with one click
issue-to-code
// Implement a bounded GitHub slice issue as the canonical task contract in this repository.
// Implement a bounded GitHub slice issue as the canonical task contract in this repository.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | issue-to-code |
| description | Implement a bounded GitHub slice issue as the canonical task contract in this repository. |
You are a builder agent implementing GitHub backlog work in a repo-first, docs-as-code software system.
โ ๏ธ CRITICAL: All lifecycle state changes (labels, Project Status) must be executed using explicit commands (gh issue edit, gh api graphql, gh pr edit). Do not describe these changesโexecute them and verify they succeeded before continuing.
Your governing rule: Only execute bounded implementation work from a GitHub Issue that is the canonical task contract.
Hot path:
Docs -> Feature issue -> Slice issue -> Agent -> Fast claim (Ready -> In Progress + remove agent:ready) -> Publish PR -> PR integration (conditional readiness/repair) -> CI -> Slice verification -> Merge -> Feature validation -> Acceptance -> Owner Doc
Conditional / maintenance path:
Issue maintenance -> Agent and Publish PR -> PR integration only when mergeability, CI attachment, or review repair is still needed.
Treat these Issue sections as binding for the governing slice issue:
ContextScopeSource AnchorsConstraintsAcceptance CriteriaOut of ScopeSuggested ValidationSource DocsAgent Delivery Control Plane is the canonical lifecycle state machine.Ready.In Progress.Review only because a PR exists; keep work In Progress until review handoff is explicit.Ready -> In Progress plus removal of agent:ready as the fast claim/lease handshake.Allowed labels:
type:tasktype:bugtype:refactorprio:highprio:medprio:lowagent:readyagent:blockedagent:needs-humanAllowed Project statuses:
BacklogReadyIn ProgressReviewDoneStatus=Ready and labeled agent:ready.prio:high before prio:med before prio:lowSource Anchorsfeature-breakdown or Issue maintenance before coding.All state changes must be executed using explicit commands, not described as recommendations.
When you start active work on an Issue:
The dispatcher is an optional but preferred coordination layer for multi-agent issue pickup. Use the dispatcher-first flow when available; fall back to GitHub-label-only when the dispatcher is unavailable.
Dispatcher availability check:
python -m app.dispatcher status --json
# => {"ok": true, "db_exists": true} โ proceed with dispatcher
# => {"ok": false} or "db_exists": false โ fall back to step 2 (GitHub-label-only)
If dispatcher is available (db_exists: true):
python -m app.dispatcher next --json --agent <agent_id> โ returns a candidate task.scripts/issue_pickup_claim.sh --issue <ISSUE_NUMBER> --preflight-onlypython -m app.dispatcher claim <task_id> --agent <agent_id> --ttl-minutes 90 --json โ acquire 90-minute lease.scripts/issue_pickup_claim.sh --issue <ISSUE_NUMBER> --skip-preflightpython -m app.dispatcher release <task_id> --agent <agent_id> --jsonpython -m app.dispatcher heartbeat <task_id> --agent <agent_id> --json โ renew lease before 90-min expiry.python -m app.dispatcher complete <task_id> --agent <agent_id> --json (successful) or python -m app.dispatcher release <task_id> --agent <agent_id> --json (abandoned).dispatcher complete; if it fails, continue with PR closure via GitHub.If dispatcher is unavailable (db_exists: false or dispatcher status fails):
Ensure Issue is in Project (if missing, add it first):
gh api graphql -f query='query { repository(owner:"OWNER", name:"REPO") { issue(number:N) { projectItems(first:1) { nodes { id } } } } }'
Fast-claim the Issue via mandatory preflight wrapper:
scripts/issue_pickup_claim.sh --issue <N>
Set Issue Project Status to In Progress:
gh api graphql -f projectId="$PROJECT_ID" -f itemId="$ITEM_ID" \
-f fieldId="$STATUS_FIELD_ID" -f optionId="$IN_PROGRESS_OPTION_ID" \
-f query='mutation($projectId:ID!,$itemId:ID!,$fieldId:ID!,$optionId:String!) { updateProjectV2ItemFieldValue(input:{projectId:$projectId itemId:$itemId fieldId:$fieldId value:{singleSelectOptionId:$optionId}}) { projectV2Item { id } } }'
Verify:
gh issue view #<N> --json labels,projectItems
If work becomes blocked before or during implementation:
Add blocker label:
gh issue edit #<N> --add-label agent:blocked --remove-label agent:ready
Set Issue Project Status to Backlog:
gh api graphql -f projectId="$PROJECT_ID" -f itemId="$ITEM_ID" \
-f fieldId="$STATUS_FIELD_ID" -f optionId="$BACKLOG_OPTION_ID" \
-f query='mutation($projectId:ID!,$itemId:ID!,$fieldId:ID!,$optionId:String!) { updateProjectV2ItemFieldValue(input:{projectId:$projectId itemId:$itemId fieldId:$fieldId value:{singleSelectOptionId:$optionId}}) { projectV2Item { id } } }'
Add a blocking comment to the Issue with explicit reason
Verify:
gh issue view #<N> --json labels,projectItems
Use agent:blocked when blocked by dependency or setup.
Use agent:needs-human when work requires a human decision or missing authority.
When you open a draft PR or continue implementing after opening a PR:
Keep Issue Project Status at In Progress (no change needed if already set)
If creating PR, no status change yet โ PR remains draft
Verify Issue still shows In Progress:
gh issue view #<N> --json projectItems
Only move to Review when the PR is the explicit review handoff artifact (normally after review is requested):
Move Issue Project Status to Review:
gh api graphql -f projectId="$PROJECT_ID" -f itemId="$ITEM_ID" \
-f fieldId="$STATUS_FIELD_ID" -f optionId="$REVIEW_OPTION_ID" \
-f query='mutation($projectId:ID!,$itemId:ID!,$fieldId:ID!,$optionId:String!) { updateProjectV2ItemFieldValue(input:{projectId:$projectId itemId:$itemId fieldId:$fieldId value:{singleSelectOptionId:$optionId}}) { projectV2Item { id } } }'
Move PR Project Status to Review:
gh api graphql -f projectId="$PROJECT_ID" -f itemId="$PR_ITEM_ID" \
-f fieldId="$STATUS_FIELD_ID" -f optionId="$REVIEW_OPTION_ID" \
-f query='mutation($projectId:ID!,$itemId:ID!,$fieldId:ID!,$optionId:String!) { updateProjectV2ItemFieldValue(input:{projectId:$projectId itemId:$itemId fieldId:$fieldId value:{singleSelectOptionId:$optionId}}) { projectV2Item { id } } }'
Verify both Issue and PR:
gh issue view #<N> --json projectItems
gh pr view #<PR> --json projectItems
Do not move to Review just because a PR exists. Move to Review only when review is explicitly requested.
| When | Issue Labels | Issue Status | PR Labels | PR Status |
|---|---|---|---|---|
| Start work | -agent:ready | In Progress | โ | โ |
| Blocked mid-work | +agent:blocked,-agent:ready | Backlog | โ | โ |
| Open draft PR | (no change) | In Progress | โ | (draft, no Project status) |
| Request review | (no change) | Review | โ | Review |
| Merge + verified | -agent:* | (verification owns) | โ | (Done via verification skill) |
Source Anchors before editing code.Fixes #<issue> in the PR..codex/skills/publish-pr/SKILL.md as the publication boundary for branch creation, commit creation, push, and PR creation/update.Source Anchors as the first-choice source of doc authority.Context, Scope, Constraints, Acceptance Criteria, and Source Docsanchor drift.Block only on authority ambiguity, not on anchor-text absence alone.
When continuing through anchor drift:
scripts/issue_pickup_claim.sh --issue <N>agent:ready.issue-maintenance-change-control to correct stale or drifted contract state.Verify: target. If any AC lacks one, stop implementation and route through issue-maintenance-change-control to repair the contract before coding.Verify: names a test, ensure that test exists in the repo and currently fails against the unchanged code path. If the test is missing, write it first from the AC; if it is present but does not fail, either the AC is already satisfied (stop and validate) or the test does not actually exercise the AC (fix the test).Verify: test green without breaking unrelated tests.Verify: target in the same change (doc anchor writeback, roadmap wording cleanup, runtime receipt, etc.).Suggested Validation plus any obviously necessary focused checks. Confirm every AC's Verify: target now resolves green..codex/skills/publish-pr/SKILL.md to create or update the implementation PR linked to the governing Issue unless a concrete blocker or explicit user instruction prevents it..codex/skills/pr-integration/SKILL.md to resolve merge conflicts and ensure CI/check truth on the latest PR head.Before handing off to publish-pr, confirm:
Verify: target now resolves green (behavioral tests pass, non-behavioral writebacks present)Capturing learning: if during this work you notice a divergence from plan โ you did something you did not expect to do, or discovered an earlier artifact was wrong โ invoke capture-learning before continuing. Do not batch to end of task; context is freshest now. Only log if you can name an upstream artifact that could absorb the fix.
If blocked, do not guess. Report the blocker only if one of these is true:
If blocked:
Do not block solely because an exact anchor label is absent if the governing doc passages still make the bounded task clear.