$npx -y skills add vouchdev/vouch --skill auto-prUse when the user invokes /auto-pr <repo-url> or asks to "open N PRs against <repo>", "auto-contribute to <repo>", or "raise mergeable PRs automatically". Wraps the vouch auto-pr CLI: points at any github repo, learns its contribution norms (from shipped guidance, else synthe
| 1 | # auto-pr |
| 2 | |
| 3 | **Goal:** point at any github repo and open N *mergeable* PRs — not N PRs. |
| 4 | each one resolves a real issue (or a genuine discovered improvement), passes |
| 5 | the repo's own test gate locally, and is signed off by a second engine before |
| 6 | it ever reaches a maintainer. |
| 7 | |
| 8 | this is a thin orchestration layer over the `vouch auto-pr` CLI. it is a |
| 9 | sibling tool to the knowledge base: it never writes to storage / proposals / |
| 10 | the audit log, and the review gate is untouched. |
| 11 | |
| 12 | ## invocation |
| 13 | |
| 14 | ``` |
| 15 | vouch auto-pr <repo-url> \ |
| 16 | --workspace <dir> --count <N> \ |
| 17 | --claude-effort <low|medium|high|max> \ |
| 18 | --codex-effort <low|medium|high|max> \ |
| 19 | [--issue-label good-first-issue] \ |
| 20 | [--fork-owner <login>] \ |
| 21 | [--max-revise 2] [--autonomy edit|full] \ |
| 22 | [--dry-run] [--json] |
| 23 | ``` |
| 24 | |
| 25 | `<repo-url>` may be `https://github.com/<owner>/<name>`, |
| 26 | `git@github.com:<owner>/<name>.git`, or the `<owner>/<name>` shorthand. |
| 27 | |
| 28 | output: the URLs of the PRs that were actually opened (one per line, or a JSON |
| 29 | array under `--json`). attempts that fail verification are reported on stderr |
| 30 | as *skipped* with a reason — they are never opened. **M genuine PRs beats N |
| 31 | shaky ones**; partial success is the intended behaviour, not an error. |
| 32 | |
| 33 | ## prerequisites |
| 34 | |
| 35 | - **`gh` CLI** authenticated for the target repo (`gh auth status` returns a |
| 36 | session). used for fork/clone, issue listing, dedup search, and PR creation. |
| 37 | - **`claude`** (Claude Code) and **`codex`** on `PATH` — both engines are used; |
| 38 | one fixes while the other reviews, alternating per PR. |
| 39 | - **`vouch` CLI** on `PATH` (`pip install vouch-kb`). |
| 40 | |
| 41 | if `claude` or `codex` is missing, **stop and tell the user** — cross-verify is |
| 42 | the whole point; don't silently fall back to a single engine. |
| 43 | |
| 44 | ## how it works (the pipeline) |
| 45 | |
| 46 | 1. **resolve workspace** — if `--workspace` is already a clone, use it; else |
| 47 | `gh repo fork --clone` (or a plain clone when you have push access). sync the |
| 48 | default branch. |
| 49 | 2. **detect-or-bootstrap guidance** — scan the repo for `CONTRIBUTING.md`, |
| 50 | `AGENTS.md`, `CLAUDE.md`, `.claude/skills/**/SKILL.md`, `.codex/`, |
| 51 | `.github/PULL_REQUEST_TEMPLATE.md`. if any exist, they become fixer/reviewer |
| 52 | context. **if none exist, fetch the repo's merged PRs and synthesize a |
| 53 | contribution `SKILL.md`**, written into the clone's `.claude/skills/` (and a |
| 54 | `.codex/` mirror) so it's reused next run. |
| 55 | 3. **source N work items** — open *unassigned* issues first (filterable by |
| 56 | `--issue-label`); if fewer than N survive dedup, let the engines discover |
| 57 | genuine bugs/improvements to fill the remainder. every candidate is |
| 58 | dedup-checked against the repo's existing PRs. |
| 59 | 4. **per item** (isolated `auto-pr/<slug>` branch): the fixer engine edits + |
| 60 | commits; the repo's own gate runs (`make check` / `pytest` / `npm test` / |
| 61 | `cargo test` / `go test`); the *other* engine reviews the diff. a red gate or |
| 62 | a rejection feeds back to the fixer for up to `--max-revise` rounds. still |
| 63 | failing ⇒ skip with a reason. passing ⇒ push to the fork and `gh pr create`. |
| 64 | |
| 65 | ## house rules it enforces |
| 66 | |
| 67 | - conventional-commit titles; lowercase prose bodies. |
| 68 | - **no `Co-Authored-By` / AI-attribution trailer** in generated commits. |
| 69 | - dedup before opening — no Nth duplicate of a tried/rejected fix. |
| 70 | - the repo's own CI-equivalent gate must be green locally before a PR opens. |
| 71 | - one logical change per PR; link/close the issue it addresses. |
| 72 | |
| 73 | ## effort levels |
| 74 | |
| 75 | `--claude-effort` / `--codex-effort` tune each engine independently: |
| 76 | |
| 77 | | level | claude model | codex reasoning | |
| 78 | |---|---|---| |
| 79 | | low | haiku | low | |
| 80 | | medium | sonnet | medium | |
| 81 | | high | opus | high | |
| 82 | | max | opus | high (codex cap) | |
| 83 | |
| 84 | (claude models are passed as aliases — `opus`/`sonnet`/`haiku` — so the tool |
| 85 | tracks the latest model in each tier. `high` and `max` both select opus; codex |
| 86 | caps reasoning effort at `high`.) |
| 87 | |
| 88 | use `high` for real contributions; drop to `low`/`medium` only for cheap |
| 89 | exploratory runs. start with `--dry-run` against a new repo to see what it |
| 90 | *would* open before spending an engine on the real thing. |
| 91 | |
| 92 | ## autonomy & safety |
| 93 | |
| 94 | the fixer drives the engines headlessly against a clone of an *untrusted* |
| 95 | third-party repo, so the default is constrained: |
| 96 | |
| 97 | - `--autonomy edit` (default) — claude `acceptEdits` (auto-accepts file edits, |
| 98 | no arbitrary command execution) and codex `--sandbox workspace-write` |
| 99 | (writes confined to the clone, no network). sufficient for most fixes, since |
| 100 | the t |