# 0021 — Implement skills: implement-feature, tdd, refactor, write-docs, diagnose **Type:** HITL **Parent PRD:** `docs/prd/chunk-3-skills-library.md` ## What to build The 5 implement phase skills. Two are new; three are preserved Pocock placeholders upgraded to the authoring standard. All authored via `write-skill` (0018), evals via `write-eval` (0017). **Skills, origins, and trigger descriptions:** | Flat name | Origin | Trigger description | |---|---|---| | `implement-feature` | New | Implement a feature, build this, write the code for X | | `tdd` | Preserved; frontmatter + standard added | TDD, test-driven, red-green-refactor | | `refactor` | New | Refactor this code, improve structure, clean up | | `write-docs` | New | Write documentation, add docstrings, generate README | | `diagnose` | Preserved; frontmatter + standard added | Diagnose this, what's wrong with X, debug this | **Key constraints per skill:** - `implement-feature`: must start from a linked issue with an EARS spec (checks `docs/issues/` in the file-based phase, Gitea MCP when configured); flags if none exists; no unrequested abstractions; updates `docs/spec/` as part of implementation if behaviour changes; calls `tdd` as its implementation methodology - `tdd`: composable and separate from `implement-feature` so TDD can be used outside full feature implementation; red-green-refactor loop - `refactor`: preserves all existing behaviour; documents what changed and why - `write-docs`: derives from code and spec; never invents behaviour - `diagnose`: preserved behavior; add frontmatter, authoring standard sections, and dead-reference cleanup ## Implementation notes Follow the per-skill workflow defined in `docs/notes/skill-implementation-workflow.md` (produced by issue 0016). **Known upstream sources to review for this category:** - `mattpocock/skills` — original `tdd` and `diagnose` placeholders; review at current HEAD; record SHAs in `source:` for any adopted content - `bmad-method/bmad-method` — BMAD developer role and implementation patterns; relevant for `implement-feature` and `refactor` For new skills (`implement-feature`, `refactor`, `write-docs`): search for prior art in the above repos before writing from scratch. ## Acceptance criteria - [ ] All 5 SKILL.md files exist at `.agents/skills//SKILL.md`; `metadata.category: implement`; authoring standard met - [ ] Dead references removed from Pocock skills (`tdd`, `diagnose`) - [ ] `implement-feature` checks for linked issue with EARS spec before proceeding; calls `tdd` by name - [ ] `source:` fields populated for adopted upstream content - [ ] Each skill has a co-located eval at `.agents/evals/implement//eval.yaml` via `write-eval` - [ ] `install.sh` deploys all 5 to `~/.agents/skills/` - [ ] **HITL:** human runs behavioral test per skill - [ ] **HITL:** human reviews each SKILL.md and eval before committing - [ ] _(Further criteria to be refined after issue 0016 grill session)_ ## Blocked by - 0016 (per-skill workflow) - 0017 (`write-eval`) - 0018 (`write-skill`)