| name | description |
|---|---|
runbooks |
Explains the runbook system for accumulating learnings including patterns, anti-patterns, and service-specific guidance. Use when understanding how agents use runbooks or when manually adding entries. |
This skill explains the runbook system for accumulating learnings.
Each agent has a companion runbook that accumulates learnings from past features:
- Patterns that worked
- Anti-patterns discovered
- Common mistakes
- Service-specific guidance
Runbooks live in service repositories:
.claude/skills/runbooks/
├── product-discovery/
│ └── RUNBOOK.md
├── api-dev/
│ └── RUNBOOK.md
├── code-reviewer/
│ └── RUNBOOK.md
└── ...
# [Agent Name] Runbook
Last updated: YYYY-MM-DD
## Patterns That Work
### [Pattern Name]
**Context**: When to use this pattern
**Pattern**: What to do
**Example**:
```go
// Code exampleLearned from: [Feature/PR reference]
Problem: What went wrong
Why it's bad: Impact
Instead: What to do instead
Learned from: [Feature/PR reference]
[Service-specific guidance for this agent's work]
- [Mistake 1]: [How to avoid]
- [Mistake 2]: [How to avoid]
## Updating Runbooks
After completing a feature or resolving an issue:
1. Identify reusable learnings
2. Categorize (pattern, anti-pattern, note)
3. Document with context
4. Reference the source (PR, issue)
## Agent Integration
Agents read their runbook during context discovery:
```markdown
## Context Discovery
...
5. Read your runbook at `.claude/skills/runbooks/{agent-name}/RUNBOOK.md` if it exists
Runbooks are automatically updated by the learning engine:
- code-reviewer logs findings to
.claude/review-findings.jsonlwith pattern names - Agents log session learnings to
.claude/session-learnings.jsonl /evolvecommand analyzes findings, calculates confidence, detects trends- Auto-promotion adds high-confidence patterns to runbooks
Patterns are automatically promoted when:
- Occurrence count >= 3
- Confidence score >= 0.6
- Pattern has a clear description
- Pattern is not already promoted
### {Pattern Name} (Auto-generated)
**Confidence**: 0.85 | **Occurrences**: 7 | **Trend**: stable
**Context**: When this pattern appears
**Anti-Pattern**: What to avoid
**Instead**: What to do
**Learned from**: PR #123, PR #145, PR #167
*Auto-generated by learning engine on 2025-01-15*- Manual entries: Added by humans, take precedence
- Auto-generated entries: Added by
/evolve, marked with "(Auto-generated)" - Conflicts: Manual entries are preserved; auto entries update statistics only
| Command | Purpose |
|---|---|
/evolve |
Analyze findings and update runbooks |
/patterns |
View pattern statistics |
/trends |
View pattern trends and alerts |
See learning-engine/SKILL.md for full documentation.
Some learnings apply to multiple agents. These should be:
- Documented in each relevant runbook
- OR extracted to a shared skill
### Use sync.Once for Storage Initialization
**Context**: When creating REST storage handlers
**Pattern**: Use sync.Once to lazily initialize storage backends
**Example**:
```go
type REST struct {
store storage.Interface
storeOnce sync.Once
}
func (r *REST) getStore() storage.Interface {
r.storeOnce.Do(func() {
r.store = newStorageBackend()
})
return r.store
}Learned from: PR #123 - Race condition in storage initialization