@codyswann/lisa 1.85.10 → 1.86.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/package.json CHANGED
@@ -78,7 +78,7 @@
78
78
  "lodash": ">=4.18.1"
79
79
  },
80
80
  "name": "@codyswann/lisa",
81
- "version": "1.85.10",
81
+ "version": "1.86.0",
82
82
  "description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
83
83
  "main": "dist/index.js",
84
84
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "1.85.10",
3
+ "version": "1.86.0",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -3,4 +3,4 @@ description: "Deploys an agent team to research, implement, review and deploy a
3
3
  argument-hint: "<ticket-url | @file-path | description>"
4
4
  ---
5
5
 
6
- Read `.claude/rules/intent-routing.md` and determine the appropriate flow for $ARGUMENTS. Execute the full flow including implementation, review, and verify flows.
6
+ Pass through to `/build` with $ARGUMENTS. The Build command reads `.claude/rules/intent-routing.md` and runs the full Implement Review Verify chain, which is what this command historically did.
@@ -72,6 +72,13 @@ JIRA Discipline:
72
72
  Agent Behavior:
73
73
  - Never handle tasks yourself when working in a team of agents. Always delegate to a specialized agent.
74
74
 
75
+ Pace:
76
+ - Never rush. There is no pressure to finish quickly. Speed is not a measure of quality, and a fast wrong answer is worse than a slow correct one.
77
+ - Take the time to read the relevant code in full, verify assumptions empirically, ask clarifying questions when something is ambiguous, and check your work before declaring it done.
78
+ - Do not skip steps to save time — quality gates, verification, reading existing code, asking the user — these exist because shortcuts cost more than they save.
79
+ - If a task feels like it's taking "too long," that is almost always a sign that the task is harder than it first appeared, not a sign that you should cut corners. Surface the difficulty to the user instead of compressing the work.
80
+ - Optimize for being correct, thorough, and reversible. Time spent doing the work right is never wasted; time spent recovering from a rushed answer often is.
81
+
75
82
  NEVER:
76
83
  - Modify this file directly. To add a memory or learning, use the project's rules file or create a skill.
77
84
  - Directly modify files inside dependency directories (e.g. node_modules, .venv, vendor, target).
@@ -253,3 +253,40 @@ The full lifecycle for a large initiative: Research -> Plan -> Implement (per it
253
253
  ## Sub-flow Usage
254
254
 
255
255
  Flows reference sub-flows by name. When a flow says "Investigate sub-flow", execute the full Investigate sub-flow sequence. When it says "Review sub-flow", execute the full Review sequence. Sub-flows can be invoked by any main flow.
256
+
257
+ ## Orchestration
258
+
259
+ How a flow dispatches its agents depends on the flow's shape. Pick the orchestration mode that matches the work — do not default to the heaviest one.
260
+
261
+ ### Agent Teams (default for multi-step flows)
262
+
263
+ Use an **agent team** (TeamCreate + TaskCreate per step) for:
264
+
265
+ - **Implement** (Build, Fix, Improve) — long sequences with parallel review and a real risk of compaction
266
+ - **Plan** — multiple specialists feeding a shared decomposition
267
+ - **Research** — multiple specialists feeding a shared PRD
268
+ - Any flow that invokes the **Review sub-flow** (the four review specialists run in parallel and gate a single follow-up task)
269
+
270
+ Why: these flows have enough steps that context compaction is likely; the Review sub-flow is parallel-by-design and `blockedBy` expresses that cleanly; durable task state lets the team lead recover assignments after compaction.
271
+
272
+ When using a team:
273
+
274
+ 1. Create one team per top-level flow invocation. Do not nest teams for sub-flows — sub-flow steps become tasks within the existing team.
275
+ 2. Express parallelism with `blockedBy`. The Review sub-flow's four specialists are independent; the "implement valid suggestions" task is `blockedBy` all four.
276
+ 3. On every TaskUpdate that sets `owner`, also store it in `metadata.owner` so the assignment survives context compaction.
277
+ 4. Re-read TaskList after any compaction event before assigning new work.
278
+
279
+ ### One-shot Sub-agents (for short or single-agent flows)
280
+
281
+ Use direct `Agent` tool invocations (no team) for:
282
+
283
+ - **Verify** when run standalone — it's a linear gate sequence with no parallelism
284
+ - **Monitor** standalone — single specialist (`ops-specialist`) producing a report
285
+ - **Investigate Only** spikes — single investigation, findings out
286
+ - Any flow chained as a sub-flow inside a larger team — its agents become tasks in the parent team, not a new team
287
+
288
+ Why: TeamCreate plus per-step TaskCreate is real overhead. For a one-or-two-agent flow with no parallelism, the bookkeeping cost outweighs the recovery and orchestration benefits.
289
+
290
+ ### When in doubt
291
+
292
+ If the flow has more than three agent steps, or any parallel step, or is likely to span a compaction boundary, use a team. Otherwise, sub-agents are fine.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "1.85.10",
3
+ "version": "1.86.0",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "1.85.10",
3
+ "version": "1.86.0",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,9 +1,21 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "1.85.10",
4
- "description": "NestJS-specific skills (GraphQL, TypeORM)",
3
+ "version": "1.86.0",
4
+ "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
7
7
  },
