devflow-kit 1.5.0 → 1.6.0

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 (83) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +6 -3
  3. package/dist/commands/ambient.js +1 -1
  4. package/dist/commands/init.js +2 -2
  5. package/dist/plugins.js +23 -23
  6. package/dist/utils/post-install.js +6 -1
  7. package/package.json +1 -1
  8. package/plugins/devflow-accessibility/.claude-plugin/plugin.json +1 -1
  9. package/plugins/devflow-ambient/.claude-plugin/plugin.json +25 -4
  10. package/plugins/devflow-ambient/README.md +48 -29
  11. package/plugins/devflow-ambient/agents/coder.md +135 -0
  12. package/plugins/devflow-ambient/agents/reviewer.md +165 -0
  13. package/plugins/devflow-ambient/agents/scrutinizer.md +80 -0
  14. package/plugins/devflow-ambient/agents/shepherd.md +94 -0
  15. package/plugins/devflow-ambient/agents/simplifier.md +93 -0
  16. package/plugins/devflow-ambient/agents/skimmer.md +93 -0
  17. package/plugins/devflow-ambient/agents/validator.md +86 -0
  18. package/plugins/devflow-ambient/skills/ambient-router/SKILL.md +72 -28
  19. package/plugins/devflow-ambient/skills/ambient-router/references/skill-catalog.md +40 -35
  20. package/plugins/devflow-ambient/skills/debug-orchestration/SKILL.md +69 -0
  21. package/plugins/devflow-ambient/skills/implementation-orchestration/SKILL.md +92 -0
  22. package/plugins/devflow-ambient/skills/plan-orchestration/SKILL.md +71 -0
  23. package/plugins/devflow-audit-claude/.claude-plugin/plugin.json +10 -1
  24. package/plugins/devflow-audit-claude/commands/audit-claude.md +4 -0
  25. package/plugins/devflow-code-review/.claude-plugin/plugin.json +2 -1
  26. package/plugins/devflow-code-review/agents/reviewer.md +10 -9
  27. package/plugins/devflow-code-review/commands/code-review-teams.md +43 -30
  28. package/plugins/devflow-code-review/commands/code-review.md +10 -1
  29. package/plugins/devflow-code-review/skills/knowledge-persistence/SKILL.md +128 -0
  30. package/plugins/devflow-code-review/skills/knowledge-persistence/references/examples.md +44 -0
  31. package/plugins/devflow-core-skills/.claude-plugin/plugin.json +1 -1
  32. package/plugins/devflow-core-skills/skills/docs-framework/SKILL.md +7 -1
  33. package/plugins/devflow-core-skills/skills/test-driven-development/SKILL.md +6 -5
  34. package/plugins/devflow-debug/.claude-plugin/plugin.json +5 -3
  35. package/plugins/devflow-debug/agents/synthesizer.md +211 -0
  36. package/plugins/devflow-debug/commands/debug-teams.md +28 -14
  37. package/plugins/devflow-debug/commands/debug.md +26 -12
  38. package/plugins/devflow-debug/skills/knowledge-persistence/SKILL.md +128 -0
  39. package/plugins/devflow-debug/skills/knowledge-persistence/references/examples.md +44 -0
  40. package/plugins/devflow-frontend-design/.claude-plugin/plugin.json +1 -1
  41. package/plugins/devflow-go/.claude-plugin/plugin.json +1 -1
  42. package/plugins/devflow-implement/.claude-plugin/plugin.json +2 -1
  43. package/plugins/devflow-implement/agents/coder.md +6 -1
  44. package/plugins/devflow-implement/agents/simplifier.md +32 -1
  45. package/plugins/devflow-implement/agents/skimmer.md +5 -0
  46. package/plugins/devflow-implement/commands/implement-teams.md +72 -55
  47. package/plugins/devflow-implement/commands/implement.md +44 -35
  48. package/plugins/devflow-implement/skills/knowledge-persistence/SKILL.md +128 -0
  49. package/plugins/devflow-implement/skills/knowledge-persistence/references/examples.md +44 -0
  50. package/plugins/devflow-java/.claude-plugin/plugin.json +1 -1
  51. package/plugins/devflow-python/.claude-plugin/plugin.json +1 -1
  52. package/plugins/devflow-react/.claude-plugin/plugin.json +1 -1
  53. package/plugins/devflow-resolve/.claude-plugin/plugin.json +4 -3
  54. package/plugins/devflow-resolve/agents/simplifier.md +32 -1
  55. package/plugins/devflow-resolve/commands/resolve-teams.md +16 -7
  56. package/plugins/devflow-resolve/commands/resolve.md +16 -7
  57. package/plugins/devflow-resolve/skills/knowledge-persistence/SKILL.md +128 -0
  58. package/plugins/devflow-resolve/skills/knowledge-persistence/references/examples.md +44 -0
  59. package/plugins/devflow-rust/.claude-plugin/plugin.json +1 -1
  60. package/plugins/devflow-self-review/.claude-plugin/plugin.json +10 -1
  61. package/plugins/devflow-self-review/agents/simplifier.md +32 -1
  62. package/plugins/devflow-self-review/commands/self-review.md +10 -4
  63. package/plugins/devflow-specify/.claude-plugin/plugin.json +1 -1
  64. package/plugins/devflow-specify/agents/skimmer.md +5 -0
  65. package/plugins/devflow-specify/commands/specify-teams.md +27 -20
  66. package/plugins/devflow-specify/commands/specify.md +26 -19
  67. package/plugins/devflow-typescript/.claude-plugin/plugin.json +1 -1
  68. package/scripts/hooks/ambient-prompt +8 -7
  69. package/scripts/hooks/session-start-memory +33 -3
  70. package/shared/agents/coder.md +6 -1
  71. package/shared/agents/reviewer.md +10 -9
  72. package/shared/agents/simplifier.md +32 -1
  73. package/shared/agents/skimmer.md +5 -0
  74. package/shared/skills/ambient-router/SKILL.md +72 -28
  75. package/shared/skills/ambient-router/references/skill-catalog.md +40 -35
  76. package/shared/skills/debug-orchestration/SKILL.md +69 -0
  77. package/shared/skills/docs-framework/SKILL.md +7 -1
  78. package/shared/skills/implementation-orchestration/SKILL.md +92 -0
  79. package/shared/skills/knowledge-persistence/SKILL.md +128 -0
  80. package/shared/skills/knowledge-persistence/references/examples.md +44 -0
  81. package/shared/skills/plan-orchestration/SKILL.md +71 -0
  82. package/shared/skills/test-driven-development/SKILL.md +6 -5
  83. package/plugins/devflow-ambient/commands/ambient.md +0 -110
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "Dean0x"
6
6
  },
