claude-sdlc 1.0.4 → 1.0.5
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/lib/installer.js
CHANGED
|
@@ -85,6 +85,11 @@ function mergeSettings(existing, template) {
|
|
|
85
85
|
const hookTypes = ['PreToolUse', 'PostToolUse', 'Stop', 'PreCompact'];
|
|
86
86
|
const result = JSON.parse(JSON.stringify(existing));
|
|
87
87
|
|
|
88
|
+
// 合并 $schema
|
|
89
|
+
if (template.$schema && !result.$schema) {
|
|
90
|
+
result.$schema = template.$schema;
|
|
91
|
+
}
|
|
92
|
+
|
|
88
93
|
for (const type of hookTypes) {
|
|
89
94
|
const existingHooks = result.hooks?.[type] || [];
|
|
90
95
|
const newHooks = template.hooks?.[type] || [];
|
|
@@ -296,6 +301,9 @@ function uninstall(targetDir) {
|
|
|
296
301
|
if (settings.hooks) {
|
|
297
302
|
delete settings.hooks;
|
|
298
303
|
}
|
|
304
|
+
if (settings.$schema === 'https://json.schemastore.org/claude-code-settings.json') {
|
|
305
|
+
delete settings.$schema;
|
|
306
|
+
}
|
|
299
307
|
if (Object.keys(settings).length === 0) {
|
|
300
308
|
fs.unlinkSync(settingsPath);
|
|
301
309
|
removed.push('settings.json');
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/claude-code-settings.json",
|
|
2
3
|
"hooks": {
|
|
3
4
|
"PreToolUse": [
|
|
4
5
|
{
|
|
@@ -6,7 +7,7 @@
|
|
|
6
7
|
"hooks": [
|
|
7
8
|
{
|
|
8
9
|
"type": "command",
|
|
9
|
-
"command": "bash
|
|
10
|
+
"command": "bash \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/check-phase-write.sh"
|
|
10
11
|
}
|
|
11
12
|
]
|
|
12
13
|
},
|
|
@@ -15,7 +16,7 @@
|
|
|
15
16
|
"hooks": [
|
|
16
17
|
{
|
|
17
18
|
"type": "command",
|
|
18
|
-
"command": "bash
|
|
19
|
+
"command": "bash \"$CLAUDE_PROJECT_DIR\"/.claude/hooks/check-phase-test.sh"
|
|
19
20
|
}
|
|
20
21
|
]
|
|
21
22
|
}
|
|
@@ -25,8 +26,8 @@
|
|
|
25
26
|
"matcher": "Write|Edit",
|
|
26
27
|
"hooks": [
|
|
27
28
|
{
|
|
28
|
-
"type": "
|
|
29
|
-
"
|
|
29
|
+
"type": "command",
|
|
30
|
+
"command": "echo '{\"decision\":\"block\",\"reason\":\"SDLC: File modified. Use Edit to update CLAUDE.md: append the modified file path to modified_files (if not already listed) and update last_updated. This is mandatory, do not skip.\"}'"
|
|
30
31
|
}
|
|
31
32
|
]
|
|
32
33
|
}
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
"hooks": [
|
|
37
38
|
{
|
|
38
39
|
"type": "prompt",
|
|
39
|
-
"prompt": "You are evaluating whether Claude should stop working. Context: $ARGUMENTS\n\
|
|
40
|
+
"prompt": "You are evaluating whether Claude should stop working. Context: $ARGUMENTS\n\nIMPORTANT: First check if stop_hook_active is true in the context above. If it is true, respond immediately with {\"ok\": true} to prevent infinite loops.\n\nOtherwise, check the conversation transcript and determine:\n1. Is there an active SDLC phase (P1-P6) with remaining work?\n2. For P3/P4/P5 auto-drive phases: has the /review been executed and passed?\n3. Are there uncompleted PRD requirements?\n4. Has CLAUDE.md YAML state been updated after the latest changes?\n\nRespond with JSON: {\"ok\": true} if all tasks are complete and Claude can stop, or {\"ok\": false, \"reason\": \"SDLC self-check: [describe what still needs to be done, e.g. run /review, update CLAUDE.md YAML, continue to next phase, etc.]\"} if Claude should continue working.",
|
|
40
41
|
"timeout": 30
|
|
41
42
|
}
|
|
42
43
|
]
|