improve-agentlisted
Install: claude install-skill stempeck/agentfactory
# Improve Agent Formula
Surgical improvement of a formula TOML based on observed execution failures or required manual intervention.
## Invocation
`/improve-agent <formula-path>` or `/improve-agent <agent-name>`
If agent-name given, resolve to `$AF_ROOT/.agentfactory/store/formulas/<agent-name>.formula.toml`.
## Phase 1: Gather Evidence
Collect what went wrong. Ask the user if not already clear from conversation context:
1. **What manual work was required after the formula ran?**
2. **Which files/paths were affected?**
3. **What was the expected state vs actual state?**
Record as a structured gap:
```
GAP: <one-line description>
EXPECTED: <what should have happened>
ACTUAL: <what happened instead>
MANUAL FIX: <what the operator had to do>
AFFECTED PATHS: <specific files/directories>
```
## Phase 2: Read and Understand the Formula
Read the full formula TOML. For each step, note:
- What it produces (artifacts, signals, commits)
- Where it writes (paths relative to `$AF_ROOT`)
- What it commits and pushes
**Output** — state explicitly:
- **Insertion point**: Step ID, action number
- **Why here**: What precedes it (must be after X) and what follows it (must be before Y)
## Phase 3: Classify the Failure
Before designing any fix, categorize the gap. State which type:
| Category | Symptoms | Pattern file section |
|----------|----------|---------------------|
| **Artifact pollution** | Unwanted files in PR, wrong paths committed, intermediate outputs visible | `## Art