7
- "version": "1.5.0",
7
+ "version": "1.6.0",
8
8
  "homepage": "https://github.com/dean0x/devflow",
9
9
  "repository": "https://github.com/dean0x/devflow",
10
10
  "license": "MIT",
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: Skimmer
3
3
  description: Codebase orientation using skim to identify relevant files, functions, and patterns for a feature or task
4
+ skills: knowledge-persistence
4
5
  model: inherit
5
6
  ---
6
7
 
@@ -20,6 +21,7 @@ You receive from orchestrator:
20
21
  3. **Search for task-relevant code** - Find files matching task keywords
21
22
  4. **Identify integration points** - Exports, entry points, import patterns
22
23
  5. **Generate orientation summary** - Structured output for implementation planning
24
+ 6. **Check project knowledge** - If `.memory/knowledge/decisions.md` exists, read its `<!-- TL;DR: ... -->` first-line comment and include active decision count in orientation under "### Active Decisions". Only the TL;DR is read here (not full entries) — this is intentional for token efficiency; agents that need full entries read the file themselves.
23
25
 
24
26
  ## Tool Invocation
25
27
 
@@ -64,6 +66,9 @@ Always invoke skim via `npx rskim`. This works whether or not skim is globally i
64
66
  ### Patterns Observed
65
67
  {Existing patterns to follow}
66
68
 
69
+ ### Active Decisions
70
+ {Count and key decisions from `.memory/knowledge/decisions.md` TL;DR, or "None found" if file missing}
71
+
67
72
  ### Suggested Approach
68
73
  {Brief recommendation based on codebase structure}
69
74
  ```
@@ -57,7 +57,11 @@ Find: project structure, similar features, patterns, integration points
57
57
  Return: codebase context for requirements (not implementation details)"
58
58
  ```
59
59
 
