- Create a directory under
skills/<skill-name>/ - Create
SKILL.mdwith YAML frontmatter:name(required): lowercase, hyphens, max 64 charsdescription(required): under 250 chars, starts with trigger condition, third personphase: which workflow phase (discovery/design/planning/execution/verification/integration/any)transitions: array of{target, condition}defining where the skill goes nextgates:{entry, exit}defining what must be true to enter/leavecontext: fork(optional): run in isolated subagent contextdisable-model-invocation: true(optional): user-invoked only
- Include in the skill body:
- HARD-GATE block (non-negotiable enforcement)
- Process flow diagram (dot format)
- Checklist (numbered steps)
- Anti-patterns (common mistakes with explanations)
- Evidence requirements
- Transition section
- Keep SKILL.md under 500 lines. Use supporting
.mdfiles for reference material. - Follow the structure of existing skills as a template.
- Create
agents/<agent-name>.mdwith YAML frontmatter:name,description,tools(array),model: opus,effort: maxskills(optional): array of forge skills the agent should follow
- Include in the body:
- Role statement (one sentence)
- "What You Do" section (numbered steps)
- "What You Do NOT Do" section (scope boundaries)
- Output format (structured markdown template)
- Input/output contracts
- Verify the agent does not overlap with existing agents' scope.
- Add the hook script to
scripts/hooks/<hook-name>.cjs - Register it in
hooks/hooks.jsonunder the appropriate event - Support runtime profiles (check
FORGE_HOOK_PROFILEandFORGE_DISABLED_HOOKS) - Use Node.js for cross-platform compatibility
- Always exit 0 on error (graceful failure, never block the user)
- Use
${CLAUDE_PLUGIN_ROOT}for paths, never hardcode - Add test fixtures in
tests/fixtures/and test cases intests/run-tests.cjs
When adding a skill, determine its tier:
| Tier | Criteria | Frontmatter |
|---|---|---|
| 1 (Unconditional) | Applies to ALL work, no exceptions | Default (no special fields) |
| 2 (Intent-matched) | Activates when description matches task | Default (no special fields) |
| 3 (User-invoked) | Only when user types the command | disable-model-invocation: true |
Update the Skill Selection section in CLAUDE.md when adding Tier 1 or Tier 2 skills.
- All hook scripts: Node.js (
.cjs), cross-platform, graceful failure - All paths: use
${CLAUDE_PLUGIN_ROOT}orprocess.cwd(), never hardcode - All skills: must have HARD-GATE, process flow diagram, and anti-patterns
- All agents: must have scope boundaries ("What You Do NOT Do")
- All agents:
model: opus,effort: max - Sanitize any stdin-sourced data before writing to files
- No em dashes in any content (use commas, colons, or restructure)
# Run hook tests
npm test
# Run skill content tests
node tests/run-skill-content-tests.cjs
node tests/skill-receive-feedback-structure.cjs
node tests/skill-techniques-structure.cjs
node tests/isolate-work-structure.cjsWhen adding a skill, add structural validation tests that verify:
- File exists with correct frontmatter
- Required sections present (HARD-GATE, process flow, anti-patterns, evidence, transitions)
- Content matches specification (key terms, section ordering)