@simplysm/sd-claude 13.0.51 → 13.0.53
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/hooks/sd-notify.py +17 -0
- package/claude/rules/sd-directories.md +3 -3
- package/claude/skills/sd-brainstorm/SKILL.md +2 -4
- package/claude/skills/sd-check/SKILL.md +5 -5
- package/claude/skills/sd-check/run-checks.mjs +7 -12
- package/claude/skills/sd-plan/SKILL.md +47 -72
- package/claude/skills/sd-plan-dev/SKILL.md +3 -5
- package/dist/commands/install.js +1 -1
- package/package.json +1 -1
- package/src/commands/install.ts +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import json, sys, os, subprocess
|
|
3
|
+
|
|
4
|
+
data = json.load(sys.stdin)
|
|
5
|
+
|
|
6
|
+
dir_name = os.path.basename(data.get("cwd", ""))
|
|
7
|
+
|
|
8
|
+
ps_cmd = (
|
|
9
|
+
"Add-Type -AssemblyName System.Windows.Forms; "
|
|
10
|
+
"$notify = New-Object System.Windows.Forms.NotifyIcon; "
|
|
11
|
+
"$notify.Icon = [System.Drawing.SystemIcons]::Information; "
|
|
12
|
+
"$notify.Visible = $true; "
|
|
13
|
+
f"$notify.ShowBalloonTip(3000, 'Claude Code', '[{dir_name}] 작업 완료', "
|
|
14
|
+
"[System.Windows.Forms.ToolTipIcon]::Info); "
|
|
15
|
+
"Start-Sleep -Milliseconds 3500"
|
|
16
|
+
)
|
|
17
|
+
subprocess.run(["powershell.exe", "-Command", ps_cmd])
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Directory Reference
|
|
2
2
|
|
|
3
3
|
- `.cache/`: Build cache (`eslint.cache`, `typecheck-{env}.tsbuildinfo`, `dts.tsbuildinfo`). Reset: delete `.cache/`
|
|
4
|
-
- `.playwright
|
|
5
|
-
- Screenshots/snapshots must always be saved to the `.playwright
|
|
6
|
-
- When calling `browser_take_screenshot`, always prefix filename with `.playwright
|
|
4
|
+
- `.tmp/playwright/`: Playwright MCP output directory
|
|
5
|
+
- Screenshots/snapshots must always be saved to the `.tmp/playwright/` directory
|
|
6
|
+
- When calling `browser_take_screenshot`, always prefix filename with `.tmp/playwright/` (e.g., `.tmp/playwright/screenshot.png`)
|
|
7
7
|
- `PLAYWRIGHT_OUTPUT_DIR` only applies to auto-generated filenames; explicitly specified filenames are resolved relative to cwd
|
|
@@ -39,13 +39,11 @@ 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
|
-
**
|
|
43
|
-
|
|
44
|
-
Display in the **system's configured language**:
|
|
42
|
+
**STOP here.** Report the result to the user in the **system's configured language**:
|
|
45
43
|
|
|
46
44
|
**"Design complete and saved to `docs/plans/<filename>.md`. Next step: `/sd-plan` to create the implementation plan."**
|
|
47
45
|
|
|
48
|
-
Do NOT auto-proceed. Wait for the user's explicit instruction.
|
|
46
|
+
Do NOT invoke `/sd-plan` or any other skill. Do NOT auto-proceed. Wait for the user's explicit instruction.
|
|
49
47
|
|
|
50
48
|
## Key Principles
|
|
51
49
|
|
|
@@ -62,17 +62,17 @@ Replace `[path]` with user's argument, or OMIT if no argument (defaults to full
|
|
|
62
62
|
**Output format:**
|
|
63
63
|
```
|
|
64
64
|
====== TYPECHECK: PASS ======
|
|
65
|
-
[last few lines]
|
|
66
65
|
|
|
67
|
-
====== LINT: FAIL ======
|
|
68
|
-
[full error output]
|
|
66
|
+
====== LINT: FAIL → .tmp/sd-check/lint.log ======
|
|
69
67
|
|
|
70
68
|
====== TEST: PASS (47 tests) ======
|
|
71
|
-
[last few lines]
|
|
72
69
|
|
|
73
70
|
====== SUMMARY: 1/3 FAILED (lint) ======
|
|
74
71
|
```
|
|
75
72
|
|
|
73
|
+
- Failed checks write full output to `.tmp/sd-check/{name}.log`
|
|
74
|
+
- Use the **Read tool** to read log files for error details
|
|
75
|
+
|
|
76
76
|
- **ENV-CHECK FAIL**: Environment prerequisites missing. Report to user and STOP.
|
|
77
77
|
- **SUMMARY: ALL PASSED**: Complete (see Completion Criteria).
|
|
78
78
|
- **SUMMARY: N/3 FAILED**: Proceed to Step 2.
|
|
@@ -82,7 +82,7 @@ Replace `[path]` with user's argument, or OMIT if no argument (defaults to full
|
|
|
82
82
|
1. **Analyze by priority:** Typecheck → Lint → Test
|
|
83
83
|
- Typecheck errors may cause lint/test errors (cascade)
|
|
84
84
|
|
|
85
|
-
2. **Read failing files** to identify root cause
|
|
85
|
+
2. **Read log files** (`.tmp/sd-check/{name}.log`) to see full error output, then **read failing source files** to identify root cause
|
|
86
86
|
|
|
87
87
|
3. **Fix with Edit:**
|
|
88
88
|
- **Typecheck:** Fix type issues
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readFileSync, existsSync } from "fs";
|
|
1
|
+
import { readFileSync, existsSync, mkdirSync, writeFileSync } from "fs";
|
|
2
2
|
import { resolve } from "path";
|
|
3
3
|
import { spawn } from "child_process";
|
|
4
4
|
|
|
@@ -48,7 +48,7 @@ if (errors.length > 0) {
|
|
|
48
48
|
// Phase 2: Run 3 checks in parallel
|
|
49
49
|
// ══════════════════════════════════════════
|
|
50
50
|
|
|
51
|
-
const
|
|
51
|
+
const logDir = resolve(root, ".tmp/sd-check");
|
|
52
52
|
|
|
53
53
|
function runCommand(name, cmd, args) {
|
|
54
54
|
return new Promise((res) => {
|
|
@@ -69,12 +69,6 @@ function runCommand(name, cmd, args) {
|
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
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
72
|
function extractTestCount(output) {
|
|
79
73
|
const match =
|
|
80
74
|
output.match(/(\d+)\s+tests?\s+passed/i) ??
|
|
@@ -96,6 +90,7 @@ const results = await Promise.all(checks.map((c) => runCommand(c.name, c.cmd, c.
|
|
|
96
90
|
// ══════════════════════════════════════════
|
|
97
91
|
|
|
98
92
|
const failed = [];
|
|
93
|
+
mkdirSync(logDir, { recursive: true });
|
|
99
94
|
|
|
100
95
|
for (const r of results) {
|
|
101
96
|
const passed = r.code === 0;
|
|
@@ -106,12 +101,12 @@ for (const r of results) {
|
|
|
106
101
|
if (count) label = `PASS (${count} tests)`;
|
|
107
102
|
}
|
|
108
103
|
|
|
109
|
-
console.log(`\n${"=".repeat(6)} ${r.name}: ${label} ${"=".repeat(6)}`);
|
|
110
|
-
|
|
111
104
|
if (passed) {
|
|
112
|
-
console.log(
|
|
105
|
+
console.log(`\n${"=".repeat(6)} ${r.name}: ${label} ${"=".repeat(6)}`);
|
|
113
106
|
} else {
|
|
114
|
-
|
|
107
|
+
const logFile = resolve(logDir, `${r.name.toLowerCase()}.log`);
|
|
108
|
+
writeFileSync(logFile, r.output, "utf8");
|
|
109
|
+
console.log(`\n${"=".repeat(6)} ${r.name}: ${label} → ${logFile} ${"=".repeat(6)}`);
|
|
115
110
|
failed.push(r.name.toLowerCase());
|
|
116
111
|
}
|
|
117
112
|
}
|
|
@@ -4,129 +4,102 @@ description: Use when you have a spec or requirements for a multi-step task, bef
|
|
|
4
4
|
model: opus
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# Turning Designs Into Implementation Plans
|
|
8
8
|
|
|
9
9
|
## Overview
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
|
|
14
|
-
|
|
15
|
-
**Announce at start:** "I'm using the sd-plan skill to create the implementation plan."
|
|
11
|
+
Turn a design doc into a step-by-step implementation plan through codebase exploration. Write bite-sized tasks assuming the implementing engineer has zero context — exact file paths, complete code, precise commands.
|
|
16
12
|
|
|
17
13
|
**Save plans to:** `docs/plans/YYYY-MM-DD-<feature-name>.md`
|
|
18
14
|
|
|
19
|
-
##
|
|
15
|
+
## The Process
|
|
20
16
|
|
|
21
|
-
**
|
|
17
|
+
**Exploring the codebase:**
|
|
18
|
+
- Read the design doc, then explore relevant files, patterns, dependencies
|
|
19
|
+
- Ask questions one at a time as they arise during planning, with your recommendation
|
|
20
|
+
- Don't batch questions upfront — real questions emerge while deep in the details
|
|
22
21
|
|
|
23
|
-
**Ask
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
22
|
+
**Ask about:**
|
|
23
|
+
- Conflicts with existing codebase patterns discovered while exploring
|
|
24
|
+
- Implementation choices the design didn't specify (which pattern, which abstraction level)
|
|
25
|
+
- Ambiguous behavior uncovered while designing tests or file structure
|
|
27
26
|
|
|
28
27
|
**Don't ask — just decide:**
|
|
29
28
|
- Internal details covered by project conventions (file naming, export patterns)
|
|
30
|
-
-
|
|
29
|
+
- YAGNI decisions (not mentioned = don't add)
|
|
31
30
|
- Implementation details with only one reasonable option
|
|
32
31
|
|
|
33
|
-
**
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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.
|
|
32
|
+
**Writing the plan:**
|
|
33
|
+
- Break into independent tasks
|
|
34
|
+
- Include exact file paths, complete code, exact commands with expected output
|
|
35
|
+
- Never write "add validation" — write the actual validation code
|
|
46
36
|
|
|
47
|
-
##
|
|
37
|
+
## Plan Document Format
|
|
48
38
|
|
|
49
|
-
**
|
|
50
|
-
- "Write the failing test" - step
|
|
51
|
-
- "Run it to make sure it fails" - step
|
|
52
|
-
- "Implement the minimal code to make the test pass" - step
|
|
53
|
-
- "Run the tests and make sure they pass" - step
|
|
54
|
-
- "Commit" - step
|
|
55
|
-
|
|
56
|
-
## Plan Document Header
|
|
57
|
-
|
|
58
|
-
**Every plan MUST start with this header:**
|
|
39
|
+
**Header:**
|
|
59
40
|
|
|
60
41
|
```markdown
|
|
61
42
|
# [Feature Name] Implementation Plan
|
|
62
43
|
|
|
63
44
|
> **For Claude:** REQUIRED SUB-SKILL: Use sd-plan-dev to implement this plan task-by-task.
|
|
64
45
|
|
|
65
|
-
**Goal:** [One sentence
|
|
46
|
+
**Goal:** [One sentence]
|
|
66
47
|
|
|
67
|
-
**Architecture:** [2-3 sentences
|
|
48
|
+
**Architecture:** [2-3 sentences]
|
|
68
49
|
|
|
69
50
|
**Tech Stack:** [Key technologies/libraries]
|
|
70
51
|
|
|
71
52
|
---
|
|
72
53
|
```
|
|
73
54
|
|
|
74
|
-
|
|
55
|
+
**Each task (TDD steps):**
|
|
75
56
|
|
|
76
|
-
|
|
57
|
+
````markdown
|
|
77
58
|
### Task N: [Component Name]
|
|
78
59
|
|
|
79
60
|
**Files:**
|
|
80
61
|
- Create: `exact/path/to/file.ts`
|
|
81
62
|
- Modify: `exact/path/to/existing.ts:123-145`
|
|
82
|
-
- Test: `exact/path/to/
|
|
63
|
+
- Test: `exact/path/to/test.spec.ts`
|
|
83
64
|
|
|
84
65
|
**Step 1: Write the failing test**
|
|
85
66
|
|
|
86
67
|
```typescript
|
|
87
68
|
test("specific behavior", () => {
|
|
88
|
-
const result =
|
|
69
|
+
const result = fn(input);
|
|
89
70
|
expect(result).toBe(expected);
|
|
90
71
|
});
|
|
91
72
|
```
|
|
92
73
|
|
|
93
74
|
**Step 2: Run test to verify it fails**
|
|
94
75
|
|
|
95
|
-
Run: `pnpm vitest exact/path/to/
|
|
96
|
-
Expected: FAIL with "
|
|
76
|
+
Run: `pnpm vitest exact/path/to/test.spec.ts --project=node`
|
|
77
|
+
Expected: FAIL with "fn is not defined"
|
|
97
78
|
|
|
98
79
|
**Step 3: Write minimal implementation**
|
|
99
80
|
|
|
100
81
|
```typescript
|
|
101
|
-
function
|
|
82
|
+
export function fn(input: string): string {
|
|
102
83
|
return expected;
|
|
103
84
|
}
|
|
104
85
|
```
|
|
105
86
|
|
|
106
87
|
**Step 4: Run test to verify it passes**
|
|
107
88
|
|
|
108
|
-
Run: `pnpm vitest exact/path/to/
|
|
89
|
+
Run: `pnpm vitest exact/path/to/test.spec.ts --project=node`
|
|
109
90
|
Expected: PASS
|
|
110
91
|
|
|
111
92
|
**Step 5: Commit**
|
|
112
93
|
|
|
113
94
|
```bash
|
|
114
|
-
git add exact/path/to/
|
|
95
|
+
git add exact/path/to/file.ts exact/path/to/test.spec.ts
|
|
115
96
|
git commit -m "feat: add specific feature"
|
|
116
97
|
```
|
|
117
|
-
|
|
98
|
+
````
|
|
118
99
|
|
|
119
|
-
##
|
|
120
|
-
- Exact file paths always
|
|
121
|
-
- Complete code in plan (not "add validation")
|
|
122
|
-
- Exact commands with expected output
|
|
123
|
-
- DRY, YAGNI, TDD, frequent commits
|
|
100
|
+
## After the Plan
|
|
124
101
|
|
|
125
|
-
|
|
126
|
-
|
|
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.
|
|
102
|
+
Save the plan, then present workflow paths. Check git status first. Display in the **system's configured language**:
|
|
130
103
|
|
|
131
104
|
```
|
|
132
105
|
Plan complete! Here's how to proceed:
|
|
@@ -153,20 +126,22 @@ You can start from any step or skip steps as needed.
|
|
|
153
126
|
⚠️ You have uncommitted changes. To use Path A, run `/sd-commit all` first.
|
|
154
127
|
```
|
|
155
128
|
|
|
156
|
-
- The `⚠️` line
|
|
157
|
-
- **Recommend one** based on
|
|
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)
|
|
129
|
+
- The `⚠️` line only when uncommitted changes exist
|
|
130
|
+
- **Recommend one** based on scope (1 sentence why)
|
|
161
131
|
- Do NOT auto-proceed. Wait for user's choice.
|
|
162
132
|
|
|
163
|
-
**Yolo mode:**
|
|
133
|
+
**Yolo mode:** Execute all steps sequentially.
|
|
134
|
+
- Each `/sd-*` step MUST be invoked via the Skill tool
|
|
135
|
+
- NEVER execute underlying commands (git, pnpm, etc.) directly, even if you know what the skill does internally
|
|
136
|
+
- If a step fails, stop and report — do not attempt manual recovery
|
|
137
|
+
|
|
138
|
+
**Yolo sd-check:** NEVER check only modified packages. Trace reverse dependencies and include all affected paths.
|
|
164
139
|
|
|
165
|
-
|
|
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
|
|
140
|
+
## Key Principles
|
|
170
141
|
|
|
171
|
-
- **
|
|
172
|
-
-
|
|
142
|
+
- **One question at a time** — Ask inline during planning, not batched upfront
|
|
143
|
+
- **Exact everything** — File paths, complete code, commands with expected output
|
|
144
|
+
- **Bite-sized steps** — Each step is one action (2-5 minutes)
|
|
145
|
+
- **TDD always** — Test first, implement second, commit third
|
|
146
|
+
- **DRY, YAGNI** — No unnecessary features, no repetition
|
|
147
|
+
- **REQUIRED SUB-SKILL:** sd-plan-dev (fresh fork per task + two-stage review)
|
|
@@ -33,6 +33,8 @@ All execution uses `Task(general-purpose)` for parallel execution.
|
|
|
33
33
|
|
|
34
34
|
Independent tasks run as **parallel Task calls in a single message**. Within each task agent, spec and quality reviews also run as **parallel sub-Task calls**.
|
|
35
35
|
|
|
36
|
+
**CRITICAL: Do NOT use `run_in_background: true`** — achieve parallelism by making multiple Task calls in a single message (foreground parallel). This ensures the orchestrator waits for all tasks to complete before proceeding to the next batch, and prevents Stop hooks from firing prematurely.
|
|
37
|
+
|
|
36
38
|
## The Process
|
|
37
39
|
|
|
38
40
|
```dot
|
|
@@ -257,6 +259,7 @@ This catches cross-task integration issues early — especially when the next ba
|
|
|
257
259
|
- Accept "close enough" on spec compliance
|
|
258
260
|
- Skip review loops (issue found → fix → re-review)
|
|
259
261
|
- Skip batch integration checks between batches
|
|
262
|
+
- Use `run_in_background: true` on Task calls (use foreground parallel instead)
|
|
260
263
|
|
|
261
264
|
**If task agent returns questions:**
|
|
262
265
|
- Answer clearly and completely
|
|
@@ -275,11 +278,6 @@ This catches cross-task integration issues early — especially when the next ba
|
|
|
275
278
|
- Escalate to user with specific error details before proceeding
|
|
276
279
|
- Do NOT re-launch on potentially partially-modified files without inspection
|
|
277
280
|
|
|
278
|
-
## After Completion
|
|
279
|
-
|
|
280
|
-
When all tasks and final review are done, if the current working directory is inside a worktree (`.worktrees/`), guide the user to:
|
|
281
|
-
- `/sd-worktree merge` — Merge the worktree branch back into main
|
|
282
|
-
|
|
283
281
|
## Integration
|
|
284
282
|
|
|
285
283
|
**Related skills:**
|
package/dist/commands/install.js
CHANGED
|
@@ -129,7 +129,7 @@ function setupMcpConfig(projectRoot) {
|
|
|
129
129
|
command: "node",
|
|
130
130
|
args: [sdClaudeBin, "npx", "@playwright/mcp@latest", "--headless"],
|
|
131
131
|
env: {
|
|
132
|
-
PLAYWRIGHT_OUTPUT_DIR: ".playwright
|
|
132
|
+
PLAYWRIGHT_OUTPUT_DIR: ".tmp/playwright"
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
135
|
changed = true;
|
package/package.json
CHANGED
package/src/commands/install.ts
CHANGED
|
@@ -189,7 +189,7 @@ function setupMcpConfig(projectRoot: string): void {
|
|
|
189
189
|
command: "node",
|
|
190
190
|
args: [sdClaudeBin, "npx", "@playwright/mcp@latest", "--headless"],
|
|
191
191
|
env: {
|
|
192
|
-
PLAYWRIGHT_OUTPUT_DIR: ".playwright
|
|
192
|
+
PLAYWRIGHT_OUTPUT_DIR: ".tmp/playwright",
|
|
193
193
|
},
|
|
194
194
|
};
|
|
195
195
|
changed = true;
|