@simplysm/sd-claude 13.0.83 → 13.0.85

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.
@@ -1,126 +1,126 @@
1
1
  ---
2
2
  name: sd-readme
3
- description: "README 문서 생성", "sd-readme" 등을 요청할 때 사용.
3
+ description: Used when requesting "README documentation generation", "sd-readme", etc.
4
4
  ---
5
5
 
6
- # SD Readme — 모노레포 패키지 README 문서 생성기
6
+ # SD Readme — Monorepo Package README Documentation Generator
7
7
 
8
- 모노레포의 패키지에 대해 README.md 문서를 자동 생성한다. 패키지 규모에 따라 단일 README.md 또는 README.md + docs/*.md 구조로 점진적 공개(Progressive Disclosure) 원칙을 적용한다.
8
+ Automatically generates README.md documentation for each package in the monorepo. Applies Progressive Disclosure principles by choosing either a single README.md or a README.md + docs/*.md structure depending on the package size.
9
9
 
10
- ARGUMENTS: 패키지명 (선택). 지정하면 해당 패키지만 처리, 미지정 전체 패키지 병렬 처리.
10
+ ARGUMENTS: Package name (optional). If specified, only that package is processed; if omitted, all packages are processed in parallel.
11
11
 
12
- ## 작업 방법
12
+ ## Workflow
13
13
 
14
14
  ```mermaid
15
15
  flowchart TD
16
- A[인자 파싱] --> B{패키지명 지정?}
17
- B -- Yes --> C[README.md 생성]
18
- B -- No --> D[public 패키지 목록 수집]
19
- D --> E[패키지별 Agent 병렬 실행]
20
- E -- Agent --> C
16
+ A[Parse arguments] --> B{Package name specified?}
17
+ B -- Yes --> C[Generate README.md]
18
+ B -- No --> D[Collect public package list]
19
+ D --> E[Run Agent per package in parallel]
20
+ E -- Each Agent --> C
21
21
  ```
22
22
 
23
- ### A. 인자 파싱
23
+ ### A. Parse Arguments
24
24
 
25
- 스킬 호출 전달된 ARGUMENTS에서 패키지명을 추출하라.
25
+ Extract the package name from the ARGUMENTS passed when invoking the skill.
26
26
 
27
- - **패키지명 지정됨** → `packages/` 하위에서 해당 디렉토리를 찾아 바로 **C. README.md 생성**으로 이동.
28
- - **패키지명 미지정** → **D. public 패키지 목록 수집**으로 이동.
27
+ - **Package name specified** Find the corresponding directory under `packages/` and proceed directly to **C. Generate README.md**.
28
+ - **Package name not specified** Proceed to **D. Collect public package list**.
29
29
 
30
- ### C. README.md 생성
30
+ ### C. Generate README.md
31
31
 
32
- 대상 패키지 하나에 대해 아래를 수행하라.
32
+ Perform the following for a single target package.
33
33
 
34
- #### C-1. package.json 분석
34
+ #### C-1. Analyze package.json
35
35
 
36
- `packages/<name>/package.json`을 읽어라:
36
+ Read `packages/<name>/package.json`:
37
37
 
38
- 1. `name` `description`을 확인하라.
39
- 2. `"private": true`이면 해당 패키지를 **건너뛰어라**.
40
- 3. 패키지 진입점 소스코드가 무엇인지 확인하라.
38
+ 1. Check the `name` and `description` fields.
39
+ 2. If `"private": true`, **skip** this package.
40
+ 3. Identify the package entry point source code.
41
41
 
42
- #### C-2. 소스 코드 분석
42
+ #### C-2. Analyze Source Code
43
43
 
44
- 1. 진입점 파일 export를 재귀적으로 모두 읽어, 모든 public API를 수집하라.
45
- 2. JSDoc 주석이 있으면 항목의 설명으로 활용하라.
44
+ 1. Recursively read the entry point file and all exports to collect every public API.
45
+ 2. If JSDoc comments exist, use them as descriptions for each item.
46
46
 
47
- #### C-3. 문서 구조 결정 생성
47
+ #### C-3. Determine Document Structure and Generate
48
48
 
49
- 소스 코드의 규모와 논리적 카테고리 수를 보고, 아래 가지 적절한 구조를 **자율적으로** 판단하라:
49
+ Examine the source code size and the number of logical categories, then **autonomously** decide which of the two structures below is appropriate:
50
50
 
51
- - **단일 README.md**: 패키지가 작고 API가 적어 카테고리 분류가 불필요한 경우
52
- - **README.md + docs/*.md**: 패키지가 크거나 논리적 카테고리가 여러 개인 경우
51
+ - **Single README.md**: When the package is small, has few APIs, and category classification is unnecessary
52
+ - **README.md + docs/*.md**: When the package is large or has multiple logical categories
53
53
 
54
- 기존 README.md 또는 docs/가 있으면 기존 내용을 기반으로 **변경된 부분만 수정**하라. 기존 문서가 없으면 새로 생성하라.
55
- 구조가 변경되는 경우(BA) 불필요해진 `docs/` 디렉토리를 삭제하라.
56
- **영어**로 작성하라.
54
+ If an existing README.md or docs/ directory exists, **modify only the changed parts** based on the existing content. If no existing documentation exists, create it from scratch.
55
+ If the structure changes (B to A), delete the now-unnecessary `docs/` directory.
56
+ Write in **English**.
57
57
 
58
- #### C-4. package.json files 필드 관리
58
+ #### C-4. Manage package.json files Field
59
59
 
60
- `docs/` 디렉토리 생성·삭제 `package.json`의 `files` 배열을 함께 업데이트하라:
60
+ When creating or deleting the `docs/` directory, update the `files` array in `package.json` accordingly:
61
61
 
62
- - **구조 B 적용 시**: `files`에 `"docs"` 항목이 없으면 추가하라.
63
- - **구조 A 적용 시**: `files`에 `"docs"` 항목이 있으면 제거하라.
62
+ - **When applying Structure B**: If the `files` array does not contain `"docs"`, add it.
63
+ - **When applying Structure A**: If the `files` array contains `"docs"`, remove it.
64
64
 
65
65
  ---
66
66
 
67
- ##### 구조 A: 단일 README.md (소규모 패키지)
67
+ ##### Structure A: Single README.md (Small Packages)
68
68
 
69
- `packages/<name>/README.md` 파일을 생성하라:
69
+ Create the `packages/<name>/README.md` file:
70
70
 
71
71
  ```markdown
72
72
  # <package-name from package.json>
73
73
 
74
74
  > <description from package.json>
75
75
 
76
- <패키지의 주요 기능과 목적에 대한 상세 설명을 영어로 작성>
76
+ <Write a detailed description of the package's main features and purpose in English>
77
77
 
78
78
  ## API Reference
79
79
 
80
80
  ### <exportedName>
81
81
 
82
82
  ```typescript
83
- <export 시그니처 코드>
83
+ <export signature code>
84
84
  ```
85
85
 
86
- <해당 API에 대한 설명>
86
+ <Description of this API>
87
87
 
88
88
  ---
89
89
 
90
- (... 모든 exported 항목에 대해 반복 ...)
90
+ (... Repeat for all exported items ...)
91
91
 
92
92
  ## Usage Examples
93
93
 
94
94
  ```typescript
95
95
  import { ... } from "<package-name>";
96
96
 
97
- // 주요 사용 예제 코드
97
+ // Main usage example code
98
98
  ```
99
99
  ```
100
100
 
101
101
  ---
102
102
 
103
- ##### 구조 B: README.md + docs/*.md (대규모 패키지)
103
+ ##### Structure B: README.md + docs/*.md (Large Packages)
104
104
 
105
- **README.md** — `packages/<name>/README.md` 파일을 생성하라:
105
+ **README.md** — Create the `packages/<name>/README.md` file:
106
106
 
107
107
  ```markdown
108
108
  # <package-name from package.json>
109
109
 
110
110
  > <description from package.json>
111
111
 
112
- <패키지의 주요 기능과 목적에 대한 상세 설명을 영어로 작성>
112
+ <Write a detailed description of the package's main features and purpose in English>
113
113
 
114
114
  ## Documentation
115
115
 
116
116
  | Category | Description |
117
117
  |----------|-------------|
118
- | [<Category1>](docs/<category1>.md) | <카테고리 설명 주요 항목 나열> |
119
- | [<Category2>](docs/<category2>.md) | <카테고리 설명 주요 항목 나열> |
118
+ | [<Category1>](docs/<category1>.md) | <Category description and list of key items> |
119
+ | [<Category2>](docs/<category2>.md) | <Category description and list of key items> |
120
120
  | ... | ... |
121
121
  ```
122
122
 
123
- **docs/*.md** — 카테고리별로 `packages/<name>/docs/<category>.md` 파일을 생성하라:
123
+ **docs/*.md** — Create a `packages/<name>/docs/<category>.md` file for each category:
124
124
 
125
125
  ```markdown
126
126
  # <Category Name>
@@ -128,39 +128,39 @@ import { ... } from "<package-name>";
128
128
  ## <exportedName>
129
129
 
130
130
  ```typescript
131
- <export 시그니처 코드>
131
+ <export signature code>
132
132
  ```
133
133
 
134
- <해당 API에 대한 설명>
134
+ <Description of this API>
135
135
 
136
136
  ---
137
137
 
138
- (... 카테고리의 모든 exported 항목에 대해 반복 ...)
138
+ (... Repeat for all exported items in this category ...)
139
139
 
140
140
  ## Usage Examples
141
141
 
142
142
  ```typescript
143
143
  import { ... } from "<package-name>";
144
144
 
145
- // 카테고리의 주요 사용 예제 코드
145
+ // Main usage example code for this category
146
146
  ```
147
147
  ```
148
148
 
149
- 카테고리명과 분류는 소스 코드의 디렉토리 구조, 기능적 유사성 등을 고려하여 자율적으로 결정하라.
149
+ Determine category names and classifications autonomously, considering the source code directory structure, functional similarity, etc.
150
150
 
151
151
  ---
152
152
 
153
- ### D. public 패키지 목록 수집
153
+ ### D. Collect Public Package List
154
154
 
155
- `packages/*/package.json`을 Glob으로 탐색하되, `private: true`인 패키지는 제외하라.
155
+ Use Glob to search `packages/*/package.json`, excluding packages with `private: true`.
156
156
 
157
157
  ---
158
158
 
159
- ### E. 패키지별 Agent 병렬 실행
159
+ ### E. Run Agent Per Package in Parallel
160
160
 
161
- 남은 패키지에 대해 Agent 도구를 사용하여 **병렬로** 다음 프롬프트를 전달하라:
161
+ For each remaining package, use the Agent tool to pass the following prompt **in parallel**:
162
162
  ```
163
- /sd-readme <패키지명>
163
+ /sd-readme <package-name>
164
164
  ```
165
165
 
166
- 모든 subagent가 완료되면 종료.
166
+ Terminate once all subagents have completed.
@@ -1,65 +1,72 @@
1
1
  ---
2
2
  name: sd-review
3
- description: "버그 리뷰", "bug review", "sd-review", "코드 리뷰", "버그 찾기" 등을 요청할 사용. 지정한 경로의 코드에서 잠재적 버그를 분석한 계획 수립을 거쳐 수정한다.
3
+ description: Used when requesting "bug review", "sd-review", "code review", "find bugs", etc. Analyzes code at the specified path for potential bugs, then creates a plan and applies fixes.
4
4
  ---
5
5
 
6
- # SD Review — 잠재적 버그 탐지
6
+ # SD Review — Potential Bug Detection
7
7
 
8
- 지정한 경로의 코드를 읽고 잠재적 버그를 분석한 뒤, `/sd-plan` 프로세스로 계획을 수립하고 실행한다.
8
+ Reads the code at the specified path, analyzes it for potential bugs, then creates and executes a plan via the `/sd-plan` process.
9
9
 
10
- ARGUMENTS: 대상 경로 (필수). 레포 임의 경로를 지정한다.
10
+ ARGUMENTS: Target path (required). Specify any path within the repo.
11
11
 
12
12
  ---
13
13
 
14
- ## Step 1: 인자 확인
14
+ ## Step 1: Validate Arguments
15
15
 
16
- 1. ARGUMENTS에서 대상 경로를 추출하라.
17
- 2. 경로가 없으면 "대상 경로를 지정해 주세요. 예: `/sd-review packages/my-pkg`"라고 안내하고 종료하라.
16
+ 1. Extract the target path from ARGUMENTS.
17
+ 2. If no path is provided, display "Please specify a target path. Example: `/sd-review packages/my-pkg`" and stop.
18
18
 
19
- ## Step 2: 버그 분석 (수정 금지)
19
+ ## Step 2: Bug Analysis (Do Not Modify Code)
20
20
 
21
- 대상 경로의 코드를 읽고 아래 5가지 관점에서 잠재적 버그를 찾아라.
22
- 코드를 절대 수정하지 마라. 발견 항목 목록만 정리하여 출력하라.
21
+ Read the code at the target path and search for potential bugs from the following 5 perspectives.
22
+ Do not modify the code under any circumstances. Only compile and output a list of findings.
23
23
 
24
- **분석 관점:**
25
- 1. **로직/정확성**잘못된 조건, off-by-one, 잘못된 연산자, 의도와 다른 분기
26
- 2. **Null/Undefined 안전성**누락된 null 체크, optional chaining 미사용, 타입 단언 오용
27
- 3. **에러 처리**삼켜진 에러, 누락된 catch, 부적절한 에러 전파
28
- 4. **엣지 케이스** 배열/문자열, 경계값, 동시성/race condition, 누락된 await
29
- 5. **리소스 관리**닫히지 않은 연결, 이벤트 리스너 누수, 메모리 릭 패턴
24
+ **Analysis Perspectives:**
25
+ 1. **Logic/Correctness**Incorrect conditions, off-by-one errors, wrong operators, unintended branching
26
+ 2. **Null/Undefined Safety**Missing null checks, unused optional chaining, misuse of type assertions
27
+ 3. **Error Handling**Swallowed errors, missing catch blocks, improper error propagation
28
+ 4. **Edge Cases**Empty arrays/strings, boundary values, concurrency/race conditions, missing await
29
+ 5. **Resource Management**Unclosed connections, event listener leaks, memory leak patterns
30
30
 
31
- 항목은 다음 형식으로 작성하라:
31
+ Write each finding in the following format:
32
32
  ```
33
- - **파일경로:라인** — 문제 설명 — 개선 방안
33
+ - **filepath:line**
34
+ - Current code: (excerpt of the relevant code)
35
+ - Problem description:
36
+ - Suggested fix:
37
+ - Reasons to fix: Rationale for applying the fix
38
+ - Reasons not to fix: Rationale for keeping the current code
34
39
  ```
35
40
 
36
- 발견 항목이 없으면 "잠재적 버그가 발견되지 않았습니다."라고 안내하고 종료하라.
41
+ If no findings are discovered, display "No potential bugs were found." and stop.
37
42
 
38
- ## Step 3: sd-plan으로 계획 수립
43
+ ## Step 3: Create Plan via sd-plan
39
44
 
40
- Step 2에서 도출된 발견 항목 목록을 작업 설명으로 하여, Skill 도구로 `sd-plan`을 호출하라. args에 아래를 전달하라:
45
+ Using the list of findings from Step 2 as the task description, invoke `sd-plan` via the Skill tool. Pass the following as args:
41
46
 
42
47
  ```
43
- 아래는 **LLM이 분석하여 제안한** 잠재적 버그 수정안이다.
44
- 수정안은 사용자가 명시적으로 요청한 수정이 아니므로, 불명확한 것으로 취급하라.
48
+ The following are potential bug fixes **analyzed and suggested by the LLM**.
49
+ Since these fixes were not explicitly requested by the user, treat them as uncertain.
45
50
 
46
- ## 대상
47
- <대상 경로>
51
+ ## Target
52
+ <target path>
48
53
 
49
- ## LLM 제안 수정안
50
- 불명확한 수정안을 사용자에게 질문할 때, 아래 내용을 **반드시 먼저** 제시하여 사용자가 맥락을 파악할 있도록 하라.
54
+ ## LLM-Suggested Fixes
55
+ When asking the user about uncertain fixes, **always present** the following information first so the user can understand the context.
51
56
 
52
57
  ```
53
- 수정안:
54
- - 파일경로:라인:
55
- - 문제 설명:
56
- - 현재 코드: (해당 부분 코드 발췌)
57
- - 개선 방안:
58
+ Fix:
59
+ - Filepath:line:
60
+ - Current code: (excerpt of the relevant code)
61
+ - Problem description:
62
+ - Suggested fix:
63
+ - Reasons to fix:
64
+ - Reasons not to fix:
58
65
  ```
59
66
 
60
- <Step 2에서 도출된 발견 항목 목록 전체>
67
+ <Full list of findings from Step 2>
61
68
  ```
62
69
 
63
- ## Step 4: 계획 실행
70
+ ## Step 4: Execute Plan
64
71
 
65
- sd-plan 완료되어 확정된 계획서가 나오면, 계획서에 따라 코드를 수정하라.
72
+ Once sd-plan completes and produces a finalized plan, apply the code modifications according to that plan.
@@ -1,59 +1,66 @@
1
1
  ---
2
2
  name: sd-simplify
3
- description: "코드 단순화", "simplify", "sd-simplify", "코드 정제" 등을 요청할 사용. 지정한 경로의 코드를 분석 계획 수립을 거쳐 수정한다.
3
+ description: Used when requesting "code simplification", "simplify", "sd-simplify", "code refinement", etc. Analyzes code at a specified path, creates a plan, and applies modifications.
4
4
  ---
5
5
 
6
- # SD Simplify — 경로 지정 코드 단순화
6
+ # SD Simplify — Path-Specific Code Simplification
7
7
 
8
- 지정한 경로의 코드를 내장 `/simplify`로 분석한 뒤, `/sd-plan` 프로세스로 계획을 수립하고 실행한다.
8
+ Analyzes code at a specified path using the built-in `/simplify`, then creates and executes a plan via the `/sd-plan` process.
9
9
 
10
- ARGUMENTS: 대상 경로 (필수). 레포 임의 경로를 지정한다.
10
+ ARGUMENTS: Target path (required). Specify any path within the repository.
11
11
 
12
12
  ---
13
13
 
14
- ## Step 1: 인자 확인
14
+ ## Step 1: Validate Arguments
15
15
 
16
- 1. ARGUMENTS에서 대상 경로를 추출하라.
17
- 2. 경로가 없으면 "대상 경로를 지정해 주세요. 예: `/sd-simplify packages/my-pkg`"라고 안내하고 종료하라.
16
+ 1. Extract the target path from ARGUMENTS.
17
+ 2. If no path is provided, display the message "Please specify a target path. Example: `/sd-simplify packages/my-pkg`" and stop.
18
18
 
19
- ## Step 2: simplify 분석 (수정 금지)
19
+ ## Step 2: simplify Analysis (Do Not Modify)
20
20
 
21
- Skill 도구로 `simplify`를 호출하라. args에 아래 지침을 전달하라:
21
+ Invoke `simplify` using the Skill tool. Pass the following instructions as args:
22
22
 
23
23
  ```
24
- <대상 경로> 경로의 현재 코드베이스를 대상으로 리뷰하라. (최근 변경 코드가 아님)
25
- 단, 코드를 절대 수정하지 마라. 수정할 목록만 정리하여 출력하라.
26
- 항목은 다음 형식으로 작성하라:
27
- - **파일경로:라인** — 문제 설명 — 개선 방안
24
+ Review the current codebase at the <target path> path. (Not recently changed code)
25
+ Do NOT modify any code. Only compile and output a list of items to fix.
26
+ Write each item in the following format:
27
+ - **file-path:line**
28
+ - Current code: (excerpt of the relevant code)
29
+ - Problem description:
30
+ - Suggested improvement:
31
+ - Reasons to change: Rationale for applying the improvement
32
+ - Reasons not to change: Rationale for keeping the current code
28
33
  ```
29
34
 
30
- `<대상 경로>` 부분은 Step 1에서 추출한 실제 경로로 치환하라.
35
+ Replace the `<target path>` placeholder with the actual path extracted in Step 1.
31
36
 
32
- ## Step 3: sd-plan으로 계획 수립
37
+ ## Step 3: Create a Plan with sd-plan
33
38
 
34
- Step 2에서 도출된 수정할 목록을 작업 설명으로 하여, Skill 도구로 `sd-plan`을 호출하라. args에 아래를 전달하라:
39
+ Using the list of items to fix from Step 2 as the task description, invoke `sd-plan` using the Skill tool. Pass the following as args:
35
40
 
36
41
  ```
37
- 아래는 **LLM이 분석하여 제안한** 코드 개선안이다.
38
- 개선안은 사용자가 명시적으로 요청한 수정이 아니므로, 불명확한 것으로 취급하라.
42
+ The following are code improvement suggestions **proposed by an LLM analysis**.
43
+ Since these suggestions were not explicitly requested by the user, treat them as unclear.
39
44
 
40
- ## 대상
41
- <대상 경로>
45
+ ## Target
46
+ <target path>
42
47
 
43
- ## LLM 제안 개선안
44
- 불명확한 개선안을 사용자에게 질문할 때, 아래 내용을 **반드시 먼저** 제시하여 사용자가 맥락을 파악할 있도록 하라.
48
+ ## LLM-Suggested Improvements
49
+ When asking the user about unclear suggestions, **always present** the following details first so the user can understand the context.
45
50
 
46
51
  ```
47
- 개선안:
48
- - 파일경로:라인:
49
- - 문제 설명:
50
- - 현재 코드: (해당 부분 코드 발췌)
51
- - 개선 방안:
52
+ Suggestion:
53
+ - File path:line:
54
+ - Current code: (excerpt of the relevant code)
55
+ - Problem description:
56
+ - Suggested improvement:
57
+ - Reasons to change:
58
+ - Reasons not to change:
52
59
  ```
53
60
 
54
- <Step 2에서 도출된 수정할 목록 전체>
61
+ <Full list of items to fix from Step 2>
55
62
  ```
56
63
 
57
- ## Step 4: 계획 실행
64
+ ## Step 4: Execute the Plan
58
65
 
59
- sd-plan 완료되어 확정된 계획서가 나오면, 계획서에 따라 코드를 수정하라.
66
+ Once sd-plan completes and a finalized plan is produced, modify the code according to that plan.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simplysm/sd-claude",
3
- "version": "13.0.83",
3
+ "version": "13.0.85",
4
4
  "description": "Simplysm Claude Code asset installer",
5
5
  "author": "simplysm",
6
6
  "license": "Apache-2.0",
@@ -10,6 +10,9 @@
10
10
  "directory": "packages/sd-claude"
11
11
  },
12
12
  "type": "module",
13
+ "bin": {
14
+ "sd-claude": "scripts/cli.mjs"
15
+ },
13
16
  "files": [
14
17
  "scripts",
15
18
  "claude"
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+
3
+ const command = process.argv[2];
4
+
5
+ if (command === "postinstall") {
6
+ await import("./postinstall.mjs");
7
+ } else {
8
+ console.log("Usage: sd-claude <command>");
9
+ console.log("Commands:");
10
+ console.log(" postinstall Install Claude Code assets to .claude/");
11
+ process.exit(1);
12
+ }
@@ -46,7 +46,7 @@ try {
46
46
  console.warn("[@simplysm/sd-claude] postinstall warning:", err.message);
47
47
  }
48
48
 
49
- /** Finds the project root from INIT_CWD or node_modules path. */
49
+ /** Finds the project root from INIT_CWD, node_modules path, or cwd. */
50
50
  function findProjectRoot(dirname) {
51
51
  if (process.env["INIT_CWD"] != null) {
52
52
  return process.env["INIT_CWD"];
@@ -55,7 +55,12 @@ function findProjectRoot(dirname) {
55
55
  const sep = path.sep;
56
56
  const marker = sep + "node_modules" + sep;
57
57
  const idx = dirname.indexOf(marker);
58
- return idx !== -1 ? dirname.substring(0, idx) : undefined;
58
+ if (idx !== -1) {
59
+ return dirname.substring(0, idx);
60
+ }
61
+
62
+ // Fallback to cwd for manual CLI invocation (e.g., npx sd-claude postinstall)
63
+ return process.cwd();
59
64
  }
60
65
 
61
66
  /** Checks if this is the simplysm monorepo with the same major version. */
@@ -107,16 +112,27 @@ function setupSettings(targetDir) {
107
112
  // statusLine: always overwrite
108
113
  settings["statusLine"] = { type: "command", command: "python .claude/sd-statusline.py" };
109
114
 
115
+ // Migrate: move root-level SessionStart to hooks.SessionStart
116
+ if (settings["SessionStart"] != null) {
117
+ settings["hooks"] = settings["hooks"] ?? {};
118
+ settings["hooks"]["SessionStart"] = [
119
+ ...(settings["hooks"]["SessionStart"] ?? []),
120
+ ...settings["SessionStart"],
121
+ ];
122
+ delete settings["SessionStart"];
123
+ }
124
+
110
125
  // SessionStart: ensure sd-session-start hook exists with correct config
126
+ settings["hooks"] = settings["hooks"] ?? {};
111
127
  const sdSessionEntry = {
112
128
  matcher: "startup|resume|clear|compact",
113
129
  hooks: [{ type: "command", command: "bash .claude/sd-session-start.sh" }],
114
130
  };
115
131
 
116
- const sessionStart = settings["SessionStart"];
132
+ const sessionStart = settings["hooks"]["SessionStart"];
117
133
 
118
134
  if (sessionStart == null) {
119
- settings["SessionStart"] = [sdSessionEntry];
135
+ settings["hooks"]["SessionStart"] = [sdSessionEntry];
120
136
  } else {
121
137
  const idx = sessionStart.findIndex((entry) =>
122
138
  entry.hooks?.some((hook) => hook.command.includes("sd-session-start")),