timsquad 3.5.0 → 3.6.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.
Files changed (160) hide show
  1. package/README.ko.md +4 -0
  2. package/README.md +4 -0
  3. package/dist/commands/audit.d.ts +22 -0
  4. package/dist/commands/audit.d.ts.map +1 -0
  5. package/dist/commands/audit.js +233 -0
  6. package/dist/commands/audit.js.map +1 -0
  7. package/dist/commands/compile.d.ts.map +1 -1
  8. package/dist/commands/compile.js +84 -3
  9. package/dist/commands/compile.js.map +1 -1
  10. package/dist/commands/daemon.d.ts.map +1 -1
  11. package/dist/commands/daemon.js +48 -2
  12. package/dist/commands/daemon.js.map +1 -1
  13. package/dist/commands/init.js +42 -6
  14. package/dist/commands/init.js.map +1 -1
  15. package/dist/commands/log.d.ts.map +1 -1
  16. package/dist/commands/log.js +32 -0
  17. package/dist/commands/log.js.map +1 -1
  18. package/dist/commands/meta-index.d.ts.map +1 -1
  19. package/dist/commands/meta-index.js +30 -0
  20. package/dist/commands/meta-index.js.map +1 -1
  21. package/dist/commands/retro.d.ts.map +1 -1
  22. package/dist/commands/retro.js +63 -6
  23. package/dist/commands/retro.js.map +1 -1
  24. package/dist/commands/workflow.d.ts +2 -0
  25. package/dist/commands/workflow.d.ts.map +1 -1
  26. package/dist/commands/workflow.js +180 -6
  27. package/dist/commands/workflow.js.map +1 -1
  28. package/dist/daemon/context-writer.d.ts +14 -0
  29. package/dist/daemon/context-writer.d.ts.map +1 -1
  30. package/dist/daemon/context-writer.js +29 -0
  31. package/dist/daemon/context-writer.js.map +1 -1
  32. package/dist/daemon/event-queue.d.ts +4 -0
  33. package/dist/daemon/event-queue.d.ts.map +1 -1
  34. package/dist/daemon/event-queue.js +107 -6
  35. package/dist/daemon/event-queue.js.map +1 -1
  36. package/dist/daemon/file-watcher.d.ts +14 -8
  37. package/dist/daemon/file-watcher.d.ts.map +1 -1
  38. package/dist/daemon/file-watcher.js +78 -41
  39. package/dist/daemon/file-watcher.js.map +1 -1
  40. package/dist/daemon/index.d.ts.map +1 -1
  41. package/dist/daemon/index.js +42 -36
  42. package/dist/daemon/index.js.map +1 -1
  43. package/dist/index.js +2 -0
  44. package/dist/index.js.map +1 -1
  45. package/dist/lib/agent-generator.d.ts.map +1 -1
  46. package/dist/lib/agent-generator.js +11 -0
  47. package/dist/lib/agent-generator.js.map +1 -1
  48. package/dist/lib/compile-rules.d.ts +2 -0
  49. package/dist/lib/compile-rules.d.ts.map +1 -1
  50. package/dist/lib/compile-rules.js +2 -0
  51. package/dist/lib/compile-rules.js.map +1 -1
  52. package/dist/lib/compiler.d.ts +21 -1
  53. package/dist/lib/compiler.d.ts.map +1 -1
  54. package/dist/lib/compiler.js +113 -3
  55. package/dist/lib/compiler.js.map +1 -1
  56. package/dist/lib/config.d.ts +3 -0
  57. package/dist/lib/config.d.ts.map +1 -1
  58. package/dist/lib/config.js +17 -2
  59. package/dist/lib/config.js.map +1 -1
  60. package/dist/lib/skill-generator.d.ts +1 -1
  61. package/dist/lib/skill-generator.d.ts.map +1 -1
  62. package/dist/lib/skill-generator.js +17 -2
  63. package/dist/lib/skill-generator.js.map +1 -1
  64. package/dist/lib/ssot-map.d.ts +31 -0
  65. package/dist/lib/ssot-map.d.ts.map +1 -0
  66. package/dist/lib/ssot-map.js +76 -0
  67. package/dist/lib/ssot-map.js.map +1 -0
  68. package/dist/lib/template.js +1 -0
  69. package/dist/lib/template.js.map +1 -1
  70. package/dist/lib/workflow-state.d.ts +1 -1
  71. package/dist/lib/workflow-state.d.ts.map +1 -1
  72. package/dist/lib/workflow-state.js +1 -1
  73. package/dist/lib/workflow-state.js.map +1 -1
  74. package/dist/types/config.d.ts +10 -1
  75. package/dist/types/config.d.ts.map +1 -1
  76. package/dist/types/config.js +22 -17
  77. package/dist/types/config.js.map +1 -1
  78. package/dist/types/index.d.ts +1 -0
  79. package/dist/types/index.d.ts.map +1 -1
  80. package/dist/types/index.js +1 -0
  81. package/dist/types/index.js.map +1 -1
  82. package/dist/types/meta-index.d.ts +8 -0
  83. package/dist/types/meta-index.d.ts.map +1 -1
  84. package/dist/types/project.d.ts +1 -1
  85. package/dist/types/project.d.ts.map +1 -1
  86. package/dist/types/project.js.map +1 -1
  87. package/dist/types/ssot-map.d.ts +28 -0
  88. package/dist/types/ssot-map.d.ts.map +1 -0
  89. package/dist/types/ssot-map.js +6 -0
  90. package/dist/types/ssot-map.js.map +1 -0
  91. package/package.json +1 -1
  92. package/templates/base/agents/base/tsq-librarian.md +45 -0
  93. package/templates/base/skills/_shared/naming-conventions.md +49 -0
  94. package/templates/base/skills/_template/SKILL.md +33 -17
  95. package/templates/base/skills/audit/SKILL.md +66 -0
  96. package/templates/base/skills/coding/SKILL.md +49 -29
  97. package/templates/base/skills/coding/rules/async-patterns.md +81 -0
  98. package/templates/base/skills/coding/rules/code-organization.md +80 -0
  99. package/templates/base/skills/coding/rules/error-handling.md +76 -0
  100. package/templates/base/skills/coding/rules/type-safety.md +85 -0
  101. package/templates/base/skills/controller/SKILL.md +50 -84
  102. package/templates/base/skills/controller/delegation/developer.md +25 -0
  103. package/templates/base/skills/controller/delegation/librarian.md +33 -0
  104. package/templates/base/skills/controller/delegation/reviewer.md +19 -0
  105. package/templates/base/skills/controller/memory/.gitkeep +0 -0
  106. package/templates/base/skills/controller/triggers/phase-complete.md +25 -0
  107. package/templates/base/skills/controller/triggers/sequence-complete.md +15 -0
  108. package/templates/base/skills/controller/triggers/ssot-changed.md +14 -0
  109. package/templates/base/skills/controller/triggers/task-complete.md +14 -0
  110. package/templates/base/skills/database/SKILL.md +8 -25
  111. package/templates/base/skills/database/rules/query-optimization.md +32 -0
  112. package/templates/base/skills/database/rules/supabase-patterns.md +94 -0
  113. package/templates/base/skills/librarian/SKILL.md +53 -0
  114. package/templates/base/skills/main-session-constraints/SKILL.md +62 -0
  115. package/templates/base/skills/methodology/tdd/SKILL.md +6 -0
  116. package/templates/base/skills/product-audit/SKILL.md +115 -0
  117. package/templates/base/skills/product-audit/checklists/01-security.md +86 -0
  118. package/templates/base/skills/product-audit/checklists/02-performance.md +67 -0
  119. package/templates/base/skills/product-audit/checklists/03-seo.md +46 -0
  120. package/templates/base/skills/product-audit/checklists/04-accessibility.md +66 -0
  121. package/templates/base/skills/product-audit/checklists/05-ui-ux.md +50 -0
  122. package/templates/base/skills/product-audit/checklists/06-architecture.md +53 -0
  123. package/templates/base/skills/product-audit/checklists/07-functional-requirements.md +55 -0
  124. package/templates/base/skills/product-audit/rules/audit-protocol.md +136 -0
  125. package/templates/base/skills/product-audit/rules/false-positive-guard.md +81 -0
  126. package/templates/base/skills/product-audit/rules/scoring-criteria.md +113 -0
  127. package/templates/base/skills/product-audit/templates/improvement-plan-template.md +60 -0
  128. package/templates/base/skills/product-audit/templates/report-template.md +88 -0
  129. package/templates/base/skills/prompt-engineering/SKILL.md +54 -73
  130. package/templates/base/skills/retrospective/SKILL.md +70 -95
  131. package/templates/base/skills/retrospective/references/improvement-template.md +26 -0
  132. package/templates/base/skills/review/SKILL.md +72 -0
  133. package/templates/base/skills/security/SKILL.md +50 -37
  134. package/templates/base/skills/security/rules/auth-patterns.md +62 -0
  135. package/templates/base/skills/security/rules/dependency-security.md +69 -0
  136. package/templates/base/skills/security/rules/input-validation.md +68 -0
  137. package/templates/base/skills/security/rules/secrets-management.md +65 -0
  138. package/templates/base/skills/spec/SKILL.md +60 -0
  139. package/templates/base/skills/testing/SKILL.md +33 -25
  140. package/templates/base/skills/testing/references/e2e-stability.md +33 -0
  141. package/templates/base/skills/tsq-cli/SKILL.md +73 -0
  142. package/templates/base/skills/tsq-cli/references/cli-reference.md +92 -0
  143. package/templates/base/skills/tsq-protocol/SKILL.md +41 -25
  144. package/templates/base/skills/typescript/SKILL.md +3 -9
  145. package/templates/base/timsquad/ssot/test-spec.template.md +11 -1
  146. package/templates/base/timsquad/ssot-map.template.yaml +41 -0
  147. package/templates/platforms/claude-code/rules/api-conventions.md +12 -0
  148. package/templates/platforms/claude-code/rules/librarian-constraints.md +11 -0
  149. package/templates/platforms/claude-code/rules/test-conventions.md +13 -0
  150. package/templates/platforms/claude-code/scripts/change-scope-guard.sh +113 -0
  151. package/templates/platforms/claude-code/scripts/completion-guard.sh +75 -13
  152. package/templates/platforms/claude-code/scripts/context-restore.sh +68 -0
  153. package/templates/platforms/claude-code/scripts/e2e-commit-gate.sh +70 -0
  154. package/templates/platforms/claude-code/scripts/e2e-marker.sh +51 -0
  155. package/templates/platforms/claude-code/scripts/phase-guard.sh +1 -1
  156. package/templates/platforms/claude-code/scripts/pre-compact.sh +70 -0
  157. package/templates/platforms/claude-code/scripts/skill-inject.sh +216 -0
  158. package/templates/platforms/claude-code/scripts/skill-rules.json +11 -1
  159. package/templates/platforms/claude-code/scripts/subagent-inject.sh +53 -0
  160. package/templates/platforms/claude-code/settings.json +27 -1