60
- ### Phase 3: Explore Requirements (Agent Teams)
60
+ ### Phase 3: Load Project Knowledge
61
+
62
+ Read `.memory/knowledge/decisions.md` and `.memory/knowledge/pitfalls.md`. Pass their content as context to the exploration team below — prior decisions constrain requirements, known pitfalls inform failure modes.
63
+
64
+ ### Phase 4: Explore Requirements (Agent Teams)
61
65
 
62
66
  Create an agent team for collaborative requirements exploration:
63
67
 
@@ -122,7 +126,7 @@ Max 2 debate rounds, then submit consensus requirements findings.
122
126
 
123
127
  **Exploration team output**: Consensus findings on user needs, similar features, constraints, failure modes.
124
128
 
125
- **Team Shutdown Protocol** (must complete before Phase 5):
129
+ **Team Shutdown Protocol** (must complete before Phase 6):
126
130
 
127
131
  ```
128
132
  Step 1: Shutdown each teammate
@@ -139,9 +143,9 @@ Step 3: GATE — Verify TeamDelete succeeded
139
143
  If retry failed → HALT and report: "Exploration team cleanup failed. Cannot create planning team."
140
144
  ```
141
145
 
142
- ### Phase 4: Synthesize Exploration
146
+ ### Phase 5: Synthesize Exploration
143
147
 
144
- **WAIT** for Phase 3, then spawn Synthesizer:
148
+ **WAIT** for Phase 4, then spawn Synthesizer:
145
149
 
146
150
  ```
147
151
  Task(subagent_type="Synthesizer"):
@@ -151,7 +155,7 @@ Explorer consensus: {team exploration consensus output}
151
155
  Combine into: user needs, similar features, constraints, failure modes"
152
156
  ```
153
157
 
154
- ### Phase 5: Plan Scope (Agent Teams)
158
+ ### Phase 6: Plan Scope (Agent Teams)
155
159
 
156
160
  Create an agent team for collaborative scope planning:
157
161
 
@@ -164,7 +168,7 @@ Spawn planning teammates with self-contained prompts:
164
168
  Prompt: |
165
169
  You are planning scope for feature: {feature}
166
170
  Exploration synthesis (what we know):
167
- {synthesis output from Phase 4}
171
+ {synthesis output from Phase 5}
168
172
 
169
173
  Your deliverable: User stories in "As X, I want Y, so that Z" format.
170
174
  Cover all actors, actions, and outcomes identified in exploration.
@@ -175,7 +179,7 @@ Spawn planning teammates with self-contained prompts:
175
179
  Prompt: |
176
180
  You are planning scope for feature: {feature}
177
181
  Exploration synthesis (what we know):
178
- {synthesis output from Phase 4}
182
+ {synthesis output from Phase 5}
179
183
 
180
184
  Your deliverable: v1 MVP scope, v2 deferred items, explicitly out of scope,
181
185
  and dependencies on other features or systems.
@@ -186,7 +190,7 @@ Spawn planning teammates with self-contained prompts:
186
190
  Prompt: |
187
191
  You are planning scope for feature: {feature}
188
192
  Exploration synthesis (what we know):
189
- {synthesis output from Phase 4}
193
+ {synthesis output from Phase 5}
190
194
 
191
195
  Your deliverable: Testable acceptance criteria for success cases,
192
196
  failure cases, and edge cases. Every criterion must be verifiable.
@@ -221,9 +225,9 @@ Step 3: GATE — Verify TeamDelete succeeded
221
225
  If retry failed → HALT and report: "Planning team cleanup failed. Cannot proceed to Gate 1."
222
226
  ```
223
227
 
224
- ### Phase 6: Synthesize Planning
228
+ ### Phase 7: Synthesize Planning
225
229
 
226
- **WAIT** for Phase 5, then spawn Synthesizer:
230
+ **WAIT** for Phase 6, then spawn Synthesizer:
227
231
 
228
232
  ```
229
233
  Task(subagent_type="Synthesizer"):
@@ -233,7 +237,7 @@ Planner consensus: {team planning consensus output}
233
237
  Combine into: user stories, scope breakdown, acceptance criteria, open questions"
