@fernado03/zoo-flow 0.9.1 → 0.11.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/README.md +139 -83
- package/bin/zoo-flow.js +444 -134
- package/package.json +3 -3
- package/templates/claude-code/.claude/commands/caveman.md +26 -0
- package/templates/claude-code/.claude/commands/commit-and-document.md +27 -0
- package/templates/claude-code/.claude/commands/diagnose.md +27 -0
- package/templates/claude-code/.claude/commands/feature.md +46 -0
- package/templates/claude-code/.claude/commands/fix.md +45 -0
- package/templates/claude-code/.claude/commands/grill-me.md +27 -0
- package/templates/claude-code/.claude/commands/grill-with-docs.md +27 -0
- package/templates/claude-code/.claude/commands/handoff.md +27 -0
- package/templates/claude-code/.claude/commands/improve-codebase-architecture.md +27 -0
- package/templates/claude-code/.claude/commands/prototype.md +27 -0
- package/templates/claude-code/.claude/commands/refactor.md +46 -0
- package/templates/claude-code/.claude/commands/review.md +27 -0
- package/templates/claude-code/.claude/commands/scaffold-context.md +27 -0
- package/templates/claude-code/.claude/commands/setup-matt-pocock-skills.md +27 -0
- package/templates/claude-code/.claude/commands/tdd.md +27 -0
- package/templates/claude-code/.claude/commands/teach.md +27 -0
- package/templates/claude-code/.claude/commands/to-issues.md +27 -0
- package/templates/claude-code/.claude/commands/to-prd.md +27 -0
- package/templates/claude-code/.claude/commands/triage.md +27 -0
- package/templates/claude-code/.claude/commands/tweak.md +27 -0
- package/templates/claude-code/.claude/commands/update-docs.md +27 -0
- package/templates/claude-code/.claude/commands/verify.md +27 -0
- package/templates/claude-code/.claude/commands/write-a-skill.md +27 -0
- package/templates/claude-code/.claude/commands/zoom-out.md +27 -0
- package/templates/claude-code/.claude/skills/engineering/commit-and-document/SKILL.md +37 -0
- package/templates/claude-code/.claude/skills/engineering/diagnose/SKILL.md +136 -0
- package/templates/claude-code/.claude/skills/engineering/explore/SKILL.md +61 -0
- package/templates/claude-code/.claude/skills/engineering/feature/SKILL.md +66 -0
- package/templates/claude-code/.claude/skills/engineering/fix/SKILL.md +59 -0
- package/templates/claude-code/.claude/skills/engineering/grill-with-docs/SKILL.md +35 -0
- package/templates/claude-code/.claude/skills/engineering/improve-codebase-architecture/SKILL.md +39 -0
- package/templates/claude-code/.claude/skills/engineering/prototype/SKILL.md +34 -0
- package/templates/claude-code/.claude/skills/engineering/refactor/SKILL.md +59 -0
- package/templates/claude-code/.claude/skills/engineering/review/SKILL.md +144 -0
- package/templates/claude-code/.claude/skills/engineering/scaffold-context/SKILL.md +44 -0
- package/templates/claude-code/.claude/skills/engineering/setup-matt-pocock-skills/SKILL.md +48 -0
- package/templates/claude-code/.claude/skills/engineering/tdd/SKILL.md +81 -0
- package/templates/claude-code/.claude/skills/engineering/to-issues/SKILL.md +37 -0
- package/templates/claude-code/.claude/skills/engineering/to-prd/SKILL.md +39 -0
- package/templates/claude-code/.claude/skills/engineering/triage/SKILL.md +36 -0
- package/templates/claude-code/.claude/skills/engineering/tweak/SKILL.md +37 -0
- package/templates/claude-code/.claude/skills/engineering/update-docs/SKILL.md +33 -0
- package/templates/claude-code/.claude/skills/engineering/verify/SKILL.md +38 -0
- package/templates/claude-code/.claude/skills/engineering/zoom-out/SKILL.md +74 -0
- package/templates/claude-code/.claude/skills/productivity/caveman/SKILL.md +24 -0
- package/templates/claude-code/.claude/skills/productivity/grill-me/SKILL.md +21 -0
- package/templates/claude-code/.claude/skills/productivity/handoff/SKILL.md +20 -0
- package/templates/claude-code/.claude/skills/productivity/teach/SKILL.md +116 -0
- package/templates/claude-code/.claude/skills/productivity/write-a-skill/SKILL.md +59 -0
- package/templates/claude-code/.zoo-flow/CONTEXT.md +8 -0
- package/templates/claude-code/.zoo-flow/START_HERE.md +28 -0
- package/templates/claude-code/.zoo-flow/docs/adr/0001-record-architecture-decisions.md +22 -0
- package/templates/claude-code/.zoo-flow/evals/no-regression-checklist.md +26 -0
- package/templates/claude-code/.zoo-flow/evals/routing-cases.jsonl +18 -0
- package/templates/claude-code/.zoo-flow/evals/routing-cases.md +211 -0
- package/templates/claude-code/.zoo-flow/project-profile.json +24 -0
- package/templates/claude-code/CLAUDE.md +237 -0
- package/templates/full/.roo/rules/07-scratch-working-memory.md +39 -0
- package/templates/full/.roo/skills/engineering/diagnose/SKILL.md +44 -10
- package/templates/full/.roo/skills/engineering/review/SKILL.md +35 -11
- package/templates/full/.roo/skills/engineering/zoom-out/SKILL.md +55 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Verify that changes work correctly by running tests"
|
|
3
|
+
argument-hint: "<what to verify>"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Verify — Test and Validation
|
|
7
|
+
|
|
8
|
+
This command runs tests and validations to verify changes work correctly.
|
|
9
|
+
|
|
10
|
+
## Behavioral Context: Implementer
|
|
11
|
+
|
|
12
|
+
You are operating in the **Implementer profile**:
|
|
13
|
+
- **File access**: Full repository access (read-only during verification)
|
|
14
|
+
- **Scope**: Run tests, don't modify code
|
|
15
|
+
- **Output**: Test results and verification report
|
|
16
|
+
|
|
17
|
+
## Procedure
|
|
18
|
+
|
|
19
|
+
Read and follow the skill file: `.claude/skills/engineering/verify/SKILL.md`
|
|
20
|
+
|
|
21
|
+
## Expected Outcome
|
|
22
|
+
|
|
23
|
+
- All relevant tests executed
|
|
24
|
+
- Clear pass/fail results
|
|
25
|
+
- Report of any issues found
|
|
26
|
+
|
|
27
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Create a new reusable skill"
|
|
3
|
+
argument-hint: "<what skill to create>"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Write Skill — Skill Creation
|
|
7
|
+
|
|
8
|
+
This command creates a new reusable skill that can be referenced by other commands.
|
|
9
|
+
|
|
10
|
+
## Behavioral Context: Implementer
|
|
11
|
+
|
|
12
|
+
You are operating in the **Implementer profile**:
|
|
13
|
+
- **File access**: Full repository access
|
|
14
|
+
- **Scope**: Create skill documentation in `.claude/skills/`
|
|
15
|
+
- **Output**: New skill with procedure and examples
|
|
16
|
+
|
|
17
|
+
## Procedure
|
|
18
|
+
|
|
19
|
+
Read and follow the skill file: `.claude/skills/productivity/write-a-skill/SKILL.md`
|
|
20
|
+
|
|
21
|
+
## Expected Outcome
|
|
22
|
+
|
|
23
|
+
- New skill created in appropriate bucket (engineering/, productivity/, misc/, personal/, in-progress/)
|
|
24
|
+
- Clear procedure documented
|
|
25
|
+
- Examples and usage guidance provided
|
|
26
|
+
|
|
27
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "High-level architectural overview and zoom-out"
|
|
3
|
+
argument-hint: "<what to overview>"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Zoom Out — Architectural Overview
|
|
7
|
+
|
|
8
|
+
This command provides a high-level architectural overview of the codebase or a specific area.
|
|
9
|
+
|
|
10
|
+
## Behavioral Context: Architect
|
|
11
|
+
|
|
12
|
+
You are operating in the **Architect profile**:
|
|
13
|
+
- **File access**: Read-only for application code
|
|
14
|
+
- **Scope**: Understand big-picture architecture
|
|
15
|
+
- **Output**: Architectural overview document
|
|
16
|
+
|
|
17
|
+
## Procedure
|
|
18
|
+
|
|
19
|
+
Read and follow the skill file: `.claude/skills/engineering/zoom-out/SKILL.md`
|
|
20
|
+
|
|
21
|
+
## Expected Outcome
|
|
22
|
+
|
|
23
|
+
- High-level architecture diagram or description
|
|
24
|
+
- Key components and their relationships
|
|
25
|
+
- Architectural patterns and decisions identified
|
|
26
|
+
|
|
27
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: commit-and-document
|
|
3
|
+
description: Commit changes and update documentation. Use after implementation is complete and verified.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Commit and Document
|
|
7
|
+
|
|
8
|
+
RULE: Never commit without explicit user approval. Never force-push.
|
|
9
|
+
|
|
10
|
+
## Procedure
|
|
11
|
+
|
|
12
|
+
1. Review changes using `Bash` with `git status` and `git diff`.
|
|
13
|
+
2. Summarize changes for user.
|
|
14
|
+
3. Ask user for approval via `AskUserQuestion`.
|
|
15
|
+
4. If approved:
|
|
16
|
+
- Stage changes using `Bash` with `git add`.
|
|
17
|
+
- Commit using `Bash` with `git commit -m "message"`.
|
|
18
|
+
- Update relevant documentation using `Write` or `Edit`.
|
|
19
|
+
5. If not approved, stop and wait for further instructions.
|
|
20
|
+
|
|
21
|
+
## Context economy
|
|
22
|
+
|
|
23
|
+
Before broad reads, locate relevant files/symbols with `Glob`, `Grep`, or targeted file reads.
|
|
24
|
+
|
|
25
|
+
Prefer targeted `Read` with line ranges or block reads once the relevant area is known.
|
|
26
|
+
|
|
27
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
28
|
+
|
|
29
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
30
|
+
|
|
31
|
+
## Complete
|
|
32
|
+
|
|
33
|
+
Return completion with:
|
|
34
|
+
- commit hash
|
|
35
|
+
- files changed
|
|
36
|
+
- documentation updated
|
|
37
|
+
- status (committed or waiting for approval)
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: diagnose
|
|
3
|
+
description: Disciplined diagnosis loop for hard bugs and performance regressions. Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says "diagnose this" / "debug this", reports a bug, says something is broken/throwing/failing, or describes a performance regression.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Uses scratch working memory for hypothesis tracking.
|
|
7
|
+
|
|
8
|
+
# Diagnose
|
|
9
|
+
|
|
10
|
+
RULE: glossary + ADRs. Skip phase only with explicit reason. DO NOT hypothesise before deterministic loop.
|
|
11
|
+
|
|
12
|
+
## 1. Feedback loop
|
|
13
|
+
|
|
14
|
+
MUST build fast pass/fail loop. Try order:
|
|
15
|
+
1. Failing test at bug-reaching seam.
|
|
16
|
+
2. Curl/HTTP script via `Bash` vs dev server.
|
|
17
|
+
3. CLI fixture + stdout diff via `Bash`.
|
|
18
|
+
4. Headless browser: DOM/console/network assertions.
|
|
19
|
+
5. Replay trace/request/payload/event log.
|
|
20
|
+
6. Throwaway minimal subsystem harness.
|
|
21
|
+
7. Property/fuzz loop.
|
|
22
|
+
8. `git bisect run` harness via `Bash`.
|
|
23
|
+
9. Differential loop: old vs new/config A vs B.
|
|
24
|
+
10. HITL bash script from `scripts/hitl-loop.template.sh`.
|
|
25
|
+
|
|
26
|
+
Rules:
|
|
27
|
+
- MUST make loop faster/sharper/deterministic.
|
|
28
|
+
- Flake: run 100x, parallelise, stress, add sleeps, raise repro rate.
|
|
29
|
+
|
|
30
|
+
## 2. Reproduce
|
|
31
|
+
|
|
32
|
+
1. Run loop.
|
|
33
|
+
2. Match symptom to report.
|
|
34
|
+
3. Confirm repeatability/flake rate.
|
|
35
|
+
4. Capture exact error/output/timing.
|
|
36
|
+
5. DO NOT continue until reproduced.
|
|
37
|
+
|
|
38
|
+
## 3. Hypotheses (with working memory)
|
|
39
|
+
|
|
40
|
+
Initialize session: `.scratch/diagnoses/<YYYY-MM-DD>/diagnose-<slug>/`
|
|
41
|
+
|
|
42
|
+
Write `<session-dir>/session.md` with symptom, repro steps, error signatures.
|
|
43
|
+
|
|
44
|
+
Generate 3–5 ranked falsifiable hypotheses. Write each to `<session-dir>/hypothesis-<N>.md`:
|
|
45
|
+
|
|
46
|
+
- **Statement**: `If {cause}, then {probe} will {result}`
|
|
47
|
+
- **Rank and confidence**
|
|
48
|
+
- **Rationale**
|
|
49
|
+
- **Instrumentation plan**: specific probe and expected outcome
|
|
50
|
+
- **Status**: pending / confirmed / rejected
|
|
51
|
+
- **Results**: (filled during phase 4)
|
|
52
|
+
|
|
53
|
+
Drop vague hypotheses. Show ranked list. User AFK → proceed top hypothesis.
|
|
54
|
+
|
|
55
|
+
## 4. Instrument (with tracking)
|
|
56
|
+
|
|
57
|
+
Before each probe, read all `<session-dir>/hypothesis-*.md` files to maintain context.
|
|
58
|
+
|
|
59
|
+
1. Map one probe to one hypothesis.
|
|
60
|
+
2. Change one variable at a time.
|
|
61
|
+
3. Prefer debugger/REPL.
|
|
62
|
+
4. Else add targeted logs only.
|
|
63
|
+
5. Tag logs `[DEBUG-xxxx]`.
|
|
64
|
+
6. DO NOT log everything.
|
|
65
|
+
7. Perf: baseline/profiler/query plan before logs.
|
|
66
|
+
|
|
67
|
+
After each probe, update the corresponding hypothesis file with:
|
|
68
|
+
- Evidence observed
|
|
69
|
+
- Status update (confirmed / rejected)
|
|
70
|
+
- Next steps
|
|
71
|
+
|
|
72
|
+
Continue until root cause is confirmed or all hypotheses are rejected.
|
|
73
|
+
|
|
74
|
+
## 5. Fix + regression
|
|
75
|
+
|
|
76
|
+
**OWNER: Implementer profile** (requires source-code edits)
|
|
77
|
+
|
|
78
|
+
Delegate to implementer profile via `Agent` tool before this phase. Implementer executes:
|
|
79
|
+
|
|
80
|
+
1. If correct seam exists, write regression test before fix.
|
|
81
|
+
2. Correct seam = real call-site bug pattern.
|
|
82
|
+
3. If seam shallow/missing, document architecture gap.
|
|
83
|
+
4. Watch regression fail.
|
|
84
|
+
5. Apply minimal fix.
|
|
85
|
+
6. Watch regression pass.
|
|
86
|
+
7. Rerun original loop.
|
|
87
|
+
|
|
88
|
+
Implementer does NOT return completion here — more phases remain. Continue to Phase 6.
|
|
89
|
+
|
|
90
|
+
## 6. Cleanup
|
|
91
|
+
|
|
92
|
+
**OWNER: Implementer profile** (requires source-code edits and git commit)
|
|
93
|
+
|
|
94
|
+
MUST finish:
|
|
95
|
+
- [ ] Original repro passes.
|
|
96
|
+
- [ ] Regression passes or missing seam documented.
|
|
97
|
+
- [ ] `[DEBUG-...]` logs removed from source.
|
|
98
|
+
- [ ] Throwaway harnesses deleted/moved.
|
|
99
|
+
- [ ] Winning hypothesis stated in commit/PR.
|
|
100
|
+
- [ ] Seam/locality blocker → recommend `/improve-codebase-architecture`.
|
|
101
|
+
|
|
102
|
+
Implementer returns results back to architect profile for Phase 7.
|
|
103
|
+
|
|
104
|
+
## Context economy
|
|
105
|
+
|
|
106
|
+
Before broad reads, locate relevant files/symbols with `Glob`, `Grep`, or targeted file reads.
|
|
107
|
+
|
|
108
|
+
Prefer targeted `Read` with line ranges or block reads once the relevant area is known.
|
|
109
|
+
|
|
110
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
111
|
+
|
|
112
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
113
|
+
|
|
114
|
+
For logs or large outputs, search for the failing marker/error first using `Grep`. Read only surrounding ranges needed to prove or disprove a hypothesis.
|
|
115
|
+
|
|
116
|
+
## 7. Save and synthesize
|
|
117
|
+
|
|
118
|
+
**OWNER: Architect profile** (writes to `.scratch/`)
|
|
119
|
+
|
|
120
|
+
Read all `<session-dir>/hypothesis-*.md` files.
|
|
121
|
+
|
|
122
|
+
Write `<session-dir>/root-cause.md`:
|
|
123
|
+
- Confirmed hypothesis with evidence trail
|
|
124
|
+
- Rejected hypotheses and why they failed
|
|
125
|
+
- Root cause explanation
|
|
126
|
+
- Fix applied (from phase 5-6)
|
|
127
|
+
- Preventive measures
|
|
128
|
+
|
|
129
|
+
Write `<session-dir>/diagnosis.md` with full log (hypotheses, instrumentation results, timeline).
|
|
130
|
+
|
|
131
|
+
Return completion with:
|
|
132
|
+
- `<session-dir>/root-cause.md` path
|
|
133
|
+
- root cause summary
|
|
134
|
+
- fix applied
|
|
135
|
+
- status
|
|
136
|
+
- recommended next command (typically `/verify` then `/review` then `/commit-and-document`)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: explore
|
|
3
|
+
description: Map the codebase or a specific area to understand structure, dependencies, and key components. Use before planning features or refactors, or when entering an unfamiliar area.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Explore
|
|
7
|
+
|
|
8
|
+
Purpose: build a mental map of an area before making changes.
|
|
9
|
+
|
|
10
|
+
## 1. Identify target
|
|
11
|
+
|
|
12
|
+
Determine what to explore:
|
|
13
|
+
|
|
14
|
+
- User-provided area, module, or feature
|
|
15
|
+
- Entire codebase if no specific target
|
|
16
|
+
- Recently changed areas if user says "what changed"
|
|
17
|
+
|
|
18
|
+
If the target is unclear, ask one short question via `AskUserQuestion` and stop.
|
|
19
|
+
|
|
20
|
+
## 2. Read structure
|
|
21
|
+
|
|
22
|
+
Start with:
|
|
23
|
+
|
|
24
|
+
- `Glob` to find file structure
|
|
25
|
+
- `Grep` to find key patterns (imports, exports, entry points)
|
|
26
|
+
- Targeted `Read` on entry points and key files
|
|
27
|
+
|
|
28
|
+
Build understanding of:
|
|
29
|
+
|
|
30
|
+
- Module boundaries
|
|
31
|
+
- Key abstractions
|
|
32
|
+
- Data flow
|
|
33
|
+
- Dependencies
|
|
34
|
+
|
|
35
|
+
## 3. Identify seams
|
|
36
|
+
|
|
37
|
+
Look for:
|
|
38
|
+
|
|
39
|
+
- Public interfaces (exported functions, classes, types)
|
|
40
|
+
- Integration points (API calls, database queries, file I/O)
|
|
41
|
+
- Test locations and coverage
|
|
42
|
+
- Configuration and environment dependencies
|
|
43
|
+
|
|
44
|
+
## 4. Report findings
|
|
45
|
+
|
|
46
|
+
Return completion with:
|
|
47
|
+
|
|
48
|
+
- modules/components identified
|
|
49
|
+
- key dependencies and relationships
|
|
50
|
+
- seams and integration points
|
|
51
|
+
- recommended next command (typically `/fix`, `/feature`, or `/refactor` if changes needed, `/tdd` if implementation needed)
|
|
52
|
+
|
|
53
|
+
## Context economy
|
|
54
|
+
|
|
55
|
+
Before broad reads, locate relevant files/symbols with `Glob`, `Grep`, or targeted file reads.
|
|
56
|
+
|
|
57
|
+
Prefer targeted `Read` with line ranges or block reads once the relevant area is known.
|
|
58
|
+
|
|
59
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
60
|
+
|
|
61
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature
|
|
3
|
+
description: Multi-phase workflow for implementing new features. Explore codebase, design solution, propose plan, approve, and implement. Use for new features, major enhancements, or functionality that requires architectural decisions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Feature
|
|
7
|
+
|
|
8
|
+
RULE: Understand the codebase and design before implementing. Features often require architectural decisions.
|
|
9
|
+
|
|
10
|
+
## 1. Explore (Architect profile)
|
|
11
|
+
|
|
12
|
+
**OWNER: Architect profile** (read-only analysis)
|
|
13
|
+
|
|
14
|
+
1. Use `explore` skill to map the relevant area.
|
|
15
|
+
2. Understand existing patterns, seams, and dependencies.
|
|
16
|
+
3. Identify where the feature fits.
|
|
17
|
+
|
|
18
|
+
## 2. Design (Architect profile)
|
|
19
|
+
|
|
20
|
+
**OWNER: Architect profile** (read-only design)
|
|
21
|
+
|
|
22
|
+
1. Propose design with rationale.
|
|
23
|
+
2. Document design in `.scratch/features/<date>/design.md`.
|
|
24
|
+
3. Include architectural decisions and trade-offs.
|
|
25
|
+
4. Present design to user.
|
|
26
|
+
5. Wait for user approval via `AskUserQuestion`.
|
|
27
|
+
|
|
28
|
+
## 3. Plan implementation (Architect profile)
|
|
29
|
+
|
|
30
|
+
**OWNER: Architect profile** (read-only planning)
|
|
31
|
+
|
|
32
|
+
1. Break feature into implementable steps.
|
|
33
|
+
2. Each step should be independently testable.
|
|
34
|
+
3. Document plan in `.scratch/features/<date>/plan.md`.
|
|
35
|
+
4. Present plan to user.
|
|
36
|
+
5. Wait for user approval via `AskUserQuestion`.
|
|
37
|
+
|
|
38
|
+
## 4. Implement (Implementer profile)
|
|
39
|
+
|
|
40
|
+
**OWNER: Implementer profile** (requires source-code edits)
|
|
41
|
+
|
|
42
|
+
Delegate to implementer profile via `Agent` tool. Implementer executes:
|
|
43
|
+
|
|
44
|
+
1. For each step in the plan:
|
|
45
|
+
- Write tests first if using TDD approach.
|
|
46
|
+
- Implement the change using `Edit` or `Write`.
|
|
47
|
+
- Run tests via `Bash` to verify.
|
|
48
|
+
- Commit if tests pass.
|
|
49
|
+
2. If tests fail, stop and report.
|
|
50
|
+
|
|
51
|
+
## 5. Verify and report
|
|
52
|
+
|
|
53
|
+
Implementer returns completion with:
|
|
54
|
+
- feature implemented
|
|
55
|
+
- tests status (all passing)
|
|
56
|
+
- recommended next command (typically `/verify` then `/review` then `/commit-and-document`)
|
|
57
|
+
|
|
58
|
+
## Context economy
|
|
59
|
+
|
|
60
|
+
Before broad reads, locate relevant files/symbols with `Glob`, `Grep`, or targeted file reads.
|
|
61
|
+
|
|
62
|
+
Prefer targeted `Read` with line ranges or block reads once the relevant area is known.
|
|
63
|
+
|
|
64
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
65
|
+
|
|
66
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fix
|
|
3
|
+
description: Multi-phase workflow for bug diagnosis and repair. Diagnose root cause, propose fix, approve, and implement. Use for bugs, regressions, or unexpected behavior.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Fix
|
|
7
|
+
|
|
8
|
+
RULE: Understand the bug before proposing a fix. Never guess at root cause.
|
|
9
|
+
|
|
10
|
+
## 1. Diagnose (Architect profile)
|
|
11
|
+
|
|
12
|
+
**OWNER: Architect profile** (read-only analysis)
|
|
13
|
+
|
|
14
|
+
1. Use `diagnose` skill to investigate the bug.
|
|
15
|
+
2. Follow the diagnose skill's phases: feedback loop, reproduce, hypothesize, instrument.
|
|
16
|
+
3. Identify root cause and propose fix.
|
|
17
|
+
4. Present findings to user.
|
|
18
|
+
5. Wait for user approval via `AskUserQuestion`.
|
|
19
|
+
|
|
20
|
+
## 2. Plan fix (Architect profile)
|
|
21
|
+
|
|
22
|
+
**OWNER: Architect profile** (read-only planning)
|
|
23
|
+
|
|
24
|
+
1. Document the fix plan in `.scratch/fixes/<date>/plan.md`.
|
|
25
|
+
2. Include root cause, proposed solution, and test strategy.
|
|
26
|
+
3. Present plan to user.
|
|
27
|
+
4. Wait for user approval via `AskUserQuestion`.
|
|
28
|
+
|
|
29
|
+
## 3. Implement fix (Implementer profile)
|
|
30
|
+
|
|
31
|
+
**OWNER: Implementer profile** (requires source-code edits)
|
|
32
|
+
|
|
33
|
+
Delegate to implementer profile via `Agent` tool. Implementer executes:
|
|
34
|
+
|
|
35
|
+
1. Write regression test first using `Write` or `Edit`.
|
|
36
|
+
2. Run test via `Bash` to verify it fails (red phase).
|
|
37
|
+
3. Implement fix using `Edit` or `Write`.
|
|
38
|
+
4. Run test via `Bash` to verify it passes (green phase).
|
|
39
|
+
5. Run full test suite via `Bash`.
|
|
40
|
+
6. If all tests pass, commit.
|
|
41
|
+
|
|
42
|
+
## 4. Verify and report
|
|
43
|
+
|
|
44
|
+
Implementer returns completion with:
|
|
45
|
+
- root cause identified
|
|
46
|
+
- fix implemented
|
|
47
|
+
- regression test added
|
|
48
|
+
- all tests passing
|
|
49
|
+
- recommended next command (typically `/verify` then `/review` then `/commit-and-document`)
|
|
50
|
+
|
|
51
|
+
## Context economy
|
|
52
|
+
|
|
53
|
+
Before broad reads, locate relevant files/symbols with `Glob`, `Grep`, or targeted file reads.
|
|
54
|
+
|
|
55
|
+
Prefer targeted `Read` with line ranges or block reads once the relevant area is known.
|
|
56
|
+
|
|
57
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
58
|
+
|
|
59
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grill-with-docs
|
|
3
|
+
description: Deep-dive exploration of a specific area with documentation. Use when you need to thoroughly understand a complex component, algorithm, or subsystem.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Grill with Docs
|
|
7
|
+
|
|
8
|
+
RULE: Produce comprehensive documentation, not just code exploration.
|
|
9
|
+
|
|
10
|
+
## Procedure
|
|
11
|
+
|
|
12
|
+
1. Identify the target area for deep exploration.
|
|
13
|
+
2. Use `Glob` and `Grep` to locate all relevant files.
|
|
14
|
+
3. Use `Read` to understand each component in detail.
|
|
15
|
+
4. Trace data flow, control flow, and dependencies.
|
|
16
|
+
5. Document findings in `.scratch/grills/<date>/<topic>.md` using `Write`.
|
|
17
|
+
6. Include diagrams (text-based), code examples, and explanations.
|
|
18
|
+
7. Identify key insights, potential issues, and recommendations.
|
|
19
|
+
|
|
20
|
+
## Context economy
|
|
21
|
+
|
|
22
|
+
Before broad reads, locate relevant files/symbols with `Glob`, `Grep`, or targeted file reads.
|
|
23
|
+
|
|
24
|
+
Prefer targeted `Read` with line ranges or block reads once the relevant area is known.
|
|
25
|
+
|
|
26
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
27
|
+
|
|
28
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
29
|
+
|
|
30
|
+
## Complete
|
|
31
|
+
|
|
32
|
+
Return completion with:
|
|
33
|
+
- documentation location
|
|
34
|
+
- key findings and insights
|
|
35
|
+
- recommended next command (typically `/feature` or `/refactor` if changes needed)
|
package/templates/claude-code/.claude/skills/engineering/improve-codebase-architecture/SKILL.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: improve-codebase-architecture
|
|
3
|
+
description: Analyze and improve codebase architecture. Use for structural improvements, better organization, or architectural refactoring.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Improve Codebase Architecture
|
|
7
|
+
|
|
8
|
+
RULE: Architecture changes should improve maintainability, testability, or clarity without changing behavior.
|
|
9
|
+
|
|
10
|
+
## Procedure
|
|
11
|
+
|
|
12
|
+
1. Explore current architecture using `explore` skill.
|
|
13
|
+
2. Identify architectural issues:
|
|
14
|
+
- Poor separation of concerns
|
|
15
|
+
- Tight coupling
|
|
16
|
+
- Code duplication
|
|
17
|
+
- Unclear boundaries
|
|
18
|
+
- Inconsistent patterns
|
|
19
|
+
3. Propose architectural improvements with rationale.
|
|
20
|
+
4. Document improvements in `.scratch/architecture/<date>/proposal.md` using `Write`.
|
|
21
|
+
5. Review with user via `AskUserQuestion`.
|
|
22
|
+
6. If approved, create implementation plan and delegate to implementer profile.
|
|
23
|
+
|
|
24
|
+
## Context economy
|
|
25
|
+
|
|
26
|
+
Before broad reads, locate relevant files/symbols with `Glob`, `Grep`, or targeted file reads.
|
|
27
|
+
|
|
28
|
+
Prefer targeted `Read` with line ranges or block reads once the relevant area is known.
|
|
29
|
+
|
|
30
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
31
|
+
|
|
32
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
33
|
+
|
|
34
|
+
## Complete
|
|
35
|
+
|
|
36
|
+
Return completion with:
|
|
37
|
+
- architecture proposal location
|
|
38
|
+
- key improvements identified
|
|
39
|
+
- recommended next command (typically `/refactor` to implement changes)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prototype
|
|
3
|
+
description: Create a quick prototype or proof-of-concept. Use for exploratory coding, trying out ideas, or validating approaches before committing to a design.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Prototype
|
|
7
|
+
|
|
8
|
+
RULE: Prototypes are throwaway code. Mark them clearly. Don't polish or test them.
|
|
9
|
+
|
|
10
|
+
## Procedure
|
|
11
|
+
|
|
12
|
+
1. Clarify what to prototype and the goal.
|
|
13
|
+
2. Create prototype in isolated location (e.g., `.scratch/prototypes/<name>/`).
|
|
14
|
+
3. Write minimal code to demonstrate the idea.
|
|
15
|
+
4. Use `Write` to create files.
|
|
16
|
+
5. Run prototype via `Bash` to demonstrate behavior.
|
|
17
|
+
6. Document findings and recommendations.
|
|
18
|
+
|
|
19
|
+
## Context economy
|
|
20
|
+
|
|
21
|
+
Before broad reads, locate relevant files/symbols with `Glob`, `Grep`, or targeted file reads.
|
|
22
|
+
|
|
23
|
+
Prefer targeted `Read` with line ranges or block reads once the relevant area is known.
|
|
24
|
+
|
|
25
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
26
|
+
|
|
27
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|
|
28
|
+
|
|
29
|
+
## Complete
|
|
30
|
+
|
|
31
|
+
Return completion with:
|
|
32
|
+
- prototype location
|
|
33
|
+
- findings and insights
|
|
34
|
+
- recommendations for next steps (proceed with design, explore alternative, or abandon)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: refactor
|
|
3
|
+
description: Multi-phase workflow for improving code structure. Diagnose structural issues, propose solutions, approve, and implement. Use for code smells, architectural improvements, or structural changes that don't change behavior.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Refactor
|
|
7
|
+
|
|
8
|
+
RULE: Refactoring changes structure, not behavior. All tests must pass before and after.
|
|
9
|
+
|
|
10
|
+
## 1. Diagnose structural issues (Architect profile)
|
|
11
|
+
|
|
12
|
+
**OWNER: Architect profile** (read-only analysis)
|
|
13
|
+
|
|
14
|
+
1. Read relevant code via `Glob`, `Grep`, and targeted `Read`.
|
|
15
|
+
2. Identify code smells, architectural issues, or improvement opportunities.
|
|
16
|
+
3. Propose refactoring plan with rationale.
|
|
17
|
+
4. Present findings to user.
|
|
18
|
+
5. Wait for user approval via `AskUserQuestion`.
|
|
19
|
+
|
|
20
|
+
## 2. Plan refactoring (Architect profile)
|
|
21
|
+
|
|
22
|
+
**OWNER: Architect profile** (read-only planning)
|
|
23
|
+
|
|
24
|
+
1. Break refactoring into safe, incremental steps.
|
|
25
|
+
2. Each step should preserve behavior and pass tests.
|
|
26
|
+
3. Document the plan in `.scratch/refactors/<date>/plan.md`.
|
|
27
|
+
4. Present plan to user.
|
|
28
|
+
5. Wait for user approval via `AskUserQuestion`.
|
|
29
|
+
|
|
30
|
+
## 3. Implement refactoring (Implementer profile)
|
|
31
|
+
|
|
32
|
+
**OWNER: Implementer profile** (requires source-code edits)
|
|
33
|
+
|
|
34
|
+
Delegate to implementer profile via `Agent` tool. Implementer executes:
|
|
35
|
+
|
|
36
|
+
1. For each step in the plan:
|
|
37
|
+
- Make the change using `Edit` or `Write`.
|
|
38
|
+
- Run tests via `Bash` to verify behavior preserved.
|
|
39
|
+
- Commit if tests pass.
|
|
40
|
+
2. If tests fail, stop and report.
|
|
41
|
+
3. Do not proceed to next step until current step verified.
|
|
42
|
+
|
|
43
|
+
## 4. Verify and report
|
|
44
|
+
|
|
45
|
+
Implementer returns completion with:
|
|
46
|
+
- what was refactored
|
|
47
|
+
- structural improvements achieved
|
|
48
|
+
- tests status (all passing)
|
|
49
|
+
- recommended next command (typically `/verify` then `/review` then `/commit-and-document`)
|
|
50
|
+
|
|
51
|
+
## Context economy
|
|
52
|
+
|
|
53
|
+
Before broad reads, locate relevant files/symbols with `Glob`, `Grep`, or targeted file reads.
|
|
54
|
+
|
|
55
|
+
Prefer targeted `Read` with line ranges or block reads once the relevant area is known.
|
|
56
|
+
|
|
57
|
+
Read full files only when structure, ordering, or surrounding context is required for correctness.
|
|
58
|
+
|
|
59
|
+
Do not re-read unchanged files; use prior findings unless the file changed.
|