Skip to content
Back to skills

Implement

ASecurity

Read a GitHub issue (or a local spec in .flow/specs) and implement it - bug or feature. Runs lint/typecheck/tests scoped to the diff, opens the PR with Closes #N (or Flow-Spec: N). With --agent, chains QA as a background subagent in its own worktree and loops on FAIL; with --workflow, the same chain runs as a Workflow.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
developmentrustgoshellbashdockergitdatabaseperformance

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add eusilvio/claude-workflow --skill implement --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Implement?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Implement
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/eusilvio-implement/badge)](https://www.skillsdirectory.com/skills/eusilvio-implement)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: implement
description: "Read a GitHub issue (or a local spec in .flow/specs) and implement it - bug or feature. Runs lint/typecheck/tests scoped to the diff, opens the PR with Closes #N (or Flow-Spec: N). With --agent, chains QA as a background subagent in its own worktree and loops on FAIL; with --workflow, the same chain runs as a Workflow."
argument-hint: "<issue-number> [--auto] [--agent | --workflow] [--here] [--contract | --slice <id> | --integrate]"
allowed-tools: Bash(gh:*), Bash(git:*), Bash(pnpm:*), Bash(npx:*), Bash(npm:*), Bash(bun:*), Bash(yarn:*), Bash(make:*), Bash(docker:*), Bash(tsx:*), Bash(cd:*), Bash(${CLAUDE_PLUGIN_ROOT}/scripts/wt.sh:*), Read, Edit, Write, Grep, Glob, Skill, Agent, SendMessage, Bash(${CLAUDE_PLUGIN_ROOT}/scripts/codemap.py:*), Bash(${CLAUDE_PLUGIN_ROOT}/scripts/brain.py:*), Bash(${CLAUDE_PLUGIN_ROOT}/scripts/flowctl.py:*), AskUserQuestion
model: sonnet
---

Arguments: $ARGUMENTS

Parse the arguments: the first token is the issue number - call it **N** and
use it everywhere below. If the arguments contain `--auto`, you are in
**AUTONOMOUS MODE**: no user is watching, you cannot ask questions. Autonomous
mode changes steps 2 and 5 as described there; everything else is identical.

If the arguments contain `--agent` or `--workflow`, do not implement here. Invoke the `Skill`
tool with skill `flow:run` and args `#N` plus any `--workflow`, `--auto`, `--merge`, `--live`, `--office`, `--realtime`,
`--jobs`/`--parts`/`--no-slice` from your own arguments (never read its file and follow it
inline: this skill runs on Sonnet, and the orchestrator must run on the Opus
its own frontmatter pins): the orchestrator gates the issue, spawns `flow:implementer` and
`flow:qa` in the issue's worktree, runs the fix/QA loop and stops at "ready to
merge". Everything below is the stage contract the implementer follows.

**Where you work.** The main checkout never moves:
- The prompt carries `WT=<path>` -> that worktree is your working directory.
- Otherwise, unless the arguments contain `--here`, create it first:
  `WT=$(${CLAUDE_PLUGIN_ROOT}/scripts/wt.sh add N [base])` (base only when it is
  not the default branch, resolved as `pr-delivery` says) and
  `${CLAUDE_PLUGIN_ROOT}/scripts/flowctl.py init N stage=implement wt=$WT`.
- `--here` (interactive only, the user asked for it): work in the current
  checkout, on a new branch. Refuse if it has uncommitted changes.

In a worktree, every shell command runs there (`cd "$WT" && ...`) and every
Read/Edit/Write uses an absolute path under it.

## Slice modes

`--contract`, `--slice <id>` or `--integrate` in the arguments: the
orchestrator split the issue. Read
`${CLAUDE_PLUGIN_ROOT}/skills/implement/references/slice-modes.md` first; it changes
what you implement, where, and how you end. Without them, ignore it.

## Speed rules (every step)

- PARALLEL BY DEFAULT: batch all independent tool calls in one message.
- Never re-read a file already read this session. CLAUDE.md is in context;
  do not re-read it.
- Independent Edits to different files go in the same message.

## 1. Read the issue

```
${CLAUDE_PLUGIN_ROOT}/scripts/flowctl.py spec view N --json
```
It returns `number,title,body,state,labels,comments,url,local` from the
GitHub issue or, when `local` is true, from the local spec
`.flow/specs/N.md` of the main checkout (no GitHub issue exists then - never
call `gh issue ...` for it). Every comment below goes through
`flowctl.py spec comment N <<'FLOW_TXT' ... FLOW_TXT`, which posts on the
issue or appends to the local spec.

**Spec source:**
The issue body IS the contract - including its `## Implementer notes` section
(integration checklist, edge cases) when present.
**QA rounds:** scan the `comments` array for comments starting with
`## QA report`. If the most recent one has `Verdict: FAIL`, every FAIL row and
every listed defect is mandatory scope for this run - implement all of them
before anything else, and do not argue with a verdict. QA graded observed
behavior; you are reading code. If you believe a finding is wrong, reproduce
it first and put the reproduction in your issue comment (step 6). Never mark
a FAIL as resolved without changing something that makes the observed
behavior change.
**Brain notes:** if the header has `Brain: [[slug]], ...`, read those notes
in `<brain>/` with the files they anchor - they are part of the contract.
(`<brain>` = the directory `${CLAUDE_PLUGIN_ROOT}/scripts/brain.py dir` prints (`docs/brain/` by default; `.flow/brain/` of the main checkout for a local, unversioned brain).)

**Legacy issues:** a comment whose body starts with `## Implementer Prompt`
overrides the body wherever they conflict; the most recent wins.

Then, in one parallel message: Read every file the issue cites (resolve paths
via the File Map in CLAUDE.md; do not grep blindly) AND, if the body has an
`Investigated at: <sha>` line, run the drift check in the same batch:
`git diff <sha>..HEAD --stat -- <cited paths>`. Any cited file that changed
since the investigation: the current code is the truth, the issue is the
intent. Without the stamp, still confirm the code matches the issue; if it
drifted, flag it before implementing.

**Sanity check the spec:** the issue was written by another agent - do not
trust it blindly. If a cited symbol does not exist, a claimed pattern is not
there, or the proposed approach contradicts what the code actually does,
STOP and flag the mismatch (in `--auto`: comment on the issue and end with
`PIPELINE:SKIPPED spec-mismatch`).

## 2. Open decisions - gate

If the issue body contains an "## Open decisions" section (even one item),
STOP here. Do not implement anything yet.

**Interactive mode (default):** present each item as an enumerated option
with your recommendation, then ask the user to choose. Resume step 3 only
after the user explicitly resolves every item. Skipping this gate is
forbidden regardless of how obvious the choice seems.

**Autonomous mode (`--auto`):** you cannot ask. Resolve like this:
1. If every item carries a `Recommended resolution:` line in the body (or,
   on legacy issues, the Implementer Prompt records a resolution for every
   item), adopt those resolutions and proceed to step 3.
2. If any item lacks a recorded resolution, do not implement. Post a comment
   listing each unresolved item with your recommended option
   (`flowctl.py spec comment N`), end with the exact line
   `PIPELINE:SKIPPED open-decisions` and stop. The user resolves and reruns
   `/flow:implement N` interactively.

## 3. Implement

Implement inline. Mirror existing patterns - find the closest analogue and
follow the same flow, error handling, and naming. Do not invent new patterns
or abstractions. Respect the issue's scope and do/don't list. Commands and
conventions are in CLAUDE.md (already in context - do not re-read it).

**Bug issues (label `bug`)**: write the regression test FIRST and watch it
fail, then fix. QA will check that the test is red at the base and green on
the branch; a test that passes on both sides fails the round. If CLAUDE.md
asks for a lessons-learned entry on bugs, that entry is in scope.

A hook runs `biome check` on every file you edit and returns the errors in
the same turn. Fix them as they appear; do not leave them for step 5.

## 4. Self-review the diff

Run `git diff` and re-read the full diff. This pass catches MECHANICAL
defects only - the things visible in the text of the diff itself:
- Orphans created by the change (unused imports, vars, functions) - remove
- Scope creep - every changed line must trace to the issue; revert extras
- Pattern violations vs the analogue you mirrored
- Leftovers: debug logs, commented-out code, TODOs you added, stubbed
  returns you meant to replace
- Map docs the repo already keeps (optional): run
  `${CLAUDE_PLUGIN_ROOT}/scripts/codemap.py check --changed <base>` and fix
  each `ORPHAN` row (a row pointing at a file your diff removed or renamed).
  `MISSING` rows for new files are added only when the repo's CLAUDE.md asks
  for it; the symbol layer of `codemap` already finds new files. No map docs:
  nothing to do.
- Brain notes anchored to what you changed: run
  `${CLAUDE_PLUGIN_ROOT}/scripts/brain.py check --changed <base>`. Every `STALE?` note is reread
  against your new code - still true: bump `updated`; no longer true: fix
  or delete it (with its INDEX line) in this diff. `ANCHOR`/`LINK` lines
  caused by your diff are fixed here too.

Fix what you find, then diff again until clean.

**This is not verification and it does not establish that the change works.**
You wrote this code; re-reading it confirms it says what you meant it to say.
Whether the behavior is correct is decided in step 5 by running it, and by QA
after the PR. Do not let a clean self-review reduce how hard you check in
step 5.

## 5. Verify - run what a machine can decide, hand back what it cannot

**Always run, both modes**, in one batch: lint, typecheck and tests scoped to
the diff, exactly as the `scoped-checks` skill defines (test runs,
migrations and seeds against a shared database go through
`FLOW_ISSUE=N ${CLAUDE_PLUGIN_ROOT}/scripts/flowctl.py locked testdb -- <cmd>`) (changed-file set from
git, `vitest related`, typecheck on affected packages, escalation triggers).
Detect the targets via `repo-conventions` and the repo's own checks skill
when it has one; a target that does not exist is not invented.

Fix what they report and rerun until green. If a check cannot be made to
pass, do not open the PR: in `--auto` end with the exact line
`PIPELINE:FAILED check`; interactive, report what fails and stop.

State the scope you ran. "Green" after a subset run means nothing that can see
the diff broke - it does not mean the suite is green.

If the issue's `## How to verify` names a command, run that one too.

**Run the repo's QA traps yourself.** If the QA playbook
(`<brain>/qa-playbook.md`, legacy `docs/memory/qa-playbook.md`, or the path CLAUDE.md names) has
`## Test traps`, run the `Como testar` probe of every trap whose
`Trigger` matches your diff, and fix what it catches before opening the PR.
QA will run them anyway; finding it here costs one step instead of a round.

**What you hand back:** anything whose verdict is a judgment call - does the
UI feel right, is the flow sensible, does it look correct on a real screen.
Tell the user:
- Where the change lives: the worktree path, and that the dev server running
  in the main checkout does not show it. To see it, run the repo's dev command
  inside the worktree on the ports from `flowctl.py env N`.
- The route/URL of the affected page.
- The **absolute path** of each file changed.
- The issue's success criteria as a checklist.

Do not claim the criteria are met. Green checks mean nothing broke, not that
the feature works - QA decides that after the PR is open.

Put this same "where to test" info in the PR body alongside the success
criteria - not just in the chat output.

## 6. Comment decisions on the issue

Before opening the PR, post a comment explaining non-obvious implementation
decisions (`flowctl.py spec comment N`). Include only what is
not self-evident from the diff:
- Why an approach was chosen over alternatives considered
- Tradeoffs accepted (e.g. performance vs simplicity)
- Constraints discovered mid-implementation that shaped the solution
- Anything a future reader would wonder "why didn't they just..."

Skip if implementation followed the issue exactly with no forks.

**Durable knowledge goes to the brain, in the diff.** If the repo has
`<brain>/`, anything from the list above that will still matter after
this PR - a decision between real alternatives, a business rule the issue
settled that applies beyond this feature, a mistake with a rule that
prevents it - also becomes a note (format and dedupe in the `brain` skill),
with `source: "#N"` (`"spec N"` for a local spec) and anchors to the files it describes. The issue
comment keeps the story; the note keeps the rule. Most PRs add zero notes.
Local brain (`brain.py dir` prints `local`): the note is written straight
into that directory, outside the diff (never `git add` it), and listed in the
PR body under `Brain:`.

## 7. Deliver

Follow the `pr-delivery` skill: commit in the repo's style, create the branch
(inside the worktree; in the current checkout only with `--here`), open the PR with the line
`flowctl.py spec ref N` prints (`Closes #N`, or `Flow-Spec: N` for a local
spec) against the resolved base. Do not close the issue or the spec by hand.

The final response must contain the line `PR: <pr-url>` (the pr-delivery
skill already prints it) - in autonomous mode the pipeline parses that line.

## 8. Hand off to QA

The work is not done, it is ready to be graded. End by telling the user to
run `/flow:verify N`. `/flow:merge` refuses to merge without a passing
QA report, so skipping this step does not save a round.

In `--auto` (you are the `flow:implementer` stage) stop at the PR: the
orchestrator owns QA and the fix loop. If it sends you QA findings in a later
round, every FAIL row is mandatory scope; fix in the same worktree, branch and
PR, rerun step 5 and reply with the pushed sha, the `## Reply to QA`
block and the `PR:` line (section below).

## Talking to your QA (`ASK:`, `ANSWER:`, `## Reply to QA`)

Under `/flow:run` your QA agent is alive and the orchestrator carries
messages between you (`agent-pipeline`, section The bridge).

- **Workflow mode** (your prompt says so; the default runtime): there is no
  bridge and no live QA to ask. Never end with `ASK:`. A technical doubt:
  take your best reading, write it as an assumption in the report and go on.
  A fact only the user has (product behavior, a business rule, a number or
  message the issue does not fix): stop and return it as `question` in your
  structured result; the orchestrator asks the user and starts you again.
  The `## Reply to QA` block still ends every fix round: the script hands it
  to the next QA.
- **Asking:** when a FAIL row cannot be reproduced from what is written, or a
  criterion is ambiguous in a way only the grader can settle, end with
  `ASK: <question>` (the why in a line above). You get the answer as a
  message and resume. At most two per round; past that, go with the best
  reproduction you have and say so.
- **Answering:** asked something by your QA ("Question from your QA"), answer
  with facts - what you changed and why, the command or seed you used,
  whether an uncommitted change is intentional - and end with `ANSWER:
  <one-line summary>`. Do not change code to answer.
- **Fix reply:** every fix round ends with this block right above `PR:`,
  one row per FAIL row and defect of the report you received:

  ```
  ## Reply to QA
  | Item | Reply |
  |---|---|
  | <criterion / defect, as QA wrote it> | fixed in <sha> - <what changed> |
  | ... | disputed - <reproduction: command and output> |
  | ... | not reproducible - <what you ran and saw> |
  ```
  The orchestrator hands it to your QA verbatim; a dispute without a
  reproduction is not a dispute.

### Talking to your QA, live mode (`--live`)

No orchestrator in the middle: you and your QA talk with
`SendMessage(to: <agentId>)` (its id comes in a message; if you were resumed
by it, reply to it). Whoever sends logs it: `$F talk N <your role> <its role>
<fail|fixed|ask|answer> "<text>"` (this makes the speech bubble in the office).

- QA sends you FAIL rows (verbatim, with evidence). You are the one who wrote
  the code, so **you fix it** on your part branch (same worktree), rerun the
  scoped checks, `$F slice N regions <id>`, commit, push, and
  `SendMessage(to: <qa id>)` with the `## Reply to QA` block + the pushed
  sha. Mark `$F busy N add <role>` while fixing, `rm` when done. Never wait for
  the orchestrator, never ask it to relay.
- Cap: 3 rounds per pair; QA closes it (`blocked` with the reason). You may
  dispute a row with a reproduction instead of changing code.
- Your turn's last line while a peer owes you an answer is
  `WAIT: <peer role> <what>`; after a fix round it is `SLICE:DONE <branch>
  <sha>` (part) or `PR: <url>` (integrator / unsliced). The part's end is
  reported by QA to the orchestrator; you do not report - you rest, alive.
  A resumed agent's completion goes to whoever resumed it (your QA), so never
  rely on the orchestrator seeing your last line.

Files in this skill

  • SKILL.md16 KB
  • references/slice-modes.md6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.