devflow-kit 1.5.0 → 1.6.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 (86) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +9 -4
  3. package/dist/commands/ambient.js +1 -1
  4. package/dist/commands/init.js +8 -4
  5. package/dist/commands/uninstall.d.ts +9 -0
  6. package/dist/commands/uninstall.js +60 -4
  7. package/dist/plugins.js +23 -23
  8. package/dist/utils/post-install.js +6 -2
  9. package/package.json +1 -1
  10. package/plugins/devflow-accessibility/.claude-plugin/plugin.json +1 -1
  11. package/plugins/devflow-ambient/.claude-plugin/plugin.json +25 -4
  12. package/plugins/devflow-ambient/README.md +48 -29
  13. package/plugins/devflow-ambient/agents/coder.md +135 -0
  14. package/plugins/devflow-ambient/agents/reviewer.md +165 -0
  15. package/plugins/devflow-ambient/agents/scrutinizer.md +80 -0
  16. package/plugins/devflow-ambient/agents/shepherd.md +94 -0
  17. package/plugins/devflow-ambient/agents/simplifier.md +93 -0
  18. package/plugins/devflow-ambient/agents/skimmer.md +93 -0
  19. package/plugins/devflow-ambient/agents/validator.md +86 -0
  20. package/plugins/devflow-ambient/skills/ambient-router/SKILL.md +76 -29
  21. package/plugins/devflow-ambient/skills/ambient-router/references/skill-catalog.md +40 -35
  22. package/plugins/devflow-ambient/skills/debug-orchestration/SKILL.md +69 -0
  23. package/plugins/devflow-ambient/skills/implementation-orchestration/SKILL.md +92 -0
  24. package/plugins/devflow-ambient/skills/plan-orchestration/SKILL.md +71 -0
  25. package/plugins/devflow-audit-claude/.claude-plugin/plugin.json +10 -1
  26. package/plugins/devflow-audit-claude/commands/audit-claude.md +4 -0
  27. package/plugins/devflow-code-review/.claude-plugin/plugin.json +2 -1
  28. package/plugins/devflow-code-review/agents/reviewer.md +10 -9
  29. package/plugins/devflow-code-review/commands/code-review-teams.md +43 -30
  30. package/plugins/devflow-code-review/commands/code-review.md +10 -1
  31. package/plugins/devflow-code-review/skills/knowledge-persistence/SKILL.md +128 -0
  32. package/plugins/devflow-code-review/skills/knowledge-persistence/references/examples.md +44 -0
  33. package/plugins/devflow-core-skills/.claude-plugin/plugin.json +1 -1
  34. package/plugins/devflow-core-skills/skills/docs-framework/SKILL.md +7 -2
  35. package/plugins/devflow-core-skills/skills/test-driven-development/SKILL.md +6 -5
  36. package/plugins/devflow-debug/.claude-plugin/plugin.json +5 -3
  37. package/plugins/devflow-debug/agents/synthesizer.md +211 -0
  38. package/plugins/devflow-debug/commands/debug-teams.md +28 -14
  39. package/plugins/devflow-debug/commands/debug.md +26 -12
  40. package/plugins/devflow-debug/skills/knowledge-persistence/SKILL.md +128 -0
  41. package/plugins/devflow-debug/skills/knowledge-persistence/references/examples.md +44 -0
  42. package/plugins/devflow-frontend-design/.claude-plugin/plugin.json +1 -1
  43. package/plugins/devflow-go/.claude-plugin/plugin.json +1 -1
  44. package/plugins/devflow-implement/.claude-plugin/plugin.json +2 -1
  45. package/plugins/devflow-implement/agents/coder.md +6 -1
  46. package/plugins/devflow-implement/agents/simplifier.md +32 -1
  47. package/plugins/devflow-implement/agents/skimmer.md +5 -0
  48. package/plugins/devflow-implement/commands/implement-teams.md +72 -55
  49. package/plugins/devflow-implement/commands/implement.md +44 -35
  50. package/plugins/devflow-implement/skills/knowledge-persistence/SKILL.md +128 -0
  51. package/plugins/devflow-implement/skills/knowledge-persistence/references/examples.md +44 -0
  52. package/plugins/devflow-java/.claude-plugin/plugin.json +1 -1
  53. package/plugins/devflow-python/.claude-plugin/plugin.json +1 -1
  54. package/plugins/devflow-react/.claude-plugin/plugin.json +1 -1
  55. package/plugins/devflow-resolve/.claude-plugin/plugin.json +4 -3
  56. package/plugins/devflow-resolve/agents/simplifier.md +32 -1
  57. package/plugins/devflow-resolve/commands/resolve-teams.md +16 -7
  58. package/plugins/devflow-resolve/commands/resolve.md +16 -7
  59. package/plugins/devflow-resolve/skills/knowledge-persistence/SKILL.md +128 -0
  60. package/plugins/devflow-resolve/skills/knowledge-persistence/references/examples.md +44 -0
  61. package/plugins/devflow-rust/.claude-plugin/plugin.json +1 -1
  62. package/plugins/devflow-self-review/.claude-plugin/plugin.json +10 -1
  63. package/plugins/devflow-self-review/agents/simplifier.md +32 -1
  64. package/plugins/devflow-self-review/commands/self-review.md +10 -4
  65. package/plugins/devflow-specify/.claude-plugin/plugin.json +1 -1
  66. package/plugins/devflow-specify/agents/skimmer.md +5 -0
  67. package/plugins/devflow-specify/commands/specify-teams.md +27 -20
  68. package/plugins/devflow-specify/commands/specify.md +26 -19
  69. package/plugins/devflow-typescript/.claude-plugin/plugin.json +1 -1
  70. package/scripts/hooks/ambient-prompt +10 -8
  71. package/scripts/hooks/background-memory-update +114 -85
  72. package/scripts/hooks/session-start-memory +34 -20
  73. package/shared/agents/coder.md +6 -1
  74. package/shared/agents/reviewer.md +10 -9
  75. package/shared/agents/simplifier.md +32 -1
  76. package/shared/agents/skimmer.md +5 -0
  77. package/shared/skills/ambient-router/SKILL.md +76 -29
  78. package/shared/skills/ambient-router/references/skill-catalog.md +40 -35
  79. package/shared/skills/debug-orchestration/SKILL.md +69 -0
  80. package/shared/skills/docs-framework/SKILL.md +7 -2
  81. package/shared/skills/implementation-orchestration/SKILL.md +92 -0
  82. package/shared/skills/knowledge-persistence/SKILL.md +128 -0
  83. package/shared/skills/knowledge-persistence/references/examples.md +44 -0
  84. package/shared/skills/plan-orchestration/SKILL.md +71 -0
  85. package/shared/skills/test-driven-development/SKILL.md +6 -5
  86. package/plugins/devflow-ambient/commands/ambient.md +0 -110
