Announcement
At the start of execution, always post a visible message to the user:
"Loaded skill: implement-issue. Starting workflow..."
Inputs
Use this skill when the user provides:
issue_number (story/sub-issue), e.g. 48
parent_issue_number (epic/parent), e.g. 45
Optional but recommended:
- Repository owner/name if not inferable from git remote.
Goal
Execute the full story workflow for a GitHub issue:
- prepare the base branch via the prepare-base skill,
- read and orient from the issue,
- check dependencies are unblocked,
- create a correctly named feature branch from the base branch,
- implement the requirements,
- verify implementation via the verify-implementation skill,
- open a PR targeting the base branch.
Procedure
0) Gather inputs
Before doing anything else:
- If
issue_number was not provided, ask: "What is the issue number to implement?"
- If
parent_issue_number was not provided, ask: "What is the parent epic issue number?"
- Do not proceed until both values are confirmed.
0.5) Prepare base branch
- Invoke the
prepare-base skill.
- Allow
prepare-base to ask for and checkout the base branch independently.
- Do not pass or assume a base branch — let the user confirm it within
prepare-base.
- After
prepare-base completes, origin/{base_branch} has been fetched and
is current. The current local branch may or may not be base_branch itself
(if another worktree already had it checked out, prepare-base will have
stayed on the prior branch and relied on the fetched remote ref instead —
this is expected and does not block the next step).
1) Read and orient
Read issue #{issue_number} fully. The issue follows the structure defined
in .github/ISSUE_TEMPLATE/sub-issue.md.
Ignore completely:
## Post-Implementation Summary
Extract and internalize the following before writing any code:
issue_title
milestone_title — from the issue's assigned GitHub milestone, if any.
Used only for the PR --milestone flag in step 6; omit that flag entirely
if the issue has no milestone assigned (expected for [Bug] and
[Tech Debt] issues).
- IT codes — from
## Epic Reference > Acceptance Criteria Covered (e.g. 48IT1)
- UC codes — from
## Acceptance Criteria (G/W/T) (e.g. 48UC1)
- Constraints — read
## Context & Constraints in full. Note every
pattern, convention, and restriction listed. These are non-negotiable during
implementation; do not deviate without raising it with the user first.
- Functional requirements — read
## Functional Requirements. These are
the observable behaviours the implementation must deliver. Use them as the
primary implementation checklist.
- Domain & Data — read
## Domain & Data. Understand the entities, their
relevant fields, and the business rules before touching any domain code.
- API / Interface Contract — read
## API / Interface Contract. The
endpoint signatures, payloads, and error cases described here are the agreed
contract. Do not alter them during implementation.
- Out of Scope — read
## Out of Scope. This is a hard implementation
boundary alongside Functional Requirements; do not implement anything listed
here.
- Notes — read
## Notes last, if present. This section contains edge
cases, security considerations, and deliberate deferrals that must not be
missed or overridden.
docs/coding-standards.md — git, commit, and PR conventions.
docs/coding-standards-backend.md — if any backend scope is detected in
the issue labels or content.
docs/coding-standards-frontend.md — if any frontend scope is detected in
the issue labels or content.
src/.editorconfig — if backend scope.
frontend/.editorconfig — if frontend scope.
If any requirement is ambiguous or two sections appear to conflict, ask a
clarifying question before coding. Do not resolve ambiguity by assumption.
1.5) Dependency gate (HARD STOP)
Check ## Context & Constraints for any Related issues: Depends on #X (or similarly phrased blocking references).
For every such dependency, check the issue's status.
If ANY blocked issue is not closed:
- Stop immediately.
- Output: "Blocked dependency detected: #X is not closed. Implementation cannot proceed."
- Do not load standards, create a branch, write code, or run verification.
2) Orient in the codebase
Before writing any code, explore the existing codebase to understand how to
map the issue's requirements to actual files and structure:
- Locate the layer boundaries described in
## Context & Constraints — find
the existing directories and files that correspond to each layer.
- Identify the patterns to follow (service classes, middleware, naming
conventions) by reading 2–3 representative existing files in the relevant
areas.
- For stories with
layer: frontend: read ## Page Architecture and identify
existing component patterns the new screens should follow.
- If the codebase structure is unclear or no analogous code exists, state your
understanding to the user and ask for confirmation before proceeding.
The goal of this step is to arrive at a clear mental map of where each
requirement will land, without having written a single line yet.
3) Create feature branch
- Determine the branch prefix from the issue's labels:
type: feature →
feature/, type: bug → bug/, type: tech-debt → tech-debt/.
- Create branch
{prefix}/{issue_number}-{slug} from origin/{base_branch}
(git checkout -b {prefix}/{issue_number}-{slug} origin/{base_branch}),
never from current HEAD — this keeps the branch point correct even when
another worktree's local copy of base_branch is stale or the branch
wasn't checked out locally in step 0.5. Slug per the rule in
docs/coding-standards.md (kebab-case, derived from the issue title, max 5
words). No milestone number in the branch name.
4) Implement
- Implement all functional requirements from
## Functional Requirements,
honouring the constraints from ## Context & Constraints, the boundaries
from ## Out of Scope, and the contracts from ## API / Interface Contract.
- For each UC code: write the corresponding test — one test per UC, named to
reflect the G/W/T behaviour it verifies.
- Backend UC codes: xUnit tests tagged
[Trait("AC", "{code}")] using the
exact code as it appears in the issue body (e.g. [Trait("AC", "48UC1")]).
- Frontend UC codes: vitest service tests (mock fetch, no DOM) in
frontend/src/services/__tests__/. Install vitest if not present
(npm install -D vitest). Register any new tag in frontend/vitest.config.ts's
tags array (name + description), same as every existing tag.
- For each IT code: write an xUnit integration test tagged
[Trait("AC", "{code}")] using the exact code as it appears in the issue
body (e.g. [Trait("AC", "45IT1")]) — IT codes carry the epic's issue
number, already resolved in the text; do not recompute it.
- If
## Acceptance Criteria (G/W/T) has no entries, no unit/frontend tests are required for this story. IT code coverage from ## Epic Reference > Acceptance Criteria Covered is independent of this and still applies if present.
- Update
README.md if behaviour, setup, usage, or documentation are affected.
- Build:
dotnet build src/PanoramaMusic.slnx
- Format check:
dotnet format src/PanoramaMusic.slnx --verify-no-changes
- Test:
dotnet test src/PanoramaMusic.Tests
- Run frontend checks (lint, typecheck, vitest) if story has frontend scope.
- Fix all failures before proceeding.
5) Verify implementation (gauntlet loop)
Commit your work before verifying. Then run up to 3 verify cycles.
For each cycle, invoke verify-implementation in a sub-agent, passing:
issue_number
base_branch
mode: subagent
cycle — 1, 2, or 3
prev_verify_sha — the VERIFIED_SHA from the previous cycle (omit on
cycle 1)
prev_report — the previous cycle's report (omit on cycle 1)
Act on the verdict:
PASS — proceed to step 6. Warnings are advisory; address any you agree
with, or leave them.
BLOCKED (n) — for each blocker, either fix it and commit, or mark it
invalid with a reason. Carry both into the next cycle's prev_report — fixed
items so verify can confirm them, invalid items annotated
INVALID: {reason} so verify can adjudicate. Do not mark an item invalid to
avoid work; the reason must cite the issue, the codebase, or a standards doc.
NEEDS_HUMAN (n) — stop. Present the open questions and disputed
findings to the developer. Once the developer rules, record the decision as
RESOLVED_BY: developer in prev_report, apply any required fix, and resume
the loop. Settled items are never re-raised.
If cycle 3 does not return PASS, stop and hand the outstanding report to the
developer. Do not proceed to step 6.
6) Open PR
- Ask: "Are you ready to post a pull request?"
- If yes: proceed with commit, push, and PR creation.
- If no: stop and wait.
- Commit and format the PR following conventions in
docs/coding-standards.md.
- Push feature branch.
- Use
milestone_title extracted in step 1, if any.
- Create PR using
gh pr create with:
--base base_branch
--title "{issue_title} (#{issue_number})"
--milestone "{milestone_title}" — omit this flag entirely if the
issue has no milestone assigned (expected for [Bug]/[Tech Debt]
issues). Never invent a milestone.
--body including:
- brief overview of what changed
Closes #{issue_number}
- milestone name as a readable line, if one is assigned
- Do not rely on post-creation edits — set milestone and issue reference at
creation time.
Guardrails
- Never proceed if dependencies are blocked.
- Do not use force push or destructive git history commands unless explicitly
requested.
- Do not amend commits unless explicitly requested.
- Preserve unrelated local changes in working tree.
- Do not deviate from patterns or constraints listed in
## Context & Constraints without raising it with the user first.
- Never implement outside
## Functional Requirements / ## Out of Scope.
- Never assume missing information.
- The verify loop is capped at 3 cycles.
implement-issue owns the count;
verify-implementation is stateless.
- Never dismiss a verify blocker silently. Fix it, or mark it invalid with a
cited reason and let verify adjudicate.
- Keep communication concise and actionable.
1---2name: implement-issue3description: Load this skill when the user says "implement issue", "implement-issue", or "/implement-issue". Implements a GitHub story issue end-to-end: prepares base branch, creates feature branch, implements the requirements, verifies via the verify-implementation skill, and opens a PR.4license: MIT5---67## Announcement89At the start of execution, always post a visible message to the user:1011> "Loaded skill: **implement-issue**. Starting workflow..."1213## Inputs1415Use this skill when the user provides:1617- `issue_number` (story/sub-issue), e.g. `48`18- `parent_issue_number` (epic/parent), e.g. `45`1920Optional but recommended:2122- Repository owner/name if not inferable from git remote.2324## Goal2526Execute the full story workflow for a GitHub issue:271) prepare the base branch via the prepare-base skill,282) read and orient from the issue,293) check dependencies are unblocked,304) create a correctly named feature branch from the base branch,315) implement the requirements,326) verify implementation via the verify-implementation skill,337) open a PR targeting the base branch.3435## Procedure3637### 0) Gather inputs3839Before doing anything else:4041- If `issue_number` was not provided, ask: "What is the issue number to implement?"42- If `parent_issue_number` was not provided, ask: "What is the parent epic issue number?"43- Do not proceed until both values are confirmed.4445### 0.5) Prepare base branch4647- Invoke the `prepare-base` skill.48- Allow `prepare-base` to ask for and checkout the base branch independently.49- Do not pass or assume a base branch — let the user confirm it within `prepare-base`.50- After `prepare-base` completes, `origin/{base_branch}` has been fetched and51 is current. The current local branch may or may not be `base_branch` itself52 (if another worktree already had it checked out, `prepare-base` will have53 stayed on the prior branch and relied on the fetched remote ref instead —54 this is expected and does not block the next step).5556### 1) Read and orient5758Read issue `#{issue_number}` fully. The issue follows the structure defined59in `.github/ISSUE_TEMPLATE/sub-issue.md`.6061Ignore completely:6263- `## Post-Implementation Summary`6465Extract and internalize the following before writing any code:6667- `issue_title`68- `milestone_title` — from the issue's assigned GitHub milestone, if any.69 Used only for the PR `--milestone` flag in step 6; omit that flag entirely70 if the issue has no milestone assigned (expected for `[Bug]` and71 `[Tech Debt]` issues).72- IT codes — from `## Epic Reference > Acceptance Criteria Covered` (e.g. `48IT1`)73- UC codes — from `## Acceptance Criteria (G/W/T)` (e.g. `48UC1`)74- **Constraints** — read `## Context & Constraints` in full. Note every75 pattern, convention, and restriction listed. These are non-negotiable during76 implementation; do not deviate without raising it with the user first.77- **Functional requirements** — read `## Functional Requirements`. These are78 the observable behaviours the implementation must deliver. Use them as the79 primary implementation checklist.80- **Domain & Data** — read `## Domain & Data`. Understand the entities, their81 relevant fields, and the business rules before touching any domain code.82- **API / Interface Contract** — read `## API / Interface Contract`. The83 endpoint signatures, payloads, and error cases described here are the agreed84 contract. Do not alter them during implementation.85- **Out of Scope** — read `## Out of Scope`. This is a hard implementation86 boundary alongside Functional Requirements; do not implement anything listed87 here.88- **Notes** — read `## Notes` last, if present. This section contains edge89 cases, security considerations, and deliberate deferrals that must not be90 missed or overridden.91- `docs/coding-standards.md` — git, commit, and PR conventions.92- `docs/coding-standards-backend.md` — if any backend scope is detected in93 the issue labels or content.94- `docs/coding-standards-frontend.md` — if any frontend scope is detected in95 the issue labels or content.96- `src/.editorconfig` — if backend scope.97- `frontend/.editorconfig` — if frontend scope.9899If any requirement is ambiguous or two sections appear to conflict, ask a100clarifying question before coding. Do not resolve ambiguity by assumption.101102### 1.5) Dependency gate (HARD STOP)103104Check `## Context & Constraints` for any `Related issues: Depends on #X` (or similarly phrased blocking references).105106For every such dependency, check the issue's status.107108If ANY blocked issue is not closed:109110- Stop immediately.111- Output: "Blocked dependency detected: #X is not closed. Implementation cannot proceed."112- Do not load standards, create a branch, write code, or run verification.113114### 2) Orient in the codebase115116Before writing any code, explore the existing codebase to understand how to117map the issue's requirements to actual files and structure:118119- Locate the layer boundaries described in `## Context & Constraints` — find120 the existing directories and files that correspond to each layer.121- Identify the patterns to follow (service classes, middleware, naming122 conventions) by reading 2–3 representative existing files in the relevant123 areas.124- For stories with `layer: frontend`: read `## Page Architecture` and identify125 existing component patterns the new screens should follow.126- If the codebase structure is unclear or no analogous code exists, state your127 understanding to the user and ask for confirmation before proceeding.128129The goal of this step is to arrive at a clear mental map of where each130requirement will land, without having written a single line yet.131132### 3) Create feature branch133134- Determine the branch prefix from the issue's labels: `type: feature` →135 `feature/`, `type: bug` → `bug/`, `type: tech-debt` → `tech-debt/`.136- Create branch `{prefix}/{issue_number}-{slug}` from `origin/{base_branch}`137 (`git checkout -b {prefix}/{issue_number}-{slug} origin/{base_branch}`),138 never from current HEAD — this keeps the branch point correct even when139 another worktree's local copy of `base_branch` is stale or the branch140 wasn't checked out locally in step 0.5. Slug per the rule in141 `docs/coding-standards.md` (kebab-case, derived from the issue title, max 5142 words). No milestone number in the branch name.143144### 4) Implement145146- Implement all functional requirements from `## Functional Requirements`,147 honouring the constraints from `## Context & Constraints`, the boundaries148 from `## Out of Scope`, and the contracts from `## API / Interface Contract`.149- For each UC code: write the corresponding test — one test per UC, named to150 reflect the G/W/T behaviour it verifies.151 - Backend UC codes: xUnit tests tagged `[Trait("AC", "{code}")]` using the152 exact code as it appears in the issue body (e.g. `[Trait("AC", "48UC1")]`).153 - Frontend UC codes: vitest service tests (mock fetch, no DOM) in154 `frontend/src/services/__tests__/`. Install vitest if not present155 (`npm install -D vitest`). Register any new tag in `frontend/vitest.config.ts`'s156 `tags` array (name + description), same as every existing tag.157- For each IT code: write an xUnit integration test tagged158 `[Trait("AC", "{code}")]` using the exact code as it appears in the issue159 body (e.g. `[Trait("AC", "45IT1")]`) — IT codes carry the **epic's** issue160 number, already resolved in the text; do not recompute it.161- If `## Acceptance Criteria (G/W/T)` has no entries, no unit/frontend tests are required for this story. IT code coverage from `## Epic Reference > Acceptance Criteria Covered` is independent of this and still applies if present.162- Update `README.md` if behaviour, setup, usage, or documentation are affected.163- Build: `dotnet build src/PanoramaMusic.slnx`164- Format check: `dotnet format src/PanoramaMusic.slnx --verify-no-changes`165- Test: `dotnet test src/PanoramaMusic.Tests`166- Run frontend checks (lint, typecheck, vitest) if story has frontend scope.167- Fix all failures before proceeding.168169### 5) Verify implementation (gauntlet loop)170171Commit your work before verifying. Then run up to **3** verify cycles.172173For each cycle, invoke `verify-implementation` in a sub-agent, passing:174175- `issue_number`176- `base_branch`177- `mode: subagent`178- `cycle` — 1, 2, or 3179- `prev_verify_sha` — the `VERIFIED_SHA` from the previous cycle (omit on180 cycle 1)181- `prev_report` — the previous cycle's report (omit on cycle 1)182183Act on the verdict:184185- **`PASS`** — proceed to step 6. Warnings are advisory; address any you agree186 with, or leave them.187- **`BLOCKED (n)`** — for each blocker, either fix it and commit, or mark it188 invalid with a reason. Carry both into the next cycle's `prev_report` — fixed189 items so verify can confirm them, invalid items annotated190 `INVALID: {reason}` so verify can adjudicate. Do not mark an item invalid to191 avoid work; the reason must cite the issue, the codebase, or a standards doc.192- **`NEEDS_HUMAN (n)`** — stop. Present the open questions and disputed193 findings to the developer. Once the developer rules, record the decision as194 `RESOLVED_BY: developer` in `prev_report`, apply any required fix, and resume195 the loop. Settled items are never re-raised.196197If cycle 3 does not return `PASS`, stop and hand the outstanding report to the198developer. Do not proceed to step 6.199200### 6) Open PR201202- Ask: "Are you ready to post a pull request?"203- If yes: proceed with commit, push, and PR creation.204- If no: stop and wait.205- Commit and format the PR following conventions in `docs/coding-standards.md`.206- Push feature branch.207- Use `milestone_title` extracted in step 1, if any.208- Create PR using `gh pr create` with:209 - `--base base_branch`210 - `--title "{issue_title} (#{issue_number})"`211 - `--milestone "{milestone_title}"` — **omit this flag entirely** if the212 issue has no milestone assigned (expected for `[Bug]`/`[Tech Debt]`213 issues). Never invent a milestone.214 - `--body` including:215 - brief overview of what changed216 - `Closes #{issue_number}`217 - milestone name as a readable line, if one is assigned218- Do not rely on post-creation edits — set milestone and issue reference at219 creation time.220221## Guardrails222223- Never proceed if dependencies are blocked.224- Do not use force push or destructive git history commands unless explicitly225 requested.226- Do not amend commits unless explicitly requested.227- Preserve unrelated local changes in working tree.228- Do not deviate from patterns or constraints listed in `## Context &229 Constraints` without raising it with the user first.230- Never implement outside `## Functional Requirements` / `## Out of Scope`.231- Never assume missing information.232- The verify loop is capped at 3 cycles. `implement-issue` owns the count;233 `verify-implementation` is stateless.234- Never dismiss a verify blocker silently. Fix it, or mark it invalid with a235 cited reason and let verify adjudicate.236- Keep communication concise and actionable.