@soleri/forge 5.14.2 → 5.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/skills/skills/brain-debrief.md +214 -0
- package/dist/skills/skills/brainstorming.md +180 -0
- package/dist/skills/skills/code-patrol.md +178 -0
- package/dist/skills/skills/context-resume.md +146 -0
- package/dist/skills/skills/deliver-and-ship.md +123 -0
- package/dist/skills/skills/env-setup.md +151 -0
- package/dist/skills/skills/executing-plans.md +216 -0
- package/dist/skills/skills/fix-and-learn.md +167 -0
- package/dist/skills/skills/health-check.md +231 -0
- package/dist/skills/skills/knowledge-harvest.md +185 -0
- package/dist/skills/skills/onboard-me.md +198 -0
- package/dist/skills/skills/retrospective.md +205 -0
- package/dist/skills/skills/second-opinion.md +149 -0
- package/dist/skills/skills/systematic-debugging.md +241 -0
- package/dist/skills/skills/test-driven-development.md +281 -0
- package/dist/skills/skills/vault-capture.md +170 -0
- package/dist/skills/skills/vault-navigator.md +140 -0
- package/dist/skills/skills/verification-before-completion.md +182 -0
- package/dist/skills/skills/writing-plans.md +215 -0
- package/dist/templates/skills.js +1 -0
- package/dist/templates/skills.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/scaffolder.test.ts +3 -1
- package/src/skills/deliver-and-ship.md +123 -0
- package/src/skills/env-setup.md +151 -0
- package/src/templates/skills.ts +1 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brain-debrief
|
|
3
|
+
description: Use when the user asks "what have I learned", "brain stats", "pattern strengths", "cross-project insights", "intelligence report", "show me patterns", "what's working", "learning summary", or wants to explore accumulated knowledge and see what the brain has learned.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Brain Debrief — Intelligence Report
|
|
7
|
+
|
|
8
|
+
Surface what the brain has learned across sessions and projects. This turns raw vault data into actionable intelligence.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
When the user wants to understand what patterns have proven valuable, what anti-patterns keep recurring, how knowledge is distributed across projects, or wants a "state of intelligence" report.
|
|
13
|
+
|
|
14
|
+
## Orchestration by Query Type
|
|
15
|
+
|
|
16
|
+
### "What have I learned?" (General debrief)
|
|
17
|
+
|
|
18
|
+
1. Get the big picture:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
YOUR_AGENT_core op:brain_stats
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Total sessions, patterns captured, quality scores, coverage gaps.
|
|
25
|
+
|
|
26
|
+
2. Get patterns ranked by proven strength:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
YOUR_AGENT_core op:brain_strengths
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Focus on strength >= 70 and successRate >= 0.7.
|
|
33
|
+
|
|
34
|
+
3. Check memory landscape:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
YOUR_AGENT_core op:memory_topics
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Shows how knowledge clusters by topic.
|
|
41
|
+
|
|
42
|
+
4. Check for stale knowledge:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
YOUR_AGENT_core op:vault_age_report
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Find entries that haven't been updated recently — candidates for review.
|
|
49
|
+
|
|
50
|
+
5. Run a curator health audit:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
YOUR_AGENT_core op:curator_health_audit
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Vault quality score, tag normalization status, duplicate density.
|
|
57
|
+
|
|
58
|
+
6. Present: top 5 strongest patterns, top 3 recurring anti-patterns, stale entries needing refresh, and coverage gaps.
|
|
59
|
+
|
|
60
|
+
### "What's working across projects?" (Cross-project intelligence)
|
|
61
|
+
|
|
62
|
+
1. Get patterns promoted to the global pool:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
YOUR_AGENT_core op:brain_global_patterns
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
2. Get recommendations based on project similarity:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
YOUR_AGENT_core op:brain_recommend
|
|
72
|
+
params: { projectName: "<current project>" }
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
3. Check linked projects:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
YOUR_AGENT_core op:project_linked_projects
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
4. Search across all projects for relevant patterns:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
YOUR_AGENT_core op:memory_cross_project_search
|
|
85
|
+
params: { query: "<topic>", crossProject: true }
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
5. Present: patterns from other projects that would apply here, ranked by relevance.
|
|
89
|
+
|
|
90
|
+
### "Am I getting smarter?" (Learning velocity)
|
|
91
|
+
|
|
92
|
+
1. Recent stats:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
YOUR_AGENT_core op:brain_stats
|
|
96
|
+
params: { since: "<7 days ago>" }
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
2. Longer period for comparison:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
YOUR_AGENT_core op:brain_stats
|
|
103
|
+
params: { since: "<30 days ago>" }
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
3. Memory stats:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
YOUR_AGENT_core op:memory_stats
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
4. Vault analytics:
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
YOUR_AGENT_core op:admin_vault_analytics
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
5. Search insights — what queries are people running, what's missing:
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
YOUR_AGENT_core op:admin_search_insights
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
6. Present: new patterns captured, strength changes, domains growing vs stagnant, search miss analysis.
|
|
125
|
+
|
|
126
|
+
### "Build fresh intelligence" (Rebuild)
|
|
127
|
+
|
|
128
|
+
1. Run the full pipeline:
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
YOUR_AGENT_core op:brain_build_intelligence
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Compute strengths, update global registry, refresh project profiles.
|
|
135
|
+
|
|
136
|
+
2. Consolidate vault (curator cleanup):
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
YOUR_AGENT_core op:curator_consolidate
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
3. Show updated metrics:
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
YOUR_AGENT_core op:brain_stats
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
4. Present: what changed after the rebuild.
|
|
149
|
+
|
|
150
|
+
### "Export what I know" (Portability)
|
|
151
|
+
|
|
152
|
+
Export brain intelligence:
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
YOUR_AGENT_core op:brain_export
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Export memory:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
YOUR_AGENT_core op:memory_export
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Export vault as backup:
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
YOUR_AGENT_core op:vault_backup
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
These can be imported into another vault:
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
YOUR_AGENT_core op:brain_import
|
|
174
|
+
YOUR_AGENT_core op:memory_import
|
|
175
|
+
YOUR_AGENT_core op:vault_import
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Presenting Intelligence
|
|
179
|
+
|
|
180
|
+
Format as a report:
|
|
181
|
+
|
|
182
|
+
- **Strengths**: Top patterns with strength scores and domains
|
|
183
|
+
- **Risks**: Recurring anti-patterns that keep appearing
|
|
184
|
+
- **Gaps**: Domains with low coverage or stale knowledge
|
|
185
|
+
- **Stale**: Entries needing refresh (from age report)
|
|
186
|
+
- **Quality**: Curator health audit score
|
|
187
|
+
- **Recommendations**: What to focus on learning next
|
|
188
|
+
- **Search Misses**: What people are looking for but not finding
|
|
189
|
+
|
|
190
|
+
## Exit Criteria
|
|
191
|
+
|
|
192
|
+
Debrief is complete when the user's specific question has been answered with data from the brain. For general debriefs, present stats + strengths + gaps + stale entries at minimum.
|
|
193
|
+
|
|
194
|
+
## Agent Tools Reference
|
|
195
|
+
|
|
196
|
+
| Op | When to Use |
|
|
197
|
+
| --------------------------------- | ----------------------------------------------- |
|
|
198
|
+
| `brain_stats` | Aggregate metrics — sessions, patterns, quality |
|
|
199
|
+
| `brain_strengths` | Patterns ranked by proven strength |
|
|
200
|
+
| `brain_global_patterns` | Cross-project promoted patterns |
|
|
201
|
+
| `brain_recommend` | Project-similarity recommendations |
|
|
202
|
+
| `brain_build_intelligence` | Rebuild full intelligence pipeline |
|
|
203
|
+
| `brain_export` / `brain_import` | Portable intelligence transfer |
|
|
204
|
+
| `memory_topics` | Knowledge clusters by topic |
|
|
205
|
+
| `memory_stats` | Memory statistics |
|
|
206
|
+
| `memory_export` / `memory_import` | Memory portability |
|
|
207
|
+
| `memory_cross_project_search` | Search across linked projects |
|
|
208
|
+
| `vault_age_report` | Find stale entries needing refresh |
|
|
209
|
+
| `vault_backup` / `vault_import` | Vault backup and restore |
|
|
210
|
+
| `curator_health_audit` | Vault quality score and status |
|
|
211
|
+
| `curator_consolidate` | Full vault cleanup pipeline |
|
|
212
|
+
| `admin_vault_analytics` | Overall knowledge quality metrics |
|
|
213
|
+
| `admin_search_insights` | Search miss analysis — what's not found |
|
|
214
|
+
| `project_linked_projects` | See connected projects |
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brainstorming
|
|
3
|
+
description: 'You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- Adapted from superpowers (MIT License) -->
|
|
7
|
+
|
|
8
|
+
# Brainstorming Ideas Into Designs
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Help turn ideas into fully formed designs and specs through natural collaborative dialogue.
|
|
13
|
+
|
|
14
|
+
Start by understanding the current project context, then ask questions one at a time to refine the idea. Once you understand what you're building, present the design and get user approval.
|
|
15
|
+
|
|
16
|
+
<HARD-GATE>
|
|
17
|
+
Do NOT invoke any implementation skill, write any code, scaffold any project, or take any implementation action until you have presented a design and the user has approved it. This applies to EVERY project regardless of perceived simplicity.
|
|
18
|
+
</HARD-GATE>
|
|
19
|
+
|
|
20
|
+
## Anti-Pattern: "This Is Too Simple To Need A Design"
|
|
21
|
+
|
|
22
|
+
Every project goes through this process. A todo list, a single-function utility, a config change — all of them. "Simple" projects are where unexamined assumptions cause the most wasted work. The design can be short (a few sentences for truly simple projects), but you MUST present it and get approval.
|
|
23
|
+
|
|
24
|
+
## Checklist
|
|
25
|
+
|
|
26
|
+
You MUST create a task for each of these items and complete them in order:
|
|
27
|
+
|
|
28
|
+
1. **Classify intent** — understand what type of work this is
|
|
29
|
+
2. **Search vault for prior art** — check if something similar was built, decided, or rejected before
|
|
30
|
+
3. **Search web for existing solutions** — don't build what already exists
|
|
31
|
+
4. **Explore project context** — check files, docs, recent commits
|
|
32
|
+
5. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
|
|
33
|
+
6. **Propose 2-3 approaches** — with trade-offs and your recommendation
|
|
34
|
+
7. **Present design** — in sections scaled to their complexity, get user approval after each section
|
|
35
|
+
8. **Capture design decision** — persist the decision to the vault
|
|
36
|
+
9. **Write design doc** — save to `docs/plans/YYYY-MM-DD-<topic>-design.md` and commit
|
|
37
|
+
10. **Transition to implementation** — invoke writing-plans skill to create implementation plan
|
|
38
|
+
|
|
39
|
+
## Step 0: Classify Intent
|
|
40
|
+
|
|
41
|
+
Before anything else, understand the type of work:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
YOUR_AGENT_core op:route_intent
|
|
45
|
+
params: { prompt: "<the user's request>" }
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This returns the intent type (BUILD, FIX, VALIDATE, DESIGN, IMPROVE, DELIVER) and routing guidance. Use this to focus the brainstorming — a FIX intent needs different questions than a BUILD intent.
|
|
49
|
+
|
|
50
|
+
## Step 1: Search Before Designing — Vault, Then Web
|
|
51
|
+
|
|
52
|
+
**BEFORE asking any questions or exploring code**, search for existing knowledge. Follow this order:
|
|
53
|
+
|
|
54
|
+
### Vault First
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
YOUR_AGENT_core op:search_intelligent
|
|
58
|
+
params: { query: "<the feature or idea the user described>" }
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Look for:
|
|
62
|
+
|
|
63
|
+
- **Previous designs** — was this discussed or attempted before?
|
|
64
|
+
- **Architectural decisions** — are there constraints from past decisions?
|
|
65
|
+
- **Patterns** — established approaches in this codebase
|
|
66
|
+
- **Anti-patterns** — approaches that were tried and failed
|
|
67
|
+
|
|
68
|
+
Browse the knowledge landscape for related context:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
YOUR_AGENT_core op:vault_tags
|
|
72
|
+
YOUR_AGENT_core op:vault_domains
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Check what the brain says about proven patterns in this domain:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
YOUR_AGENT_core op:brain_strengths
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Check if other linked projects have solved this:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
YOUR_AGENT_core op:memory_cross_project_search
|
|
85
|
+
params: { query: "<the feature>", crossProject: true }
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Web Search Second
|
|
89
|
+
|
|
90
|
+
If the vault doesn't have prior art, search the web for:
|
|
91
|
+
|
|
92
|
+
- **Existing libraries/tools** that solve this problem (don't build what exists)
|
|
93
|
+
- **Reference implementations** in similar projects
|
|
94
|
+
- **Best practices** and established patterns for this type of feature
|
|
95
|
+
- **Known pitfalls** that others have documented
|
|
96
|
+
|
|
97
|
+
### Present Findings
|
|
98
|
+
|
|
99
|
+
Present vault + web findings to the user: "Before we design this, here's what I found..." This informs the design conversation and prevents reinventing solutions.
|
|
100
|
+
|
|
101
|
+
## The Process
|
|
102
|
+
|
|
103
|
+
**Understanding the idea:**
|
|
104
|
+
|
|
105
|
+
- Check out the current project state first (files, docs, recent commits)
|
|
106
|
+
- Ask questions one at a time to refine the idea
|
|
107
|
+
- Prefer multiple choice questions when possible, but open-ended is fine too
|
|
108
|
+
- Only one question per message
|
|
109
|
+
- Focus on understanding: purpose, constraints, success criteria
|
|
110
|
+
|
|
111
|
+
**Exploring approaches:**
|
|
112
|
+
|
|
113
|
+
- Propose 2-3 different approaches with trade-offs
|
|
114
|
+
- Present options conversationally with your recommendation and reasoning
|
|
115
|
+
- Lead with your recommended option and explain why
|
|
116
|
+
- **Reference vault patterns** — if the vault has a proven approach, lead with it
|
|
117
|
+
- **Reference web findings** — if an existing library solves this, recommend it over custom code
|
|
118
|
+
|
|
119
|
+
**Presenting the design:**
|
|
120
|
+
|
|
121
|
+
- Once you understand what you're building, present the design
|
|
122
|
+
- Scale each section to its complexity
|
|
123
|
+
- Ask after each section whether it looks right so far
|
|
124
|
+
- Cover: architecture, components, data flow, error handling, testing
|
|
125
|
+
|
|
126
|
+
## After the Design
|
|
127
|
+
|
|
128
|
+
**Capture the design decision to the vault:**
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
YOUR_AGENT_core op:capture_knowledge
|
|
132
|
+
params: {
|
|
133
|
+
title: "<feature name> — design decision",
|
|
134
|
+
description: "<chosen approach, rationale, rejected alternatives>",
|
|
135
|
+
type: "decision",
|
|
136
|
+
category: "<relevant domain>",
|
|
137
|
+
tags: ["<relevant>", "<tags>", "design-decision"]
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
This ensures future brainstorming sessions can reference what was decided and why.
|
|
142
|
+
|
|
143
|
+
**Documentation:**
|
|
144
|
+
|
|
145
|
+
- Write the validated design to `docs/plans/YYYY-MM-DD-<topic>-design.md`
|
|
146
|
+
- Commit the design document to git
|
|
147
|
+
|
|
148
|
+
**Implementation:**
|
|
149
|
+
|
|
150
|
+
- Invoke the writing-plans skill to create a detailed implementation plan
|
|
151
|
+
- Do NOT invoke any other skill. writing-plans is the next step.
|
|
152
|
+
|
|
153
|
+
## Process Flow
|
|
154
|
+
|
|
155
|
+
**The terminal state is invoking writing-plans.** Do NOT invoke any other implementation skill. The ONLY skill you invoke after brainstorming is writing-plans.
|
|
156
|
+
|
|
157
|
+
## Key Principles
|
|
158
|
+
|
|
159
|
+
- **Classify first** — understand intent before diving in
|
|
160
|
+
- **Vault first** — don't reinvent what's been decided or solved before
|
|
161
|
+
- **Web second** — don't build what already exists as a library
|
|
162
|
+
- **One question at a time** — don't overwhelm with multiple questions
|
|
163
|
+
- **Multiple choice preferred** — easier to answer than open-ended when possible
|
|
164
|
+
- **YAGNI ruthlessly** — remove unnecessary features from all designs
|
|
165
|
+
- **Explore alternatives** — always propose 2-3 approaches before settling
|
|
166
|
+
- **Incremental validation** — present design, get approval before moving on
|
|
167
|
+
- **Capture decisions** — every design decision gets persisted to the vault
|
|
168
|
+
- **Cross-project learning** — check if other projects solved this already
|
|
169
|
+
- **Be flexible** — go back and clarify when something doesn't make sense
|
|
170
|
+
|
|
171
|
+
## Agent Tools Reference
|
|
172
|
+
|
|
173
|
+
| Op | When to Use |
|
|
174
|
+
| ------------------------------ | -------------------------------------------- |
|
|
175
|
+
| `route_intent` | Classify the type of work (BUILD, FIX, etc.) |
|
|
176
|
+
| `search_intelligent` | Search vault for prior art |
|
|
177
|
+
| `vault_tags` / `vault_domains` | Browse knowledge landscape |
|
|
178
|
+
| `brain_strengths` | Check proven patterns |
|
|
179
|
+
| `memory_cross_project_search` | Check if other projects solved this |
|
|
180
|
+
| `capture_knowledge` | Persist design decision to vault |
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-patrol
|
|
3
|
+
description: Use when the user asks "review this code", "check this against patterns", "code patrol", "does this follow our rules", "validate against vault", "check for anti-patterns", or wants code reviewed not against generic lint rules but against the project's own captured patterns, anti-patterns, and conventions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Code Patrol — Review Code Against Your Own Knowledge
|
|
7
|
+
|
|
8
|
+
Review code against the vault's patterns, anti-patterns, and project conventions — not generic lint rules, but YOUR team's captured knowledge applied to new code. Catches violations that no linter knows about.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
- Before committing or creating a PR
|
|
13
|
+
- "Does this follow our patterns?"
|
|
14
|
+
- "Check this code against our rules"
|
|
15
|
+
- Code review with institutional knowledge
|
|
16
|
+
- After writing implementation code
|
|
17
|
+
|
|
18
|
+
## The Magic: Project-Specific Code Intelligence
|
|
19
|
+
|
|
20
|
+
### Step 1: Understand the Code's Domain
|
|
21
|
+
|
|
22
|
+
Classify what domain this code belongs to:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
YOUR_AGENT_core op:route_intent
|
|
26
|
+
params: { prompt: "Code review: <brief description of the code>" }
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Determine which vault domains are relevant:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
YOUR_AGENT_core op:vault_domains
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Step 2: Load Relevant Patterns
|
|
36
|
+
|
|
37
|
+
Search for patterns in the code's domain:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
YOUR_AGENT_core op:search_intelligent
|
|
41
|
+
params: { query: "<what this code does>" }
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Search specifically for anti-patterns to check against:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
YOUR_AGENT_core op:search
|
|
48
|
+
params: { type: "anti-pattern" }
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Search for critical rules that must not be violated:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
YOUR_AGENT_core op:search
|
|
55
|
+
params: { severity: "critical" }
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Load project-specific rules:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
YOUR_AGENT_core op:project_list_rules
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
YOUR_AGENT_core op:get_behavior_rules
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Get proven approaches from the brain:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
YOUR_AGENT_core op:brain_strengths
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Step 3: Review the Code
|
|
75
|
+
|
|
76
|
+
With vault patterns loaded, review the code checking for:
|
|
77
|
+
|
|
78
|
+
| Check | Source | Severity |
|
|
79
|
+
| -------------------------------------- | ----------------------------- | ------------- |
|
|
80
|
+
| Violates a critical rule | `search (severity: critical)` | Must fix |
|
|
81
|
+
| Matches a known anti-pattern | `search (type: anti-pattern)` | Must fix |
|
|
82
|
+
| Doesn't follow a proven pattern | `brain_strengths` | Should fix |
|
|
83
|
+
| Breaks project conventions | `project_list_rules` | Should fix |
|
|
84
|
+
| Misses an opportunity to use a pattern | `search_intelligent` | Could improve |
|
|
85
|
+
|
|
86
|
+
### Step 4: Present the Review
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
## Code Patrol Report
|
|
90
|
+
|
|
91
|
+
### Must Fix (Critical)
|
|
92
|
+
- **[Rule name]**: [What's wrong and why]
|
|
93
|
+
Vault ref: [entry title] (severity: critical)
|
|
94
|
+
Fix: [How to fix it]
|
|
95
|
+
|
|
96
|
+
### Should Fix (Warning)
|
|
97
|
+
- **[Anti-pattern name]**: [What's wrong]
|
|
98
|
+
Vault ref: [entry title] (type: anti-pattern)
|
|
99
|
+
Better approach: [The pattern to follow]
|
|
100
|
+
|
|
101
|
+
### Could Improve (Suggestion)
|
|
102
|
+
- **[Pattern opportunity]**: [The code works but could benefit from...]
|
|
103
|
+
Vault ref: [entry title] (type: pattern)
|
|
104
|
+
|
|
105
|
+
### Looks Good
|
|
106
|
+
- [What the code does well — patterns it follows correctly]
|
|
107
|
+
|
|
108
|
+
### Summary
|
|
109
|
+
X critical issues, Y warnings, Z suggestions
|
|
110
|
+
Patterns followed: [list]
|
|
111
|
+
Patterns missed: [list]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Step 5: Learn From the Review
|
|
115
|
+
|
|
116
|
+
If the review reveals a new pattern or anti-pattern not in the vault, capture it:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
YOUR_AGENT_core op:capture_quick
|
|
120
|
+
params: {
|
|
121
|
+
title: "<new pattern or anti-pattern discovered>",
|
|
122
|
+
description: "<what it is, when it applies>"
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
If the review reveals a knowledge gap, note it:
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
YOUR_AGENT_core op:capture_knowledge
|
|
130
|
+
params: {
|
|
131
|
+
title: "<missing convention>",
|
|
132
|
+
description: "<this should be documented as a project rule>",
|
|
133
|
+
type: "principle",
|
|
134
|
+
category: "<domain>",
|
|
135
|
+
tags: ["convention", "code-review"]
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Step 6: Verify After Fixes
|
|
140
|
+
|
|
141
|
+
After the user applies fixes, re-run the patrol to confirm clean:
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
YOUR_AGENT_core op:search_intelligent
|
|
145
|
+
params: { query: "<re-check the specific violations>" }
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Check system health:
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
YOUR_AGENT_core op:admin_health
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## The Magic
|
|
155
|
+
|
|
156
|
+
This feels like magic because:
|
|
157
|
+
|
|
158
|
+
1. It's not ESLint — it catches things like "we decided not to use inheritance here" or "this API pattern caused production issues last month"
|
|
159
|
+
2. The rules come from YOUR team's experience, not a generic config file
|
|
160
|
+
3. It gets smarter over time — every captured pattern becomes a new check
|
|
161
|
+
4. It catches institutional knowledge violations that no static analyzer can
|
|
162
|
+
|
|
163
|
+
A linter checks syntax. Code patrol checks wisdom.
|
|
164
|
+
|
|
165
|
+
## Agent Tools Reference
|
|
166
|
+
|
|
167
|
+
| Op | When to Use |
|
|
168
|
+
| -------------------- | --------------------------------------------- |
|
|
169
|
+
| `route_intent` | Classify the code's domain |
|
|
170
|
+
| `vault_domains` | See which domains are relevant |
|
|
171
|
+
| `search_intelligent` | Find relevant patterns for this code |
|
|
172
|
+
| `search` | Find anti-patterns and critical rules |
|
|
173
|
+
| `project_list_rules` | Project-specific conventions |
|
|
174
|
+
| `get_behavior_rules` | Behavioral rules |
|
|
175
|
+
| `brain_strengths` | Proven patterns to check against |
|
|
176
|
+
| `capture_quick` | Capture new patterns discovered during review |
|
|
177
|
+
| `capture_knowledge` | Capture new conventions |
|
|
178
|
+
| `admin_health` | Post-review health check |
|