234
238
  ```
235
239
 
236
- ### Phase 7: Gate 1 - Validate Scope
240
+ ### Phase 8: Gate 1 - Validate Scope
237
241
 
238
242
  Use AskUserQuestion to validate:
239
243
  - Primary problem being solved
@@ -241,14 +245,14 @@ Use AskUserQuestion to validate:
241
245
  - v1 scope selection (minimal/medium/full)
242
246
  - Explicit exclusions
243
247
 
244
- ### Phase 8: Gate 2 - Confirm Criteria
248
+ ### Phase 9: Gate 2 - Confirm Criteria
245
249
 
246
250
  Present specification summary, then use AskUserQuestion for final confirmation:
247
251
  - Success UX pattern
248
252
  - Error handling approach
249
253
  - Ready to create issue / Needs changes / Cancel
250
254
 
251
- ### Phase 9: Create Issue
255
+ ### Phase 10: Create Issue
252
256
 
253
257
  Create GitHub issue with `gh issue create`:
254
258
  - Title: feature name
@@ -268,32 +272,35 @@ Report issue number and URL.
268
272
  ├─ Phase 2: Orient
269
273
  │ └─ Skimmer agent (codebase context via skim)
270
274
 
271
- ├─ Phase 3: Explore Requirements (Agent Teams)
275
+ ├─ Phase 3: Load Project Knowledge
276
+ │ └─ Read decisions.md + pitfalls.md
277
+
278
+ ├─ Phase 4: Explore Requirements (Agent Teams)
272
279
  │ ├─ User Perspective Explorer (teammate)
273
280
  │ ├─ Similar Features Explorer (teammate)
274
281
  │ ├─ Constraints Explorer (teammate)
275
282
  │ ├─ Failure Mode Explorer (teammate)
276
283
  │ └─ Debate → consensus requirements findings
277
284
 
278
- ├─ Phase 4: Synthesize Exploration
285
+ ├─ Phase 5: Synthesize Exploration
279
286
  │ └─ Synthesizer agent (mode: exploration)
280
287
 
281
- ├─ Phase 5: Plan Scope (Agent Teams)
288
+ ├─ Phase 6: Plan Scope (Agent Teams)
282
289
  │ ├─ User Stories Planner (teammate)
283
290
  │ ├─ Scope Boundaries Planner (teammate)
284
291
  │ ├─ Acceptance Criteria Planner (teammate)
285
292
  │ └─ Debate → consensus scope plan
286
293
 
287
- ├─ Phase 6: Synthesize Planning
294
+ ├─ Phase 7: Synthesize Planning
288
295
  │ └─ Synthesizer agent (mode: planning)
289
296
 
290
- ├─ Phase 7: GATE 1 - Validate Scope ⛔ MANDATORY
297
+ ├─ Phase 8: GATE 1 - Validate Scope ⛔ MANDATORY
291
298
  │ └─ AskUserQuestion: Confirm scope and priorities
292
299
 
293
- ├─ Phase 8: GATE 2 - Confirm Criteria ⛔ MANDATORY
300
+ ├─ Phase 9: GATE 2 - Confirm Criteria ⛔ MANDATORY
294
301
  │ └─ AskUserQuestion: Final spec approval
295
302
 
296
- ├─ Phase 9: Create Issue
303
+ ├─ Phase 10: Create Issue
297
304
  │ └─ gh issue create
298
305
 
299
306
  └─ Report: Issue number, URL, /implement command
@@ -57,20 +57,24 @@ Find: project structure, similar features, patterns, integration points
57
57
  Return: codebase context for requirements (not implementation details)"
58
58
  ```
59
59
 
60
- ### Phase 3: Explore Requirements (Parallel)
60
+ ### Phase 3: Load Project Knowledge
61
61
 
62
- Spawn 4 Explore agents **in a single message**, each with Skimmer context:
62
+ Read `.memory/knowledge/decisions.md` and `.memory/knowledge/pitfalls.md`. Pass their content as context to the Explore agents below prior decisions constrain requirements, known pitfalls inform failure modes.
63
+
64
+ ### Phase 4: Explore Requirements (Parallel)
65
+
66
+ Spawn 4 Explore agents **in a single message**, each with Skimmer context and project knowledge (if loaded):
63
67
 
64
68
  | Focus | Thoroughness | Find |
65
69
  |-------|-------------|------|
66
70
  | User perspective | medium | Target users, goals, pain points, user journeys |
67
71
  | Similar features | medium | Comparable features, scope patterns, edge cases |