@@ -0,0 +1,216 @@
1
+ #!/bin/bash
2
+ # Skill Inject — UserPromptSubmit Hook
3
+ # 사용자 프롬프트를 분석하여 매칭 스킬의 Contract/Protocol/Verification을
4
+ # systemMessage로 강제 주입한다 (advisory → mandatory 전환).
5
+ #
6
+ # 기존 skill-suggest.sh를 대체 (상위 호환).
7
+ # Input: JSON via stdin (Claude Code hook protocol, .prompt 필드 포함)
8
+ # Output: JSON with systemMessage (스킬 강제 주입)
9
+
10
+ set -e
11
+
12
+ # Read hook input
13
+ INPUT=$(cat 2>/dev/null || echo "")
14
+ if [ -z "$INPUT" ]; then
15
+ exit 0
16
+ fi
17
+
18
+ PROMPT=$(echo "$INPUT" | jq -r '.prompt // ""' 2>/dev/null || echo "")
19
+ if [ -z "$PROMPT" ] || [ "$PROMPT" = "null" ]; then
20
+ exit 0
21
+ fi
22
+
23
+ # Find project root
24
+ PROJECT_ROOT="$(pwd)"
25
+ while [ "$PROJECT_ROOT" != "/" ]; do
26
+ if [ -d "$PROJECT_ROOT/.timsquad" ]; then
27
+ break
28
+ fi
29
+ PROJECT_ROOT="$(dirname "$PROJECT_ROOT")"
30
+ done
31
+
32
+ if [ ! -d "$PROJECT_ROOT/.timsquad" ]; then
33
+ exit 0
34
+ fi
35
+
36
+ # Load skill rules
37
+ RULES_FILE="$PROJECT_ROOT/.claude/scripts/skill-rules.json"
38
+ if [ ! -f "$RULES_FILE" ]; then
39
+ exit 0
40
+ fi
41
+
42
+ THRESHOLD=$(jq -r '.threshold // 2' "$RULES_FILE" 2>/dev/null || echo "2")
43
+ PROMPT_LOWER=$(echo "$PROMPT" | tr '[:upper:]' '[:lower:]')
44
+
45
+ # Match skills and collect top matches with scores
46
+ declare -a MATCH_SKILLS=()
47
+ declare -a MATCH_SCORES=()
48
+
49
+ RULE_COUNT=$(jq '.rules | length' "$RULES_FILE" 2>/dev/null || echo "0")
50
+
51
+ i=0
52
+ while [ "$i" -lt "$RULE_COUNT" ]; do
53
+ SKILL=$(jq -r ".rules[$i].skill" "$RULES_FILE" 2>/dev/null)
54
+ SCORE=0
55
+
56
+ # Check if skill is deployed
57
+ SKILL_DIR="$PROJECT_ROOT/.claude/skills/$SKILL"
58
+ if [ ! -d "$SKILL_DIR" ]; then
59
+ i=$((i + 1))
60
+ continue
61
+ fi
62
+
63
+ # Keyword matching (3 points each)
64
+ KW_COUNT=$(jq ".rules[$i].keywords | length" "$RULES_FILE" 2>/dev/null || echo "0")
65
+ j=0
66
+ while [ "$j" -lt "$KW_COUNT" ]; do
67
+ KW=$(jq -r ".rules[$i].keywords[$j]" "$RULES_FILE" 2>/dev/null)
68
+ if echo "$PROMPT_LOWER" | grep -qi -- "$KW" 2>/dev/null; then
69
+ SCORE=$((SCORE + 3))
70
+ fi
71
+ j=$((j + 1))
72
+ done
73
+
74
+ # Pattern matching (5 points each)
75
+ PAT_COUNT=$(jq ".rules[$i].patterns | length" "$RULES_FILE" 2>/dev/null || echo "0")
76
+ k=0
77
+ while [ "$k" -lt "$PAT_COUNT" ]; do
78
+ PAT=$(jq -r ".rules[$i].patterns[$k]" "$RULES_FILE" 2>/dev/null)
79
+ if [ -n "$PAT" ] && echo "$PROMPT_LOWER" | grep -qiE -- "$PAT" 2>/dev/null; then
80
+ SCORE=$((SCORE + 5))
81
+ fi
82
+ k=$((k + 1))
83
+ done
84
+
85
+ # Threshold check
86
+ if [ "$SCORE" -ge "$THRESHOLD" ]; then
87
+ MATCH_SKILLS+=("$SKILL")
88
+ MATCH_SCORES+=("$SCORE")
89
+ fi
90
+
91
+ i=$((i + 1))
92
+ done
93
+
94
+ # Sort by score descending and take top 3
95
+ SORTED_INDICES=""
96
+ if [ ${#MATCH_SKILLS[@]} -gt 0 ]; then
97
+ SORTED_INDICES=$(
98
+ for idx in "${!MATCH_SCORES[@]}"; do
99
+ echo "${MATCH_SCORES[$idx]} $idx"
100
+ done | sort -rn | head -3 | awk '{print $2}'
101
+ )
102
+ fi
103
+
104
+ # Extract Contract + Protocol + Verification sections from matched skills
105
+ INJECTION=""
106
+ CHAR_COUNT=0
107
+ MAX_CHARS=1500
108
+
109
+ for idx in $SORTED_INDICES; do
110
+ SKILL="${MATCH_SKILLS[$idx]}"
111
+ SKILL_FILE="$PROJECT_ROOT/.claude/skills/$SKILL/SKILL.md"
112
+
113
+ if [ ! -f "$SKILL_FILE" ]; then
114
+ continue
115
+ fi
116
+
117
+ # Extract key sections (Contract + Protocol + Verification)
118
+ SECTIONS=$(awk '
119
+ /^## Contract/ { capture=1; next }
120
+ /^## Protocol/ { capture=1; next }
121
+ /^## Verification/ { capture=1; next }
122
+ /^## / { capture=0 }
123
+ capture { print }
124
+ ' "$SKILL_FILE" 2>/dev/null | head -20)
125
+
126
+ if [ -z "$SECTIONS" ]; then
127
+ continue
128
+ fi
129
+
130
+ # Append memory/ contents if exists (project-specific decisions)
131
+ MEMORY_DIR="$PROJECT_ROOT/.claude/skills/$SKILL/memory"
132
+ MEMORY_CONTENT=""
133
+ if [ -d "$MEMORY_DIR" ]; then
134
+ for MEM_FILE in "$MEMORY_DIR"/*.md; do
135
+ [ ! -f "$MEM_FILE" ] && continue
136
+ MEM_TEXT=$(head -10 "$MEM_FILE" 2>/dev/null || echo "")
137
+ if [ -n "$MEM_TEXT" ]; then
138
+ MEMORY_CONTENT="$MEMORY_CONTENT
139
+ $MEM_TEXT"
140
+ fi
141
+ done
142
+ fi
143
+
144
+ ENTRY="[Skill: $SKILL] $SECTIONS"
145
+ if [ -n "$MEMORY_CONTENT" ]; then
146
+ ENTRY="$ENTRY
147
+ [Memory] $MEMORY_CONTENT"
148
+ fi
149
+ ENTRY_LEN=${#ENTRY}
150
+
151
+ if [ $((CHAR_COUNT + ENTRY_LEN)) -gt "$MAX_CHARS" ]; then
152
+ break
153
+ fi
154
+
155
+ if [ -n "$INJECTION" ]; then
156
+ INJECTION="$INJECTION
157
+ ---
158
+ $ENTRY"
159
+ else
160
+ INJECTION="$ENTRY"
161
+ fi
162
+ CHAR_COUNT=$((CHAR_COUNT + ENTRY_LEN))
163
+ done
164
+
165
+ # SSOT Map Tier 0 injection (always injected regardless of skill match)
166
+ SSOT_MAP="$PROJECT_ROOT/.timsquad/ssot-map.yaml"
167
+ if [ -f "$SSOT_MAP" ]; then
168
+ # Parse tier-0-always compiled paths from YAML
169
+ TIER0_PATHS=$(awk '
170
+ /^tier-0-always:/ { in_tier0=1; next }
171
+ /^tier-[0-9]/ { in_tier0=0 }
172
+ in_tier0 && /compiled:/ { gsub(/.*compiled: */, ""); gsub(/^ *| *$/, ""); print }
173
+ ' "$SSOT_MAP" 2>/dev/null)
174
+
175
+ TIER0_CONTENT=""
176
+ while IFS= read -r REL_PATH; do
177
+ [ -z "$REL_PATH" ] && continue
178
+ COMPILED_FILE="$PROJECT_ROOT/.claude/skills/controller/$REL_PATH"
179
+ if [ -f "$COMPILED_FILE" ]; then
180
+ FILE_CONTENT=$(cat "$COMPILED_FILE" 2>/dev/null || echo "")
181
+ if [ -n "$FILE_CONTENT" ]; then
182
+ if [ -n "$TIER0_CONTENT" ]; then
183
+ TIER0_CONTENT="$TIER0_CONTENT
184
+ ---
185
+ $FILE_CONTENT"
186
+ else
187
+ TIER0_CONTENT="$FILE_CONTENT"
188
+ fi
189
+ fi
190
+ fi
191
+ done <<< "$TIER0_PATHS"
192
+
193
+ if [ -n "$TIER0_CONTENT" ]; then
194
+ if [ -n "$INJECTION" ]; then
195
+ INJECTION="[SSOT Tier-0 Constraints]
196
+ $TIER0_CONTENT
197
+ ---
198
+ $INJECTION"
199
+ else
200
+ INJECTION="[SSOT Tier-0 Constraints]
201
+ $TIER0_CONTENT"
202
+ fi
203
+ fi
204
+ fi
205
+
206
+ # Output as systemMessage (mandatory injection)
207
+ if [ -n "$INJECTION" ]; then
208
+ jq -n --arg msg "$INJECTION" '{
209
+ hookSpecificOutput: {
210
+ hookEventName: "UserPromptSubmit",
211
+ systemMessage: $msg
212
+ }
213
+ }'
214
+ fi
215
+
216
+ exit 0
@@ -1,6 +1,11 @@
1
1
  {
2
- "threshold": 4,
2
+ "threshold": 2,
3
3
  "rules": [
4
+ {
5
+ "skill": "main-session-constraints",
6
+ "keywords": ["요구사항", "분석", "계획", "위임", "스프린트", "pm", "관리"],
7
+ "patterns": ["(plan|analyze|delegate|manage).*?(task|project|sprint)"]
8
+ },
4
9
  {
5
10
  "skill": "mobile/flutter",
6
11
  "keywords": ["flutter", "widget", "riverpod", "stateless", "stateful", "플러터"],
@@ -80,6 +85,11 @@
80
85
  "skill": "planning",
81
86
  "keywords": ["prd", "requirements", "specification", "기획", "요구사항"],
82
87
  "patterns": ["(write|create|draft).*?(prd|spec|requirement)"]
88
+ },
89
+ {
90
+ "skill": "tsq-cli",
91
+ "keywords": ["tsq", "cli", "커맨드", "init", "status"],
92
+ "patterns": ["tsq\\s+(init|status|log|wf|mi|audit|knowledge)"]
83
93
  }
84
94
  ]
85
95
  }
