sdtk-code-kit 0.2.0 → 0.3.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 (42) hide show
  1. package/README.md +3 -3
  2. package/assets/manifest/toolkit-bundle.manifest.json +57 -57
  3. package/assets/manifest/toolkit-bundle.sha256.txt +28 -28
  4. package/assets/toolkit/toolkit/AGENTS.md +219 -219
  5. package/assets/toolkit/toolkit/install.ps1 +156 -156
  6. package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +78 -78
  7. package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +150 -150
  8. package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +62 -62
  9. package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +82 -82
  10. package/assets/toolkit/toolkit/sdtk-spec.config.json +6 -6
  11. package/assets/toolkit/toolkit/sdtk-spec.config.profiles.example.json +12 -12
  12. package/assets/toolkit/toolkit/skills/code-brainstorm/SKILL.md +55 -55
  13. package/assets/toolkit/toolkit/skills/code-debug/SKILL.md +296 -296
  14. package/assets/toolkit/toolkit/skills/code-debug/references/root-cause-tracing.md +68 -68
  15. package/assets/toolkit/toolkit/skills/code-discover/SKILL.md +54 -54
  16. package/assets/toolkit/toolkit/skills/code-execute/SKILL.md +74 -74
  17. package/assets/toolkit/toolkit/skills/code-finish/SKILL.md +205 -205
  18. package/assets/toolkit/toolkit/skills/code-parallel/SKILL.md +64 -64
  19. package/assets/toolkit/toolkit/skills/code-parallel/references/code-quality-reviewer-prompt.md +26 -26
  20. package/assets/toolkit/toolkit/skills/code-parallel/references/implementer-prompt.md +113 -113
  21. package/assets/toolkit/toolkit/skills/code-parallel/references/spec-reviewer-prompt.md +61 -61
  22. package/assets/toolkit/toolkit/skills/code-plan/SKILL.md +85 -85
  23. package/assets/toolkit/toolkit/skills/code-review/SKILL.md +79 -79
  24. package/assets/toolkit/toolkit/skills/code-review/references/checklist.md +125 -125
  25. package/assets/toolkit/toolkit/skills/code-review/references/code-reviewer.md +146 -146
  26. package/assets/toolkit/toolkit/skills/code-ship/SKILL.md +52 -52
  27. package/assets/toolkit/toolkit/skills/code-tdd/SKILL.md +378 -378
  28. package/assets/toolkit/toolkit/skills/code-tdd/references/testing-anti-patterns.md +299 -299
  29. package/assets/toolkit/toolkit/skills/code-verify/SKILL.md +144 -144
  30. package/assets/toolkit/toolkit/skills/code-worktree/SKILL.md +228 -228
  31. package/assets/toolkit/toolkit/templates/CODE_WORKFLOW_TEMPLATE.md +140 -140
  32. package/package.json +2 -2
  33. package/src/commands/agent-team.js +174 -0
  34. package/src/commands/guardrails.js +94 -2
  35. package/src/commands/help.js +13 -0
  36. package/src/commands/sleep.js +132 -0
  37. package/src/index.js +8 -0
  38. package/src/lib/agent-team-export.js +409 -0
  39. package/src/lib/agent-team-plan.js +514 -0
  40. package/src/lib/sleep-plan.js +175 -0
  41. package/src/lib/sleep-report.js +229 -0
  42. package/src/lib/trust-events.js +20 -1
