devflow-kit 1.4.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 (95) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +7 -3
  3. package/dist/commands/ambient.js +1 -1
  4. package/dist/commands/init.js +31 -2
  5. package/dist/commands/list.d.ts +21 -0
  6. package/dist/commands/list.js +71 -3
  7. package/dist/plugins.js +24 -24
  8. package/dist/utils/manifest.d.ts +45 -0
  9. package/dist/utils/manifest.js +100 -0
  10. package/dist/utils/post-install.js +6 -1
  11. package/package.json +1 -1
  12. package/plugins/devflow-accessibility/.claude-plugin/plugin.json +1 -1
  13. package/plugins/devflow-ambient/.claude-plugin/plugin.json +25 -4
  14. package/plugins/devflow-ambient/README.md +48 -29
  15. package/plugins/devflow-ambient/agents/coder.md +135 -0
  16. package/plugins/devflow-ambient/agents/reviewer.md +165 -0
  17. package/plugins/devflow-ambient/agents/scrutinizer.md +80 -0
  18. package/plugins/devflow-ambient/agents/shepherd.md +94 -0
  19. package/plugins/devflow-ambient/agents/simplifier.md +93 -0
  20. package/plugins/devflow-ambient/agents/skimmer.md +93 -0
  21. package/plugins/devflow-ambient/agents/validator.md +86 -0
  22. package/plugins/devflow-ambient/skills/ambient-router/SKILL.md +72 -28
  23. package/plugins/devflow-ambient/skills/ambient-router/references/skill-catalog.md +40 -34
  24. package/plugins/devflow-ambient/skills/debug-orchestration/SKILL.md +69 -0
  25. package/plugins/devflow-ambient/skills/implementation-orchestration/SKILL.md +92 -0
  26. package/plugins/devflow-ambient/skills/plan-orchestration/SKILL.md +71 -0
  27. package/plugins/devflow-audit-claude/.claude-plugin/plugin.json +10 -1
  28. package/plugins/devflow-audit-claude/commands/audit-claude.md +4 -0
  29. package/plugins/devflow-code-review/.claude-plugin/plugin.json +2 -1
  30. package/plugins/devflow-code-review/agents/reviewer.md +47 -9
  31. package/plugins/devflow-code-review/agents/synthesizer.md +12 -5
  32. package/plugins/devflow-code-review/commands/code-review-teams.md +43 -30
  33. package/plugins/devflow-code-review/commands/code-review.md +14 -2
  34. package/plugins/devflow-code-review/skills/knowledge-persistence/SKILL.md +128 -0
  35. package/plugins/devflow-code-review/skills/knowledge-persistence/references/examples.md +44 -0
  36. package/plugins/devflow-core-skills/.claude-plugin/plugin.json +2 -1
  37. package/plugins/devflow-core-skills/skills/docs-framework/SKILL.md +7 -1
  38. package/plugins/devflow-core-skills/skills/search-first/SKILL.md +133 -0
  39. package/plugins/devflow-core-skills/skills/search-first/references/evaluation-criteria.md +101 -0
  40. package/plugins/devflow-core-skills/skills/test-driven-development/SKILL.md +6 -5
  41. package/plugins/devflow-debug/.claude-plugin/plugin.json +5 -3
  42. package/plugins/devflow-debug/agents/synthesizer.md +211 -0
  43. package/plugins/devflow-debug/commands/debug-teams.md +28 -14
  44. package/plugins/devflow-debug/commands/debug.md +26 -12
  45. package/plugins/devflow-debug/skills/knowledge-persistence/SKILL.md +128 -0
  46. package/plugins/devflow-debug/skills/knowledge-persistence/references/examples.md +44 -0
  47. package/plugins/devflow-frontend-design/.claude-plugin/plugin.json +1 -1
  48. package/plugins/devflow-go/.claude-plugin/plugin.json +1 -1
  49. package/plugins/devflow-implement/.claude-plugin/plugin.json +2 -1
  50. package/plugins/devflow-implement/agents/coder.md +21 -13
  51. package/plugins/devflow-implement/agents/simplifier.md +32 -1
  52. package/plugins/devflow-implement/agents/skimmer.md +5 -0
  53. package/plugins/devflow-implement/agents/synthesizer.md +12 -5
  54. package/plugins/devflow-implement/commands/implement-teams.md +73 -60
  55. package/plugins/devflow-implement/commands/implement.md +45 -40
  56. package/plugins/devflow-implement/skills/knowledge-persistence/SKILL.md +128 -0
  57. package/plugins/devflow-implement/skills/knowledge-persistence/references/examples.md +44 -0
  58. package/plugins/devflow-java/.claude-plugin/plugin.json +1 -1
  59. package/plugins/devflow-python/.claude-plugin/plugin.json +1 -1
  60. package/plugins/devflow-react/.claude-plugin/plugin.json +1 -1
  61. package/plugins/devflow-resolve/.claude-plugin/plugin.json +4 -3
  62. package/plugins/devflow-resolve/agents/simplifier.md +32 -1
  63. package/plugins/devflow-resolve/commands/resolve-teams.md +16 -7
  64. package/plugins/devflow-resolve/commands/resolve.md +16 -7
  65. package/plugins/devflow-resolve/skills/knowledge-persistence/SKILL.md +128 -0
  66. package/plugins/devflow-resolve/skills/knowledge-persistence/references/examples.md +44 -0
  67. package/plugins/devflow-rust/.claude-plugin/plugin.json +1 -1
  68. package/plugins/devflow-self-review/.claude-plugin/plugin.json +10 -1
  69. package/plugins/devflow-self-review/agents/simplifier.md +32 -1
  70. package/plugins/devflow-self-review/commands/self-review.md +10 -4
  71. package/plugins/devflow-specify/.claude-plugin/plugin.json +1 -1
  72. package/plugins/devflow-specify/agents/skimmer.md +5 -0
  73. package/plugins/devflow-specify/agents/synthesizer.md +12 -5
  74. package/plugins/devflow-specify/commands/specify-teams.md +27 -20
  75. package/plugins/devflow-specify/commands/specify.md +26 -19
  76. package/plugins/devflow-typescript/.claude-plugin/plugin.json +1 -1
  77. package/scripts/hooks/ambient-prompt +8 -7
  78. package/scripts/hooks/session-start-memory +33 -3
  79. package/shared/agents/coder.md +21 -13
  80. package/shared/agents/reviewer.md +47 -9
  81. package/shared/agents/simplifier.md +32 -1
  82. package/shared/agents/skimmer.md +5 -0
  83. package/shared/agents/synthesizer.md +12 -5
  84. package/shared/skills/ambient-router/SKILL.md +72 -28
  85. package/shared/skills/ambient-router/references/skill-catalog.md +40 -34
  86. package/shared/skills/debug-orchestration/SKILL.md +69 -0
  87. package/shared/skills/docs-framework/SKILL.md +7 -1
  88. package/shared/skills/implementation-orchestration/SKILL.md +92 -0
  89. package/shared/skills/knowledge-persistence/SKILL.md +128 -0
  90. package/shared/skills/knowledge-persistence/references/examples.md +44 -0
  91. package/shared/skills/plan-orchestration/SKILL.md +71 -0
  92. package/shared/skills/search-first/SKILL.md +133 -0
  93. package/shared/skills/search-first/references/evaluation-criteria.md +101 -0
  94. package/shared/skills/test-driven-development/SKILL.md +6 -5
  95. package/plugins/devflow-ambient/commands/ambient.md +0 -110
