implement
Implements a single issue, creates a GitHub Issue/PR, and links them with `Closes
Instalar con Codex o Claude Copia este prompt, pรฉgalo en Codex, Claude u otro asistente, y deja que revise la pรกgina de la skill y la instale por ti.
Menรบ
Implements a single issue, creates a GitHub Issue/PR, and links them with `Closes
Instalar con Codex o Claude Copia este prompt, pรฉgalo en Codex, Claude u otro asistente, y deja que revise la pรกgina de la skill y la instale por ti.
Basado en la clasificaciรณn ocupacional SOC
Pre-meeting B2B account research. Produces a structured account brief (company overview, recent news, tech stack, decision structure hypothesis, hypothesized pain points, approach strategy). Use before /discovery-prep.
Generates a Discovery meeting plan from an account brief โ SPIN questions, MEDDIC checklist, hypothesized pain points with verification questions, objection prep, time-boxed agenda. Run after /account-brief, before the meeting.
Generates post-meeting follow-up assets โ customer-facing email draft, internal action list, CRM update fields, account_brief updates, champion status tracking. Run after any sales meeting.
Converts sales-written meeting notes (discovery type) into a PRD draft for PoC building, and updates account_brief.md with newly learned facts. The bridge between sales discovery and engineering PoC. Run after a discovery meeting, before /kickoff.
Generates a closing proposal from demo meeting notes + the actual PoC + account brief. Business-value first; technical specs in appendix. Run after a demo meeting, before contract negotiation.
Analyzes and critiques business viability. Use after /brainstorm and before /prd.
| name | implement |
| description | Implements a single issue, creates a GitHub Issue/PR, and links them with `Closes |
| argument-hint | [ISSUE-number] |
| disable-model-invocation | true |
| allowed-tools | Read, Glob, Grep, Write, Edit, Bash(bash scripts/checkpoint.sh *), Bash(bash scripts/wt_setup.sh *), Bash(bash scripts/wt_cleanup.sh *), Bash(bash scripts/registry_edit.sh *), Bash(bash scripts/flock_edit.sh *), Bash(bash scripts/worktree.sh *), Bash(python3 scripts/*), Bash(git *), Bash(gh *), Bash(bash ${CLAUDE_PLUGIN_ROOT}/scripts/*), Bash(python3 ${CLAUDE_PLUGIN_ROOT}/scripts/*) |
Kit root: ${CLAUDE_PLUGIN_ROOT}
scripts/ dir): prefix every kit script command with it, e.g.
bash <kit-root>/scripts/checkpoint.sh โฆ. Absolute paths also work from worktrees.${โฆ} placeholder above โ standalone layout: run commands as written.Run these checks silently at the start. Use results to adapt behavior:
[ -f issues.md ] โ if true, this project uses the sprint system. Respect issue numbering and STATUS.md.[ -f docs/sprint_state.md ] โ if true and Status shows running, a sprint is active. Be aware of parallel work in worktrees.[ -f docs/prd_digest.md ] โ if true, read it for quick project context before starting.gh auth status before any GitHub operation.Every phase has a checkpoint. Run the verification command and check the exit code.
ADVISORY: line (advisory gate): report the gap, self-correct, continue.
Standard prefix:bash scripts/checkpoint.sh
Append --skill <name> --phase <phase> --issue <ID> for the specific check.
checkpoint.sh resolves the main repo root internally, so the command stays
a single prefix-matchable form (safe to allowlist as Bash(bash scripts/checkpoint.sh *)).
Pipeline skills operate in git worktrees to isolate changes from main.
WT="$(bash scripts/wt_setup.sh <branch>)" โ creates the
worktree via scripts/worktree.sh create and writes .claude-kit/freeze-dir.txt
inside it in a single step.bash scripts/worktree.sh rootbash scripts/wt_cleanup.sh <branch> โ cd's to main root
inside a subshell, then removes the worktree (never leaves CWD dangling).
All file operations happen inside $WT/. Shared files live on main only.Shared files (issues.md, STATUS.md, CHANGELOG.md) are managed on main only.
Always use registry_edit.sh for concurrent-safe writes โ it resolves the
main repo root internally and delegates to flock_edit.sh:
bash scripts/registry_edit.sh issues.md -- bash -c '<update command>'
Never commit these files to feature branches.
Every phase in this skill has a CHECKPOINT block. You MUST run the verification command after completing each phase. Blocking gates (MANDATORY โ NEVER SKIP) exit non-zero on failure: STOP immediately, report, do NOT proceed. Advisory gates (ADVISORY (report & continue)) always exit 0 and print an ADVISORY: line on failure: report the gap, self-correct, then continue โ do NOT halt on them (ISSUE-031). Never skip running a checkpoint of either tier.
Path convention: Checkpoint commands use the bash scripts/checkpoint.sh wrapper, which resolves the main repo root internally (via scripts/worktree.sh root). This ensures the verification script is found regardless of whether CWD is the main repo or a worktree, and keeps the command prefix-matchable for permission allowlists.
Hard requirements:
gh issue createCloses #<issue_number> in PR body.Algorithm:
gh authenticated (gh auth status).Before reading the test plan, the issue body, or anything else, evaluate the spec gate for $ARGUMENTS. This protects against the failure mode where a non-trivial feature gets coded without any reviewable decision artifact.
0a) Parse flags: check $ARGUMENTS for --skip-spec-gate. If present, the gate logs a telemetry-style bypass note (one line printed to stdout) and proceeds to step 1. Strip the flag from $ARGUMENTS before continuing.
0b) Compute the gate decision:
python3 scripts/spec_gate.py $ARGUMENTS [--skip-spec-gate]
The script reads issues.md, detects sprint mode via KIT_SPRINT_MODE=1, scans the issue body for signals (api/schema/migration/breaking/protocol/๋ฐ์ดํฐ๋ชจ๋ธ/new-package + estimate-at-cap), and prints a JSON object with decision, reasons, signals, spec_path, sprint_mode.
0c) Branch on decision:
decision: "proceed" โ log the reasons (and signals if non-empty) inline so the user can see why the gate let it through, then continue to step 1.
decision: "auto_spec" (sprint mode, Spec-Required, no SPEC yet) โ invoke the /spec skill inline on the current branch:
KIT_SPRINT_MODE=1 so /spec knows it is being auto-invoked./spec $ARGUMENTS./spec to complete and produce docs/specs/SPEC-<NNN>.md with the Spec: field updated on the issue./spec (docs(spec): SPEC-<NNN> โ <decision summary>)./spec returns, re-run python3 scripts/spec_gate.py $ARGUMENTS to confirm the new decision is proceed. If it is still not proceed, STOP and report.decision: "hold" (non-sprint, requires user input) โ present a structured 3-way choice using the project's question mechanism (e.g., AskUserQuestion):
/spec now: invoke /spec $ARGUMENTS, then resume at step 0b (re-evaluate gate after SPEC lands).Spec-Required: field to false and append the reason to the issue's Implementation Notes; then proceed to step 1.Quote the gate's reasons and signals to the user so they understand the prompt.
decision: "bypassed" (--skip-spec-gate was passed) โ print the one-line bypass note (telemetry-style: spec_gate_bypassed issue=$ARGUMENTS) and continue.
0d) Only after Phase 0 produces a proceed-equivalent outcome does the rest of the algorithm run.
CHECKPOINT โ MANDATORY โ NEVER SKIP Run:
bash scripts/checkpoint.sh --skill implement --phase test-plan --issue $ARGUMENTSVerifiesdocs/test_plan.mdexists with a non-empty Risk Matrix. If exit code โ 0: STOP โ run/kickofffirst or create test_plan.md manually.
Locate $ARGUMENTS in issues.md. Read the issue's Goal, Scope, AC, and Implementation Notes.
Manual: true, STOP immediately. Report to the user: "This issue requires manual action โ see Implementation Notes." Do NOT proceed with automated implementation.
2a) Figma prototype upsert โ MANDATORY when Figma URLs exist:
Scan the issue's Implementation Notes for Figma URLs (pattern: figma.com/design/ or figma.com/file/).If NO Figma URLs found: skip to step 2a checkpoint.
If Figma URLs ARE found โ you MUST execute ALL of the following steps:
Determine the platform from the issue's Platform field:
mobile โ --mobiledesktop โ --desktopweb or empty โ no flag (default)
Run the fetch script with the platform flag and all extracted URLs:python3 scripts/figma_fetch.py [--mobile|--desktop] <url1> <url2> ...
If the script exits with non-zero (e.g., FIGMA_TOKEN not set, invalid URL, API error): STOP and report the error to the user. Do NOT proceed โ the issue explicitly requires Figma data.
figma_fetch.py automatically generates:
figma-export/design_data.json โ full node tree datafigma-export/figma_styles.css โ complete CSS rules (gradients, shadows, fonts, positioning, responsive, states)figma-export/component_map.json โ nodeโclassโasset mapping with html_hintfigma-export/assets/ โ downloaded SVG/PNG icons and imagesfigma-export/renders/ โ Figma-rendered reference PNGsExtract breakpoints from the issue. Read the issue's Implementation Notes or the PRD for responsive breakpoint specs (e.g., "Desktop 1400px+ / Tablet 768px+ / Mobile 360px+"). If found, pass them explicitly to the figma-converter prompt below. If not found, use the Figma frame widths as breakpoints.
Invoke the figma-converter agent (via Task) with this prompt:
You are the figma-converter agent. Read agents/figma-converter.md for your full instructions.
## Responsive Breakpoints (from project spec โ use EXACTLY these values)
{Insert the breakpoints extracted in step 3, e.g.:
- Desktop: > 1400px (default)
- Tablet: โค 1400px
- Mobile: โค 768px}
## Required Steps (do ALL of these โ a placeholder HTML is NOT acceptable)
### Step 1: Read all input files
- Read figma-export/renders/*.png (open each image โ these are your visual target)
- Read figma-export/design_data.json (full content โ contains node tree with coordinates, text, styles)
- Read figma-export/figma_styles.css (skim โ contains pre-generated CSS classes)
- Read figma-export/component_map.json (skim โ contains asset paths and html_hints)
### Step 2: Build desktop HTML
- Read frames[0].tree from design_data.json
- Frame origin: tree.x, tree.y. Element position: element.y - frame.y, element.x - frame.x
- Create a .frame container (width:100%, height:{frame_h}px)
- Background images: class="bg", width:100%, position:absolute, z-index:1
- Content wrapper: class="cw", width:{frame_w}px, left:50%, transform:translateX(-50%), z-index:3
- Every element inside cw: position:absolute, top/left from coordinates, WITH a class name
- Import figma_styles.css via <link>
- z-index layers: bg(1) โ deco(5) โ content(10) โ nav(50)
- All text from design_data.json text_content fields โ do NOT invent text
### Step 3: Add tablet @media
- **Read the issue's breakpoint spec** from issues.md or PRD โ use THOSE breakpoint values, NOT defaults
- Read frames[1].tree from design_data.json
- Write @media block with THAT frame's coordinates, font sizes, widths
- Every element that exists in frames[1] gets repositioned
- Check text_style.segments for mixed font-weights โ generate <span> tags
### Step 4: Add mobile @media
- Use the issue's breakpoint spec for mobile threshold
- Read frames[2].tree from design_data.json
- Same process as Step 3
### Step 5: Verify
- Open the HTML in browser. Compare with render PNGs.
- Scroll through entire page. Check: backgrounds visible? Text readable? Footer present?
## Output
Write to: prototype/screens/desktop.html
This must be a COMPLETE HTML file โ not a placeholder.
If you cannot complete it, explain what blocked you.
Verify the output is not a placeholder. Read the generated HTML file. If it contains "placeholder" or is less than 1KB, the figma-converter failed โ retry with the same prompt.
Do NOT skip this step when Figma URLs exist. The checkpoint below WILL fail if figma_fetch.py was not executed.
CHECKPOINT โ MANDATORY โ NEVER SKIP Run:
bash scripts/checkpoint.sh --skill implement --phase figma --issue $ARGUMENTSAuto-passes when no Figma URLs exist. Fails if Figma URLs found but design_data.json not generated. If exit code โ 0: STOP immediately and report the failure. Do NOT proceed.
2b) Gather context โ read the following docs (if they exist, skip silently if not). Read all applicable documents via parallel Read tool calls in a single message. Do NOT read them sequentially.
docs/prd_digest.md โ quick PRD context (goals, features, NFRs, scope)docs/architecture.md โ tech stack, modules, API designdocs/data_model.md โ schema, indexes, query patterns, seed data, migrationsdocs/requirements.md โ related FRs/NFRs referenced by the issuedocs/test_plan.md โ test strategy, risk matrix, critical flows to guide test writingUI: true, or contains UI keywords in Track/title):
docs/design_system.md โ CSS tokens, component specsdocs/design_philosophy.md โ aesthetic directiondocs/wireframes.md โ layout for the relevant screendocs/interactions.md โ states, transitions, animations for the relevant flowdocs/copy_guide.md โ UI labels, error messages, empty states, glossaryprototype/screens/*.html โ visual reference for the relevant screenfigma-export/skeleton.html โ complete HTML structure to copy into implementation (semantic tags, text, assets, CSS classes)figma-export/figma_styles.css โ ready-to-use CSS rules (includes responsive @media queries + :hover/:focus states)figma-export/component_map.json โ maps Figma nodes to CSS classes, asset paths (with html_hint), children orderfigma-export/assets/ โ downloaded SVG/PNG icons and images from Figmadocs/design_system_mobile.md โ React Native design tokens, component specsdocs/design_philosophy.md โ aesthetic direction (shared with web)docs/wireframes_mobile.md โ mobile layout, gestures, safe areasdocs/interactions_mobile.md โ gesture specs, haptic mapping, transitionsdocs/copy_guide.md โ UI labels, error messages (shared with web)prototype-mobile/src/screens/*.tsx โ React Native screen referenceissue/$ARGUMENTS-<slug> and write back.
bash scripts/registry_edit.sh issues.md -- bash -c '<update command>'gh issue create --title "[$ARGUMENTS] <title>" --body "<body>"bash scripts/registry_edit.sh issues.md -- bash -c '<update command>'CHECKPOINT โ ADVISORY (report & continue) Run:
bash scripts/checkpoint.sh --skill implement --phase issue --issue $ARGUMENTSAdvisory: exits 0 even on failure, printing anADVISORY:line โ report the gap, self-correct, then continue.
WT="$(bash scripts/wt_setup.sh issue/$ARGUMENTS-<slug>)"
wt_setup.sh creates the worktree via scripts/worktree.sh create and
writes .claude-kit/freeze-dir.txt inside it in a single step. All
subsequent file operations (code, tests) happen inside $WT/.
From this point, Edit/Write operations outside $WT/ will be blocked
(if /freeze or /guard hooks are active). Registry files on main
(issues.md, STATUS.md) are updated via bash scripts/registry_edit.sh
from the main repo root โ this is the only exception.CHECKPOINT โ ADVISORY (report & continue) Run:
bash scripts/checkpoint.sh --skill implement --phase worktree --issue $ARGUMENTSAdvisory: exits 0 even on failure, printing anADVISORY:line โ report the gap, self-correct, then continue.
$WT/.
This project follows TDD: write failing tests before writing implementation code.
docs/test_plan.md exists, read it. Use the Risk Matrix and Critical Flows to prioritize which scenarios to test. Map your tests to the test cases defined there (TC-NNN).test_*.py in tests/).pass-only bodies, or tests without assert/expect will be rejected at checkpoint.docs/test_plan.md Risk Matrix), write an E2E test. Web: tests/e2e/*.spec.ts. Mobile: e2e/*.yaml or e2e/*.test.ts.docs/test_plan.md exists, check that any High-risk flows affected by your changes have test coverage.CHECKPOINT โ MANDATORY โ NEVER SKIP Run:
bash scripts/checkpoint.sh --skill implement --phase tests-written --issue $ARGUMENTSIf exit code โ 0: STOP immediately and report the failure. Do NOT proceed.
CHECKPOINT โ MANDATORY โ NEVER SKIP Run:
bash scripts/checkpoint.sh --skill implement --phase red --issue $ARGUMENTSIf exit code โ 0: STOP immediately and report the failure. Do NOT proceed.
Implement minimal code inside $WT/.
Write the minimum code needed to make all tests pass. Follow existing project patterns.
Minimality gate โ walk the Decision Ladder before generating code (the developer subagent enforces this; the orchestrator must not write prompts that contradict it):
If Figma data exists (figma-export/ directory present):
prototype/screens/*.html โ this is your visual targetfigma-export/figma_styles.css โ import this CSS directlyfigma-export/component_map.json โ use class names and asset pathsfigma-export/renders/*.png โ compare your implementation against these๐ซ Structure-source prohibition (when figma-export/ exists) โ applies to BOTH this skill and any developer subagent prompt you write:
prototype/screens/*.html (generated by figma-converter from Figma) is the ONLY structural source of truth. Layout, grid, hero composition, card count, decorative elements, breakpoint thresholds โ all come from the prototype.prototype/screens/desktop.html (and tablet/mobile variants). Reproduce its structure exactly. Use other project files only as a reference for coding conventions, not for layout."CHECKPOINT โ ADVISORY (report & continue) Run:
bash scripts/checkpoint.sh --skill implement --phase code --issue $ARGUMENTSAdvisory: exits 0 even on failure, printing anADVISORY:line โ report the gap, self-correct, then continue.
$WT/.
All tests must pass. If any fail, fix the implementation (not the tests) until green.
The checkpoint also runs platform-specific gates (e2e-web, e2e-mobile, etc.) as warnings.
Gate failures don't block implementation but flag integration risks early.CHECKPOINT โ MANDATORY โ NEVER SKIP Run:
bash scripts/checkpoint.sh --skill implement --phase test --issue $ARGUMENTSIf exit code โ 0: STOP immediately and report the failure. Do NOT proceed.
9.5) Figma fidelity loop (UI issues with Figma data only โ skip if no figma-export/design_data.json):
Iteratively refine the implementation until all Figma tokens match and structure is correct.
a) Token compliance (primary โ blocking):
MAX_ITERATIONS = 3
for i in 1..MAX_ITERATIONS:
Run: python3 scripts/verify_figma_compliance.py --project-path $WT
IF exit code = 0 (all tokens match): BREAK.
IF exit code โ 0:
1. Read the violation report โ each violation shows file:line, found value, and Figma-allowed values.
2. Fix the implementation: replace wrong colors/fonts/spacings/etc. with Figma values.
3. Re-run tests to ensure fixes don't break functionality.
4. Continue loop.
IF all MAX_ITERATIONS exhausted: log remaining violations and proceed.
b) Computed style verification loop (primary โ blocking):
MAX_ITERATIONS = 3
for i in 1..MAX_ITERATIONS:
Run: python3 scripts/verify_computed_styles.py --project-path $WT
IF exit code = 0 (all computed styles match): BREAK.
IF exit code โ 0:
1. Read the violation report โ shows ACTUAL rendered values vs Figma-allowed values.
These are real computed values from the browser, not source code regex matches.
2. Fix: the violation tells you exactly which element, property, and computed value is wrong.
3. Re-run tests.
4. Continue loop.
IF all MAX_ITERATIONS exhausted: log remaining violations and proceed.
c) Structural match loop (primary โ blocking, per-viewport):
MAX_ITERATIONS = 3
for i in 1..MAX_ITERATIONS:
Run: python3 scripts/verify_structural_match.py --project-path $WT
IF exit code = 0 (all viewports matched): BREAK.
IF exit code โ 0:
1. Read the per-viewport report. Each violation shows:
- Which viewport (desktop/tablet/mobile) has missing elements
- Missing element types (buttons, inputs, icons, navigation)
- Missing text content (copy from Figma not found)
- Missing responsive CSS (@media queries for each breakpoint)
2. Fix the implementation:
- Add missing elements for each viewport
- Add @media queries for tablet/mobile breakpoints
- Ensure responsive behavior matches Figma's per-viewport design
3. Re-run tests to ensure fixes don't break functionality.
4. Continue loop.
IF all MAX_ITERATIONS exhausted: log remaining violations and proceed.
c) Layout verification loop (primary โ blocking):
MAX_ITERATIONS = 3
for i in 1..MAX_ITERATIONS:
Run: python3 scripts/verify_layout.py --project-path $WT
IF exit code = 0 (layout matches): BREAK.
IF exit code โ 0:
1. Read the violation report:
- Wrong direction: "sidebar should be row but has flex-direction: column"
- Wrong order: "nav should be left-of content but appears after it"
2. Fix: adjust flex-direction, reorder DOM elements, fix container structure
3. Re-run tests.
4. Continue loop.
IF all MAX_ITERATIONS exhausted: log remaining violations and proceed.
e) Same-renderer visual diff (blocking โ prototype HTML vs implementation, both Chromium):
Run: python3 scripts/verify_visual_diff.py --project-path $WT --threshold 1
IF exit code โ 0: read diff images, fix visible layout/style issues, re-run.
Both prototype and implementation are rendered by the same Chromium engine, so there are no font hinting or anti-aliasing false positives.
f) Visual diff advisory (non-blocking):
Run: python3 scripts/verify_visual_diff.py --project-path $WT --threshold 5
Generates diff images in figma-export/visual-diff/ for visual inspection.
Do NOT block on pixel diff โ it's an advisory signal due to renderer differences (Figma vs Chromium).
If diff > 5%: review the diff images and fix obvious layout issues.
$WT/).CHECKPOINT โ ADVISORY (report & continue) Run:
bash scripts/checkpoint.sh --skill implement --phase push --issue $ARGUMENTSAdvisory: exits 0 even on failure, printing anADVISORY:line โ report the gap, self-correct, then continue.
[$ARGUMENTS] <title>Closes #<issue_number>CHECKPOINT โ ADVISORY (report & continue) Run:
bash scripts/checkpoint.sh --skill implement --phase pr --issue $ARGUMENTSAdvisory: exits 0 even on failure, printing anADVISORY:line โ report the gap, self-correct, then continue.
registry_edit.sh โ it resolves the main repo root internally so
you never have to build paths via command substitution:bash scripts/registry_edit.sh issues.md -- bash -c '<update command>'
bash scripts/registry_edit.sh STATUS.md -- bash -c '<update command>'
CHECKPOINT โ ADVISORY (report & continue) Run:
bash scripts/checkpoint.sh --skill implement --phase registry --issue $ARGUMENTSAdvisory: exits 0 even on failure, printing anADVISORY:line โ report the gap, self-correct, then continue.
IMPORTANT: Never commit issues.md, STATUS.md, or CHANGELOG.md to the feature branch.
These are registry files managed only on main. Always use bash scripts/registry_edit.sh <file> -- bash -c '<update command>' โ the wrapper resolves the main repo root internally.
gh auth status fails: stop and instruct the user to run gh auth login.gh issue create fails: retry once; if still failing, stop and report the error.git push fails: check for upstream conflicts; report and stop.gh pr create fails: retry once; if still failing, the branch is already pushed โ report and let user create PR manually.bash scripts/wt_cleanup.sh <branch> for safe worktree removal.
The wrapper cd's to the main repo root and then removes the worktree in
a single subshell, so the caller never ends up with a deleted CWD.bash scripts/wt_cleanup.sh <branch>git push origin --delete <branch> (remote cleanup, if pushed)gh pr close <pr_number> to close the broken PR.doing or backlog if it was prematurely set to done.