@codyswann/lisa 1.29.1 → 1.30.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.
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: spec-analyst
3
+ description: Analyzes requirements for ambiguities, missing details, and unstated assumptions. Outputs clarifying questions ranked by architectural impact.
4
+ tools: Read, Grep, Glob
5
+ model: sonnet
6
+ ---
7
+
8
+ # Specification Gap Analyst
9
+
10
+ Find every gap in requirements before implementation begins -- not after. Surface questions so the team lead can ask the user. Never answer questions on behalf of the user.
11
+
12
+ ## Focus Areas
13
+
14
+ Analyze the input for gaps in these categories:
15
+
16
+ 1. **Technology/language choice** -- Is the language, framework, or runtime specified? If project context makes it obvious, note that instead of asking.
17
+ 2. **Scale and performance** -- Expected limits? (input size, concurrency, throughput)
18
+ 3. **Input/output format** -- What format does input arrive in? What format should output be? (CLI args, JSON, file, stdin/stdout)
19
+ 4. **Error handling** -- What should happen on invalid input? (throw, return null, log and continue, exit code)
20
+ 5. **Target audience** -- Who will use this? (developers via API, end users via CLI, automated systems)
21
+ 6. **Deployment context** -- Where does this run? (local, CI, server, browser, container)
22
+ 7. **Integration points** -- Does this need to work with existing code, APIs, or databases?
23
+ 8. **Edge cases** -- What happens at boundaries? (zero, negative, very large, empty, null)
24
+ 9. **Naming and location** -- Where should new files live? What naming conventions apply?
25
+ 10. **Acceptance criteria** -- How do we know this is "done"? What does success look like?
26
+
27
+ ## Output Format
28
+
29
+ Return a numbered list of clarifying questions sorted by impact level (high first). For each question:
30
+
31
+ - State the question clearly (one sentence)
32
+ - Explain why it matters (one sentence -- what could go wrong if assumed incorrectly)
33
+ - Note the impact level: **high** (affects architecture), **medium** (affects implementation), **low** (affects polish)
34
+
35
+ ## Rules
36
+
37
+ - Never assume defaults for ambiguous requirements -- surface the ambiguity
38
+ - Never answer questions on behalf of the user
39
+ - Flag every gap, even if it seems obvious -- what's obvious to an engineer may not be what the user intended
40
+ - Use project context (`package.json`, existing code patterns, `CLAUDE.md`) to avoid asking questions the project has already answered
41
+ - Be concise -- one sentence per question, one sentence for why it matters
@@ -10,18 +10,23 @@ When making a plan:
10
10
  - Verify correct versions of third-party libraries
11
11
  - Look for reusable code
12
12
  - If a decision is left unresolved by the human, use the recommended option
13
- - The plan MUST include TaskCreate instructions for each task (following the Task Creation Specification below). Specify that subagents should handle as many tasks in parallel as possible.
13
+ - The plan MUST include TaskCreate instructions for each task (following the Task Creation Specification below)
14
+ - Specify that subagents should handle as many tasks in parallel as possible
15
+
16
+ Do NOT include separate tasks for linting, type-checking, or formatting. These are handled automatically by PostToolUse hooks and lint-staged pre-commit hooks.
17
+
18
+ IMPORTANT: The `## Sessions` section in plan files is auto-maintained by `track-plan-sessions.sh` -- do not manually edit it.
14
19
 
15
20
  ### Required Tasks
16
21
 
17
22
  The following tasks are always required unless the plan includes only trivial changes:
18
23
 
19
- - Product/UX review using `product-reviewer` agent (validate feature works from a non-technical perspective)
24
+ - Product/UX review using `product-reviewer` agent
20
25
  - CodeRabbit code review
21
26
  - Local code review via `/plan-local-code-review`
22
- - Technical review using `tech-reviewer` agent (beginner-friendly; correctness, security, performance)
27
+ - Technical review using `tech-reviewer` agent
23
28
  - Implement valid review suggestions (run after all reviews complete)
24
- - Simplify code using code simplifier agent (run after review implementation)
29
+ - Simplify code using `code-simplifier` agent (run after review implementation)
25
30
  - Update/add/remove tests as needed (run after review implementation)
26
31
  - Update/add/remove documentation -- JSDoc, markdown files, etc. (run after review implementation)
27
32
  - Verify all verification metadata in existing tasks (run after review implementation)
@@ -29,14 +34,27 @@ The following tasks are always required unless the plan includes only trivial ch
29
34
 
