@codyswann/lisa 1.67.3 → 1.68.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.
Files changed (127) hide show
  1. package/all/copy-overwrite/.claude/rules/base-rules.md +0 -50
  2. package/all/copy-overwrite/.claude/rules/intent-routing.md +115 -0
  3. package/all/copy-overwrite/.claude/rules/verification.md +27 -538
  4. package/package.json +1 -1
  5. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  6. package/plugins/lisa/agents/architecture-specialist.md +4 -9
  7. package/plugins/lisa/agents/bug-fixer.md +40 -0
  8. package/plugins/lisa/agents/builder.md +41 -0
  9. package/plugins/lisa/agents/debug-specialist.md +4 -93
  10. package/plugins/lisa/agents/jira-agent.md +85 -0
  11. package/plugins/lisa/agents/performance-specialist.md +2 -11
  12. package/plugins/lisa/agents/product-specialist.md +2 -10
  13. package/plugins/lisa/agents/quality-specialist.md +2 -0
  14. package/plugins/lisa/agents/security-specialist.md +3 -9
  15. package/plugins/lisa/agents/test-specialist.md +2 -16
  16. package/plugins/lisa/agents/verification-specialist.md +38 -103
  17. package/plugins/lisa/commands/build.md +10 -0
  18. package/plugins/lisa/commands/fix.md +10 -0
  19. package/plugins/lisa/commands/improve.md +15 -0
  20. package/plugins/lisa/commands/investigate.md +10 -0
  21. package/plugins/lisa/commands/monitor.md +10 -0
  22. package/plugins/lisa/commands/plan/create.md +1 -1
  23. package/plugins/lisa/commands/plan/execute.md +1 -2
  24. package/plugins/lisa/commands/plan.md +10 -0
  25. package/plugins/lisa/commands/review.md +10 -0
  26. package/plugins/lisa/commands/ship.md +10 -0
  27. package/plugins/lisa/skills/acceptance-criteria/SKILL.md +71 -0
  28. package/plugins/lisa/skills/bug-triage/SKILL.md +23 -0
  29. package/plugins/lisa/skills/codebase-research/SKILL.md +87 -0
  30. package/plugins/lisa/skills/epic-triage/SKILL.md +28 -0
  31. package/plugins/lisa/skills/performance-review/SKILL.md +94 -0
  32. package/plugins/lisa/skills/quality-review/SKILL.md +54 -0
  33. package/plugins/lisa/skills/reproduce-bug/SKILL.md +96 -0
  34. package/plugins/lisa/skills/root-cause-analysis/SKILL.md +155 -0
  35. package/plugins/lisa/skills/security-review/SKILL.md +57 -0
  36. package/plugins/lisa/skills/task-decomposition/SKILL.md +95 -0
  37. package/plugins/lisa/skills/task-triage/SKILL.md +23 -0
  38. package/plugins/lisa/skills/tdd-implementation/SKILL.md +83 -0
  39. package/plugins/lisa/skills/test-strategy/SKILL.md +63 -0
  40. package/plugins/lisa/skills/verification-lifecycle/SKILL.md +292 -0
  41. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  43. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  44. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  46. package/plugins/src/base/agents/architecture-specialist.md +4 -9
  47. package/plugins/src/base/agents/bug-fixer.md +40 -0
  48. package/plugins/src/base/agents/builder.md +41 -0
  49. package/plugins/src/base/agents/debug-specialist.md +4 -93
  50. package/plugins/src/base/agents/jira-agent.md +85 -0
  51. package/plugins/src/base/agents/performance-specialist.md +2 -11
  52. package/plugins/src/base/agents/product-specialist.md +2 -10
  53. package/plugins/src/base/agents/quality-specialist.md +2 -0
  54. package/plugins/src/base/agents/security-specialist.md +3 -9
  55. package/plugins/src/base/agents/test-specialist.md +2 -16
  56. package/plugins/src/base/agents/verification-specialist.md +38 -103
  57. package/plugins/src/base/commands/build.md +10 -0
  58. package/plugins/src/base/commands/fix.md +10 -0
  59. package/plugins/src/base/commands/improve.md +15 -0
  60. package/plugins/src/base/commands/investigate.md +10 -0
  61. package/plugins/src/base/commands/monitor.md +10 -0
  62. package/plugins/src/base/commands/plan/create.md +1 -1
  63. package/plugins/src/base/commands/plan/execute.md +1 -2
  64. package/plugins/src/base/commands/plan.md +10 -0
  65. package/plugins/src/base/commands/review.md +10 -0
  66. package/plugins/src/base/commands/ship.md +10 -0
  67. package/plugins/src/base/skills/acceptance-criteria/SKILL.md +71 -0
  68. package/plugins/src/base/skills/bug-triage/SKILL.md +23 -0
  69. package/plugins/src/base/skills/codebase-research/SKILL.md +87 -0
  70. package/plugins/src/base/skills/epic-triage/SKILL.md +28 -0
  71. package/plugins/src/base/skills/performance-review/SKILL.md +94 -0
  72. package/plugins/src/base/skills/quality-review/SKILL.md +54 -0
  73. package/plugins/src/base/skills/reproduce-bug/SKILL.md +96 -0
  74. package/plugins/src/base/skills/root-cause-analysis/SKILL.md +155 -0
  75. package/plugins/src/base/skills/security-review/SKILL.md +57 -0
  76. package/plugins/src/base/skills/task-decomposition/SKILL.md +95 -0
  77. package/plugins/src/base/skills/task-triage/SKILL.md +23 -0
  78. package/plugins/src/base/skills/tdd-implementation/SKILL.md +83 -0
  79. package/plugins/src/base/skills/test-strategy/SKILL.md +63 -0
  80. package/plugins/src/base/skills/verification-lifecycle/SKILL.md +292 -0
  81. package/expo/copy-overwrite/.claude/rules/expo-verification.md +0 -261
  82. package/plugins/lisa/agents/agent-architect.md +0 -310
  83. package/plugins/lisa/agents/hooks-expert.md +0 -74
  84. package/plugins/lisa/agents/implementer.md +0 -54
  85. package/plugins/lisa/agents/slash-command-architect.md +0 -87
  86. package/plugins/lisa/agents/web-search-researcher.md +0 -112
  87. package/plugins/lisa/commands/git/commit-and-submit-pr.md +0 -7
  88. package/plugins/lisa/commands/git/commit-submit-pr-and-verify.md +0 -7
  89. package/plugins/lisa/commands/git/commit-submit-pr-deploy-and-verify.md +0 -7
  90. package/plugins/lisa/commands/jira/fix.md +0 -7
  91. package/plugins/lisa/commands/jira/implement.md +0 -7
  92. package/plugins/lisa/commands/sonarqube/check.md +0 -6
  93. package/plugins/lisa/commands/sonarqube/fix.md +0 -6
  94. package/plugins/lisa/commands/tasks/load.md +0 -7
  95. package/plugins/lisa/commands/tasks/sync.md +0 -7
  96. package/plugins/lisa/skills/git-commit-and-submit-pr/SKILL.md +0 -8
  97. package/plugins/lisa/skills/git-commit-submit-pr-and-verify/SKILL.md +0 -7
  98. package/plugins/lisa/skills/git-commit-submit-pr-deploy-and-verify/SKILL.md +0 -7
  99. package/plugins/lisa/skills/jira-fix/SKILL.md +0 -16
  100. package/plugins/lisa/skills/jira-implement/SKILL.md +0 -18
  101. package/plugins/lisa/skills/sonarqube-check/SKILL.md +0 -11
  102. package/plugins/lisa/skills/sonarqube-fix/SKILL.md +0 -8
  103. package/plugins/lisa/skills/tasks-load/SKILL.md +0 -88
  104. package/plugins/lisa/skills/tasks-sync/SKILL.md +0 -108
  105. package/plugins/src/base/agents/agent-architect.md +0 -310
  106. package/plugins/src/base/agents/hooks-expert.md +0 -74
  107. package/plugins/src/base/agents/implementer.md +0 -54
  108. package/plugins/src/base/agents/slash-command-architect.md +0 -87
  109. package/plugins/src/base/agents/web-search-researcher.md +0 -112
  110. package/plugins/src/base/commands/git/commit-and-submit-pr.md +0 -7
  111. package/plugins/src/base/commands/git/commit-submit-pr-and-verify.md +0 -7
  112. package/plugins/src/base/commands/git/commit-submit-pr-deploy-and-verify.md +0 -7
  113. package/plugins/src/base/commands/jira/fix.md +0 -7
  114. package/plugins/src/base/commands/jira/implement.md +0 -7
  115. package/plugins/src/base/commands/sonarqube/check.md +0 -6
  116. package/plugins/src/base/commands/sonarqube/fix.md +0 -6
  117. package/plugins/src/base/commands/tasks/load.md +0 -7
  118. package/plugins/src/base/commands/tasks/sync.md +0 -7
  119. package/plugins/src/base/skills/git-commit-and-submit-pr/SKILL.md +0 -8
  120. package/plugins/src/base/skills/git-commit-submit-pr-and-verify/SKILL.md +0 -7
  121. package/plugins/src/base/skills/git-commit-submit-pr-deploy-and-verify/SKILL.md +0 -7
  122. package/plugins/src/base/skills/jira-fix/SKILL.md +0 -16
  123. package/plugins/src/base/skills/jira-implement/SKILL.md +0 -18
  124. package/plugins/src/base/skills/sonarqube-check/SKILL.md +0 -11
  125. package/plugins/src/base/skills/sonarqube-fix/SKILL.md +0 -8
  126. package/plugins/src/base/skills/tasks-load/SKILL.md +0 -88
  127. package/plugins/src/base/skills/tasks-sync/SKILL.md +0 -108
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: "Review code changes. Runs quality, security, performance, product, and test reviews in parallel, then consolidates findings."
3
+ argument-hint: "[pr-link-or-branch]"
4
+ ---
5
+
6
+ Read `.claude/rules/intent-routing.md` and execute the **Review** flow.
7
+
8
+ Runs `quality-specialist`, `security-specialist`, and `performance-specialist` in parallel, followed by `product-specialist` and `test-specialist`. Consolidates all findings ranked by severity.
9
+
10
+ $ARGUMENTS
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: "Ship current changes. Commits, opens PR, handles review feedback loop, deploys, verifies, and monitors."
3
+ argument-hint: "[commit-message-hint]"
4
+ ---
5
+
6
+ Read `.claude/rules/intent-routing.md` and execute the **Ship** flow.
7
+
8
+ This includes: atomic commits, PR creation, review-fix loop (fix failed checks, resolve merge conflicts, handle bot review feedback until mergeable), merge, deploy, post-deploy verification, and monitoring.
9
+
10
+ $ARGUMENTS
@@ -0,0 +1,71 @@
1
+ ---
2
+ name: acceptance-criteria
3
+ description: "Acceptance criteria definition. Gherkin user flows (Given/When/Then), error states, UX concerns, and empirical verification from the user perspective."
4
+ ---
5
+
6
+ # Acceptance Criteria
7
+
8
+ Evaluate changes from a non-technical user's perspective. Define acceptance criteria and verify behavior matches requirements.
9
+
10
+ ## Analysis Process
11
+
12
+ 1. **Understand the user goal** -- what problem does this solve for the end user?
13
+ 2. **Define user flows** -- step-by-step paths through the feature, including happy path and error paths
14
+ 3. **Write acceptance criteria** -- testable conditions from the user's perspective
15
+ 4. **Identify UX concerns** -- confusing interactions, missing feedback, accessibility issues
16
+ 5. **Map error states** -- what happens when things go wrong, and what the user sees
17
+ 6. **Run the feature** -- execute scripts, call APIs, or trigger the described behavior to verify empirically
18
+ 7. **Compare output to requirements** -- does actual behavior match expectations?
19
+
20
+ ## Output Format
21
+
22
+ Structure findings as:
23
+
24
+ ```
25
+ ## Product Analysis
26
+
27
+ ### User Goal
28
+ [1-2 sentence summary of what the user wants to accomplish]
29
+
30
+ ### User Flows (Gherkin)
31
+
32
+ #### Happy Path
33
+ Given [precondition]
34
+ When [action]
35
+ Then [expected outcome]
36
+
37
+ #### Error Path: [description]
38
+ Given [precondition]
39
+ When [action that fails]
40
+ Then [error handling behavior]
41
+
42
+ ### Acceptance Criteria
43
+ - [ ] [criterion from user perspective]
44
+
45
+ ### UX Concerns
46
+ - [concern] -- impact on user experience
47
+
48
+ ### Error Handling Requirements
49
+ | Error Condition | User Sees | User Can Do |
50
+ |----------------|-----------|-------------|
51
+
52
+ ### Verification Results
53
+ For each acceptance criterion:
54
+ - **Criterion:** [what was expected]
55
+ - **Result:** Pass / Fail / Not Yet Testable
56
+ - **Evidence:** [what was observed]
57
+
58
+ ### Out of Scope
59
+ - [thing that might be expected but is not part of this work]
60
+ ```
61
+
62
+ ## Rules
63
+
64
+ - Write acceptance criteria from the user's perspective, not the developer's
65
+ - Every user flow must include at least one error path
66
+ - Use Gherkin format (Given/When/Then) for user flows to enable direct translation into test cases
67
+ - When verifying, always run the feature -- never review by only reading code
68
+ - If you cannot run the feature (missing dependencies, services unavailable), report as a blocker -- do not guess
69
+ - If the changes are purely internal (refactoring, config, tooling), report "No user-facing impact" and explain why
70
+ - Do not propose UX changes beyond what was described -- flag scope concerns instead
71
+ - Assume the reviewer has no technical background
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: bug-triage
3
+ description: "8-step bug triage and implementation workflow. Ensures bugs are reproducible, root-caused, and fixable before implementation begins."
4
+ ---
5
+
6
+ # Bug Triage
7
+
8
+ Follow this 8-step triage process before implementing any bug fix. Do not skip triage.
9
+
10
+ ## Triage Steps
11
+
12
+ 1. Verify you have all information needed to reproduce the bug (authentication requirements, environment information, etc.). Do not make assumptions. If anything is missing, stop and ask before proceeding.
13
+ 2. Reproduce the bug. If you cannot reproduce it, stop and report what you tried and what you observed.
14
+ 3. Once reproduced, verify you are 100% positive on how to fix it. If not, determine what you need to do to be 100% positive (e.g. add logging, trace the code path, inspect state) and do that first.
15
+ 4. Verify you have access to the tools, environments, and permissions needed to deploy and verify this fix (e.g. CI/CD pipelines, deployment targets, logging/monitoring systems, API access, database access). If any are missing or inaccessible, stop and raise them before starting implementation.
16
+ 5. Define the tests you will write to confirm the fix and prevent a regression.
17
+ 6. Define the documentation you will create or update to explain this bug so another developer understands the "how" and "what" behind it.
18
+ 7. If you can verify your fix before deploying to the target environment (e.g. start the app, invoke the API, open a browser, run the process, check logs), do so before deploying.
19
+ 8. Define how you will verify the fix beyond a shadow of a doubt (e.g. deploy to the target environment, invoke the API, open a browser, run the process, check logs).
20
+
21
+ ## Implementation
22
+
23
+ Use the output of the triage steps above as your guide. Do not skip triage.
@@ -0,0 +1,87 @@
1
+ ---
2
+ name: codebase-research
3
+ description: "Codebase exploration and architecture analysis. Read files, trace data flow, identify modification points, map dependencies, find reusable code, evaluate design patterns."
4
+ ---
5
+
6
+ # Codebase Research
7
+
8
+ Systematically explore and analyze a codebase to understand its architecture, trace data flow, and identify how to make changes safely.
9
+
10
+ ## Analysis Process
11
+
12
+ Follow these steps in order. Do not skip steps or propose changes to code you have not read.
13
+
14
+ ### 1. Read Referenced Files
15
+
16
+ - Read every file that is directly relevant to the task
17
+ - Understand the current architecture before proposing changes
18
+ - Read imports and dependencies to understand the module graph
19
+ - Check for configuration files that affect behavior (tsconfig, eslint, webpack, etc.)
20
+
21
+ ### 2. Trace Data Flow
22
+
23
+ - Follow the path from entry point to output for the affected feature
24
+ - Identify every transformation the data undergoes
25
+ - Map inputs, intermediate states, and outputs
26
+ - Note where data crosses boundaries (API calls, database queries, message queues)
27
+
28
+ ### 3. Identify Modification Points
29
+
30
+ - Determine which files, functions, and interfaces need changes
31
+ - Note the exact lines where modifications are required
32
+ - Identify any type definitions, schemas, or contracts that must be updated
33
+ - Check for generated code that may need regeneration
34
+
35
+ ### 4. Map Dependencies
36
+
37
+ - Identify what depends on the code being changed (downstream consumers)
38
+ - Identify what the code being changed depends on (upstream providers)
39
+ - Determine the safe modification order to avoid breaking intermediate states
40
+ - Flag any circular dependencies
41
+
42
+ ### 5. Check for Reusable Code
43
+
44
+ - Search for existing utilities, helpers, or patterns that apply to the task
45
+ - Check shared libraries and common modules
46
+ - Look for similar implementations elsewhere in the codebase that can be referenced
47
+ - Prefer reusing existing code over creating new abstractions
48
+
49
+ ### 6. Evaluate Design Patterns
50
+
51
+ - Match the codebase's existing patterns -- do not introduce new architectural patterns without reason
52
+ - Check naming conventions, file organization, and code style
53
+ - Identify any patterns that are partially implemented and should be completed
54
+ - Note anti-patterns that should not be propagated
55
+
56
+ ## Output Format
57
+
58
+ ```text
59
+ ## Architecture Analysis
60
+
61
+ ### Files to Create
62
+ - `path/to/file.ts` -- purpose
63
+
64
+ ### Files to Modify
65
+ - `path/to/file.ts:L42-L68` -- what changes and why
66
+
67
+ ### Dependency Graph
68
+ - [file A] -> [file B] -> [file C] (modification order)
69
+
70
+ ### Design Decisions
71
+ | Decision | Choice | Rationale |
72
+ |----------|--------|-----------|
73
+
74
+ ### Reusable Code
75
+ - `path/to/util.ts:functionName` -- how it applies
76
+
77
+ ### Risks
78
+ - [risk description] -- [mitigation]
79
+ ```
80
+
81
+ ## Rules
82
+
83
+ - Always read files before recommending changes to them
84
+ - Follow existing patterns in the codebase -- do not introduce new architectural patterns unless explicitly required
85
+ - Include file:line references for all recommendations
86
+ - Flag breaking changes explicitly
87
+ - Keep the modification surface area as small as possible
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: epic-triage
3
+ description: "9-step epic triage and 5-step implementation workflow. Ensures epics are fully scoped, broken down, and ordered before execution begins."
4
+ ---
5
+
6
+ # Epic Triage
7
+
8
+ Follow this 9-step triage process before implementing any epic. Do not skip triage.
9
+
10
+ ## Triage Steps
11
+
12
+ 1. Verify you have all information needed to understand the full scope of this epic (goals, acceptance criteria, impacted systems, design specs, dependencies, etc.). Do not make assumptions. If anything is missing, stop and ask before proceeding.
13
+ 2. Verify the epic is broken down into concrete, well-scoped bugs, tasks, and/or stories that are each fully triaged. If ambiguities exist, stop and resolve them before breaking it down.
14
+ 3. Identify all cross-cutting concerns (auth, performance, security, data migrations, third-party integrations) that need to be addressed across the epic.
15
+ 4. Identify all dependencies between tasks within the epic, or on external epics, teams, or services. Determine the correct order of execution.
16
+ 5. Verify you have access to the tools, environments, and permissions needed to deploy and verify all tasks within this epic (e.g. CI/CD pipelines, deployment targets, logging/monitoring systems, API access, database access). If any are missing or inaccessible, stop and raise them before proceeding.
17
+ 6. Define the overall test strategy for the epic (unit, integration, end-to-end, load testing).
18
+ 7. Define the documentation that will need to be created or updated to cover the full scope of the epic so another developer understands the architecture, design decisions, and implementation.
19
+ 8. Define measurable acceptance criteria that confirm the epic is fully complete.
20
+ 9. Define how you will verify the epic is fully delivered beyond a shadow of a doubt (e.g. deploy to the target environment, walk through all acceptance criteria end-to-end, confirm all child tasks/stories are closed, confirm no regressions).
21
+
22
+ ## Implementation
23
+
24
+ 1. Use the output of the triage steps above as your guide. Do not skip triage.
25
+ 2. Work through each task and/or story in the order defined during triage, respecting dependencies.
26
+ 3. Apply the Bug Implementation and Task Implementation processes to each child bug or task, respectively, as you work through them.
27
+ 4. Continuously update the epic and its child issues in JIRA as progress is made.
28
+ 5. Do not consider the epic complete until all acceptance criteria are verified in the target environment and all child issues are resolved.
@@ -0,0 +1,94 @@
1
+ ---
2
+ name: performance-review
3
+ description: "Performance review methodology. N+1 queries, inefficient algorithms, memory leaks, missing indexes, unnecessary re-renders, bundle size issues. Evidence-based recommendations."
4
+ ---
5
+
6
+ # Performance Review
7
+
8
+ Identify bottlenecks, inefficiencies, and scalability risks in code changes.
9
+
10
+ ## Analysis Process
11
+
12
+ 1. **Read affected files** -- understand data access patterns, algorithmic complexity, and resource usage
13
+ 2. **Identify N+1 queries** -- look for ORM calls inside loops, missing eager loading, unbatched database access
14
+ 3. **Check algorithmic complexity** -- nested loops over collections, repeated linear scans, unnecessary sorting
15
+ 4. **Evaluate memory usage** -- large object allocations, unbounded caches, retained references, memory leaks
16
+ 5. **Review database patterns** -- missing indexes, full table scans, unoptimized joins, excessive round trips
17
+ 6. **Check caching** -- missing cache layers, cache invalidation issues, redundant computations
18
+ 7. **Assess bundle/payload size** -- unnecessary imports, large dependencies, uncompressed responses
19
+ 8. **Review rendering performance** -- unnecessary re-renders, missing memoization, layout thrashing (frontend)
20
+
21
+ ## Output Format
22
+
23
+ Structure findings as:
24
+
25
+ ```
26
+ ## Performance Analysis
27
+
28
+ ### Critical Issues
29
+ Issues that will cause noticeable degradation at scale.
30
+
31
+ - [issue] -- where in the code, why it matters, estimated impact
32
+
33
+ ### N+1 Query Detection
34
+ | Location | Pattern | Fix |
35
+ |----------|---------|-----|
36
+ | file:line | Description of the N+1 | Eager load / batch / join |
37
+
38
+ ### Algorithmic Complexity
39
+ | Location | Current | Suggested | Why |
40
+ |----------|---------|-----------|-----|
41
+ | file:line | O(n^2) | O(n) | Description |
42
+
43
+ ### Database Concerns
44
+ - Missing indexes, unoptimized queries, excessive round trips
45
+
46
+ ### Memory Concerns
47
+ - Unbounded growth, large allocations, retained references
48
+
49
+ ### Caching Opportunities
50
+ - Computations or queries that could benefit from caching
51
+
52
+ ### Recommendations
53
+ - [recommendation] -- priority (critical/warning/suggestion), estimated impact
54
+ ```
55
+
56
+ ## Common Patterns to Flag
57
+
58
+ ### N+1 Queries
59
+ ```typescript
60
+ // Bad: N+1 -- one query per user inside loop
61
+ const users = await userRepo.find();
62
+ const profiles = await Promise.all(users.map(u => profileRepo.findOne({ userId: u.id })));
63
+
64
+ // Good: Single query with join or batch
65
+ const users = await userRepo.find({ relations: ["profile"] });
66
+ ```
67
+
68
+ ### Unnecessary Re-computation
69
+ ```typescript
70
+ // Bad: Recomputes on every call
71
+ const getExpensiveResult = () => heavyComputation(data);
72
+
73
+ // Good: Compute once, reuse
74
+ const expensiveResult = heavyComputation(data);
75
+ ```
76
+
77
+ ### Unbounded Collection Growth
78
+ ```typescript
79
+ // Bad: Cache grows without limit
80
+ const cache = new Map();
81
+ const get = (key) => { if (!cache.has(key)) cache.set(key, compute(key)); return cache.get(key); };
82
+
83
+ // Good: LRU or bounded cache
84
+ const cache = new LRUCache({ max: 1000 });
85
+ ```
86
+
87
+ ## Rules
88
+
89
+ - Focus on the specific changes proposed, not a full performance audit of the entire codebase
90
+ - Flag only real performance risks -- do not micro-optimize code that runs once at startup
91
+ - Quantify impact where possible (O(n) vs O(n^2), number of database round trips, estimated payload size)
92
+ - Distinguish between critical issues (will degrade at scale) and suggestions (marginal improvement)
93
+ - If the changes have no performance implications, report "No performance concerns" and explain why
94
+ - Always consider the data scale -- an O(n^2) over 5 items is fine, over 10,000 is not
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: quality-review
3
+ description: "Code quality review checklist. Correctness, coding philosophy compliance, test coverage, documentation quality. Findings ranked by severity in plain English."
4
+ ---
5
+
6
+ # Quality Review
7
+
8
+ Review code quality for changed files. Explain all findings in plain English as if speaking to someone with no programming background.
9
+
10
+ ## Review Checklist
11
+
12
+ For each changed file, evaluate:
13
+
14
+ 1. **Correctness** -- Does the code do what the task says? Logic errors, off-by-one mistakes, missing edge cases?
15
+ 2. **Coding philosophy** -- Immutability patterns (no `let`, no mutations, functional transformations)? Correct function structure (variables, side effects, return)?
16
+ 3. **Test coverage** -- Tests present? Testing behavior, not implementation details? Edge cases covered?
17
+ 4. **Documentation** -- JSDoc on new functions explaining "why"? Preambles on new files?
18
+ 5. **Code clarity** -- Readable variable names? Unnecessary complexity? Could a new team member understand this?
19
+
20
+ ## Output Format
21
+
22
+ Rank findings by severity:
23
+
24
+ ### Critical (must fix before merge)
25
+ Broken logic or violates hard project rules.
26
+
27
+ ### Warning (should fix)
28
+ Could cause problems later or reduce maintainability.
29
+
30
+ ### Suggestion (nice to have)
31
+ Minor improvements, not blocking.
32
+
33
+ ## Finding Format
34
+
35
+ For each finding:
36
+
37
+ - **What** -- Plain English description, no jargon
38
+ - **Why** -- What could go wrong? Concrete examples
39
+ - **Where** -- File path and line number
40
+ - **Fix** -- Specific, actionable suggestion
41
+
42
+ ### Example
43
+
44
+ > **What:** The function changes the original list instead of creating a new one.
45
+ > **Why:** Other code using that list could see unexpected changes, causing hard-to-track bugs.
46
+ > **Where:** `src/utils/transform.ts:42`
47
+ > **Fix:** Use `[...items].sort()` instead of `items.sort()` to create a copy first.
48
+
49
+ ## Rules
50
+
51
+ - Run `bun run test` to confirm tests pass
52
+ - Run the task's proof command to confirm the implementation works
53
+ - Never approve code with failing tests
54
+ - If no issues found, say so clearly -- do not invent problems
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: reproduce-bug
3
+ description: "How to create reliable bug reproduction scenarios. Covers failing tests, minimal scripts, environment verification, and reproduction evidence capture."
4
+ ---
5
+
6
+ # Reproduce Bug
7
+
8
+ Before investigating root cause, reproduce the issue empirically. A bug that cannot be reproduced cannot be verified as fixed.
9
+
10
+ ## Reproduction Process
11
+
12
+ ### 1. Run the Failing Scenario
13
+
14
+ - Execute the exact command, test, or request that triggers the bug
15
+ - Capture the complete error output, stack trace, or unexpected behavior
16
+ - Record the exact command used so it can be repeated
17
+
18
+ ### 2. Capture Evidence
19
+
20
+ - Save the full error output (not just a summary)
21
+ - Note the timestamp and environment details (OS, runtime version, dependency versions)
22
+ - Screenshot or log any visual/UI issues
23
+ - Record the actual behavior vs. the expected behavior
24
+
25
+ ### 3. Investigate Environment Differences (If Cannot Reproduce)
26
+
27
+ If the issue does not reproduce locally:
28
+
29
+ - Compare environment configurations (env vars, config files, feature flags)
30
+ - Check runtime versions (Node.js, Python, Java, etc.)
31
+ - Compare dependency versions (`package-lock.json`, `poetry.lock`, etc.)
32
+ - Check data differences (database state, seed data, user roles)
33
+ - Verify network conditions (DNS, proxies, firewalls, VPN)
34
+ - Check for platform-specific behavior (OS, architecture, container vs. host)
35
+
36
+ ### 4. Create a Minimal Reproduction
37
+
38
+ Create the smallest possible reproduction that triggers the bug:
39
+
40
+ **Preferred: Failing test**
41
+ - Write a test that exercises the exact code path and asserts the expected behavior
42
+ - The test should fail with the same symptom as the reported bug
43
+ - A failing test is the most reliable reproduction because it runs in CI and prevents regression
44
+
45
+ **Fallback: Reproduction script**
46
+ - Write a standalone script that triggers the issue
47
+ - Minimize dependencies -- remove anything not needed to reproduce
48
+ - Include setup steps (data seeding, config) in the script itself
49
+ - The script should be runnable by anyone with access to the repo
50
+
51
+ **Last resort: Manual steps**
52
+ - Document exact click-by-click or command-by-command steps
53
+ - Include prerequisite state (logged-in user, specific data, feature flags)
54
+ - Note any timing-sensitive aspects (race conditions, timeouts)
55
+
56
+ ### 5. Verify Reproduction Is Reliable
57
+
58
+ - Run the reproduction multiple times to confirm it consistently fails
59
+ - For intermittent bugs, run enough iterations to establish the failure rate
60
+ - If intermittent, note any patterns (timing, load, specific data)
61
+
62
+ ## Output Format
63
+
64
+ ```text
65
+ ## Reproduction
66
+
67
+ ### Command/Steps
68
+ The exact command or steps to trigger the bug.
69
+
70
+ ### Actual Behavior
71
+ What happens (error message, wrong output, crash).
72
+
73
+ ### Expected Behavior
74
+ What should happen instead.
75
+
76
+ ### Environment
77
+ - Runtime: [version]
78
+ - OS: [platform]
79
+ - Dependencies: [relevant versions]
80
+
81
+ ### Reproduction Type
82
+ [ ] Failing test: [path to test file]
83
+ [ ] Script: [path to script]
84
+ [ ] Manual steps: [documented above]
85
+
86
+ ### Reliability
87
+ [Always / Intermittent (N/M runs) / Conditional (only when X)]
88
+ ```
89
+
90
+ ## Rules
91
+
92
+ - Never skip reproduction. If you cannot reproduce, report what you tried and what you observed.
93
+ - A failing test is always the preferred reproduction method.
94
+ - Capture complete error output -- do not truncate or summarize.
95
+ - If the bug is environment-specific, document exactly which environment triggers it.
96
+ - Do not begin root cause analysis until you have a reliable reproduction.
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: root-cause-analysis
3
+ description: "Root cause analysis methodology. Evidence gathering from logs, execution path tracing, strategic log placement, and building irrefutable proof chains."
4
+ ---
5
+
6
+ # Root Cause Analysis
7
+
8
+ Definitively prove what is causing a problem. Do not guess. Do not theorize without evidence. Trace the actual execution path, read real logs, and produce irrefutable proof of root cause.
9
+
10
+ **Core principle: "Show me the proof."** Every conclusion must be backed by concrete evidence -- a log line, a stack trace, a reproducible sequence, or a failing test.
11
+
12
+ ## Phase 1: Gather Evidence from Logs
13
+
14
+ ### Local Logs
15
+
16
+ - Search application logs in the project directory (`logs/`, `tmp/`, stdout/stderr output)
17
+ - Run tests with verbose logging enabled to capture execution flow
18
+ - Check framework-specific log locations (e.g., `.next/`, `dist/`, build output)
19
+
20
+ ### Remote Logs (AWS CloudWatch, etc.)
21
+
22
+ - Discover existing scripts and tools in the project for tailing logs:
23
+ - Check `package.json` scripts for log-related commands
24
+ - Search for shell scripts: `scripts/*log*`, `scripts/*tail*`, `scripts/*watch*`
25
+ - Look for AWS CLI wrappers, CloudWatch log group configurations
26
+ - Check for `.env` files referencing log groups or log streams
27
+ - Use discovered tools first before falling back to raw CLI commands
28
+ - When using AWS CLI directly:
29
+ ```bash
30
+ # Discover available log groups
31
+ aws logs describe-log-groups --query 'logGroups[].logGroupName' --output text
32
+
33
+ # Tail recent logs with filter
34
+ aws logs filter-log-events \
35
+ --log-group-name "/aws/lambda/function-name" \
36
+ --start-time $(date -d '30 minutes ago' +%s000) \
37
+ --filter-pattern "ERROR" \
38
+ --query 'events[].message' --output text
39
+
40
+ # Follow live logs
41
+ aws logs tail "/aws/lambda/function-name" --follow --since 10m
42
+ ```
43
+
44
+ ## Phase 2: Trace the Execution Path
45
+
46
+ - Start from the error and work backward through the call stack
47
+ - Read every function in the chain -- do not skip intermediate code
48
+ - Identify the exact line where behavior diverges from expectation
49
+ - Map the data flow: what value was expected vs. what value was actually present
50
+
51
+ ## Phase 3: Strategic Log Placement
52
+
53
+ When existing logs are insufficient, add targeted log statements to prove or disprove hypotheses.
54
+
55
+ ### Log Statement Guidelines
56
+
57
+ - **Be surgical** -- add the minimum number of log statements needed to confirm the root cause
58
+ - **Include context** -- log the actual values, not just "reached here"
59
+ - **Use structured format** -- make logs easy to find and parse
60
+
61
+ ```typescript
62
+ // Bad: Vague, unhelpful
63
+ console.log("here");
64
+ console.log("data:", data);
65
+
66
+ // Good: Precise, searchable, includes context
67
+ console.log("[DEBUG:issue-123] processOrder entry", {
68
+ orderId: order.id,
69
+ status: order.status,
70
+ itemCount: order.items.length,
71
+ timestamp: new Date().toISOString(),
72
+ });
73
+ ```
74
+
75
+ ### Placement Strategy
76
+
77
+ | Placement | Purpose |
78
+ |-----------|---------|
79
+ | Function entry | Confirm the function is called and with what arguments |
80
+ | Before conditional branches | Verify which branch is taken and why |
81
+ | Before/after async operations | Detect timing issues, race conditions, failed awaits |
82
+ | Before/after data transformations | Catch where data becomes corrupted or unexpected |
83
+ | Error handlers and catch blocks | Ensure errors are not silently swallowed |
84
+
85
+ ### Hypothesis Elimination
86
+
87
+ When multiple hypotheses exist, design a log placement strategy that eliminates all but one. Each log statement should be placed to confirm or rule out a specific hypothesis.
88
+
89
+ ## Phase 4: Prove the Root Cause
90
+
91
+ Build an evidence chain that is irrefutable:
92
+
93
+ 1. **The symptom** -- what the user observes (error message, wrong output, crash)
94
+ 2. **The proximate cause** -- the line of code that directly produces the symptom
95
+ 3. **The root cause** -- the underlying reason the proximate cause occurs
96
+ 4. **The proof** -- log output, test result, or reproduction steps that confirm each link
97
+
98
+ ### Evidence Chain Format
99
+
100
+ ```text
101
+ Symptom: [exact error message or behavior]
102
+ |
103
+ v
104
+ Proximate cause: [file:line] -- [the line that directly produces the error]
105
+ |
106
+ v
107
+ Root cause: [file:line] -- [the underlying reason]
108
+ |
109
+ v
110
+ Proof: [log output / test result / reproduction that confirms the chain]
111
+ ```
112
+
113
+ ## Phase 5: Clean Up
114
+
115
+ After root cause is confirmed, **remove all debug log statements** added during investigation. Leave only:
116
+
117
+ - Log statements that belong in the application permanently (error logging, audit trails)
118
+ - Statements explicitly requested by the user
119
+
120
+ Verify cleanup:
121
+ ```bash
122
+ # Search for any remaining debug markers
123
+ grep -rn "\[DEBUG:" src/ --include="*.ts" --include="*.tsx" --include="*.js"
124
+ ```
125
+
126
+ ## Output Format
127
+
128
+ ```text
129
+ ## Root Cause Analysis
130
+
131
+ ### Evidence Trail
132
+ | Step | Location | Evidence | Conclusion |
133
+ |------|----------|----------|------------|
134
+ | 1 | file:line | Log output or observed value | What this proves |
135
+ | 2 | file:line | Log output or observed value | What this proves |
136
+
137
+ ### Root Cause
138
+ **Proximate cause:** The line that directly produces the error.
139
+ **Root cause:** The underlying reason this line behaves incorrectly.
140
+ **Proof:** The specific evidence that confirms this beyond doubt.
141
+
142
+ ### Recommended Fix
143
+ What needs to change and why. Include file:line references.
144
+ ```
145
+
146
+ ## Rules
147
+
148
+ - Never guess at root cause -- prove it with evidence
149
+ - Read the actual code in the execution path -- do not rely on function names or comments to infer behavior
150
+ - When adding debug logs, use a consistent prefix (e.g., `[DEBUG:issue-name]`) so they are easy to find and clean up
151
+ - Remove all temporary debug log statements after investigation is complete
152
+ - If remote log access is unavailable, report what logs would be needed and from where
153
+ - Prefer project-specific tooling and scripts over raw CLI commands for log access
154
+ - If the root cause is in a third-party dependency, identify the exact version and known issue
155
+ - Always verify the fix resolves the issue -- do not mark investigation complete without proof