@codyswann/lisa 1.80.0 → 1.81.1
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 +1 -1
- package/plugins/lisa/.claude-plugin/plugin.json +14 -10
- package/plugins/lisa/agents/bug-fixer.md +1 -1
- package/plugins/lisa/agents/builder.md +1 -1
- package/plugins/lisa/agents/jira-agent.md +10 -9
- package/plugins/lisa/commands/build.md +3 -3
- package/plugins/lisa/commands/fix.md +3 -3
- package/plugins/lisa/commands/improve.md +8 -8
- package/plugins/lisa/commands/investigate.md +1 -1
- package/plugins/lisa/commands/monitor.md +2 -2
- package/plugins/lisa/commands/plan/create.md +3 -1
- package/plugins/lisa/commands/plan/execute.md +1 -1
- package/plugins/lisa/commands/plan.md +3 -1
- package/plugins/lisa/commands/research.md +8 -0
- package/plugins/lisa/commands/review.md +2 -2
- package/plugins/lisa/commands/ship.md +2 -4
- package/plugins/lisa/commands/verify.md +10 -0
- package/plugins/lisa/hooks/inject-flow-context.sh +12 -0
- package/plugins/lisa/rules/base-rules.md +4 -0
- package/plugins/lisa/rules/intent-routing.md +204 -82
- package/plugins/lisa/rules/verification.md +11 -0
- package/plugins/lisa/skills/plan-execute/SKILL.md +36 -19
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/src/base/.claude-plugin/plugin.json +6 -10
- package/plugins/src/base/agents/bug-fixer.md +1 -1
- package/plugins/src/base/agents/builder.md +1 -1
- package/plugins/src/base/agents/jira-agent.md +10 -9
- package/plugins/src/base/commands/build.md +3 -3
- package/plugins/src/base/commands/fix.md +3 -3
- package/plugins/src/base/commands/improve.md +8 -8
- package/plugins/src/base/commands/investigate.md +1 -1
- package/plugins/src/base/commands/monitor.md +2 -2
- package/plugins/src/base/commands/plan/create.md +3 -1
- package/plugins/src/base/commands/plan/execute.md +1 -1
- package/plugins/src/base/commands/plan.md +3 -1
- package/plugins/src/base/commands/research.md +8 -0
- package/plugins/src/base/commands/review.md +2 -2
- package/plugins/src/base/commands/ship.md +2 -4
- package/plugins/src/base/commands/verify.md +10 -0
- package/plugins/src/base/hooks/inject-flow-context.sh +12 -0
- package/plugins/src/base/rules/base-rules.md +4 -0
- package/plugins/src/base/rules/intent-routing.md +204 -82
- package/plugins/src/base/rules/verification.md +11 -0
- package/plugins/src/base/skills/plan-execute/SKILL.md +36 -19
- package/scripts/test-intent-routing.sh +221 -0
|
@@ -1,114 +1,211 @@
|
|
|
1
1
|
# Intent Routing
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MANDATORY: Before starting any work in a session, classify the user's initial request using the Flow Classification Protocol below. Do not respond, do not start work, do not ask questions until you have determined which flow applies. Once a flow is established, all subsequent messages operate within that flow — do not re-classify. This is not optional — skipping classification leads to unstructured responses that bypass readiness gates.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Each flow has a readiness gate that MUST pass before work begins. If the gate fails, stop and ask for what is missing.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
When: Bug reports, broken behavior, error messages, JIRA bug tickets.
|
|
7
|
+
## Flow Classification Protocol
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
1. `git-history-analyzer` — understand why affected code exists, find related past fixes/reverts
|
|
12
|
-
2. `debug-specialist` — reproduce the bug, prove root cause with evidence
|
|
13
|
-
3. `architecture-specialist` — assess fix risk, identify files to change, check for ripple effects
|
|
14
|
-
4. `test-specialist` — design regression test strategy
|
|
15
|
-
5. `bug-fixer` — implement fix via TDD (reproduction becomes failing test)
|
|
16
|
-
6. **Verify sub-flow**
|
|
17
|
-
7. **Ship sub-flow**
|
|
18
|
-
8. `learner` — capture discoveries for future sessions
|
|
19
|
-
|
|
20
|
-
### Build
|
|
21
|
-
When: New features, stories, tasks, JIRA story/task tickets.
|
|
9
|
+
A `UserPromptSubmit` prompt hook uses a fast model to pre-classify the user's request and injects the result as `additionalContext`. Use this classification as a strong hint but verify it against the flow definitions below.
|
|
22
10
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
7. **Ship sub-flow**
|
|
31
|
-
8. `learner` — capture discoveries
|
|
11
|
+
1. If the user invoked a slash command (`/fix`, `/build`, `/plan`, etc.), the flow is already determined -- skip classification.
|
|
12
|
+
2. If a flow hint was injected by the hook, verify it matches the request. If it does, proceed with that flow.
|
|
13
|
+
3. If the classification is "None" or you disagree with the hint:
|
|
14
|
+
- **Interactive session** (user is present): present a multiple choice using AskUserQuestion with options: Research, Plan, Implement, Verify, No flow.
|
|
15
|
+
- **Headless/non-interactive session** (running with `-p` flag, in a CI pipeline, or as a scheduled agent): do NOT ask the user. Classify to the best of your ability from available context (ticket content, prompt text, current branch state). If you truly cannot classify, default to "No flow" and proceed with the request as-is.
|
|
16
|
+
4. Once a flow is selected, check its readiness gate before proceeding.
|
|
17
|
+
5. If you are a subagent: your parent agent has already determined the flow -- do NOT ask the user to choose a flow. Execute your assigned work within the established flow context.
|
|
32
18
|
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
## Readiness Gate Protocol
|
|
20
|
+
|
|
21
|
+
Every flow begins with a gate check. The gate defines what information must be present before the flow can begin.
|
|
22
|
+
|
|
23
|
+
If the gate fails:
|
|
24
|
+
- **Interactive session** (user is present):
|
|
25
|
+
1. Identify exactly what is missing
|
|
26
|
+
2. Before asking the user, attempt to answer the questions yourself from available context (source code, docs, git history, project structure, config files). Only ask the user about information you genuinely cannot determine.
|
|
27
|
+
3. When you do ask the user, provide recommended answers to choose from based on what you found in the codebase. Do not ask open-ended questions when you can offer specific options.
|
|
28
|
+
4. Tell the user what is needed and why
|
|
29
|
+
5. Do NOT proceed until the missing information is provided or resolved
|
|
30
|
+
6. If the missing information can be obtained by running a preceding flow (e.g., Research before Plan), suggest that instead
|
|
31
|
+
- **Headless/non-interactive session** (running with `-p` flag, in a CI pipeline, or as a scheduled agent): do NOT block on missing information. Infer what you can from available context (ticket content, prompt text, codebase state, git history). Proceed with best effort using what is available. If critical information is truly unobtainable, fail with a clear error message explaining what was missing.
|
|
32
|
+
|
|
33
|
+
## Main Flows
|
|
34
|
+
|
|
35
|
+
### Research
|
|
36
|
+
|
|
37
|
+
When: "I need a PRD", "What should we build?", product discovery, requirements gathering, feature exploration, understanding a problem space, open-ended feature ideas.
|
|
38
|
+
|
|
39
|
+
Gate:
|
|
40
|
+
- A problem statement, feature idea, or business objective must be provided
|
|
41
|
+
- If none is provided, ask: "What problem are you trying to solve or what capability are you trying to add?"
|
|
35
42
|
|
|
36
43
|
Sequence:
|
|
37
|
-
1.
|
|
38
|
-
2. `
|
|
39
|
-
3. `
|
|
40
|
-
4.
|
|
44
|
+
1. **Investigate sub-flow** -- gather context from codebase, git history, existing behavior, and external sources
|
|
45
|
+
2. `product-specialist` -- define user goals, user flows (Gherkin), acceptance criteria, error states, UX concerns, and out-of-scope items
|
|
46
|
+
3. `architecture-specialist` -- assess technical feasibility, identify constraints, map existing system boundaries
|
|
47
|
+
4. Synthesize findings into a PRD document containing: problem statement, user stories, acceptance criteria, technical constraints, open questions, and proposed scope
|
|
48
|
+
5. `learner` -- capture discoveries for future sessions
|
|
49
|
+
|
|
50
|
+
Output: A PRD document. If there is not enough context to produce a complete PRD, stop and report what is missing rather than producing an incomplete one.
|
|
41
51
|
|
|
42
52
|
### Plan
|
|
43
|
-
|
|
53
|
+
|
|
54
|
+
When: "Break this down", "Create tickets", epic planning, large scope work, JIRA epic tickets, "Turn this PRD into work items".
|
|
55
|
+
|
|
56
|
+
Gate:
|
|
57
|
+
- A PRD, specification document, or equivalent detailed description must be provided
|
|
58
|
+
- The specification must contain: clear scope, acceptance criteria, and enough detail to decompose into work items
|
|
59
|
+
- If no specification exists, stop and suggest running the **Research** flow first
|
|
60
|
+
- If the specification has unresolved ambiguities, stop and list them
|
|
44
61
|
|
|
45
62
|
Sequence:
|
|
46
|
-
1.
|
|
47
|
-
2. `
|
|
48
|
-
3.
|
|
63
|
+
1. **Investigate sub-flow** -- explore codebase for architecture, patterns, dependencies relevant to the spec
|
|
64
|
+
2. `product-specialist` -- validate and refine acceptance criteria for the whole scope
|
|
65
|
+
3. `architecture-specialist` -- map dependencies, identify cross-cutting concerns, determine execution order
|
|
66
|
+
4. Decompose into ordered work items (epics, stories, tasks, spikes, bugs), each with:
|
|
67
|
+
- Type (epic, story, task, spike, bug)
|
|
68
|
+
- Acceptance criteria
|
|
69
|
+
- Verification method
|
|
70
|
+
- Dependencies
|
|
71
|
+
- Skills required
|
|
72
|
+
5. Create work items in the tracker (JIRA, Linear, GitHub) with acceptance criteria and dependencies
|
|
73
|
+
6. `learner` -- capture discoveries for future sessions
|
|
74
|
+
|
|
75
|
+
Output: Work items in a tracker with acceptance criteria, ordered by dependency. If the specification cannot be decomposed without further clarification, stop and report what is missing.
|
|
76
|
+
|
|
77
|
+
### Implement
|
|
78
|
+
|
|
79
|
+
When: Working on a specific ticket (story, task, bug, spike), implementing a well-defined piece of work.
|
|
80
|
+
|
|
81
|
+
Gate:
|
|
82
|
+
- A well-defined work item with acceptance criteria must be provided (ticket URL, file spec, or detailed description)
|
|
83
|
+
- The work item must have clear scope, expected behavior, and verification method
|
|
84
|
+
- If acceptance criteria are missing or ambiguous, stop and ask before proceeding
|
|
85
|
+
- If the work item is too large (epic-level), stop and suggest running the **Plan** flow first
|
|
86
|
+
|
|
87
|
+
Determine the work type and execute the matching variant:
|
|
88
|
+
|
|
89
|
+
#### Build (features, stories, tasks)
|
|
90
|
+
|
|
91
|
+
1. **Investigate sub-flow** -- explore codebase for related code, patterns, dependencies
|
|
92
|
+
2. `product-specialist` -- define acceptance criteria, user flows, error states
|
|
93
|
+
3. `architecture-specialist` -- design approach, map files to modify, identify reusable code
|
|
94
|
+
4. `test-specialist` -- design test strategy (coverage, edge cases, TDD sequence)
|
|
95
|
+
5. `builder` -- implement via TDD (acceptance criteria become tests)
|
|
96
|
+
6. Run validation: lint, typecheck, tests
|
|
97
|
+
7. `verification-specialist` -- verify locally (run the software, observe behavior)
|
|
98
|
+
8. Write e2e test encoding the verification
|
|
99
|
+
9. **Review sub-flow**
|
|
100
|
+
10. `learner` -- capture discoveries
|
|
101
|
+
|
|
102
|
+
#### Fix (bugs)
|
|
103
|
+
|
|
104
|
+
1. **Reproduce sub-flow** -- write failing test or script that demonstrates the bug (MANDATORY before any fix is attempted)
|
|
105
|
+
2. **Investigate sub-flow** -- git history, root cause analysis
|
|
106
|
+
3. `debug-specialist` -- prove root cause with evidence
|
|
107
|
+
4. `architecture-specialist` -- assess fix risk, identify files to change, check for ripple effects
|
|
108
|
+
5. `test-specialist` -- design regression test strategy
|
|
109
|
+
6. `bug-fixer` -- implement fix via TDD (reproduction becomes failing test)
|
|
110
|
+
7. Run validation: lint, typecheck, tests
|
|
111
|
+
8. `verification-specialist` -- verify locally (prove the bug is fixed)
|
|
112
|
+
9. Write e2e test encoding the verification
|
|
113
|
+
10. **Review sub-flow**
|
|
114
|
+
11. `learner` -- capture discoveries
|
|
115
|
+
|
|
116
|
+
#### Improve (refactoring, optimization, coverage improvement)
|
|
117
|
+
|
|
118
|
+
1. **Investigate sub-flow** -- understand current state, measure baseline
|
|
119
|
+
2. `architecture-specialist` -- identify target, plan approach
|
|
120
|
+
3. `test-specialist` -- ensure existing test coverage before refactoring (safety net)
|
|
121
|
+
4. `builder` -- implement improvements via TDD
|
|
122
|
+
5. Run validation: lint, typecheck, tests
|
|
123
|
+
6. `verification-specialist` -- measure again, prove improvement over baseline
|
|
124
|
+
7. Write e2e test encoding the verification (if applicable)
|
|
125
|
+
8. **Review sub-flow**
|
|
126
|
+
9. `learner` -- capture discoveries
|
|
127
|
+
|
|
128
|
+
#### Investigate Only (spikes)
|
|
129
|
+
|
|
130
|
+
1. **Investigate sub-flow** -- full investigation
|
|
131
|
+
2. Report findings with evidence
|
|
132
|
+
3. Recommend next action (Research, Plan, Implement, or escalate)
|
|
133
|
+
4. `learner` -- capture discoveries
|
|
134
|
+
|
|
135
|
+
Output: Code passing all validation + local empirical verification + e2e test (except for spikes, which produce findings only).
|
|
49
136
|
|
|
50
137
|
### Verify
|
|
51
|
-
When: Pre-ship quality gate. Used as a sub-flow by Fix and Build.
|
|
52
138
|
|
|
53
|
-
|
|
54
|
-
1. Run full test suite — all tests must pass before proceeding
|
|
55
|
-
2. Run quality checks — lint, typecheck, and format
|
|
56
|
-
3. `verification-specialist` — verify acceptance criteria are met empirically
|
|
139
|
+
When: Code is ready to ship. All local validation passes. Moving from "works on my machine" to "works in production".
|
|
57
140
|
|
|
58
|
-
|
|
59
|
-
|
|
141
|
+
Gate:
|
|
142
|
+
- Code must pass local validation (lint, typecheck, tests)
|
|
143
|
+
- Local empirical verification must be complete
|
|
144
|
+
- If local validation fails, go back to **Implement**
|
|
145
|
+
- If no code changes exist, there is nothing to verify
|
|
60
146
|
|
|
61
147
|
Sequence:
|
|
62
|
-
1. Commit
|
|
63
|
-
2. PR
|
|
64
|
-
3.
|
|
65
|
-
|
|
66
|
-
- If
|
|
67
|
-
- If merge conflicts → resolve and push
|
|
148
|
+
1. Commit -- atomic conventional commits via `git-commit` skill
|
|
149
|
+
2. PR -- create/update pull request via `git-submit-pr` skill
|
|
150
|
+
3. PR Watch Loop (repeat until mergeable):
|
|
151
|
+
- If status checks fail -- fix and push
|
|
152
|
+
- If merge conflicts -- resolve and push
|
|
68
153
|
- If bot review feedback (CodeRabbit, etc.):
|
|
69
|
-
- Valid feedback
|
|
70
|
-
- Invalid feedback
|
|
154
|
+
- Valid feedback -- implement fix, push, resolve comment
|
|
155
|
+
- Invalid feedback -- reply explaining why, resolve comment
|
|
71
156
|
- Repeat until all checks pass and all comments are resolved
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
157
|
+
4. Merge the PR
|
|
158
|
+
5. Monitor deploy (watch the deployment action triggered by merge):
|
|
159
|
+
- If deploy fails -- fix, open new PR, return to step 3
|
|
160
|
+
6. Remote verification:
|
|
161
|
+
- `verification-specialist` -- verify in target environment (same checks as local verification, but on remote)
|
|
162
|
+
- `ops-specialist` -- post-deploy health check, smoke test, monitor for errors in first minutes
|
|
163
|
+
- If remote verification fails -- fix, open new PR, return to step 3
|
|
76
164
|
|
|
77
|
-
|
|
78
|
-
|
|
165
|
+
Output: Merged PR, successful deploy, remote verification passing.
|
|
166
|
+
|
|
167
|
+
## Sub-flows
|
|
168
|
+
|
|
169
|
+
Sub-flows are reusable sequences invoked by main flows. When a flow says "Investigate sub-flow", execute the full Investigate sequence.
|
|
170
|
+
|
|
171
|
+
### Investigate
|
|
172
|
+
|
|
173
|
+
Purpose: Gather context and evidence about code, behavior, or systems.
|
|
79
174
|
|
|
80
175
|
Sequence:
|
|
81
|
-
1.
|
|
82
|
-
2. `
|
|
83
|
-
3. `
|
|
84
|
-
4.
|
|
176
|
+
1. `git-history-analyzer` -- understand why affected code exists, find related past changes
|
|
177
|
+
2. `debug-specialist` -- reproduce if applicable, trace execution, prove findings with evidence
|
|
178
|
+
3. `ops-specialist` -- check logs, errors, health (if runtime issue)
|
|
179
|
+
4. Report findings with evidence
|
|
180
|
+
|
|
181
|
+
### Reproduce
|
|
85
182
|
|
|
86
|
-
|
|
87
|
-
When: Refactoring, optimization, coverage improvement, complexity reduction.
|
|
183
|
+
Purpose: Create a reliable reproduction that demonstrates a bug before fixing it.
|
|
88
184
|
|
|
89
185
|
Sequence:
|
|
90
|
-
1.
|
|
91
|
-
2.
|
|
92
|
-
3.
|
|
93
|
-
4.
|
|
94
|
-
5. **Ship sub-flow**
|
|
95
|
-
6. `learner` — capture discoveries
|
|
186
|
+
1. Execute the exact scenario that triggers the bug
|
|
187
|
+
2. Capture complete error output and evidence
|
|
188
|
+
3. Write a failing test that captures the bug (preferred) or a minimal reproduction script
|
|
189
|
+
4. Verify the reproduction is reliable (runs multiple times, consistently fails)
|
|
96
190
|
|
|
97
|
-
|
|
98
|
-
|
|
191
|
+
A bug MUST be reproduced before any fix is attempted. If reproduction fails, report what was tried and stop.
|
|
192
|
+
|
|
193
|
+
### Review
|
|
194
|
+
|
|
195
|
+
Purpose: Multi-dimensional code review before shipping.
|
|
99
196
|
|
|
100
197
|
Sequence:
|
|
101
|
-
1. `
|
|
102
|
-
2. `
|
|
103
|
-
3.
|
|
104
|
-
4.
|
|
105
|
-
5. `learner` — capture discoveries
|
|
198
|
+
1. Run in parallel: `quality-specialist`, `security-specialist`, `performance-specialist`
|
|
199
|
+
2. `product-specialist` -- verify acceptance criteria are met empirically
|
|
200
|
+
3. `test-specialist` -- verify test coverage and quality
|
|
201
|
+
4. Consolidate findings, ranked by severity
|
|
106
202
|
|
|
107
203
|
### Monitor
|
|
108
|
-
|
|
204
|
+
|
|
205
|
+
Purpose: Check application health and operational status. Can be invoked standalone or as part of Verify.
|
|
109
206
|
|
|
110
207
|
Sequence:
|
|
111
|
-
1. `ops-specialist`
|
|
208
|
+
1. `ops-specialist` -- health checks, log inspection, error monitoring, performance analysis
|
|
112
209
|
2. Report findings, escalate if action needed
|
|
113
210
|
|
|
114
211
|
## JIRA Entry Point
|
|
@@ -116,11 +213,36 @@ Sequence:
|
|
|
116
213
|
When the request references a JIRA ticket (ticket ID like PROJ-123 or a JIRA URL):
|
|
117
214
|
|
|
118
215
|
1. Hand off to `jira-agent`
|
|
119
|
-
2. `jira-agent` reads the ticket
|
|
120
|
-
3.
|
|
121
|
-
4. `jira-agent`
|
|
122
|
-
5. `jira-agent`
|
|
216
|
+
2. `jira-agent` reads the ticket fully (description, comments, attachments, linked issues)
|
|
217
|
+
3. `jira-agent` validates ticket quality via `jira-verify` skill
|
|
218
|
+
4. `jira-agent` runs analytical triage via `ticket-triage` skill
|
|
219
|
+
5. If triage finds unresolved ambiguities (`BLOCKED` verdict), `jira-agent` posts findings and STOPS -- no work begins
|
|
220
|
+
6. `jira-agent` determines intent and delegates to the appropriate flow:
|
|
221
|
+
|
|
222
|
+
| Ticket Type | Flow | Work Type |
|
|
223
|
+
|-------------|------|-----------|
|
|
224
|
+
| Epic | Plan | -- |
|
|
225
|
+
| Story | Implement | Build |
|
|
226
|
+
| Task | Implement | Build |
|
|
227
|
+
| Bug | Implement | Fix |
|
|
228
|
+
| Spike | Implement | Investigate Only |
|
|
229
|
+
| Improvement | Implement | Improve |
|
|
230
|
+
|
|
231
|
+
If the ticket type is ambiguous, read the description to classify. A "Task" that describes broken behavior is a Fix. A "Bug" that requests new functionality is a Build.
|
|
232
|
+
|
|
233
|
+
7. `jira-agent` syncs progress at milestones via `jira-sync` skill
|
|
234
|
+
8. `jira-agent` posts evidence at completion via `jira-evidence` skill
|
|
235
|
+
|
|
236
|
+
## Flow Chaining
|
|
237
|
+
|
|
238
|
+
Flows can chain naturally:
|
|
239
|
+
- Research produces a PRD -- hand it to Plan
|
|
240
|
+
- Plan produces work items -- hand each to Implement
|
|
241
|
+
- Implement produces verified code -- hand to Verify
|
|
242
|
+
- If any flow discovers it lacks what it needs, it stops and suggests the preceding flow
|
|
243
|
+
|
|
244
|
+
The full lifecycle for a large initiative: Research -> Plan -> Implement (per item) -> Verify (per item).
|
|
123
245
|
|
|
124
246
|
## Sub-flow Usage
|
|
125
247
|
|
|
126
|
-
Flows reference sub-flows by name. When a flow says "
|
|
248
|
+
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.
|
|
@@ -90,4 +90,15 @@ Every change requires one or more verification types. Classify the change first,
|
|
|
90
90
|
|
|
91
91
|
---
|
|
92
92
|
|
|
93
|
+
## Local vs Remote Verification
|
|
94
|
+
|
|
95
|
+
Verification happens at two stages in the workflow:
|
|
96
|
+
|
|
97
|
+
- **Local verification** (part of the Implement flow): Run the full test suite, typecheck, lint, and empirically verify the change in a local or preview environment. This proves the change works before shipping. After local verification succeeds, encode it as an e2e test.
|
|
98
|
+
- **Remote verification** (part of the Verify flow): After the PR is merged and deployed, repeat the same empirical verification against the target environment. This proves the change works in production, not just locally. If remote verification fails, fix and re-deploy.
|
|
99
|
+
|
|
100
|
+
Both levels use the same verification types table above. The difference is the environment, not the rigor.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
93
104
|
For the full verification lifecycle (classify, check tooling, plan, execute, loop), surfaces, escalation protocol, and proof artifact requirements, see the `verification-lifecycle` skill loaded by the `verification-specialist` agent.
|
|
@@ -35,17 +35,28 @@ Using the general-purpose agent in Team Lead session, Determine what branch to u
|
|
|
35
35
|
2. Are we on a feature branch without an open pull request? Use the branch, but ask the human what branch to target for the PR
|
|
36
36
|
3. Are we on an environment branch (dev, staging, main, prod, production)? Check out a feature branch named for this plan and set the target branch of the PR to the environment branch
|
|
37
37
|
|
|
38
|
-
Using the general-purpose agent in Team Lead session, Determine
|
|
39
|
-
1.
|
|
40
|
-
2.
|
|
41
|
-
3.
|
|
42
|
-
4.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
Using the general-purpose agent in Team Lead session, Determine which flow applies:
|
|
39
|
+
1. Research -- needs a PRD (no specification exists)
|
|
40
|
+
2. Plan -- needs decomposition (specification exists but no work items)
|
|
41
|
+
3. Implement -- has a well-defined work item
|
|
42
|
+
4. Verify -- has code ready to ship
|
|
43
|
+
|
|
44
|
+
If Implement, determine the work type:
|
|
45
|
+
1. Build (feature, story, task)
|
|
46
|
+
2. Fix (bug -- mandatory Reproduce sub-flow before investigation)
|
|
47
|
+
3. Improve (refactoring, optimization, coverage improvement)
|
|
48
|
+
4. Investigate Only (spike -- no code changes, just findings)
|
|
49
|
+
|
|
50
|
+
Run the readiness gate check for the selected flow as defined in `.claude/rules/intent-routing.md`. If the gate fails, stop and report what is missing.
|
|
51
|
+
|
|
52
|
+
IF it is a Fix (bug), execute the Reproduce sub-flow FIRST:
|
|
53
|
+
1. Write a failing test that demonstrates the bug (preferred)
|
|
54
|
+
2. If a failing test is not possible, write a minimal reproduction script
|
|
55
|
+
3. Verify the reproduction is reliable (consistent failure)
|
|
56
|
+
4. The reproduction MUST succeed before any investigation or fix attempt begins
|
|
57
|
+
5. Examples of reproduction methods:
|
|
47
58
|
1. Write a simple API client and call the offending API
|
|
48
|
-
2. Start the server on localhost and
|
|
59
|
+
2. Start the server on localhost and use the Playwright CLI or Chrome DevTools
|
|
49
60
|
|
|
50
61
|
Using the general-purpose agent in Team Lead session, determine how you will know that the task is fully complete
|
|
51
62
|
1. Examples
|
|
@@ -78,12 +89,18 @@ Before any task is implemented, the agent team must explore the codebase for rel
|
|
|
78
89
|
Each task must be reviewed by the team to make sure their verification passes.
|
|
79
90
|
Each task must have their learnings reviewed by the learner subagent.
|
|
80
91
|
|
|
81
|
-
Before shutting down the team:
|
|
82
|
-
|
|
83
|
-
1.
|
|
84
|
-
2.
|
|
85
|
-
3.
|
|
86
|
-
4.
|
|
87
|
-
5.
|
|
88
|
-
6.
|
|
89
|
-
7.
|
|
92
|
+
Before shutting down the team, execute the Verify flow:
|
|
93
|
+
|
|
94
|
+
1. Run local validation: lint, typecheck, tests — all must pass
|
|
95
|
+
2. `verification-specialist`: verify locally (empirical proof that the change works)
|
|
96
|
+
3. Write e2e test encoding the verification
|
|
97
|
+
4. Commit ALL outstanding changes in logical batches on the branch (minus sensitive data/information) — not just changes made by the agent team. This includes pre-existing uncommitted changes that were on the branch before the plan started. Do NOT filter commits to only "task-related" files. If it shows up in git status, it gets committed (unless it contains secrets).
|
|
98
|
+
5. Push the changes - if any pre-push hook blocks you, create a task for the agent team to fix the error/problem whether it was pre-existing or not
|
|
99
|
+
6. Open a pull request with auto-merge on
|
|
100
|
+
7. PR Watch Loop: Monitor the PR. Create a task for the agent team to resolve any code review comments by either implementing the suggestions or commenting why they should not be implemented and close the comment. Fix any failing checks and repush. Continue until all checks pass.
|
|
101
|
+
8. Merge the PR
|
|
102
|
+
9. Monitor the deploy action that triggers automatically from the successful merge
|
|
103
|
+
10. If deploy fails, create a task for the agent team to fix the failure, open a new PR and then go back to step 7
|
|
104
|
+
11. Remote verification: `verification-specialist` verifies in target environment (same checks as local verification, but on remote)
|
|
105
|
+
12. `ops-specialist`: post-deploy health check, monitor for errors in first minutes
|
|
106
|
+
13. If remote verification fails, create a task for the agent team to find out why it failed, fix it and return to step 4 (repeat until you get all the way through)
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Validates the intent-routing system wiring:
|
|
3
|
+
# - All commands reference valid flows
|
|
4
|
+
# - All agents referenced in intent-routing exist
|
|
5
|
+
# - All skills referenced by agents exist
|
|
6
|
+
# - Hooks produce valid JSON
|
|
7
|
+
# - plugin.json is valid and references existing hook files
|
|
8
|
+
# - No stale flow names remain
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
|
|
11
|
+
PLUGIN_SRC="plugins/src/base"
|
|
12
|
+
PLUGIN_BUILT="plugins/lisa"
|
|
13
|
+
ERRORS=0
|
|
14
|
+
WARNINGS=0
|
|
15
|
+
|
|
16
|
+
pass() { echo " PASS: $1"; }
|
|
17
|
+
fail() { echo " FAIL: $1"; ERRORS=$((ERRORS + 1)); }
|
|
18
|
+
warn() { echo " WARN: $1"; WARNINGS=$((WARNINGS + 1)); }
|
|
19
|
+
|
|
20
|
+
echo "=== Intent Routing Validation ==="
|
|
21
|
+
echo ""
|
|
22
|
+
|
|
23
|
+
# 1. Check intent-routing.md exists and has all 4 main flows
|
|
24
|
+
echo "--- 1. Flow Definitions ---"
|
|
25
|
+
ROUTING="$PLUGIN_SRC/rules/intent-routing.md"
|
|
26
|
+
if [ ! -f "$ROUTING" ]; then
|
|
27
|
+
fail "intent-routing.md not found at $ROUTING"
|
|
28
|
+
else
|
|
29
|
+
for flow in "### Research" "### Plan" "### Implement" "### Verify"; do
|
|
30
|
+
if grep -q "$flow" "$ROUTING"; then
|
|
31
|
+
pass "Flow section '$flow' exists"
|
|
32
|
+
else
|
|
33
|
+
fail "Flow section '$flow' missing from intent-routing.md"
|
|
34
|
+
fi
|
|
35
|
+
done
|
|
36
|
+
for subflow in "### Investigate" "### Reproduce" "### Review" "### Monitor"; do
|
|
37
|
+
if grep -q "$subflow" "$ROUTING"; then
|
|
38
|
+
pass "Sub-flow section '$subflow' exists"
|
|
39
|
+
else
|
|
40
|
+
fail "Sub-flow section '$subflow' missing from intent-routing.md"
|
|
41
|
+
fi
|
|
42
|
+
done
|
|
43
|
+
fi
|
|
44
|
+
echo ""
|
|
45
|
+
|
|
46
|
+
# 2. Check no stale flow names remain in source
|
|
47
|
+
echo "--- 2. Stale Flow Names ---"
|
|
48
|
+
STALE=$(grep -rl "Fix flow\|Build flow\|Ship flow\|Improve flow\|Investigate flow\|Monitor flow\|Review flow" "$PLUGIN_SRC" 2>/dev/null || true)
|
|
49
|
+
if [ -z "$STALE" ]; then
|
|
50
|
+
pass "No stale flow names (Fix flow, Build flow, etc.) in $PLUGIN_SRC"
|
|
51
|
+
else
|
|
52
|
+
fail "Stale flow names found in: $STALE"
|
|
53
|
+
fi
|
|
54
|
+
echo ""
|
|
55
|
+
|
|
56
|
+
# 3. Check all commands exist
|
|
57
|
+
echo "--- 3. Commands ---"
|
|
58
|
+
for cmd in research verify fix build improve investigate plan ship review monitor; do
|
|
59
|
+
if [ -f "$PLUGIN_SRC/commands/$cmd.md" ]; then
|
|
60
|
+
pass "Command /$cmd exists"
|
|
61
|
+
else
|
|
62
|
+
fail "Command /$cmd missing at $PLUGIN_SRC/commands/$cmd.md"
|
|
63
|
+
fi
|
|
64
|
+
done
|
|
65
|
+
echo ""
|
|
66
|
+
|
|
67
|
+
# 4. Check commands reference the correct flows
|
|
68
|
+
echo "--- 4. Command -> Flow References ---"
|
|
69
|
+
check_cmd_flow() {
|
|
70
|
+
local cmd="$1" expected="$2"
|
|
71
|
+
if grep -q "$expected" "$PLUGIN_SRC/commands/$cmd.md" 2>/dev/null; then
|
|
72
|
+
pass "/$cmd references '$expected'"
|
|
73
|
+
else
|
|
74
|
+
fail "/$cmd does not reference '$expected'"
|
|
75
|
+
fi
|
|
76
|
+
}
|
|
77
|
+
check_cmd_flow "research" "Research"
|
|
78
|
+
check_cmd_flow "plan" "Plan"
|
|
79
|
+
check_cmd_flow "fix" "Implement"
|
|
80
|
+
check_cmd_flow "build" "Implement"
|
|
81
|
+
check_cmd_flow "improve" "Implement"
|
|
82
|
+
check_cmd_flow "investigate" "Implement"
|
|
83
|
+
check_cmd_flow "verify" "Verify"
|
|
84
|
+
check_cmd_flow "ship" "Verify"
|
|
85
|
+
check_cmd_flow "review" "Review"
|
|
86
|
+
check_cmd_flow "monitor" "Monitor"
|
|
87
|
+
echo ""
|
|
88
|
+
|
|
89
|
+
# 5. Check all agents referenced in intent-routing exist
|
|
90
|
+
echo "--- 5. Agent References ---"
|
|
91
|
+
AGENTS_DIR="$PLUGIN_SRC/agents"
|
|
92
|
+
for agent in product-specialist architecture-specialist test-specialist builder bug-fixer \
|
|
93
|
+
debug-specialist git-history-analyzer ops-specialist verification-specialist \
|
|
94
|
+
quality-specialist security-specialist performance-specialist learner jira-agent; do
|
|
95
|
+
if [ -f "$AGENTS_DIR/$agent.md" ]; then
|
|
96
|
+
pass "Agent '$agent' exists"
|
|
97
|
+
else
|
|
98
|
+
# ops-specialist is stack-specific, check expo/rails
|
|
99
|
+
if [ "$agent" = "ops-specialist" ]; then
|
|
100
|
+
if [ -f "plugins/src/expo/agents/$agent.md" ] || [ -f "plugins/src/rails/agents/$agent.md" ]; then
|
|
101
|
+
pass "Agent '$agent' exists (stack-specific)"
|
|
102
|
+
else
|
|
103
|
+
warn "Agent '$agent' not found in base (expected in stack-specific plugins)"
|
|
104
|
+
fi
|
|
105
|
+
else
|
|
106
|
+
fail "Agent '$agent' referenced in intent-routing but not found"
|
|
107
|
+
fi
|
|
108
|
+
fi
|
|
109
|
+
done
|
|
110
|
+
echo ""
|
|
111
|
+
|
|
112
|
+
# 6. Check hooks
|
|
113
|
+
echo "--- 6. Hooks ---"
|
|
114
|
+
HOOK_FILE="$PLUGIN_SRC/hooks/inject-flow-context.sh"
|
|
115
|
+
if [ -f "$HOOK_FILE" ]; then
|
|
116
|
+
pass "inject-flow-context.sh exists"
|
|
117
|
+
if [ -x "$HOOK_FILE" ]; then
|
|
118
|
+
pass "inject-flow-context.sh is executable"
|
|
119
|
+
else
|
|
120
|
+
fail "inject-flow-context.sh is not executable"
|
|
121
|
+
fi
|
|
122
|
+
# Test it produces valid JSON
|
|
123
|
+
HOOK_OUTPUT=$(echo '{}' | bash "$HOOK_FILE" 2>/dev/null)
|
|
124
|
+
if echo "$HOOK_OUTPUT" | jq . >/dev/null 2>&1; then
|
|
125
|
+
pass "inject-flow-context.sh produces valid JSON"
|
|
126
|
+
# Check it has the right structure
|
|
127
|
+
if echo "$HOOK_OUTPUT" | jq -e '.hookSpecificOutput.additionalContext' >/dev/null 2>&1; then
|
|
128
|
+
pass "inject-flow-context.sh has correct JSON structure"
|
|
129
|
+
else
|
|
130
|
+
fail "inject-flow-context.sh missing hookSpecificOutput.additionalContext"
|
|
131
|
+
fi
|
|
132
|
+
else
|
|
133
|
+
fail "inject-flow-context.sh does not produce valid JSON"
|
|
134
|
+
fi
|
|
135
|
+
else
|
|
136
|
+
fail "inject-flow-context.sh not found"
|
|
137
|
+
fi
|
|
138
|
+
echo ""
|
|
139
|
+
|
|
140
|
+
# 7. Check plugin.json
|
|
141
|
+
echo "--- 7. Plugin Configuration ---"
|
|
142
|
+
PLUGIN_JSON="$PLUGIN_SRC/.claude-plugin/plugin.json"
|
|
143
|
+
if jq . "$PLUGIN_JSON" >/dev/null 2>&1; then
|
|
144
|
+
pass "plugin.json is valid JSON"
|
|
145
|
+
else
|
|
146
|
+
fail "plugin.json is not valid JSON"
|
|
147
|
+
fi
|
|
148
|
+
|
|
149
|
+
# Check haiku prompt hook is registered
|
|
150
|
+
if jq -e '.hooks.UserPromptSubmit[].hooks[] | select(.type == "prompt")' "$PLUGIN_JSON" >/dev/null 2>&1; then
|
|
151
|
+
pass "Haiku prompt hook registered in UserPromptSubmit"
|
|
152
|
+
else
|
|
153
|
+
fail "Haiku prompt hook not found in UserPromptSubmit"
|
|
154
|
+
fi
|
|
155
|
+
|
|
156
|
+
# Check inject-flow-context is registered in SubagentStart
|
|
157
|
+
if jq -e '.hooks.SubagentStart[] | select(.hooks[].command | test("inject-flow-context"))' "$PLUGIN_JSON" >/dev/null 2>&1; then
|
|
158
|
+
pass "inject-flow-context.sh registered in SubagentStart"
|
|
159
|
+
else
|
|
160
|
+
fail "inject-flow-context.sh not registered in SubagentStart"
|
|
161
|
+
fi
|
|
162
|
+
echo ""
|
|
163
|
+
|
|
164
|
+
# 8. Check built plugin matches source
|
|
165
|
+
echo "--- 8. Built Plugin ---"
|
|
166
|
+
if [ -d "$PLUGIN_BUILT" ]; then
|
|
167
|
+
for file in commands/research.md commands/verify.md hooks/inject-flow-context.sh rules/intent-routing.md; do
|
|
168
|
+
if [ -f "$PLUGIN_BUILT/$file" ]; then
|
|
169
|
+
if diff -q "$PLUGIN_SRC/$file" "$PLUGIN_BUILT/$file" >/dev/null 2>&1; then
|
|
170
|
+
pass "Built $file matches source"
|
|
171
|
+
else
|
|
172
|
+
fail "Built $file differs from source (run bun run build:plugins)"
|
|
173
|
+
fi
|
|
174
|
+
else
|
|
175
|
+
fail "Built $file not found (run bun run build:plugins)"
|
|
176
|
+
fi
|
|
177
|
+
done
|
|
178
|
+
else
|
|
179
|
+
fail "Built plugin directory $PLUGIN_BUILT not found"
|
|
180
|
+
fi
|
|
181
|
+
echo ""
|
|
182
|
+
|
|
183
|
+
# 9. Check readiness gates are defined
|
|
184
|
+
echo "--- 9. Readiness Gates ---"
|
|
185
|
+
for gate in "Gate:" "problem statement" "PRD" "acceptance criteria" "local validation"; do
|
|
186
|
+
if grep -q "$gate" "$ROUTING"; then
|
|
187
|
+
pass "Readiness gate reference '$gate' found"
|
|
188
|
+
else
|
|
189
|
+
warn "Readiness gate reference '$gate' not found in intent-routing.md"
|
|
190
|
+
fi
|
|
191
|
+
done
|
|
192
|
+
echo ""
|
|
193
|
+
|
|
194
|
+
# 10. Check headless mode handling
|
|
195
|
+
echo "--- 10. Headless Mode ---"
|
|
196
|
+
if grep -qi "headless\|non-interactive" "$ROUTING"; then
|
|
197
|
+
pass "Headless/non-interactive mode handling documented"
|
|
198
|
+
else
|
|
199
|
+
fail "No headless/non-interactive mode handling in intent-routing.md"
|
|
200
|
+
fi
|
|
201
|
+
if grep -qi "do NOT ask" "$ROUTING"; then
|
|
202
|
+
pass "Explicit 'do NOT ask' directive for headless mode"
|
|
203
|
+
else
|
|
204
|
+
warn "Missing explicit 'do NOT ask' directive for headless mode"
|
|
205
|
+
fi
|
|
206
|
+
echo ""
|
|
207
|
+
|
|
208
|
+
# Summary
|
|
209
|
+
echo "=== Summary ==="
|
|
210
|
+
echo " Passed: checks completed"
|
|
211
|
+
echo " Errors: $ERRORS"
|
|
212
|
+
echo " Warnings: $WARNINGS"
|
|
213
|
+
if [ "$ERRORS" -gt 0 ]; then
|
|
214
|
+
echo ""
|
|
215
|
+
echo "FAILED: $ERRORS error(s) found. Fix before deploying."
|
|
216
|
+
exit 1
|
|
217
|
+
else
|
|
218
|
+
echo ""
|
|
219
|
+
echo "ALL CHECKS PASSED."
|
|
220
|
+
exit 0
|
|
221
|
+
fi
|