@@ -128,10 +128,14 @@ Analyze 3 axes to determine strategy:
128
128
  Synthesize outputs from multiple Reviewer agents. Apply strict merge rules.
129
129
 
130
130
  **Process:**
131
- 1. Read all review reports from `${REVIEW_BASE_DIR}/*-report.*.md`
132
- 2. Categorize issues into 3 buckets (from review-methodology)
133
- 3. Count by severity (CRITICAL, HIGH, MEDIUM, LOW)
134
- 4. Determine merge recommendation based on blocking issues
131
+ 1. Read all review reports from `${REVIEW_BASE_DIR}/*.md` (exclude your own output `review-summary.*.md`)
132
+ 2. Extract confidence percentages from each finding
133
+ 3. Apply confidence-aware aggregation: when multiple reviewers flag the same file:line, boost confidence by 10% per additional reviewer (cap at 100%)
134
+ <!-- Confidence threshold also in: shared/agents/reviewer.md, plugins/devflow-code-review/commands/code-review.md -->
135
+ 4. Maintain ≥80% confidence threshold in final output
136
+ 5. Categorize issues into 3 buckets (from review-methodology)
137
+ 6. Count by severity (CRITICAL, HIGH, MEDIUM, LOW)
138
+ 7. Determine merge recommendation based on blocking issues
135
139
 
136
140
  **Issue Categories:**
137
141
  - **Blocking** (Category 1): Issues in YOUR changes - CRITICAL/HIGH must block
@@ -172,7 +176,10 @@ Report format:
172
176
  | Pre-existing | - | - | {n} | {n} | {n} |
173
177
 
174
178
  ## Blocking Issues
175
- {List with file:line and suggested fix}
179
+ {List with file:line, confidence %, and suggested fix}
180
+
181
+ ## Suggestions (Lower Confidence)
182
+ {Max 5 items across all reviewers with 60-79% confidence. Brief descriptions only.}
176
183
 
177
184
  ## Action Plan
178
185
  1. {Priority fix}
@@ -1,25 +1,23 @@
1
1
  ---
2
2
  name: ambient-router
3
- description: >-
4
- Classify user intent and response depth for ambient mode. Auto-loads relevant
5
- skills without explicit command invocation. Used by /ambient command and
6
- always-on UserPromptSubmit hook.
3
+ description: This skill should be used when classifying user intent for ambient mode, auto-loading relevant skills without explicit command invocation. Used by the always-on UserPromptSubmit hook.
7
4
  user-invocable: false
8
5
  allowed-tools: Read, Grep, Glob
9
6
  ---
10
7
 
11
8
  # Ambient Router
12
9
 
13
- Classify user intent and auto-load relevant skills. Zero overhead for simple requests, skill injection for substantive work, workflow nudges for complex tasks.
10
+ Classify user intent and auto-load relevant skills. Zero overhead for simple requests, skill loading + optional agent orchestration for substantive work.
14
11
 
15
12
  ## Iron Law
16
13
 
17
- > **PROPORTIONAL RESPONSE**
14
+ > **PROPORTIONAL RESPONSE MATCHED TO SCOPE**
18
15
  >
19
- > Match effort to intent. Never apply heavyweight processes to lightweight requests.
20
- > A chat question gets zero overhead. A 3-file feature gets 2-3 skills. A system
21
- > refactor gets a nudge toward `/implement`. Misclassification in either direction
22
- > is a failure.
16
+ > QUICK gets zero overhead. GUIDED gets skill loading + main session implementation
17
+ > with Simplifier cleanup. ORCHESTRATED gets full skill loading via the Skill tool plus
18
+ > agent pipeline execution. Misclassification in either direction is a failure —
19
+ > false-positive ORCHESTRATED is expensive (5-6 agent spawns), false-negative
20
+ > GUIDED leaves quality on the table.
23
21
 
24
22
  ---
25
23
 
@@ -29,14 +27,14 @@ Determine what the user is trying to do from their prompt.
29
27
 
30
28
  | Intent | Signal Words / Patterns | Examples |
31
29
  |--------|------------------------|---------|
