@codyswann/lisa 1.38.0 → 1.39.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/all/copy-overwrite/.claude/README.md +11 -5
- package/all/copy-overwrite/.claude/agents/agent-architect.md +0 -1
- package/all/copy-overwrite/.claude/agents/{architecture-planner.md → architecture-specialist.md} +7 -12
- package/all/copy-overwrite/.claude/agents/debug-specialist.md +204 -0
- package/all/copy-overwrite/.claude/agents/implementer.md +35 -23
- package/all/copy-overwrite/.claude/agents/learner.md +0 -1
- package/all/copy-overwrite/.claude/agents/performance-specialist.md +95 -0
- package/all/copy-overwrite/.claude/agents/{product-planner.md → product-specialist.md} +19 -14
- package/all/copy-overwrite/.claude/agents/{tech-reviewer.md → quality-specialist.md} +9 -11
- package/all/copy-overwrite/.claude/agents/{security-planner.md → security-specialist.md} +8 -13
- package/all/copy-overwrite/.claude/agents/{test-strategist.md → test-specialist.md} +20 -15
- package/all/copy-overwrite/.claude/agents/verification-specialist.md +189 -0
- package/all/copy-overwrite/.claude/commands/plan/create.md +1 -1
- package/all/copy-overwrite/.claude/commands/plan/execute.md +7 -0
- package/all/copy-overwrite/.claude/hooks/README.md +2 -2
- package/all/copy-overwrite/.claude/hooks/setup-jira-cli.sh +2 -2
- package/all/copy-overwrite/.claude/hooks/sync-tasks.sh +3 -0
- package/all/copy-overwrite/.claude/hooks/ticket-sync-reminder.sh +3 -0
- package/all/copy-overwrite/.claude/hooks/track-plan-sessions.sh +3 -0
- package/all/copy-overwrite/.claude/rules/lisa.md +2 -4
- package/all/copy-overwrite/.claude/rules/verfication.md +104 -1
- package/all/copy-overwrite/.claude/settings.json +219 -26
- package/all/copy-overwrite/.claude/skills/agent-design-best-practices/SKILL.md +219 -0
- package/all/copy-overwrite/.claude/skills/plan-add-test-coverage/SKILL.md +1 -1
- package/all/copy-overwrite/.claude/skills/plan-execute/SKILL.md +89 -0
- package/all/copy-overwrite/.claude/skills/plan-fix-linter-error/SKILL.md +1 -1
- package/all/copy-overwrite/.claude/skills/plan-lower-code-complexity/SKILL.md +1 -1
- package/all/copy-overwrite/.claude/skills/plan-reduce-max-lines/SKILL.md +1 -1
- package/all/copy-overwrite/.claude/skills/plan-reduce-max-lines-per-function/SKILL.md +1 -1
- package/all/copy-overwrite/README.md +6 -2
- package/dist/utils/fibonacci.d.ts +30 -22
- package/dist/utils/fibonacci.d.ts.map +1 -1
- package/dist/utils/fibonacci.js +40 -34
- package/dist/utils/fibonacci.js.map +1 -1
- package/package.json +1 -1
- package/rails/copy-overwrite/.claude/skills/plan-add-test-coverage/SKILL.md +1 -1
- package/rails/copy-overwrite/.claude/skills/plan-fix-linter-error/SKILL.md +1 -1
- package/rails/copy-overwrite/.claude/skills/plan-lower-code-complexity/SKILL.md +1 -1
- package/rails/copy-overwrite/.claude/skills/plan-reduce-max-lines/SKILL.md +1 -1
- package/rails/copy-overwrite/.claude/skills/plan-reduce-max-lines-per-function/SKILL.md +1 -1
- package/typescript/copy-contents/.husky/pre-push +1 -5
- package/typescript/copy-overwrite/.claude/settings.json +112 -78
- package/typescript/copy-overwrite/.github/workflows/quality.yml +1 -5
- package/all/copy-overwrite/.claude/REFERENCE.md +0 -519
- package/all/copy-overwrite/.claude/agents/codebase-analyzer.md +0 -146
- package/all/copy-overwrite/.claude/agents/codebase-locator.md +0 -125
- package/all/copy-overwrite/.claude/agents/codebase-pattern-finder.md +0 -237
- package/all/copy-overwrite/.claude/agents/consistency-checker.md +0 -58
- package/all/copy-overwrite/.claude/agents/product-reviewer.md +0 -47
- package/all/copy-overwrite/.claude/agents/spec-analyst.md +0 -41
- package/all/copy-overwrite/.claude/agents/test-coverage-agent.md +0 -17
- package/all/copy-overwrite/.claude/commands/plan/implement.md +0 -6
- package/all/copy-overwrite/.claude/rules/plan-governance.md +0 -96
- package/all/copy-overwrite/.claude/rules/plan.md +0 -79
- package/all/copy-overwrite/.claude/skills/plan-create/SKILL.md +0 -238
- package/all/copy-overwrite/.claude/skills/plan-implement/SKILL.md +0 -114
- /package/typescript/copy-overwrite/.claude/hooks/{install_pkgs.sh → install-pkgs.sh} +0 -0
|
@@ -1015,11 +1015,7 @@ jobs:
|
|
|
1015
1015
|
# Parent packages pin ^4.4.1; fix requires major version 5.x (incompatible)
|
|
1016
1016
|
# Risk: None - CLI build tool, not a production runtime dependency
|
|
1017
1017
|
|
|
1018
|
-
|
|
1019
|
-
# Transitive dependency via aws-amplify > @aws-amplify/api-rest > axios
|
|
1020
|
-
# bun overrides/resolutions cannot reach nested node_modules copies
|
|
1021
|
-
# Risk: Low - only affects server-side mergeConfig with attacker-controlled input
|
|
1022
|
-
if ! bun audit --audit-level=high --ignore GHSA-5j98-mcp5-4vw2 --ignore GHSA-8qq5-rm4j-mr97 --ignore GHSA-37qj-frw5-hhjh --ignore GHSA-43fc-jf86-j433; then
|
|
1018
|
+
if ! bun audit --audit-level=high --ignore GHSA-5j98-mcp5-4vw2 --ignore GHSA-8qq5-rm4j-mr97 --ignore GHSA-37qj-frw5-hhjh; then
|
|
1023
1019
|
echo "::warning::Found high or critical vulnerabilities"
|
|
1024
1020
|
exit 1
|
|
1025
1021
|
fi
|
|
@@ -1,519 +0,0 @@
|
|
|
1
|
-
# Claude Code Hooks & Settings Reference
|
|
2
|
-
|
|
3
|
-
Complete expert reference for Claude Code hooks and `.claude/settings.json` configuration.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Hook Event Types (13 total)
|
|
8
|
-
|
|
9
|
-
| Event | Trigger | Matcher Support |
|
|
10
|
-
|-------|---------|-----------------|
|
|
11
|
-
| `SessionStart` | Session begins/resumes | `startup`, `resume`, `clear`, `compact` |
|
|
12
|
-
| `SessionEnd` | Session terminates | `clear`, `logout`, `prompt_input_exit`, `other` |
|
|
13
|
-
| `Setup` | `--init`, `--init-only`, `--maintenance` flags | `init`, `maintenance` |
|
|
14
|
-
| `PreToolUse` | Before tool call processes | Tool names (regex supported) |
|
|
15
|
-
| `PostToolUse` | After tool succeeds | Tool names (regex supported) |
|
|
16
|
-
| `PostToolUseFailure` | After tool fails | Tool names (regex supported) |
|
|
17
|
-
| `PermissionRequest` | Permission dialog appears | Tool names |
|
|
18
|
-
| `SubagentStart` | Subagent spawns | N/A |
|
|
19
|
-
| `SubagentStop` | Subagent finishes | N/A |
|
|
20
|
-
| `Stop` | Main agent finishes (not interrupted) | N/A |
|
|
21
|
-
| `UserPromptSubmit` | User submits prompt | N/A |
|
|
22
|
-
| `Notification` | Notifications sent | `permission_prompt`, `idle_prompt`, `auth_success`, `elicitation_dialog` |
|
|
23
|
-
| `PreCompact` | Before context compaction | `manual`, `auto` |
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Complete settings.json Schema
|
|
28
|
-
|
|
29
|
-
```json
|
|
30
|
-
{
|
|
31
|
-
"permissions": {
|
|
32
|
-
"allow": ["Bash(npm run:*)", "Read"],
|
|
33
|
-
"ask": ["Bash(git push:*)"],
|
|
34
|
-
"deny": ["Bash(rm -rf:*)", "Read(./.env.*)"],
|
|
35
|
-
"additionalDirectories": ["../docs/"],
|
|
36
|
-
"defaultMode": "default | acceptEdits | plan | bypassPermissions | dontAsk",
|
|
37
|
-
"disableBypassPermissionsMode": "disable | warn"
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
"hooks": {},
|
|
41
|
-
"disableAllHooks": false,
|
|
42
|
-
"allowManagedHooksOnly": false,
|
|
43
|
-
|
|
44
|
-
"env": {
|
|
45
|
-
"ANTHROPIC_API_KEY": "sk-...",
|
|
46
|
-
"BASH_DEFAULT_TIMEOUT_MS": "30000",
|
|
47
|
-
"BASH_MAX_TIMEOUT_MS": "7200000",
|
|
48
|
-
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
|
|
49
|
-
"CLAUDE_CODE_MAX_OUTPUT_TOKENS": "32000",
|
|
50
|
-
"MAX_THINKING_TOKENS": "31999",
|
|
51
|
-
"OTEL_METRICS_EXPORTER": "otlp",
|
|
52
|
-
"OTEL_EXPORTER_OTLP_ENDPOINT": "...",
|
|
53
|
-
"CUSTOM_VAR": "value"
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
"model": "string",
|
|
57
|
-
"alwaysThinkingEnabled": false,
|
|
58
|
-
|
|
59
|
-
"statusLine": { "type": "command", "command": "<HOME>/.claude/statusline.sh" },
|
|
60
|
-
"outputStyle": "string",
|
|
61
|
-
"language": "string",
|
|
62
|
-
"spinnerTipsEnabled": true,
|
|
63
|
-
"terminalProgressBarEnabled": true,
|
|
64
|
-
"showTurnDuration": true,
|
|
65
|
-
|
|
66
|
-
"attribution": {
|
|
67
|
-
"commit": "🤖 Generated with Claude Code\n\nCo-Authored-By: ...",
|
|
68
|
-
"pr": "🤖 Generated with Claude Code"
|
|
69
|
-
},
|
|
70
|
-
"includeCoAuthoredBy": false,
|
|
71
|
-
|
|
72
|
-
"forceLoginMethod": "claudeai | console",
|
|
73
|
-
"forceLoginOrgUUID": "string",
|
|
74
|
-
"apiKeyHelper": "string",
|
|
75
|
-
"awsAuthRefresh": "string",
|
|
76
|
-
"awsCredentialExport": "string",
|
|
77
|
-
"otelHeadersHelper": "string",
|
|
78
|
-
|
|
79
|
-
"enableAllProjectMcpServers": false,
|
|
80
|
-
"enabledMcpjsonServers": [],
|
|
81
|
-
"disabledMcpjsonServers": [],
|
|
82
|
-
"allowedMcpServers": [],
|
|
83
|
-
"deniedMcpServers": [],
|
|
84
|
-
|
|
85
|
-
"enabledPlugins": { "plugin-name@marketplace": true },
|
|
86
|
-
"extraKnownMarketplaces": {},
|
|
87
|
-
"strictKnownMarketplaces": [],
|
|
88
|
-
|
|
89
|
-
"respectGitignore": true,
|
|
90
|
-
"fileSuggestion": { "type": "command", "command": "..." },
|
|
91
|
-
"additionalDirectories": [],
|
|
92
|
-
|
|
93
|
-
"sandbox": {
|
|
94
|
-
"enabled": true,
|
|
95
|
-
"autoAllowBashIfSandboxed": true,
|
|
96
|
-
"excludedCommands": ["git", "docker"],
|
|
97
|
-
"allowUnsandboxedCommands": true,
|
|
98
|
-
"network": {
|
|
99
|
-
"allowUnixSockets": ["<HOME>/.ssh/agent-socket"],
|
|
100
|
-
"allowLocalBinding": true,
|
|
101
|
-
"httpProxyPort": 8080,
|
|
102
|
-
"socksProxyPort": 8081
|
|
103
|
-
},
|
|
104
|
-
"enableWeakerNestedSandbox": false
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
"cleanupPeriodDays": 30,
|
|
108
|
-
"autoUpdatesChannel": "stable | latest",
|
|
109
|
-
"plansDirectory": "string",
|
|
110
|
-
"companyAnnouncements": []
|
|
111
|
-
}
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
---
|
|
115
|
-
|
|
116
|
-
## Hook Configuration Structure
|
|
117
|
-
|
|
118
|
-
```json
|
|
119
|
-
{
|
|
120
|
-
"hooks": {
|
|
121
|
-
"EventName": [
|
|
122
|
-
{
|
|
123
|
-
"matcher": "ToolPattern",
|
|
124
|
-
"hooks": [
|
|
125
|
-
{
|
|
126
|
-
"type": "command",
|
|
127
|
-
"command": "bash-cmd",
|
|
128
|
-
"timeout": 60
|
|
129
|
-
}
|
|
130
|
-
]
|
|
131
|
-
}
|
|
132
|
-
]
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Hook Types
|
|
138
|
-
|
|
139
|
-
| Type | Description |
|
|
140
|
-
|------|-------------|
|
|
141
|
-
| `command` | Executes bash command synchronously |
|
|
142
|
-
| `prompt` | Sends JSON input to LLM (Haiku) for decision |
|
|
143
|
-
|
|
144
|
-
**Prompt-based hooks** only support: `Stop`, `SubagentStop`, `UserPromptSubmit`, `PreToolUse`, `PermissionRequest`
|
|
145
|
-
|
|
146
|
-
Prompt hooks must return JSON: `{"ok": true|false, "reason": "explanation"}`
|
|
147
|
-
|
|
148
|
-
---
|
|
149
|
-
|
|
150
|
-
## Environment Variables Available to Hooks
|
|
151
|
-
|
|
152
|
-
| Variable | Description | Availability |
|
|
153
|
-
|----------|-------------|--------------|
|
|
154
|
-
| `CLAUDE_PROJECT_DIR` | Absolute path to project root | Always |
|
|
155
|
-
| `CLAUDE_CODE_REMOTE` | `"true"` if web environment | Always |
|
|
156
|
-
| `CLAUDE_ENV_FILE` | File path to persist env vars | SessionStart/Setup only |
|
|
157
|
-
| `CLAUDE_PLUGIN_ROOT` | Plugin directory path | Plugin hooks only |
|
|
158
|
-
|
|
159
|
-
---
|
|
160
|
-
|
|
161
|
-
## Exit Code Behavior
|
|
162
|
-
|
|
163
|
-
| Exit Code | Behavior |
|
|
164
|
-
|-----------|----------|
|
|
165
|
-
| **0** | Success - stdout processed for JSON or added as context |
|
|
166
|
-
| **2** | Blocking error - prevents action, stderr shown to Claude |
|
|
167
|
-
| **Other** | Non-blocking error - stderr shown in verbose mode |
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## Blocking vs Non-Blocking Hooks
|
|
172
|
-
|
|
173
|
-
### Blocking Hooks (Exit Code 2)
|
|
174
|
-
|
|
175
|
-
| Event | Effect |
|
|
176
|
-
|-------|--------|
|
|
177
|
-
| `PreToolUse` | Blocks tool call, shows stderr to Claude |
|
|
178
|
-
| `PermissionRequest` | Denies permission, shows stderr to Claude |
|
|
179
|
-
| `PostToolUse` | Shows stderr to Claude (tool already ran) |
|
|
180
|
-
| `UserPromptSubmit` | Erases submitted prompt, shows stderr to user only |
|
|
181
|
-
| `Stop`/`SubagentStop` | Blocks stoppage, shows stderr to Claude |
|
|
182
|
-
| `Setup`/`SessionStart`/`SessionEnd`/`PreCompact`/`Notification` | Shows stderr to user only |
|
|
183
|
-
|
|
184
|
-
---
|
|
185
|
-
|
|
186
|
-
## Matcher Patterns
|
|
187
|
-
|
|
188
|
-
| Pattern | Matches |
|
|
189
|
-
|---------|---------|
|
|
190
|
-
| `Write` | Exact match only |
|
|
191
|
-
| `Edit\|Write` | Either tool (regex OR) |
|
|
192
|
-
| `npm run:*` | Prefix + word boundary (`npm run lint` yes, `npm runtest` no) |
|
|
193
|
-
| `ls*` | Glob anywhere (`ls -la`, `lsof`) |
|
|
194
|
-
| `Notebook.*` | Regex pattern (all Notebook tools) |
|
|
195
|
-
| `mcp__server__.*` | All MCP server tools |
|
|
196
|
-
| `""` or omit | All tools/events |
|
|
197
|
-
|
|
198
|
-
### Common Tool Names for Matching
|
|
199
|
-
|
|
200
|
-
**Core Tools:**
|
|
201
|
-
`Bash`, `Write`, `Edit`, `Read`, `Glob`, `Grep`, `WebFetch`, `WebSearch`
|
|
202
|
-
|
|
203
|
-
**Notebook Tools:**
|
|
204
|
-
`Notebook`, `NotebookEdit`
|
|
205
|
-
|
|
206
|
-
**Agent & Task Tools:**
|
|
207
|
-
`Task`, `TaskCreate`, `TaskUpdate`, `TaskList`, `TaskGet`
|
|
208
|
-
|
|
209
|
-
**Skill & Planning Tools:**
|
|
210
|
-
`Skill`, `EnterPlanMode`, `ExitPlanMode`, `AskUserQuestion`
|
|
211
|
-
|
|
212
|
-
**Advanced Tools:**
|
|
213
|
-
`LSP`, `Computer`, `ToolSearch`, `TeammateTool`
|
|
214
|
-
|
|
215
|
-
**MCP Tools Pattern:**
|
|
216
|
-
`mcp__<server>__<tool>` (e.g., `mcp__memory__create_entities`)
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
## Settings File Locations & Precedence
|
|
221
|
-
|
|
222
|
-
| Scope | Location | Shared | Precedence |
|
|
223
|
-
|-------|----------|--------|------------|
|
|
224
|
-
| Managed | System-level `managed-settings.json` | Yes (IT deployed) | Highest (cannot override) |
|
|
225
|
-
| User | `<HOME>/.claude/settings.json` | No | Normal |
|
|
226
|
-
| Project | `.claude/settings.json` | Yes (in git) | Normal |
|
|
227
|
-
| Local | `.claude/settings.local.json` | No (gitignored) | Normal |
|
|
228
|
-
|
|
229
|
-
### Managed Settings Locations
|
|
230
|
-
|
|
231
|
-
| OS | Path |
|
|
232
|
-
|----|------|
|
|
233
|
-
| macOS | `<SYSTEM_CONFIG>/ClaudeCode/` |
|
|
234
|
-
| Linux/WSL | `<SYSTEM_CONFIG>/claude-code/` |
|
|
235
|
-
| Windows | `<SYSTEM_CONFIG>\ClaudeCode\` |
|
|
236
|
-
|
|
237
|
-
---
|
|
238
|
-
|
|
239
|
-
## Hook Output Handling by Event
|
|
240
|
-
|
|
241
|
-
| Event | stdout | stderr |
|
|
242
|
-
|-------|--------|--------|
|
|
243
|
-
| PreToolUse/PostToolUse/Stop/SubagentStop | Shown in verbose mode, JSON parsed for control | Shown in verbose mode |
|
|
244
|
-
| Notification/SessionEnd | Logged to debug only (`--debug`) | Logged to debug only |
|
|
245
|
-
| UserPromptSubmit/SessionStart/Setup | **Added to Claude's context** | Shown to user in verbose mode |
|
|
246
|
-
|
|
247
|
-
---
|
|
248
|
-
|
|
249
|
-
## Hook Input Schema (Common Fields)
|
|
250
|
-
|
|
251
|
-
All hook inputs include:
|
|
252
|
-
|
|
253
|
-
```json
|
|
254
|
-
{
|
|
255
|
-
"session_id": "abc123",
|
|
256
|
-
"transcript_path": "/path/to/transcript.jsonl",
|
|
257
|
-
"cwd": "/current/working/directory",
|
|
258
|
-
"permission_mode": "default | plan | acceptEdits | dontAsk | bypassPermissions",
|
|
259
|
-
"hook_event_name": "EventName"
|
|
260
|
-
}
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
### PreToolUse Input
|
|
264
|
-
|
|
265
|
-
```json
|
|
266
|
-
{
|
|
267
|
-
"tool_name": "Bash | Write | Edit | Read | Glob | Grep | WebFetch | WebSearch | Task",
|
|
268
|
-
"tool_input": {
|
|
269
|
-
"command": "...",
|
|
270
|
-
"description": "...",
|
|
271
|
-
"timeout": 120000,
|
|
272
|
-
"run_in_background": false
|
|
273
|
-
},
|
|
274
|
-
"tool_use_id": "toolu_01ABC123..."
|
|
275
|
-
}
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
### PostToolUse Input
|
|
279
|
-
|
|
280
|
-
```json
|
|
281
|
-
{
|
|
282
|
-
"tool_name": "...",
|
|
283
|
-
"tool_input": {},
|
|
284
|
-
"tool_response": {},
|
|
285
|
-
"tool_use_id": "toolu_01ABC123..."
|
|
286
|
-
}
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
### Notification Input
|
|
290
|
-
|
|
291
|
-
```json
|
|
292
|
-
{
|
|
293
|
-
"message": "Claude needs your permission to use Bash",
|
|
294
|
-
"notification_type": "permission_prompt | idle_prompt | auth_success | elicitation_dialog"
|
|
295
|
-
}
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
### UserPromptSubmit Input
|
|
299
|
-
|
|
300
|
-
```json
|
|
301
|
-
{
|
|
302
|
-
"prompt": "User's prompt text"
|
|
303
|
-
}
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
### Stop Input
|
|
307
|
-
|
|
308
|
-
```json
|
|
309
|
-
{
|
|
310
|
-
"stop_hook_active": false
|
|
311
|
-
}
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
### SubagentStop Input
|
|
315
|
-
|
|
316
|
-
```json
|
|
317
|
-
{
|
|
318
|
-
"stop_hook_active": false,
|
|
319
|
-
"agent_id": "def456",
|
|
320
|
-
"agent_transcript_path": "/path/to/subagent/transcript.jsonl"
|
|
321
|
-
}
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
### SubagentStart Input
|
|
325
|
-
|
|
326
|
-
```json
|
|
327
|
-
{
|
|
328
|
-
"agent_id": "agent-abc123",
|
|
329
|
-
"agent_type": "Explore | Bash | Plan | CustomAgentName"
|
|
330
|
-
}
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
### SessionStart Input
|
|
334
|
-
|
|
335
|
-
```json
|
|
336
|
-
{
|
|
337
|
-
"source": "startup | resume | clear | compact",
|
|
338
|
-
"model": "claude-sonnet-4-20250514",
|
|
339
|
-
"agent_type": "AgentName"
|
|
340
|
-
}
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
### SessionEnd Input
|
|
344
|
-
|
|
345
|
-
```json
|
|
346
|
-
{
|
|
347
|
-
"reason": "exit | clear | logout | prompt_input_exit | other"
|
|
348
|
-
}
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
### Setup Input
|
|
352
|
-
|
|
353
|
-
```json
|
|
354
|
-
{
|
|
355
|
-
"trigger": "init | maintenance"
|
|
356
|
-
}
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
### PreCompact Input
|
|
360
|
-
|
|
361
|
-
```json
|
|
362
|
-
{
|
|
363
|
-
"trigger": "manual | auto",
|
|
364
|
-
"custom_instructions": ""
|
|
365
|
-
}
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
---
|
|
369
|
-
|
|
370
|
-
## Hook-Specific Output Schemas
|
|
371
|
-
|
|
372
|
-
### PreToolUse Output
|
|
373
|
-
|
|
374
|
-
```json
|
|
375
|
-
{
|
|
376
|
-
"hookSpecificOutput": {
|
|
377
|
-
"hookEventName": "PreToolUse",
|
|
378
|
-
"permissionDecision": "allow | deny | ask",
|
|
379
|
-
"permissionDecisionReason": "Optional explanation",
|
|
380
|
-
"updatedInput": {
|
|
381
|
-
"field_name": "new_value"
|
|
382
|
-
},
|
|
383
|
-
"additionalContext": "Additional context for Claude"
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
```
|
|
387
|
-
|
|
388
|
-
### PermissionRequest Output
|
|
389
|
-
|
|
390
|
-
```json
|
|
391
|
-
{
|
|
392
|
-
"hookSpecificOutput": {
|
|
393
|
-
"hookEventName": "PermissionRequest",
|
|
394
|
-
"decision": {
|
|
395
|
-
"behavior": "allow | deny",
|
|
396
|
-
"message": "Why denied",
|
|
397
|
-
"interrupt": true,
|
|
398
|
-
"updatedInput": {}
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
```
|
|
403
|
-
|
|
404
|
-
### PostToolUse Output
|
|
405
|
-
|
|
406
|
-
```json
|
|
407
|
-
{
|
|
408
|
-
"hookSpecificOutput": {
|
|
409
|
-
"hookEventName": "PostToolUse",
|
|
410
|
-
"additionalContext": "Feedback for Claude"
|
|
411
|
-
},
|
|
412
|
-
"decision": "block | undefined",
|
|
413
|
-
"reason": "Why blocked (if decision=block)"
|
|
414
|
-
}
|
|
415
|
-
```
|
|
416
|
-
|
|
417
|
-
### UserPromptSubmit Output
|
|
418
|
-
|
|
419
|
-
```json
|
|
420
|
-
{
|
|
421
|
-
"hookSpecificOutput": {
|
|
422
|
-
"hookEventName": "UserPromptSubmit",
|
|
423
|
-
"additionalContext": "Additional context to add"
|
|
424
|
-
},
|
|
425
|
-
"decision": "block | undefined",
|
|
426
|
-
"reason": "Why blocked"
|
|
427
|
-
}
|
|
428
|
-
```
|
|
429
|
-
|
|
430
|
-
### Stop/SubagentStop Output
|
|
431
|
-
|
|
432
|
-
```json
|
|
433
|
-
{
|
|
434
|
-
"decision": "block | undefined",
|
|
435
|
-
"reason": "Why blocked (required when blocked)"
|
|
436
|
-
}
|
|
437
|
-
```
|
|
438
|
-
|
|
439
|
-
### SessionStart/Setup Output
|
|
440
|
-
|
|
441
|
-
```json
|
|
442
|
-
{
|
|
443
|
-
"hookSpecificOutput": {
|
|
444
|
-
"hookEventName": "SessionStart | Setup",
|
|
445
|
-
"additionalContext": "Context to inject"
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
```
|
|
449
|
-
|
|
450
|
-
---
|
|
451
|
-
|
|
452
|
-
## Permission Evaluation Order
|
|
453
|
-
|
|
454
|
-
First match wins:
|
|
455
|
-
|
|
456
|
-
1. **Deny rules** (highest priority)
|
|
457
|
-
2. **Ask rules**
|
|
458
|
-
3. **Allow rules** (lowest priority)
|
|
459
|
-
|
|
460
|
-
---
|
|
461
|
-
|
|
462
|
-
## Wildcard Patterns in Permissions
|
|
463
|
-
|
|
464
|
-
| Pattern | Description |
|
|
465
|
-
|---------|-------------|
|
|
466
|
-
| `:*` | Prefix matching with word boundary |
|
|
467
|
-
| `*` | Glob matching anywhere |
|
|
468
|
-
| `**` | Recursive glob |
|
|
469
|
-
|
|
470
|
-
Examples:
|
|
471
|
-
- `Bash(npm run:*)` - matches "npm run lint" but NOT "npm runtest"
|
|
472
|
-
- `Bash(ls*)` - matches both "ls -la" and "lsof"
|
|
473
|
-
- `Read(./secrets/**)` - matches all files under ./secrets/
|
|
474
|
-
|
|
475
|
-
---
|
|
476
|
-
|
|
477
|
-
## Best Practices
|
|
478
|
-
|
|
479
|
-
1. **Blocking behavior for enforcement**: When creating hooks for linting, code quality, or static analysis, use blocking behavior (exit 2) so Claude receives feedback and can fix errors.
|
|
480
|
-
|
|
481
|
-
2. **Notification hooks**: Notification-only hooks should exit 0 since they don't require Claude to take action.
|
|
482
|
-
|
|
483
|
-
3. **JSON parsing**: Never parse JSON in shell scripts using grep/sed/cut/awk—always use `jq` for robust JSON handling.
|
|
484
|
-
|
|
485
|
-
4. **Environment persistence**: Use `CLAUDE_ENV_FILE` in SessionStart/Setup hooks to persist environment variables across subsequent bash commands:
|
|
486
|
-
```bash
|
|
487
|
-
echo 'export VAR=value' >> "$CLAUDE_ENV_FILE"
|
|
488
|
-
```
|
|
489
|
-
|
|
490
|
-
5. **Timeout configuration**: Default is 60 seconds per hook. Configure per-hook with `"timeout"` field (in seconds).
|
|
491
|
-
|
|
492
|
-
---
|
|
493
|
-
|
|
494
|
-
---
|
|
495
|
-
|
|
496
|
-
## Claude Code System Prompts Reference
|
|
497
|
-
|
|
498
|
-
Comprehensive catalog of all 110+ system prompts used by Claude Code v2.1.19+. Maintained by Piebald AI and updated within minutes of each Claude Code release.
|
|
499
|
-
|
|
500
|
-
**What It Contains:**
|
|
501
|
-
- Main system prompt and ~40 system reminders
|
|
502
|
-
- 18+ tool descriptions (Bash, Write, Edit, Read, WebFetch, WebSearch, etc.)
|
|
503
|
-
- Specialized agent prompts (Explore, Plan, Task execution)
|
|
504
|
-
- Creation assistants (Agent architect, CLAUDE.md generator, status line setup)
|
|
505
|
-
- Slash command implementations (/security-review, /review-pr, /pr-comments)
|
|
506
|
-
- Utility functions (summarization, session management, security analysis)
|
|
507
|
-
|
|
508
|
-
**Why It's Useful:**
|
|
509
|
-
Understand exactly how Claude Code is instructed to operate across different scenarios. Reference for customization via tweakcc tool.
|
|
510
|
-
|
|
511
|
-
**Repository:** [Piebald-AI/claude-code-system-prompts](https://github.com/Piebald-AI/claude-code-system-prompts)
|
|
512
|
-
|
|
513
|
-
---
|
|
514
|
-
|
|
515
|
-
## Sources
|
|
516
|
-
|
|
517
|
-
- [Claude Code Hooks Reference](https://docs.anthropic.com/en/docs/claude-code/hooks)
|
|
518
|
-
- [Claude Code Settings Documentation](https://docs.anthropic.com/en/docs/claude-code/settings)
|
|
519
|
-
- [Claude Code System Prompts Repository](https://github.com/Piebald-AI/claude-code-system-prompts)
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: codebase-analyzer
|
|
3
|
-
description: Analyzes codebase implementation details. Call the codebase-analyzer agent when you need to find detailed information about specific components. As always, the more detailed your request prompt, the better! :)
|
|
4
|
-
model: inherit
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
You are a specialist at understanding HOW code works. Your job is to analyze implementation details, trace data flow, and explain technical workings with precise file:line references.
|
|
8
|
-
|
|
9
|
-
## CRITICAL: YOUR ONLY JOB IS TO DOCUMENT AND EXPLAIN THE CODEBASE AS IT EXISTS TODAY
|
|
10
|
-
|
|
11
|
-
- DO NOT suggest improvements or changes unless the user explicitly asks for them
|
|
12
|
-
- DO NOT perform root cause analysis unless the user explicitly asks for them
|
|
13
|
-
- DO NOT propose future enhancements unless the user explicitly asks for them
|
|
14
|
-
- DO NOT critique the implementation or identify "problems"
|
|
15
|
-
- DO NOT comment on code quality, performance issues, or security concerns
|
|
16
|
-
- DO NOT suggest refactoring, optimization, or better approaches
|
|
17
|
-
- ONLY describe what exists, how it works, and how components interact
|
|
18
|
-
|
|
19
|
-
## Core Responsibilities
|
|
20
|
-
|
|
21
|
-
1. **Analyze Implementation Details**
|
|
22
|
-
- Read specific files to understand logic
|
|
23
|
-
- Identify key functions and their purposes
|
|
24
|
-
- Trace method calls and data transformations
|
|
25
|
-
- Note important algorithms or patterns
|
|
26
|
-
|
|
27
|
-
2. **Trace Data Flow**
|
|
28
|
-
- Follow data from entry to exit points
|
|
29
|
-
- Map transformations and validations
|
|
30
|
-
- Identify state changes and side effects
|
|
31
|
-
- Document API contracts between components
|
|
32
|
-
|
|
33
|
-
3. **Identify Architectural Patterns**
|
|
34
|
-
- Recognize design patterns in use
|
|
35
|
-
- Note architectural decisions
|
|
36
|
-
- Identify conventions and best practices
|
|
37
|
-
- Find integration points between systems
|
|
38
|
-
|
|
39
|
-
## Analysis Strategy
|
|
40
|
-
|
|
41
|
-
### Step 1: Read Entry Points
|
|
42
|
-
|
|
43
|
-
- Start with main files mentioned in the request
|
|
44
|
-
- Look for exports, public methods, or route handlers
|
|
45
|
-
- Identify the "surface area" of the component
|
|
46
|
-
|
|
47
|
-
### Step 2: Follow the Code Path
|
|
48
|
-
|
|
49
|
-
- Trace function calls step by step
|
|
50
|
-
- Read each file involved in the flow
|
|
51
|
-
- Note where data is transformed
|
|
52
|
-
- Identify external dependencies
|
|
53
|
-
- Take time to ultrathink about how all these pieces connect and interact
|
|
54
|
-
|
|
55
|
-
### Step 3: Document Key Logic
|
|
56
|
-
|
|
57
|
-
- Document business logic as it exists
|
|
58
|
-
- Describe validation, transformation, error handling
|
|
59
|
-
- Explain any complex algorithms or calculations
|
|
60
|
-
- Note configuration or feature flags being used
|
|
61
|
-
- DO NOT evaluate if the logic is correct or optimal
|
|
62
|
-
- DO NOT identify potential bugs or issues
|
|
63
|
-
|
|
64
|
-
## Output Format
|
|
65
|
-
|
|
66
|
-
Structure your analysis like this:
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
## Analysis: [Feature/Component Name]
|
|
70
|
-
|
|
71
|
-
### Overview
|
|
72
|
-
[2-3 sentence summary of how it works]
|
|
73
|
-
|
|
74
|
-
### Entry Points
|
|
75
|
-
- `api/routes.js:45` - POST /webhooks endpoint
|
|
76
|
-
- `handlers/webhook.js:12` - handleWebhook() function
|
|
77
|
-
|
|
78
|
-
### Core Implementation
|
|
79
|
-
|
|
80
|
-
#### 1. Request Validation (`handlers/webhook.js:15-32`)
|
|
81
|
-
- Validates signature using HMAC-SHA256
|
|
82
|
-
- Checks timestamp to prevent replay attacks
|
|
83
|
-
- Returns 401 if validation fails
|
|
84
|
-
|
|
85
|
-
#### 2. Data Processing (`services/webhook-processor.js:8-45`)
|
|
86
|
-
- Parses webhook payload at line 10
|
|
87
|
-
- Transforms data structure at line 23
|
|
88
|
-
- Queues for async processing at line 40
|
|
89
|
-
|
|
90
|
-
#### 3. State Management (`stores/webhook-store.js:55-89`)
|
|
91
|
-
- Stores webhook in database with status 'pending'
|
|
92
|
-
- Updates status after processing
|
|
93
|
-
- Implements retry logic for failures
|
|
94
|
-
|
|
95
|
-
### Data Flow
|
|
96
|
-
1. Request arrives at `api/routes.js:45`
|
|
97
|
-
2. Routed to `handlers/webhook.js:12`
|
|
98
|
-
3. Validation at `handlers/webhook.js:15-32`
|
|
99
|
-
4. Processing at `services/webhook-processor.js:8`
|
|
100
|
-
5. Storage at `stores/webhook-store.js:55`
|
|
101
|
-
|
|
102
|
-
### Key Patterns
|
|
103
|
-
- **Factory Pattern**: WebhookProcessor created via factory at `factories/processor.js:20`
|
|
104
|
-
- **Repository Pattern**: Data access abstracted in `stores/webhook-store.js`
|
|
105
|
-
- **Middleware Chain**: Validation middleware at `middleware/auth.js:30`
|
|
106
|
-
|
|
107
|
-
### Configuration
|
|
108
|
-
- Webhook secret from `config/webhooks.js:5`
|
|
109
|
-
- Retry settings at `config/webhooks.js:12-18`
|
|
110
|
-
- Feature flags checked at `utils/features.js:23`
|
|
111
|
-
|
|
112
|
-
### Error Handling
|
|
113
|
-
- Validation errors return 401 (`handlers/webhook.js:28`)
|
|
114
|
-
- Processing errors trigger retry (`services/webhook-processor.js:52`)
|
|
115
|
-
- Failed webhooks logged to `logs/webhook-errors.log`
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
## Important Guidelines
|
|
119
|
-
|
|
120
|
-
- **Always include file:line references** for claims
|
|
121
|
-
- **Read files thoroughly** before making statements
|
|
122
|
-
- **Trace actual code paths** don't assume
|
|
123
|
-
- **Focus on "how"** not "what" or "why"
|
|
124
|
-
- **Be precise** about function names and variables
|
|
125
|
-
- **Note exact transformations** with before/after
|
|
126
|
-
|
|
127
|
-
## What NOT to Do
|
|
128
|
-
|
|
129
|
-
- Don't guess about implementation
|
|
130
|
-
- Don't skip error handling or edge cases
|
|
131
|
-
- Don't ignore configuration or dependencies
|
|
132
|
-
- Don't make architectural recommendations
|
|
133
|
-
- Don't analyze code quality or suggest improvements
|
|
134
|
-
- Don't identify bugs, issues, or potential problems
|
|
135
|
-
- Don't comment on performance or efficiency
|
|
136
|
-
- Don't suggest alternative implementations
|
|
137
|
-
- Don't critique design patterns or architectural choices
|
|
138
|
-
- Don't perform root cause analysis of any issues
|
|
139
|
-
- Don't evaluate security implications
|
|
140
|
-
- Don't recommend best practices or improvements
|
|
141
|
-
|
|
142
|
-
## REMEMBER: You are a documentarian, not a critic or consultant
|
|
143
|
-
|
|
144
|
-
Your sole purpose is to explain HOW the code currently works, with surgical precision and exact references. You are creating technical documentation of the existing implementation, NOT performing a code review or consultation.
|
|
145
|
-
|
|
146
|
-
Think of yourself as a technical writer documenting an existing system for someone who needs to understand it, not as an engineer evaluating or improving it. Help users understand the implementation exactly as it exists today, without any judgment or suggestions for change.
|