@@ -1,228 +1,228 @@
1
- ---
2
- name: code-worktree
3
- description: Git worktrees for feature isolation. Use when starting feature work that needs isolation -- creates isolated worktrees with safety verification.
4
- ---
5
-
6
- # Code Worktree
7
-
8
- ## Critical Constraints
9
- - I do not create a project-local worktree until I verify the target directory is ignored.
10
- - I do not start feature work in a new worktree without checking the baseline setup and tests.
11
-
12
-
13
- ## Overview
14
- Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.
15
-
16
- **Core principle:** Systematic directory selection + safety verification = reliable isolation.
17
-
18
- **Announce at start:** "I'm using the code-worktree skill to set up an isolated workspace."
19
-
20
- ## Procedure
21
- 1. Choose the worktree location using the documented priority order.
22
- 2. Verify project-local directories are ignored before creation.
23
- 3. Create the worktree and run repository setup commands.
24
- 4. Confirm the baseline tests pass before implementation begins.
25
-
26
- ## Directory Selection Process
27
-
28
- Follow this priority order:
29
-
30
- ### 1. Check Existing Directories
31
-
32
- ```bash
33
- # Check in priority order
34
- ls -d .worktrees 2>/dev/null # Preferred (hidden)
35
- ls -d worktrees 2>/dev/null # Alternative
36
- ```
37
-
38
- **If found:** Use that directory. If both exist, `.worktrees` wins.
39
-
40
- ### 2. Check Repository Guidance
41
-
42
- ```bash
43
- rg -n -i "worktree|worktrees|\\.worktrees" AGENTS.md 2>/dev/null
44
- ```
45
-
46
- **If preference specified:** Use it without asking.
47
-
48
- ### 3. Ask User
49
-
50
- If no directory exists and no repository guidance preference:
51
-
52
- ```
53
- No worktree directory found. Where should I create worktrees?
54
-
55
- 1. .worktrees/ (project-local, hidden)
56
- 2. ~/.config/sdtk-code/worktrees/<project-name>/ (global location)
57
-
58
- Which would you prefer?
59
- ```
60
-
61
- ## Safety Verification
62
-
63
- ### For Project-Local Directories (.worktrees or worktrees)
64
-
65
- **MUST verify directory is ignored before creating worktree:**
66
-
67
- ```bash
68
- # Check if directory is ignored (respects local, global, and system gitignore)
69
- git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null
70
- ```
71
-
72
- **If NOT ignored:**
73
-
74
- Per SDTK repository hygiene:
75
- 1. Add appropriate line to .gitignore
76
- 2. Commit the change
77
- 3. Proceed with worktree creation
78
-
79
- **Why critical:** Prevents accidentally committing worktree contents to repository.
80
-
81
- ### For Global Directory (~/.config/sdtk-code/worktrees)
82
-
83
- No .gitignore verification needed - outside project entirely.
84
-
85
- ## Creation Steps
86
-
87
- ### 1. Detect Project Name
88
-
89
- ```bash
90
- project=$(basename "$(git rev-parse --show-toplevel)")
91
- ```
92
-
93
- ### 2. Create Worktree
94
-
95
- ```bash
96
- # Determine full path
97
- case $LOCATION in
98
- .worktrees|worktrees)
99
- path="$LOCATION/$BRANCH_NAME"
100
- ;;
101
- ~/.config/sdtk-code/worktrees/*)
102
- path="~/.config/sdtk-code/worktrees/$project/$BRANCH_NAME"
103
- ;;
104
- esac
105
-
106
- # Create worktree with new branch
107
- git worktree add "$path" -b "$BRANCH_NAME"
108
- cd "$path"
109
- ```
110
-
111
- ### 3. Run Project Setup
112
-
113
- Auto-detect and run appropriate setup:
114
-
115
- ```bash
116
- # Node.js
117
- if [ -f package.json ]; then npm install; fi
118
-
119
- # Rust
120
- if [ -f Cargo.toml ]; then cargo build; fi
121
-
122
- # Python
123
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
124
- if [ -f pyproject.toml ]; then poetry install; fi
125
-
126
- # Go
127
- if [ -f go.mod ]; then go mod download; fi
128
- ```
129
-
130
- ### 4. Verify Clean Baseline
131
-
132
- Run tests to ensure worktree starts clean:
133
-
134
- ```bash
135
- # Examples - use project-appropriate command
136
- npm test
137
- cargo test
138
- pytest
139
- go test ./...
140
- ```
141
-
142
- **If tests fail:** Report failures, ask whether to proceed or investigate.
143
-
144
- **If tests pass:** Report ready.
145
-
146
- ### 5. Report Location
147
-
148
- ```
149
- Worktree ready at <full-path>
150
- Tests passing (<N> tests, 0 failures)
151
- Ready to implement <feature-name>
152
- ```
153
-
154
- ## Quick Reference
155
-
156
- | Situation | Action |
157
- |-----------|--------|
158
- | `.worktrees/` exists | Use it (verify ignored) |
159
- | `worktrees/` exists | Use it (verify ignored) |
160
- | Both exist | Use `.worktrees/` |
161
- | Neither exists | Check AGENTS.md -> Ask user |
162
- | Directory not ignored | Add to .gitignore + commit |
163
- | Tests fail during baseline | Report failures + ask |
164
- | No package.json/Cargo.toml | Skip dependency install |
165
-
166
- ## Common Mistakes
167
-
168
- ### Skipping ignore verification
169
-
170
- - **Problem:** Worktree contents get tracked, pollute git status
171
- - **Fix:** Always use `git check-ignore` before creating project-local worktree
172
-
173
- ### Assuming directory location
174
-
175
- - **Problem:** Creates inconsistency, violates project conventions
176
- - **Fix:** Follow priority: existing > AGENTS.md > ask
177
-
178
- ### Proceeding with failing tests
179
-
180
- - **Problem:** Can't distinguish new bugs from pre-existing issues
181
- - **Fix:** Report failures, get explicit permission to proceed
182
-
183
- ### Hardcoding setup commands
184
-
185
- - **Problem:** Breaks on projects using different tools
186
- - **Fix:** Auto-detect from project files (package.json, etc.)
187
-
188
- ## Example Workflow
189
-
190
- ```
191
- You: I'm using the code-worktree skill to set up an isolated workspace.
192
-
193
- [Check .worktrees/ - exists]
194
- [Verify ignored - git check-ignore confirms .worktrees/ is ignored]
195
- [Create worktree: git worktree add .worktrees/auth -b feature/auth]
196
- [Run npm install]
197
- [Run npm test - 47 passing]
198
-
199
- Worktree ready at /Users/example/myproject/.worktrees/auth
200
- Tests passing (47 tests, 0 failures)
201
- Ready to implement auth feature
202
- ```
203
-
204
- ## Red Flags
205
-
206
- **Never:**
207
- - Create worktree without verifying it's ignored (project-local)
208
- - Skip baseline test verification
209
- - Proceed with failing tests without asking
210
- - Assume directory location when ambiguous
211
- - Skip repository guidance check
212
-
213
- **Always:**
214
- - Follow directory priority: existing > AGENTS.md > ask
215
- - Verify directory is ignored for project-local
216
- - Auto-detect and run project setup
217
- - Verify clean test baseline
218
-
219
- ## Integration
220
-
221
- **Called by:**
222
- - **code-brainstorm** (Phase 4) - REQUIRED when design is approved and implementation follows
223
- - **code-parallel** - REQUIRED before executing any tasks
224
- - **code-execute** - REQUIRED before executing any tasks
225
- - Any skill needing isolated workspace
226
-
227
- **Pairs with:**
228
- - **code-finish** - REQUIRED for cleanup after work complete
1
+ ---
2
+ name: code-worktree
3
+ description: Git worktrees for feature isolation. Use when starting feature work that needs isolation -- creates isolated worktrees with safety verification.
4
+ ---
5
+
6
+ # Code Worktree
7
+
8
+ ## Critical Constraints
9
+ - I do not create a project-local worktree until I verify the target directory is ignored.
10
+ - I do not start feature work in a new worktree without checking the baseline setup and tests.
11
+
12
+
13
+ ## Overview
14
+ Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.
15
+
16
+ **Core principle:** Systematic directory selection + safety verification = reliable isolation.
17
+
18
+ **Announce at start:** "I'm using the code-worktree skill to set up an isolated workspace."
19
+
20
+ ## Procedure
21
+ 1. Choose the worktree location using the documented priority order.
22
+ 2. Verify project-local directories are ignored before creation.
23
+ 3. Create the worktree and run repository setup commands.
24
+ 4. Confirm the baseline tests pass before implementation begins.
25
+
26
+ ## Directory Selection Process
27
+
28
+ Follow this priority order:
29
+
30
+ ### 1. Check Existing Directories
31
+
32
+ ```bash
33
+ # Check in priority order
34
+ ls -d .worktrees 2>/dev/null # Preferred (hidden)
35
+ ls -d worktrees 2>/dev/null # Alternative
36
+ ```
37
+
38
+ **If found:** Use that directory. If both exist, `.worktrees` wins.
39
+
40
+ ### 2. Check Repository Guidance
41
+
42
+ ```bash
43
+ rg -n -i "worktree|worktrees|\\.worktrees" AGENTS.md 2>/dev/null
44
+ ```
45
+
46
+ **If preference specified:** Use it without asking.
47
+
48
+ ### 3. Ask User
49
+
50
+ If no directory exists and no repository guidance preference:
51
+
52
+ ```
53
+ No worktree directory found. Where should I create worktrees?
54
+
55
+ 1. .worktrees/ (project-local, hidden)
56
+ 2. ~/.config/sdtk-code/worktrees/<project-name>/ (global location)
57
+
58
+ Which would you prefer?
59
+ ```
60
+
61
+ ## Safety Verification
62
+
63
+ ### For Project-Local Directories (.worktrees or worktrees)
64
+
65
+ **MUST verify directory is ignored before creating worktree:**
66
+
67
+ ```bash
68
+ # Check if directory is ignored (respects local, global, and system gitignore)
69
+ git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null
70
+ ```
71
+
72
+ **If NOT ignored:**
73
+
74
+ Per SDTK repository hygiene:
75
+ 1. Add appropriate line to .gitignore
76
+ 2. Commit the change
77
+ 3. Proceed with worktree creation
78
+
79
+ **Why critical:** Prevents accidentally committing worktree contents to repository.
80
+
81
+ ### For Global Directory (~/.config/sdtk-code/worktrees)
82
+
83
+ No .gitignore verification needed - outside project entirely.
84
+
85
+ ## Creation Steps
86
+
87
+ ### 1. Detect Project Name
88
+
89
+ ```bash
90
+ project=$(basename "$(git rev-parse --show-toplevel)")
91
+ ```
92
+
93
+ ### 2. Create Worktree
94
+
95
+ ```bash
96
+ # Determine full path
97
+ case $LOCATION in
98
+ .worktrees|worktrees)
99
+ path="$LOCATION/$BRANCH_NAME"
100
+ ;;
101
+ ~/.config/sdtk-code/worktrees/*)
102
+ path="~/.config/sdtk-code/worktrees/$project/$BRANCH_NAME"
103
+ ;;
104
+ esac
105
+
106
+ # Create worktree with new branch
107
+ git worktree add "$path" -b "$BRANCH_NAME"
108
+ cd "$path"
109
+ ```
110
+
111
+ ### 3. Run Project Setup
112
+
113
+ Auto-detect and run appropriate setup:
114
+
115
+ ```bash
116
+ # Node.js
117
+ if [ -f package.json ]; then npm install; fi
118
+
119
+ # Rust
120
+ if [ -f Cargo.toml ]; then cargo build; fi
121
+
122
+ # Python
123
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
124
+ if [ -f pyproject.toml ]; then poetry install; fi
125
+
126
+ # Go
127
+ if [ -f go.mod ]; then go mod download; fi
128
+ ```
129
+
130
+ ### 4. Verify Clean Baseline
131
+
132
+ Run tests to ensure worktree starts clean:
133
+
134
+ ```bash
135
+ # Examples - use project-appropriate command
136
+ npm test
137
+ cargo test
138
+ pytest
139
+ go test ./...
140
+ ```
141
+
142
+ **If tests fail:** Report failures, ask whether to proceed or investigate.
143
+
144
+ **If tests pass:** Report ready.
145
+
146
+ ### 5. Report Location
147
+
148
+ ```
149
+ Worktree ready at <full-path>
150
+ Tests passing (<N> tests, 0 failures)
151
+ Ready to implement <feature-name>
152
+ ```
153
+
154
+ ## Quick Reference
155
+
156
+ | Situation | Action |
157
+ |-----------|--------|
158
+ | `.worktrees/` exists | Use it (verify ignored) |
159
+ | `worktrees/` exists | Use it (verify ignored) |
160
+ | Both exist | Use `.worktrees/` |
161
+ | Neither exists | Check AGENTS.md -> Ask user |
162
+ | Directory not ignored | Add to .gitignore + commit |
163
+ | Tests fail during baseline | Report failures + ask |
164
+ | No package.json/Cargo.toml | Skip dependency install |
165
+
166
+ ## Common Mistakes
167
+
168
+ ### Skipping ignore verification
169
+
170
+ - **Problem:** Worktree contents get tracked, pollute git status
171
+ - **Fix:** Always use `git check-ignore` before creating project-local worktree
172
+
173
+ ### Assuming directory location
174
+
175
+ - **Problem:** Creates inconsistency, violates project conventions
176
+ - **Fix:** Follow priority: existing > AGENTS.md > ask
177
+
178
+ ### Proceeding with failing tests
179
+
180
+ - **Problem:** Can't distinguish new bugs from pre-existing issues
181
+ - **Fix:** Report failures, get explicit permission to proceed
182
+
183
+ ### Hardcoding setup commands
184
+
185
+ - **Problem:** Breaks on projects using different tools
186
+ - **Fix:** Auto-detect from project files (package.json, etc.)
187
+
188
+ ## Example Workflow
189
+
190
+ ```
191
+ You: I'm using the code-worktree skill to set up an isolated workspace.
192
+
193
+ [Check .worktrees/ - exists]
194
+ [Verify ignored - git check-ignore confirms .worktrees/ is ignored]
195
+ [Create worktree: git worktree add .worktrees/auth -b feature/auth]
196
+ [Run npm install]
197
+ [Run npm test - 47 passing]
198
+
199
+ Worktree ready at /Users/example/myproject/.worktrees/auth
200
+ Tests passing (47 tests, 0 failures)
201
+ Ready to implement auth feature
202
+ ```
203
+
204
+ ## Red Flags
205
+
206
+ **Never:**
207
+ - Create worktree without verifying it's ignored (project-local)
208
+ - Skip baseline test verification
209
+ - Proceed with failing tests without asking
210
+ - Assume directory location when ambiguous
211
+ - Skip repository guidance check
212
+
213
+ **Always:**
214
+ - Follow directory priority: existing > AGENTS.md > ask
215
+ - Verify directory is ignored for project-local
216
+ - Auto-detect and run project setup
217
+ - Verify clean test baseline
218
+
219
+ ## Integration
220
+
221
+ **Called by:**
222
+ - **code-brainstorm** (Phase 4) - REQUIRED when design is approved and implementation follows
223
+ - **code-parallel** - REQUIRED before executing any tasks
224
+ - **code-execute** - REQUIRED before executing any tasks
225
+ - Any skill needing isolated workspace
226
+
227
+ **Pairs with:**
228
+ - **code-finish** - REQUIRED for cleanup after work complete