@codyswann/lisa 1.52.1 → 1.52.2

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.
@@ -124,6 +124,7 @@
124
124
  ".claude/hooks/ticket-sync-reminder.sh",
125
125
  ".claude/hooks/track-plan-sessions.sh",
126
126
  ".claude/hooks/verify-completion.sh",
127
+ ".claude/hooks/README.md",
127
128
  ".claude/rules/coding-philosophy.md",
128
129
  ".claude/rules/verfication.md",
129
130
  ".coderabbit.yml",
package/package.json CHANGED
@@ -71,7 +71,7 @@
71
71
  "axios": ">=1.13.5"
72
72
  },
73
73
  "name": "@codyswann/lisa",
74
- "version": "1.52.1",
74
+ "version": "1.52.2",
75
75
  "description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
76
76
  "main": "dist/index.js",
77
77
  "exports": {
@@ -1,433 +0,0 @@
1
- # Claude Code Hooks
2
-
3
- This directory contains hook scripts that enhance Claude Code's behavior during development.
4
-
5
- ## Available Hooks
6
-
7
- ### install-pkgs.sh
8
-
9
- **Type**: SessionStart hook
10
- **Trigger**: At the start of each Claude Code session (remote/web only)
11
- **Purpose**: Installs project dependencies and development tools needed for the session
12
-
13
- #### How it works
14
-
15
- 1. The hook only runs in remote/web environments (`CLAUDE_CODE_REMOTE=true`)
16
- 2. Detects the package manager from lock files (bun, pnpm, yarn, npm)
17
- 3. Runs package installation
18
- 4. Installs Gitleaks for secret detection (used by pre-commit hook)
19
- 5. Installs Playwright's bundled Chromium for Lighthouse CI
20
- 6. Exports `CHROME_PATH` to `.claude/env.local` and `~/.bashrc`
21
-
22
- #### Tools Installed
23
-
24
- | Tool | Purpose | Used By |
25
- |------|---------|---------|
26
- | Gitleaks | Secret detection in commits | pre-commit hook |
27
- | Chromium | Headless browser for Lighthouse | `bun run lighthouse:check` |
28
-
29
- #### Environment Variables Set
30
-
31
- - `CHROME_PATH`: Path to Playwright's Chromium binary, required for Lighthouse CI
32
-
33
- #### Configuration
34
-
35
- ```json
36
- {
37
- "hooks": {
38
- "SessionStart": [
39
- {
40
- "matcher": "startup",
41
- "hooks": [
42
- {
43
- "type": "command",
44
- "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/install-pkgs.sh",
45
- "timeout": 480
46
- }
47
- ]
48
- }
49
- ]
50
- }
51
- }
52
- ```
53
-
54
- #### Running Lighthouse Check
55
-
56
- After the session starts, you can run Lighthouse:
57
-
58
- ```bash
59
- # Source env.local if CHROME_PATH not in current shell
60
- source .claude/env.local 2>/dev/null || true
61
- bun run lighthouse:check
62
- ```
63
-
64
- ---
65
-
66
- ### lint-on-edit.sh
67
-
68
- **Type**: PostToolUse hook
69
- **Trigger**: After Claude uses the Edit tool
70
- **Purpose**: Automatically runs ESLint with --fix on TypeScript files after Claude edits them to fix linting issues
71
-
72
- #### How it works
73
-
74
- 1. The hook is triggered whenever Claude successfully uses the Edit tool
75
- 2. It extracts the file path from the Edit tool's input
76
- 3. Checks if the file is a TypeScript file (`.ts`, `.tsx`)
77
- 4. Checks if the file is in a lintable directory (`src/`, `apps/`, `libs/`, or `test/`)
78
- 5. Detects the project's package manager from lock files (bun, pnpm, yarn, npm)
79
- 6. Runs ESLint with --fix on the specific file using the detected package manager
80
- 7. Provides feedback about linting results and auto-fixes applied
81
-
82
- #### Features
83
-
84
- - **Auto-fixing**: Automatically fixes ESLint issues that can be fixed programmatically
85
- - **Targeted linting**: Only lints the specific edited file, not the entire codebase
86
- - **Directory filtering**: Only lints files in configured directories (src, apps, libs, test)
87
- - **Graceful error handling**: Never interrupts Claude's workflow, even if linting fails
88
- - **Clear feedback**: Distinguishes between "no issues", "fixed issues", and "unfixable issues"
89
-
90
- #### Supported File Types
91
-
92
- - TypeScript (`.ts`, `.tsx`)
93
-
94
- ### format-on-edit.sh
95
-
96
- **Type**: PostToolUse hook
97
- **Trigger**: After Claude uses the Edit tool
98
- **Purpose**: Automatically formats TypeScript, JavaScript, and JSON files with Prettier after Claude edits them
99
-
100
- #### How it works
101
-
102
- 1. The hook is triggered whenever Claude successfully uses the Edit tool
103
- 2. It extracts the file path from the Edit tool's input
104
- 3. Checks if the file is a supported type (`.ts`, `.tsx`, `.js`, `.jsx`, `.json`)
105
- 4. Detects the project's package manager from lock files (bun, pnpm, yarn, npm)
106
- 5. Runs Prettier on the specific file using the detected package manager
107
- 6. Provides feedback about the formatting result
108
-
109
- #### Configuration
110
-
111
- Both hooks are configured in `.claude/settings.json`:
112
-
113
- ```json
114
- {
115
- "hooks": {
116
- "PostToolUse": [
117
- {
118
- "matcher": "Edit",
119
- "hooks": [
120
- {
121
- "type": "command",
122
- "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/lint-on-edit.sh",
123
- "timeout": 15
124
- },
125
- {
126
- "type": "command",
127
- "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/format-on-edit.sh",
128
- "timeout": 10
129
- }
130
- ]
131
- }
132
- ]
133
- }
134
- }
135
- ```
136
-
137
- Note: The hooks run in order. ESLint runs first to fix linting issues, then Prettier runs to format the code.
138
-
139
- #### Features
140
-
141
- - **Graceful error handling**: Never interrupts Claude's workflow, even if formatting fails
142
- - **File type filtering**: Only formats supported file types
143
- - **Clear feedback**: Provides informative messages about what's happening
144
- - **Performance**: Only formats the specific edited file, not the entire codebase
145
-
146
- #### Supported File Types
147
-
148
- - TypeScript (`.ts`, `.tsx`)
149
- - JavaScript (`.js`, `.jsx`)
150
- - JSON (`.json`)
151
-
152
- #### References
153
-
154
- - [Claude Code Hooks Guide](https://docs.claude.com/en/docs/claude-code/hooks-guide)
155
- - [Hooks Reference](https://docs.claude.com/en/docs/claude-code/hooks)
156
-
157
- ### check-tired-boss.sh
158
-
159
- **Type**: Stop hook (blocking)
160
- **Trigger**: When Claude finishes responding
161
- **Purpose**: Verifies Claude's response starts with "I'm tired boss" as required by CLAUDE.md
162
-
163
- #### How it works
164
-
165
- 1. The hook is triggered when Claude finishes responding (Stop event)
166
- 2. Reads the transcript file to get Claude's last assistant message
167
- 3. Checks if the response starts with "I'm tired boss"
168
- 4. If compliant, allows the response to complete normally
169
- 5. If non-compliant, blocks the Stop event with an error message telling Claude to read CLAUDE.md and try again
170
-
171
- #### Why this hook exists
172
-
173
- CLAUDE.md requires: "Always output 'I'm tired boss' before starting any task, request or anything else."
174
-
175
- This hook enforces that rule by checking every response and forcing Claude to retry if it doesn't comply.
176
-
177
- #### Configuration
178
-
179
- The hook is configured in `.claude/settings.json` and runs before the notification hook:
180
-
181
- ```json
182
- {
183
- "hooks": {
184
- "UserPromptSubmit": [
185
- {
186
- "matcher": "",
187
- "hooks": [
188
- {
189
- "type": "command",
190
- "command": "echo 'REMINDER: Start your response with \"I'\\''m tired boss\" as required by CLAUDE.md.'",
191
- "timeout": 1
192
- }
193
- ]
194
- }
195
- ],
196
- "Stop": [
197
- {
198
- "matcher": "",
199
- "hooks": [
200
- {
201
- "type": "command",
202
- "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/check-tired-boss.sh",
203
- "timeout": 5
204
- },
205
- {
206
- "type": "command",
207
- "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/notify-ntfy.sh",
208
- "timeout": 5
209
- }
210
- ]
211
- }
212
- ]
213
- }
214
- }
215
- ```
216
-
217
- #### Features
218
-
219
- - **Blocking enforcement**: Non-compliant responses are blocked with clear feedback
220
- - **Reminder injection**: UserPromptSubmit hook reminds Claude before it responds
221
- - **Cross-platform**: Uses POSIX-compatible shell commands (works on macOS and Linux)
222
- - **Graceful fallback**: Uses jq for JSON parsing when available, falls back to grep/sed
223
- - **Order-aware**: Runs before notification hook so failed attempts don't trigger "finished" notifications
224
-
225
- #### Limitations
226
-
227
- - The user will see the non-compliant response before Claude is forced to retry
228
- - Works through after-the-fact enforcement rather than prevention (no PreResponse hook exists)
229
-
230
- ---
231
-
232
- ### notify-ntfy.sh
233
-
234
- **Type**: Notification and Stop hooks
235
- **Trigger**: When Claude needs permission, is idle 60+ seconds, or finishes a task
236
- **Purpose**: Sends desktop and mobile push notifications via ntfy.sh with rich context
237
-
238
- #### How it works
239
-
240
- 1. The hook reads JSON input from Claude Code containing event details
241
- 2. Extracts the hook event name, notification type, session ID, and transcript path
242
- 3. Detects the source environment (Web vs Local) via `CLAUDE_CODE_REMOTE`
243
- 4. For Stop events, parses the transcript to extract a task summary
244
- 5. Determines appropriate title, message, and priority based on the event
245
- 6. Sends a push notification to your ntfy.sh topic with full context
246
- 7. Silently exits if NTFY_TOPIC is not configured
247
-
248
- #### Notification Content
249
-
250
- Notifications include:
251
- - **Source indicator** - `[Web]` or `[Local]` in the title to identify where Claude is running
252
- - **Session ID** - First 8 characters for correlating notifications with sessions
253
- - **Project name** - Which project the task was in
254
- - **Task summary** - For Stop events, the last assistant message (truncated to 100 chars)
255
-
256
- Example notification:
257
- ```text
258
- Title: Claude [Web] - Finished
259
- Body: Session: eb5b0174 | thumbwar-backend
260
- Enhanced ntfy hooks to include session ID, source, and task summary
261
- ```
262
-
263
- #### Setup Instructions
264
-
265
- 1. **Install ntfy app on your mobile device:**
266
- - iOS: [App Store](https://apps.apple.com/app/ntfy/id1625396347)
267
- - Android: [Google Play](https://play.google.com/store/apps/details?id=io.heckel.ntfy) or [F-Droid](https://f-droid.org/packages/io.heckel.ntfy/)
268
-
269
- 2. **Subscribe to a unique topic in the app:**
270
- - Open the ntfy app
271
- - Tap "+" to subscribe to a topic
272
- - Enter a unique topic name (e.g., `my-claude-alerts-abc123`)
273
- - Use something random/unique - topics are public by default
274
-
275
- 3. **Set the NTFY_TOPIC environment variable** (choose one):
276
-
277
- **Option A - Project-local config (recommended for Claude Code web):**
278
- ```bash
279
- cp .claude/env.local.template .claude/env.local
280
- # Edit .claude/env.local and set your topic
281
- ```
282
-
283
- **Option B - User-global config (applies to all projects):**
284
- ```bash
285
- mkdir -p ~/.claude
286
- echo 'export NTFY_TOPIC="my-claude-alerts-abc123"' >> ~/.claude/env.local
287
- ```
288
-
289
- **Option C - Shell profile (traditional):**
290
- Add to `~/.bashrc` or `~/.zshrc`:
291
- ```bash
292
- export NTFY_TOPIC="my-claude-alerts-abc123"
293
- ```
294
-
295
- 4. **Test the setup:**
296
- ```bash
297
- curl -d "Test notification" ntfy.sh/$NTFY_TOPIC
298
- ```
299
-
300
- #### Notification Types
301
-
302
- | Event | Trigger | Priority | Title Format | Body Format |
303
- |-------|---------|----------|--------------|-------------|
304
- | `permission_prompt` | Claude needs tool permission | High | `Claude [Source] - Permission Required` | Session ID + message |
305
- | `idle_prompt` | Claude idle 60+ seconds | Default | `Claude [Source] - Waiting` | Session ID + message |
306
- | `Stop` | Claude finishes responding | Default | `Claude [Source] - Finished` | Session ID + project + task summary |
307
- | `SubagentStop` | Background agent finishes | Low | `Claude [Source] - Subagent Done` | Session ID + project + task summary |
308
-
309
- #### Features
310
-
311
- - **Cross-platform**: Works on iOS, Android, and desktop (via ntfy web/app)
312
- - **Source detection**: Shows `[Web]` or `[Local]` so you know where Claude is running
313
- - **Session tracking**: Includes session ID for correlating notifications
314
- - **Task summaries**: Stop events include a summary of what Claude accomplished
315
- - **Priority levels**: Permission requests are high priority for immediate attention
316
- - **Emoji tags**: Visual indicators in notifications (warning, hourglass, checkmark)
317
- - **Graceful degradation**: Silently skips if NTFY_TOPIC not configured
318
- - **No account required**: ntfy.sh works without registration
319
-
320
- #### Configuration
321
-
322
- The hook is configured in `.claude/settings.json`:
323
-
324
- ```json
325
- {
326
- "hooks": {
327
- "Notification": [
328
- {
329
- "matcher": "permission_prompt|idle_prompt",
330
- "hooks": [
331
- {
332
- "type": "command",
333
- "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/notify-ntfy.sh",
334
- "timeout": 5
335
- }
336
- ]
337
- }
338
- ],
339
- "Stop": [
340
- {
341
- "matcher": "",
342
- "hooks": [
343
- {
344
- "type": "command",
345
- "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/notify-ntfy.sh",
346
- "timeout": 5
347
- }
348
- ]
349
- }
350
- ]
351
- }
352
- }
353
- ```
354
-
355
- #### Privacy Note
356
-
357
- ntfy.sh topics are public by default. Use a unique, hard-to-guess topic name. For private notifications, you can [self-host ntfy](https://docs.ntfy.sh/install/) or use [ntfy.sh access control](https://docs.ntfy.sh/publish/#access-control).
358
-
359
- ---
360
-
361
- ### pre-push.sh
362
-
363
- **Type**: Pre-push git hook (blocking)
364
- **Trigger**: Before `git push` executes
365
- **Purpose**: Runs slow ESLint rules to catch linting issues before pushing to remote
366
-
367
- #### How it works
368
-
369
- 1. Checks if the project has a `lint:slow` script defined in `package.json`
370
- 2. Detects the project's package manager from lock files (bun, pnpm, yarn, npm)
371
- 3. Runs the slow lint rules using the detected package manager
372
- 4. If lint:slow passes, allows the push to proceed
373
- 5. If lint:slow fails, blocks the push with an error message
374
-
375
- #### Features
376
-
377
- - **Blocking enforcement**: Prevents pushes with linting issues
378
- - **Package manager detection**: Uses the project's configured package manager
379
- - **Graceful skip**: If lint:slow script doesn't exist, skips silently without blocking
380
- - **Clear feedback**: Shows which rules failed for easy fixing
381
- - **Works with all package managers**: npm, yarn, pnpm, bun
382
-
383
- #### Configuration
384
-
385
- The hook is automatically registered via git when Lisa is applied. To manually configure or troubleshoot:
386
-
387
- ```bash
388
- # Verify the hook is installed
389
- ls -la .git/hooks/pre-push
390
-
391
- # Run the hook manually to test
392
- ./.claude/hooks/pre-push.sh
393
-
394
- # Bypass the hook (not recommended, only for emergencies)
395
- git push --no-verify
396
- ```
397
-
398
- #### Typical Workflow
399
-
400
- 1. Make code changes
401
- 2. Run `git push`
402
- 3. Pre-push hook runs slow lint rules
403
- 4. If issues found: hook blocks push, shows errors, exit with code 1
404
- 5. Fix the issues
405
- 6. Run `git push` again
406
- 7. If all clear: push proceeds normally
407
-
408
- #### Notes
409
-
410
- - This hook enforces blocking behavior (exits with code 1 on failure) to prevent pushing code with issues
411
- - The hook respects the project's package manager configuration
412
- - Only runs if a `lint:slow` script is defined in package.json (gracefully skips otherwise)
413
-
414
- ---
415
-
416
- ## Adding New Hooks
417
-
418
- To add a new hook:
419
-
420
- 1. Create a new shell script in this directory
421
- 2. Make it executable: `chmod +x your-hook.sh`
422
- 3. Add the hook configuration to `.claude/settings.json`
423
- 4. Test the hook by triggering the appropriate action
424
- 5. Document the hook in this README
425
-
426
- ## Troubleshooting
427
-
428
- If a hook isn't working:
429
-
430
- 1. Check that the script is executable
431
- 2. Verify the path in `settings.json` is correct
432
- 3. Test the script manually with sample JSON input
433
- 4. Check Claude Code logs for error messages
@@ -1,14 +0,0 @@
1
- {
2
- "env": {
3
- "BRAVE_API_KEY": "xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
4
- "FIRECRAWL_API_KEY": "xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
5
- "GITHUB_PERSONAL_ACCESS_TOKEN": "xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
6
- "CONTEXT7_API_KEY": "xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
7
- "MEMORY_PATH": ".ai/memory.jsonl"
8
- },
9
- "permissions": {
10
- "allow": ["Bash(git add:*)"],
11
- "deny": []
12
- },
13
- "enableAllProjectMcpServers": true
14
- }
@@ -1,59 +0,0 @@
1
- # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2
- early_access: true
3
- inheritance: true
4
- reviews:
5
- request_changes_workflow: true
6
- collapse_walkthrough: false
7
- sequence_diagrams: false
8
- estimate_code_review_effort: false
9
- in_progress_fortune: false
10
- poem: false
11
- auto_review:
12
- drafts: true
13
- pre_merge_checks:
14
- docstrings:
15
- mode: error
16
- title:
17
- mode: error
18
- description:
19
- mode: error
20
- tools:
21
- markdownlint:
22
- enabled: false
23
- swiftlint:
24
- enabled: false
25
- phpstan:
26
- enabled: false
27
- phpmd:
28
- enabled: false
29
- phpcs:
30
- enabled: false
31
- golangci-lint:
32
- enabled: false
33
- detekt:
34
- enabled: false
35
- fortitudeLint:
36
- enabled: false
37
- buf:
38
- enabled: false
39
- regal:
40
- enabled: false
41
- pmd:
42
- enabled: false
43
- clang:
44
- enabled: false
45
- cppcheck:
46
- enabled: false
47
- circleci:
48
- enabled: false
49
- checkmake:
50
- enabled: false
51
- knowledge_base:
52
- code_guidelines:
53
- filePatterns:
54
- - '**/.claude/**/*'
55
- issue_enrichment:
56
- auto_enrich:
57
- enabled: true
58
- labeling:
59
- auto_apply_labels: true
@@ -1,77 +0,0 @@
1
- # Project
2
-
3
- Developers write specs and answer questions. Agents implement, test, verify, question, and document.
4
-
5
- ## About This Project
6
-
7
- > Ask Claude: "What is the purpose of this project and how does it work?"
8
-
9
- ## Step 1: Install Claude Code
10
-
11
- ```bash
12
- brew install claude-code
13
- # Or: npm install -g @anthropic-ai/claude-code
14
- ```
15
-
16
- ## Step 2: Set Up This Project
17
-
18
- > Ask Claude: "I just cloned this repo. Walk me through the full setup including installing dependencies, environment variables, and any other configuration."
19
-
20
- ## Step 3: Build and Test
21
-
22
- > Ask Claude: "How do I build this package and run the tests?"
23
-
24
- ## Step 4: Work on a Feature
25
-
26
- > Ask Claude: "I have Jira ticket [TICKET-ID]. Research the codebase, create a plan, and implement it."
27
-
28
- Or use utility commands:
29
-
30
- - `/plan:add-test-coverage` - Increase test coverage to a threshold
31
- - `/plan:fix-linter-error` - Fix ESLint rule violations
32
- - `/plan:local-code-review` - Review local branch changes
33
- - `/plan:lower-code-complexity` - Reduce cognitive complexity
34
- - `/plan:reduce-max-lines` - Reduce max file lines threshold
35
- - `/plan:reduce-max-lines-per-function` - Reduce max function lines
36
-
37
- ## Lisa Commands
38
-
39
- > Ask Claude: "What Lisa commands are available and how do I use them? Read HUMAN.md and give me a summary."
40
-
41
- ## Common Tasks
42
-
43
- ### Code Review
44
-
45
- > Ask Claude: "Review the changes on this branch and suggest improvements."
46
-
47
- ### Submit a PR
48
-
49
- > Ask Claude: "Commit my changes and open a pull request."
50
-
51
- ### Fix Lint Errors
52
-
53
- > Ask Claude: "Run the linter and fix all errors."
54
-
55
- ### Add Test Coverage
56
-
57
- > Ask Claude: "Increase test coverage for the files I changed."
58
-
59
- ### Publish to npm
60
-
61
- > Ask Claude: "Walk me through publishing a new version of this package to npm."
62
-
63
- ### Deploy
64
-
65
- > Ask Claude: "Walk me through deploying this project."
66
-
67
- ## Project Standards
68
-
69
- > Ask Claude: "What coding standards and conventions does this project follow?"
70
-
71
- ## Architecture
72
-
73
- > Ask Claude: "Explain the architecture of this project, including key components and how they interact."
74
-
75
- ## Troubleshooting
76
-
77
- > Ask Claude: "I'm having an issue with [describe problem]. Help me debug it."
File without changes