# 0019 — Factory skills: write-adr, write-issue-spec, write-workflow, upgrade-skill, validate-skill **Type:** HITL **Parent PRD:** `docs/prd/chunk-3-skills-library.md` ## What to build The remaining 5 factory meta-skills, authored using `write-skill` (0018). `write-adr` must be implemented first within this group — it is called by `design/grill-me` (issue 0020). All skills in this group are new. Each skill follows the per-skill workflow from `docs/notes/skill-implementation-workflow.md`. `write-adr` must be verified before starting issue 0020. **Skills and trigger descriptions** (from skills index): | Flat name | Trigger description | |---|---| | `write-adr` | Write an ADR, document this architectural decision, record this decision | | `write-issue-spec` | Write a spec for this issue, draft the issue description for X, create a Gitea issue spec | | `write-workflow` | Write a workflow for X, chain these skills into a workflow, create a workflow document | | `upgrade-skill` | This skill is wrong, fix this skill, update skill X, skill X is behaving incorrectly | | `validate-skill` | Check this skill, does this skill meet the standard, review this SKILL.md, audit skill X | **Key constraints per skill:** - `write-adr`: produces `docs/adr/NNN-title.md`; increments ADR number from existing files; never edits an existing Accepted ADR — creates a superseding one instead - `write-issue-spec`: produces complete issue body (Why + EARS Requirements with ADDED/MODIFIED/REMOVED delta markers + Design notes + independently completable Task checklist); scale-adaptive; does not post — outputs body for human review; must work for both file-based issues (`docs/issues/`) and Gitea MCP when configured — the active backend is determined at runtime per ADR-0011 (provider-agnostic issue tracker) - `write-workflow`: produces `.agents/workflows/.md` with WorkflowContext schema (inputs/outputs per step), HITL gates before every irreversible action, failure paths documented - `upgrade-skill`: bumps `version` in frontmatter; always adds a new eval test capturing the correction; never reduces existing eval suite - `validate-skill`: severity-rated findings — missing eval = critical; missing failure handling = high; weak trigger description = high ## 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` — check for any meta-skill or skill-authoring patterns; record SHAs for any adopted content - `bmad-method/bmad-method` — BMAD architect role and ADR-writing patterns; relevant for `write-adr` and `write-issue-spec` - `github/spec-kit` and `Fission-AI/OpenSpec` — issue spec and workflow standards; relevant for `write-issue-spec` and `write-workflow` - Search agentskills.io and GitHub for open-source validate-skill and upgrade-skill implementations before writing from scratch For all skills in this group: these are meta-skills with no direct Pocock placeholder equivalent; expect to synthesize from multiple upstreams. ## Acceptance criteria - [ ] All 5 SKILL.md files exist at `.agents/skills//SKILL.md`; `metadata.category: factory`; authoring standard met for each - [ ] `write-adr` implemented and verified before the design skills issue (0020) begins - [ ] Each skill has a co-located eval at `.agents/evals/factory//eval.yaml` produced via `write-eval` - [ ] `install.sh` deploys all 5 to `~/.agents/skills/` - [ ] **HITL:** human runs behavioral test per skill; output format matches constraints - [ ] **HITL:** human reviews each SKILL.md and eval before committing - [ ] Per-skill process followed for all 5 skills: source discovery (sub-agent) → source review with licence/security check (sub-agent) → conflict check against constitution + factory principles (sub-agent) → synthesis grill → co-write iteratively - [ ] Trigger description for each skill tested against explicit, implicit, and negative queries before body written - [ ] `when:` frontmatter field present in all SKILL.md files - [ ] `source:` and `references:` fields correctly populated or absent - [ ] eval.yaml for each skill contains all 5 required test types - [ ] Body ≤500 lines for each skill - [ ] `write-adr` implemented and passing behavioral test before design skills issue (0020) begins - [ ] `docs/spec/overview.md` updated to reflect all 5 skills deployed ## Blocked by - 0016 (grill defines per-skill workflow) - 0017 (`write-eval` needed to produce evals) - 0018 (`write-skill` used to author these skills)