68
- | Constraints | quick | Dependencies, business rules, security, performance |
69
- | Failure modes | quick | Error states, edge cases, validation needs |
72
+ | Constraints | quick | Dependencies, business rules, security, performance, **prior architectural decisions** |
73
+ | Failure modes | quick | Error states, edge cases, validation needs, **known pitfalls** |
70
74
 
71
- ### Phase 4: Synthesize Exploration
75
+ ### Phase 5: Synthesize Exploration
72
76
 
73
- **WAIT** for Phase 3, then spawn Synthesizer:
77
+ **WAIT** for Phase 4, then spawn Synthesizer:
74
78
 
75
79
  ```
76
80
  Task(subagent_type="Synthesizer"):
@@ -79,7 +83,7 @@ Mode: exploration
79
83
  Combine into: user needs, similar features, constraints, failure modes"
80
84
  ```
81
85
 
82
- ### Phase 5: Plan Scope (Parallel)
86
+ ### Phase 6: Plan Scope (Parallel)
83
87
 
84
88
  Spawn 3 Plan agents **in a single message**, each with exploration synthesis:
85
89
 
@@ -89,9 +93,9 @@ Spawn 3 Plan agents **in a single message**, each with exploration synthesis:
89
93
  | Scope boundaries | v1 MVP, v2 deferred, out of scope, dependencies |
90
94
  | Acceptance criteria | Success/failure/edge case criteria (testable) |
91
95
 
92
- ### Phase 6: Synthesize Planning
96
+ ### Phase 7: Synthesize Planning
93
97
 
94
- **WAIT** for Phase 5, then spawn Synthesizer:
98
+ **WAIT** for Phase 6, then spawn Synthesizer:
95
99
 
96
100
  ```
97
101
  Task(subagent_type="Synthesizer"):
@@ -100,7 +104,7 @@ Mode: planning
100
104
  Combine into: user stories, scope breakdown, acceptance criteria, open questions"
101
105
  ```
102
106
 
103
- ### Phase 7: Gate 1 - Validate Scope
107
+ ### Phase 8: Gate 1 - Validate Scope
104
108
 
105
109
  Use AskUserQuestion to validate:
106
110
  - Primary problem being solved
@@ -108,14 +112,14 @@ Use AskUserQuestion to validate:
108
112
  - v1 scope selection (minimal/medium/full)
109
113
  - Explicit exclusions
110
114
 
111
- ### Phase 8: Gate 2 - Confirm Criteria
115
+ ### Phase 9: Gate 2 - Confirm Criteria
112
116
 
113
117
  Present specification summary, then use AskUserQuestion for final confirmation:
114
118
  - Success UX pattern
115
119
  - Error handling approach
116
120
  - Ready to create issue / Needs changes / Cancel
117
121
 
118
- ### Phase 9: Create Issue
122
+ ### Phase 10: Create Issue
119
123
 
120
124
  Create GitHub issue with `gh issue create`:
121
125
  - Title: feature name
@@ -135,30 +139,33 @@ Report issue number and URL.
135
139
  ├─ Phase 2: Orient
136
140
  │ └─ Skimmer agent (codebase context via skim)
137
141
 
138
- ├─ Phase 3: Explore Requirements (PARALLEL)
142
+ ├─ Phase 3: Load Project Knowledge
143
+ │ └─ Read decisions.md + pitfalls.md
144
+
145
+ ├─ Phase 4: Explore Requirements (PARALLEL)
139
146
  │ ├─ Explore: User perspective
140
147
  │ ├─ Explore: Similar features
141
148
  │ ├─ Explore: Constraints
142
149
  │ └─ Explore: Failure modes
143
150
 
144
- ├─ Phase 4: Synthesize Exploration
151
+ ├─ Phase 5: Synthesize Exploration
145
152
  │ └─ Synthesizer agent (mode: exploration)
146
153
 
147
- ├─ Phase 5: Plan Scope (PARALLEL)
154
+ ├─ Phase 6: Plan Scope (PARALLEL)
148
155
  │ ├─ Plan: User stories
149
156
  │ ├─ Plan: Scope boundaries
150
157
  │ └─ Plan: Acceptance criteria
151
158
 
152
- ├─ Phase 6: Synthesize Planning
159
+ ├─ Phase 7: Synthesize Planning
153
160
  │ └─ Synthesizer agent (mode: planning)
154
161
 
