@simplysm/sd-claude 13.0.62 → 13.0.64
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-claude-rules.md +40 -0
- package/claude/skills/sd-brainstorm/SKILL.md +65 -7
- package/claude/skills/sd-plan/SKILL.md +37 -87
- package/claude/skills/sd-use/SKILL.md +5 -4
- package/claude/skills/sd-worktree/sd-worktree.mjs +15 -2
- package/package.json +1 -1
- package/claude/rules/sd-language.md +0 -6
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Claude Code Rules
|
|
2
|
+
|
|
3
|
+
## Language
|
|
4
|
+
|
|
5
|
+
Respond in the **system's configured language** (set via Claude Code's language setting).
|
|
6
|
+
|
|
7
|
+
- Technical terms, code identifiers (variable names, function names, etc.), and library names should remain as-is
|
|
8
|
+
- Show English error messages and logs in their original form, but provide explanations in the system language
|
|
9
|
+
|
|
10
|
+
## Missing References
|
|
11
|
+
|
|
12
|
+
If a referenced file or document cannot be found, **stop immediately and ask the user for the correct path.**
|
|
13
|
+
|
|
14
|
+
- Do NOT skip or proceed on your own judgment.
|
|
15
|
+
- Responses like "I couldn't find the file, so I'll skip it" are strictly prohibited.
|
|
16
|
+
- Always confirm with the user before proceeding.
|
|
17
|
+
|
|
18
|
+
## Scope of Work
|
|
19
|
+
|
|
20
|
+
**Do only what is explicitly asked.** Never perform work that was not requested.
|
|
21
|
+
|
|
22
|
+
### Questions vs. Code Requests — CRITICAL
|
|
23
|
+
|
|
24
|
+
- **If the user asks a question** (e.g., "이건 왜 이래?", "이거 뭐야?", "어떻게 동작해?") → **answer with text only**. Do NOT edit, write, or create any files.
|
|
25
|
+
- **If the user discusses, explains, or shares opinions** → **respond with text only**. Do NOT touch any files.
|
|
26
|
+
- **Only edit/write/create files when the user explicitly requests code changes** (e.g., "수정해줘", "만들어줘", "변경해줘", "추가해줘", "고쳐줘").
|
|
27
|
+
- Reading files to answer a question is fine. **Modifying files to answer a question is prohibited.**
|
|
28
|
+
|
|
29
|
+
### General Rules
|
|
30
|
+
|
|
31
|
+
- When the user says "ask", "request", or "confirm" → **ask the user**. Do NOT decide or create it yourself.
|
|
32
|
+
- Do NOT add features, refactoring, improvements, or documentation beyond the requested scope.
|
|
33
|
+
- When in doubt, **ask first** before proceeding.
|
|
34
|
+
- Responses like "I'll create it myself" or "I'll add that as well" are strictly prohibited.
|
|
35
|
+
|
|
36
|
+
## Bug Workarounds
|
|
37
|
+
|
|
38
|
+
### AskUserQuestion UI Clipping
|
|
39
|
+
|
|
40
|
+
Before calling `AskUserQuestion`, output **2 blank lines** (`\n\n`) so the preceding text is not clipped in the UI.
|
|
@@ -15,21 +15,38 @@ Start by understanding the current project context, then ask questions one at a
|
|
|
15
15
|
## The Process
|
|
16
16
|
|
|
17
17
|
**Understanding the idea:**
|
|
18
|
-
|
|
19
18
|
- Check out the current project state first (files, docs, recent commits)
|
|
20
19
|
- Ask questions one at a time to refine the idea
|
|
21
20
|
- Prefer multiple choice questions when possible, but open-ended is fine too
|
|
22
21
|
- Only one question per message - if a topic needs more exploration, break it into multiple questions
|
|
23
22
|
- Focus on understanding: purpose, constraints, success criteria
|
|
24
23
|
|
|
25
|
-
**
|
|
24
|
+
**Gap review loop:**
|
|
25
|
+
|
|
26
|
+
When you think you've asked enough, **STOP and run a gap review before moving on.**
|
|
27
|
+
|
|
28
|
+
1. Silently check ALL of these categories for unanswered questions:
|
|
29
|
+
- **Scope**: What's in? What's explicitly out?
|
|
30
|
+
- **User flows**: All inputs, outputs, feedback, navigation
|
|
31
|
+
- **Edge cases**: Empty states, errors, limits, concurrency, undo
|
|
32
|
+
- **Data**: Shape, validation, persistence, migration, relationships
|
|
33
|
+
- **Integration**: How does this connect to existing code/systems?
|
|
34
|
+
- **Non-functional**: Performance, accessibility, security, i18n
|
|
35
|
+
- **Assumptions**: Anything you assumed but never confirmed
|
|
36
|
+
2. If ANY new question emerges → ask it, then **restart from step 1**
|
|
37
|
+
3. Only when zero questions remain across ALL categories → proceed to exploring approaches.
|
|
38
|
+
|
|
39
|
+
**Rules:**
|
|
40
|
+
- Each loop must seriously re-examine all categories, not just skim.
|
|
41
|
+
- Looping only once is suspicious — double-check.
|
|
42
|
+
- When in doubt, ask. One extra question costs less than a flawed design.
|
|
26
43
|
|
|
44
|
+
**Exploring approaches:**
|
|
27
45
|
- Propose 2-3 different approaches with trade-offs
|
|
28
46
|
- Present options conversationally with your recommendation and reasoning
|
|
29
47
|
- Lead with your recommended option and explain why
|
|
30
48
|
|
|
31
49
|
**Presenting the design:**
|
|
32
|
-
|
|
33
50
|
- Once you believe you understand what you're building, present the design
|
|
34
51
|
- Break it into sections of 200-300 words
|
|
35
52
|
- Ask after each section whether it looks right so far
|
|
@@ -39,15 +56,56 @@ Start by understanding the current project context, then ask questions one at a
|
|
|
39
56
|
## After the Design
|
|
40
57
|
|
|
41
58
|
**Documentation:**
|
|
42
|
-
|
|
43
59
|
- Write the validated design to `docs/plans/YYYY-MM-DD-<topic>-design.md`
|
|
44
60
|
- Commit the design document to git
|
|
45
61
|
|
|
46
|
-
**
|
|
62
|
+
**Next Steps Guide:**
|
|
63
|
+
|
|
64
|
+
Present the following two workflow paths so the user can see the full process and choose.
|
|
65
|
+
Display the guide in the **user's configured language** (follow the language settings from CLAUDE.md or system instructions).
|
|
66
|
+
|
|
67
|
+
Before presenting, check git status for uncommitted changes. If there are any uncommitted changes (staged, unstaged, or untracked files), append the warning line (shown below) at the end of the guide block.
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
Design complete! Here's how to proceed:
|
|
71
|
+
|
|
72
|
+
--- Path A: With branch isolation (recommended for features/large changes) ---
|
|
73
|
+
|
|
74
|
+
1. /sd-worktree add <name> — Create a worktree branch
|
|
75
|
+
2. /sd-plan — Break into detailed tasks
|
|
76
|
+
3. /sd-plan-dev — Execute tasks in parallel (includes TDD + review)
|
|
77
|
+
4. /sd-check — Verify (modified + dependents)
|
|
78
|
+
5. /sd-commit — Commit
|
|
79
|
+
6. /sd-worktree merge — Merge back to main
|
|
80
|
+
7. /sd-worktree clean — Remove worktree
|
|
81
|
+
|
|
82
|
+
--- Path B: Direct on current branch (quick fixes/small changes) ---
|
|
83
|
+
|
|
84
|
+
1. /sd-plan — Break into detailed tasks
|
|
85
|
+
2. /sd-plan-dev — Execute tasks in parallel (includes TDD + review)
|
|
86
|
+
3. /sd-check — Verify (modified + dependents)
|
|
87
|
+
4. /sd-commit — Commit
|
|
88
|
+
|
|
89
|
+
You can start from any step or skip steps as needed.
|
|
90
|
+
|
|
91
|
+
💡 "Path A: yolo" or "Path B: yolo" to auto-run all steps
|
|
92
|
+
|
|
93
|
+
⚠️ You have uncommitted changes. To use Path A, run `/sd-commit all` first.
|
|
94
|
+
```
|
|
47
95
|
|
|
48
|
-
|
|
96
|
+
- The last `⚠️` line is only shown when uncommitted changes exist. Omit it when working tree is clean.
|
|
49
97
|
|
|
50
|
-
|
|
98
|
+
- After presenting both paths, **recommend one** based on the design's scope:
|
|
99
|
+
- Path A recommended: new features, multi-file changes, architectural changes, anything that benefits from isolation
|
|
100
|
+
- Path B recommended: small bug fixes, single-file changes, config tweaks, minor adjustments
|
|
101
|
+
- Briefly explain why (1 sentence)
|
|
102
|
+
- Do NOT auto-proceed to any step. Present the overview with recommendation and wait for the user's choice.
|
|
103
|
+
- **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.
|
|
104
|
+
- **Yolo sd-check — include dependents**: NEVER check only modified packages. Also check all packages that depend on them:
|
|
105
|
+
1. Identify modified packages from `git diff --name-only`
|
|
106
|
+
2. Trace reverse dependencies (packages that import from modified packages) using `package.json` or project dependency graph
|
|
107
|
+
3. Include integration/e2e tests that cover the modified packages
|
|
108
|
+
4. Run `/sd-check` with all affected paths, or `/sd-check` without path (whole project) when changes are widespread
|
|
51
109
|
|
|
52
110
|
## Key Principles
|
|
53
111
|
|
|
@@ -4,153 +4,103 @@ 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
|
+
# Writing Plans
|
|
8
8
|
|
|
9
9
|
## Overview
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## The Process
|
|
16
|
-
|
|
17
|
-
**Exploring the codebase:**
|
|
18
|
-
|
|
19
|
-
- Read the design doc, then explore relevant files, patterns, dependencies
|
|
20
|
-
- Ask questions one at a time as they arise during planning, with your recommendation
|
|
21
|
-
- Don't batch questions upfront — real questions emerge while deep in the details
|
|
22
|
-
|
|
23
|
-
**Ask about anything you're not 100% confident about.** Examples:
|
|
24
|
-
|
|
25
|
-
- Dependency choices (add library vs implement directly)
|
|
26
|
-
- Conflicts with existing codebase patterns
|
|
27
|
-
- Implementation choices the design didn't specify
|
|
28
|
-
- Ambiguous behavior or edge cases
|
|
29
|
-
- Migration concerns (breaking changes, compatibility)
|
|
30
|
-
- If in doubt, ask. The cost of asking is low; the cost of a wrong assumption is high.
|
|
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.
|
|
31
14
|
|
|
32
|
-
**
|
|
15
|
+
**Announce at start:** "I'm using the sd-plan skill to create the implementation plan."
|
|
33
16
|
|
|
34
|
-
|
|
35
|
-
- YAGNI decisions (not mentioned = don't add)
|
|
36
|
-
- Implementation details with only one reasonable option
|
|
17
|
+
**Save plans to:** `docs/plans/YYYY-MM-DD-<feature-name>.md`
|
|
37
18
|
|
|
38
|
-
|
|
19
|
+
## Bite-Sized Task Granularity
|
|
39
20
|
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
21
|
+
**Each step is one action (2-5 minutes):**
|
|
22
|
+
- "Write the failing test" - step
|
|
23
|
+
- "Run it to make sure it fails" - step
|
|
24
|
+
- "Implement the minimal code to make the test pass" - step
|
|
25
|
+
- "Run the tests and make sure they pass" - step
|
|
26
|
+
- "Commit" - step
|
|
43
27
|
|
|
44
|
-
## Plan Document
|
|
28
|
+
## Plan Document Header
|
|
45
29
|
|
|
46
|
-
**
|
|
30
|
+
**Every plan MUST start with this header:**
|
|
47
31
|
|
|
48
32
|
```markdown
|
|
49
33
|
# [Feature Name] Implementation Plan
|
|
50
34
|
|
|
51
35
|
> **For Claude:** REQUIRED SUB-SKILL: Use sd-plan-dev to implement this plan task-by-task.
|
|
52
36
|
|
|
53
|
-
**Goal:** [One sentence]
|
|
37
|
+
**Goal:** [One sentence describing what this builds]
|
|
54
38
|
|
|
55
|
-
**Architecture:** [2-3 sentences]
|
|
39
|
+
**Architecture:** [2-3 sentences about approach]
|
|
56
40
|
|
|
57
41
|
**Tech Stack:** [Key technologies/libraries]
|
|
58
42
|
|
|
59
43
|
---
|
|
60
44
|
```
|
|
61
45
|
|
|
62
|
-
|
|
46
|
+
## Task Structure
|
|
63
47
|
|
|
64
|
-
|
|
48
|
+
```markdown
|
|
65
49
|
### Task N: [Component Name]
|
|
66
50
|
|
|
67
51
|
**Files:**
|
|
68
|
-
|
|
69
52
|
- Create: `exact/path/to/file.ts`
|
|
70
53
|
- Modify: `exact/path/to/existing.ts:123-145`
|
|
71
|
-
- Test: `exact/path/to/
|
|
54
|
+
- Test: `exact/path/to/tests/file.spec.ts`
|
|
72
55
|
|
|
73
56
|
**Step 1: Write the failing test**
|
|
74
57
|
|
|
75
58
|
```typescript
|
|
76
59
|
test("specific behavior", () => {
|
|
77
|
-
const result =
|
|
60
|
+
const result = functionUnderTest(input);
|
|
78
61
|
expect(result).toBe(expected);
|
|
79
62
|
});
|
|
80
63
|
```
|
|
81
64
|
|
|
82
65
|
**Step 2: Run test to verify it fails**
|
|
83
66
|
|
|
84
|
-
Run: `
|
|
85
|
-
Expected: FAIL with "
|
|
67
|
+
Run: `pnpm vitest exact/path/to/tests/file.spec.ts --run`
|
|
68
|
+
Expected: FAIL with "functionUnderTest is not defined"
|
|
86
69
|
|
|
87
70
|
**Step 3: Write minimal implementation**
|
|
88
71
|
|
|
89
72
|
```typescript
|
|
90
|
-
|
|
73
|
+
function functionUnderTest(input: InputType): OutputType {
|
|
91
74
|
return expected;
|
|
92
75
|
}
|
|
93
76
|
```
|
|
94
77
|
|
|
95
78
|
**Step 4: Run test to verify it passes**
|
|
96
79
|
|
|
97
|
-
Run: `
|
|
80
|
+
Run: `pnpm vitest exact/path/to/tests/file.spec.ts --run`
|
|
98
81
|
Expected: PASS
|
|
99
82
|
|
|
100
83
|
**Step 5: Commit**
|
|
101
84
|
|
|
102
85
|
```bash
|
|
103
|
-
git add exact/path/to/file.ts exact/path/to/
|
|
86
|
+
git add exact/path/to/tests/file.spec.ts exact/path/to/file.ts
|
|
104
87
|
git commit -m "feat: add specific feature"
|
|
105
88
|
```
|
|
106
|
-
````
|
|
107
|
-
|
|
108
|
-
## After the Plan
|
|
109
|
-
|
|
110
|
-
Save the plan, then present workflow paths. Check git status first. Display in the **system's configured language**:
|
|
111
|
-
|
|
112
|
-
```
|
|
113
|
-
Plan complete! Here's how to proceed:
|
|
114
|
-
|
|
115
|
-
--- Path A: With branch isolation (recommended for features/large changes) ---
|
|
116
|
-
|
|
117
|
-
1. /sd-worktree add <name> — Create a worktree branch
|
|
118
|
-
2. /sd-plan-dev — Execute tasks in parallel (includes TDD + review)
|
|
119
|
-
3. /sd-check — Verify (modified + dependents)
|
|
120
|
-
4. /sd-commit — Commit
|
|
121
|
-
5. /sd-worktree merge — Merge back to main
|
|
122
|
-
6. /sd-worktree clean — Remove worktree
|
|
123
|
-
|
|
124
|
-
--- Path B: Direct on current branch (quick fixes/small changes) ---
|
|
125
|
-
|
|
126
|
-
1. /sd-plan-dev — Execute tasks in parallel (includes TDD + review)
|
|
127
|
-
2. /sd-check — Verify (modified + dependents)
|
|
128
|
-
3. /sd-commit — Commit
|
|
129
|
-
|
|
130
|
-
You can start from any step or skip steps as needed.
|
|
131
|
-
|
|
132
|
-
💡 "Path A: yolo" or "Path B: yolo" to auto-run all steps
|
|
133
|
-
|
|
134
|
-
⚠️ You have uncommitted changes. To use Path A, run `/sd-commit all` first.
|
|
135
89
|
```
|
|
136
90
|
|
|
137
|
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
|
|
141
|
-
|
|
91
|
+
## Remember
|
|
92
|
+
- Exact file paths always
|
|
93
|
+
- Complete code in plan (not "add validation")
|
|
94
|
+
- Exact commands with expected output
|
|
95
|
+
- DRY, YAGNI, TDD, frequent commits
|
|
142
96
|
|
|
143
|
-
|
|
144
|
-
- NEVER execute underlying commands (git, npm, etc.) directly, even if you know what the skill does internally
|
|
145
|
-
- If a step fails, stop and report — do not attempt manual recovery
|
|
97
|
+
## Execution Handoff
|
|
146
98
|
|
|
147
|
-
|
|
99
|
+
After saving the plan:
|
|
148
100
|
|
|
149
|
-
|
|
101
|
+
- If in **yolo mode** (user chose "yolo" from sd-brainstorm): Immediately proceed to sd-plan-dev without asking. No confirmation needed.
|
|
102
|
+
- Otherwise: Display this message **in the system's configured language** (detect from the language setting and translate accordingly):
|
|
103
|
+
**"Plan complete and saved to `docs/plans/<filename>.md`. Ready to execute with sd-plan-dev?"**
|
|
150
104
|
|
|
151
|
-
- **
|
|
152
|
-
-
|
|
153
|
-
- **Bite-sized steps** — Each step is one action (2-5 minutes)
|
|
154
|
-
- **TDD always** — Test first, implement second, commit third
|
|
155
|
-
- **DRY, YAGNI** — No unnecessary features, no repetition
|
|
156
|
-
- **REQUIRED SUB-SKILL:** sd-plan-dev (fresh fork per task + two-stage review)
|
|
105
|
+
- **REQUIRED SUB-SKILL:** Use sd-plan-dev
|
|
106
|
+
- Fresh fork per task + two-stage review (spec compliance → code quality)
|
|
@@ -27,7 +27,7 @@ Analyze user request from ARGUMENTS, select the best matching sd-\* skill or age
|
|
|
27
27
|
| `sd-plan` | Multi-step task with spec/requirements — **planning before code** |
|
|
28
28
|
| `sd-plan-dev` | Already have a plan — **executing implementation plan** |
|
|
29
29
|
| `sd-explore` | Deep codebase analysis — tracing execution paths, architecture, dependencies |
|
|
30
|
-
| `sd-review` |
|
|
30
|
+
| `sd-review` | **Large-scale** comprehensive review of an entire package or broad path — use only when user explicitly requests full/deep/comprehensive review |
|
|
31
31
|
| `sd-check` | Verify code — typecheck, lint, tests |
|
|
32
32
|
| `sd-commit` | Create a git commit |
|
|
33
33
|
| `sd-readme` | Update a package README.md |
|
|
@@ -40,15 +40,16 @@ Analyze user request from ARGUMENTS, select the best matching sd-\* skill or age
|
|
|
40
40
|
|
|
41
41
|
| Agent | When to select |
|
|
42
42
|
| -------------------- | ----------------------------------------------------------------- |
|
|
43
|
-
| `sd-code-reviewer` |
|
|
43
|
+
| `sd-code-reviewer` | Quick/focused review — specific files, recent changes, bugs, security, quality issues. **Default choice for most review requests** |
|
|
44
44
|
| `sd-code-simplifier` | Simplify, clean up, improve code readability |
|
|
45
45
|
| `sd-api-reviewer` | Review library public API for DX quality |
|
|
46
46
|
|
|
47
47
|
## Selection Rules
|
|
48
48
|
|
|
49
49
|
1. Select **exactly one** skill or agent — the most specific match wins
|
|
50
|
-
2.
|
|
51
|
-
3.
|
|
50
|
+
2. **Review requests**: Default to `sd-code-reviewer` agent. Only use `sd-review` skill when the user explicitly asks for a full/comprehensive/deep review of an entire package
|
|
51
|
+
3. If nothing matches, use **default LLM behavior** and handle the request directly
|
|
52
|
+
4. Pass ARGUMENTS through as the skill/agent's input
|
|
52
53
|
|
|
53
54
|
## Report Format
|
|
54
55
|
|
|
@@ -18,6 +18,18 @@ const mainWorktree = getOutput("git worktree list --porcelain")
|
|
|
18
18
|
.split("\n")[0]
|
|
19
19
|
.replace("worktree ", "");
|
|
20
20
|
|
|
21
|
+
function detectPackageManager() {
|
|
22
|
+
if (existsSync(resolve(mainWorktree, "pnpm-lock.yaml"))) return "pnpm";
|
|
23
|
+
if (existsSync(resolve(mainWorktree, "yarn.lock"))) return "yarn";
|
|
24
|
+
if (existsSync(resolve(mainWorktree, "package-lock.json"))) return "npm";
|
|
25
|
+
if (
|
|
26
|
+
existsSync(resolve(mainWorktree, "bun.lockb")) ||
|
|
27
|
+
existsSync(resolve(mainWorktree, "bun.lock"))
|
|
28
|
+
)
|
|
29
|
+
return "bun";
|
|
30
|
+
return "npm";
|
|
31
|
+
}
|
|
32
|
+
|
|
21
33
|
function detectWorktreeName() {
|
|
22
34
|
const cwd = process.cwd();
|
|
23
35
|
const worktreesDir = resolve(mainWorktree, ".worktrees");
|
|
@@ -46,8 +58,9 @@ switch (cmd) {
|
|
|
46
58
|
const branch = getMainBranch();
|
|
47
59
|
console.log(`Creating worktree: .worktrees/${name} (from ${branch})`);
|
|
48
60
|
run(`git worktree add "${worktreePath}" -b "${name}"`);
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
const pm = detectPackageManager();
|
|
62
|
+
console.log(`Installing dependencies (${pm})...`);
|
|
63
|
+
run(`${pm} install`, { cwd: worktreePath });
|
|
51
64
|
console.log(`\nReady: ${worktreePath}`);
|
|
52
65
|
break;
|
|
53
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
# Language
|
|
2
|
-
|
|
3
|
-
Respond in the **system's configured language** (set via Claude Code's language setting).
|
|
4
|
-
|
|
5
|
-
- Technical terms, code identifiers (variable names, function names, etc.), and library names should remain as-is
|
|
6
|
-
- Show English error messages and logs in their original form, but provide explanations in the system language
|