Skip to main content

SWERepo

Set up a repository the way an AI-assisted team should work, and keep it that way.

SWERepo brings a new or existing Python repository on GitHub up to one engineering standard, and keeps it there:

  • CI with a single required check;
  • branch rules with code review;
  • decision records and a progress log;
  • instructions every AI coding agent reads;
  • rules you approve, locked with tests through SeamSpec.

It shows its plan before it changes anything, never overwrites your own work, and changes GitHub only after you say yes.

Status: 0.2.0, Alpha. The standard may still change before 1.0. The full design is in SWEREPO-SPEC.md.

SWERepo is an independent project. It is not part of, or endorsed by, SWE-agent, SWE-bench or Open SWE.

Contents

Install

You need For
Python 3.11 or later SWERepo itself
uv the projects it sets up: CI installs and tests them with uv
GitHub CLI (gh), logged in anything on GitHub: reading the repository, applying branch rules and settings
SeamSpec (optional) locked rules
uv tool install swerepo
uv tool install seamspec==0.1.2   # optional: for locked rules

Quickstart

In your repository, in a terminal:

swerepo check     # what the repository meets, misses or has changed; reads only
swerepo init      # set it up: shows the plan, asks, then writes
swerepo update    # later: bring what SWERepo wrote up to the current standard

init and update print their plan first; --dry-run prints it and stops. Without a terminal, init and update apply only with --yes, and change GitHub only with --yes --apply-github.

How a setup goes

An existing repository

 swerepo init
   │
   ├─ a new branch: swerepo-setup, from your freshly fetched default branch
   ├─ a few questions: editors, security contact, mode, code owner, SeamSpec, test files with fake keys
   ├─ the plan: every file it creates, every block it adds, every GitHub change
   │
   ├─ your yes ──► files written on swerepo-setup (yours kept: SWERepo only adds)
   ├─ GitHub, each change asked first:
   │     merge settings ............................ applied now
   │     Dependabot alerts, then security updates .. applied now
   │     branch ruleset ............................ waits: it needs swerepo-ci.yml on main
   ├─ SeamSpec set up; four hygiene rules proposed for your review
   │
   └─ What's left:
         1. commit on swerepo-setup
         2. one ready command: push, and open the pull request
            (title and description filled in: gh asks nothing)
         ───────── merge the pull request once CI is green ─────────
         3. swerepo init --only github   ► the branch ruleset, now that CI is on main

Why the ruleset waits: it requires the ci-ok check. Applied before swerepo-ci.yml is on the default branch, it would block every pull request, the setup pull request included. Merge settings and Dependabot can't block anything, so they come in the first run; with Dependabot alerts on, the dependency graph is on too, so CI's dependency review passes on the setup pull request.

A new repository

 swerepo init                      (no commits yet, maybe no GitHub repository)
   ├─ files written on your default branch
   └─ What's left:
         1. commit them on main: the one commit that goes straight to it
         2. gh repo create --source . --push      (or git push, to an empty repository)
         3. swerepo init --only github            ► branch ruleset, merge settings, Dependabot

What it sets up

Six components. Each is optional: --only ci,github picks some, --no-seamspec leaves one out.