155
- ├─ Phase 7: GATE 1 - Validate Scope ⛔ MANDATORY
162
+ ├─ Phase 8: GATE 1 - Validate Scope ⛔ MANDATORY
156
163
  │ └─ AskUserQuestion: Confirm scope and priorities
157
164
 
158
- ├─ Phase 8: GATE 2 - Confirm Criteria ⛔ MANDATORY
165
+ ├─ Phase 9: GATE 2 - Confirm Criteria ⛔ MANDATORY
159
166
  │ └─ AskUserQuestion: Final spec approval
160
167
 
161
- ├─ Phase 9: Create Issue
168
+ ├─ Phase 10: Create Issue
162
169
  │ └─ gh issue create
163
170
 
164
171
  └─ Report: Issue number, URL, /implement command
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "Dean0x"
6
6
  },
7
- "version": "1.5.0",
7
+ "version": "1.6.0",
8
8
  "homepage": "https://github.com/dean0x/devflow",
9
9
  "repository": "https://github.com/dean0x/devflow",
10
10
  "license": "MIT",
@@ -30,15 +30,16 @@ if [ "$WORD_COUNT" -lt 2 ]; then
30
30
  exit 0
31
31
  fi
32
32
 
33
- # Inject classification preamble
34
- PREAMBLE="AMBIENT MODE ACTIVE: Before responding, silently classify this prompt:
35
- Intent: BUILD | DEBUG | REVIEW | PLAN | EXPLORE | CHAT
36
- Depth: QUICK (no overhead) | GUIDED (load skills) | ELEVATE (suggest /command)
33
+ # Normalize to lowercase for matching
34
+ PROMPT_LOWER=$(echo "$PROMPT" | tr '[:upper:]' '[:lower:]')
37
35
 
38
- If GUIDED+: Use the ambient-router skill already in your session context for classification details and skill selection matrix. Then Read the selected skills from ~/.claude/skills/<name>/SKILL.md and apply their patterns. For BUILD tasks, also load test-driven-development skill and enforce RED-GREEN-REFACTOR.
36
+ # Fast-path: git operations are always QUICK skip preamble
37
+ if echo "$PROMPT_LOWER" | grep -qE '^(commit|push|pull|merge|rebase|cherry-pick|squash|tag|stash)|create (a )?pr|open (a )?pr'; then
38
+ exit 0
39
+ fi
39
40
 
40
- If QUICK: Respond normally without stating classification.
41
- Only state classification aloud for GUIDED/ELEVATE."
41
+ # Inject classification preamble
42
+ PREAMBLE="AMBIENT MODE ACTIVE: Before responding, silently classify this prompt using the ambient-router skill already in your session context. If QUICK, respond normally without stating classification."
42
43
 
43
44
  jq -n --arg ctx "$PREAMBLE" '{
