@codyswann/lisa 1.79.2 → 1.81.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/cdk/package-lisa/package.lisa.json +1 -0
- package/nestjs/package-lisa/package.lisa.json +1 -0
- package/package.json +3 -2
- 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/rails/create-only/.github/workflows/claude-code-review-response.yml +30 -0
- package/scripts/test-intent-routing.sh +221 -0
|
@@ -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
|