@soleri/forge 9.0.0 → 9.0.1

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.
Files changed (84) hide show
  1. package/dist/scaffold-filetree.js +15 -1
  2. package/dist/scaffold-filetree.js.map +1 -1
  3. package/dist/skills/brain-debrief/SKILL.md +66 -0
  4. package/dist/skills/brainstorming/SKILL.md +85 -0
  5. package/dist/skills/code-patrol/SKILL.md +86 -0
  6. package/dist/skills/context-resume/SKILL.md +92 -0
  7. package/dist/skills/executing-plans/SKILL.md +87 -0
  8. package/dist/skills/fix-and-learn/SKILL.md +98 -0
  9. package/dist/skills/health-check/SKILL.md +131 -0
  10. package/dist/skills/knowledge-harvest/SKILL.md +93 -0
  11. package/dist/skills/onboard-me/SKILL.md +118 -0
  12. package/dist/skills/retrospective/SKILL.md +95 -0
  13. package/dist/skills/second-opinion/SKILL.md +97 -0
  14. package/dist/skills/systematic-debugging/SKILL.md +99 -0
  15. package/dist/skills/test-driven-development/SKILL.md +91 -0
  16. package/dist/skills/vault-capture/SKILL.md +82 -0
  17. package/dist/skills/vault-navigator/SKILL.md +80 -0
  18. package/dist/skills/verification-before-completion/SKILL.md +82 -0
  19. package/dist/skills/writing-plans/SKILL.md +105 -0
  20. package/package.json +1 -1
  21. package/src/scaffold-filetree.ts +16 -1
  22. package/src/skills/brain-debrief/SKILL.md +66 -0
  23. package/src/skills/brainstorming/SKILL.md +85 -0
  24. package/src/skills/code-patrol/SKILL.md +86 -0
  25. package/src/skills/context-resume/SKILL.md +92 -0
  26. package/src/skills/executing-plans/SKILL.md +87 -0
  27. package/src/skills/fix-and-learn/SKILL.md +98 -0
  28. package/src/skills/health-check/SKILL.md +131 -0
  29. package/src/skills/knowledge-harvest/SKILL.md +93 -0
  30. package/src/skills/onboard-me/SKILL.md +118 -0
  31. package/src/skills/retrospective/SKILL.md +95 -0
  32. package/src/skills/second-opinion/SKILL.md +97 -0
  33. package/src/skills/systematic-debugging/SKILL.md +99 -0
  34. package/src/skills/test-driven-development/SKILL.md +91 -0
  35. package/src/skills/vault-capture/SKILL.md +82 -0
  36. package/src/skills/vault-navigator/SKILL.md +80 -0
  37. package/src/skills/verification-before-completion/SKILL.md +82 -0
  38. package/src/skills/writing-plans/SKILL.md +105 -0
  39. package/dist/skills/agent-dev.md +0 -122
  40. package/dist/skills/agent-guide.md +0 -110
  41. package/dist/skills/agent-persona.md +0 -66
  42. package/dist/skills/brain-debrief.md +0 -214
  43. package/dist/skills/brainstorming.md +0 -180
  44. package/dist/skills/code-patrol.md +0 -178
  45. package/dist/skills/context-resume.md +0 -146
  46. package/dist/skills/deliver-and-ship.md +0 -123
  47. package/dist/skills/env-setup.md +0 -151
  48. package/dist/skills/executing-plans.md +0 -216
  49. package/dist/skills/fix-and-learn.md +0 -167
  50. package/dist/skills/health-check.md +0 -231
  51. package/dist/skills/knowledge-harvest.md +0 -185
  52. package/dist/skills/onboard-me.md +0 -198
  53. package/dist/skills/retrospective.md +0 -205
  54. package/dist/skills/second-opinion.md +0 -149
  55. package/dist/skills/systematic-debugging.md +0 -241
  56. package/dist/skills/test-driven-development.md +0 -281
  57. package/dist/skills/vault-capture.md +0 -170
  58. package/dist/skills/vault-curate.md +0 -107
  59. package/dist/skills/vault-navigator.md +0 -140
  60. package/dist/skills/verification-before-completion.md +0 -182
  61. package/dist/skills/writing-plans.md +0 -215
  62. package/src/skills/agent-dev.md +0 -122
  63. package/src/skills/agent-guide.md +0 -110
  64. package/src/skills/agent-persona.md +0 -66
  65. package/src/skills/brain-debrief.md +0 -214
  66. package/src/skills/brainstorming.md +0 -180
  67. package/src/skills/code-patrol.md +0 -178
  68. package/src/skills/context-resume.md +0 -146
  69. package/src/skills/deliver-and-ship.md +0 -123
  70. package/src/skills/env-setup.md +0 -151
  71. package/src/skills/executing-plans.md +0 -216
  72. package/src/skills/fix-and-learn.md +0 -167
  73. package/src/skills/health-check.md +0 -231
  74. package/src/skills/knowledge-harvest.md +0 -185
  75. package/src/skills/onboard-me.md +0 -198
  76. package/src/skills/retrospective.md +0 -205
  77. package/src/skills/second-opinion.md +0 -149
  78. package/src/skills/systematic-debugging.md +0 -241
  79. package/src/skills/test-driven-development.md +0 -281
  80. package/src/skills/vault-capture.md +0 -170
  81. package/src/skills/vault-curate.md +0 -107
  82. package/src/skills/vault-navigator.md +0 -140
  83. package/src/skills/verification-before-completion.md +0 -182
  84. package/src/skills/writing-plans.md +0 -215