44
45
  "hookSpecificOutput": {
@@ -119,6 +119,31 @@ ${COMPACT_NOTE}"
119
119
  fi
120
120
  fi
121
121
 
122
+ # --- Section 1.5: Project Knowledge TL;DR ---
123
+ KNOWLEDGE_DIR="$CWD/.memory/knowledge"
124
+ if [ -d "$KNOWLEDGE_DIR" ]; then
125
+ KNOWLEDGE_TLDR=""
126
+ for kf in "$KNOWLEDGE_DIR"/decisions.md "$KNOWLEDGE_DIR"/pitfalls.md; do
127
+ if [ -f "$kf" ]; then
128
+ TLDR_LINE=$(sed -n '1s/<!-- TL;DR: \(.*\) -->/\1/p' "$kf")
129
+ if [ -n "$TLDR_LINE" ]; then
130
+ KNOWLEDGE_TLDR="${KNOWLEDGE_TLDR}${TLDR_LINE}\n"
131
+ fi
132
+ fi
133
+ done
134
+ if [ -n "$KNOWLEDGE_TLDR" ]; then
135
+ KNOWLEDGE_SECTION="--- PROJECT KNOWLEDGE (TL;DR) ---
136
+ $(printf '%b' "$KNOWLEDGE_TLDR")"
137
+ if [ -n "$CONTEXT" ]; then
138
+ CONTEXT="${CONTEXT}
139
+
140
+ ${KNOWLEDGE_SECTION}"
141
+ else
142
+ CONTEXT="$KNOWLEDGE_SECTION"
143
+ fi
144
+ fi
145
+ fi
146
+
122
147
  # --- Section 2: Ambient Skill Injection ---
123
148
 
124
149
  # Inject ambient-router SKILL.md directly into context so Claude doesn't need a Read call.
@@ -129,10 +154,15 @@ AMBIENT_SKILL_PATH="$HOME/.claude/skills/ambient-router/SKILL.md"
129
154
  SETTINGS_FILE="$HOME/.claude/settings.json"
130
155
  if [ -f "$AMBIENT_SKILL_PATH" ] && [ -f "$SETTINGS_FILE" ] && grep -q "ambient-prompt" "$SETTINGS_FILE" 2>/dev/null; then
131
156
  AMBIENT_SKILL_CONTENT=$(cat "$AMBIENT_SKILL_PATH")
132
- CONTEXT="${CONTEXT}
133
-
134
- --- AMBIENT ROUTER (auto-loaded) ---
157
+ AMBIENT_SECTION="--- AMBIENT ROUTER (auto-loaded) ---
135
158
  ${AMBIENT_SKILL_CONTENT}"
159
+ if [ -n "$CONTEXT" ]; then
160
+ CONTEXT="${CONTEXT}
161
+
162
+ ${AMBIENT_SECTION}"
163
+ else
164
+ CONTEXT="$AMBIENT_SECTION"
165
+ fi
136
166
  fi
137
167
 
138
168
  # --- Output ---
@@ -2,7 +2,7 @@
2
2
  name: Coder
3
3
  description: Autonomous task implementation on feature branch. Implements, tests, and commits.
4
4
  model: inherit
5
- skills: core-patterns, git-safety, implementation-patterns, git-workflow, test-patterns, input-validation
5
+ skills: core-patterns, git-safety, implementation-patterns, git-workflow, test-patterns, test-driven-development, search-first, input-validation
6
6
  ---
7
7
 
8
8
  # Coder Agent
@@ -35,6 +35,8 @@ You receive from orchestrator:
35
35
  - Cross-reference changed files against EXECUTION_PLAN to identify what's relevant to your task
36
36
  - Read those relevant files to understand interfaces, types, naming conventions, error handling, and testing patterns established by prior work
37
37
  - If PRIOR_PHASE_SUMMARY is provided, use it to validate your understanding — actual code is authoritative, summaries are supplementary
38
+ - If `.memory/knowledge/decisions.md` exists, read it. Apply prior architectural decisions relevant to this task. Avoid contradicting accepted decisions without documenting a new ADR.
39
+ - If `.memory/knowledge/pitfalls.md` exists, scan for pitfalls in files you're about to modify.
38
40
 
39
41
  2. **Load domain skills**: Based on DOMAIN hint and files in scope, dynamically load relevant language/ecosystem skills by reading their SKILL.md. Only load skills that are installed:
40
42
  - `backend` (TypeScript): Read `~/.claude/skills/typescript/SKILL.md`, `~/.claude/skills/input-validation/SKILL.md`
@@ -89,6 +91,9 @@ Return structured completion status:
89
91
  ### PR (if created)
90
92
  - URL: {pr_url}
91
93
 
94
+ ### Key Decisions (if any)
95
+ - {Decision}: {rationale}
96
+
92
97
  ### Blockers (if any)
93
98
  {Description of blocker or failure with recommendation}
94
99
  ```
@@ -42,15 +42,16 @@ The orchestrator provides:
42
42
  ## Responsibilities
43
43
 
44
44
  1. **Load focus skill** - Read the pattern skill file for your focus area from the table above. This gives you detection rules and patterns specific to your review type.
45
- 2. **Identify changed lines** - Get diff against base branch (main/master/develop)
46
- 3. **Apply 3-category classification** - Sort issues by where they occur
47
- 4. **Apply focus-specific analysis** - Use pattern skill detection rules from the loaded skill file
48
- 5. **Assign severity** - CRITICAL, HIGH, MEDIUM, LOW based on impact
49
- 6. **Assess confidence** - Assign 0-100% confidence to each finding (see Confidence Scale below)
50
- 7. **Filter by confidence** - Only report findings ≥80% in main sections; lower-confidence items go to Suggestions
51
- 8. **Consolidate similar issues** - Group related findings to reduce noise (see Consolidation Rules)
52
- 9. **Generate report** - File:line references with suggested fixes
53
- 10. **Determine merge recommendation** - Based on blocking issues
45
+ 2. **Check known pitfalls** - If `.memory/knowledge/pitfalls.md` exists, read it. Check if any pitfall Areas overlap with files in the current diff. Verify the Resolution was applied. Flag if a known pitfall pattern is being reintroduced.
46
+ 3. **Identify changed lines** - Get diff against base branch (main/master/develop)
47
+ 4. **Apply 3-category classification** - Sort issues by where they occur
48
+ 5. **Apply focus-specific analysis** - Use pattern skill detection rules from the loaded skill file
49
+ 6. **Assign severity** - CRITICAL, HIGH, MEDIUM, LOW based on impact
50
+ 7. **Assess confidence** - Assign 0-100% confidence to each finding (see Confidence Scale below)
51
+ 8. **Filter by confidence** - Only report findings ≥80% in main sections; lower-confidence items go to Suggestions
52
+ 9. **Consolidate similar issues** - Group related findings to reduce noise (see Consolidation Rules)
53
+ 10. **Generate report** - File:line references with suggested fixes
54
+ 11. **Determine merge recommendation** - Based on blocking issues
54
55
 
55
56
  ## Confidence Scale
56
57
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: Simplifier
3
3
  description: Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Focuses on recently modified code unless instructed otherwise.
4
+ skills: core-patterns
4
5
  model: inherit
5
6
  ---
6
7
 
@@ -59,4 +60,34 @@ Your refinement process:
59
60
  5. Verify the refined code is simpler and more maintainable
60
61
  6. Document only significant changes that affect understanding
61
62
 
62
- You operate autonomously and proactively, refining code immediately after it's written or modified without requiring explicit requests. Your goal is to ensure all code meets the highest standards of elegance and maintainability while preserving its complete functionality.
63
+ You operate autonomously and proactively, refining code immediately after it's written or modified without requiring explicit requests. Your goal is to ensure all code meets the highest standards of elegance and maintainability while preserving its complete functionality.
64
+
65
+ ## Output
66
+
67
+ Return structured completion status:
68
+
69
+ ```markdown
70
+ ## Simplification Report
71
+
72
+ ### Changes Applied
73
+ - {file}: {description of simplification}
74
+
75
+ ### Changes Skipped
76
+ - {reason not simplified — would change behavior / already clean}
77
+
78
+ ### Files Modified
79
+ - {file} ({change description})
80
+ ```
81
+
82
+ ## Boundaries
83
+
84
+ **Escalate to orchestrator:**
85
+ - Changes that would alter observable behavior or break tests
86
+ - Simplifications requiring new dependencies or architectural changes
87
+ - Files outside the recently modified scope (unless instructed)
88
+
89
+ **Handle autonomously:**
90
+ - Naming improvements, dead code removal, nesting reduction
91
+ - Import sorting and organization
92
+ - Redundant abstraction elimination
93
+ - Comment cleanup (remove obvious, keep non-obvious)
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: Skimmer
3
3
  description: Codebase orientation using skim to identify relevant files, functions, and patterns for a feature or task
4
+ skills: knowledge-persistence
4
5
  model: inherit
5
6
  ---
6
7
 
@@ -20,6 +21,7 @@ You receive from orchestrator:
20
21
  3. **Search for task-relevant code** - Find files matching task keywords
21
22
  4. **Identify integration points** - Exports, entry points, import patterns
22
23
  5. **Generate orientation summary** - Structured output for implementation planning
24
+ 6. **Check project knowledge** - If `.memory/knowledge/decisions.md` exists, read its `<!-- TL;DR: ... -->` first-line comment and include active decision count in orientation under "### Active Decisions". Only the TL;DR is read here (not full entries) — this is intentional for token efficiency; agents that need full entries read the file themselves.
23
25
 
24
26
  ## Tool Invocation
25
27
 
@@ -64,6 +66,9 @@ Always invoke skim via `npx rskim`. This works whether or not skim is globally i
64
66
  ### Patterns Observed
65
67
  {Existing patterns to follow}
66
68
 
69
+ ### Active Decisions
70
+ {Count and key decisions from `.memory/knowledge/decisions.md` TL;DR, or "None found" if file missing}
71
+
67
72
  ### Suggested Approach
68
73
  {Brief recommendation based on codebase structure}
69
74
  ```