---
name: add-directive
description: Author a human directive shaping agent reasoning in the vault
applies_to_agents: []   # human-invoked only; no agents
---

# Skill: add-directive

This skill guides a HUMAN through authoring a directive in
`Knowledge/_human/Directives/`. Agents NEVER run this skill.

## When activated

The `/gmd:add-directive` slash command invokes this skill. The
`/gmd:new-project` workflow offers the slash command as an optional
step during project init.

## §10.3 directive schema (all required)

| Field | Type | Values |
|-------|------|--------|
| type | string | must be "directive" |
| scope | string | repo \| project \| concept \| task |
| applies_to_agents | array | list of agent slugs OR ["all"] |
| precedence | number | 1 = highest authority; integer |
| enforce_in_curation | boolean | true = governs curator promotion |
| summary | string | >= 10 words |

## Authoring wizard (AskUserQuestion flow)

1. Component gate check: abort silently if components.obsidian.enabled is false
2. Ask: scope? (repo | project | concept | task)
3. If scope=project: list existing Projects/*/00-README.md; ask which
4. Ask: applies_to_agents (free-form; suggest "all" or specific list)
5. Ask: precedence (default 1)
6. Ask: enforce_in_curation (yes | no; default no)
7. Ask: summary (one sentence, >= 10 words)
8. Ask: body content (free-form markdown)
9. Resolve target path:
   - scope=repo    -> Knowledge/_human/Directives/Repo/{slug}.md
   - scope=project -> Knowledge/_human/Directives/Projects/{project}/{slug}.md
   - scope=concept -> Knowledge/_human/Directives/Concepts/{slug}.md
   - scope=task    -> Knowledge/_human/Directives/Tasks/{slug}.md
10. mkdir -p parent directory (THIS IS THE ONE AND ONLY place agents
    MAY mkdir under Directives/ — because this runs only on human invocation)
11. Write file with §10.3 frontmatter + body
12. Validate via:
    `node -e "const {validateDirectiveSchema}=require('./bin/lib/vault-directives.js'); const fm=...; const r=validateDirectiveSchema(fm); if(!r.valid){console.error('Schema invalid:',r);process.exit(1);}"`
13. Print hint: "Verify via \`node bin/gmd-tools.cjs vault-orient --caller gmd-planner\`"

## Non-goals

- Agents MUST NOT invoke this skill
- No auto-generation of directive bodies (directives are human content)
- No template library (directives are repo-specific; templates would constrain creativity)