30
35
  The following task is always required regardless of plan size:
31
36
 
32
- - Archive the plan (run after all other tasks). This task must explicitly say to:
33
- - Create a folder named `<plan-name>` in `./plans/completed`
34
- - Rename the plan to reflect its actual contents
35
- - Move it into `./plans/completed/<plan-name>`
36
- - Read session IDs from `./plans/completed/<plan-name>`
37
- - Move each `~/.claude/tasks/<session-id>` directory to `./plans/completed/<plan-name>/tasks`
38
- - Update any "in_progress" task to "completed"
39
- - Commit and push changes to the PR
37
+ - **Archive the plan** (run after all other tasks). See the Archive Procedure section below for the full steps this task must include.
38
+
39
+ ### Archive Procedure
40
+
41
+ The archive task must follow these steps exactly. All file operations MUST use `mv` via Bash -- never use Write, Edit, or copy tools, as they overwrite the `## Sessions` table maintained by `track-plan-sessions.sh`.
42
+
43
+ 1. Create destination folder: `mkdir -p ./plans/completed/<plan-name>`
44
+ 2. Rename the plan file to reflect its actual contents
45
+ 3. Move the plan file: `mv plans/<plan-file>.md ./plans/completed/<plan-name>/<renamed>.md`
46
+ 4. Verify source is gone: `! ls plans/<plan-file>.md 2>/dev/null && echo "Source removed"`
47
+ 5. Parse session IDs from the `## Sessions` table in the moved plan file
48
+ 6. Move each task directory: `mv ~/.claude/tasks/<session-id> ./plans/completed/<plan-name>/tasks/`
49
+ - **Fallback** (if Sessions table is empty): `grep -rl '"plan": "<plan-name>"' ~/.claude/tasks/*/` and move parent directories of matches
50
+ 7. Update any `in_progress` tasks to `completed` via TaskUpdate
51
+ 8. Final git operations:
52
+ ```bash
53
+ git add . && git commit -m "chore: archive <plan-name> plan"
54
+ GIT_SSH_COMMAND="ssh -o ServerAliveInterval=30 -o ServerAliveCountMax=5" git push
55
+ gh pr ready
56
+ gh pr merge --auto --merge
57
+ ```
40
58
 
41
59
  ### Branch and PR Rules
42
60
 
@@ -54,31 +72,27 @@ When referencing a ticket (JIRA, Linear, etc.):
54
72
  - Update the ticket with the working branch
55
73
  - Add a comment on the ticket with the finalized plan
56
74
 
57
- NOTE: Do NOT include a separate task for linting, type-checking, or formatting. These are handled automatically by PostToolUse hooks (lint-on-edit.sh, format-on-edit.sh) and lint-staged pre-commit hooks (ESLint, Prettier, ast-grep).
58
-
59
- IMPORTANT: The `## Sessions` section in plan files is auto-maintained by `track-plan-sessions.sh` -- do not manually edit it.
60
-
61
75
  ## Git Workflow
62
76
 
63
77
  Every plan follows this workflow to keep PRs clean:
64
78
 
65
79
  1. **First task:** Verify/create branch and open a draft PR (`gh pr create --draft`). No implementation before the draft PR exists.
66
80
  2. **During implementation:** Commits only, no pushes. Pre-commit hooks validate lint, format, and typecheck.
67
- 3. **After archive task:** One final `git push`, then mark PR ready (`gh pr ready`), then enable auto-merge (`gh pr merge --auto --merge`).
81
+ 3. **After archive task:** One final push, then mark PR ready, then enable auto-merge (see Archive Procedure step 8).
68
82
 
69
83
  ## Implementation Team Guidance
70
84
 
71
85
  When plans spawn an Agent Team for implementation, recommend these specialized agents:
72
86
 
