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.
- package/CHANGELOG.md +51 -0
- package/README.md +7 -3
- package/dist/commands/ambient.js +1 -1
- package/dist/commands/init.js +31 -2
- package/dist/commands/list.d.ts +21 -0
- package/dist/commands/list.js +71 -3
- package/dist/plugins.js +24 -24
- package/dist/utils/manifest.d.ts +45 -0
- package/dist/utils/manifest.js +100 -0
- package/dist/utils/post-install.js +6 -1
- package/package.json +1 -1
- package/plugins/devflow-accessibility/.claude-plugin/plugin.json +1 -1
- package/plugins/devflow-ambient/.claude-plugin/plugin.json +25 -4
- package/plugins/devflow-ambient/README.md +48 -29
- package/plugins/devflow-ambient/agents/coder.md +135 -0
- package/plugins/devflow-ambient/agents/reviewer.md +165 -0
- package/plugins/devflow-ambient/agents/scrutinizer.md +80 -0
- package/plugins/devflow-ambient/agents/shepherd.md +94 -0
- package/plugins/devflow-ambient/agents/simplifier.md +93 -0
- package/plugins/devflow-ambient/agents/skimmer.md +93 -0
- package/plugins/devflow-ambient/agents/validator.md +86 -0
- package/plugins/devflow-ambient/skills/ambient-router/SKILL.md +72 -28
- package/plugins/devflow-ambient/skills/ambient-router/references/skill-catalog.md +40 -34
- package/plugins/devflow-ambient/skills/debug-orchestration/SKILL.md +69 -0
- package/plugins/devflow-ambient/skills/implementation-orchestration/SKILL.md +92 -0
- package/plugins/devflow-ambient/skills/plan-orchestration/SKILL.md +71 -0
- package/plugins/devflow-audit-claude/.claude-plugin/plugin.json +10 -1
- package/plugins/devflow-audit-claude/commands/audit-claude.md +4 -0
- package/plugins/devflow-code-review/.claude-plugin/plugin.json +2 -1
- package/plugins/devflow-code-review/agents/reviewer.md +47 -9
- package/plugins/devflow-code-review/agents/synthesizer.md +12 -5
- package/plugins/devflow-code-review/commands/code-review-teams.md +43 -30
- package/plugins/devflow-code-review/commands/code-review.md +14 -2
- package/plugins/devflow-code-review/skills/knowledge-persistence/SKILL.md +128 -0
- package/plugins/devflow-code-review/skills/knowledge-persistence/references/examples.md +44 -0
- package/plugins/devflow-core-skills/.claude-plugin/plugin.json +2 -1
- package/plugins/devflow-core-skills/skills/docs-framework/SKILL.md +7 -1
- package/plugins/devflow-core-skills/skills/search-first/SKILL.md +133 -0
- package/plugins/devflow-core-skills/skills/search-first/references/evaluation-criteria.md +101 -0
- package/plugins/devflow-core-skills/skills/test-driven-development/SKILL.md +6 -5
- package/plugins/devflow-debug/.claude-plugin/plugin.json +5 -3
- package/plugins/devflow-debug/agents/synthesizer.md +211 -0
- package/plugins/devflow-debug/commands/debug-teams.md +28 -14
- package/plugins/devflow-debug/commands/debug.md +26 -12
- package/plugins/devflow-debug/skills/knowledge-persistence/SKILL.md +128 -0
- package/plugins/devflow-debug/skills/knowledge-persistence/references/examples.md +44 -0
- package/plugins/devflow-frontend-design/.claude-plugin/plugin.json +1 -1
- package/plugins/devflow-go/.claude-plugin/plugin.json +1 -1
- package/plugins/devflow-implement/.claude-plugin/plugin.json +2 -1
- package/plugins/devflow-implement/agents/coder.md +21 -13
- package/plugins/devflow-implement/agents/simplifier.md +32 -1
- package/plugins/devflow-implement/agents/skimmer.md +5 -0
- package/plugins/devflow-implement/agents/synthesizer.md +12 -5
- package/plugins/devflow-implement/commands/implement-teams.md +73 -60
- package/plugins/devflow-implement/commands/implement.md +45 -40
- package/plugins/devflow-implement/skills/knowledge-persistence/SKILL.md +128 -0
- package/plugins/devflow-implement/skills/knowledge-persistence/references/examples.md +44 -0
- package/plugins/devflow-java/.claude-plugin/plugin.json +1 -1
- package/plugins/devflow-python/.claude-plugin/plugin.json +1 -1
- package/plugins/devflow-react/.claude-plugin/plugin.json +1 -1
- package/plugins/devflow-resolve/.claude-plugin/plugin.json +4 -3
- package/plugins/devflow-resolve/agents/simplifier.md +32 -1
- package/plugins/devflow-resolve/commands/resolve-teams.md +16 -7
- package/plugins/devflow-resolve/commands/resolve.md +16 -7
- package/plugins/devflow-resolve/skills/knowledge-persistence/SKILL.md +128 -0
- package/plugins/devflow-resolve/skills/knowledge-persistence/references/examples.md +44 -0
- package/plugins/devflow-rust/.claude-plugin/plugin.json +1 -1
- package/plugins/devflow-self-review/.claude-plugin/plugin.json +10 -1
- package/plugins/devflow-self-review/agents/simplifier.md +32 -1
- package/plugins/devflow-self-review/commands/self-review.md +10 -4
- package/plugins/devflow-specify/.claude-plugin/plugin.json +1 -1
- package/plugins/devflow-specify/agents/skimmer.md +5 -0
- package/plugins/devflow-specify/agents/synthesizer.md +12 -5
- package/plugins/devflow-specify/commands/specify-teams.md +27 -20
- package/plugins/devflow-specify/commands/specify.md +26 -19
- package/plugins/devflow-typescript/.claude-plugin/plugin.json +1 -1
- package/scripts/hooks/ambient-prompt +8 -7
- package/scripts/hooks/session-start-memory +33 -3
- package/shared/agents/coder.md +21 -13
- package/shared/agents/reviewer.md +47 -9
- package/shared/agents/simplifier.md +32 -1
- package/shared/agents/skimmer.md +5 -0
- package/shared/agents/synthesizer.md +12 -5
- package/shared/skills/ambient-router/SKILL.md +72 -28
- package/shared/skills/ambient-router/references/skill-catalog.md +40 -34
- package/shared/skills/debug-orchestration/SKILL.md +69 -0
- package/shared/skills/docs-framework/SKILL.md +7 -1
- package/shared/skills/implementation-orchestration/SKILL.md +92 -0
- package/shared/skills/knowledge-persistence/SKILL.md +128 -0
- package/shared/skills/knowledge-persistence/references/examples.md +44 -0
- package/shared/skills/plan-orchestration/SKILL.md +71 -0
- package/shared/skills/search-first/SKILL.md +133 -0
- package/shared/skills/search-first/references/evaluation-criteria.md +101 -0
- package/shared/skills/test-driven-development/SKILL.md +6 -5
- package/plugins/devflow-ambient/commands/ambient.md +0 -110
|
@@ -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)
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: search-first
|
|
3
|
+
description: >-
|
|
4
|
+
This skill should be used when the user asks to "add a utility", "create a helper",
|
|
5
|
+
"implement parsing", "build a wrapper", or writes infrastructure/utility code that
|
|
6
|
+
may already exist as a well-maintained package. Enforces research before building.
|
|
7
|
+
user-invocable: false
|
|
8
|
+
allowed-tools: Read, Grep, Glob
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Search-First
|
|
12
|
+
|
|
13
|
+
Research before building. Check if a battle-tested solution exists before writing custom utility code.
|
|
14
|
+
|
|
15
|
+
## Iron Law
|
|
16
|
+
|
|
17
|
+
> **RESEARCH BEFORE BUILDING**
|
|
18
|
+
>
|
|
19
|
+
> Never write custom utility code without first checking if a battle-tested solution
|
|
20
|
+
> exists. The best code is code you don't write. A maintained package with thousands
|
|
21
|
+
> of users will always beat a hand-rolled utility in reliability, edge cases, and
|
|
22
|
+
> long-term maintenance.
|
|
23
|
+
|
|
24
|
+
## When This Skill Activates
|
|
25
|
+
|
|
26
|
+
**Triggers** — creating or modifying code that:
|
|
27
|
+
- Parses, formats, or validates data (dates, URLs, emails, UUIDs, etc.)
|
|
28
|
+
- Implements common algorithms (sorting, diffing, hashing, encoding)
|
|
29
|
+
- Wraps HTTP clients, retries, rate limiting, caching
|
|
30
|
+
- Handles file system operations beyond basic read/write
|
|
31
|
+
- Implements CLI argument parsing, logging, or configuration
|
|
32
|
+
- Creates test utilities (mocking, fixtures, assertions)
|
|
33
|
+
|
|
34
|
+
**Does NOT trigger** for:
|
|
35
|
+
- Domain-specific business logic unique to this project
|
|
36
|
+
- Glue code connecting existing components
|
|
37
|
+
- Trivial operations (< 5 lines, single-use)
|
|
38
|
+
- Code that intentionally avoids external dependencies (e.g., zero-dep libraries)
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Research Process
|
|
43
|
+
|
|
44
|
+
### Phase 1: Need Analysis
|
|
45
|
+
|
|
46
|
+
Before searching, define what you actually need:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
Need: {one-sentence description of the capability}
|
|
50
|
+
Constraints: {runtime, bundle size, license, zero-dep requirement}
|
|
51
|
+
Must-haves: {non-negotiable requirements}
|
|
52
|
+
Nice-to-haves: {optional features}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Phase 2: Search
|
|
56
|
+
|
|
57
|
+
Delegate research to an Explore subagent to keep main session context clean.
|
|
58
|
+
|
|
59
|
+
**Spawn an Explore agent** with this prompt template:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
Task(subagent_type="Explore"):
|
|
63
|
+
"Research existing solutions for: {need description}
|
|
64
|
+
|
|
65
|
+
Search for:
|
|
66
|
+
1. npm/PyPI/crates packages that solve this (check package.json/requirements.txt for ecosystem)
|
|
67
|
+
2. Existing utilities in this codebase (grep for related function names)
|
|
68
|
+
3. Framework built-ins that already handle this
|
|
69
|
+
|
|
70
|
+
For each candidate, find:
|
|
71
|
+
- Package name and weekly downloads (if applicable)
|
|
72
|
+
- Last publish date and maintenance status
|
|
73
|
+
- Bundle size / dependency count
|
|
74
|
+
- API surface relevant to our need
|
|
75
|
+
- License compatibility
|
|
76
|
+
|
|
77
|
+
Return top 3 candidates with pros/cons, or confirm nothing suitable exists."
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Phase 3: Evaluate
|
|
81
|
+
|
|
82
|
+
Score each candidate against evaluation criteria. See `references/evaluation-criteria.md` for the full matrix.
|
|
83
|
+
|
|
84
|
+
Quick checklist:
|
|
85
|
+
- [ ] Last published within 12 months
|
|
86
|
+
- [ ] Weekly downloads > 1,000 (npm) or equivalent traction
|
|
87
|
+
- [ ] No known vulnerabilities (check Snyk/npm audit)
|
|
88
|
+
- [ ] API fits the use case without heavy wrapping
|
|
89
|
+
- [ ] License compatible with project (MIT/Apache/BSD preferred)
|
|
90
|
+
- [ ] Bundle size acceptable for the project context
|
|
91
|
+
|
|
92
|
+
### Phase 4: Decide
|
|
93
|
+
|
|
94
|
+
Choose one of four outcomes:
|
|
95
|
+
|
|
96
|
+
| Decision | When | Action |
|
|
97
|
+
|----------|------|--------|
|
|
98
|
+
| **Adopt** | Exact match, well-maintained, good API | Install and use directly |
|
|
99
|
+
| **Extend** | Partial match, needs thin wrapper | Install + write minimal adapter |
|
|
100
|
+
| **Compose** | No single package fits, but 2-3 small ones combine well | Install multiple, write glue code |
|
|
101
|
+
| **Build** | Nothing fits, or dependency cost exceeds value | Write custom, document why |
|
|
102
|
+
|
|
103
|
+
**Document the decision** in a code comment at the usage site:
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
// search-first: Adopted date-fns for date formatting (2M weekly downloads, 30KB)
|
|
107
|
+
// search-first: Built custom — no package handles our specific wire format
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Anti-Patterns
|
|
113
|
+
|
|
114
|
+
| Anti-Pattern | Correct Approach |
|
|
115
|
+
|-------------|-----------------|
|
|
116
|
+
| Adding a dependency for 5 lines of trivial code | Build — dependency overhead exceeds value |
|
|
117
|
+
| Choosing the most popular package without checking fit | Evaluate API fit, not just popularity |
|
|
118
|
+
| Wrapping a package so heavily it obscures the original | If wrapping > 50% of original API, reconsider |
|
|
119
|
+
| Skipping research because "I know how to build this" | Research anyway — maintenance cost matters more than initial build |
|
|
120
|
+
| Installing a massive framework for one utility function | Look for focused, single-purpose packages |
|
|
121
|
+
|
|
122
|
+
## Scope Limiter
|
|
123
|
+
|
|
124
|
+
This skill concerns **utility and infrastructure code** only:
|
|
125
|
+
- Data transformation, validation, formatting
|
|
126
|
+
- Network operations, retries, caching
|
|
127
|
+
- CLI tooling, logging, configuration
|
|
128
|
+
- Test utilities and helpers
|
|
129
|
+
|
|
130
|
+
It does NOT apply to **domain-specific business logic** where:
|
|
131
|
+
- The logic encodes unique business rules
|
|
132
|
+
- No generic solution could exist
|
|
133
|
+
- The code is inherently project-specific
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Search-First — Evaluation Criteria
|
|
2
|
+
|
|
3
|
+
Detailed package evaluation criteria and decision matrix for the 4-outcome model.
|
|
4
|
+
|
|
5
|
+
## Evaluation Matrix
|
|
6
|
+
|
|
7
|
+
Score each candidate on these axes (1-5 scale):
|
|
8
|
+
|
|
9
|
+
| Criterion | Weight | 1 (Poor) | 3 (Acceptable) | 5 (Excellent) |
|
|
10
|
+
|-----------|--------|-----------|-----------------|----------------|
|
|
11
|
+
| **Maintenance** | High | No commits in 2+ years | Active, yearly releases | Regular releases, responsive maintainer |
|
|
12
|
+
| **Adoption** | Medium | < 100 weekly downloads | 1K-10K weekly downloads | > 100K weekly downloads |
|
|
13
|
+
| **API Fit** | High | Needs heavy wrapping | Partial fit, thin adapter needed | Direct use, clean API |
|
|
14
|
+
| **Bundle Size** | Medium | > 500KB | 50-500KB | < 50KB |
|
|
15
|
+
| **Security** | High | Known vulnerabilities | No known issues, few dependencies | Audited, zero/minimal dependencies |
|
|
16
|
+
| **License** | Required | GPL/AGPL (restrictive) | LGPL (conditional) | MIT/Apache/BSD (permissive) |
|
|
17
|
+
|
|
18
|
+
**Minimum thresholds**: License must be compatible. Security must be ≥ 3. All others are trade-offs.
|
|
19
|
+
|
|
20
|
+
## Decision Matrix
|
|
21
|
+
|
|
22
|
+
### Adopt (score ≥ 20/25, API Fit ≥ 4)
|
|
23
|
+
|
|
24
|
+
The package directly solves the problem with minimal integration code.
|
|
25
|
+
|
|
26
|
+
**Example**: Using `zod` for schema validation — exact fit, massive adoption, tiny bundle.
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
✅ Adopt: zod v3.22
|
|
30
|
+
- Maintenance: 5 (monthly releases)
|
|
31
|
+
- Adoption: 5 (4M weekly downloads)
|
|
32
|
+
- API Fit: 5 (direct use for all validation)
|
|
33
|
+
- Bundle Size: 4 (57KB)
|
|
34
|
+
- Security: 5 (zero dependencies)
|
|
35
|
+
- Total: 24/25
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Extend (score ≥ 15/25, API Fit ≥ 2)
|
|
39
|
+
|
|
40
|
+
The package handles 60-80% of the need. Write a thin adapter for the rest.
|
|
41
|
+
|
|
42
|
+
**Example**: Using `got` for HTTP but wrapping it with project-specific retry and auth logic.
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
✅ Extend: got v14
|
|
46
|
+
- Maintenance: 4 (active)
|
|
47
|
+
- Adoption: 5 (8M weekly downloads)
|
|
48
|
+
- API Fit: 3 (need custom retry wrapper)
|
|
49
|
+
- Bundle Size: 3 (150KB)
|
|
50
|
+
- Security: 4 (minimal deps)
|
|
51
|
+
- Total: 19/25
|
|
52
|
+
Adapter: ~30 lines wrapping retry + auth headers
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Compose (no single package fits, but small packages combine)
|
|
56
|
+
|
|
57
|
+
Two or three focused packages together solve the problem better than one large framework.
|
|
58
|
+
|
|
59
|
+
**Example**: `ms` (time parsing) + `p-retry` (retry logic) + `quick-lru` (caching) instead of a monolithic HTTP client framework.
|
|
60
|
+
|
|
61
|
+
**Rules for Compose**:
|
|
62
|
+
- Maximum 3 packages in a composition
|
|
63
|
+
- Each package must be focused (single responsibility)
|
|
64
|
+
- Total combined bundle < what a monolithic alternative would cost
|
|
65
|
+
- Glue code should be < 50 lines
|
|
66
|
+
|
|
67
|
+
### Build (nothing fits, or dependency cost > value)
|
|
68
|
+
|
|
69
|
+
Write custom code when:
|
|
70
|
+
- No package scores ≥ 15/25
|
|
71
|
+
- The code is < 50 lines and trivial
|
|
72
|
+
- Zero-dependency constraint is explicit
|
|
73
|
+
- The domain is too specific for generic packages
|
|
74
|
+
|
|
75
|
+
**Required**: Document why Build was chosen:
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
// search-first: Built custom — our wire format uses non-standard
|
|
79
|
+
// ISO-8601 extensions that no date library handles correctly.
|
|
80
|
+
// Evaluated: date-fns (no custom format support), luxon (500KB overhead),
|
|
81
|
+
// dayjs (close but missing timezone edge case).
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Ecosystem-Specific Hints
|
|
85
|
+
|
|
86
|
+
### Node.js / TypeScript
|
|
87
|
+
- Check npm: `https://www.npmjs.com/package/{name}`
|
|
88
|
+
- Bundle size: `https://bundlephobia.com/package/{name}`
|
|
89
|
+
- Check if Node.js built-ins handle it (`node:crypto`, `node:url`, `node:path`)
|
|
90
|
+
|
|
91
|
+
### Python
|
|
92
|
+
- Check PyPI: `https://pypi.org/project/{name}`
|
|
93
|
+
- Check if stdlib handles it (`urllib`, `json`, `pathlib`, `dataclasses`)
|
|
94
|
+
|
|
95
|
+
### Rust
|
|
96
|
+
- Check crates.io: `https://crates.io/crates/{name}`
|
|
97
|
+
- Check if std handles it
|
|
98
|
+
|
|
99
|
+
### Go
|
|
100
|
+
- Check pkg.go.dev
|
|
101
|
+
- Go standard library is extensive — check stdlib first
|
|
@@ -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
|
|
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
|
-
- **
|
|
134
|
-
- **
|
|
135
|
-
- **
|
|
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
|