Build one ticket, or a direct request such as a review finding or a small refactor, test-first; get it reviewed and commit it. The only odhyp skill that writes code.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Implement?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/odhyp-implement)
---
name: implement
description: Build one ticket, or a direct request such as a review finding or a small refactor, test-first; get it reviewed and commit it. The only odhyp skill that writes code.
disable-model-invocation: true
argument-hint: "@<tickets>/NNNN-slug.md | T-NNNN | T-NNNN 1,3 | finding 1 | 1,3 | all | <request>"
---
Read the odhyp block in `CLAUDE.md` for the paths and the test and lint commands (No odhyp block: stop and say to run `/odhyp:setup`), and `${CLAUDE_PLUGIN_ROOT}/templates/TICKET-FORMAT.md`.
**Mode** comes from `$ARGUMENTS`:
- `T-NNNN` followed by a finding selection (`T-0012 2`, `T-0012 1,3`, `T-0012 all`): **direct mode** on those findings of that ticket (see Direct mode);
- otherwise starts with `T-` or `@<tickets>/`, or is empty: **ticket mode**;
- anything else (`finding 1`, `1`, `1,3`, `all`, free text): **direct mode**, for small, well-understood work found in this session.
Each step below says what differs in direct mode.
## 1. Pick the work
### Ticket mode
The ticket is `$ARGUMENTS`. With no argument, pick the next eligible one: an `in-progress` ticket first, then a `needs-info` ticket with every item under `## Questions` answered and every `depends_on` `resolved`, otherwise the lowest-numbered `ready-for-agent` ticket whose `depends_on` are all `resolved`. State its ID and title. An `in-progress` ticket refused below ends the pick with its own refusal; never move on to another ticket.
Check these first, in this order, before changing any file. Refuse, change no ticket, and stop when:
- it is `resolved` or `wontfix`: say so;
- it is `needs-info` with unanswered questions: show them, and say to answer them inline under `## Questions` in the ticket's file path and commit; the next `/implement` then picks it up;
- it is `ready-for-human`: say what the person has to do, then to set `status: resolved` (done by hand) or `status: ready-for-agent` (an agent should build it) in the ticket's file path, and commit;
- any `depends_on` ticket is not `resolved`: list them;
- it is `in-progress` and its `## Notes` holds two or more `Must-fix (review):` or `Blocked:` entries (one per failed run): show them and give the ways out: fix it by hand, set `status: resolved` and commit the code with the ticket file; delete the entries to allow another try; or discard the ticket's code changes, set `status: wontfix` with the reason under `## Notes` and commit the ticket file. Both commits end with `Refs: T-NNNN`;
- the ticket is not `in-progress` and `git status --porcelain` prints anything: list the changes and say to commit, stash or discard them first;
- it is not `in-progress` and the test or lint command fails before any change: show the failure and say to fix it first.
Otherwise:
- `needs-info` with every item under `## Questions` answered: set `status: in-progress` and continue.
- `in-progress`: resume. Check `git status` and `## Notes`; must-fix findings from an earlier review and `Blocked:` entries are listed there, and fixing them comes first.
- Otherwise set `status: in-progress`.
With no argument and no eligible ticket, change nothing and stop:
- no open tickets (every ticket is `resolved` or `wontfix`): say so and point to `/shape` for new work;
- otherwise: list each open ticket with the refusal reason above that blocks it.
After a `needs-info`, `ready-for-human` or `depends_on` refusal, or the open-ticket list, add one line: to drop a blocking ticket instead, set `status: wontfix` in its file with the reason under `## Notes` (for a `depends_on` refusal, also remove its ID from this ticket's `depends_on`, since only `resolved` satisfies a dependency), and commit.
### Direct mode
A bare `N` (`2`, `1,3`, `all`) names findings in the most recent numbered findings list in this conversation; after an implement run that is its step 6 report (or MUST-FIX message), which supersedes code-review's own numbering. `T-NNNN N` names findings in that ticket's `Findings (review):` entry under `## Notes`, so it works after a `/clear`; lines marked `(fixed)` or `(ticketed T-MMMM)` are skipped, and `all` means every unmarked line. A number that is missing or marked either way, no such entry, or nothing left for `all`: say so and stop; the same holds for a bare `N` whose finding also has a marked line in a ticket's `Findings (review):` entry. These findings came from a review of T-NNNN, so the commit carries `Refs: T-NNNN` (step 5). Whenever the findings came from a review of a ticket (either form), refuse and stop unless that ticket is `resolved`. When it is `wontfix`, say it was dropped, so its findings need `/to-tickets` or a new request. Otherwise its work is not committed yet, and a direct run would build on, and could commit, the blocked diff; say to finish it with `/implement T-NNNN` first (answering its `## Questions` before that when it is `needs-info`).
Restate the selected finding(s), or the request, as one or two lines of expected outcome: the **brief**. A request like `this` means only the session's last `# Shape Summary`, never a `# Diagnosis Summary`; its `## Done when` and `## Tested by` are the brief. State it before building. Keep the scope to what was asked.
Ask instead of building when the request is ambiguous; when it has significant architectural implications, send the user to `/shape`.
## 2. Build, test-first
In ticket mode, the ticket is the whole brief: build exactly its acceptance criteria, inside its `## Decisions that apply` and `## Out of scope`. Read the spec, and when `parent:` is not `none` that parent ticket's `## Context` and `## Notes`, only as background: they never widen the ticket's scope. In direct mode, build exactly the brief.
For each acceptance criterion (direct mode: each expected outcome): write the test, run it and watch it go **red**, write the code that turns it **green**, refactor. A diagnose ticket (`source: diagnose`, `fix` or `perf`) starts with its `## Failing test to write first`; in direct mode, a diagnose finding starts with its `### Failing test to write first`. Changes with no testable behaviour (docs, skill text), and a failing test that reads `none`, skip red/green.
Then run the full test and lint commands, in both modes. **Done when** both are clean.
**Never guess.** When the ticket turns out to be:
- **unclear**: set `status: needs-info`, write the questions under `## Questions`, discard this ticket's code changes (not the ticket file), commit the ticket file alone as `chore(<scope>): ask questions on T-NNNN` with `Refs: T-NNNN`, and stop;
- **too big** for one session: narrow this ticket to a first slice that fits, write the rest as new self-contained tickets (`parent:` this ticket, this ticket's `spec:`, `source: implement`, depending on it), and when `spec:` is not `none` append their IDs to that spec's `tickets:` list, note the split in `## Notes`, set this ticket back to `ready-for-agent`, discard this ticket's code changes (not the ticket or spec files), commit the ticket files (and that spec file, if any) alone as `chore(<scope>): split T-NNNN` with `Refs: T-NNNN`, and stop;
- **stuck red**: the test or lint command still fails after a real attempt: keep the code and `status: in-progress`, add `Blocked:` under `## Notes` with the failing test or lint error and what was tried, tell the user the next step is `/implement` on this ticket again, and stop.
Discard code changes with `git restore --staged --worktree <path>` for changed files and by deleting new ones. Commit the ticket files (and the spec file of a split) with `git add -- <files>`, then `git commit -m "<subject>" -m "Refs: T-NNNN" -- <files>`, so new files are tracked and nothing else staged goes in. `<scope>` is the ticket's.
In direct mode: unclear → ask the user and stop; too big → stop and suggest `/to-tickets`; stuck red → report the failure and stop. Direct mode never creates a ticket unless the user asks.
## 3. Keep the records true
- Using the **diagram** skill, update the ticket's `diagrams` and any other existing diagram the work makes wrong.
- **Glossary:** when the brief (ticket, or in direct mode the shape summary's `## Glossary`) lists glossary entries and the odhyp block has a `Glossary:` line, read `${CLAUDE_PLUGIN_ROOT}/templates/GLOSSARY-FORMAT.md` and apply them to that file: add new terms, rewrite changed ones, and delete removed ones with every mention of them. A missing file is created with a `# Glossary` H1 when the first term arrives. No `Glossary:` line: write nothing and say nothing. The glossary file is committed with the code in step 5. Do not otherwise read the glossary.
- If the work proved the spec wrong, add an entry under the spec's `## Decisions`: `date · T-NNNN · what changed and why`.
- Check off the acceptance criteria and append to `## Notes` what was done and anything a later reader needs.
In direct mode there is no ticket to update (except the `(fixed)` marks in step 5); update any existing diagram the work makes wrong, and add an entry under the `## Decisions` of any spec the work proves wrong: `date · what changed and why` (put `T-NNNN ·` after the date only when the findings came from a review of that ticket).
## 4. Review
Run the odhyp **code-review** skill (`odhyp:code-review`) with the ticket ID as its argument (direct mode: the brief). It reviews the uncommitted diff in a fresh context and returns a verdict and ranked findings; it changes nothing.
- **MUST-FIX:** commit nothing. Add one `Must-fix (review):` entry under `## Notes` for this run, listing each Critical and High finding with its `path:line` and required change. Add the review's open non-blocking findings under `## Notes` as `Findings (review):` with each `path:line`, numbered as in step 6 (into that entry if it exists, continuing the numbering; a second review's are already there). Keep `status: in-progress`, and stop. Tell the user the findings, the Critical and High ones by `path:line` with no number and the non-blocking ones under their numbers in the ticket, so `N` names the same finding in chat and after a `/clear`, and that the next step is `/implement` on this ticket again; the non-blocking ones can be kept with `/to-tickets N` now or `/to-tickets T-NNNN N` after a `/clear` (while the ticket is not `resolved`, to-tickets leaves their lines unmarked, so a later `all` offers them again; waiting until it is `resolved` avoids that), and fixed with `/implement T-NNNN N` only once the ticket is `resolved` (its work committed; a direct run now would build on, and could commit, the blocked diff). In direct mode: commit nothing, report the findings, say they exist only in this session and a `/clear` loses them, offer `/to-tickets N` (N = the finding numbers) to keep them or `/implement N` to fix them now, and stop.
- **PASS:** in ticket mode, first add this review's open `ticket` findings under `## Notes` as `Findings (review):` with each `path:line`, numbered as in step 6 (into that entry if it exists, continuing the numbering). If there are Medium or Low findings marked `fix now`, apply them (ticket mode: note them under `## Notes`), get the test and lint commands clean as in step 2, and run code-review once more on the new diff. In ticket mode, add that review's non-blocking findings under `## Notes` as `Findings (review):` (or to that entry if it exists), continuing the numbering, before acting on its verdict. Its verdict then decides as above, but a second PASS changes nothing further, and a second MUST-FIX also reports the first review's `ticket` findings to the user. Then, on a PASS, continue to step 5 and commit the diff as reviewed. Whenever findings from both reviews are reported, number them as one list: the first review's open findings first, then the second review's, continuing the count, so each `N` names one finding; applied `fix now` findings get no number.
In ticket mode, when the ticket already has a `Findings (review):` entry from an earlier run, the count, in the ticket and in chat alike, starts after its highest number, so `N` names the same finding in both. A finding already in that entry (same problem in the same file, even if its line moved) is not added again: it keeps its number and its text and `path:line` are updated in place, and it is reported under that number. If this run applies it as `fix now`, append `(fixed)` to the end of its line in that entry instead of updating it, keeping its text and `path:line`; it stays there, so its number stays taken. Like any applied `fix now` finding, it gets no number in chat. A line already marked `(ticketed T-MMMM)` is left as it is and not reported again, since that ticket tracks it. A line marked `(fixed)` is left as it is too, but the same problem found again means the fix failed: add it as a new numbered finding and report it.
## 5. Commit
Set `status: resolved`. Stage the code, the tests, the ticket file and any diagram, spec or glossary files, and commit them together:
```
type(scope)!: subject
Refs: T-NNNN
```
`type`, `scope` and `!` (only when `breaking: true`) come from the ticket. Commit to the current branch.
In direct mode there is no ticket status to set; stage the code, the tests and any diagram, spec or glossary files. Pick `type` and `scope` from the change and commit `type(scope): subject` with no `Refs:` footer, unless the findings came from a review of ticket T-NNNN: then add `Refs: T-NNNN`, and, for each applied finding that has a line in that ticket's `Findings (review):` entry, append `(fixed)` to the end of that line and stage the ticket file in the same commit, so a later `T-NNNN all` skips them. Findings that share type and scope share one commit; otherwise one commit each.
## 6. Stop
Report the commit hash(es), then one line per `fix now` finding applied, then the open non-blocking findings: the first review's `ticket` findings and every finding of the second review, numbered as one list (step 4). In both modes, when the ticket, its spec (read `## Design` and `## Decisions` both: `## Decisions` holds only changes made during implementation) or the direct brief settled a decision worth keeping that no ADR in the decisions folder (`Decisions:` in the odhyp block) covers, offer `/odhyp:to-adr` in one line; never run it yourself. Then end. The user decides what comes next: `/implement N` or `/to-tickets N` on a finding (this report's numbers supersede code-review's), `/implement T-NNNN N` or `/to-tickets T-NNNN N` for a ticket's `Findings (review):` after a `/clear`, `/session-review`, or `/clear`.