32
- | **BUILD** | "add", "create", "implement", "build", "write", "make" | "add a login form", "create an API endpoint" |
30
+ | **IMPLEMENT** | "add", "create", "implement", "build", "write", "make" | "add a login form", "create an API endpoint" |
33
31
  | **DEBUG** | "fix", "bug", "broken", "failing", "error", "why does" | "fix the auth error", "why is this test failing" |
34
32
  | **REVIEW** | "check", "look at", "review", "is this ok", "any issues" | "check this function", "any issues with this?" |
35
33
  | **PLAN** | "how should", "design", "architecture", "approach", "strategy" | "how should I structure auth?", "what's the approach for caching?" |
36
34
  | **EXPLORE** | "what is", "where is", "find", "show me", "explain", "how does" | "where is the config?", "explain this function" |
37
35
  | **CHAT** | greetings, meta-questions, confirmations, short responses | "thanks", "yes", "what can you do?" |
38
36
 
39
- **Ambiguous prompts:** Default to the lowest-overhead classification. "Update the README" → BUILD/GUIDED. Git operations like "commit this" → QUICK.
37
+ **Ambiguous prompts:** Default to the lowest-overhead classification. "Update the README" → QUICK. Git operations like "commit this" → QUICK.
40
38
 
41
39
  ## Step 2: Classify Depth
42
40
 
@@ -44,44 +42,87 @@ Determine how much enforcement the prompt warrants.
44
42
 
45
43
  | Depth | Criteria | Action |
46
44
  |-------|----------|--------|
47
- | **QUICK** | CHAT intent. EXPLORE with no analytical depth ("where is X?"). Git/devops operations (commit, push, merge, branch, pr, deploy, reinstall). Single-word continuations. | Respond normally. Zero overhead. Do not state classification. |
48
- | **GUIDED** | BUILD/DEBUG/REVIEW/PLAN intent (any word count). EXPLORE with analytical depth ("analyze our X", "discuss how Y works"). | Read and apply 2-3 relevant skills from the selection matrix below. State classification briefly. |
49
- | **ELEVATE** | Multi-file architectural change, system-wide scope, > 5 files. Detailed implementation plan (100+ words with plan structure). | Respond at best effort + recommend: "This looks like it would benefit from `/implement` for full lifecycle management." |
45
+ | **QUICK** | CHAT intent. EXPLORE intent. Git/devops operations (commit, push, merge, branch, pr, deploy, reinstall). Single-word continuations. Small edits, config changes, trivial single-file tweaks. | Respond normally. Zero overhead. Do not state classification. |
46
+ | **GUIDED** | IMPLEMENT with small scope (≤2 files, single module). DEBUG with clear error location (stack trace, specific file, known function). PLAN for focused design questions (specific area/pattern). REVIEW (always GUIDED). | Load skills via Skill tool. Main session implements directly. Spawn Simplifier after code changes. State classification. |
47
+ | **ORCHESTRATED** | IMPLEMENT with larger scope (>2 files, multi-module, complex). DEBUG with vague/cross-cutting bug (no clear location, multiple possible causes). PLAN for system-level architecture (caching layer, auth system, multi-module design). | Load skills via Skill tool, then orchestrate agents per Step 5. State classification. |
50
48
 
51
- ## Step 3: Select Skills (GUIDED depth only)
49
+ **Scope-based decision criteria:**
52
50
 
53
- Based on classified intent, read the following skills to inform your response.
51
+ | Intent | GUIDED (small scope) | ORCHESTRATED (large scope) |
52
+ |--------|---------------------|---------------------------|
53
+ | **IMPLEMENT** | ≤2 files, single module, clear task | >2 files, multi-module, complex |
54
+ | **DEBUG** | Clear error with known location (stack trace, specific file) | Vague/cross-cutting bug, multiple possible causes |
55
+ | **PLAN** | Focused question about specific area/pattern | System-level architecture, multi-module design |
56
+ | **REVIEW** | Always GUIDED | — |
57
+
58
+ **Classification conservatism:** Default to QUICK. Only classify GUIDED/ORCHESTRATED when the prompt has clear task scope. When choosing between GUIDED and ORCHESTRATED, prefer GUIDED — escalate only when scope clearly exceeds main-session capacity.
59
+
60
+ ## Step 3: Select Skills
61
+
62
+ Based on classified intent and depth, invoke each selected skill using the Skill tool.
63
+
64
+ ### GUIDED-depth skills
54
65
 
55
66
  | Intent | Primary Skills | Secondary (if file type matches) |
56
67
  |--------|---------------|----------------------------------|
57
- | **BUILD** | test-driven-development, implementation-patterns | typescript (.ts), react (.tsx/.jsx), go (.go), java (.java), python (.py), rust (.rs), frontend-design (CSS/UI), input-validation (forms/API), security-patterns (auth/crypto) |
58
- | **DEBUG** | test-patterns, core-patterns | git-safety (if git operations involved) |
68
+ | **IMPLEMENT** | test-driven-development, implementation-patterns, search-first | typescript (.ts), react (.tsx/.jsx), go (.go), java (.java), python (.py), rust (.rs), frontend-design (CSS/UI), input-validation (forms/API), security-patterns (auth/crypto) |
69
+ | **DEBUG** | core-patterns, test-patterns | git-safety (if git operations involved) |
70
+ | **PLAN** | implementation-patterns, core-patterns | — |
59
71
  | **REVIEW** | self-review, core-patterns | test-patterns |
60
- | **PLAN** | implementation-patterns | core-patterns |
61
72
 