@@ -0,0 +1,131 @@
1
+ ---
2
+ name: health-check
3
+ description: Use when running maintenance on the knowledge base — deduplication, contradiction resolution, stale entry cleanup, or vault quality auditing.
4
+ ---
5
+
6
+ # Health Check — Knowledge Base Maintenance
7
+
8
+ Comprehensive maintenance cycle on the knowledge base. Finds stale entries, duplicates, contradictions, and quality issues.
9
+
10
+ ## Steps
11
+
12
+ ### 1. System Health
13
+
14
+ ```
15
+ ernesto_core op:admin_health
16
+ ernesto_core op:admin_diagnostic
17
+ ```
18
+
19
+ ### 2. Vault Metrics
20
+
21
+ ```
22
+ ernesto_core op:admin_vault_size
23
+ ernesto_core op:admin_vault_analytics
24
+ ernesto_core op:vault_domains
25
+ ernesto_core op:vault_tags
26
+ ```
27
+
28
+ ### 3. Quality Audit
29
+
30
+ ```
31
+ ernesto_core op:curator_health_audit
32
+ ```
33
+
34
+ ### 4. Find Duplicates
35
+
36
+ ```
37
+ ernesto_core op:curator_detect_duplicates
38
+ ```
39
+
40
+ ### 5. Find Contradictions
41
+
42
+ ```
43
+ ernesto_core op:curator_contradictions
44
+ ernesto_core op:curator_resolve_contradiction
45
+ params: { contradictionId: "<id>" }
46
+ ```
47
+
48
+ ### 6. Find Stale Entries
49
+
50
+ ```
51
+ ernesto_core op:vault_age_report
52
+ ```
53
+
54
+ Entries >30 days without updates: refresh, archive, or delete.
55
+
56
+ ### 7. Check Search Quality
57
+
58
+ ```
59
+ ernesto_core op:admin_search_insights
60
+ ```
61
+
62
+ ### 8. Memory Health
63
+
64
+ ```
65
+ ernesto_core op:memory_stats
66
+ ernesto_core op:memory_deduplicate
67
+ ```
68
+
69
+ ### 9. Governance Queue
70
+
71
+ ```
72
+ ernesto_core op:governance_proposals params: { action: "list" }
73
+ ernesto_core op:governance_expire
74
+ ```
75
+
76
+ ### 10. Fix Everything (Optional, with user approval)
77
+
78
+ - `op:curator_groom_all` — normalize tags, fix metadata
79
+ - `op:curator_consolidate` — deduplicate, normalize, quality-score
80
+ - `op:memory_prune` — remove stale memories
81
+ - `op:brain_build_intelligence` — rebuild with clean data
82
+ - `op:admin_reset_cache` — clear caches
83
+
84
+ ## Presenting the Report
85
+
86
+ ```
87
+ ## Knowledge Health Report
88
+
89
+ ### System
90
+ | Check | Status |
91
+ |-------|--------|
92
+ | Infrastructure | OK / Issues |
93
+
94
+ ### Vault Quality
95
+ | Metric | Value | Status |
96
+ |--------|-------|--------|
97
+ | Total entries | X | — |
98
+ | Quality score | X/100 | Good/Warning/Critical |
99
+
100
+ ### Issues Found
101
+ | Issue | Count | Action |
102
+ |-------|-------|--------|
103
+ | Duplicates | X | Merge |
104
+ | Contradictions | X | Resolve |
105
+ | Stale entries (>30d) | X | Review |
106
+ | Search misses | X | Fill gaps |
107
+
108
+ ### Recommended Actions
109
+ 1. [Most impactful fix]
110
+ 2. [Second most impactful]
111
+ ```
112
+
113
+ ## Common Mistakes
114
+
115
+ - Running cleanup without presenting findings to user first
116
+ - Skipping search insights (missing knowledge gaps)
117
+ - Not rebuilding brain intelligence after major cleanup
118
+
119
+ ## Quick Reference
120
+
121
+ | Op | When to Use |
122
+ |----|-------------|
123
+ | `admin_health` / `admin_diagnostic` | System health |
124
+ | `admin_vault_analytics` / `admin_vault_size` | Vault metrics |
125
+ | `curator_health_audit` | Quality score |
126
+ | `curator_detect_duplicates` | Find duplicates |
127
+ | `curator_contradictions` | Find conflicts |
128
+ | `vault_age_report` | Stale entries |
129
+ | `admin_search_insights` | Search miss analysis |
130
+ | `curator_consolidate` | Full cleanup pipeline |
131
+ | `brain_build_intelligence` | Rebuild after cleanup |
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: knowledge-harvest
3
+ description: Use when pointing at code, docs, PRs, or any text to automatically extract and capture patterns, anti-patterns, and decisions into the vault.
4
+ ---
5
+
6
+ # Knowledge Harvest — Extract Patterns From Anything
7
+
8
+ Point at code, docs, PRs, architecture decisions, or postmortems — the agent extracts every pattern, anti-pattern, decision, and principle, then captures them to the vault.
9
+
10
+ ## Steps
11
+
12
+ ### 1. Understand the Source
13
+
14
+ Read target content and classify: `ernesto_core op:route_intent params: { prompt: "Extract knowledge from: <source>" }`
15
+
16
+ ### 2. Check What's Already Known
17
+
18
+ ```
19
+ ernesto_core op:search_intelligent
20
+ params: { query: "<topic of source material>" }
21
+ ernesto_core op:vault_tags
22
+ ernesto_core op:vault_domains
23
+ ```
24
+
25
+ Focus extraction on gaps — skip what vault already covers.
26
+
27
+ ### 3. Extract and Classify
28
+
29
+ | Type | What to Look For |
30
+ |------|-----------------|
31
+ | **pattern** | Repeatable approaches that work |
32
+ | **anti-pattern** | Known mistakes to avoid |
33
+ | **decision** | Architectural choices with rationale |
34
+ | **principle** | Guiding rules or heuristics |
35
+ | **workflow** | Step-by-step procedures |
36
+
37
+ For each: determine category, severity, and tags.
38
+
39
+ ### 4. Batch Capture
40
+
41
+ ```
42
+ ernesto_core op:capture_knowledge
43
+ params: {
44
+ title: "<clear, searchable name>",
45
+ description: "<what it is, when to apply, why it matters>",
46
+ type: "<pattern|anti-pattern|decision|principle|workflow>",
47
+ category: "<domain>",
48
+ tags: ["<tag1>", "<tag2>"],
49
+ example: "<code snippet or quote>",
50
+ why: "<reasoning>"
51
+ }
52
+ ```
53
+
54
+ Present each capture as you go: `Captured: api-auth-jwt (pattern, critical)`
55
+
56
+ ### 5. Post-Harvest Quality
57
+
58
+ - `op:curator_detect_duplicates` — find duplicates created during harvest
59
+ - `op:curator_groom_all` — normalize tags, fix metadata
60
+ - `op:curator_contradictions` — check for conflicts
61
+
62
+ ### 6. Verify and Report
63
+
64
+ ```
65
+ ## Harvest Complete
66
+
67
+ Source: [name]
68
+ Extracted: X entries (Y patterns, Z anti-patterns, W decisions)
69
+ Duplicates: N (merged/skipped)
70
+ Contradictions: N (flagged)
71
+ Vault health: OK
72
+ ```
73
+
74
+ Optionally promote universal patterns: `op:memory_promote_to_global`.
75
+
76
+ ## Common Mistakes
77
+
78
+ - Not checking vault before extracting (creates duplicates)
79
+ - Capturing too-granular entries instead of atomic, searchable ones
80
+ - Skipping post-harvest quality checks (duplicates and contradictions accumulate)
81
+
82
+ ## Quick Reference
83
+
84
+ | Op | When to Use |
85
+ |----|-------------|
86
+ | `search_intelligent` | Check existing knowledge |
87
+ | `vault_tags` / `vault_domains` | See what's covered |
88
+ | `capture_knowledge` | Capture each item |
89
+ | `curator_detect_duplicates` | Post-harvest dedup |
90
+ | `curator_groom_all` | Normalize entries |
91
+ | `curator_contradictions` | Find conflicts |
92
+ | `memory_promote_to_global` | Share cross-project |
93
+ | `admin_vault_analytics` | Knowledge quality |
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: onboard-me
3
+ description: Use when someone is new to the project and needs a structured introduction to its knowledge, patterns, decisions, and conventions.
4
+ ---
5
+
6
+ # Onboard Me — Instant Project Intelligence
7
+
8
+ Structured tour of everything the vault knows about this project. Decisions, patterns, anti-patterns, conventions — all in one walkthrough.
9
+
10
+ ## Steps
11
+
12
+ ### 1. Project Overview
13
+
14
+ ```
15
+ ernesto_core op:identity
16
+ ernesto_core op:project_get
17
+ ernesto_core op:project_list_rules
18
+ ernesto_core op:get_behavior_rules
19
+ ```
20
+
21
+ ### 2. Knowledge Landscape
22
+
23
+ ```
24
+ ernesto_core op:vault_domains
25
+ ernesto_core op:vault_tags
26
+ ernesto_core op:admin_vault_size
27
+ ```
28
+
29
+ ### 3. Critical Knowledge
30
+
31
+ ```
32
+ ernesto_core op:search
33
+ params: { severity: "critical" }
34
+ ```
35
+
36
+ ### 4. Key Decisions
37
+
38
+ ```
39
+ ernesto_core op:search_intelligent
40
+ params: { query: "architectural decision design choice" }
41
+ ```
42
+
43
+ ### 5. Strongest Patterns
44
+
45
+ ```
46
+ ernesto_core op:brain_strengths
47
+ ```
48
+
49
+ ### 6. Anti-Patterns to Avoid
50
+
51
+ ```
52
+ ernesto_core op:search
53
+ params: { type: "anti-pattern" }
54
+ ```
55
+
56
+ ### 7. Cross-Project Context
57
+
58
+ ```
59
+ ernesto_core op:project_linked_projects
60
+ ernesto_core op:brain_global_patterns
61
+ ```
62
+
63
+ ### 8. Knowledge Gaps
64
+
65
+ ```
66
+ ernesto_core op:admin_search_insights
67
+ ernesto_core op:vault_age_report
68
+ ```
69
+
70
+ ## Presenting the Onboarding
71
+
72
+ ```
73
+ ## Welcome to [Project Name]
74
+
75
+ **Domains:** [list] | **Vault:** X entries across Y domains
76
+
77
+ ### Critical Rules (Must Follow)
78
+ [Non-negotiable conventions]
79
+
80
+ ### Key Decisions
81
+ [Top architectural decisions with rationale]
82
+
83
+ ### Proven Patterns (Do This)
84
+ [Brain-strength patterns]
85
+
86
+ ### Anti-Patterns (Don't Do This)
87
+ [Known mistakes]
88
+
89
+ ### Project Conventions
90
+ [Rules, naming conventions]
91
+
92
+ ### Related Projects
93
+ [Linked projects and shared patterns]
94
+
95
+ ### Knowledge Gaps
96
+ [Areas not well-documented — ask the team]
97
+ ```
98
+
99
+ **Tip:** Use vault-navigator to search topics as you work. Use second-opinion before architectural decisions.
100
+
101
+ ## Common Mistakes
102
+
103
+ - Dumping all vault entries instead of curating the most important ones
104
+ - Skipping anti-patterns (newcomers need to know what NOT to do)
105
+ - Not surfacing knowledge gaps (newcomers should know where documentation is thin)
106
+
107
+ ## Quick Reference
108
+
109
+ | Op | When to Use |
110
+ |----|-------------|
111
+ | `identity` / `project_get` | Project overview |
112
+ | `project_list_rules` / `get_behavior_rules` | Conventions |
113
+ | `vault_domains` / `vault_tags` | Knowledge landscape |
114
+ | `search` (severity/type filters) | Critical rules, anti-patterns |
115
+ | `search_intelligent` | Key decisions |
116
+ | `brain_strengths` | Proven patterns |
117
+ | `brain_global_patterns` | Cross-project patterns |
118
+ | `admin_search_insights` | Knowledge gaps |
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: retrospective
3
+ description: Use when reflecting on recent work — sprint retros, weekly summaries, learning reports, or extracting actionable insights from accumulated session data.
4
+ ---
5
+
6
+ # Retrospective — Learning Report From Real Data
7
+
8
+ Generate a data-driven retrospective from session data, vault captures, plan outcomes, and brain intelligence.
9
+
10
+ ## Steps
11
+
12
+ ### 1. Gather Data
13
+
14
+ ```
15
+ ernesto_core op:brain_stats
16
+ ernesto_core op:brain_stats params: { since: "<start of period>" }
17
+ ernesto_core op:brain_strengths
18
+ ernesto_core op:vault_recent
19
+ ernesto_core op:memory_topics
20
+ ernesto_core op:memory_stats
21
+ ernesto_core op:plan_stats
22
+ ernesto_core op:admin_search_insights
23
+ ernesto_core op:admin_vault_analytics
24
+ ```
25
+
26
+ ### 2. Analyze Patterns
27
+
28
+ ```
29
+ ernesto_core op:vault_age_report
30
+ ernesto_core op:curator_detect_duplicates
31
+ ernesto_core op:curator_contradictions
32
+ ernesto_core op:curator_health_audit
33
+ ```
34
+
35
+ ### 3. Present the Retrospective
36
+
37
+ ```
38
+ ## Retrospective: [Period]
39
+
40
+ ### By the Numbers
41
+ | Metric | This Period | Previous | Trend |
42
+ |--------|-----------|----------|-------|
43
+ | Patterns captured | X | Y | up/down |
44
+ | Plans completed | X | Y | up/down |
45
+ | Brain strength (avg) | X | Y | up/down |
46
+ | Search misses | X | Y | up/down |
47
+
48
+ ### What Went Well
49
+ [High brain strength patterns, completed plans, growing domains]
50
+
51
+ ### What Didn't Go Well
52
+ [Recurring anti-patterns, failed plans, knowledge gaps]
53
+
54
+ ### Vault Health
55
+ Quality: X/100 | Duplicates: N | Contradictions: N | Stale: N
56
+
57
+ ### Recommendations
58
+ 1. [Data-driven action item]
59
+ 2. [Data-driven action item]
60
+ ```
61
+
62
+ ### 4. Capture the Retrospective
63
+
64
+ ```
65
+ ernesto_core op:capture_knowledge
66
+ params: {
67
+ title: "Retrospective — [period]",
68
+ description: "<key findings and action items>",
69
+ type: "workflow",
70
+ category: "meta",
71
+ tags: ["retrospective"]
72
+ }
73
+ ```
74
+
75
+ ### 5. Clean Up (Optional)
76
+
77
+ If quality issues found: `op:curator_consolidate` then `op:brain_build_intelligence`.
78
+
79
+ ## Common Mistakes
80
+
81
+ - Presenting AI opinions instead of actual vault/brain metrics
82
+ - Not comparing periods (missing trends)
83
+ - Skipping the capture step (retrospective insights are lost)
84
+
85
+ ## Quick Reference
86
+
87
+ | Op | When to Use |
88
+ |----|-------------|
89
+ | `brain_stats` / `brain_strengths` | Metrics and patterns |
90
+ | `vault_recent` | Recent captures |
91
+ | `memory_topics` / `memory_stats` | Knowledge clusters |
92
+ | `plan_stats` | Plan completion |
93
+ | `admin_search_insights` | Search misses |
94
+ | `curator_health_audit` | Vault quality |
95
+ | `capture_knowledge` | Persist retrospective |
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: second-opinion
3
+ description: Use when facing a technical decision, comparing approaches, or needing an informed recommendation backed by vault knowledge, brain patterns, and web research.
4
+ ---
5
+
6
+ # Second Opinion — Decision Support From All Sources
7
+
8
+ Get an informed recommendation that synthesizes vault knowledge, brain patterns, cross-project experience, and web research before making any technical decision.
9
+
10
+ ## Steps
11
+
12
+ ### 1. Understand the Decision
13
+
14
+ ```
15
+ ernesto_core op:route_intent
16
+ params: { prompt: "<user's question>" }
17
+ ```
18
+
19
+ ### 2. Search All Knowledge Sources
20
+
21
+ **Vault** — previous decisions, patterns, anti-patterns:
22
+ ```
23
+ ernesto_core op:search_intelligent
24
+ params: { query: "<the decision or options>" }
25
+ ```
26
+
27
+ **Brain** — proven approaches:
28
+ ```
29
+ ernesto_core op:brain_strengths
30
+ ernesto_core op:brain_recommend
31
+ params: { projectName: "<current project>" }
32
+ ```
33
+
34
+ **Cross-project** — what other projects chose:
35
+ ```
36
+ ernesto_core op:memory_cross_project_search
37
+ params: { query: "<topic>", crossProject: true }
38
+ ```
39
+
40
+ **Web** — community consensus, benchmarks, comparison articles.
41
+
42
+ ### 3. Synthesize and Present
43
+
44
+ ```
45
+ ## Decision: [Question]
46
+
47
+ ### What the Vault Says
48
+ [Existing decisions, patterns, anti-patterns]
49
+
50
+ ### What the Brain Recommends
51
+ [Proven patterns, cross-project insights]
52
+
53
+ ### What the Web Says
54
+ [Community consensus, benchmarks]
55
+
56
+ ### Options Analysis
57
+ | Criteria | Option A | Option B |
58
+ |----------|----------|----------|
59
+ | [criteria] | ... | ... |
60
+ | Vault support | [patterns?] | [patterns?] |
61
+
62
+ ### Recommendation
63
+ [Clear recommendation with reasoning]
64
+
65
+ ### Risks
66
+ [What could go wrong]
67
+ ```
68
+
69
+ ### 4. Capture the Decision
70
+
71
+ ```
72
+ ernesto_core op:capture_knowledge
73
+ params: {
74
+ title: "<decision title>",
75
+ description: "<chosen option, rationale, rejected alternatives>",
76
+ type: "decision",
77
+ category: "<domain>",
78
+ tags: ["decision"]
79
+ }
80
+ ```
81
+
82
+ ## Common Mistakes
83
+
84
+ - Giving a generic AI opinion instead of searching vault/brain first
85
+ - Not capturing the final decision (next person faces the same question blind)
86
+ - Skipping cross-project search (another project may have solved this)
87
+
88
+ ## Quick Reference
89
+
90
+ | Op | When to Use |
91
+ |----|-------------|
92
+ | `route_intent` | Classify decision type |
93
+ | `search_intelligent` | Find previous decisions |
94
+ | `brain_strengths` / `brain_recommend` | Proven approaches |
95
+ | `memory_cross_project_search` | Other projects' choices |
96
+ | `memory_search` | Session context |
97
+ | `capture_knowledge` | Persist the decision |
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: systematic-debugging
3
+ description: Use when encountering any bug, test failure, or unexpected behavior — before proposing fixes.
4
+ ---
5
+
6
+ # Systematic Debugging
7
+
8
+ **Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
9
+
10
+ ## Phase 0: Search Before Investigating
11
+
12
+ **BEFORE touching any code:**
13
+
14
+ ```
15
+ ernesto_core op:search_intelligent
16
+ params: { query: "<bug or error message>" }
17
+ ernesto_core op:brain_strengths
18
+ ernesto_core op:memory_search
19
+ params: { query: "<error or symptom>" }
20
+ ```
21
+
22
+ If vault has a match — apply it directly. Then search web: exact error message, GitHub issues, Stack Overflow, official docs.
23
+
24
+ Only if vault and web produce no answer, proceed to Phase 1.
25
+
26
+ ## Start a Debug Loop
27
+
28
+ ```
29
+ ernesto_core op:loop_start
30
+ params: { prompt: "Debug: <bug>", mode: "custom" }
31
+ ```
32
+
33
+ ## The Four Phases
34
+
35
+ ### Phase 1: Root Cause Investigation
36
+
37
+ 1. Read error messages carefully
38
+ 2. Reproduce consistently
39
+ 3. Check recent changes
40
+ 4. Gather evidence at component boundaries
41
+ 5. Trace data flow backward through call stack
42
+
43
+ Track each step with `op:loop_iterate`.
44
+
45
+ ### Phase 2: Pattern Analysis
46
+
47
+ Find working examples, compare against references (read completely), identify differences, understand dependencies. Use `op:search_intelligent` for comparison.
48
+
49
+ ### Phase 3: Hypothesis and Testing
50
+
51
+ Form single hypothesis, test minimally (one variable at a time), verify before continuing. If unsure — ask for help.
52
+
53
+ ### Phase 4: Implementation
54
+
55
+ 1. Create failing test (use test-driven-development skill)
56
+ 2. Implement single fix (root cause only)
57
+ 3. Verify fix
58
+ 4. If < 3 attempts failed, return to Phase 1. If >= 3, STOP — question architecture with human partner.
59
+
60
+ ## Phase 5: Capture the Learning
61
+
62
+ ```
63
+ ernesto_core op:loop_complete
64
+ ernesto_core op:capture_knowledge
65
+ params: {
66
+ title: "<bug>",
67
+ description: "<root cause, solution, what made it hard to find>",
68
+ type: "anti-pattern",
69
+ category: "<domain>",
70
+ tags: ["<relevant>"]
71
+ }
72
+ ernesto_core op:session_capture
73
+ ```
74
+
75
+ ## Red Flags — STOP and Return to Phase 1
76
+
77
+ - "Quick fix for now" / "Just try changing X"
78
+ - Proposing solutions before tracing data flow
79
+ - "One more fix attempt" after 2+ failures
80
+ - Each fix reveals a new problem elsewhere
81
+
82
+ ## Common Mistakes
83
+
84
+ - Skipping vault search ("I know this one") — 30 seconds saves hours
85
+ - Making multiple changes at once (can't isolate what worked)
86
+ - Skipping the capture step (same bug will recur)
87
+
88
+ ## Quick Reference
89
+
90
+ | Phase | Key Activities | Tools |
91
+ |-------|---------------|-------|
92
+ | 0. Search | Vault, web, memory | `search_intelligent`, `brain_strengths`, `memory_search` |
93
+ | 1. Root Cause | Read errors, reproduce, trace | `loop_iterate` |
94
+ | 2. Pattern | Find working examples, compare | `search_intelligent` |
95
+ | 3. Hypothesis | Form theory, test minimally | `loop_iterate` |
96
+ | 4. Implementation | Test, fix, verify | `loop_iterate` |
97
+ | 5. Capture | Persist root cause | `capture_knowledge`, `loop_complete` |
98
+
99
+ **Related skills:** test-driven-development, verification-before-completion, fix-and-learn