Component What you get
docs SPEC.md (what the project does), decision records in docs/adr/ with a generated index, a progress log (docs/PROGRESS.md and one entry per change in docs/progress/), CHANGELOG.md, CONTRIBUTING.md
agents AGENTS.md with the working rules and the project's commands, read by Cursor, VS Code Copilot and Antigravity; CLAUDE.md (Claude Code) and GEMINI.md (Antigravity, Gemini CLI) pointing to it, only for the editors you use; four runbooks for agents in docs/agents/
ci .github/workflows/swerepo-ci.yml, and ruff and pytest settings in a marked block at the end of pyproject.toml where you have none: lint (ruff, your own linters, or a gradual move to ruff for a codebase never linted), tests on every Python version requires-python allows, macOS on pushes, a workflow audit (zizmor), dependency review, SeamSpec's locked rules, Copilot's review, and one required check, ci-ok, which fails if any job didn't do what it should
security SECURITY.md (GitHub's private vulnerability reporting on a public repository; else an email address or a link to your team's page), a privacy scan for personal email addresses, home-folder paths and obvious secrets (by file and line, never what was found), run in CI by .github/workflows/swerepo-privacy.yml, a .gitignore block, and swerepo hook install for a pre-push hook that refuses such a push
github the branch rulesets and merge settings as code in .github/swerepo/, applied through gh; Dependabot's alerts and security updates, private vulnerability reporting, secret scanning and push protection, each turned on after your yes; Dependabot (each new version once it is a week old; Python's minor and patch updates as one pull request); Copilot review instructions; pull request and issue templates; CODEOWNERS for governance files
seamspec SeamSpec set up for your editors, four hygiene rules proposed (no personal data, the ADR index, the changelog's [Unreleased], CI still running the tests), and docs/EARNED_SPEC.md, the readable list of the rules in force

Your own files are never replaced: where one exists, SWERepo adds its block at the end (for example, in AGENTS.md or .gitignore), or keeps it and says so. The one edit inside a file of yours: where SeamSpec is set up, .seamspec is added to your own ruff settings' extend-exclude, so ruff never touches locked tests.

Branch rules: solo and team

Rule solo team
Changes only through pull requests ✓ ✓
ci-ok must pass ✓ ✓
No force pushes, no deleting the default branch ✓ ✓
Copilot reviews each pull request, and every review thread is resolved ✓ ✓
One approving review, stale approvals dismissed on push ✓
Code-owner review of governance files ✓
Copilot reviews every push (CI waits for the latest commit's review) off by default ✓
Merging squash only squash only

Copilot's review needs GitHub Copilot code review on your account or organisation. init looks for signs of it on GitHub (Copilot's rules, its settings, or its reviews on recent pull requests) and, in a terminal, asks with what it found as the default; --copilot-review or --no-copilot-review decides without asking. Without Copilot's review, the ruleset leaves it out (in solo, the thread rule too), and CI doesn't wait for a review that would never come. Otherwise, once the ruleset is applied, CI's copilot-review job waits up to 20 minutes on every pull request and then fails, saying whether Copilot was asked at all. --copilot-review-on-push or --no-copilot-review-on-push chooses whether Copilot reviews every push. Where Copilot's review depends on each person's own licence or credits, answer no: a pull request whose author has none left would wait 20 minutes and fail.

Protected develop and release branches: --protected-branches develop,release protects them beside the default branch. Feature branches start from develop and are squash-merged into it; develop is merged into release with a merge commit (a second ruleset, swerepo-release, allows merge commits only). Every workflow runs on pushes to each of them, and each ruleset is applied once swerepo-ci.yml has reached its branches.

The default follows who owns the repository: solo for a personal account, team for an organisation (--mode changes it). Merged branches are kept or deleted as your repository already does. Rulesets need a public repository, or a paid plan for a private one; check says so when they can't be enforced.

Locked rules with SeamSpec

 SWERepo proposes a rule (or you, or your agent)   e.g. "no personal email addresses in tracked files"
   │   each rule is a plain sentence plus a test
   ▼
 seamspec review          you read the rule and its test, and approve or reject it: only a person approves
   │
   ▼
 locked                   the test runs when an agent finishes, before every commit, and in CI
   │
   ├─ a change breaks it ──► the commit or the pull request is stopped
   └─ the rule must change ──► a supersede, which you approve the same way
   │
 seamspec spec --out docs/EARNED_SPEC.md     the readable list of what is locked

After approving rules, refresh the earned spec before committing; CI checks it's current. SWERepo's "What's left" and check both say so.

Keeping it current

 swerepo update
   ├─ files SWERepo wrote and nobody changed ........ rewritten to the current templates
   ├─ files you edited .............................. three-way merge, shown first, applied after your yes
   ├─ a conflict, or an earlier version it can't rebuild ... left alone, and reported
   └─ never deletes a file, never touches one SWERepo didn't write
 swerepo diff      what update would change in the files you edited
 swerepo status    the components set up, the mode, and each file's state

Like init, update ends with one ready command for its pull request, on a branch of your own.

Checking a repository

swerepo check reports, per component, what a repository meets (✓), misses (✗), has changed (~) or could update (↑), and ends with what to do next. It only reads: no file is written, and GitHub is read only through gh, with GET requests.

swerepo check                 # on your machine: files, and GitHub's live settings against the committed ones
swerepo check --json          # the same, for scripts and agents
swerepo check --ci            # in GitHub Actions: annotations, no GitHub API calls
swerepo check --base main     # the pull-request rules: a progress entry; an ADR for a new dependency or a workflow change

In repositories set up with a released SWERepo, CI's governance job runs swerepo check --ci on each pull request.

What SWERepo never does

  • commit, push, merge, or open a pull request for you: it gives you the commands;
  • change GitHub without your yes in a terminal, or --yes --apply-github;
  • replace or delete a file of yours;
  • approve a locked rule, or answer another tool's consent question for you;
  • install a tool or change your project's dependencies;
  • repeat a secret, an email address or a path it found: findings name the file and line only.

Commands

Command What it does
swerepo init set a repository up (--only, --no-<component>, --mode, --code-owner, --no-copilot-review, --copilot-review-on-push, --protected-branches, --editors, --dry-run, --yes, --apply-github, --json)
swerepo check report what the repository meets and misses (--only, --json, --ci, --base)
swerepo update (-u) bring what SWERepo wrote up to the current standard (--only, --dry-run, --yes, --merge, --apply-github, --protected-branches)
swerepo diff the merge update would make in files you edited
swerepo status components, mode, versions, and files by state
swerepo adr new "Title" / adr index a new decision record from the template; regenerate the ADR index
swerepo progress Now, Next and the latest progress entries
swerepo threads <pr> a pull request's open review threads, read-only
swerepo privacy the privacy scan, on its own
swerepo hook install the pre-push privacy hook

swerepo <command> --help gives the details.

Develop

git clone https://github.com/swerepo/swerepo.git && cd swerepo
uv sync
uv run pytest && uv run ruff check . && uv run ruff format --check . && uv run seamspec verify --all

SWERepo follows the standard it installs: branches and pull requests, an ADR for each decision, a progress entry for each change, and locked rules. See CONTRIBUTING.md.

License

Apache-2.0

Metadata

Release files for swerepo 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for swerepo 0.2.0
File Size Uploaded Provenance Actions
swerepo-0.2.0.tar.gz 207.7 kB With provenance Details for swerepo-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for swerepo 0.2.0
File Interpreter ABI Platform Actions
swerepo-0.2.0-py3-none-any.whl Python 3 none any Details for swerepo-0.2.0-py3-none-any.whl

Total release size: 474.4 kB

Release files / swerepo-0.2.0.tar.gz

Download URL swerepo-0.2.0.tar.gz
Size 207.7 kB
Tags Source
SHA-256 checksum
How to use checksums
82383ecf0bc77f84a5b9bd1be8883cba831edb74554a7ee99835b39da50cb712
BLAKE2b-256 checksum
How to use checksums
5bfb6d41f709d797c5d72c023375e74737de580f3fc624421e4d3331ea3a9ce2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

Release files / swerepo-0.2.0-py3-none-any.whl

Download URL swerepo-0.2.0-py3-none-any.whl
Size 266.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2abfb2632b9d833c5e1842a2c411377f19831de511e1aaef6bdac70424eee50
BLAKE2b-256 checksum
How to use checksums
62be6cbd06b9c4ed7cbaff8b15c9ef37cd3dc04ea7f8f6b285717b64bccd1fd8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

Security for swerepo 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for swerepo-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page