62
- **Excluded from ambient** (review-command-only): review-methodology, complexity-patterns, consistency-patterns, database-patterns, dependencies-patterns, documentation-patterns, regression-patterns, architecture-patterns, accessibility.
73
+ ### ORCHESTRATED-depth skills
74
+
75
+ | Intent | Primary Skills | Secondary (if file type matches) |
76
+ |--------|---------------|----------------------------------|
77
+ | **IMPLEMENT** | implementation-orchestration, implementation-patterns | typescript (.ts), react (.tsx/.jsx), go (.go), java (.java), python (.py), rust (.rs), frontend-design (CSS/UI), input-validation (forms/API), security-patterns (auth/crypto) |
78
+ | **DEBUG** | debug-orchestration, core-patterns | git-safety (if git operations involved) |
79
+ | **PLAN** | plan-orchestration, implementation-patterns, core-patterns | — |
80
+
81
+ **Excluded from ambient** (review-command-only): review-methodology, complexity-patterns, consistency-patterns, database-patterns, dependencies-patterns, documentation-patterns, regression-patterns, architecture-patterns, accessibility, performance-patterns.
63
82
 
64
83
  See `references/skill-catalog.md` for the full skill-to-intent mapping with file pattern triggers.
65
84
 
66
85
  ## Step 4: Apply
67
86
 
68
87
  <IMPORTANT>
69
- When classification is GUIDED or ELEVATE, skill application is NON-NEGOTIABLE.
88
+ When classification is GUIDED or ORCHESTRATED, skill loading is NON-NEGOTIABLE.
70
89
  Do not rationalize skipping skills. Do not respond without loading them first.
71
- If test-driven-development is selected, you MUST write the failing test before ANY production code.
90
+ BLOCKING REQUIREMENT: Invoke each selected skill using the Skill tool before proceeding.
91
+ For IMPLEMENT intent, enforce TDD: write the failing test before ANY production code.
72
92
  </IMPORTANT>
73
93
 
74
94
  - **QUICK:** Respond directly. No preamble, no classification statement.
75
- - **GUIDED:** State classification briefly: `Ambient: BUILD/GUIDED. Loading: test-driven-development, implementation-patterns.` Then read the selected skills and apply their patterns. No exceptions.
76
- - **ELEVATE:** Respond with your best effort, then append: `> This task spans multiple files/systems. Consider \`/implement\` for full lifecycle.`
95
+ - **GUIDED:** State classification briefly: `Ambient: IMPLEMENT/GUIDED. Loading: implementation-patterns, search-first.` Then invoke each skill using the Skill tool and work directly in main session. After code changes, spawn Simplifier on changed files.
96
+ - **ORCHESTRATED:** State classification briefly: `Ambient: IMPLEMENT/ORCHESTRATED. Loading: implementation-orchestration, implementation-patterns.` Then invoke each skill using the Skill tool and follow Step 5 for agent orchestration.
97
+
98
+ ### GUIDED Behavior by Intent
99
+
100
+ | Intent | Main Session Work | Post-Work |
101
+ |--------|------------------|-----------|
102
+ | **IMPLEMENT** | Implement directly with loaded skills. Follow TDD cycle. | Spawn Simplifier on changed files. |
103
+ | **DEBUG** | Investigate directly — reproduce bug, diagnose from stack trace/error, fix. | Spawn Simplifier on changed files. |
104
+ | **PLAN** | Explore relevant code and design directly. The area is focused enough for main session. | No Simplifier (no code changes). |
105
+ | **REVIEW** | Review directly with loaded skills. | No Simplifier. |
106
+
107
+ ## Step 5: Orchestrate Agents (ORCHESTRATED depth only)
108
+
109
+ After loading skills via Step 3-4, execute the agent pipeline for the classified intent:
110
+
111
+ | Intent | Pipeline |
112
+ |--------|----------|
113
+ | **IMPLEMENT** | Follow implementation-orchestration skill pipeline: pre-flight → plan synthesis → Coder → quality gates |
114
+ | **DEBUG** | Follow debug-orchestration skill pipeline: hypotheses → parallel Explores → convergence → report → offer fix |
115
+ | **PLAN** | Follow plan-orchestration skill pipeline: Skimmer → Explores → Plan agent → gap validation |
116
+ | **EXPLORE** | No agents — respond in main session |
117
+ | **CHAT** | No agents — respond in main session |
77
118
 
78
119
  ---
79
120
 
80
121
  ## Transparency Rules
81
122
 
82
123
  1. **QUICK → silent.** No classification output.
83
- 2. **GUIDED → brief statement + full skill enforcement.** One line: intent, depth, skills loaded. Then follow every skill requirement without shortcuts.
84
- 3. **ELEVATErecommendation.** Best-effort response + workflow nudge.
124
+ 2. **GUIDED → brief statement + full skill enforcement.** One line: intent, depth, skills loaded. Then implement in main session with skill patterns applied.
125
+ 3. **ORCHESTRATEDbrief statement + full skill enforcement + agent orchestration.** One line: intent, depth, skills loaded. Then follow every skill requirement and orchestrate agents per Step 5.
85
126
  4. **Never lie about classification.** If uncertain, say so.
86
127
  5. **Never over-classify.** When in doubt, go one tier lower.
87
128
  6. **Never under-apply.** Rationalization is the enemy of quality. If a skill requires a step, do the step.
@@ -90,7 +131,10 @@ If test-driven-development is selected, you MUST write the failing test before A
90
131
 
91
132
  | Case | Handling |
92
133
  |------|----------|
93
- | Mixed intent ("fix this bug and add a test") | Use the higher-overhead intent (BUILD > DEBUG) |
134
+ | Mixed intent ("fix this bug and add a test") | Use the higher-overhead intent (IMPLEMENT > DEBUG) |
94
135
  | Continuation of previous conversation | Inherit previous classification unless prompt clearly shifts |
95
136
  | User explicitly requests no enforcement | Respect immediately — classify as QUICK |
96
137
  | Prompt references specific DevFlow command | Skip ambient — the command has its own orchestration |
