| name | description | argument-hint | allowed-tools |
|---|---|---|---|
codify |
Capture a discovery from iteration and turn it into reusable infrastructure |
[what you discovered] |
Read, Write, Edit, Glob, Grep, Bash, AskUserQuestion |
Capture what you learned through iteration and turn it into reusable infrastructure.
The habit: After meaningful iteration, ask "What did I just learn that should become infrastructure?"
discovery: What you discovered (optional—will prompt if not provided)
If no discovery provided, ask:
"What did you discover through iteration? Describe the pattern, adjustment, or insight that worked."
Ask the user to choose:
- Skill: Reusable prompt pattern (
.claude/skills/[name].md) - Command: User-invokable workflow (
.claude/commands/[name].md) - Agent update: Modification to existing agent
- Guardrail: Constraint or validation rule
- Example: Good output for reference (
examples/[name].md) - CLAUDE.md update: Project-level guidance
Ask relevant questions:
- What triggers this / when should it be used?
- What are the inputs and expected outputs?
- What makes this pattern work?
- If updating existing file: which one?
Use Glob and Read to find similar artifacts in the project:
Glob: .claude/skills/*.md
Glob: .claude/commands/*.md
Read 1-2 similar files to match project conventions.
Based on type, create the file:
Skill → .claude/skills/[name].md:
---
name: [name]
description: [when to use this]
---
# [Name]
[Instructions for executing the pattern]
## When to Use
[triggers]
## Process
1. [step]
2. [step]
## Output
[what it produces]Command → .claude/commands/[name].md:
---
name: [name]
description: [what it does]
argument-hint: "[args]"
allowed-tools: [tools needed]
---
# [Name] Command
[Instructions]
## Arguments
- [arg]: [description]
## Instructions
[steps]For updates: Read the existing file, then Edit to add the new pattern.
Verify the file is valid, then:
git add [file]
git commit -m "feat(infra): add [name] [type] - [brief description]"Tell the user:
- What was created
- File location
- How to invoke it
- Commit hash
/codify "shorter paragraphs work better for chat contexts"
/codify "validation after generation catches 80% of issues"
/codify
Every /codify invocation:
- Captures knowledge that would otherwise evaporate
- Improves all future work that touches that pattern
- Builds compound returns from your iterations
This is meta-level investment. Don't skip it.