@@ -0,0 +1,53 @@
1
+ #!/bin/bash
2
+ # Subagent Inject — SubagentStart Hook
3
+ # 서브에이전트 시작 시 tsq-protocol 핵심 내용을 자동 주입한다.
4
+ #
5
+ # Input: JSON via stdin (Claude Code hook protocol)
6
+ # Output: JSON with systemMessage (프로토콜 주입)
7
+
8
+ set -e
9
+
10
+ # Find project root
11
+ PROJECT_ROOT="$(pwd)"
12
+ while [ "$PROJECT_ROOT" != "/" ]; do
13
+ if [ -d "$PROJECT_ROOT/.timsquad" ]; then
14
+ break
15
+ fi
16
+ PROJECT_ROOT="$(dirname "$PROJECT_ROOT")"
17
+ done
18
+
19
+ if [ ! -d "$PROJECT_ROOT/.timsquad" ]; then
20
+ exit 0
21
+ fi
22
+
23
+ # Load tsq-protocol Contract + Protocol sections
24
+ PROTOCOL_FILE="$PROJECT_ROOT/.claude/skills/tsq-protocol/SKILL.md"
25
+ if [ ! -f "$PROTOCOL_FILE" ]; then
26
+ exit 0
27
+ fi
28
+
29
+ # Extract Contract + Quick Rules (compact, max 1000 chars)
30
+ SECTIONS=$(awk '
31
+ /^## Contract/ { capture=1; next }
32
+ /^## Quick Rules/ { capture=1; next }
33
+ /^## / { capture=0 }
34
+ capture { print }
35
+ ' "$PROTOCOL_FILE" 2>/dev/null | head -30)
36
+
37
+ if [ -z "$SECTIONS" ]; then
38
+ exit 0
39
+ fi
40
+
41
+ INJECTION="[TSQ Protocol - Subagent] $SECTIONS"
42
+
43
+ # Trim to 1000 chars max
44
+ INJECTION="${INJECTION:0:1000}"
45
+
46
+ jq -n --arg msg "$INJECTION" '{
47
+ hookSpecificOutput: {
48
+ hookEventName: "SubagentStart",
49
+ systemMessage: $msg
50
+ }
51
+ }'
52
+
53
+ exit 0
@@ -5,7 +5,7 @@
5
5
  "hooks": [
6
6
  {
7
7
  "type": "command",
8
- "command": "bash .claude/scripts/skill-suggest.sh",
8
+ "command": "bash .claude/scripts/skill-inject.sh",
9
9
  "timeout": 5
10
10
  }
11
11
  ]