138
+ | Scope ambiguous between GUIDED and ORCHESTRATED | Default to GUIDED; escalate if complexity emerges during work |
139
+ | REVIEW intent | Always GUIDED — single Reviewer focus, no orchestration pipeline |
140
+ | Multiple triggers per session | Each runs independently; context compaction handles accumulation |
@@ -4,46 +4,50 @@ Full mapping of DevFlow skills to ambient intents and file-type triggers. The am
4
4
 
5
5
  ## Skills Available for Ambient Loading
6
6
 
7
- These skills may be loaded during GUIDED-depth ambient routing.
8
-
9
- ### BUILD Intent
10
-
11
- | Skill | When to Load | File Patterns |
12
- |-------|-------------|---------------|
13
- | test-driven-development | Always for BUILD | `*.ts`, `*.tsx`, `*.js`, `*.jsx`, `*.py` |
14
- | implementation-patterns | Always for BUILD | Any code file |
15
- | typescript | TypeScript files in scope | `*.ts`, `*.tsx` |
16
- | react | React components in scope | `*.tsx`, `*.jsx` |
17
- | frontend-design | UI/styling work | `*.css`, `*.scss`, `*.tsx` with styling keywords |
18
- | input-validation | Forms, APIs, user input | Files with form/input/validation keywords |
19
- | go | Go files in scope | `*.go` |
20
- | java | Java files in scope | `*.java` |
21
- | python | Python files in scope | `*.py` |
22
- | rust | Rust files in scope | `*.rs` |
23
- | security-patterns | Auth, crypto, secrets | Files with auth/token/crypto/password keywords |
7
+ These skills may be loaded during GUIDED and ORCHESTRATED-depth ambient routing.
8
+
9
+ ### IMPLEMENT Intent
10
+
11
+ | Skill | When to Load | Depth | File Patterns |
12
+ |-------|-------------|-------|---------------|
13
+ | implementation-orchestration | ORCHESTRATED only | ORCHESTRATED | Any orchestrates agent pipeline |
14
+ | test-driven-development | Always for IMPLEMENT | GUIDED + ORCHESTRATED | Any code file — enforces RED-GREEN-REFACTOR |
15
+ | implementation-patterns | Always for IMPLEMENT | GUIDED + ORCHESTRATED | Any code file |
16
+ | search-first | Always for IMPLEMENT | GUIDED + ORCHESTRATED | Any enforces research before building |
17
+ | typescript | TypeScript files in scope | GUIDED + ORCHESTRATED | `*.ts`, `*.tsx` |
18
+ | react | React components in scope | GUIDED + ORCHESTRATED | `*.tsx`, `*.jsx` |
19
+ | frontend-design | UI/styling work | GUIDED + ORCHESTRATED | `*.css`, `*.scss`, `*.tsx` with styling keywords |
20
+ | input-validation | Forms, APIs, user input | GUIDED + ORCHESTRATED | Files with form/input/validation keywords |
21
+ | go | Go files in scope | GUIDED + ORCHESTRATED | `*.go` |
22
+ | java | Java files in scope | GUIDED + ORCHESTRATED | `*.java` |
23
+ | python | Python files in scope | GUIDED + ORCHESTRATED | `*.py` |
24
+ | rust | Rust files in scope | GUIDED + ORCHESTRATED | `*.rs` |
25
+ | security-patterns | Auth, crypto, secrets | GUIDED + ORCHESTRATED | Files with auth/token/crypto/password keywords |
24
26
 
25
27
  ### DEBUG Intent
26
28
 
27
- | Skill | When to Load | File Patterns |
28
- |-------|-------------|---------------|
29
- | test-patterns | Always for DEBUG | Any test-related context |
30
- | core-patterns | Always for DEBUG | Any code file |
31
- | git-safety | Git operations involved | User mentions git, rebase, merge, etc. |
29
+ | Skill | When to Load | Depth | File Patterns |
30
+ |-------|-------------|-------|---------------|
31
+ | debug-orchestration | ORCHESTRATED only | ORCHESTRATED | Any orchestrates investigation pipeline |
32
+ | core-patterns | Always for DEBUG | GUIDED + ORCHESTRATED | Any code file |
33
+ | test-patterns | Always for DEBUG (GUIDED) | GUIDED | Any code file |
34
+ | git-safety | Git operations involved | GUIDED + ORCHESTRATED | User mentions git, rebase, merge, etc. |
32
35
 
33
36
  ### REVIEW Intent
34
37
 
35
- | Skill | When to Load | File Patterns |
36
- |-------|-------------|---------------|
37
- | self-review | Always for REVIEW | Any code file |
38
- | core-patterns | Always for REVIEW | Any code file |
39
- | test-patterns | Test files in scope | `*.test.*`, `*.spec.*` |
38
+ | Skill | When to Load | Depth | File Patterns |
39
+ |-------|-------------|-------|---------------|
40
+ | self-review | Always for REVIEW | GUIDED | Any code file |
41
+ | core-patterns | Always for REVIEW | GUIDED | Any code file |
42
+ | test-patterns | Test files in scope | GUIDED | `*.test.*`, `*.spec.*` |
40
43
 
41
44
  ### PLAN Intent
42
45
 
43
- | Skill | When to Load | File Patterns |
44
- |-------|-------------|---------------|
45
- | implementation-patterns | Always for PLAN | Any planning context |
46
- | core-patterns | Architectural planning | System design discussions |
46
+ | Skill | When to Load | Depth | File Patterns |
47
+ |-------|-------------|-------|---------------|
48
+ | plan-orchestration | ORCHESTRATED only | ORCHESTRATED | Any orchestrates design pipeline |
49
+ | implementation-patterns | Always for PLAN | GUIDED + ORCHESTRATED | Any planning context |
50
+ | core-patterns | Always for PLAN | GUIDED + ORCHESTRATED | System design discussions |
47
51
 
