PRD: Chunk 3 — Skills Library Rebuild #19
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
PRD: Chunk 3 — Skills Library Rebuild
Status: In progress — 0015 ✅, 0016 ✅
Produced by: grill-with-docs session, 2026-05-17
Prerequisite: AGENTS.md refactor issue must be completed before skill implementation begins
Problem Statement
The 12 existing skills were written as Pocock placeholder content before the factory research was completed. They lack consistent frontmatter, carry no upstream provenance tracking, contain dead references (to
setup-matt-pocock-skills,AGENT-BRIEF.md,OUT-OF-SCOPE.md), and do not align with the factory's authoring standard, phase taxonomy, or design phase structure. There is no mechanism to detect upstream drift, no established review cadence, and no eval coverage for any skill. The factory meta-skills — which enable the factory to build and validate itself — do not exist at all.The skills library is the most immediately useful output of this repo. In its current state, it does not meet the quality bar required for professional-scale use.
Solution
Rebuild the skills library using the factory skills index (
docs/research/ai-coding-factory/ai-coding-factory-skills-index.md) as the canonical build reference. Existing Pocock placeholder skills are refactored to the authoring standard; new skills are built from scratch. The factory meta-skills (factory/category) are built first, starting withfactory/write-eval, to bootstrap eval coverage before any other skill is written.A
source:array field in each skill's frontmatter tracks upstream provenance with full traceability (repo slug, commit SHA, files adopted). An upstream review cadence — per-chunk start during roadmap, quarterly after — prevents drift from upstream sources.The design phase is restructured from its current ad-hoc state into a formal sequence: grill → write-prd → architecture-review (optional) → break-into-issues, with a lightweight secondary grill path for quick ideation without docs integration.
Before skill implementation begins, a dedicated grill session on the general skill implementation workflow is required. That grill produces the working conventions used across all subsequent skill issues.
User Stories
source:field so I can trace exactly which upstream commits and files were adopted when a skill was written.source:to support multiple upstream sources per skill so that combined/merged skills retain full provenance for each contribution.updated:date in eachsource:entry so I can tell how stale the adoption may be.factory/write-evalbuilt first so every subsequent skill can be evaluated against a consistent standard from the start.eval.yamlso I can verify the skill's trigger and output behaviour deterministically.metadata.categoryin frontmatter so I can discover skills by what I am doing in the SDLC.design/grill-meto be the default deep-grill skill (callingfactory/write-adrwhen decisions crystallise) so grilling sessions automatically produce ADRs without duplicate logic.design/grill-leanas a lightweight alternative so I can run a quick interrogation without domain model integration when that overhead is unnecessary.design/write-prdto enforce "why + what only, never how" via inline self-checks so PRDs don't drift into implementation territory.design/write-prdto verify a grill session exists as a prerequisite so PRDs are never written cold.design/architecture-reviewto present ≥2 options with tradeoffs so I never receive a single recommendation without alternatives.design/break-into-issuesto propose Gitea milestone groupings for PRDs producing >5 issues so large bodies of work have a natural epic structure.design/break-into-issuesto enforce independently shippable slices so no issue blocks another open issue.factory/write-skillto validate the trigger description against explicit, implicit, and negative test cases before completing so skills activate reliably.factory/validate-skillto produce severity-rated findings (missing eval = critical, missing failure handling = high, weak trigger = high) so skill quality gaps are clearly prioritised.factory/upgrade-skillto always add a new eval test capturing the correction so the same failure cannot recur silently.implement/tddto remain a separate skill fromimplement/implement-featureso the methodology (TDD) is composable and reusable outside of full feature implementation.implement/implement-featureto require a linked issue with an EARS spec (checkingdocs/issues/in the file-based phase, Gitea when configured) so implementation never begins without a spec.review/security-reviewto apply OWASP LLM Top 10 + Agentic AI Top 10 for application code, and AST03/04/06/07/09 for self-authored factory skills, so the right checklist is applied in each context.review/changelog-entryto produce conventional changelog format entries so git-cliff can consume them deterministically.deploy/deployment-checklistto verify a linked issue exists and is closed or in-progress before any deployment so deployments are always traceable to a spec.cross-cutting/governance-checkto validate proposed actions againstAGENTS.mdso governance rules are checked without requiring the developer to recall them from memory.cross-cutting/session-handoffto prompt LESSONS.md extraction as part of handoff so cross-session learnings are captured before context is lost.iac/write-docker-composeto include pinned image versions, secrets via env vars, and healthchecks by default so Docker Compose files are production-safe without additional review.iac/iac-security-reviewto check hardcoded secrets, unpinned versions, missing resource limits, and non-idempotent patterns so IaC security issues are caught before apply.source:field (array) when derived from an upstream, and nosource:field when original, so the absence of the field unambiguously means self-authored.cavemanpreserved as-is so token compression works without disruption.design/prototypepreserved and placed indesign/so design-phase exploratory work has a clear skill home.cross-cutting/triagepreserved so incoming issue intake has a skill home.cross-cutting/improve-codebase-architecturepreserved in cross-cutting so architecture improvement is invocable at any phase boundary.cross-cutting/zoom-outpreserved as a standalone skill (merge into architect role revisited at Chunk 5 grill) so orientation is available now without waiting for Chunk 5.Implementation Decisions
Prerequisite: AGENTS.md refactor
Both the repo-level
CLAUDE.mdand the globalproviders/claude-code/CLAUDE.mdbecome thin adapters importingAGENTS.md. Repo-level:AGENTS.mdat repo root,CLAUDE.mdimports it via@AGENTS.md. Global:core/AGENTS.mddeployed to~/.agents/AGENTS.md,providers/claude-code/CLAUDE.mdimports it. Content currently in bothCLAUDE.mdfiles moves to their respectiveAGENTS.md.core/deployment path (~/.claude/core/) unchanged —@importfor on-demand files stays in the Claude Code adapter. An ADR superseding ADR-0005 is required. This issue must be closed before skill implementation begins.Source field structure
Every skill derived from an upstream carries a
source:array in frontmatter. Each entry:Multiple entries for skills combining patterns from multiple upstreams. Absence of
source:means self-authored original. Single-source skills use a single-item array for schema consistency.Upstream review cadence
Per-skill (not once at chunk start): during source review for each skill, check listed repos for commits since
updated:, decide whether to pull changes in using the pull criteria documented indocs/notes/skill-implementation-workflow.md. After the roadmap is complete (post Chunk 7): quarterly calendar-based review. Cadence is a human responsibility — no tooling required until Chunk 6.Factory bootstrap order
factory/write-evalis the first skill built in Chunk 3, with a hand-written eval for itself.factory/write-skillis second, also hand-written.implement/write-docsis the third skill — phase 2 of issue 0018, the first skill authored viawrite-skillitself (the factory eating itself for the first time). Every subsequent skill in Chunk 3 useswrite-skillfor SKILL.md authoring andwrite-evalfor eval production. Eval YAML files live in.agents/evals/<category>/<skill-name>/eval.yaml. CI enforcement of evals is Chunk 6 — the files exist and document expected behaviour before then.Skill taxonomy — phase × domain matrix
Phase axis:
design,factory,implement,test,review,deploy,operate,cross-cutting. Domain axis:iac(tool-specific). Cross-cutting skills have no single phase home. Paths remain flat per ADR-0009; category expressed inmetadata.categoryfrontmatter only. Role skills (roles/) are Chunk 5.Full Chunk 3 skill inventory
Design (6):
grill-leandesign/grill-leangrill-megrill-medesign/grill-megrill-with-docs; callswrite-adrwrite-prddesign/write-prdto-prdarchitecture-reviewdesign/architecture-reviewbreak-into-issuesdesign/break-into-issuesto-issuesprototypedesign/prototypeFactory (7) — build
write-evalfirst:write-evalfactory/write-evalwrite-skillfactory/write-skillwrite-a-skillwrite-issue-specfactory/write-issue-specwrite-workflowfactory/write-workflowwrite-adrfactory/write-adrgrill-meupgrade-skillfactory/upgrade-skillvalidate-skillfactory/validate-skillImplement (5):
implement-featureimplement/implement-featuretddimplement/tddrefactorimplement/refactorwrite-docsimplement/write-docsdiagnoseimplement/diagnoseTest (3):
write-tests,generate-test-data,review-test-coverage— all new.Review (4):
code-review,security-review,pr-description,changelog-entry— all new.Deploy (4):
write-ci-pipeline,write-deployment-config,write-ai-review-workflow,deployment-checklist— all new.Operate (4):
write-runbook,incident-diagnosis,post-mortem,inspect-deployment— all new.IaC / domain (2):
write-docker-composeiac/write-docker-composeiac-security-reviewiac/iac-security-reviewCross-cutting (7):
session-handoffcross-cutting/session-handoffgovernance-checkcross-cutting/governance-checkAGENTS.mdgit-commit-messagecross-cutting/git-commit-messageimprove-codebase-architecturecross-cutting/improve-codebase-architecturetriagecross-cutting/triagezoom-outcross-cutting/zoom-outcavemancross-cutting/cavemanTotal: 42 skills. Role skills (6) deferred to Chunk 5. Gitea skills (3) moved to
providers/gitea/adapter. 5 IaC skills deferred.Skill composition pattern
Skills call other skills by name where appropriate, keeping each skill focused. Established compositions:
grill-mecallswrite-adrwhen a decision crystallisesgrill-meusesgrill-leanas its interview engineimplement-featurecallstddas its implementation methodologywrite-workflowwill formalise these chains (Chunk 4)Design phase sequence
grill-lean(optional lightweight) →grill-me(primary, with docs) →write-prd→architecture-review(optional) →break-into-issuesPRD artifact scope (placeholder — refine during write-prd implementation)
PRDs contain: problem statement, goals, non-goals (explicit), functional requirements at feature level, success criteria. Never contain: implementation approach, technical design, EARS-level detail. Inline self-checks in
write-prdenforce this. Prerequisite: linked grill session output.Issue artifact scope (placeholder — refine during write-issue-spec implementation)
Issues contain: link to parent PRD (inherited why), EARS acceptance criteria, brownfield delta markers, design notes (non-trivial only), independently completable task checklist. Inline self-checks in
break-into-issuesandwrite-issue-specenforce this. Large PRDs (>5 issues) include Gitea milestone groupings in the output.Provider-agnostic issue tracker
Skills reference "linked issue" generically. In the file-based phase (
docs/issues/), skills check for a matchingdocs/issues/NNNN-*.md. When Gitea MCP is configured, skills use it instead. The active backend is determined at runtime by MCP availability, not a config flag. An ADR (0011) documents this decision. Gitea-specific skills (setup-gitea-mcp,post-pr-review,create-issue) are a provider adapter atproviders/gitea/— not part of the core library.Authoring standard for all skills
Every SKILL.md carries:
name,description(trigger — written and tested first),version,updated,when(when the skill is invoked — deferred to Chunk 4 for full bidirectional reference convention),metadata.category,source(array, if upstream-derived),references(array, if external citations needed). Body sections: role, when/when-not, required inputs, constraints, process, output format, failure handling, self-check. Body under 500 lines. XML tags only for skills with ≥3 logical sections and 500+ tokens.Sub-agent usage in skill implementation
Skills are implemented using the per-skill workflow in
docs/notes/skill-implementation-workflow.md. Sub-agents handle source discovery, source review (including licence and security checks), conflict checking against the constitution and factory principles, and eval writing. This keeps the main context lean and ensures each step is independently reviewable. The synthesis grill and HITL behavioral test are human-in-the-loop steps that cannot be delegated.Changelog tooling
git-cliffadopted as the deterministic changelog generator. Config (cliff.toml) added to this repo in Chunk 3; CI integration in Chunk 6.review/changelog-entryskill handles prose release notes for cases where conventional commit messages alone are insufficient. git-cliff is selected over release-please (GitHub-only, incompatible with Gitea) and conventional-changelog (Node.js dependency, less actively maintained).Open decisions carried forward
when:frontmatter + bidirectional reference convention: principle documented in CONTEXT.md now; reference scanner tooling in Chunk 6; full resolution deferred to Chunk 4+.zoom-outinto architect role: revisit at Chunk 5 grill session.write-prdandwrite-issue-spec.Testing Decisions
Skills are content, not code — they cannot be unit tested. Verification is behavioural.
What makes a good skill eval:
Every skill gets an eval. Written via
factory/write-eval(exceptwrite-evalitself, which gets a hand-written eval). Co-located at.agents/evals/<category>/<skill-name>/eval.yaml.CI enforcement: eval files exist in Chunk 3; CI gates that run them on skill changes are Chunk 6.
Behavioural acceptance testing (human-executed post-commit, per skill): open a fresh Claude session, invoke the skill with the trigger phrases from its description, verify the output meets the authoring standard. Each issue includes a short acceptance checklist.
Prior art:
tests/test-governance-layer.shandtests/test-chunk2-behavioral.sh— behavioural test scripts from Chunks 2 and governance workstream. Same pattern applies here.Out of Scope
providers/gitea/adapter, not Chunk 3core/→~/.agents/migration — Chunk 7when:frontmatter full implementation — open, Chunk 4+Further Notes
Update
ai-coding-factory-skills-index.mdonce all 42 skills exist as SKILL.md files. Replace the pre-implementation build reference content with the as-implemented state: actual flat skill names, categories, trigger descriptions as deployed, and any deviations from the original plan noted. The index becomes a living reference rather than a deleted artifact — see issue 0028.Upstream review at Chunk 3 start: before writing any skill, review the upstreams listed in the implementation guidance (mattpocock/skills, bmad-method/bmad-method, github/spec-kit, Fission-AI/OpenSpec) at their current HEAD. Note the commit SHAs. These become the
commit:values insource:fields.Second grill before implementation: the first issue in Chunk 3 (after the AGENTS.md prerequisite) is a dedicated grill on the general skill implementation workflow — what the per-skill process looks like, what the working conventions are, and how the
factory/write-eval-first bootstrap works in practice. That grill produces the conventions applied to all subsequent skill issues.ADRs to produce during implementation: