feat: wire factory principles into content index and write-skill governance check

- AGENTS.md: add factory principles and factory-integration-decisions to
  on-demand content index so they are discoverable for skill design work
- write-skill: insert conflict-check step (step 3) — sub-agent reads
  constitution and factory principles after grill, before any writing;
  hard gate with explicit self-check item; renumber steps 3–8 → 4–9
- META.md: bump to v1.4

Closes the gap identified in PRD chunk-3-skills-library §sub-agent-usage:
conflict checking against constitution and factory principles was specified
but never wired into the write-skill process.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-26 18:49:49 +00:00
parent 663f10c3fe
commit 33153594f1
3 changed files with 12 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
```yaml
version: "1.3"
version: "1.4"
updated: 2026-05-26
# when: describes when this skill is loaded — the full trigger context.

View File

@@ -38,17 +38,19 @@ Negative trigger cases are NOT a required input. The agent proposes them based o
2. **Grill.** Run a focused grill with the /grill-me skill to reach shared understanding of: skill name, category, purpose, and use cases. One question at a time, with a recommendation for each.
3. **Write and test the trigger description.** Using the agreed name, category, purpose, and use cases from the grill, draft `description:`. Propose negative trigger cases based on the skill's purpose and adjacent skills — get explicit user confirmation before running tests. Test all three cases and show per-case PASS/FAIL. A failed case means revise and retest — do not proceed.
3. **Conflict check.** Spawn a sub-agent: read `docs/ai-constitution.md` and `docs/research/ai-coding-factory/ai-coding-factory-principles.md`, then check the agreed skill purpose and design against both documents. Return a numbered list of tensions or conflicts, or confirm none found. An empty list is a valid result — it confirms the design is clean before writing begins. Hard gate: resolve any findings before proceeding.
4. **Walk through each section.** For each section in `SKILL-TEMPLATE.md`: propose content, state where it comes from, present alternatives if they exist. Wait for explicit human confirmation before moving to the next section.
4. **Write and test the trigger description.** Using the agreed name, category, purpose, and use cases from the grill, draft `description:`. Propose negative trigger cases based on the skill's purpose and adjacent skills — get explicit user confirmation before running tests. Test all three cases and show per-case PASS/FAIL. A failed case means revise and retest — do not proceed.
5. **Copy both templates.** Copy `SKILL-TEMPLATE.md` to `.agents/skills/<name>/SKILL.md`. Copy `META-TEMPLATE.md` to `.agents/skills/<name>/META.md`. Do not modify content yet — copy first, fill second.
5. **Walk through each section.** For each section in `SKILL-TEMPLATE.md`: propose content, state where it comes from, present alternatives if they exist. Wait for explicit human confirmation before moving to the next section.
6. **Fill both files.** Fill in the copied `SKILL.md` with confirmed section content. Fill in the copied `META.md` with version, updated date, when, source (if applicable), and references (if applicable).
6. **Copy both templates.** Copy `SKILL-TEMPLATE.md` to `.agents/skills/<name>/SKILL.md`. Copy `META-TEMPLATE.md` to `.agents/skills/<name>/META.md`. Do not modify content yet — copy first, fill second.
7. **Invoke `write-eval`.** Do not mark the skill complete without an eval file.
7. **Fill both files.** Fill in the copied `SKILL.md` with confirmed section content. Fill in the copied `META.md` with version, updated date, when, source (if applicable), and references (if applicable).
8. **Prompt for HITL.** Ask the user to open a fresh session, trigger the skill, and confirm output before committing.
8. **Invoke `write-eval`.** Do not mark the skill complete without an eval file.
9. **Prompt for HITL.** Ask the user to open a fresh session, trigger the skill, and confirm output before committing.
## Output format
@@ -73,6 +75,7 @@ For placeholder conversions, `SKILL.md` replaces the existing file entirely —
## Self-check
- [ ] Overlap check completed before any content was written
- [ ] Conflict check sub-agent ran against constitution and factory principles — findings resolved before any writing began
- [ ] Trigger description tested against all three cases — all passed before body content was written
- [ ] Negative trigger cases confirmed by user before testing
- [ ] Each section confirmed explicitly by user before SKILL.md was written