Repo Issue Orchestrator
Coordinate one prepared GitHub repository's ready-for-agent issue queue through completion.
Use this after planning is complete. Assume the user has already run grill-with-docs, setup-skills, to-prd, and to-issues, unless evidence shows the repo is missing that setup.
This is a control-plane skill: inspect queue, choose the next issue, enforce TDD/proof/review gates, ask owner decisions, and report. It does not create PRDs or implementation issues by default.
Always obey global AGENTS.md first: git safety, secrets safety, public GitHub body safety, permission boundaries, no destructive operations without explicit approval, and autoreview before non-trivial push/land.
Use Extra High reasoning for the orchestrator. Tell worker agents to use Medium or High reasoning based on task complexity.
Repository Scope
- Work in exactly one repository: the current git repo or the GitHub repo URL named by the user.
- Do not scan unrelated repositories.
- Do not create a portfolio ledger.
- Do not manage releases unless the user explicitly asks for release work.
- Treat PRD issues as planning context, not implementation work.
- Treat implementation issues labeled
ready-for-agent as the main work queue.
- Re-check repository state before each issue: current branch, dirty files, open PRs, and latest issue state.
Setup Is Assumed
Do not run planning/setup skills unless the repo is missing required setup or the user explicitly asks.
Skip by default:
grill-with-docs
setup-skills
to-prd
to-issues
If setup appears missing, stop and report exactly what is missing instead of silently creating planning artifacts.
Required ready state:
- repo has usable
AGENTS.md or equivalent agent instructions;
- repo issue workflow is configured in
docs/agents/* when present;
- PRD/context issue exists when the work came from planning;
- implementation issues exist and are labeled
ready-for-agent;
- local checkout is safe to work in.
Operating Model
Verify repo readiness.
- Confirm current repo or user-provided GitHub repo.
- Read repo
AGENTS.md.
- Read
docs/agents/* when present.
- Read PRD/context issue if linked or obvious.
- Run
git status -sb.
- Stop if repo state is unsafe.
Load issue queue.
- Use
github-project-triage to inspect open issues, labels, blockers, PR overlap, CI state, and risk.
- Prefer issues labeled
ready-for-agent.
- Treat PRD issues as context, not implementation work.
Classify open issues.
Autonomous: clear fit, bounded implementation, usable test/proof path, no product decision needed.
Needs owner: product choice, missing credential/access, missing live proof, destructive/irreversible choice, or unclear domain decision.
Context only: PRD, meta issue, planning issue, or issue superseded by implementation issues.
Blocked: depends on another issue, failing prerequisite, missing external service, or unsafe repo state.
Pick one issue.
- Pick only one issue at a time.
- Prefer dependency order from issue bodies over title order.
- Prefer unblocked foundational vertical slices.
- If several are plausible, recommend one with reason.
Use github-deep-review before coding.
- Read full issue body and comments.
- Check current
main.
- Confirm issue is still valid.
- Identify relevant code path.
- Decide best bounded fix.
- Define required tests, proof, and live validation.
Use oracle only when needed.
- Use for unclear design, refactor, or issue-split tradeoffs.
- Treat output as advisory and verify it.
Use create-cli only when issue touches CLI behavior.
- Args, flags, config, dry-run, output, help text, and errors.
Implement with mandatory tdd.
- All development work must follow red-green-refactor unless the issue is docs-only, metadata-only, or test-only.
- Write one behavior test first.
- Confirm it fails for the expected reason.
- Implement the smallest change that passes.
- Repeat one behavior at a time.
- Refactor only while green.
- Test through public interfaces, not implementation details.
- If no automated test can fit, state why before coding and define replacement proof.
Use github-deep-review again when issue is subtle.
- Ask whether the final patch actually resolves the issue.
- Verify no stale assumptions remain.
Run autoreview.
- Required before non-trivial commit, push, PR update, or land.
- Fix accepted/actionable findings.
- Rerun focused tests and review if code changes.
- Commit scoped changes.
- Commit only changes for the current issue.
- Use Conventional Commits.
- Update GitHub only when authorized.
- Push only when user asked.
- Create or update PR only when user asked.
- Rerun/fix CI only when user asked.
- Merge only when user asked.
- Close issue only when user asked or the repo workflow explicitly authorizes it.
- Refresh and repeat.
- Return to expected branch.
- Pull/update safely when allowed.
- Reload issue queue.
- Pick next unblocked issue.
Continue until every ready-for-agent issue is completed, blocked behind an owner decision, or unsafe to continue.
Decision-Ready Queue Rule
Do not ask the owner to decide from an unprepared issue.
- Existing issue with no implementation: investigate, confirm validity, identify best bounded candidate, implement if authorized, test, prove, review, and prepare a commit/PR before asking for land/delete.
- Existing PR: inspect, reproduce, rewrite/fix as needed, add tests, run proof and
autoreview, and get CI green before asking for land/delete.
- Product decision: choose a reversible technical default when safe, but ask when behavior, policy, privacy, or user-facing semantics are unclear.
- Access or live-proof blocker: finish code, tests, docs, review, and CI first. Ask only for the exact missing credential, account action, browser step, waiver, or land/delete decision.
Normal owner interaction should be one of:
- continue with issue
<URL>;
- land prepared PR
<URL>;
- delete or close prepared PR/issue
<URL>;
- provide one exact access step;
- choose documented option A/B;
- approve explicit proof waiver.
Owner Decision Briefs
Never ask for approval, access, waiver, land, delete, or product choice with only a URL.
Immediately before asking, refresh the issue/PR and local repo state. Do not repeat a question already answered.
Every owner decision request must include:
- full canonical GitHub URL and title;
- plain-language explanation of what changes and who benefits;
- why the decision is needed now;
- completed proof: reproduction, tests, live proof,
autoreview, CI, and mergeability where applicable;
- material tradeoffs, residual risks, scope concerns, or missing evidence;
- recommendation and concise rationale;
- exact choices available and what each choice does.
If autonomous work remains, do that work first instead of asking prematurely.
Authorization
Treat triage, implementation, push, PR update, CI rerun/fix, merge, close, and release as separate permissions.
- Queue analysis does not authorize edits.
- Implementation permission authorizes local changes and verification only.
- Push permission does not imply merge or close permission.
- CI rerun/fix permission must be explicit.
- Merge/close permission must be explicit.
- Release, version bump, tag, registry publish, and GitHub Release require a current explicit release request.
Without required permission, stop at the last authorized boundary and report the exact next action.
Credential Access
Before reporting a credential blocker:
- Check only the exact expected environment variable.
- Use it only if already exported.
- Use the user's approved secret workflow if available.
- Never broadly enumerate secrets or print values.
- Ask the owner only after the targeted path is absent, inaccessible, or requires approval.
Report only presence, access path, and exact missing approval. Never paste credentials into issues, PRs, commits, or logs.
Issue Work Contract
For each selected implementation issue:
- read full issue discussion, repo instructions, docs, and relevant code;
- read PRD/context issue if this issue was generated from one;
- establish root cause or implementation seam before coding;
- use
github-deep-review before coding;
- use
oracle only for real uncertainty;
- use
create-cli only for CLI-facing work;
- implement with mandatory
tdd;
- add regression coverage when appropriate;
- run focused tests and broader project checks as appropriate;
- run live/end-to-end proof against the changed user path when runtime behavior changes;
- run
autoreview until no accepted/actionable findings remain;
- commit scoped changes;
- push/update PR only when authorized;
- close issue only when authorized;
- return to expected clean branch state before the next issue.
TDD Gate
Every development issue must have a TDD plan before implementation.
Required before coding:
- identify public behavior under test;
- choose first behavior test;
- state expected failing reason;
- run the test and see it fail, unless test infrastructure itself must be added first.
Allowed exceptions:
- docs-only issue;
- metadata-only issue;
- test-only issue;
- no feasible automated seam exists.
For exceptions, write replacement proof before coding:
- exact manual/live proof path;
- commands to run;
- expected observable behavior;
- risk left uncovered by automation.
Do not write broad implementation first and tests after. If code already exists before the TDD gate, stop, write the next failing behavior test, and continue from there.
Live Proof Gate
Live proof is a pre-push/pre-land requirement for runtime behavior changes.
- Test the final candidate through the changed user path using the real built artifact and realistic service/account/browser/device boundary when applicable.
- Mocks, fixtures, screenshots of source, route existence, and CI supplement live proof; they do not replace it when real runtime behavior changed.
- Redact secrets and private user data while keeping concrete evidence: command, behavior, response class, artifact hash, screenshot path, or observed state transition.
- If live proof is unavailable, finish code, tests, review, and CI first. Then ask for exact access, an explicit issue-specific waiver, or a reject/defer decision.
- Re-run live proof after fixes that change the relevant runtime path.
- Pure docs, metadata, CI, or test-only changes may use closest workflow/build proof; state why no runtime boundary applies.
GitHub Body Safety
For issue comments, PR bodies, or close comments:
- use temp files and
--body-file when text contains backticks, shell snippets, env names, or user-provided text;
- fetch existing bodies into temp files before editing;
- inspect body files before public writes;
- stop if quoting or literal
\n output looks wrong.
Queue Closeout
An issue is complete only when one of these is true:
- implementation PR is prepared with proof and owner must choose land/delete;
- issue is fixed, tested, reviewed, pushed/closed within granted permissions;
- issue is blocked with exact owner decision/access needed;
- issue is superseded by another issue/PR with proof and close permission exists;
- issue is not ready for agent work and should be moved out of
ready-for-agent.
After each issue, report:
- issue URL;
- status: completed, PR ready, blocked, deferred, or not-ready;
- changed behavior;
- tests/proof run;
autoreview result;
- commit/PR URL if created;
- next recommended issue.
Reporting
Always use full canonical GitHub URLs. Never report only #123.
For queue status, group items as:
Active: current issue and phase.
Ready next: next recommended unblocked issue.
Needs owner: exact decision/access required.
Blocked: issue and blocker.
Completed: issue, proof, PR/commit/close state.
Report meaningful changes, not routine polling.
1---2name: repo-issue-orchestrator3description: Finish ready-for-agent issues in one prepared GitHub repo after PRD/issues/setup exist: triage queue, deep-review each issue, implement with TDD, prove, autoreview, commit, and repeat.4---56# Repo Issue Orchestrator78Coordinate one prepared GitHub repository's `ready-for-agent` issue queue through completion.910Use this after planning is complete. Assume the user has already run `grill-with-docs`, `setup-skills`, `to-prd`, and `to-issues`, unless evidence shows the repo is missing that setup.1112This is a control-plane skill: inspect queue, choose the next issue, enforce TDD/proof/review gates, ask owner decisions, and report. It does not create PRDs or implementation issues by default.1314Always obey global `AGENTS.md` first: git safety, secrets safety, public GitHub body safety, permission boundaries, no destructive operations without explicit approval, and `autoreview` before non-trivial push/land.1516Use Extra High reasoning for the orchestrator. Tell worker agents to use Medium or High reasoning based on task complexity.1718## Repository Scope1920- Work in exactly one repository: the current git repo or the GitHub repo URL named by the user.21- Do not scan unrelated repositories.22- Do not create a portfolio ledger.23- Do not manage releases unless the user explicitly asks for release work.24- Treat PRD issues as planning context, not implementation work.25- Treat implementation issues labeled `ready-for-agent` as the main work queue.26- Re-check repository state before each issue: current branch, dirty files, open PRs, and latest issue state.2728## Setup Is Assumed2930Do not run planning/setup skills unless the repo is missing required setup or the user explicitly asks.3132Skip by default:3334- `grill-with-docs`35- `setup-skills`36- `to-prd`37- `to-issues`3839If setup appears missing, stop and report exactly what is missing instead of silently creating planning artifacts.4041Required ready state:4243- repo has usable `AGENTS.md` or equivalent agent instructions;44- repo issue workflow is configured in `docs/agents/*` when present;45- PRD/context issue exists when the work came from planning;46- implementation issues exist and are labeled `ready-for-agent`;47- local checkout is safe to work in.4849## Operating Model50511. Verify repo readiness.52 - Confirm current repo or user-provided GitHub repo.53 - Read repo `AGENTS.md`.54 - Read `docs/agents/*` when present.55 - Read PRD/context issue if linked or obvious.56 - Run `git status -sb`.57 - Stop if repo state is unsafe.58592. Load issue queue.60 - Use `github-project-triage` to inspect open issues, labels, blockers, PR overlap, CI state, and risk.61 - Prefer issues labeled `ready-for-agent`.62 - Treat PRD issues as context, not implementation work.63643. Classify open issues.65 - `Autonomous`: clear fit, bounded implementation, usable test/proof path, no product decision needed.66 - `Needs owner`: product choice, missing credential/access, missing live proof, destructive/irreversible choice, or unclear domain decision.67 - `Context only`: PRD, meta issue, planning issue, or issue superseded by implementation issues.68 - `Blocked`: depends on another issue, failing prerequisite, missing external service, or unsafe repo state.69704. Pick one issue.71 - Pick only one issue at a time.72 - Prefer dependency order from issue bodies over title order.73 - Prefer unblocked foundational vertical slices.74 - If several are plausible, recommend one with reason.75765. Use `github-deep-review` before coding.77 - Read full issue body and comments.78 - Check current `main`.79 - Confirm issue is still valid.80 - Identify relevant code path.81 - Decide best bounded fix.82 - Define required tests, proof, and live validation.83846. Use `oracle` only when needed.85 - Use for unclear design, refactor, or issue-split tradeoffs.86 - Treat output as advisory and verify it.87887. Use `create-cli` only when issue touches CLI behavior.89 - Args, flags, config, dry-run, output, help text, and errors.90918. Implement with mandatory `tdd`.92 - All development work must follow red-green-refactor unless the issue is docs-only, metadata-only, or test-only.93 - Write one behavior test first.94 - Confirm it fails for the expected reason.95 - Implement the smallest change that passes.96 - Repeat one behavior at a time.97 - Refactor only while green.98 - Test through public interfaces, not implementation details.99 - If no automated test can fit, state why before coding and define replacement proof.1001019. Use `github-deep-review` again when issue is subtle.102 - Ask whether the final patch actually resolves the issue.103 - Verify no stale assumptions remain.10410510. Run `autoreview`.106 - Required before non-trivial commit, push, PR update, or land.107 - Fix accepted/actionable findings.108 - Rerun focused tests and review if code changes.10911011. Commit scoped changes.111 - Commit only changes for the current issue.112 - Use Conventional Commits.11311412. Update GitHub only when authorized.115 - Push only when user asked.116 - Create or update PR only when user asked.117 - Rerun/fix CI only when user asked.118 - Merge only when user asked.119 - Close issue only when user asked or the repo workflow explicitly authorizes it.12012113. Refresh and repeat.122 - Return to expected branch.123 - Pull/update safely when allowed.124 - Reload issue queue.125 - Pick next unblocked issue.126127Continue until every `ready-for-agent` issue is completed, blocked behind an owner decision, or unsafe to continue.128129## Decision-Ready Queue Rule130131Do not ask the owner to decide from an unprepared issue.132133- Existing issue with no implementation: investigate, confirm validity, identify best bounded candidate, implement if authorized, test, prove, review, and prepare a commit/PR before asking for land/delete.134- Existing PR: inspect, reproduce, rewrite/fix as needed, add tests, run proof and `autoreview`, and get CI green before asking for land/delete.135- Product decision: choose a reversible technical default when safe, but ask when behavior, policy, privacy, or user-facing semantics are unclear.136- Access or live-proof blocker: finish code, tests, docs, review, and CI first. Ask only for the exact missing credential, account action, browser step, waiver, or land/delete decision.137138Normal owner interaction should be one of:139140- continue with issue `<URL>`;141- land prepared PR `<URL>`;142- delete or close prepared PR/issue `<URL>`;143- provide one exact access step;144- choose documented option A/B;145- approve explicit proof waiver.146147## Owner Decision Briefs148149Never ask for approval, access, waiver, land, delete, or product choice with only a URL.150151Immediately before asking, refresh the issue/PR and local repo state. Do not repeat a question already answered.152153Every owner decision request must include:154155- full canonical GitHub URL and title;156- plain-language explanation of what changes and who benefits;157- why the decision is needed now;158- completed proof: reproduction, tests, live proof, `autoreview`, CI, and mergeability where applicable;159- material tradeoffs, residual risks, scope concerns, or missing evidence;160- recommendation and concise rationale;161- exact choices available and what each choice does.162163If autonomous work remains, do that work first instead of asking prematurely.164165## Authorization166167Treat triage, implementation, push, PR update, CI rerun/fix, merge, close, and release as separate permissions.168169- Queue analysis does not authorize edits.170- Implementation permission authorizes local changes and verification only.171- Push permission does not imply merge or close permission.172- CI rerun/fix permission must be explicit.173- Merge/close permission must be explicit.174- Release, version bump, tag, registry publish, and GitHub Release require a current explicit release request.175176Without required permission, stop at the last authorized boundary and report the exact next action.177178## Credential Access179180Before reporting a credential blocker:1811821. Check only the exact expected environment variable.1832. Use it only if already exported.1843. Use the user's approved secret workflow if available.1854. Never broadly enumerate secrets or print values.1865. Ask the owner only after the targeted path is absent, inaccessible, or requires approval.187188Report only presence, access path, and exact missing approval. Never paste credentials into issues, PRs, commits, or logs.189190## Issue Work Contract191192For each selected implementation issue:193194- read full issue discussion, repo instructions, docs, and relevant code;195- read PRD/context issue if this issue was generated from one;196- establish root cause or implementation seam before coding;197- use `github-deep-review` before coding;198- use `oracle` only for real uncertainty;199- use `create-cli` only for CLI-facing work;200- implement with mandatory `tdd`;201- add regression coverage when appropriate;202- run focused tests and broader project checks as appropriate;203- run live/end-to-end proof against the changed user path when runtime behavior changes;204- run `autoreview` until no accepted/actionable findings remain;205- commit scoped changes;206- push/update PR only when authorized;207- close issue only when authorized;208- return to expected clean branch state before the next issue.209210## TDD Gate211212Every development issue must have a TDD plan before implementation.213214Required before coding:215216- identify public behavior under test;217- choose first behavior test;218- state expected failing reason;219- run the test and see it fail, unless test infrastructure itself must be added first.220221Allowed exceptions:222223- docs-only issue;224- metadata-only issue;225- test-only issue;226- no feasible automated seam exists.227228For exceptions, write replacement proof before coding:229230- exact manual/live proof path;231- commands to run;232- expected observable behavior;233- risk left uncovered by automation.234235Do not write broad implementation first and tests after. If code already exists before the TDD gate, stop, write the next failing behavior test, and continue from there.236237## Live Proof Gate238239Live proof is a pre-push/pre-land requirement for runtime behavior changes.240241- Test the final candidate through the changed user path using the real built artifact and realistic service/account/browser/device boundary when applicable.242- Mocks, fixtures, screenshots of source, route existence, and CI supplement live proof; they do not replace it when real runtime behavior changed.243- Redact secrets and private user data while keeping concrete evidence: command, behavior, response class, artifact hash, screenshot path, or observed state transition.244- If live proof is unavailable, finish code, tests, review, and CI first. Then ask for exact access, an explicit issue-specific waiver, or a reject/defer decision.245- Re-run live proof after fixes that change the relevant runtime path.246- Pure docs, metadata, CI, or test-only changes may use closest workflow/build proof; state why no runtime boundary applies.247248## GitHub Body Safety249250For issue comments, PR bodies, or close comments:251252- use temp files and `--body-file` when text contains backticks, shell snippets, env names, or user-provided text;253- fetch existing bodies into temp files before editing;254- inspect body files before public writes;255- stop if quoting or literal `\n` output looks wrong.256257## Queue Closeout258259An issue is complete only when one of these is true:260261- implementation PR is prepared with proof and owner must choose land/delete;262- issue is fixed, tested, reviewed, pushed/closed within granted permissions;263- issue is blocked with exact owner decision/access needed;264- issue is superseded by another issue/PR with proof and close permission exists;265- issue is not ready for agent work and should be moved out of `ready-for-agent`.266267After each issue, report:268269- issue URL;270- status: completed, PR ready, blocked, deferred, or not-ready;271- changed behavior;272- tests/proof run;273- `autoreview` result;274- commit/PR URL if created;275- next recommended issue.276277## Reporting278279Always use full canonical GitHub URLs. Never report only `#123`.280281For queue status, group items as:282283- `Active`: current issue and phase.284- `Ready next`: next recommended unblocked issue.285- `Needs owner`: exact decision/access required.286- `Blocked`: issue and blocker.287- `Completed`: issue, proof, PR/commit/close state.288289Report meaningful changes, not routine polling.