Implement Issue
Implement exactly one GitHub issue in the current checkout. Stay local: do not create worktrees, Docker containers, branches, pull requests, labels, issue comments, pushes, or issue closes.
Intake
- Require exactly one GitHub issue number from the user. If it is missing or ambiguous, ask for the issue number and stop.
- Read repository instructions before editing: root
AGENTS.md, nested AGENTS.md files that apply to touched paths, and any domain or issue-tracker docs those files name.
- Fetch the issue packet with
gh issue view <number> --comments. Also fetch labels or structured fields if needed to understand status.
- Search the issue body and comments for parent PRD references. Fetch every referenced parent PRD issue with
gh issue view <number> --comments.
- Work on the current branch only. Do not create or switch branches.
- Infer the base branch from a user-provided base, the branch upstream, or the repository default branch.
- Before writing, run
git status --short, git log --oneline <base>..HEAD, and inspect any existing diff from <base>...HEAD. Continue partial work already present; do not restart or redo completed work.
Intake is complete when the issue packet, parent PRD context, repo instructions, base branch, working-tree state, and existing branch changes are understood.
Scope
- Treat the GitHub issue, linked PRD, existing tests, and repo instructions as the approved behavior list. Do not pause for plan approval unless the issue packet is contradictory or missing required context.
- Work on one issue only. If another issue appears necessary, report it as follow-up instead of implementing it.
- Preserve unrelated local changes. Stage and commit only files relevant to the issue.
- Do not leave commented-out code or TODO comments in committed code.
- Do not mutate GitHub. On blockers, print a concise blocker report and a draft issue comment instead of posting it.
Workflow
Explore.
Read the issue packet, parent PRD, relevant source, and relevant tests before editing.
Completion: the expected behavior, affected public interfaces, and nearest tests are identified.
Plan.
Choose the smallest implementation that satisfies the issue. Name the first behavior test to add or change.
Completion: there is a narrow edit plan tied to issue or PRD requirements.
Execute with a red-green loop.
Use $tdd when available, but override its interactive approval gates: the issue packet is the approval source. Write one failing behavior test through a public interface, implement enough to pass it, then repeat. Do not invent new seams only to make testing easier.
Completion: every required behavior from the issue packet is represented by passing behavior tests or explicitly justified as already covered.
Verify.
Follow the repo's AGENTS.md test workflow. Prefer the smallest meaningful test scope first, then broaden only when the changed surface justifies it. For Python repos, run the repo-approved syntax or type check; when src and tests exist and repo instructions do not specify otherwise, use uv run python -m compileall -q src tests. Do not run full training, W&B-backed commands, Docker validation, or broad/full suites unless repo instructions, the changed surface, or the user explicitly requires it.
Completion: targeted tests and required syntax/type checks pass, or failures are diagnosed as blockers.
Commit locally.
Review git diff, git status --short, and staged files before committing. Commit only relevant changes. Do not use a RALPH: prefix. Use this commit shape:
Issue #<number>: <imperative summary>
Issue: #<number> <title>
PRD: #<number> <title> # omit if none
Decisions:
- <key decision>
Files:
- <important file or area>
Verification:
- <command run>
Risk:
- <residual risk or "None known">
Completion: a local commit exists on the current branch and contains only this issue's relevant changes.
Stop.
After a successful commit, output the commit hash and commands run. Do not start another issue.
Blocked Path
If required context is missing, tests fail for reasons you cannot fix, dependencies are unavailable, or the issue cannot be completed safely:
- Do not commit partial work unless it is a useful local checkpoint and clearly described as incomplete.
- Do not post to GitHub.
- Output
BLOCKED, the blocker, evidence gathered, commands run, and a draft issue comment the user can post.
1---2name: implement-issue3description: Implement one GitHub issue in the current checkout using the issue, comments, linked PRD, existing branch work, TDD, repo validation rules, and a local commit. User-invoked only; require an explicit issue number.4license: MIT5---67# Implement Issue89Implement exactly one GitHub issue in the current checkout. Stay local: do not create worktrees, Docker containers, branches, pull requests, labels, issue comments, pushes, or issue closes.1011## Intake12131. Require exactly one GitHub issue number from the user. If it is missing or ambiguous, ask for the issue number and stop.142. Read repository instructions before editing: root `AGENTS.md`, nested `AGENTS.md` files that apply to touched paths, and any domain or issue-tracker docs those files name.153. Fetch the issue packet with `gh issue view <number> --comments`. Also fetch labels or structured fields if needed to understand status.164. Search the issue body and comments for parent PRD references. Fetch every referenced parent PRD issue with `gh issue view <number> --comments`.175. Work on the current branch only. Do not create or switch branches.186. Infer the base branch from a user-provided base, the branch upstream, or the repository default branch.197. Before writing, run `git status --short`, `git log --oneline <base>..HEAD`, and inspect any existing diff from `<base>...HEAD`. Continue partial work already present; do not restart or redo completed work.2021Intake is complete when the issue packet, parent PRD context, repo instructions, base branch, working-tree state, and existing branch changes are understood.2223## Scope2425- Treat the GitHub issue, linked PRD, existing tests, and repo instructions as the approved behavior list. Do not pause for plan approval unless the issue packet is contradictory or missing required context.26- Work on one issue only. If another issue appears necessary, report it as follow-up instead of implementing it.27- Preserve unrelated local changes. Stage and commit only files relevant to the issue.28- Do not leave commented-out code or TODO comments in committed code.29- Do not mutate GitHub. On blockers, print a concise blocker report and a draft issue comment instead of posting it.3031## Workflow32331. Explore.34 Read the issue packet, parent PRD, relevant source, and relevant tests before editing.35 Completion: the expected behavior, affected public interfaces, and nearest tests are identified.36372. Plan.38 Choose the smallest implementation that satisfies the issue. Name the first behavior test to add or change.39 Completion: there is a narrow edit plan tied to issue or PRD requirements.40413. Execute with a red-green loop.42 Use `$tdd` when available, but override its interactive approval gates: the issue packet is the approval source. Write one failing behavior test through a public interface, implement enough to pass it, then repeat. Do not invent new seams only to make testing easier.43 Completion: every required behavior from the issue packet is represented by passing behavior tests or explicitly justified as already covered.44454. Verify.46 Follow the repo's `AGENTS.md` test workflow. Prefer the smallest meaningful test scope first, then broaden only when the changed surface justifies it. For Python repos, run the repo-approved syntax or type check; when `src` and `tests` exist and repo instructions do not specify otherwise, use `uv run python -m compileall -q src tests`. Do not run full training, W&B-backed commands, Docker validation, or broad/full suites unless repo instructions, the changed surface, or the user explicitly requires it.47 Completion: targeted tests and required syntax/type checks pass, or failures are diagnosed as blockers.48495. Commit locally.50 Review `git diff`, `git status --short`, and staged files before committing. Commit only relevant changes. Do not use a `RALPH:` prefix. Use this commit shape:5152 ```text53 Issue #<number>: <imperative summary>5455 Issue: #<number> <title>56 PRD: #<number> <title> # omit if none57 Decisions:58 - <key decision>59 Files:60 - <important file or area>61 Verification:62 - <command run>63 Risk:64 - <residual risk or "None known">65 ```6667 Completion: a local commit exists on the current branch and contains only this issue's relevant changes.68696. Stop.70 After a successful commit, output the commit hash and commands run. Do not start another issue.7172## Blocked Path7374If required context is missing, tests fail for reasons you cannot fix, dependencies are unavailable, or the issue cannot be completed safely:75761. Do not commit partial work unless it is a useful local checkpoint and clearly described as incomplete.772. Do not post to GitHub.783. Output `BLOCKED`, the blocker, evidence gathered, commands run, and a draft issue comment the user can post.