@@ -50,6 +50,11 @@
50
50
  "type": "command",
51
51
  "command": "tsq daemon notify subagent-start 2>/dev/null || true",
52
52
  "timeout": 3
53
+ },
54
+ {
55
+ "type": "command",
56
+ "command": "bash .claude/scripts/subagent-inject.sh",
57
+ "timeout": 5
53
58
  }
54
59
  ]
55
60
  }
@@ -74,6 +79,16 @@
74
79
  "timeout": 5
75
80
  }
76
81
  ]
82
+ },
83
+ {
84
+ "matcher": "compact",
85
+ "hooks": [
86
+ {
87
+ "type": "command",
88
+ "command": "bash .claude/scripts/context-restore.sh",
89
+ "timeout": 5
90
+ }
91
+ ]
77
92
  }
78
93
  ],
79
94
  "PostToolUse": [
@@ -119,6 +134,17 @@
119
134
  ]
120
135
  }
121
136
  ],
137
+ "PreCompact": [
138
+ {
139
+ "hooks": [
140
+ {
141
+ "type": "command",
142
+ "command": "bash .claude/scripts/pre-compact.sh",
143
+ "timeout": 5
144
+ }
145
+ ]
146
+ }
147
+ ],
122
148
  "SessionEnd": [
123
149
  {
124
150
  "hooks": [