claude-smith 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +1 -0
- package/README.md +1 -0
- package/bin/cli.mjs +4 -4
- package/hooks/plan-guard.mjs +12 -0
- package/package.json +1 -1
- package/templates/commands/smith-decompose.md +63 -0
package/README.ko.md
CHANGED
package/README.md
CHANGED
|
@@ -142,6 +142,7 @@ After installation, these commands are available in Claude Code:
|
|
|
142
142
|
| `/smith-report` | Detailed compliance report |
|
|
143
143
|
| `/smith-check` | Validate installation |
|
|
144
144
|
| `/smith-plan` | Generate decomposition plan template |
|
|
145
|
+
| `/smith-decompose` | Guided 5-step problem decomposition for complex tasks |
|
|
145
146
|
| `/smith-update` | Check for updates and upgrade |
|
|
146
147
|
|
|
147
148
|
## Commands
|
package/bin/cli.mjs
CHANGED
|
@@ -403,14 +403,14 @@ function check() {
|
|
|
403
403
|
|
|
404
404
|
// Check commands
|
|
405
405
|
const commandsDir = join(cwd, '.claude', 'commands');
|
|
406
|
-
const expectedCommands = ['smith.md', 'smith-report.md', 'smith-check.md', 'smith-plan.md'];
|
|
406
|
+
const expectedCommands = ['smith.md', 'smith-report.md', 'smith-check.md', 'smith-plan.md', 'smith-decompose.md'];
|
|
407
407
|
const missingCommands = expectedCommands.filter(c => !existsSync(join(commandsDir, c)));
|
|
408
|
-
results.commands = { installed:
|
|
408
|
+
results.commands = { installed: 5 - missingCommands.length, total: 5, missing: missingCommands };
|
|
409
409
|
|
|
410
410
|
if (!ciMode) {
|
|
411
411
|
console.log(missingCommands.length === 0
|
|
412
|
-
? `✅ Commands:
|
|
413
|
-
: `❌ Commands: ${
|
|
412
|
+
? `✅ Commands: 5/5 installed`
|
|
413
|
+
: `❌ Commands: ${5 - missingCommands.length}/5 (missing: ${missingCommands.join(', ')})`);
|
|
414
414
|
}
|
|
415
415
|
if (missingCommands.length > 0) results.ok = false;
|
|
416
416
|
|
package/hooks/plan-guard.mjs
CHANGED
|
@@ -88,6 +88,18 @@ const isOmc = isOmcAutoMode(process.cwd());
|
|
|
88
88
|
const warnAt = isOmc ? (config.warnAt || 5) * 2 : (config.warnAt || 5);
|
|
89
89
|
const blockAt = isOmc ? (config.blockAt || 10) * 2 : (config.blockAt || 10);
|
|
90
90
|
|
|
91
|
+
// Early suggestion on first code edit (gentle, non-blocking)
|
|
92
|
+
if (count === 1) {
|
|
93
|
+
notifyUser(config.notify, 'Plan Guard', 'warn', '첫 코드 편집 — 복잡한 작업이면 /smith-decompose 먼저');
|
|
94
|
+
const output = JSON.stringify({
|
|
95
|
+
hookSpecificOutput: {
|
|
96
|
+
hookEventName: "PreToolUse",
|
|
97
|
+
additionalContext: `🕵️ Smith > Plan Guard: First code file edit detected without a plan. If this is a complex or abstract task, consider running /smith-decompose first to break it down into verifiable units.\n💡 Simple task? Ignore this and continue. Complex task? Decompose first, implement second.`
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
process.stdout.write(output);
|
|
101
|
+
}
|
|
102
|
+
|
|
91
103
|
// Block if threshold reached
|
|
92
104
|
if (count >= blockAt) {
|
|
93
105
|
recordEvent(sessionId, 'plan-guard', 'block');
|
package/package.json
CHANGED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
Decompose a complex or abstract request into verifiable work units.
|
|
2
|
+
|
|
3
|
+
Follow this 5-step framework strictly. Do NOT skip steps or jump to implementation.
|
|
4
|
+
|
|
5
|
+
## Step 1: Essence Extraction
|
|
6
|
+
|
|
7
|
+
Ask yourself: **"What is the user actually trying to achieve?"**
|
|
8
|
+
|
|
9
|
+
- Strip away implementation details and restate the core problem in one sentence
|
|
10
|
+
- Identify the success criteria: "How will we know this is done?"
|
|
11
|
+
- Output: `Core Problem: ...` and `Success Criteria: ...`
|
|
12
|
+
|
|
13
|
+
## Step 2: Uncertainty Map
|
|
14
|
+
|
|
15
|
+
List what you DON'T know. Be honest about assumptions.
|
|
16
|
+
|
|
17
|
+
| What I Know | What I Assume | What I Don't Know |
|
|
18
|
+
|-------------|---------------|-------------------|
|
|
19
|
+
| (facts) | (guesses) | (unknowns) |
|
|
20
|
+
|
|
21
|
+
Every item in "Assume" and "Don't Know" is a candidate for a user question.
|
|
22
|
+
|
|
23
|
+
## Step 3: Clarifying Questions
|
|
24
|
+
|
|
25
|
+
Use the AskUserQuestion tool to ask 1-2 targeted questions based on Step 2.
|
|
26
|
+
|
|
27
|
+
Rules:
|
|
28
|
+
- Ask about the MOST impactful unknowns only (not everything)
|
|
29
|
+
- Provide 2-3 concrete options per question with trade-offs
|
|
30
|
+
- Include your recommendation
|
|
31
|
+
- WAIT for user answers before proceeding to Step 4
|
|
32
|
+
|
|
33
|
+
## Step 4: Unit Decomposition
|
|
34
|
+
|
|
35
|
+
Break the work into independently verifiable units:
|
|
36
|
+
|
|
37
|
+
For each unit:
|
|
38
|
+
- **Name**: Short descriptive name
|
|
39
|
+
- **Responsibility**: One sentence (if it needs two, split the unit)
|
|
40
|
+
- **Inputs/Outputs**: What it receives, what it produces
|
|
41
|
+
- **Verification**: Specific test or check that proves it works
|
|
42
|
+
- **Files**: Create/modify/test file paths
|
|
43
|
+
|
|
44
|
+
Quality checks:
|
|
45
|
+
- Each unit has exactly ONE responsibility
|
|
46
|
+
- Dependencies are unidirectional (no cycles)
|
|
47
|
+
- Removing any unit doesn't break the others
|
|
48
|
+
- Each unit can be verified in isolation
|
|
49
|
+
|
|
50
|
+
## Step 5: Plan File Generation
|
|
51
|
+
|
|
52
|
+
Generate `docs/plans/YYYY-MM-DD-<topic>.md` (or `plan.md`) with:
|
|
53
|
+
|
|
54
|
+
1. Goal (from Step 1)
|
|
55
|
+
2. Decisions (from Step 3 answers)
|
|
56
|
+
3. Unit list with dependency graph
|
|
57
|
+
4. Implementation order (leaf-first: fewest dependencies first)
|
|
58
|
+
5. Per-unit tasks at 2-5 minute granularity
|
|
59
|
+
|
|
60
|
+
After generating the plan, report to the user:
|
|
61
|
+
- How many units and tasks were created
|
|
62
|
+
- Estimated implementation order
|
|
63
|
+
- Which unit to start with and why
|