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.1.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
- Quickstart
- How a setup goes
- What it sets up
- Branch rules: solo and team
- Locked rules with SeamSpec
- Keeping it current
- Checking a repository
- What SWERepo never does
- Commands
- Develop
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 by default), 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 ruleset and merge settings as code in .github/swerepo/, applied through gh; 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 | ✓ | |
| Merging | squash only | squash only |
Copilot's review needs GitHub Copilot code review on your account or organisation. Without it, pass --no-copilot-review to init: the ruleset leaves Copilot's review 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.
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, --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) |
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
Metadata
Release files for swerepo 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| swerepo-0.1.0.tar.gz | 190.1 kB | With provenance | Details for swerepo-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| swerepo-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for swerepo-0.1.0-py3-none-any.whl |
Total release size: 428.3 kB
Release files / swerepo-0.1.0.tar.gz
| Download URL | swerepo-0.1.0.tar.gz |
|---|---|
| Size | 190.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c7b20c018a40a133676396c5d2ac09141d7c26ccab09adfed4f1844307cae9b5
|
|
BLAKE2b-256 checksum How to use checksums |
597244ed6407126db72706ed8f3455bb185756a86ae1cee511e748a25aacba61
|
| 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 4, 2026.
Transparency logRelease files / swerepo-0.1.0-py3-none-any.whl
| Download URL | swerepo-0.1.0-py3-none-any.whl |
|---|---|
| Size | 238.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e07bae56f6ef75eea819dda2e99dedd925fe731369360acef2a8a1d147acd42f
|
|
BLAKE2b-256 checksum How to use checksums |
e18d723e5f036b79951619bc9f66453a93d4ed534b870a912dca0f471702f2be
|
| 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 4, 2026.
Transparency logSecurity for swerepo 0.1.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.
Attestation for swerepo-0.1.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 4, 2026.
Transparency logA 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.