48
52
  ## Skills Excluded from Ambient
49
53
 
@@ -62,7 +66,9 @@ These skills are loaded only by explicit DevFlow commands (primarily `/code-revi
62
66
 
63
67
  ## Selection Limits
64
68
 
65
- - **Maximum 3 skills** per ambient response (primary + up to 2 secondary)
66
- - **Primary skills** are always loaded for the classified intent
69
+ - **Maximum 3 knowledge skills** per ambient response (primary + up to 2 secondary)
70
+ - **Orchestration skills** (implementation-orchestration, debug-orchestration, plan-orchestration) are loaded only at ORCHESTRATED depth — they don't count toward the knowledge skill limit
71
+ - **Primary skills** are always loaded for the classified intent at both GUIDED and ORCHESTRATED depth
67
72
  - **Secondary skills** are loaded only when file patterns match conversation context
68
- - If more than 3 skills seem relevant, this is an ELEVATE signal
73
+ - **GUIDED depth** loads knowledge skills only (no orchestration skills) main session works directly
74
+ - **ORCHESTRATED depth** loads orchestration skill + knowledge skills — agents execute the pipeline
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: debug-orchestration
3
+ description: Agent orchestration for DEBUG intent — hypothesis investigation, root cause analysis, optional fix
4
+ user-invocable: false
5
+ allowed-tools: Read, Grep, Glob, Bash, Task, AskUserQuestion
6
+ ---
7
+
8
+ # Debug Orchestration
9
+
10
+ Agent pipeline for DEBUG intent in ambient ORCHESTRATED mode. Competing hypothesis investigation, parallel evidence gathering, convergence validation, and optional fix.
11
+
12
+ This is a lightweight variant of `/debug` for ambient ORCHESTRATED mode. Excluded: knowledge persistence loading, GitHub issue fetching, pitfall recording.
13
+
14
+ ## Iron Law
15
+
16
+ > **COMPETING HYPOTHESES BEFORE CONCLUSIONS**
17
+ >
18
+ > Never investigate a single theory. Generate 3-5 distinct hypotheses, investigate them
19
+ > in parallel, and let evidence determine the root cause. Confirmation bias is the enemy
20
+ > of debugging — multiple hypotheses are the antidote.
21
+
22
+ ---
23
+
24
+ ## Phase 1: Hypothesize
25
+
26
+ Analyze the bug description, error messages, and conversation context. Generate 3-5 hypotheses that are:
27
+
28
+ - **Specific**: Points to a concrete mechanism (not "something is wrong with auth")
29
+ - **Testable**: Can be confirmed or disproved by examining specific files/logs
30
+ - **Distinct**: Each hypothesis proposes a different root cause
31
+
32
+ If fewer than 3 hypotheses are possible, proceed with 2.
33
+
34
+ ## Phase 2: Investigate (Parallel)
35
+
36
+ Spawn one `Task(subagent_type="Explore")` per hypothesis **in a single message** (parallel execution):
37
+
38
+ - Each investigator searches for evidence FOR and AGAINST its hypothesis
39
+ - Must provide file:line references for all evidence
40
+ - Returns verdict: **CONFIRMED** | **DISPROVED** | **PARTIAL** (some evidence supports, some contradicts)
41
+
42
+ ## Phase 3: Converge
43
+
44
+ Evaluate investigation results:
45
+
46
+ - **One CONFIRMED**: Spawn 1-2 additional `Task(subagent_type="Explore")` agents to validate from different angles (prevent confirmation bias)
47
+ - **Multiple PARTIAL**: Look for a unifying root cause that explains all partial evidence
48
+ - **All DISPROVED**: Report honestly — "No root cause identified from initial hypotheses." Generate 2-3 second-round hypotheses if conversation context suggests avenues not yet explored.
49
+
50
+ ## Phase 4: Report
51
+
52
+ Present root cause analysis:
53
+
54
+ - **Confidence level**: HIGH (confirmed + validated) | MEDIUM (partial convergence) | LOW (best guess from incomplete evidence)
55
+ - **Evidence table**: Hypothesis → verdict → key evidence (file:line)
56
+ - **Root cause**: Clear statement of what's wrong and why
57
+ - **Recommended fix**: Specific changes with file references
58
+
59
+ ## Phase 5: Offer Fix
60
+
61
+ Ask user via AskUserQuestion: "Want me to implement this fix?"
62
+
63
+ - **YES** → Implement the fix directly in main session using GUIDED approach: load implementation-patterns, search-first, and test-driven-development skills, then code the fix. Spawn `Task(subagent_type="Simplifier")` on changed files after.
64
+ - **NO** → Done. Report stands as documentation.
65
+
66
+ ## Error Handling
67
+
68
+ - **All hypotheses disproved, no second-round ideas**: Report "No root cause identified" with summary of what was investigated and ruled out
69
+ - **Explore agents return insufficient evidence**: Report LOW confidence with available evidence, suggest manual investigation areas
@@ -39,7 +39,10 @@ All generated documentation lives under `.docs/` in the project root:
39
39
  .memory/
40
40
  ├── WORKING-MEMORY.md # Auto-maintained by Stop hook (overwritten)
41
41
  ├── PROJECT-PATTERNS.md # Accumulated patterns (merged across sessions)
42
- └── backup.json # Pre-compact git state snapshot
42
+ ├── backup.json # Pre-compact git state snapshot
43
+ └── knowledge/
44
+ ├── decisions.md # Architectural decisions (ADR-NNN format)
45
+ └── pitfalls.md # Known pitfalls (PF-NNN format)
43
46
  ```
44
47
 
45
48
  ---
@@ -97,6 +100,8 @@ source .devflow/scripts/docs-helpers.sh 2>/dev/null || {
97
100
  |-------|-----------------|----------|
98
101
  | Reviewer | `.docs/reviews/{branch-slug}/{type}-report.{timestamp}.md` | Creates new |
99
102
  | Working Memory | `.memory/WORKING-MEMORY.md` | Overwrites (auto-maintained by Stop hook) |
103
+ | Knowledge (decisions) | `.memory/knowledge/decisions.md` | Append-only (ADR-NNN sequential IDs) |
104
+ | Knowledge (pitfalls) | `.memory/knowledge/pitfalls.md` | Append-only (PF-NNN sequential IDs) |
100
105
 
101
106
  ### Agents That Don't Persist
102
107
 
@@ -125,6 +130,7 @@ When creating or modifying persisting agents:
125
130
  This framework is used by:
126
131
  - **Review agents**: Creates review reports
127
132
  - **Working Memory hooks**: Auto-maintains `.memory/WORKING-MEMORY.md`
133
+ - **Command flows**: `/implement` appends ADRs to `decisions.md`; `/code-review`, `/debug`, `/resolve` append PFs to `pitfalls.md`
128
134
 
129
135
  All persisting agents should load this skill to ensure consistent documentation.
130
136
 
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: implementation-orchestration
3
+ description: Agent orchestration for IMPLEMENT intent — pre-flight, Coder, quality gates
4
+ user-invocable: false
5
+ allowed-tools: Read, Grep, Glob, Bash, Task, AskUserQuestion
6
+ ---
7
+
8
+ # Implementation Orchestration
9
+
10
+ Agent pipeline for IMPLEMENT intent in ambient ORCHESTRATED mode. Pre-flight checks, plan synthesis, Coder execution, and quality gates.
11
+
12
+ This is a lightweight variant of `/implement` for ambient ORCHESTRATED mode. Excluded: strategy selection (single/sequential/parallel Coders), retry loops, PR creation, knowledge loading.
13
+
14
+ ## Iron Law
15
+
16
+ > **QUALITY GATES ARE NON-NEGOTIABLE**
17
+ >
18
+ > Every Coder output passes through Validator → Simplifier → Scrutinizer → re-Validate → Shepherd.
19
+ > Skipping a gate because "it looks fine" is never acceptable. The pipeline runs to completion
20
+ > or halts on failure — there is no shortcut.
21
+
22
+ ---
23
+
24
+ ## Phase 1: Pre-flight — Branch Safety
25
+
26
+ Detect branch type before spawning Coder:
27
+
28
+ - **Work branches** (`feat/`, `fix/`, `chore/`, `refactor/`, `docs/` prefix): proceed on current branch.
29
+ - **Protected branches** (`main`, `master`, `develop`, `release/*`, `staging`, `production`): ask user via AskUserQuestion with 2-3 suggested branch names following `{type}/{ticket}-{slug}` convention. Include ticket number if available from conversation context.
30
+ - **If user declines branch creation**: proceed on the protected branch. Respect the user's choice.
31
+
32
+ ## Phase 2: Plan Synthesis
33
+
34
+ Synthesize conversation context into a structured EXECUTION_PLAN for Coder:
35
+
36
+ - **If a plan exists** in conversation context (from plan mode — accepted in-session or injected after "accept and clear") → use the plan as-is.
37
+ - **Otherwise** → synthesize from conversation: what to build, files/modules affected, constraints, decisions made during discussion.
38
+
39
+ Format as structured markdown with: Goal, Steps, Files, Constraints, Decisions.
40
+
41
+ ## Phase 3: Coder Execution
42
+
43
+ Record git SHA before first Coder: `git rev-parse HEAD`
44
+
45
+ Spawn `Task(subagent_type="Coder")` with input variables:
46
+ - **TASK_ID**: Generated from timestamp (e.g., `task-2026-03-19_1430`)
47
+ - **TASK_DESCRIPTION**: From conversation context
48
+ - **BASE_BRANCH**: Current branch (or newly created branch from Phase 1)
49
+ - **EXECUTION_PLAN**: From Phase 2
50
+ - **PATTERNS**: Codebase patterns from conversation context
51
+ - **CREATE_PR**: `false` (commit only, no push)
52
+ - **DOMAIN**: Inferred from files in scope (`backend`, `frontend`, `tests`, `fullstack`)
53
+
54
+ **Execution strategy**: Single sequential Coder by default. Parallel Coders only when tasks are self-contained — zero shared contracts, no integration points, different files/modules with no imports between them.
55
+
56
+ If Coder returns **BLOCKED**, halt the pipeline and report to user.
57
+
58
+ ## Phase 4: FILES_CHANGED Detection
59
+
60
+ After Coder completes, detect changed files:
61
+
62
+ ```bash
63
+ git diff --name-only {starting_sha}...HEAD
64
+ ```
65
+
66
+ Pass FILES_CHANGED to all quality gate agents.
67
+
68
+ ## Phase 5: Quality Gates
69
+
70
+ Run sequentially — each gate must pass before the next:
71
+
72
+ 1. `Task(subagent_type="Validator")` (build + typecheck + lint + tests) — retry up to 2× on failure (Coder fixes between retries)
73
+ 2. `Task(subagent_type="Simplifier")` — code clarity and maintainability pass on FILES_CHANGED
74
+ 3. `Task(subagent_type="Scrutinizer")` — 9-pillar quality evaluation on FILES_CHANGED
75
+ 4. `Task(subagent_type="Validator")` (re-validate after Simplifier/Scrutinizer changes)
76
+ 5. `Task(subagent_type="Shepherd")` — verify implementation matches original request — retry up to 2× if misalignment found
77
+
78
+ If any gate exhausts retries, halt pipeline and report what passed and what failed.
79
+
80
+ ## Phase 6: Completion
81
+
82
+ Report results:
83
+ - Commits created (from Coder)
84
+ - Files changed
85
+ - Quality gate results (pass/fail per gate)
86
+ - No push — user decides when to push
87
+
88
+ ## Error Handling
89
+
90
+ - **Coder BLOCKED**: Halt immediately, report blocker to user
91
+ - **Validator fails after retries**: Report specific failures, halt pipeline
92
+ - **Shepherd misalignment after retries**: Report misalignment details, let user decide next steps
@@ -0,0 +1,128 @@
1
+ ---
2
+ name: knowledge-persistence
3
+ description: >-
4
+ This skill should be used when recording architectural decisions or pitfalls
5
+ to project knowledge files, or when loading prior decisions and known pitfalls
6
+ for context during investigation, specification, or review.
7
+ user-invocable: false
8
+ allowed-tools: Read, Write, Bash
9
+ ---
10
+
11
+ # Knowledge Persistence
12
+
13
+ Record architectural decisions and pitfalls to `.memory/knowledge/` files. This is the single source of truth for the extraction procedure — commands reference this skill instead of inlining the steps.
14
+
15
+ ## Iron Law
16
+
17
+ > **SINGLE SOURCE OF TRUTH**
18
+ >
19
+ > All knowledge extraction follows this procedure exactly. Commands never inline
20
+ > their own extraction steps — they read this skill and follow it.
21
+
22
+ ---
23
+
24
+ ## File Locations
25
+
26
+ ```
27
+ .memory/knowledge/
28
+ ├── decisions.md # ADR entries (append-only)
29
+ └── pitfalls.md # PF entries (area-specific gotchas)
30
+ ```
31
+
32
+ ## File Formats
33
+
34
+ ### decisions.md (ADR entries)
35
+
36
+ **Template header** (create if file missing):
37
+ ```
38
+ <!-- TL;DR: 0 decisions. Key: -->
39
+ # Architectural Decisions
40
+
41
+ Append-only. Status changes allowed; deletions prohibited.
42
+ ```
43
+
44
+ **Entry format**:
45
+ ```markdown
46
+ ## ADR-{NNN}: {Title}
47
+
48
+ - **Date**: {YYYY-MM-DD}
49
+ - **Status**: Accepted
50
+ - **Context**: {Why this decision was needed}
51
+ - **Decision**: {What was decided}
52
+ - **Consequences**: {Tradeoffs and implications}
53
+ - **Source**: {command and identifier, e.g. `/implement TASK-123`}
54
+ ```
55
+
56
+ ### pitfalls.md (PF entries)
57
+
58
+ **Template header** (create if file missing):
59
+ ```
60
+ <!-- TL;DR: 0 pitfalls. Key: -->
61
+ # Known Pitfalls
62
+
63
+ Area-specific gotchas, fragile areas, and past bugs.
64
+ ```
65
+
66
+ **Entry format**:
67
+ ```markdown
68
+ ## PF-{NNN}: {Short description}
69
+
70
+ - **Area**: {file paths or module names}
71
+ - **Issue**: {What goes wrong}
72
+ - **Impact**: {Consequences if hit}
73
+ - **Resolution**: {How to fix or avoid}
74
+ - **Source**: {command and identifier, e.g. `/code-review branch-name`}
75
+ ```
76
+
77
+ ---
78
+
79
+ ## Extraction Procedure
80
+
81
+ Follow these steps when recording decisions or pitfalls:
82
+
83
+ 1. **Read** the target file (`.memory/knowledge/decisions.md` or `.memory/knowledge/pitfalls.md`). If it doesn't exist, create it with the template header above.
84
+ 2. **Check capacity** — count `## ADR-` or `## PF-` headings. If >=50, log "Knowledge base at capacity — skipping new entry" and stop.
85
+ 3. **Find next ID** — find highest NNN via regex (`/^## ADR-(\d+)/` or `/^## PF-(\d+)/`), default to 0. Increment by 1.
86
+ 4. **Deduplicate** (pitfalls only) — skip if an entry with the same Area + Issue already exists.
87
+ 5. **Append** the new entry using the format above.
88
+ 6. **Update TL;DR** — rewrite the `<!-- TL;DR: ... -->` comment on line 1 to reflect the new count and key topics.
89
+
90
+ ## Lock Protocol
91
+
92
+ When writing, use a mkdir-based lock:
93
+ - Lock path: `.memory/.knowledge.lock`
94
+ - Timeout: 30 seconds (fail if lock not acquired)
95
+ - Stale recovery: if lock directory is >60 seconds old, remove it and retry
96
+ - Release lock after write completes (remove lock directory)
97
+
98
+ ## Loading Knowledge for Context
99
+
100
+ When a command needs prior knowledge as input (not recording):
101
+
102
+ 1. Read `.memory/knowledge/decisions.md` if it exists
103
+ 2. Read `.memory/knowledge/pitfalls.md` if it exists
104
+ 3. Pass content as context to downstream agents — prior decisions constrain scope, known pitfalls inform investigation
105
+
106
+ If neither file exists, skip silently. No error, no empty-file creation.
107
+
108
+ ## Operation Budget
109
+
110
+ Recording: do inline (no agent spawn), 2-3 Read/Write operations total.
111
+ Loading: 1-2 Read operations, pass as context string.
112
+
113
+ ---
114
+
115
+ ## Extended References
116
+
117
+ For entry examples and status lifecycle details:
118
+ - `references/examples.md` - Full decision and pitfall entry examples
119
+
120
+ ---
121
+
122
+ ## Success Criteria
123
+
124
+ - [ ] Entry appended with correct sequential ID
125
+ - [ ] No duplicate pitfalls (same Area + Issue)
126
+ - [ ] TL;DR comment updated with current count
127
+ - [ ] Lock acquired before write, released after
128
+ - [ ] Capacity limit (50) respected