@@ -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
@@ -0,0 +1,44 @@
1
+ # Knowledge Persistence Examples
2
+
3
+ ## Decision Entry Example
4
+
5
+ ```markdown
6
+ ## ADR-001: Use mkdir-based locks for concurrent session serialization
7
+
8
+ - **Date**: 2026-03-03
9
+ - **Status**: Accepted
10
+ - **Context**: Multiple Claude Code sessions can run on the same project simultaneously (different terminals, SSH, etc.). Memory writes must serialize to prevent corruption.
11
+ - **Decision**: Use `mkdir` as an atomic lock primitive. Lock directory at `.memory/.knowledge.lock`. 30-second timeout with 60-second stale recovery.
12
+ - **Consequences**: Simple, cross-platform, no external dependencies. Cannot detect holder PID if lock is stale — relies on age-based recovery. Sufficient for low-contention writes.
13
+ - **Source**: `/implement #99`
14
+ ```
15
+
16
+ ## Pitfall Entry Example
17
+
18
+ ```markdown
19
+ ## PF-001: Orphaned teams variants silently skipped
20
+
21
+ - **Area**: plugins/devflow-*/commands/*-teams.md, src/cli/installer
22
+ - **Issue**: The installer iterates base `.md` files and looks up matching `-teams.md` variants. A `-teams.md` file without a corresponding base `.md` is silently ignored during installation.
23
+ - **Impact**: Teams variant appears committed but never installs. Users on `--teams` mode silently get no command.
24
+ - **Resolution**: Always create the base `.md` file first. CI should validate that every `-teams.md` has a matching base file.
25
+ - **Source**: `/code-review feat/agent-teams`
26
+ ```
27
+
28
+ ## Status Lifecycle (Decisions Only)
29
+
30
+ Decisions support status transitions:
31
+ - `Accepted` — current, in effect
32
+ - `Superseded by ADR-NNN` — replaced by a newer decision
33
+ - `Deprecated` — no longer relevant, kept for history
34
+
35
+ Pitfalls have no status field — they remain until manually removed.
36
+
37
+ ## Deduplication Logic (Pitfalls Only)
38
+
39
+ Before appending a new pitfall, check existing entries:
40
+ 1. Extract `Area` and `Issue` from the new entry
41
+ 2. Compare against all existing `PF-*` entries
42
+ 3. If both Area AND Issue match an existing entry (case-insensitive substring), skip
43
+
44
+ This prevents recording the same gotcha from multiple review cycles.
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: plan-orchestration
3
+ description: Agent orchestration for PLAN intent — codebase orientation, design exploration, gap validation
4
+ user-invocable: false
5
+ allowed-tools: Read, Grep, Glob, Bash, Task, AskUserQuestion
6
+ ---
7
+
8
+ # Plan Orchestration
9
+
10
+ Agent pipeline for PLAN intent in ambient ORCHESTRATED mode. Codebase orientation, targeted exploration, architecture design, and gap validation.
11
+
12
+ This is a lightweight variant of the Plan phase in `/implement` for ambient ORCHESTRATED mode.
13
+
14
+ ## Iron Law
15
+
16
+ > **PLANS WITHOUT CODEBASE GROUNDING ARE FANTASIES**
17
+ >
18
+ > Orient before architecting. Every design decision must reference existing patterns,
19
+ > real file structures, and actual integration points. A plan that ignores the codebase
20
+ > will fail on contact with implementation.
21
+
22
+ ---
23
+
24
+ ## Phase 1: Orient
25
+
26
+ Spawn `Task(subagent_type="Skimmer")` to get codebase overview relevant to the planning question:
27
+
28
+ - Existing patterns and conventions in the affected area
29
+ - File structure and module boundaries
30
+ - Test patterns and coverage approach
31
+ - Related prior implementations (similar features, analogous patterns)
32
+
33
+ ## Phase 2: Explore
34
+
35
+ Based on Skimmer findings, spawn 2-3 `Task(subagent_type="Explore")` agents **in a single message** (parallel execution):
36
+
37
+ - **Integration explorer**: Examine integration points — APIs, shared types, module boundaries the plan must respect
38
+ - **Pattern explorer**: Find existing implementations of similar features to follow as templates
39
+ - **Constraint explorer**: Identify constraints — test infrastructure, build system, CI requirements, deployment concerns
40
+
41
+ Adjust explorer focus based on the specific planning question.
42
+
43
+ ## Phase 3: Design
44
+
45
+ Spawn `Task(subagent_type="Plan")` with combined Skimmer + Explore findings:
46
+
47
+ - Design implementation approach with file-level specificity
48
+ - Reference existing patterns discovered in Phase 1-2
49
+ - Include: architecture decisions, file changes, new files needed, test strategy
50
+ - Flag any areas where existing patterns conflict with the proposed approach
51
+
52
+ ## Phase 4: Validate
53
+
54
+ Main session reviews the plan for:
55
+
56
+ - **Gaps**: Missing files, unhandled edge cases, integration points not addressed
57
+ - **Risks**: Areas where the plan deviates from existing patterns, potential regressions
58
+ - **Ambiguities**: Design choices that need user input
59
+
60
+ Present plan to user with identified risks. Use AskUserQuestion for any ambiguous design choices.
61
+
62
+ ## Output
63
+
64
+ Structured plan ready to feed into IMPLEMENT/ORCHESTRATED if user proceeds:
65
+
66
+ - Goal and scope
67
+ - Architecture decisions with rationale
68
+ - File-level change list (create/modify/delete)
69
+ - Test strategy
70
+ - Risks and mitigations
71
+ - Open questions (if any)
@@ -91,7 +91,7 @@ See `references/rationalization-prevention.md` for extended examples with code.
91
91
 
92
92
  ## Process Enforcement
93
93
 
94
- When implementing any feature under ambient BUILD/GUIDED:
94
+ When implementing any feature under ambient IMPLEMENT/GUIDED or IMPLEMENT/ORCHESTRATED:
95
95
 
96
96
  1. **Identify the first behavior** — What is the simplest thing this feature must do?
97
97
  2. **Write the test** — Describe that behavior as a failing test
@@ -130,7 +130,8 @@ When skipping TDD, never rationalize. State clearly: "Skipping TDD because: [spe
130
130
 
131
131
  ## Integration with Ambient Mode
132
132
 
133
- - **BUILD/GUIDED** → TDD enforced. Every new function/method gets test-first treatment.
134
- - **BUILD/QUICK** → TDD skipped (trivial single-file edit).
135
- - **BUILD/ELEVATE** → TDD mentioned in nudge toward `/implement`.
136
- - **DEBUG/GUIDED** → TDD applies to the fix: write a test that reproduces the bug first, then fix.
133
+ - **IMPLEMENT/GUIDED** → TDD enforced in main session. Write the failing test before production code. Skill loaded directly.
134
+ - **IMPLEMENT/ORCHESTRATED** → TDD enforced via Coder agent (skill in Coder frontmatter). Every implementation gets test-first treatment.
135
+ - **IMPLEMENT/QUICK** → TDD skipped (trivial single-file edit).
136
+ - **DEBUG/GUIDED** → TDD applies to the fix in main session: write a test that reproduces the bug first, then fix.
137
+ - **DEBUG/ORCHESTRATED** → TDD applies to the fix: write a test that reproduces the bug first, then fix.
@@ -1,110 +0,0 @@
1
- ---
2
- description: Ambient mode — classify intent and auto-load relevant skills for any prompt
3
- ---
4
-
5
- # Ambient Command
6
-
7
- Classify user intent and auto-load relevant skills. No agents spawned — enhances the main session only.
8
-
9
- ## Usage
10
-
11
- ```
12
- /ambient <prompt> Classify and respond with skill enforcement
13
- /ambient Show usage
14
- ```
15
-
16
- ## Phases
17
-
18
- ### Phase 1: Load Router
19
-
20
- Read the `ambient-router` skill:
21
- - `~/.claude/skills/ambient-router/SKILL.md`
22
-
23
- ### Phase 2: Classify
24
-
25
- Apply the ambient-router classification to `$ARGUMENTS`:
26
-
27
- 1. **Intent:** BUILD | DEBUG | REVIEW | PLAN | EXPLORE | CHAT
28
- 2. **Depth:** QUICK | GUIDED | ELEVATE
29
-
30
- If no arguments provided, output:
31
-
32
- ```
33
- ## Ambient Mode
34
-
35
- Classify intent and auto-load relevant skills.
36
-
37
- Usage: /ambient <your prompt>
38
-
39
- Examples:
40
- /ambient add a login form → BUILD/GUIDED (loads TDD + implementation-patterns)
41
- /ambient fix the auth error → DEBUG/GUIDED (loads test-patterns + core-patterns)
42
- /ambient where is the config? → EXPLORE/QUICK (responds normally)
43
- /ambient refactor the auth system → BUILD/ELEVATE (suggests /implement)
44
-
45
- Always-on: devflow ambient --enable
46
- ```
47
-
48
- Then stop.
49
-
50
- ### Phase 3: State Classification
51
-
52
- - **QUICK:** Skip this phase entirely. Respond directly in Phase 4.
53
- - **GUIDED:** Output one line: `Ambient: {INTENT}/{DEPTH}. Loading: {skill1}, {skill2}.`
54
- - **ELEVATE:** Skip — recommendation happens in Phase 4.
55
-
56
- ### Phase 4: Apply
57
-
58
- **QUICK:**
59
- Respond to the user's prompt normally. Zero skill loading. Zero overhead.
60
-
61
- **GUIDED:**
62
- Read the selected skills based on the ambient-router's skill selection matrix:
63
-
64
- | Intent | Primary Skills | Secondary (conditional) |
65
- |--------|---------------|------------------------|
66
- | BUILD | test-driven-development, implementation-patterns | typescript (.ts), react (.tsx), frontend-design (CSS/UI), input-validation (forms/API), security-patterns (auth/crypto) |
67
- | DEBUG | test-patterns, core-patterns | git-safety (if git ops) |
68
- | REVIEW | self-review, core-patterns | test-patterns |
69
- | PLAN | implementation-patterns | core-patterns |
70
-
71
- Read up to 3 skills from `~/.claude/skills/{name}/SKILL.md`. Apply their patterns and constraints when responding to the user's prompt.
72
-
73
- For BUILD intent: enforce RED-GREEN-REFACTOR from test-driven-development. Write failing tests before production code.
74
-
75
- **ELEVATE:**
76
- Respond to the user's prompt with your best effort, then append:
77
-
78
- > This task spans multiple files/systems. Consider `/implement` for full lifecycle management (exploration → planning → implementation → review).
79
-
80
- ## Architecture
81
-
82
- ```
83
- /ambient <prompt> (main session, no agents)
84
-
85
- ├─ Phase 1: Load ambient-router skill
86
- ├─ Phase 2: Classify intent + depth
87
- ├─ Phase 3: State classification (GUIDED only)
88
- └─ Phase 4: Apply
89
- ├─ QUICK → respond directly
90
- ├─ GUIDED → load 2-3 skills, apply patterns, respond
91
- └─ ELEVATE → respond + workflow nudge
92
- ```
93
-
94
- ## Edge Cases
95
-
96
- | Case | Handling |
97
- |------|----------|
98
- | No arguments | Show usage and stop |
99
- | Single word ("help") | Classify — likely CHAT/QUICK |
100
- | Prompt references `/implement` etc. | Classify as normal — user chose /ambient intentionally |
101
- | Mixed intent ("fix and add test") | Use higher-overhead intent (BUILD > DEBUG) |
102
- | User says "no enforcement" | Respect immediately — treat as QUICK |
103
-
104
- ## Principles
105
-
106
- 1. **No agents** — Ambient enhances the main session, never spawns subagents
107
- 2. **Proportional** — QUICK gets zero overhead, GUIDED gets 2-3 skills, ELEVATE gets a nudge
108
- 3. **Transparent** — State classification for GUIDED/ELEVATE, silent for QUICK
109
- 4. **Respectful** — Never over-classify; when in doubt, go one tier lower
110
- 5. **TDD for BUILD** — GUIDED depth BUILD tasks enforce test-first workflow