8
- "hooks": {}
8
+ "hooks": {
9
+ "PreToolUse": [
10
+ {
11
+ "matcher": "Write|Edit",
12
+ "hooks": [
13
+ {
14
+ "type": "command",
15
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/block-migration-edits.sh"
16
+ }
17
+ ]
18
+ }
19
+ ]
20
+ }
9
21
  }
@@ -0,0 +1,60 @@
1
+ #!/bin/bash
2
+ # This file is managed by Lisa.
3
+ # Do not edit directly — changes will be overwritten on the next `lisa` run.
4
+
5
+ # PreToolUse hook: block Write/Edit on TypeORM migration files.
6
+ # NestJS projects must use `bun run migration:generate` to create migrations
7
+ # from entity diffs. Hand-written migrations drift from entity metadata and
8
+ # break the schema/migration contract.
9
+ # Reference: https://docs.claude.com/en/docs/claude-code/hooks
10
+ # Exit code 2 blocks the tool call and surfaces stderr to Claude.
11
+
12
+ JSON_INPUT=$(cat)
13
+
14
+ if ! command -v jq >/dev/null 2>&1; then
15
+ echo "⚠ block-migration-edits: jq not available, allowing edit" >&2
16
+ exit 0
17
+ fi
18
+
19
+ FILE_PATH=$(echo "$JSON_INPUT" | jq -r '.tool_input.file_path // empty')
20
+
21
+ if [ -z "$FILE_PATH" ]; then
22
+ exit 0
23
+ fi
24
+
25
+ case "$FILE_PATH" in
26
+ */migrations/*.ts|*/migrations/*.js)
27
+ cat >&2 <<EOF
28
+ ❌ Blocked: Direct edits to TypeORM migration files are not allowed.
29
+
30
+ File: $FILE_PATH
31
+
32
+ Entity files (src/database/entities/*.ts) are the single source of
33
+ truth for the database schema in this project. Migrations are a derived
34
+ artifact — generate them from entity diffs:
35
+
36
+ 1. Edit the entity to express the desired schema.
37
+ 2. Run: bun run migration:generate --name=<DescriptiveName>
38
+ 3. Review the generated migration; commit entity + migration together.
39
+
40
+ If a schema change cannot be expressed via the entity model, the entity
41
+ model is wrong — fix the entity, do not hand-write the migration.
42
+
43
+ OUT-OF-BAND MIGRATIONS (seed data, backfills, data transformations,
44
+ one-off cleanup): these genuinely cannot come from entity diffs. They
45
+ are legitimate but they bypass the entity-as-source-of-truth contract.
46
+
47
+ If you believe this edit is an out-of-band migration:
48
+ 1. STOP and tell the user what change is needed and why it cannot
49
+ be expressed via the entity model.
50
+ 2. Get explicit approval before proceeding.
51
+ 3. Document the rationale in the migration's class comment.
52
+
53
+ Do NOT silently hand-write a migration. See the nestjs-rules skill
54
+ for the full rationale.
55
+ EOF
56
+ exit 2
57
+ ;;
58
+ esac
59
+
60
+ exit 0
@@ -43,15 +43,44 @@ The `--no-spec` flag is used because this project follows TDD (Test-Driven Devel
43
43
 
44
44
  ## Database Migrations
45
45
 
46
+ ### Entity Files Are the Source of Truth
47
+
48
+ In this project, **entity files (`src/database/entities/*.ts`) are the single source of truth for the database schema**. Migrations are a derived artifact — TypeORM diffs the entity metadata against the current database and emits the migration for you. The workflow is always:
49
+
50
+ 1. Edit the entity file to express the desired schema.
51
+ 2. Run `bun run migration:generate --name=<DescriptiveName>` to produce the migration from the diff.
52
+ 3. Review the generated migration, then commit both the entity change and the migration together.
53
+
54
+ If a schema change cannot be expressed via the entity model, the entity model is wrong — fix the entity, do not hand-write the migration.
55
+
46
56
  ### Never Create Migration Files Manually
47
57
 
48
- Never create or modify a TypeORM migration file directly. Instead, use `migration:generate` from `package.json`:
58
+ Never create or modify a TypeORM migration file directly. Use `migration:generate` from `package.json`:
49
59
 
50
60
  ```bash
51
- bun run migration:generate
61
+ bun run migration:generate --name=<DescriptiveName>
52
62
  ```
53
63
 
54
- **Exception**: Direct modification is allowed only for changes that don't break syncing with entity files (e.g., adding indexes, comments, or non-structural changes).
64
+ ### Out-of-Band Migrations (Seed Data, Backfills)
65
+
66
+ Some changes genuinely cannot be derived from entity diffs:
67
+
68
+ - **Seed data** (reference rows, lookup tables, initial admin user)
69
+ - **Data backfills** (populating a new column from existing rows)
70
+ - **Data transformations** (splitting a column, normalizing values)
71
+ - **One-off cleanup** (deleting orphaned rows before a constraint is added)
72
+
73
+ These are legitimate cases for a hand-written migration, but they are **out-of-band** — they bypass the entity-as-source-of-truth contract. When you encounter one:
74
+
75
+ 1. **Stop and tell the user.** Explain what change is needed and why it cannot be expressed via the entity model.
76
+ 2. **Get explicit approval** before writing the migration by hand.
77
+ 3. Document the rationale in the migration's class comment so future readers understand why this one was not generated.
78
+
79
+ Do not silently hand-write a migration for a backfill or seed-data change. The user must know that the entity-as-source-of-truth contract is being intentionally bypassed for this case.
80
+
81
+ ### Enforcement
82
+
83
+ The `lisa-nestjs` plugin ships a `PreToolUse` hook (`block-migration-edits.sh`) that blocks `Write`/`Edit` on any path matching `**/migrations/*.ts` or `**/migrations/*.js`. The block surfaces this rule's guidance to remind you to either (a) edit the entity instead, or (b) ask the user before proceeding with an out-of-band migration.
55
84
 
56
85
  ### Why Auto-Generation
57
86
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "1.85.10",
3
+ "version": "1.86.0",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "1.85.10",
3
+ "version": "1.86.0",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -3,4 +3,4 @@ description: "Deploys an agent team to research, implement, review and deploy a
3
3
  argument-hint: "<ticket-url | @file-path | description>"
4
4
  ---
5
5
 
6
- Read `.claude/rules/intent-routing.md` and determine the appropriate flow for $ARGUMENTS. Execute the full flow including implementation, review, and verify flows.
6
+ Pass through to `/build` with $ARGUMENTS. The Build command reads `.claude/rules/intent-routing.md` and runs the full Implement Review Verify chain, which is what this command historically did.
@@ -72,6 +72,13 @@ JIRA Discipline:
72
72
  Agent Behavior:
73
73
  - Never handle tasks yourself when working in a team of agents. Always delegate to a specialized agent.
74
74
 
75
+ Pace:
76
+ - Never rush. There is no pressure to finish quickly. Speed is not a measure of quality, and a fast wrong answer is worse than a slow correct one.
77
+ - Take the time to read the relevant code in full, verify assumptions empirically, ask clarifying questions when something is ambiguous, and check your work before declaring it done.
78
+ - Do not skip steps to save time — quality gates, verification, reading existing code, asking the user — these exist because shortcuts cost more than they save.
79
+ - If a task feels like it's taking "too long," that is almost always a sign that the task is harder than it first appeared, not a sign that you should cut corners. Surface the difficulty to the user instead of compressing the work.
80
+ - Optimize for being correct, thorough, and reversible. Time spent doing the work right is never wasted; time spent recovering from a rushed answer often is.
81
+
75
82
  NEVER:
76
83
  - Modify this file directly. To add a memory or learning, use the project's rules file or create a skill.
77
84
  - Directly modify files inside dependency directories (e.g. node_modules, .venv, vendor, target).
@@ -253,3 +253,40 @@ The full lifecycle for a large initiative: Research -> Plan -> Implement (per it
253
253
  ## Sub-flow Usage
254
254
 
255
255
  Flows reference sub-flows by name. When a flow says "Investigate sub-flow", execute the full Investigate sub-flow sequence. When it says "Review sub-flow", execute the full Review sequence. Sub-flows can be invoked by any main flow.
256
+
257
+ ## Orchestration
258
+
259
+ How a flow dispatches its agents depends on the flow's shape. Pick the orchestration mode that matches the work — do not default to the heaviest one.
260
+
261
+ ### Agent Teams (default for multi-step flows)
262
+
263
+ Use an **agent team** (TeamCreate + TaskCreate per step) for:
264
+
265
+ - **Implement** (Build, Fix, Improve) — long sequences with parallel review and a real risk of compaction
266
+ - **Plan** — multiple specialists feeding a shared decomposition
267
+ - **Research** — multiple specialists feeding a shared PRD
268
+ - Any flow that invokes the **Review sub-flow** (the four review specialists run in parallel and gate a single follow-up task)
269
+
270
+ Why: these flows have enough steps that context compaction is likely; the Review sub-flow is parallel-by-design and `blockedBy` expresses that cleanly; durable task state lets the team lead recover assignments after compaction.
271
+
272
+ When using a team:
273
+
274
+ 1. Create one team per top-level flow invocation. Do not nest teams for sub-flows — sub-flow steps become tasks within the existing team.
275
+ 2. Express parallelism with `blockedBy`. The Review sub-flow's four specialists are independent; the "implement valid suggestions" task is `blockedBy` all four.
276
+ 3. On every TaskUpdate that sets `owner`, also store it in `metadata.owner` so the assignment survives context compaction.
277
+ 4. Re-read TaskList after any compaction event before assigning new work.
278
+
279
+ ### One-shot Sub-agents (for short or single-agent flows)
280
+
281
+ Use direct `Agent` tool invocations (no team) for:
282
+
283
+ - **Verify** when run standalone — it's a linear gate sequence with no parallelism
284
+ - **Monitor** standalone — single specialist (`ops-specialist`) producing a report
285
+ - **Investigate Only** spikes — single investigation, findings out
286
+ - Any flow chained as a sub-flow inside a larger team — its agents become tasks in the parent team, not a new team
287
+
288
+ Why: TeamCreate plus per-step TaskCreate is real overhead. For a one-or-two-agent flow with no parallelism, the bookkeeping cost outweighs the recovery and orchestration benefits.
289
+
290
+ ### When in doubt
291
+
292
+ If the flow has more than three agent steps, or any parallel step, or is likely to span a compaction boundary, use a team. Otherwise, sub-agents are fine.
@@ -1,7 +1,19 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
3
  "version": "1.0.0",
4
- "description": "NestJS-specific skills (GraphQL, TypeORM)",
4
+ "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": { "name": "Cody Swann" },
6
- "hooks": {}
6
+ "hooks": {
7
+ "PreToolUse": [
8
+ {
9
+ "matcher": "Write|Edit",
10
+ "hooks": [
11
+ {
12
+ "type": "command",
13
+ "command": "${CLAUDE_PLUGIN_ROOT}/hooks/block-migration-edits.sh"
14
+ }
15
+ ]
16
+ }
17
+ ]
18
+ }
7
19
  }
@@ -0,0 +1,60 @@
1
+ #!/bin/bash
2
+ # This file is managed by Lisa.
3
+ # Do not edit directly — changes will be overwritten on the next `lisa` run.
4
+
5
+ # PreToolUse hook: block Write/Edit on TypeORM migration files.
6
+ # NestJS projects must use `bun run migration:generate` to create migrations
7
+ # from entity diffs. Hand-written migrations drift from entity metadata and
8
+ # break the schema/migration contract.
9
+ # Reference: https://docs.claude.com/en/docs/claude-code/hooks
10
+ # Exit code 2 blocks the tool call and surfaces stderr to Claude.
11
+
12
+ JSON_INPUT=$(cat)
13
+
14
+ if ! command -v jq >/dev/null 2>&1; then
15
+ echo "⚠ block-migration-edits: jq not available, allowing edit" >&2
16
+ exit 0
17
+ fi
18
+
19
+ FILE_PATH=$(echo "$JSON_INPUT" | jq -r '.tool_input.file_path // empty')
20
+
21
+ if [ -z "$FILE_PATH" ]; then
22
+ exit 0
23
+ fi
24
+
25
+ case "$FILE_PATH" in
26
+ */migrations/*.ts|*/migrations/*.js)
27
+ cat >&2 <<EOF
28
+ ❌ Blocked: Direct edits to TypeORM migration files are not allowed.
29
+
30
+ File: $FILE_PATH
31
+
32
+ Entity files (src/database/entities/*.ts) are the single source of
33
+ truth for the database schema in this project. Migrations are a derived
34
+ artifact — generate them from entity diffs:
35
+
36
+ 1. Edit the entity to express the desired schema.
37
+ 2. Run: bun run migration:generate --name=<DescriptiveName>
38
+ 3. Review the generated migration; commit entity + migration together.
39
+
40
+ If a schema change cannot be expressed via the entity model, the entity
41
+ model is wrong — fix the entity, do not hand-write the migration.
42
+
43
+ OUT-OF-BAND MIGRATIONS (seed data, backfills, data transformations,
44
+ one-off cleanup): these genuinely cannot come from entity diffs. They
45
+ are legitimate but they bypass the entity-as-source-of-truth contract.
46
+
47
+ If you believe this edit is an out-of-band migration:
48
+ 1. STOP and tell the user what change is needed and why it cannot
49
+ be expressed via the entity model.
50
+ 2. Get explicit approval before proceeding.
51
+ 3. Document the rationale in the migration's class comment.
52
+
53
+ Do NOT silently hand-write a migration. See the nestjs-rules skill
54
+ for the full rationale.
55
+ EOF
56
+ exit 2
57
+ ;;
58
+ esac
59
+
60
+ exit 0
@@ -43,15 +43,44 @@ The `--no-spec` flag is used because this project follows TDD (Test-Driven Devel
43
43
 
44
44
  ## Database Migrations
45
45
 
46
+ ### Entity Files Are the Source of Truth
47
+
48
+ In this project, **entity files (`src/database/entities/*.ts`) are the single source of truth for the database schema**. Migrations are a derived artifact — TypeORM diffs the entity metadata against the current database and emits the migration for you. The workflow is always:
49
+
50
+ 1. Edit the entity file to express the desired schema.
51
+ 2. Run `bun run migration:generate --name=<DescriptiveName>` to produce the migration from the diff.
52
+ 3. Review the generated migration, then commit both the entity change and the migration together.
53
+
54
+ If a schema change cannot be expressed via the entity model, the entity model is wrong — fix the entity, do not hand-write the migration.
55
+
46
56
  ### Never Create Migration Files Manually
47
57
 
48
- Never create or modify a TypeORM migration file directly. Instead, use `migration:generate` from `package.json`:
58
+ Never create or modify a TypeORM migration file directly. Use `migration:generate` from `package.json`:
49
59
 
50
60
  ```bash
51
- bun run migration:generate
61
+ bun run migration:generate --name=<DescriptiveName>
52
62
  ```
53
63
 
54
- **Exception**: Direct modification is allowed only for changes that don't break syncing with entity files (e.g., adding indexes, comments, or non-structural changes).
64
+ ### Out-of-Band Migrations (Seed Data, Backfills)
65
+
66
+ Some changes genuinely cannot be derived from entity diffs:
67
+
68
+ - **Seed data** (reference rows, lookup tables, initial admin user)
69
+ - **Data backfills** (populating a new column from existing rows)
70
+ - **Data transformations** (splitting a column, normalizing values)
71
+ - **One-off cleanup** (deleting orphaned rows before a constraint is added)
72
+
73
+ These are legitimate cases for a hand-written migration, but they are **out-of-band** — they bypass the entity-as-source-of-truth contract. When you encounter one:
74
+
75
+ 1. **Stop and tell the user.** Explain what change is needed and why it cannot be expressed via the entity model.
76
+ 2. **Get explicit approval** before writing the migration by hand.
77
+ 3. Document the rationale in the migration's class comment so future readers understand why this one was not generated.
78
+
79
+ Do not silently hand-write a migration for a backfill or seed-data change. The user must know that the entity-as-source-of-truth contract is being intentionally bypassed for this case.
80
+
81
+ ### Enforcement
82
+
83
+ The `lisa-nestjs` plugin ships a `PreToolUse` hook (`block-migration-edits.sh`) that blocks `Write`/`Edit` on any path matching `**/migrations/*.ts` or `**/migrations/*.js`. The block surfaces this rule's guidance to remind you to either (a) edit the entity instead, or (b) ask the user before proceeding with an out-of-band migration.
55
84
 
56
85
  ### Why Auto-Generation
57
86