@simplysm/sd-claude 13.0.45 → 13.0.47
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/claude/rules/sd-workflow-rules.md +5 -0
- package/claude/skills/sd-brainstorm/SKILL.md +4 -44
- package/claude/skills/sd-check/SKILL.md +51 -84
- package/claude/skills/sd-check/run-checks.mjs +128 -0
- package/claude/skills/sd-plan/SKILL.md +70 -4
- package/claude/skills/sd-use/SKILL.md +1 -1
- package/claude/skills/sd-worktree/sd-worktree.mjs +1 -1
- package/package.json +1 -1
- package/claude/skills/sd-check/env-check.mjs +0 -45
|
@@ -16,3 +16,8 @@
|
|
|
16
16
|
- Before modifying functions/classes: Read the file to understand existing code style
|
|
17
17
|
- When unsure about API/method usage: Check signatures in source code
|
|
18
18
|
- **If confidence is low, ask the user instead of writing code**
|
|
19
|
+
|
|
20
|
+
## Memory Policy
|
|
21
|
+
|
|
22
|
+
- **Do NOT use auto memory** (`~/.claude/projects/.../memory/`). It is environment-specific and does not persist across machines.
|
|
23
|
+
- All persistent knowledge belongs in `.claude/rules/` or project docs (committed to git).
|
|
@@ -39,53 +39,13 @@ Start by understanding the current project context, then ask questions one at a
|
|
|
39
39
|
- Write the validated design to `docs/plans/YYYY-MM-DD-<topic>-design.md`
|
|
40
40
|
- Commit the design document to git
|
|
41
41
|
|
|
42
|
-
**Next
|
|
42
|
+
**Next Step:**
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
Display the guide in the **user's configured language** (follow the language settings from CLAUDE.md or system instructions).
|
|
44
|
+
Display in the **system's configured language**:
|
|
46
45
|
|
|
47
|
-
|
|
46
|
+
**"Design complete and saved to `docs/plans/<filename>.md`. Next step: `/sd-plan` to create the implementation plan."**
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
Design complete! Here's how to proceed:
|
|
51
|
-
|
|
52
|
-
--- Path A: With branch isolation (recommended for features/large changes) ---
|
|
53
|
-
|
|
54
|
-
1. /sd-worktree add <name> — Create a worktree branch
|
|
55
|
-
2. /sd-plan — Break into detailed tasks
|
|
56
|
-
3. /sd-plan-dev — Execute tasks in parallel (includes TDD + review)
|
|
57
|
-
4. /sd-check — Verify (modified + dependents)
|
|
58
|
-
5. /sd-commit — Commit
|
|
59
|
-
6. /sd-worktree merge — Merge back to main
|
|
60
|
-
7. /sd-worktree clean — Remove worktree
|
|
61
|
-
|
|
62
|
-
--- Path B: Direct on current branch (quick fixes/small changes) ---
|
|
63
|
-
|
|
64
|
-
1. /sd-plan — Break into detailed tasks
|
|
65
|
-
2. /sd-plan-dev — Execute tasks in parallel (includes TDD + review)
|
|
66
|
-
3. /sd-check — Verify (modified + dependents)
|
|
67
|
-
4. /sd-commit — Commit
|
|
68
|
-
|
|
69
|
-
You can start from any step or skip steps as needed.
|
|
70
|
-
|
|
71
|
-
💡 "Path A: yolo" or "Path B: yolo" to auto-run all steps
|
|
72
|
-
|
|
73
|
-
⚠️ You have uncommitted changes. To use Path A, run `/sd-commit all` first.
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
- The last `⚠️` line is only shown when uncommitted changes exist. Omit it when working tree is clean.
|
|
77
|
-
|
|
78
|
-
- After presenting both paths, **recommend one** based on the design's scope:
|
|
79
|
-
- Path A recommended: new features, multi-file changes, architectural changes, anything that benefits from isolation
|
|
80
|
-
- Path B recommended: small bug fixes, single-file changes, config tweaks, minor adjustments
|
|
81
|
-
- Briefly explain why (1 sentence)
|
|
82
|
-
- Do NOT auto-proceed to any step. Present the overview with recommendation and wait for the user's choice.
|
|
83
|
-
- **Yolo mode**: If the user responds with "Path A: yolo" or "Path B: yolo" (or similar intent like "A yolo", "B 자동"), execute all steps of the chosen path sequentially without stopping between steps.
|
|
84
|
-
- **Yolo sd-check — include dependents**: NEVER check only modified packages. Also check all packages that depend on them:
|
|
85
|
-
1. Identify modified packages from `git diff --name-only`
|
|
86
|
-
2. Trace reverse dependencies (packages that import from modified packages) using `package.json` or project dependency graph
|
|
87
|
-
3. Include integration/e2e tests that cover the modified packages
|
|
88
|
-
4. Run `/sd-check` with all affected paths, or `/sd-check` without path (whole project) when changes are widespread
|
|
48
|
+
Do NOT auto-proceed. Wait for the user's explicit instruction.
|
|
89
49
|
|
|
90
50
|
## Key Principles
|
|
91
51
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sd-check
|
|
3
3
|
description: Use when verifying code quality via typecheck, lint, and tests - before deployment, PR creation, after code changes, or when type errors, lint violations, or test failures are suspected. Applies to whole project or specific paths.
|
|
4
|
-
allowed-tools: Bash(node .claude/skills/sd-check/
|
|
4
|
+
allowed-tools: Bash(node .claude/skills/sd-check/run-checks.mjs), Bash(pnpm typecheck), Bash(pnpm lint --fix), Bash(pnpm vitest)
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# sd-check
|
|
@@ -14,19 +14,18 @@ Verify code quality through parallel execution of typecheck, lint, and test chec
|
|
|
14
14
|
|
|
15
15
|
**Foundational Principle:** Violating the letter of these steps is violating the spirit of verification.
|
|
16
16
|
|
|
17
|
-
When the user asks to verify code, YOU will manually execute **EXACTLY THESE
|
|
17
|
+
When the user asks to verify code, YOU will manually execute **EXACTLY THESE 3 STEPS** (no more, no less):
|
|
18
18
|
|
|
19
|
-
**Step 1:**
|
|
20
|
-
**Step 2:**
|
|
21
|
-
**Step 3:**
|
|
22
|
-
**Step 4:** Re-verify (go back to Step 2) until all pass
|
|
19
|
+
**Step 1:** Run the unified check script (single background command)
|
|
20
|
+
**Step 2:** Collect results, fix errors in priority order
|
|
21
|
+
**Step 3:** Re-verify (go back to Step 1) until all pass
|
|
23
22
|
|
|
24
23
|
**Core principle:** Always re-run ALL checks after any fix - changes can cascade.
|
|
25
24
|
|
|
26
25
|
**CRITICAL:**
|
|
27
26
|
- This skill verifies ONLY typecheck, lint, and test
|
|
28
27
|
- **NO BUILD. NO DEV SERVER. NO TEAMS. NO TASK LISTS.**
|
|
29
|
-
- Do NOT create your own "better" workflow - follow these
|
|
28
|
+
- Do NOT create your own "better" workflow - follow these 3 steps EXACTLY
|
|
30
29
|
|
|
31
30
|
## Usage
|
|
32
31
|
|
|
@@ -37,72 +36,48 @@ When the user asks to verify code, YOU will manually execute **EXACTLY THESE 4 S
|
|
|
37
36
|
|
|
38
37
|
## Quick Reference
|
|
39
38
|
|
|
40
|
-
| Check |
|
|
41
|
-
|
|
42
|
-
| Typecheck |
|
|
43
|
-
| Lint |
|
|
44
|
-
| Test |
|
|
39
|
+
| Check | Purpose |
|
|
40
|
+
|-------|---------|
|
|
41
|
+
| Typecheck | Type errors |
|
|
42
|
+
| Lint | Code quality (with auto-fix) |
|
|
43
|
+
| Test | Functionality |
|
|
45
44
|
|
|
46
|
-
**All 3 run in PARALLEL**
|
|
45
|
+
**All 3 run in PARALLEL** inside the unified script (single command).
|
|
47
46
|
|
|
48
47
|
## Workflow
|
|
49
48
|
|
|
50
|
-
### Step 1:
|
|
49
|
+
### Step 1: Run Unified Check Script
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
Launch the single check command in background:
|
|
53
52
|
|
|
54
|
-
```bash
|
|
55
|
-
node .claude/skills/sd-check/env-check.mjs
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
- **Exit 0 + "Environment OK"**: Proceed to Step 2
|
|
59
|
-
- **Exit 1 + version error** (e.g., "simplysm v13+"): Tell the user this project is below v13 so automated checks are unavailable, and they should run typecheck, lint, and test manually. Then STOP — do not proceed to Step 2.
|
|
60
|
-
- **Exit 1 + other errors**: STOP, report the listed errors to user
|
|
61
|
-
|
|
62
|
-
The script checks: package.json version (v13+), pnpm workspace files, typecheck/lint scripts, vitest config.
|
|
63
|
-
|
|
64
|
-
### Step 2: Launch 3 Background Bash Commands in Parallel
|
|
65
|
-
|
|
66
|
-
Launch ALL 3 commands in a **single message** using Bash tool with `run_in_background: true`.
|
|
67
|
-
|
|
68
|
-
**Replace `[path]` with user's argument, or OMIT if no argument (defaults to full project).**
|
|
69
|
-
|
|
70
|
-
**Command 1 - Typecheck:**
|
|
71
53
|
```
|
|
72
54
|
Bash tool:
|
|
73
|
-
command: "
|
|
74
|
-
description: "Run typecheck"
|
|
75
|
-
|
|
76
|
-
timeout: 300000
|
|
55
|
+
command: "node .claude/skills/sd-check/run-checks.mjs [path]"
|
|
56
|
+
description: "Run typecheck + lint + test"
|
|
57
|
+
timeout: 600000
|
|
77
58
|
```
|
|
78
59
|
|
|
79
|
-
|
|
80
|
-
```
|
|
81
|
-
Bash tool:
|
|
82
|
-
command: "pnpm lint --fix [path]"
|
|
83
|
-
description: "Run lint with auto-fix"
|
|
84
|
-
run_in_background: true
|
|
85
|
-
timeout: 300000
|
|
86
|
-
```
|
|
60
|
+
Replace `[path]` with user's argument, or OMIT if no argument (defaults to full project).
|
|
87
61
|
|
|
88
|
-
**
|
|
89
|
-
```
|
|
90
|
-
Bash tool:
|
|
91
|
-
command: "pnpm vitest [path] --run"
|
|
92
|
-
description: "Run tests"
|
|
93
|
-
run_in_background: true
|
|
94
|
-
timeout: 300000
|
|
62
|
+
**Output format:**
|
|
95
63
|
```
|
|
64
|
+
====== TYPECHECK: PASS ======
|
|
65
|
+
[last few lines]
|
|
96
66
|
|
|
97
|
-
|
|
67
|
+
====== LINT: FAIL ======
|
|
68
|
+
[full error output]
|
|
98
69
|
|
|
99
|
-
|
|
70
|
+
====== TEST: PASS (47 tests) ======
|
|
71
|
+
[last few lines]
|
|
100
72
|
|
|
101
|
-
|
|
73
|
+
====== SUMMARY: 1/3 FAILED (lint) ======
|
|
74
|
+
```
|
|
102
75
|
|
|
103
|
-
**
|
|
76
|
+
- **ENV-CHECK FAIL**: Environment prerequisites missing. Report to user and STOP.
|
|
77
|
+
- **SUMMARY: ALL PASSED**: Complete (see Completion Criteria).
|
|
78
|
+
- **SUMMARY: N/3 FAILED**: Proceed to Step 2.
|
|
104
79
|
|
|
105
|
-
|
|
80
|
+
### Step 2: Fix Errors
|
|
106
81
|
|
|
107
82
|
1. **Analyze by priority:** Typecheck → Lint → Test
|
|
108
83
|
- Typecheck errors may cause lint/test errors (cascade)
|
|
@@ -118,51 +93,47 @@ Collect ALL 3 outputs using `TaskOutput` tool (with `block: true, timeout: 30000
|
|
|
118
93
|
- If source bug: Fix source
|
|
119
94
|
- **If root cause unclear OR 2-3 fix attempts failed:** Recommend `/sd-debug`
|
|
120
95
|
|
|
121
|
-
4. **Proceed to Step
|
|
96
|
+
4. **Proceed to Step 3**
|
|
122
97
|
|
|
123
|
-
### Step
|
|
98
|
+
### Step 3: Re-verify (Loop Until All Pass)
|
|
124
99
|
|
|
125
100
|
**CRITICAL:** After ANY fix, re-run ALL 3 checks.
|
|
126
101
|
|
|
127
|
-
Go back to Step
|
|
102
|
+
Go back to Step 1 and run the unified script again.
|
|
128
103
|
|
|
129
104
|
**Do NOT assume:** "I only fixed typecheck → skip lint/test". Fixes cascade.
|
|
130
105
|
|
|
131
|
-
Repeat Steps
|
|
106
|
+
Repeat Steps 1-3 until all 3 checks pass.
|
|
132
107
|
|
|
133
108
|
## Common Mistakes
|
|
134
109
|
|
|
135
|
-
###
|
|
136
|
-
**Wrong:**
|
|
137
|
-
**Right:**
|
|
138
|
-
|
|
139
|
-
### ❌ Fixing before collecting all results
|
|
140
|
-
**Wrong:** Command 1 returns error → fix immediately → re-verify
|
|
141
|
-
**Right:** Wait for all 3 → collect all errors → fix in priority order → re-verify
|
|
110
|
+
### Fixing before reading full output
|
|
111
|
+
**Wrong:** See first error in output → fix immediately
|
|
112
|
+
**Right:** Read full SUMMARY → collect all errors → fix in priority order → re-verify
|
|
142
113
|
|
|
143
|
-
###
|
|
114
|
+
### Skipping re-verification after fixes
|
|
144
115
|
**Wrong:** Fix typecheck → assume lint/test still pass
|
|
145
|
-
**Right:** ALWAYS re-run
|
|
116
|
+
**Right:** ALWAYS re-run the script after any fix
|
|
146
117
|
|
|
147
|
-
###
|
|
148
|
-
**Wrong:** Launch haiku/sonnet/opus agents via Task tool to run
|
|
118
|
+
### Using agents instead of background Bash
|
|
119
|
+
**Wrong:** Launch haiku/sonnet/opus agents via Task tool to run the script
|
|
149
120
|
**Right:** Use `Bash` with `run_in_background: true` (no model overhead)
|
|
150
121
|
|
|
151
|
-
###
|
|
122
|
+
### Including build/dev steps
|
|
152
123
|
**Wrong:** Run `pnpm build` or `pnpm dev` as part of verification
|
|
153
124
|
**Right:** sd-check is ONLY typecheck, lint, test (no build, no dev)
|
|
154
125
|
|
|
155
|
-
###
|
|
126
|
+
### Asking user for path
|
|
156
127
|
**Wrong:** No path provided → ask "which package?"
|
|
157
|
-
**Right:** No path → verify entire project (omit path in
|
|
128
|
+
**Right:** No path → verify entire project (omit path in command)
|
|
158
129
|
|
|
159
|
-
###
|
|
130
|
+
### Infinite fix loop
|
|
160
131
|
**Wrong:** Keep trying same fix when tests fail repeatedly
|
|
161
132
|
**Right:** After 2-3 failed attempts → recommend `/sd-debug`
|
|
162
133
|
|
|
163
|
-
###
|
|
134
|
+
### Claiming success without fresh evidence
|
|
164
135
|
**Wrong:** "All checks should pass now" or "Great, that fixes it!"
|
|
165
|
-
**Right:** Run
|
|
136
|
+
**Right:** Run script → read output → cite results (e.g., "0 errors, 47 tests passed") → THEN claim
|
|
166
137
|
|
|
167
138
|
## Red Flags - STOP and Follow Workflow
|
|
168
139
|
|
|
@@ -170,12 +141,10 @@ If you find yourself doing ANY of these, you're violating the skill:
|
|
|
170
141
|
|
|
171
142
|
- Treating sd-check as a command to invoke (`Skill: sd-check Args: ...`)
|
|
172
143
|
- Including build or dev server in verification
|
|
173
|
-
- Running commands sequentially instead of parallel
|
|
174
144
|
- Using Task/agent instead of background Bash
|
|
175
145
|
- Not re-verifying after every fix
|
|
176
146
|
- Asking user for path when none provided
|
|
177
147
|
- Continuing past 2-3 failed fix attempts without recommending `/sd-debug`
|
|
178
|
-
- Spawning 4+ commands (only 3: typecheck, lint, test)
|
|
179
148
|
- Expressing satisfaction ("Great!", "Perfect!", "Done!") before all 3 checks pass
|
|
180
149
|
- Using vague language: "should work", "probably passes", "seems fine"
|
|
181
150
|
- Claiming completion based on a previous run, not the current one
|
|
@@ -204,8 +173,7 @@ If you find yourself doing ANY of these, you're violating the skill:
|
|
|
204
173
|
| Excuse | Reality |
|
|
205
174
|
|--------|---------|
|
|
206
175
|
| "I'm following the spirit, not the letter" | Violating the letter IS violating the spirit - follow EXACTLY |
|
|
207
|
-
| "I'll create a better workflow with teams/tasks" | Follow the
|
|
208
|
-
| "I'll split tests into multiple commands" | Only 3 commands total: typecheck, lint, test |
|
|
176
|
+
| "I'll create a better workflow with teams/tasks" | Follow the 3 steps EXACTLY - no teams, no task lists |
|
|
209
177
|
| "Agents can analyze output better" | Background Bash is sufficient - analysis happens in main context |
|
|
210
178
|
| "I only fixed lint, typecheck still passes" | Always re-verify ALL - fixes can cascade |
|
|
211
179
|
| "Build is part of verification" | Build is deployment, not verification - NEVER include it |
|
|
@@ -213,7 +181,6 @@ If you find yourself doing ANY of these, you're violating the skill:
|
|
|
213
181
|
| "I'll try one more fix approach" | After 2-3 attempts → recommend /sd-debug |
|
|
214
182
|
| "Tests are independent of types" | Type fixes affect tests - always re-run ALL |
|
|
215
183
|
| "I'll invoke sd-check skill with args" | sd-check is EXACT STEPS, not a command |
|
|
216
|
-
| "
|
|
217
|
-
| "I'm confident it passes" | Confidence ≠ evidence — run the check |
|
|
184
|
+
| "I'm confident it passes" | Confidence is not evidence — run the check |
|
|
218
185
|
| "It should work now" | "Should" = no evidence — run the check |
|
|
219
|
-
| "I already verified earlier" | Earlier
|
|
186
|
+
| "I already verified earlier" | Earlier is not now — re-run after every change |
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { readFileSync, existsSync } from "fs";
|
|
2
|
+
import { resolve } from "path";
|
|
3
|
+
import { spawn } from "child_process";
|
|
4
|
+
|
|
5
|
+
const root = resolve(import.meta.dirname, "../../..");
|
|
6
|
+
const pathArg = process.argv[2];
|
|
7
|
+
|
|
8
|
+
// ══════════════════════════════════════════
|
|
9
|
+
// Phase 1: Environment Pre-check
|
|
10
|
+
// ══════════════════════════════════════════
|
|
11
|
+
|
|
12
|
+
const errors = [];
|
|
13
|
+
|
|
14
|
+
const pkgPath = resolve(root, "package.json");
|
|
15
|
+
if (!existsSync(pkgPath)) {
|
|
16
|
+
errors.push("package.json not found");
|
|
17
|
+
} else {
|
|
18
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
19
|
+
const major = parseInt(pkg.version?.split(".")[0], 10);
|
|
20
|
+
if (Number.isNaN(major) || major < 13) {
|
|
21
|
+
errors.push(`This skill requires simplysm v13+. Current: ${pkg.version}`);
|
|
22
|
+
}
|
|
23
|
+
if (!pkg.scripts?.typecheck) {
|
|
24
|
+
errors.push("'typecheck' script not defined in package.json");
|
|
25
|
+
}
|
|
26
|
+
if (!pkg.scripts?.lint) {
|
|
27
|
+
errors.push("'lint' script not defined in package.json");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
for (const f of ["pnpm-workspace.yaml", "pnpm-lock.yaml"]) {
|
|
32
|
+
if (!existsSync(resolve(root, f))) {
|
|
33
|
+
errors.push(`${f} not found`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (!existsSync(resolve(root, "vitest.config.ts"))) {
|
|
38
|
+
errors.push("vitest.config.ts not found");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (errors.length > 0) {
|
|
42
|
+
console.log("ENV-CHECK FAIL");
|
|
43
|
+
for (const e of errors) console.log(`- ${e}`);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// ══════════════════════════════════════════
|
|
48
|
+
// Phase 2: Run 3 checks in parallel
|
|
49
|
+
// ══════════════════════════════════════════
|
|
50
|
+
|
|
51
|
+
const TAIL_LINES = 15;
|
|
52
|
+
|
|
53
|
+
function runCommand(name, cmd, args) {
|
|
54
|
+
return new Promise((res) => {
|
|
55
|
+
const child = spawn(cmd, args, { cwd: root, shell: true, stdio: "pipe" });
|
|
56
|
+
const chunks = [];
|
|
57
|
+
|
|
58
|
+
child.stdout.on("data", (d) => chunks.push(d));
|
|
59
|
+
child.stderr.on("data", (d) => chunks.push(d));
|
|
60
|
+
|
|
61
|
+
child.on("close", (code) => {
|
|
62
|
+
const output = Buffer.concat(chunks).toString("utf8");
|
|
63
|
+
res({ name, code, output });
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
child.on("error", (err) => {
|
|
67
|
+
res({ name, code: 1, output: err.message });
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function tail(text, n) {
|
|
73
|
+
const lines = text.trimEnd().split("\n");
|
|
74
|
+
if (lines.length <= n) return text.trimEnd();
|
|
75
|
+
return "...\n" + lines.slice(-n).join("\n");
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function extractTestCount(output) {
|
|
79
|
+
const match =
|
|
80
|
+
output.match(/(\d+)\s+tests?\s+passed/i) ??
|
|
81
|
+
output.match(/Tests\s+(\d+)\s+passed/i) ??
|
|
82
|
+
output.match(/(\d+)\s+pass/i);
|
|
83
|
+
return match ? match[1] : null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const checks = [
|
|
87
|
+
{ name: "TYPECHECK", cmd: "pnpm", args: pathArg ? ["typecheck", pathArg] : ["typecheck"] },
|
|
88
|
+
{ name: "LINT", cmd: "pnpm", args: pathArg ? ["lint", "--fix", pathArg] : ["lint", "--fix"] },
|
|
89
|
+
{ name: "TEST", cmd: "pnpm", args: pathArg ? ["vitest", pathArg, "--run"] : ["vitest", "--run"] },
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
const results = await Promise.all(checks.map((c) => runCommand(c.name, c.cmd, c.args)));
|
|
93
|
+
|
|
94
|
+
// ══════════════════════════════════════════
|
|
95
|
+
// Output results
|
|
96
|
+
// ══════════════════════════════════════════
|
|
97
|
+
|
|
98
|
+
const failed = [];
|
|
99
|
+
|
|
100
|
+
for (const r of results) {
|
|
101
|
+
const passed = r.code === 0;
|
|
102
|
+
let label = passed ? "PASS" : "FAIL";
|
|
103
|
+
|
|
104
|
+
if (passed && r.name === "TEST") {
|
|
105
|
+
const count = extractTestCount(r.output);
|
|
106
|
+
if (count) label = `PASS (${count} tests)`;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
console.log(`\n${"=".repeat(6)} ${r.name}: ${label} ${"=".repeat(6)}`);
|
|
110
|
+
|
|
111
|
+
if (passed) {
|
|
112
|
+
console.log(tail(r.output, TAIL_LINES));
|
|
113
|
+
} else {
|
|
114
|
+
console.log(r.output.trimEnd());
|
|
115
|
+
failed.push(r.name.toLowerCase());
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
console.log();
|
|
120
|
+
if (failed.length === 0) {
|
|
121
|
+
console.log(`${"=".repeat(6)} SUMMARY: ALL PASSED ${"=".repeat(6)}`);
|
|
122
|
+
} else {
|
|
123
|
+
console.log(
|
|
124
|
+
`${"=".repeat(6)} SUMMARY: ${failed.length}/3 FAILED (${failed.join(", ")}) ${"=".repeat(6)}`,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
process.exit(failed.length > 0 ? 1 : 0);
|
|
@@ -16,6 +16,34 @@ Assume they are a skilled developer, but know almost nothing about our toolset o
|
|
|
16
16
|
|
|
17
17
|
**Save plans to:** `docs/plans/YYYY-MM-DD-<feature-name>.md`
|
|
18
18
|
|
|
19
|
+
## Clarification Phase
|
|
20
|
+
|
|
21
|
+
**Before writing the plan**, read the design doc and explore the codebase. Then identify implementation decisions the design didn't specify.
|
|
22
|
+
|
|
23
|
+
**Ask the user about:**
|
|
24
|
+
- Core behavior choices (state management approach, error handling strategy, validation UX)
|
|
25
|
+
- User-facing behavior not specified (what the user sees on error, how navigation works)
|
|
26
|
+
- Architectural choices with multiple valid options (which pattern, which abstraction level)
|
|
27
|
+
|
|
28
|
+
**Don't ask — just decide:**
|
|
29
|
+
- Internal details covered by project conventions (file naming, export patterns)
|
|
30
|
+
- Pure YAGNI decisions (features not mentioned = don't add)
|
|
31
|
+
- Implementation details with only one reasonable option
|
|
32
|
+
|
|
33
|
+
**Format:** Present all discovered gaps as a single numbered list with your recommended option for each. Wait for user confirmation before writing the plan.
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
Before writing the plan, I found these implementation decisions not covered in the design:
|
|
37
|
+
|
|
38
|
+
1. **[Topic]**: [The gap]. I'd recommend [option A] because [reason]. Alternatively, [option B].
|
|
39
|
+
2. **[Topic]**: [The gap]. I'd recommend [option] because [reason].
|
|
40
|
+
...
|
|
41
|
+
|
|
42
|
+
Should I proceed with these recommendations, or would you like to change any?
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If no gaps are found, skip this phase and proceed directly to writing the plan.
|
|
46
|
+
|
|
19
47
|
## Bite-Sized Task Granularity
|
|
20
48
|
|
|
21
49
|
**Each step is one action (2-5 minutes):**
|
|
@@ -96,11 +124,49 @@ git commit -m "feat: add specific feature"
|
|
|
96
124
|
|
|
97
125
|
## Execution Handoff
|
|
98
126
|
|
|
99
|
-
After saving the plan
|
|
127
|
+
After saving the plan, present the following workflow paths in the **system's configured language**.
|
|
128
|
+
|
|
129
|
+
Before presenting, check git status for uncommitted changes. If there are any, append the `⚠️` warning line.
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
Plan complete! Here's how to proceed:
|
|
133
|
+
|
|
134
|
+
--- Path A: With branch isolation (recommended for features/large changes) ---
|
|
135
|
+
|
|
136
|
+
1. /sd-worktree add <name> — Create a worktree branch
|
|
137
|
+
2. /sd-plan-dev — Execute tasks in parallel (includes TDD + review)
|
|
138
|
+
3. /sd-check — Verify (modified + dependents)
|
|
139
|
+
4. /sd-commit — Commit
|
|
140
|
+
5. /sd-worktree merge — Merge back to main
|
|
141
|
+
6. /sd-worktree clean — Remove worktree
|
|
142
|
+
|
|
143
|
+
--- Path B: Direct on current branch (quick fixes/small changes) ---
|
|
144
|
+
|
|
145
|
+
1. /sd-plan-dev — Execute tasks in parallel (includes TDD + review)
|
|
146
|
+
2. /sd-check — Verify (modified + dependents)
|
|
147
|
+
3. /sd-commit — Commit
|
|
148
|
+
|
|
149
|
+
You can start from any step or skip steps as needed.
|
|
150
|
+
|
|
151
|
+
💡 "Path A: yolo" or "Path B: yolo" to auto-run all steps
|
|
152
|
+
|
|
153
|
+
⚠️ You have uncommitted changes. To use Path A, run `/sd-commit all` first.
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
- The `⚠️` line is only shown when uncommitted changes exist. Omit it when working tree is clean.
|
|
157
|
+
- **Recommend one** based on the plan's scope:
|
|
158
|
+
- Path A: new features, multi-file changes, architectural changes
|
|
159
|
+
- Path B: small bug fixes, single-file changes, minor adjustments
|
|
160
|
+
- Briefly explain why (1 sentence)
|
|
161
|
+
- Do NOT auto-proceed. Wait for user's choice.
|
|
162
|
+
|
|
163
|
+
**Yolo mode:** If the user responds with "Path A: yolo" or "Path B: yolo" (or similar intent like "A yolo", "B 자동"), execute all steps of the chosen path sequentially without stopping between steps.
|
|
100
164
|
|
|
101
|
-
-
|
|
102
|
-
|
|
103
|
-
|
|
165
|
+
**Yolo sd-check — include dependents:** NEVER check only modified packages. Also check all packages that depend on them:
|
|
166
|
+
1. Identify modified packages from `git diff --name-only`
|
|
167
|
+
2. Trace reverse dependencies (packages that import from modified packages) using `package.json` or project dependency graph
|
|
168
|
+
3. Include integration/e2e tests that cover the modified packages
|
|
169
|
+
4. Run `/sd-check` with all affected paths, or `/sd-check` without path (whole project) when changes are widespread
|
|
104
170
|
|
|
105
171
|
- **REQUIRED SUB-SKILL:** Use sd-plan-dev
|
|
106
172
|
- Fresh fork per task + two-stage review (spec compliance → code quality)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sd-use
|
|
3
|
-
description:
|
|
3
|
+
description: You MUST invoke this for any user request that does not explicitly use a /sd-* slash command. Do not bypass by selecting other sd-* skills directly, even when the match seems obvious.
|
|
4
4
|
model: haiku
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -46,7 +46,7 @@ switch (cmd) {
|
|
|
46
46
|
const branch = getMainBranch();
|
|
47
47
|
console.log(`Creating worktree: .worktrees/${name} (from ${branch})`);
|
|
48
48
|
run(`git worktree add "${worktreePath}" -b "${name}"`);
|
|
49
|
-
console.log("Installing dependencies...")
|
|
49
|
+
console.log("Installing dependencies...");/
|
|
50
50
|
run("pnpm install", { cwd: worktreePath });
|
|
51
51
|
console.log(`\nReady: ${worktreePath}`);
|
|
52
52
|
break;
|
package/package.json
CHANGED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { readFileSync, existsSync } from "fs";
|
|
2
|
-
import { resolve } from "path";
|
|
3
|
-
|
|
4
|
-
const root = resolve(import.meta.dirname, "../../..");
|
|
5
|
-
const errors = [];
|
|
6
|
-
|
|
7
|
-
// 1. Root package.json version check
|
|
8
|
-
const pkgPath = resolve(root, "package.json");
|
|
9
|
-
if (!existsSync(pkgPath)) {
|
|
10
|
-
errors.push("package.json not found");
|
|
11
|
-
} else {
|
|
12
|
-
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
13
|
-
const major = parseInt(pkg.version?.split(".")[0], 10);
|
|
14
|
-
if (Number.isNaN(major) || major < 13) {
|
|
15
|
-
errors.push(`This skill requires simplysm v13+. Current: ${pkg.version}`);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// 3. Scripts check
|
|
19
|
-
if (!pkg.scripts?.typecheck) {
|
|
20
|
-
errors.push("'typecheck' script not defined in package.json");
|
|
21
|
-
}
|
|
22
|
-
if (!pkg.scripts?.lint) {
|
|
23
|
-
errors.push("'lint' script not defined in package.json");
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// 2. pnpm workspace files
|
|
28
|
-
for (const f of ["pnpm-workspace.yaml", "pnpm-lock.yaml"]) {
|
|
29
|
-
if (!existsSync(resolve(root, f))) {
|
|
30
|
-
errors.push(`${f} not found`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// 4. Vitest config
|
|
35
|
-
if (!existsSync(resolve(root, "vitest.config.ts"))) {
|
|
36
|
-
errors.push("vitest.config.ts not found");
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (errors.length > 0) {
|
|
40
|
-
console.log("FAIL");
|
|
41
|
-
for (const e of errors) console.log(`- ${e}`);
|
|
42
|
-
process.exit(1);
|
|
43
|
-
} else {
|
|
44
|
-
console.log("Environment OK");
|
|
45
|
-
}
|