73
- | Agent | Use For | Why |
74
- |-------|---------|-----|
75
- | `implementer` | Code implementation | Pre-loaded with project conventions, empirical verification |
76
- | `tech-reviewer` | Technical review | Beginner-friendly findings; covers correctness, security, performance |
77
- | `product-reviewer` | Product/UX review | Validates from non-technical perspective; runs feature empirically |
78
- | `learner` | Post-implementation learning | Processes task learnings through `skill-evaluator` to create skills, add rules, or discard |
79
- | `test-coverage-agent` | Writing tests | Specialized for comprehensive, meaningful test coverage |
80
- | `code-simplifier` (plugin) | Code simplification | Simplifies and refines for clarity and maintainability |
81
- | `coderabbit` (plugin) | CodeRabbit review | Automated AI code review |
87
+ | Agent | Use For |
88
+ |-------|---------|
89
+ | `implementer` | Code implementation (pre-loaded with project conventions) |
90
+ | `tech-reviewer` | Technical review (correctness, security, performance) |
91
+ | `product-reviewer` | Product/UX review (validates from non-technical perspective) |
92
+ | `learner` | Post-implementation learning (processes learnings into skills/rules) |
93
+ | `test-coverage-agent` | Writing comprehensive, meaningful tests |
94
+ | `code-simplifier` (plugin) | Code simplification and refinement |
95
+ | `coderabbit` (plugin) | Automated AI code review |
82
96
 
83
97
  The **team lead** handles git operations (commits, pushes, PR management) -- teammates focus on their specialized work.
84
98
 
@@ -95,12 +109,14 @@ Every task description must be a markdown document with these sections:
95
109
 
96
110
  **Type:** Bug | Task | Epic | Story
97
111
 
98
- **Description:** Clear description based on type (Bug: symptoms/root cause; Story: Gherkin Given/When/Then; Task: clear goal; Epic: goal with sub-tasks)
112
+ **Description:** Clear description based on type:
113
+ - Bug: symptoms and root cause
114
+ - Story: Gherkin Given/When/Then
115
+ - Task: clear goal
116
+ - Epic: goal with sub-tasks
99
117
 
100
118
  ### Type-Specific Requirements
101
119
 
102
- When the plan type is determined, apply the corresponding requirements:
103
-
104
120
  #### Bug
105
121
  - **Replication step** (mandatory): Reproduce the bug empirically before any fix
106
122
  - **Root cause analysis**: Identify why the bug occurs
@@ -119,6 +135,8 @@ When the plan type is determined, apply the corresponding requirements:
119
135
  - **Decompose into sub-tasks** (Stories/Tasks/Bugs)
120
136
  - **Each sub-task gets its own type-specific requirements**
121
137
 
138
+ ### Additional Description Sections
139
+
122
140
  **Acceptance Criteria:** Checkbox list of completion criteria
123
141
 
124
142
  **Relevant Research:** Code references, patterns, architecture constraints
@@ -135,6 +153,8 @@ When the plan type is determined, apply the corresponding requirements:
135
153
 
136
154
  ### Metadata
137
155
 
