sdtk-code-kit 0.1.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 +138 -0
- package/assets/manifest/toolkit-bundle.manifest.json +147 -0
- package/assets/manifest/toolkit-bundle.sha256.txt +28 -0
- package/assets/toolkit/toolkit/AGENTS.md +210 -0
- package/assets/toolkit/toolkit/install.ps1 +126 -0
- package/assets/toolkit/toolkit/scripts/install-claude-skills.ps1 +78 -0
- package/assets/toolkit/toolkit/scripts/install-codex-skills.ps1 +127 -0
- package/assets/toolkit/toolkit/scripts/uninstall-claude-skills.ps1 +62 -0
- package/assets/toolkit/toolkit/scripts/uninstall-codex-skills.ps1 +53 -0
- package/assets/toolkit/toolkit/sdtk-spec.config.json +6 -0
- package/assets/toolkit/toolkit/sdtk-spec.config.profiles.example.json +12 -0
- package/assets/toolkit/toolkit/skills/code-brainstorm/SKILL.md +56 -0
- package/assets/toolkit/toolkit/skills/code-debug/SKILL.md +297 -0
- package/assets/toolkit/toolkit/skills/code-debug/references/root-cause-tracing.md +69 -0
- package/assets/toolkit/toolkit/skills/code-discover/SKILL.md +54 -0
- package/assets/toolkit/toolkit/skills/code-execute/SKILL.md +75 -0
- package/assets/toolkit/toolkit/skills/code-finish/SKILL.md +206 -0
- package/assets/toolkit/toolkit/skills/code-parallel/SKILL.md +65 -0
- package/assets/toolkit/toolkit/skills/code-parallel/references/code-quality-reviewer-prompt.md +27 -0
- package/assets/toolkit/toolkit/skills/code-parallel/references/implementer-prompt.md +114 -0
- package/assets/toolkit/toolkit/skills/code-parallel/references/spec-reviewer-prompt.md +62 -0
- package/assets/toolkit/toolkit/skills/code-plan/SKILL.md +86 -0
- package/assets/toolkit/toolkit/skills/code-review/SKILL.md +80 -0
- package/assets/toolkit/toolkit/skills/code-review/references/checklist.md +126 -0
- package/assets/toolkit/toolkit/skills/code-review/references/code-reviewer.md +147 -0
- package/assets/toolkit/toolkit/skills/code-ship/SKILL.md +53 -0
- package/assets/toolkit/toolkit/skills/code-tdd/SKILL.md +379 -0
- package/assets/toolkit/toolkit/skills/code-tdd/references/testing-anti-patterns.md +300 -0
- package/assets/toolkit/toolkit/skills/code-verify/SKILL.md +145 -0
- package/assets/toolkit/toolkit/skills/code-worktree/SKILL.md +229 -0
- package/assets/toolkit/toolkit/templates/CODE_WORKFLOW_TEMPLATE.md +112 -0
- package/bin/sdtk-code.js +14 -0
- package/package.json +44 -0
- package/src/commands/build.js +53 -0
- package/src/commands/generate.js +11 -0
- package/src/commands/help.js +169 -0
- package/src/commands/init.js +86 -0
- package/src/commands/plan.js +52 -0
- package/src/commands/runtime.js +205 -0
- package/src/commands/ship.js +54 -0
- package/src/commands/start.js +89 -0
- package/src/commands/verify.js +57 -0
- package/src/index.js +70 -0
- package/src/lib/args.js +107 -0
- package/src/lib/errors.js +41 -0
- package/src/lib/powershell.js +65 -0
- package/src/lib/scope.js +55 -0
- package/src/lib/toolkit-payload.js +72 -0
- package/src/lib/workflow-artifact.js +453 -0
- package/src/lib/workflow-build.js +127 -0
- package/src/lib/workflow-handoff.js +427 -0
- package/src/lib/workflow-intake.js +100 -0
- package/src/lib/workflow-plan.js +96 -0
- package/src/lib/workflow-ship.js +163 -0
- package/src/lib/workflow-verify.js +212 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<!-- Based on superpowers by Jesse Vincent (MIT License, 2025). Adapted for SDTK-CODE. See ../../THIRD_PARTY_NOTICES.md for details. -->
|
|
2
|
+
---
|
|
3
|
+
name: code-verify
|
|
4
|
+
description: Verification before completion. Use before claiming any work is done -- run verification commands and confirm output, evidence before assertions.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Code Verify
|
|
8
|
+
|
|
9
|
+
## Critical Constraints
|
|
10
|
+
- I do not claim code is done, passing, or ready without fresh command evidence.
|
|
11
|
+
- I do not substitute "should work" language for executed verification output.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
Claiming work is complete without verification is dishonesty, not efficiency.
|
|
17
|
+
|
|
18
|
+
**Core principle:** Evidence before claims, always.
|
|
19
|
+
|
|
20
|
+
**Violating the letter of this rule is violating the spirit of this rule.**
|
|
21
|
+
|
|
22
|
+
## The Iron Law
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If you haven't run the verification command in this message, you cannot claim it passes.
|
|
29
|
+
|
|
30
|
+
## Process
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
BEFORE claiming any status or expressing satisfaction:
|
|
34
|
+
|
|
35
|
+
1. IDENTIFY: What command proves this claim?
|
|
36
|
+
2. RUN: Execute the FULL command (fresh, complete)
|
|
37
|
+
3. READ: Full output, check exit code, count failures
|
|
38
|
+
4. VERIFY: Does output confirm the claim?
|
|
39
|
+
- If NO: State actual status with evidence
|
|
40
|
+
- If YES: State claim WITH evidence
|
|
41
|
+
5. ONLY THEN: Make the claim
|
|
42
|
+
|
|
43
|
+
Skip any step = lying, not verifying
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Common Failures
|
|
47
|
+
|
|
48
|
+
| Claim | Requires | Not Sufficient |
|
|
49
|
+
|-------|----------|----------------|
|
|
50
|
+
| Tests pass | Test command output: 0 failures | Previous run, "should pass" |
|
|
51
|
+
| Linter clean | Linter output: 0 errors | Partial check, extrapolation |
|
|
52
|
+
| Build succeeds | Build command: exit 0 | Linter passing, logs look good |
|
|
53
|
+
| Bug fixed | Test original symptom: passes | Code changed, assumed fixed |
|
|
54
|
+
| Regression test works | Red-green cycle verified | Test passes once |
|
|
55
|
+
| Agent completed | VCS diff shows changes | Agent reports "success" |
|
|
56
|
+
| Requirements met | Line-by-line checklist | Tests passing |
|
|
57
|
+
|
|
58
|
+
## Red Flags - STOP
|
|
59
|
+
|
|
60
|
+
- Using "should", "probably", "seems to"
|
|
61
|
+
- Expressing satisfaction before verification ("Great!", "Perfect!", "Done!", etc.)
|
|
62
|
+
- About to commit/push/PR without verification
|
|
63
|
+
- Trusting agent success reports
|
|
64
|
+
- Relying on partial verification
|
|
65
|
+
- Thinking "just this once"
|
|
66
|
+
- Tired and wanting work over
|
|
67
|
+
- **ANY wording implying success without having run verification**
|
|
68
|
+
|
|
69
|
+
## Rationalization Prevention
|
|
70
|
+
|
|
71
|
+
| Excuse | Reality |
|
|
72
|
+
|--------|---------|
|
|
73
|
+
| "Should work now" | RUN the verification |
|
|
74
|
+
| "I'm confident" | Confidence evidence |
|
|
75
|
+
| "Just this once" | No exceptions |
|
|
76
|
+
| "Linter passed" | Linter compiler |
|
|
77
|
+
| "Agent said success" | Verify independently |
|
|
78
|
+
| "I'm tired" | Exhaustion excuse |
|
|
79
|
+
| "Partial check is enough" | Partial proves nothing |
|
|
80
|
+
| "Different words so rule doesn't apply" | Spirit over letter |
|
|
81
|
+
|
|
82
|
+
## Key Patterns
|
|
83
|
+
|
|
84
|
+
**Tests:**
|
|
85
|
+
```
|
|
86
|
+
[Run test command] [See: 34/34 pass] "All tests pass"
|
|
87
|
+
"Should pass now" / "Looks correct"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Regression tests (TDD Red-Green):**
|
|
91
|
+
```
|
|
92
|
+
Write -> Run (pass) -> Revert fix -> Run (MUST FAIL) -> Restore -> Run (pass)
|
|
93
|
+
"I've written a regression test" (without red-green verification)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Build:**
|
|
97
|
+
```
|
|
98
|
+
[Run build] [See: exit 0] "Build passes"
|
|
99
|
+
"Linter passed" (linter doesn't check compilation)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Requirements:**
|
|
103
|
+
```
|
|
104
|
+
Re-read plan -> Create checklist -> Verify each -> Report gaps or completion
|
|
105
|
+
"Tests pass, phase complete"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Agent delegation:**
|
|
109
|
+
```
|
|
110
|
+
Agent reports success -> Check VCS diff -> Verify changes -> Report actual state
|
|
111
|
+
Trust agent report
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Why This Matters
|
|
115
|
+
|
|
116
|
+
From 24 failure memories:
|
|
117
|
+
- the user said "I don't believe you" - trust broken
|
|
118
|
+
- Undefined functions shipped - would crash
|
|
119
|
+
- Missing requirements shipped - incomplete features
|
|
120
|
+
- Time wasted on false completion -> redirect -> rework
|
|
121
|
+
- Violates: "Honesty is a core value. If you lie, you'll be replaced."
|
|
122
|
+
|
|
123
|
+
## When To Apply
|
|
124
|
+
|
|
125
|
+
**ALWAYS before:**
|
|
126
|
+
- ANY variation of success/completion claims
|
|
127
|
+
- ANY expression of satisfaction
|
|
128
|
+
- ANY positive statement about work state
|
|
129
|
+
- Committing, PR creation, task completion
|
|
130
|
+
- Moving to next task
|
|
131
|
+
- Delegating to agents
|
|
132
|
+
|
|
133
|
+
**Rule applies to:**
|
|
134
|
+
- Exact phrases
|
|
135
|
+
- Paraphrases and synonyms
|
|
136
|
+
- Implications of success
|
|
137
|
+
- ANY communication suggesting completion/correctness
|
|
138
|
+
|
|
139
|
+
## The Bottom Line
|
|
140
|
+
|
|
141
|
+
**No shortcuts for verification.**
|
|
142
|
+
|
|
143
|
+
Run the command. Read the output. THEN claim the result.
|
|
144
|
+
|
|
145
|
+
This is non-negotiable.
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
<!-- Based on superpowers by Jesse Vincent (MIT License, 2025). Adapted for SDTK-CODE. See ../../THIRD_PARTY_NOTICES.md for details. -->
|
|
2
|
+
---
|
|
3
|
+
name: code-worktree
|
|
4
|
+
description: Git worktrees for feature isolation. Use when starting feature work that needs isolation -- creates isolated worktrees with safety verification.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Code Worktree
|
|
8
|
+
|
|
9
|
+
## Critical Constraints
|
|
10
|
+
- I do not create a project-local worktree until I verify the target directory is ignored.
|
|
11
|
+
- I do not start feature work in a new worktree without checking the baseline setup and tests.
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.
|
|
16
|
+
|
|
17
|
+
**Core principle:** Systematic directory selection + safety verification = reliable isolation.
|
|
18
|
+
|
|
19
|
+
**Announce at start:** "I'm using the code-worktree skill to set up an isolated workspace."
|
|
20
|
+
|
|
21
|
+
## Procedure
|
|
22
|
+
1. Choose the worktree location using the documented priority order.
|
|
23
|
+
2. Verify project-local directories are ignored before creation.
|
|
24
|
+
3. Create the worktree and run repository setup commands.
|
|
25
|
+
4. Confirm the baseline tests pass before implementation begins.
|
|
26
|
+
|
|
27
|
+
## Directory Selection Process
|
|
28
|
+
|
|
29
|
+
Follow this priority order:
|
|
30
|
+
|
|
31
|
+
### 1. Check Existing Directories
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Check in priority order
|
|
35
|
+
ls -d .worktrees 2>/dev/null # Preferred (hidden)
|
|
36
|
+
ls -d worktrees 2>/dev/null # Alternative
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**If found:** Use that directory. If both exist, `.worktrees` wins.
|
|
40
|
+
|
|
41
|
+
### 2. Check CLAUDE.md
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
grep -i "worktree.*director" CLAUDE.md 2>/dev/null
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**If preference specified:** Use it without asking.
|
|
48
|
+
|
|
49
|
+
### 3. Ask User
|
|
50
|
+
|
|
51
|
+
If no directory exists and no CLAUDE.md preference:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
No worktree directory found. Where should I create worktrees?
|
|
55
|
+
|
|
56
|
+
1. .worktrees/ (project-local, hidden)
|
|
57
|
+
2. ~/.config/sdtk-code/worktrees/<project-name>/ (global location)
|
|
58
|
+
|
|
59
|
+
Which would you prefer?
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Safety Verification
|
|
63
|
+
|
|
64
|
+
### For Project-Local Directories (.worktrees or worktrees)
|
|
65
|
+
|
|
66
|
+
**MUST verify directory is ignored before creating worktree:**
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Check if directory is ignored (respects local, global, and system gitignore)
|
|
70
|
+
git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**If NOT ignored:**
|
|
74
|
+
|
|
75
|
+
Per Jesse's rule "Fix broken things immediately":
|
|
76
|
+
1. Add appropriate line to .gitignore
|
|
77
|
+
2. Commit the change
|
|
78
|
+
3. Proceed with worktree creation
|
|
79
|
+
|
|
80
|
+
**Why critical:** Prevents accidentally committing worktree contents to repository.
|
|
81
|
+
|
|
82
|
+
### For Global Directory (~/.config/sdtk-code/worktrees)
|
|
83
|
+
|
|
84
|
+
No .gitignore verification needed - outside project entirely.
|
|
85
|
+
|
|
86
|
+
## Creation Steps
|
|
87
|
+
|
|
88
|
+
### 1. Detect Project Name
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
project=$(basename "$(git rev-parse --show-toplevel)")
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 2. Create Worktree
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Determine full path
|
|
98
|
+
case $LOCATION in
|
|
99
|
+
.worktrees|worktrees)
|
|
100
|
+
path="$LOCATION/$BRANCH_NAME"
|
|
101
|
+
;;
|
|
102
|
+
~/.config/sdtk-code/worktrees/*)
|
|
103
|
+
path="~/.config/sdtk-code/worktrees/$project/$BRANCH_NAME"
|
|
104
|
+
;;
|
|
105
|
+
esac
|
|
106
|
+
|
|
107
|
+
# Create worktree with new branch
|
|
108
|
+
git worktree add "$path" -b "$BRANCH_NAME"
|
|
109
|
+
cd "$path"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### 3. Run Project Setup
|
|
113
|
+
|
|
114
|
+
Auto-detect and run appropriate setup:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Node.js
|
|
118
|
+
if [ -f package.json ]; then npm install; fi
|
|
119
|
+
|
|
120
|
+
# Rust
|
|
121
|
+
if [ -f Cargo.toml ]; then cargo build; fi
|
|
122
|
+
|
|
123
|
+
# Python
|
|
124
|
+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
|
125
|
+
if [ -f pyproject.toml ]; then poetry install; fi
|
|
126
|
+
|
|
127
|
+
# Go
|
|
128
|
+
if [ -f go.mod ]; then go mod download; fi
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 4. Verify Clean Baseline
|
|
132
|
+
|
|
133
|
+
Run tests to ensure worktree starts clean:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Examples - use project-appropriate command
|
|
137
|
+
npm test
|
|
138
|
+
cargo test
|
|
139
|
+
pytest
|
|
140
|
+
go test ./...
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**If tests fail:** Report failures, ask whether to proceed or investigate.
|
|
144
|
+
|
|
145
|
+
**If tests pass:** Report ready.
|
|
146
|
+
|
|
147
|
+
### 5. Report Location
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
Worktree ready at <full-path>
|
|
151
|
+
Tests passing (<N> tests, 0 failures)
|
|
152
|
+
Ready to implement <feature-name>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Quick Reference
|
|
156
|
+
|
|
157
|
+
| Situation | Action |
|
|
158
|
+
|-----------|--------|
|
|
159
|
+
| `.worktrees/` exists | Use it (verify ignored) |
|
|
160
|
+
| `worktrees/` exists | Use it (verify ignored) |
|
|
161
|
+
| Both exist | Use `.worktrees/` |
|
|
162
|
+
| Neither exists | Check CLAUDE.md -> Ask user |
|
|
163
|
+
| Directory not ignored | Add to .gitignore + commit |
|
|
164
|
+
| Tests fail during baseline | Report failures + ask |
|
|
165
|
+
| No package.json/Cargo.toml | Skip dependency install |
|
|
166
|
+
|
|
167
|
+
## Common Mistakes
|
|
168
|
+
|
|
169
|
+
### Skipping ignore verification
|
|
170
|
+
|
|
171
|
+
- **Problem:** Worktree contents get tracked, pollute git status
|
|
172
|
+
- **Fix:** Always use `git check-ignore` before creating project-local worktree
|
|
173
|
+
|
|
174
|
+
### Assuming directory location
|
|
175
|
+
|
|
176
|
+
- **Problem:** Creates inconsistency, violates project conventions
|
|
177
|
+
- **Fix:** Follow priority: existing > CLAUDE.md > ask
|
|
178
|
+
|
|
179
|
+
### Proceeding with failing tests
|
|
180
|
+
|
|
181
|
+
- **Problem:** Can't distinguish new bugs from pre-existing issues
|
|
182
|
+
- **Fix:** Report failures, get explicit permission to proceed
|
|
183
|
+
|
|
184
|
+
### Hardcoding setup commands
|
|
185
|
+
|
|
186
|
+
- **Problem:** Breaks on projects using different tools
|
|
187
|
+
- **Fix:** Auto-detect from project files (package.json, etc.)
|
|
188
|
+
|
|
189
|
+
## Example Workflow
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
You: I'm using the code-worktree skill to set up an isolated workspace.
|
|
193
|
+
|
|
194
|
+
[Check .worktrees/ - exists]
|
|
195
|
+
[Verify ignored - git check-ignore confirms .worktrees/ is ignored]
|
|
196
|
+
[Create worktree: git worktree add .worktrees/auth -b feature/auth]
|
|
197
|
+
[Run npm install]
|
|
198
|
+
[Run npm test - 47 passing]
|
|
199
|
+
|
|
200
|
+
Worktree ready at /Users/jesse/myproject/.worktrees/auth
|
|
201
|
+
Tests passing (47 tests, 0 failures)
|
|
202
|
+
Ready to implement auth feature
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Red Flags
|
|
206
|
+
|
|
207
|
+
**Never:**
|
|
208
|
+
- Create worktree without verifying it's ignored (project-local)
|
|
209
|
+
- Skip baseline test verification
|
|
210
|
+
- Proceed with failing tests without asking
|
|
211
|
+
- Assume directory location when ambiguous
|
|
212
|
+
- Skip CLAUDE.md check
|
|
213
|
+
|
|
214
|
+
**Always:**
|
|
215
|
+
- Follow directory priority: existing > CLAUDE.md > ask
|
|
216
|
+
- Verify directory is ignored for project-local
|
|
217
|
+
- Auto-detect and run project setup
|
|
218
|
+
- Verify clean test baseline
|
|
219
|
+
|
|
220
|
+
## Integration
|
|
221
|
+
|
|
222
|
+
**Called by:**
|
|
223
|
+
- **code-brainstorm** (Phase 4) - REQUIRED when design is approved and implementation follows
|
|
224
|
+
- **code-parallel** - REQUIRED before executing any tasks
|
|
225
|
+
- **code-execute** - REQUIRED before executing any tasks
|
|
226
|
+
- Any skill needing isolated workspace
|
|
227
|
+
|
|
228
|
+
**Pairs with:**
|
|
229
|
+
- **code-finish** - REQUIRED for cleanup after work complete
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# CODE_WORKFLOW __FEATURE_KEY__
|
|
2
|
+
|
|
3
|
+
<!-- SDTK-CODE:METADATA:START -->
|
|
4
|
+
## 1. Metadata
|
|
5
|
+
- Feature key: `__FEATURE_KEY__`
|
|
6
|
+
- Lane: `__LANE__`
|
|
7
|
+
- Current phase: `start`
|
|
8
|
+
- Phase status: `__PHASE_STATUS__`
|
|
9
|
+
- Intake outcome: `__INTAKE_OUTCOME__`
|
|
10
|
+
- Last updated: `__LAST_UPDATED__`
|
|
11
|
+
<!-- SDTK-CODE:METADATA:END -->
|
|
12
|
+
|
|
13
|
+
<!-- SDTK-CODE:INPUTS:START -->
|
|
14
|
+
## 2. Inputs
|
|
15
|
+
### Required Inputs
|
|
16
|
+
__REQUIRED_INPUTS__
|
|
17
|
+
|
|
18
|
+
### Additional Discovered Inputs
|
|
19
|
+
__ADDITIONAL_INPUTS__
|
|
20
|
+
|
|
21
|
+
### Missing Required Inputs
|
|
22
|
+
__MISSING_INPUTS__
|
|
23
|
+
<!-- SDTK-CODE:INPUTS:END -->
|
|
24
|
+
|
|
25
|
+
<!-- SDTK-CODE:PLAN:START -->
|
|
26
|
+
## 3. Scope Lock
|
|
27
|
+
### In Scope
|
|
28
|
+
- Pending confirmation during workflow planning.
|
|
29
|
+
|
|
30
|
+
### Out Of Scope
|
|
31
|
+
- Pending confirmation during workflow planning.
|
|
32
|
+
|
|
33
|
+
### Assumptions
|
|
34
|
+
- No explicit planning assumptions recorded.
|
|
35
|
+
|
|
36
|
+
### Risks
|
|
37
|
+
- No explicit planning risks recorded.
|
|
38
|
+
|
|
39
|
+
## 4. Plan / Slices
|
|
40
|
+
- Pending lane-specific planning or build guidance.
|
|
41
|
+
|
|
42
|
+
### Planning Notes
|
|
43
|
+
- No additional planning notes recorded.
|
|
44
|
+
<!-- SDTK-CODE:PLAN:END -->
|
|
45
|
+
|
|
46
|
+
<!-- SDTK-CODE:BUILD:START -->
|
|
47
|
+
### Build Progress
|
|
48
|
+
- Build status: `pending`
|
|
49
|
+
- Execution mode: `sequential`
|
|
50
|
+
|
|
51
|
+
### Active Slices
|
|
52
|
+
- Pending build-phase execution.
|
|
53
|
+
|
|
54
|
+
### Build Notes
|
|
55
|
+
- No build notes recorded yet.
|
|
56
|
+
|
|
57
|
+
### Debug Notes
|
|
58
|
+
- No debug notes recorded.
|
|
59
|
+
|
|
60
|
+
### Parallelization Justification
|
|
61
|
+
- Not using explicit parallel execution in this build pass.
|
|
62
|
+
<!-- SDTK-CODE:BUILD:END -->
|
|
63
|
+
|
|
64
|
+
<!-- SDTK-CODE:STATUS:START -->
|
|
65
|
+
## 5. Status Checklist
|
|
66
|
+
- Current phase: `start`
|
|
67
|
+
- Next recommended phase: `__NEXT_PHASE__`
|
|
68
|
+
- Suggested engine entrypoints: __SUGGESTED_ENGINE__
|
|
69
|
+
- Blocking state: `__BLOCKING_STATE__`
|
|
70
|
+
<!-- SDTK-CODE:STATUS:END -->
|
|
71
|
+
|
|
72
|
+
<!-- SDTK-CODE:VERIFY:START -->
|
|
73
|
+
## 6. Evidence And Review Notes
|
|
74
|
+
### Evidence Summary
|
|
75
|
+
- No summarized verification evidence recorded yet.
|
|
76
|
+
|
|
77
|
+
### Raw Output References
|
|
78
|
+
- Store raw command output under `docs/dev/evidence/__FEATURE_KEY__/` and reference it from this section.
|
|
79
|
+
|
|
80
|
+
### Review Gate Status
|
|
81
|
+
- Evidence gate: `pending`
|
|
82
|
+
- Spec/compliance gate: `pending`
|
|
83
|
+
- Quality gate: `pending`
|
|
84
|
+
|
|
85
|
+
### Spec / Compliance Notes
|
|
86
|
+
- No spec/compliance notes recorded yet.
|
|
87
|
+
|
|
88
|
+
### Quality Notes
|
|
89
|
+
- No quality review notes recorded yet.
|
|
90
|
+
|
|
91
|
+
### Debug Follow-Up
|
|
92
|
+
- No reactive debug follow-up recorded.
|
|
93
|
+
<!-- SDTK-CODE:VERIFY:END -->
|
|
94
|
+
|
|
95
|
+
<!-- SDTK-CODE:SHIP:START -->
|
|
96
|
+
## 7. Ship / Finish Decision
|
|
97
|
+
### Final Decision
|
|
98
|
+
- Decision: `pending`
|
|
99
|
+
- Ship status: `pending`
|
|
100
|
+
|
|
101
|
+
### Preflight Summary
|
|
102
|
+
- No ship preflight entries recorded yet.
|
|
103
|
+
|
|
104
|
+
### Follow-Up Items
|
|
105
|
+
- No follow-up items recorded.
|
|
106
|
+
|
|
107
|
+
### Ship Notes
|
|
108
|
+
- No additional ship notes recorded.
|
|
109
|
+
|
|
110
|
+
### Debug Follow-Up
|
|
111
|
+
- No reactive debug follow-up recorded.
|
|
112
|
+
<!-- SDTK-CODE:SHIP:END -->
|
package/bin/sdtk-code.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { run } = require("../src/index");
|
|
6
|
+
|
|
7
|
+
run(process.argv.slice(2))
|
|
8
|
+
.then((exitCode) => {
|
|
9
|
+
process.exitCode = Number.isInteger(exitCode) ? exitCode : 0;
|
|
10
|
+
})
|
|
11
|
+
.catch((error) => {
|
|
12
|
+
console.error(`sdtk-code: ${error.message}`);
|
|
13
|
+
process.exitCode = typeof error.exitCode === "number" ? error.exitCode : 4;
|
|
14
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sdtk-code-kit",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Workflow-first coding process toolkit: start, plan, build, verify, ship, and runtime setup.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"sdtk-code": "./bin/sdtk-code.js"
|
|
7
|
+
},
|
|
8
|
+
"main": "src/index.js",
|
|
9
|
+
"type": "commonjs",
|
|
10
|
+
"files": [
|
|
11
|
+
"bin/",
|
|
12
|
+
"src/",
|
|
13
|
+
"assets/"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"test": "powershell -ExecutionPolicy Bypass -Command \"$ErrorActionPreference = 'Stop'; Set-Location '..\\..\\..\\..'; python -m unittest tests.test_sdtk_code_cli tests.test_sdtk_code_product tests.test_sdtk_code_workflow_regressions\"",
|
|
17
|
+
"build:payload": "powershell -ExecutionPolicy Bypass -Command \"$ErrorActionPreference = 'Stop'; & 'scripts/sync-toolkit-assets.ps1'; & 'scripts/build-toolkit-manifest.ps1'\"",
|
|
18
|
+
"verify:payload": "node -e \"require('./src/lib/toolkit-payload').verify()\"",
|
|
19
|
+
"pack:smoke": "npm pack --dry-run",
|
|
20
|
+
"pack:release": "npm pack",
|
|
21
|
+
"prepublishOnly": "node -e \"require('./src/lib/toolkit-payload').verify()\""
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18.13.0"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"sdtk-code",
|
|
28
|
+
"cli",
|
|
29
|
+
"toolkit"
|
|
30
|
+
],
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/codexsdtk/sdtk-toolkit.git",
|
|
35
|
+
"directory": "products/sdtk-code/distribution/sdtk-code-kit"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/codexsdtk/sdtk-toolkit/tree/main/products/sdtk-code/distribution/sdtk-code-kit",
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/codexsdtk/sdtk-toolkit/issues"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const { parseFlags, requireFlag, validatePattern } = require("../lib/args");
|
|
5
|
+
const { ValidationError } = require("../lib/errors");
|
|
6
|
+
const { runBuild } = require("../lib/workflow-build");
|
|
7
|
+
|
|
8
|
+
const FLAG_DEFS = {
|
|
9
|
+
"feature-key": { type: "string" },
|
|
10
|
+
"project-path": { type: "string" },
|
|
11
|
+
"active-slice": { type: "string", multiple: true },
|
|
12
|
+
note: { type: "string", multiple: true },
|
|
13
|
+
"debug-note": { type: "string", multiple: true },
|
|
14
|
+
"parallel-reason": { type: "string" },
|
|
15
|
+
complete: { type: "boolean" },
|
|
16
|
+
blocked: { type: "boolean" },
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const FEATURE_KEY_RE = /^[A-Z0-9_]+$/;
|
|
20
|
+
|
|
21
|
+
function cmdBuild(args) {
|
|
22
|
+
const { flags, positional } = parseFlags(args, FLAG_DEFS);
|
|
23
|
+
if (positional.length > 0) {
|
|
24
|
+
throw new ValidationError('Unexpected positional arguments. Use flags only for "build".');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const featureKey = requireFlag(flags, "feature-key", "feature-key");
|
|
28
|
+
validatePattern(
|
|
29
|
+
featureKey,
|
|
30
|
+
FEATURE_KEY_RE,
|
|
31
|
+
"feature-key",
|
|
32
|
+
"Must use UPPER_SNAKE_CASE, for example ORDER_MGMT."
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const projectPath = flags["project-path"] ? path.resolve(flags["project-path"]) : process.cwd();
|
|
36
|
+
const result = runBuild(projectPath, featureKey, flags);
|
|
37
|
+
|
|
38
|
+
console.log("SDTK-CODE workflow build");
|
|
39
|
+
console.log(` Feature key: ${featureKey}`);
|
|
40
|
+
console.log(` Lane: ${result.lane}`);
|
|
41
|
+
console.log(` Status: ${result.phaseStatus}`);
|
|
42
|
+
console.log(` Artifact: ${result.artifactPath}`);
|
|
43
|
+
console.log(` Slices: ${result.activeSliceCount}`);
|
|
44
|
+
console.log(` Mode: ${result.executionMode}`);
|
|
45
|
+
console.log(` Next phase: ${result.nextPhase}`);
|
|
46
|
+
console.log(` Engine: ${result.suggestedEngineSkills.join(", ")}`);
|
|
47
|
+
|
|
48
|
+
return 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
module.exports = {
|
|
52
|
+
cmdBuild,
|
|
53
|
+
};
|