156
+ Every task MUST include this JSON metadata block. Do NOT omit `skills` (use `[]` if none) or `verification`.
157
+
138
158
  ```json
139
159
  {
140
160
  "plan": "<plan-name>",
@@ -7,35 +7,28 @@ description: "Creates an implementation plan from a ticket URL, file path, or te
7
7
 
8
8
  Create an implementation plan for: $ARGUMENTS
9
9
 
10
+ All plans must follow the rules in @.claude/rules/plan.md (required tasks, branch/PR rules, task creation specification, metadata schema, and archive procedure).
11
+
10
12
  ## Step 1: Parse Input
11
13
 
12
14
  Determine the input type from `$ARGUMENTS`:
13
15
 
14
- 1. **Ticket URL/ID** For when the argument references a JIRA, Github or Linear issue/ticket number or url
15
- - Fetch ticket details with the appropriate CLI or MCP Server
16
- - Extract: title, description, acceptance criteria, priority, epic/parent
17
- - Note the ticket URL for continuous integration updates
18
-
19
- 2. **File path** — If the the arguments reference a file:
20
- - Read the file contents
21
- - Use the file as context for the plan
22
-
23
- 3. **Free text** — Otherwise, treat the entire argument as a text description of the work
16
+ 1. **Ticket URL/ID** -- Fetch ticket details with the appropriate CLI or MCP Server. Extract: title, description, acceptance criteria, priority, epic/parent. Note the ticket URL for later integration updates.
17
+ 2. **File path** -- Read the file contents and use as context for the plan.
18
+ 3. **Free text** -- Treat the entire argument as a text description of the work.
24
19
 
25
20
  If no argument provided, prompt the user for input.
26
21
 
27
22
  ## Step 2: Detect Plan Type
28
23
 
29
- Analyze the input to determine the plan type:
30
-
31
24
  | Type | Indicators |
32
25
  |------|------------|
33
- | **Bug** | Describes symptoms, errors, incorrect behavior, "broken", "fails", "crash", "regression" |
34
- | **Story/Feature** | Describes new capability, user-facing change, "add", "implement", "create", "as a user" |
35
- | **Task** | Describes internal work, refactoring, configuration, maintenance, "update", "migrate", "refactor" |
36
- | **Epic** | Describes large scope with multiple features/stories, "overhaul", "redesign", multiple distinct deliverables |
26
+ | **Bug** | Symptoms, errors, incorrect behavior, "broken", "fails", "crash", "regression" |
27
+ | **Story/Feature** | New capability, user-facing change, "add", "implement", "create", "as a user" |
28
+ | **Task** | Internal work, refactoring, configuration, maintenance, "update", "migrate", "refactor" |
29
+ | **Epic** | Large scope with multiple features/stories, "overhaul", "redesign", multiple deliverables |
37
30
 
38
- If the type is ambiguous, default to **Task**.
31
+ If ambiguous, default to **Task**.
39
32
 
40
33
  ## Step 3: Spawn Research Team
41
34
 
@@ -43,116 +36,71 @@ Create an Agent Team to research the work in parallel. The team lead operates in
43
36
 
44
37
  ### Phase 1: Research (parallel)
45
38
 
46
- Spawn these three teammates simultaneously:
39
+ Spawn these four teammates simultaneously:
47
40
 
48
41
  #### Ticket/Task Researcher
49
- - **Name**: `researcher`
50
- - **Agent type**: `general-purpose`
51
- - **Mode**: `plan`
52
- - **Prompt**: Research the input (ticket, file, or description). If a ticket URL, fetch full details via JIRA MCP or GitHub CLI. If a bug, attempt to reproduce it empirically (Playwright, browser, direct API call, etc.). Extract requirements, acceptance criteria, and context.
42
+ - **Name**: `researcher` | **Agent type**: `general-purpose` | **Mode**: `plan`
43
+ - **Prompt**: Research the input (ticket, file, or description). If a ticket URL, fetch full details via JIRA MCP or GitHub CLI. If a bug, attempt to reproduce it empirically. Extract requirements, acceptance criteria, and context.
53
44
 
54
45
  #### Codebase Explorer
55
- - **Name**: `explorer`
56
- - **Agent type**: `Explore`
57
- - **Mode**: `plan`
58
- - **Prompt**: Explore the codebase for relevant code, existing patterns, and reusable scripts. Read lint and format rules to understand project standards. Identify files that would need modification, existing utilities that can be reused, and architecture constraints. Check for existing scripts in `package.json` that could be used for replication or verification.
46
+ - **Name**: `explorer` | **Agent type**: `Explore` | **Mode**: `plan`
47
+ - **Prompt**: Explore the codebase for relevant code, existing patterns, and reusable scripts. Read lint and format rules. Identify files needing modification, reusable utilities, and architecture constraints. Check `package.json` scripts for replication or verification.
59
48
 
60
49
  #### Devil's Advocate
61
- - **Name**: `devils-advocate`
62
- - **Agent type**: `general-purpose`
63
- - **Mode**: `plan`
64
- - **Prompt**: Review the input from a critical perspective. Identify anti-patterns, N+1 queries, missing edge cases, security concerns, and performance issues. Do not assume anti-patterns are acceptable just because they exist in the codebase — undocumented anti-patterns should be flagged, not used as reference.
50
+ - **Name**: `devils-advocate` | **Agent type**: `general-purpose` | **Mode**: `plan`
51
+ - **Prompt**: Review the input critically. Identify anti-patterns, N+1 queries, missing edge cases, security concerns, and performance issues. Undocumented anti-patterns in the codebase should be flagged, not used as reference.
52
+
53
+ #### Spec Gap Analyst
54
+ - **Name**: `spec-analyst` | **Agent type**: `spec-analyst` | **Mode**: `plan`
55
+ - **Prompt**: Analyze the input for specification gaps. Read `package.json` and existing code for project context. Identify every ambiguity or unstated assumption that could lead to wrong architectural decisions. Report as a numbered list of clarifying questions, sorted by impact.
56
+
57
+ ### Gap Resolution
65
58
 
66
- ### Phase 2: Review (parallel, after Phase 1 findings are synthesized)
59
+ After Phase 1 completes and before synthesizing the draft plan:
67
60
 
68
- After collecting and synthesizing Phase 1 findings into a draft plan, spawn these two reviewers simultaneously:
61
+ 1. Collect gaps from the spec-analyst's findings
62
+ 2. Present gaps to the user via AskUserQuestion -- group related questions and include why each matters
63
+ 3. If no gaps identified, state "No specification gaps identified" and proceed to Phase 2
64
+ 4. Incorporate answers into the draft plan context before Phase 2 review
65
+
66
+ ### Phase 2: Review (parallel, after Phase 1 synthesis)
67
+
68
+ After synthesizing Phase 1 findings (including gap resolution answers) into a draft plan, spawn these two reviewers simultaneously:
69
69
 
70
70
  #### Tech Reviewer
71
- - **Name**: `tech-reviewer`
72
- - **Agent type**: `tech-reviewer`
73
- - **Mode**: `plan`
74
- - **Prompt**: Review the draft plan for correctness, security, and coding-philosophy compliance. Validate the proposed approach, identify technical risks, and confirm the implementation strategy is sound. Flag any issues ranked by severity.
71
+ - **Name**: `tech-reviewer` | **Agent type**: `tech-reviewer` | **Mode**: `plan`
72
+ - **Prompt**: Review the draft plan for correctness, security, and coding-philosophy compliance. Validate the approach, identify technical risks, and flag issues ranked by severity.
75
73
 
76
74
  #### Product Reviewer
77
- - **Name**: `product-reviewer`
78
- - **Agent type**: `product-reviewer`
79
- - **Mode**: `plan`
80
- - **Prompt**: Review the draft plan from a non-technical/UX perspective. Does the plan solve the right problem? Will the proposed solution work for end users? Are there user-facing concerns the technical team may have missed?
75
+ - **Name**: `product-reviewer` | **Agent type**: `product-reviewer` | **Mode**: `plan`
76
+ - **Prompt**: Review the draft plan from a non-technical/UX perspective. Does the plan solve the right problem? Will the solution work for end users? Are there user-facing concerns the technical team missed?
81
77
 
82
78
  ### Bug-Specific Rules
83
79
 
84
80
  If the plan type is **Bug**:
85
81
 
86
- - The bug **must** be empirically replicated (Playwright, browser, direct API call, etc.) not guessed at
82
+ - The bug **must** be empirically replicated (Playwright, browser, direct API call, etc.) -- not guessed at
87
83
  - If the research team cannot reproduce the bug, **STOP**. Update the ticket with findings and what additional information is needed, then end the session
88
84
  - Do not attempt to fix a bug you cannot prove exists
89
- - Never include solutions with obvious anti-patterns (e.g., N+1 queries). If unavoidable due to API limitations, **STOP** and update the ticket with what is needed
90
-
91
- ## Step 4: Synthesize & Write Plan
92
-
93
- After all teammates have reported and the team lead has approved their findings:
94
-
95
- 1. Synthesize findings into a unified plan and save it
96
- 2. The plan must include, at minimum, the info found in the @.claude/rules/plan.md rule
97
-
98
- ### Plan Structure
85
+ - Never include solutions with obvious anti-patterns (e.g., N+1 queries). If unavoidable, **STOP** and update the ticket
99
86
 
100
- The plan file must include, at minimum:
87
+ ## Step 4: Synthesize and Write Plan
101
88
 
102
- 1. **Title and context** What is being done and why
103
- 2. **Input source** — Ticket URL, file path, or description
104
- 3. **Plan type** — Bug, Task, Story/Feature, or Epic
105
- 4. **Branch and PR** — Following branch/PR rules from @.claude/rules/plan.md
106
- 5. **Analysis** — Synthesized research findings from all teammates
107
- 6. **Implementation approach** — How the work will be done
108
- 7. **Tasks** — Following the Task Creation Specification from @.claude/rules/plan.md
109
- 8. **Implementation Team** — Instructions to spawn a second Agent Team (see Step 6)
89
+ After all teammates have reported and the team lead has approved their findings, synthesize into a unified plan file with these sections:
110
90
 
111
- ### Type-Specific Requirements
91
+ 1. **Title and context** -- What is being done and why
92
+ 2. **Input source** -- Ticket URL, file path, or description
93
+ 3. **Plan type** -- Bug, Task, Story/Feature, or Epic
94
+ 4. **Branch and PR** -- Following Branch and PR Rules from @.claude/rules/plan.md
95
+ 5. **Analysis** -- Synthesized research findings from all teammates
96
+ 6. **Implementation approach** -- How the work will be done
97
+ 7. **Tasks** -- Following the Task Creation Specification from @.claude/rules/plan.md, including the JSON metadata block for each task
98
+ 8. **Required tasks** -- All tasks from the Required Tasks section in @.claude/rules/plan.md (archive task must be last)
99
+ 9. **Implementation team** -- Instructions to spawn a second Agent Team using the agents from the Implementation Team Guidance table in @.claude/rules/plan.md
112
100
 
113
- Apply these additional requirements based on the detected type:
101
+ Apply the Type-Specific Requirements from @.claude/rules/plan.md based on the detected plan type. For Bugs, also include a replication task before any fix and a proof command for every fix task. For Epics, include dependency mapping between sub-tasks.
114
102
 
115
- #### Bug
116
- - **Replication step** (mandatory): Include a task to reproduce the bug empirically before any fix
117
- - **Root cause analysis**: Identify why the bug occurs, not just what triggers it
118
- - **Regression test**: Write a test that fails without the fix and passes with it
119
- - **Verification**: Run the replication step again after the fix to confirm resolution
120
- - **Proof command**: Every fix task must include a proof command and expected output
121
-
122
- #### Story/Feature
123
- - **UX review**: Include a product-reviewer agent task to validate from user perspective
124
- - **Feature flag consideration**: Note whether this should be behind a feature flag
125
- - **Documentation**: Include user-facing documentation if applicable
126
-
127
- #### Task
128
- - **Standard implementation** with empirical verification
129
-
130
- #### Epic
131
- - **Decompose into sub-tasks**: Break into Stories, Tasks, and/or Bugs
132
- - **Each sub-task gets its own type-specific requirements**
133
- - **Dependency mapping**: Identify which sub-tasks depend on others
134
-
135
- ## Step 5: Include Required Tasks
136
-
137
- Include all required tasks defined in the @.claude/rules/plan.md rule (Required Tasks section), including the archive task which must always be last.
138
-
139
- ## Step 6: Implementation Team Instructions
140
-
141
- The plan must include instructions to spawn a **second Agent Team** for implementation. Recommend these specialized agents:
142
-
143
- | Agent | Use For |
144
- |-------|---------|
145
- | `implementer` | Code implementation (pre-loaded with project conventions) |
146
- | `tech-reviewer` | Technical review (correctness, security, performance) |
147
- | `product-reviewer` | Product/UX review (validates from non-technical perspective) |
148
- | `learner` | Post-implementation learning (processes learnings into skills/rules) |
149
- | `test-coverage-agent` | Writing comprehensive tests |
150
- | `code-simplifier` | Code simplification and refinement |
151
- | `coderabbit` | Automated AI code review |
152
-
153
- The **team lead** handles git operations (commits, pushes, PR management) — teammates focus on their specialized work.
154
-
155
- ## Step 7: Ticket Integration
103
+ ## Step 5: Ticket Integration
156
104
 
157
105
  If the input was a ticket ID or URL:
158
106
 
@@ -160,14 +108,10 @@ If the input was a ticket ID or URL:
160
108
  2. Associate the branch and PR with the ticket
161
109
  3. Post the approved plan as a comment on the ticket
162
110
  4. Use `/jira-sync` at key milestones
163
- 5. If blocked (cannot reproduce, unavoidable anti-pattern, missing information, etc.), update the ticket before stopping
164
-
165
- ## Step 8: Present to User
111
+ 5. If blocked, update the ticket before stopping
166
112
 
167
- Present the synthesized plan to the user for review. The user should be able to:
113
+ ## Step 6: Present to User
168
114
 
169
- - Approve the plan as-is
170
- - Request modifications
171
- - Reject the plan
115
+ Present the synthesized plan to the user for review. The user may approve, request modifications, or reject.
172
116
 
173
117
  All decisions in the plan must include a recommendation. If a decision is left unresolved, use the recommended option.
@@ -13,13 +13,34 @@ If no argument provided, search for plan files in the `plans/` directory and pre
13
13
 
14
14
  1. **Read the plan file** specified in `$ARGUMENTS`
15
15
  2. **Parse all tasks** from the plan, including their dependencies, descriptions, and verification requirements
16
- 3. **Create tasks** using TaskCreate for each task in the plan
17
- 4. **Set up dependencies** between tasks using TaskUpdate (addBlockedBy/addBlocks)
18
- 5. **Spawn an Agent Team** with specialized agents to execute tasks in parallel where dependencies allow
19
- 6. **Execute tasks** following the plan's specified order and dependency graph
20
- 7. **Verify each task** using its verification metadata before marking complete
21
- 8. **Commit changes** after implementation using conventional commit format
16
+ 3. **Parse task metadata** -- extract the JSON metadata code fence from each task (see @.claude/rules/plan.md Metadata section for the required schema)
17
+ 4. **Create tasks** using TaskCreate for each task in the plan, passing the full parsed metadata
18
+ 5. **Set up dependencies** between tasks using TaskUpdate (addBlockedBy/addBlocks)
19
+ 6. **Spawn an Agent Team** with specialized agents to execute tasks in parallel where dependencies allow
20
+ 7. **Execute tasks** following the plan's specified order and dependency graph
21
+ 8. **Verify each task** using its `verification.command` before marking complete
22
+ 9. **Archive the plan** following the Archive Procedure in @.claude/rules/plan.md
22
23
 
23
24
  ## Agent Team Composition
24
25
 
25
- Use the specialized agents listed in $ARGUMENTS and the @.claude/rules/plan.md rule (Implementation Team Guidance section). The **team lead** handles git operations (commits, pushes, PR management) -- teammates focus on their specialized work.
26
+ Use the specialized agents listed in $ARGUMENTS and the Implementation Team Guidance table in @.claude/rules/plan.md. The **team lead** handles git operations (commits, pushes, PR management) -- teammates focus on their specialized work.
27
+
28
+ ## Task Metadata Rules
29
+
30
+ Each task in the plan file contains a JSON metadata code fence (schema defined in @.claude/rules/plan.md Metadata section).
31
+
32
+ - Every TaskCreate call MUST include the full `metadata` object from the plan's JSON code fence
33
+ - If a task is missing `skills` or `verification`, flag it as an error and ask the user before proceeding
34
+ - Run `verification.command` before marking any task complete
35
+
36
+ ## Compaction Resilience
37
+
38
+ Context compaction can cause the team lead to lose in-memory state (task assignments, owner fields). Follow these rules:
39
+
40
+ 1. **Dual owner storage** -- on every TaskUpdate that sets `owner`, also store it in `metadata.owner`:
41
+ ```
42
+ TaskUpdate({ taskId: "1", owner: "implementer-1", metadata: { owner: "implementer-1" } })
43
+ ```
44
+ 2. **Re-read after compaction** -- immediately call TaskList to reload all task state
45
+ 3. **Restore missing owners** -- if any task has `metadata.owner` but no `owner` field, restore it via TaskUpdate
46
+ 4. **Never rely on memory** -- always call TaskList before assigning new work
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Fibonacci sequence utilities providing safe, validated computation
3
+ * within JavaScript's integer precision limits.
4
+ *
5
+ * Caps at fibonacci(78) / sequence length 79 because fibonacci(79)
6
+ * exceeds Number.MAX_SAFE_INTEGER, which would silently corrupt results.
7
+ *
8
+ * @module fibonacci
9
+ */
10
+ /**
11
+ * Compute the nth Fibonacci number (0-indexed).
12
+ *
13
+ * Uses an iterative tuple-reduce approach to avoid stack overflow
14
+ * and keep computation O(n) time, O(1) space.
15
+ *
16
+ * @param n - The zero-based index in the Fibonacci sequence
17
+ * @returns The nth Fibonacci number
18
+ * @throws {RangeError} If n is negative, non-integer, NaN, Infinity, or greater than 78
19
+ */
20
+ export declare function fibonacci(n: number): number;
21
+ /**
22
+ * Generate the first `length` Fibonacci numbers as a readonly array.
23
+ *
24
+ * Builds the sequence incrementally with reduce so each element derives
25
+ * from its two predecessors without recomputing from scratch.
26
+ *
27
+ * @param length - How many Fibonacci numbers to generate
28
+ * @returns A readonly array of Fibonacci numbers
29
+ * @throws {RangeError} If length is negative, non-integer, NaN, Infinity, or greater than 79
30
+ */
31
+ export declare function fibonacciSequence(length: number): readonly number[];
32
+ //# sourceMappingURL=fibonacci.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fibonacci.d.ts","sourceRoot":"","sources":["../../src/utils/fibonacci.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAsB3C;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAiBnE"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Fibonacci sequence utilities providing safe, validated computation
3
+ * within JavaScript's integer precision limits.
4
+ *
5
+ * Caps at fibonacci(78) / sequence length 79 because fibonacci(79)
6
+ * exceeds Number.MAX_SAFE_INTEGER, which would silently corrupt results.
7
+ *
8
+ * @module fibonacci
9
+ */
10
+ /** Largest n for which fibonacci(n) fits in a safe JS integer. */
11
+ const MAX_SAFE_N = 78;
12
+ /** Largest sequence length where all elements remain safe JS integers. */
13
+ const MAX_SAFE_LENGTH = 79;
14
+ /**
15
+ * Compute the nth Fibonacci number (0-indexed).
16
+ *
17
+ * Uses an iterative tuple-reduce approach to avoid stack overflow
18
+ * and keep computation O(n) time, O(1) space.
19
+ *
20
+ * @param n - The zero-based index in the Fibonacci sequence
21
+ * @returns The nth Fibonacci number
22
+ * @throws {RangeError} If n is negative, non-integer, NaN, Infinity, or greater than 78
23
+ */
24
+ export function fibonacci(n) {
25
+ if (!Number.isInteger(n) || n < 0) {
26
+ throw new RangeError(`Expected a non-negative integer for n, got ${String(n)}`);
27
+ }
28
+ if (n > MAX_SAFE_N) {
29
+ throw new RangeError("fibonacci(n) exceeds Number.MAX_SAFE_INTEGER for n > 78");
30
+ }
31
+ if (n <= 1) {
32
+ return n;
33
+ }
34
+ const [, result] = Array.from({ length: n - 1 }).reduce(([prev, curr]) => [curr, prev + curr], [0, 1]);
35
+ return result;
36
+ }
37
+ /**
38
+ * Generate the first `length` Fibonacci numbers as a readonly array.
39
+ *
40
+ * Builds the sequence incrementally with reduce so each element derives
41
+ * from its two predecessors without recomputing from scratch.
42
+ *
43
+ * @param length - How many Fibonacci numbers to generate
44
+ * @returns A readonly array of Fibonacci numbers
45
+ * @throws {RangeError} If length is negative, non-integer, NaN, Infinity, or greater than 79
46
+ */
47
+ export function fibonacciSequence(length) {
48
+ if (!Number.isInteger(length) || length < 0) {
49
+ throw new RangeError(`Expected a non-negative integer for length, got ${String(length)}`);
50
+ }
51
+ if (length > MAX_SAFE_LENGTH) {
52
+ throw new RangeError("fibonacciSequence(length) exceeds Number.MAX_SAFE_INTEGER for length > 79");
53
+ }
54
+ return Array.from({ length }).reduce((acc, _, i) => [...acc, i < 2 ? i : (acc[i - 1] ?? 0) + (acc[i - 2] ?? 0)], []);
55
+ }
56
+ //# sourceMappingURL=fibonacci.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fibonacci.js","sourceRoot":"","sources":["../../src/utils/fibonacci.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,kEAAkE;AAClE,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,0EAA0E;AAC1E,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B;;;;;;;;;GASG;AACH,MAAM,UAAU,SAAS,CAAC,CAAS;IACjC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,UAAU,CAClB,8CAA8C,MAAM,CAAC,CAAC,CAAC,EAAE,CAC1D,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,GAAG,UAAU,EAAE,CAAC;QACnB,MAAM,IAAI,UAAU,CAClB,yDAAyD,CAC1D,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,MAAM,CAErD,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE1D,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,UAAU,CAClB,mDAAmD,MAAM,CAAC,MAAM,CAAC,EAAE,CACpE,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,GAAG,eAAe,EAAE,CAAC;QAC7B,MAAM,IAAI,UAAU,CAClB,2EAA2E,CAC5E,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAClC,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAC1E,EAAE,CACH,CAAC;AACJ,CAAC"}
@@ -1,3 +1,4 @@
1
+ export * from "./fibonacci.js";
1
2
  export * from "./file-operations.js";
2
3
  export * from "./json-utils.js";
3
4
  export * from "./path-utils.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
@@ -1,3 +1,4 @@
1
+ export * from "./fibonacci.js";
1
2
  export * from "./file-operations.js";
2
3
  export * from "./json-utils.js";
3
4
  export * from "./path-utils.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -88,7 +88,7 @@
88
88
  "@isaacs/brace-expansion": "^5.0.1"
89
89
  },
90
90
  "name": "@codyswann/lisa",
91
- "version": "1.29.1",
91
+ "version": "1.30.0",
92
92
  "description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
93
93
  "main": "dist/index.js",
94
94
  "bin": {