@codyswann/lisa 1.68.0 → 1.70.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/README.md +44 -49
- package/all/copy-overwrite/.claude/rules/intent-routing.md +14 -3
- package/all/copy-overwrite/.claude/rules/security-audit-handling.md +17 -0
- package/expo/merge/.claude/settings.json +8 -1
- package/package.json +1 -1
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/agents/jira-agent.md +23 -5
- package/plugins/lisa/commands/improve.md +1 -0
- package/plugins/lisa/commands/jira/triage.md +7 -0
- package/plugins/lisa/commands/plan/improve-tests.md +7 -0
- package/plugins/lisa/skills/nightly-add-test-coverage/SKILL.md +27 -0
- package/plugins/lisa/skills/nightly-improve-tests/SKILL.md +31 -0
- package/plugins/lisa/skills/nightly-lower-code-complexity/SKILL.md +25 -0
- package/plugins/lisa/skills/plan-improve-tests/SKILL.md +47 -0
- package/plugins/lisa/skills/ticket-triage/SKILL.md +150 -0
- 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/agents/jira-agent.md +23 -5
- package/plugins/src/base/commands/improve.md +1 -0
- package/plugins/src/base/commands/jira/triage.md +7 -0
- package/plugins/src/base/commands/plan/improve-tests.md +7 -0
- package/plugins/src/base/skills/nightly-add-test-coverage/SKILL.md +27 -0
- package/plugins/src/base/skills/nightly-improve-tests/SKILL.md +31 -0
- package/plugins/src/base/skills/nightly-lower-code-complexity/SKILL.md +25 -0
- package/plugins/src/base/skills/plan-improve-tests/SKILL.md +47 -0
- package/plugins/src/base/skills/ticket-triage/SKILL.md +150 -0
- package/rails/merge/.claude/settings.json +8 -1
package/README.md
CHANGED
|
@@ -1,77 +1,72 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Lisa
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Lisa is a governance layer for AI-assisted software development. It ensures that AI agents — whether running on a developer's machine or in CI/CD — follow the same standards, workflows, and quality gates.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## What Lisa Does
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### Intent Routing
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
When a request comes in (from a human, a JIRA ticket, or a scheduled job), Lisa classifies it and routes it to the appropriate **flow**. Flows are ordered sequences of specialized agents, each with a defined role.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
brew install claude-code
|
|
13
|
-
# Or: npm install -g @anthropic-ai/claude-code
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Step 2: Set Up This Project
|
|
17
|
-
|
|
18
|
-
> Ask Claude: "I just cloned this repo. Walk me through the full setup including installing dependencies, environment variables, and any other configuration."
|
|
19
|
-
|
|
20
|
-
## Step 3: Build and Test
|
|
11
|
+
A request to fix a bug routes to a different flow than a request to build a feature or reduce code complexity. The routing is automatic based on context, but can be overridden explicitly via slash commands.
|
|
21
12
|
|
|
22
|
-
|
|
13
|
+
### Flows and Agents
|
|
23
14
|
|
|
24
|
-
|
|
15
|
+
A flow is a pipeline. Each step in the pipeline is an **agent** — a scoped AI with specific tools and skills. One agent investigates git history, another reproduces bugs, another writes code, another verifies the result.
|
|
25
16
|
|
|
26
|
-
|
|
17
|
+
Agents delegate domain-specific work to **skills** — reusable instruction sets that can be invoked by agents, by slash commands, or by CI workflows. The same skill that triages a JIRA ticket interactively is the same skill invoked by the nightly triage workflow.
|
|
27
18
|
|
|
28
|
-
|
|
19
|
+
Flows can nest. A build flow includes a verification sub-flow, which includes a ship sub-flow. This composition keeps each flow focused while enabling complex end-to-end workflows.
|
|
29
20
|
|
|
30
|
-
|
|
31
|
-
- `/plan:fix-linter-error` - Fix ESLint rule violations
|
|
32
|
-
- `/plan:local-code-review` - Review local branch changes
|
|
33
|
-
- `/plan:lower-code-complexity` - Reduce cognitive complexity
|
|
34
|
-
- `/plan:reduce-max-lines` - Reduce max file lines threshold
|
|
35
|
-
- `/plan:reduce-max-lines-per-function` - Reduce max function lines
|
|
21
|
+
### Quality Gates
|
|
36
22
|
|
|
37
|
-
|
|
23
|
+
Lisa enforces quality through layered gates:
|
|
38
24
|
|
|
39
|
-
|
|
25
|
+
- **Rules** are loaded into every AI session automatically. They define coding standards, architectural patterns, and behavioral expectations. The AI follows them because they're part of its context.
|
|
26
|
+
- **Git hooks** are hard stops. Pre-commit hooks run linting, formatting, and type checking. Pre-push hooks run tests, coverage checks, security audits, and dead code detection. Nothing ships without passing.
|
|
27
|
+
- **Claude hooks** bridge AI actions to project tooling — ensuring that when the AI commits, pushes, or creates a PR, the project's quality infrastructure runs.
|
|
40
28
|
|
|
41
|
-
|
|
29
|
+
### Location Agnostic
|
|
42
30
|
|
|
43
|
-
|
|
31
|
+
The same rules, skills, and quality gates apply everywhere:
|
|
44
32
|
|
|
45
|
-
|
|
33
|
+
- On a developer's workstation running Claude Code interactively
|
|
34
|
+
- In a GitHub Action running a nightly improvement job
|
|
35
|
+
- In a CI workflow responding to a PR review comment
|
|
46
36
|
|
|
47
|
-
|
|
37
|
+
The analytical logic lives in skills. The enforcement lives in hooks and rules. The orchestration adapts to context — using MCP integrations locally and REST APIs in CI — but the standards don't change.
|
|
48
38
|
|
|
49
|
-
|
|
39
|
+
### Template Governance
|
|
50
40
|
|
|
51
|
-
|
|
41
|
+
Lisa distributes its standards to downstream projects as templates. When a project installs Lisa, it receives:
|
|
52
42
|
|
|
53
|
-
|
|
43
|
+
- Linting, formatting, and type checking configurations
|
|
44
|
+
- Test and coverage infrastructure
|
|
45
|
+
- CI/CD workflows
|
|
46
|
+
- Git hooks
|
|
47
|
+
- AI agent definitions, skills, and rules
|
|
54
48
|
|
|
55
|
-
|
|
49
|
+
Templates follow governance rules: some files are overwritten on every update (enforced standards), some are created once and left alone (project customization), and some are merged (shared defaults with project additions).
|
|
56
50
|
|
|
57
|
-
|
|
51
|
+
## Quick Start
|
|
58
52
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
### Deploy
|
|
64
|
-
|
|
65
|
-
> Ask Claude: "Walk me through deploying this project."
|
|
53
|
+
```bash
|
|
54
|
+
brew install claude-code
|
|
55
|
+
```
|
|
66
56
|
|
|
67
|
-
|
|
57
|
+
> Ask Claude: "I just cloned this repo. Walk me through setup."
|
|
68
58
|
|
|
69
|
-
|
|
59
|
+
## Working With Lisa
|
|
70
60
|
|
|
71
|
-
|
|
61
|
+
> Ask Claude: "I have JIRA ticket [TICKET-ID]. Research, plan, and implement it."
|
|
72
62
|
|
|
73
|
-
|
|
63
|
+
Or use slash commands directly:
|
|
74
64
|
|
|
75
|
-
|
|
65
|
+
- `/fix` — route through the bug fix flow
|
|
66
|
+
- `/build` — route through the feature build flow
|
|
67
|
+
- `/improve` — route through the improvement flow
|
|
68
|
+
- `/investigate` — route through the investigation flow
|
|
69
|
+
- `/jira:triage <TICKET-ID>` — analytical triage gate: detect ambiguities, edge cases, and verification methodology
|
|
70
|
+
- `/plan:improve-tests <target>` — improve test quality by analyzing and strengthening weak or brittle tests
|
|
76
71
|
|
|
77
|
-
> Ask Claude: "
|
|
72
|
+
> Ask Claude: "What commands are available?"
|
|
@@ -94,6 +94,16 @@ Sequence:
|
|
|
94
94
|
5. **Ship sub-flow**
|
|
95
95
|
6. `learner` — capture discoveries
|
|
96
96
|
|
|
97
|
+
#### Improve: Test Quality
|
|
98
|
+
When: "Improve tests", "strengthen test suite", "fix weak tests", test quality improvement.
|
|
99
|
+
|
|
100
|
+
Sequence:
|
|
101
|
+
1. `test-specialist` — scan tests, identify weak/brittle tests, rank by improvement impact
|
|
102
|
+
2. `builder` — implement test improvements
|
|
103
|
+
3. **Verify sub-flow**
|
|
104
|
+
4. **Ship sub-flow**
|
|
105
|
+
5. `learner` — capture discoveries
|
|
106
|
+
|
|
97
107
|
### Monitor
|
|
98
108
|
When: "Check the logs", "Any errors?", health checks, production monitoring.
|
|
99
109
|
|
|
@@ -106,9 +116,10 @@ Sequence:
|
|
|
106
116
|
When the request references a JIRA ticket (ticket ID like PROJ-123 or a JIRA URL):
|
|
107
117
|
|
|
108
118
|
1. Hand off to `jira-agent`
|
|
109
|
-
2. `jira-agent` reads the ticket, validates quality,
|
|
110
|
-
3. `jira-agent`
|
|
111
|
-
4. `jira-agent`
|
|
119
|
+
2. `jira-agent` reads the ticket, validates structural quality, and runs analytical triage
|
|
120
|
+
3. If triage finds unresolved ambiguities, `jira-agent` posts findings and STOPS — no work begins
|
|
121
|
+
4. `jira-agent` determines intent and delegates to the appropriate flow above
|
|
122
|
+
5. `jira-agent` syncs progress at milestones and posts evidence at completion
|
|
112
123
|
|
|
113
124
|
## Sub-flow Usage
|
|
114
125
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Security Audit Handling
|
|
2
|
+
|
|
3
|
+
If `git push` fails because the pre-push hook reports security vulnerabilities, follow these steps. Never use `--no-verify` to bypass the security audit.
|
|
4
|
+
|
|
5
|
+
## Node.js Projects (GHSA advisories)
|
|
6
|
+
|
|
7
|
+
1. Note the GHSA ID(s), affected package(s), and advisory URL from the error output
|
|
8
|
+
2. Check the advisory URL to determine if a patched version of the vulnerable package exists
|
|
9
|
+
3. If a patched version exists: add a resolution/override in package.json to force the patched version (add to both `resolutions` and `overrides` sections), then run the package manager install command to regenerate the lockfile, commit the changes, and retry the push
|
|
10
|
+
4. If no patched version exists and the vulnerability is safe for this project (e.g., transitive dependency with no untrusted input, devDeps only, or build tool only): add an exclusion entry to `audit.ignore.local.json` with the format `{"id": "GHSA-xxx", "package": "pkg-name", "reason": "why this is safe for this project"}`, then commit and retry the push
|
|
11
|
+
|
|
12
|
+
## Rails Projects (bundler-audit)
|
|
13
|
+
|
|
14
|
+
1. Note the advisory ID, affected gem, and advisory URL from the error output
|
|
15
|
+
2. Check if a patched version of the gem exists
|
|
16
|
+
3. If a patched version exists: update the gem in Gemfile, run `bundle update <gem>`, commit the changes, and retry the push
|
|
17
|
+
4. If no patched version exists and the vulnerability is safe for this project: document the exception and retry the push
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"coderabbit@claude-plugins-official": true,
|
|
13
13
|
"sentry@claude-plugins-official": true,
|
|
14
14
|
"posthog@claude-plugins-official": true,
|
|
15
|
-
"lisa-expo@lisa": true
|
|
15
|
+
"lisa-expo@lisa": true,
|
|
16
|
+
"impeccable@impeccable": true
|
|
16
17
|
},
|
|
17
18
|
"extraKnownMarketplaces": {
|
|
18
19
|
"CodySwannGT/lisa": {
|
|
@@ -20,6 +21,12 @@
|
|
|
20
21
|
"source": "github",
|
|
21
22
|
"repo": "CodySwannGT/lisa"
|
|
22
23
|
}
|
|
24
|
+
},
|
|
25
|
+
"pbakaus/impeccable": {
|
|
26
|
+
"source": {
|
|
27
|
+
"source": "github",
|
|
28
|
+
"repo": "pbakaus/impeccable"
|
|
29
|
+
}
|
|
23
30
|
}
|
|
24
31
|
},
|
|
25
32
|
"env": {
|
package/package.json
CHANGED
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"flatted": "^3.4.2"
|
|
75
75
|
},
|
|
76
76
|
"name": "@codyswann/lisa",
|
|
77
|
-
"version": "1.
|
|
77
|
+
"version": "1.70.0",
|
|
78
78
|
"description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
|
|
79
79
|
"main": "dist/index.js",
|
|
80
80
|
"exports": {
|
|
@@ -7,6 +7,7 @@ skills:
|
|
|
7
7
|
- jira-evidence
|
|
8
8
|
- jira-verify
|
|
9
9
|
- jira-add-journey
|
|
10
|
+
- ticket-triage
|
|
10
11
|
---
|
|
11
12
|
|
|
12
13
|
# JIRA Agent
|
|
@@ -33,7 +34,24 @@ Use the `jira-verify` skill to check:
|
|
|
33
34
|
|
|
34
35
|
If validation fails, update the ticket with what's missing and escalate.
|
|
35
36
|
|
|
36
|
-
### 3.
|
|
37
|
+
### 3. Analytical Triage Gate
|
|
38
|
+
|
|
39
|
+
Determine the repo name: `basename $(git rev-parse --show-toplevel)`
|
|
40
|
+
|
|
41
|
+
Check if the ticket already has the `claude-triaged-{repo}` label. If yes, skip to Step 4.
|
|
42
|
+
|
|
43
|
+
If not triaged:
|
|
44
|
+
1. Fetch the full ticket details (summary, description, acceptance criteria, comments, labels)
|
|
45
|
+
2. Invoke the `ticket-triage` skill with the ticket details in context
|
|
46
|
+
3. Post the skill's findings (ambiguities, edge cases, verification methodology) as comments on the ticket using Atlassian MCP tools. Prefix all comments with `[{repo}]`.
|
|
47
|
+
4. Add the `claude-triaged-{repo}` label to the ticket
|
|
48
|
+
|
|
49
|
+
**Gating behavior:**
|
|
50
|
+
- If the verdict is `BLOCKED` (ambiguities found): post the ambiguities, do NOT proceed to implementation. Report to the human: "This ticket has unresolved ambiguities. Triage posted findings as comments. Please resolve the ambiguities and retry."
|
|
51
|
+
- If the verdict is `NOT_RELEVANT`: add the label and report "Ticket is not relevant to this repository."
|
|
52
|
+
- If the verdict is `PASSED` or `PASSED_WITH_FINDINGS`: proceed to Step 4.
|
|
53
|
+
|
|
54
|
+
### 4. Determine Intent
|
|
37
55
|
|
|
38
56
|
Map the ticket type to a flow:
|
|
39
57
|
|
|
@@ -47,11 +65,11 @@ Map the ticket type to a flow:
|
|
|
47
65
|
|
|
48
66
|
If the ticket type is ambiguous, read the description to classify. A "Task" that describes broken behavior is a Fix, not a Build.
|
|
49
67
|
|
|
50
|
-
###
|
|
68
|
+
### 5. Delegate to Flow
|
|
51
69
|
|
|
52
70
|
Hand off to the appropriate flow as defined in `.claude/rules/intent-routing.md`. Pass the full ticket context (description, acceptance criteria, credentials, reproduction steps) to the first agent in the flow.
|
|
53
71
|
|
|
54
|
-
###
|
|
72
|
+
### 6. Sync Progress at Milestones
|
|
55
73
|
|
|
56
74
|
Use the `jira-sync` skill to update the ticket at these milestones:
|
|
57
75
|
- **Plan created** — post plan summary, branch name
|
|
@@ -59,14 +77,14 @@ Use the `jira-sync` skill to update the ticket at these milestones:
|
|
|
59
77
|
- **PR ready** — post PR link, summary of changes
|
|
60
78
|
- **PR merged** — post final summary
|
|
61
79
|
|
|
62
|
-
###
|
|
80
|
+
### 7. Post Evidence at Completion
|
|
63
81
|
|
|
64
82
|
Use the `jira-evidence` skill to:
|
|
65
83
|
- Upload verification evidence to the GitHub PR
|
|
66
84
|
- Post evidence summary as a JIRA comment
|
|
67
85
|
- Transition the ticket to Code Review
|
|
68
86
|
|
|
69
|
-
###
|
|
87
|
+
### 8. Suggest Status Transition
|
|
70
88
|
|
|
71
89
|
Based on the milestone, suggest (but don't auto-transition):
|
|
72
90
|
|
|
@@ -11,5 +11,6 @@ For specific improvement types, you can also use:
|
|
|
11
11
|
- `/lisa:plan:lower-code-complexity` — reduce cognitive complexity
|
|
12
12
|
- `/lisa:plan:reduce-max-lines` — reduce file length
|
|
13
13
|
- `/lisa:plan:reduce-max-lines-per-function` — reduce function length
|
|
14
|
+
- `/lisa:plan:improve-tests` — improve test quality
|
|
14
15
|
|
|
15
16
|
$ARGUMENTS
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Analytical triage of a JIRA ticket -- ambiguity detection, edge case analysis, verification methodology"
|
|
3
|
+
allowed-tools: ["Skill"]
|
|
4
|
+
argument-hint: "<TICKET-ID>"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Use the /lisa:ticket-triage skill to run analytical triage on the JIRA ticket. $ARGUMENTS
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nightly-add-test-coverage
|
|
3
|
+
description: "Nightly direct-execution skill for increasing test coverage. Receives pre-computed threshold data, writes tests targeting coverage gaps, updates thresholds, commits, and creates a PR."
|
|
4
|
+
allowed-tools: ["Edit", "MultiEdit", "Write", "Read", "Glob", "Grep", "Bash"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Nightly Test Coverage Improvement
|
|
8
|
+
|
|
9
|
+
The caller provides pre-computed context:
|
|
10
|
+
- **Package manager** (`npm`, `yarn`, or `bun`)
|
|
11
|
+
- **Thresholds file** path (vitest.thresholds.json or jest.thresholds.json)
|
|
12
|
+
- **Current thresholds** (statements, branches, functions, lines percentages)
|
|
13
|
+
- **Proposed thresholds** (each metric increased by the coverage increment, capped at 90%)
|
|
14
|
+
- **Metrics being bumped** (which metrics are below target)
|
|
15
|
+
|
|
16
|
+
## Instructions
|
|
17
|
+
|
|
18
|
+
1. Read CLAUDE.md and package.json for project conventions
|
|
19
|
+
2. Run the project's coverage script with the provided package manager (e.g., `npm run test:cov`, `yarn test:cov`, or `bun run test:cov`) to get the coverage report -- identify gaps BEFORE reading any source files
|
|
20
|
+
3. Parse the coverage output to identify the specific files and lines with the lowest coverage. Prioritize files with the most uncovered lines/branches.
|
|
21
|
+
4. Read only the uncovered sections of source files using the coverage report line numbers -- do not explore the codebase broadly
|
|
22
|
+
5. Write new tests to increase coverage enough to meet the proposed thresholds. Focus on the metrics being bumped -- write tests that cover untested branches, statements, functions, and lines.
|
|
23
|
+
6. Re-run the coverage script with the provided package manager to verify the new thresholds pass
|
|
24
|
+
7. Update the thresholds file with the proposed new threshold values
|
|
25
|
+
8. Re-run the coverage script with the provided package manager to confirm the updated thresholds pass
|
|
26
|
+
9. Commit all changes (new tests + updated thresholds file) with conventional commit messages
|
|
27
|
+
10. Create a PR with `gh pr create` with a title like "test: increase test coverage: [metrics being bumped]" summarizing coverage improvements
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nightly-improve-tests
|
|
3
|
+
description: "Nightly direct-execution skill for improving test quality. In nightly mode, focuses on tests for recently changed files. In general mode, scans all tests for the weakest ones. Commits and creates a PR."
|
|
4
|
+
allowed-tools: ["Edit", "MultiEdit", "Write", "Read", "Glob", "Grep", "Bash"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Nightly Test Quality Improvement
|
|
8
|
+
|
|
9
|
+
The caller provides:
|
|
10
|
+
- **Mode**: "nightly" or "general"
|
|
11
|
+
- **Changed files** (nightly mode only): list of source files changed in the last 24 hours
|
|
12
|
+
|
|
13
|
+
## Nightly Mode
|
|
14
|
+
|
|
15
|
+
1. Read CLAUDE.md and package.json for project conventions
|
|
16
|
+
2. For each changed source file, find its corresponding test file(s)
|
|
17
|
+
3. Analyze those test files for: missing edge cases, weak assertions (toBeTruthy instead of specific values), missing error path coverage, tests that test implementation rather than behavior
|
|
18
|
+
4. Improve the test files with the most impactful changes
|
|
19
|
+
5. Run the full test suite to verify all tests pass
|
|
20
|
+
6. Commit changes with conventional commit messages
|
|
21
|
+
7. Create a PR with `gh pr create` summarizing what was improved and why
|
|
22
|
+
|
|
23
|
+
## General Mode
|
|
24
|
+
|
|
25
|
+
1. Read CLAUDE.md and package.json for project conventions
|
|
26
|
+
2. Scan the test files to find weak, brittle, or poorly-written tests
|
|
27
|
+
3. Look for: missing edge cases, weak assertions (toBeTruthy instead of specific values), missing error path coverage, tests that test implementation rather than behavior
|
|
28
|
+
4. Improve 3-5 test files with the most impactful changes
|
|
29
|
+
5. Run the full test suite to verify all tests pass
|
|
30
|
+
6. Commit changes with conventional commit messages
|
|
31
|
+
7. Create a PR with `gh pr create` summarizing what was improved and why
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nightly-lower-code-complexity
|
|
3
|
+
description: "Nightly direct-execution skill for reducing code complexity thresholds. Receives pre-computed threshold data, refactors violations, updates thresholds, commits, and creates a PR."
|
|
4
|
+
allowed-tools: ["Edit", "MultiEdit", "Write", "Read", "Glob", "Grep", "Bash"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Nightly Code Complexity Reduction
|
|
8
|
+
|
|
9
|
+
The caller provides pre-computed context:
|
|
10
|
+
- **Package manager** (`npm`, `yarn`, or `bun`)
|
|
11
|
+
- **Current thresholds** (cognitiveComplexity, maxLinesPerFunction from eslint.thresholds.json)
|
|
12
|
+
- **Proposed thresholds** (each metric decreased toward target minimums)
|
|
13
|
+
- **Metrics being reduced** (which metrics are above target)
|
|
14
|
+
|
|
15
|
+
## Instructions
|
|
16
|
+
|
|
17
|
+
1. Read CLAUDE.md and package.json for project conventions
|
|
18
|
+
2. Update eslint.thresholds.json with the proposed new threshold values (do NOT change the maxLines threshold)
|
|
19
|
+
3. Run the project's lint script with the provided package manager (e.g., `npm run lint`, `yarn lint`, or `bun run lint`) to find functions that violate the new stricter thresholds
|
|
20
|
+
4. For cognitive complexity violations: use early returns, extract helper functions, replace conditionals with lookup tables
|
|
21
|
+
5. For max-lines-per-function violations: split large functions, extract helper functions, separate concerns
|
|
22
|
+
6. Re-run the lint script with the provided package manager to verify all violations are resolved
|
|
23
|
+
7. Run the project's test script with the provided package manager (e.g., `npm run test`, `yarn test`, or `bun run test`) to verify no tests are broken by the refactoring
|
|
24
|
+
8. Commit all changes (refactored code + updated eslint.thresholds.json) with conventional commit messages
|
|
25
|
+
9. Create a PR with `gh pr create` with a title like "refactor: reduce code complexity: [metrics being reduced]" summarizing the changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plan-improve-tests
|
|
3
|
+
description: This skill should be used when improving test quality. It scans the test suite for weak, brittle, or poorly-written tests, generates a brief with improvement opportunities, and creates a plan with tasks to strengthen the tests.
|
|
4
|
+
allowed-tools: ["Read", "Bash", "Glob", "Grep"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Improve Test Quality
|
|
8
|
+
|
|
9
|
+
Target: $ARGUMENTS
|
|
10
|
+
|
|
11
|
+
If no argument provided, scan the full test suite.
|
|
12
|
+
|
|
13
|
+
## Step 1: Gather Requirements
|
|
14
|
+
|
|
15
|
+
1. **Run test suite** to establish baseline:
|
|
16
|
+
```bash
|
|
17
|
+
bun run test 2>&1 | tail -20
|
|
18
|
+
```
|
|
19
|
+
2. **Scan test files** for quality issues:
|
|
20
|
+
- Weak assertions (`toBeTruthy`, `toBeDefined` instead of specific values)
|
|
21
|
+
- Missing edge cases (no boundary values, no error paths)
|
|
22
|
+
- Implementation coupling (testing internals rather than behavior)
|
|
23
|
+
- Missing error path coverage
|
|
24
|
+
- Duplicated setup that could indicate missing abstractions
|
|
25
|
+
3. **Identify 10-20 test files** with highest improvement potential, noting:
|
|
26
|
+
- File path
|
|
27
|
+
- Issues found (weak assertions, missing edge cases, etc.)
|
|
28
|
+
- Estimated impact of improvement
|
|
29
|
+
|
|
30
|
+
## Step 2: Compile Brief and Delegate
|
|
31
|
+
|
|
32
|
+
Compile the gathered information into a structured brief:
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
Improve test quality across the test suite.
|
|
36
|
+
|
|
37
|
+
Test files needing improvement (ordered by impact):
|
|
38
|
+
1. [test file] - [issues found]
|
|
39
|
+
- Weak assertions: [count]
|
|
40
|
+
- Missing edge cases: [description]
|
|
41
|
+
- Implementation coupling: [description]
|
|
42
|
+
2. ...
|
|
43
|
+
|
|
44
|
+
Verification: `bun run test` -> Expected: All tests pass, improved assertions and coverage
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Invoke `/plan-execute` with this brief to create the implementation plan.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ticket-triage
|
|
3
|
+
description: "Analytical triage gate for JIRA tickets. Detects requirement ambiguities, identifies edge cases from codebase analysis, and plans verification methodology. Posts findings to the ticket and produces a verdict (BLOCKED/PASSED_WITH_FINDINGS/PASSED) that gates whether implementation can proceed."
|
|
4
|
+
allowed-tools: ["Read", "Glob", "Grep", "Bash"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Ticket Triage: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
Perform analytical triage on the JIRA ticket. The caller has fetched the ticket details (summary, description, acceptance criteria, labels, status, comments) and provided them in context.
|
|
10
|
+
|
|
11
|
+
Repository name for scoped labels and comment headers: determine via `basename $(git rev-parse --show-toplevel)`.
|
|
12
|
+
|
|
13
|
+
## Phase 1 -- Relevance Check
|
|
14
|
+
|
|
15
|
+
Search the local codebase using Glob and Grep for code related to the ticket's subject matter:
|
|
16
|
+
- Keywords from summary and description
|
|
17
|
+
- Component names, API endpoints, database tables
|
|
18
|
+
- Error messages or log strings mentioned in the ticket
|
|
19
|
+
|
|
20
|
+
If NO relevant code is found in this repo:
|
|
21
|
+
- Output: `## Verdict: NOT_RELEVANT`
|
|
22
|
+
- Instruct caller to add the label `claude-triaged-{repo}` and skip this ticket
|
|
23
|
+
|
|
24
|
+
If relevant code IS found, proceed to Phase 2.
|
|
25
|
+
|
|
26
|
+
## Phase 2 -- Cross-Repo Awareness
|
|
27
|
+
|
|
28
|
+
Parse the ticket's existing comments for triage headers from OTHER repositories. Look for patterns like:
|
|
29
|
+
- `*[some-repo-name] Ambiguity detected*`
|
|
30
|
+
- `*[some-repo-name] Edge cases*`
|
|
31
|
+
- `*[some-repo-name] Verification methodology*`
|
|
32
|
+
|
|
33
|
+
Note which phases other repos have already covered and what findings they posted. In subsequent phases:
|
|
34
|
+
- Do NOT duplicate findings already posted by another repo
|
|
35
|
+
- DO add supplementary findings specific to THIS repo's codebase
|
|
36
|
+
|
|
37
|
+
## Phase 3 -- Ambiguity Detection
|
|
38
|
+
|
|
39
|
+
Examine the ticket summary, description, and acceptance criteria. Look for:
|
|
40
|
+
|
|
41
|
+
| Signal | Example |
|
|
42
|
+
|--------|---------|
|
|
43
|
+
| Vague language | "should work properly", "handle edge cases", "improve performance" |
|
|
44
|
+
| Untestable criteria | No measurable outcome defined |
|
|
45
|
+
| Undefined terms | Acronyms or domain terms not explained in context |
|
|
46
|
+
| Missing scope boundaries | What's included vs excluded is unclear |
|
|
47
|
+
| Implicit assumptions | Assumptions not stated explicitly |
|
|
48
|
+
|
|
49
|
+
Skip ambiguities already raised by another repo's triage comments.
|
|
50
|
+
|
|
51
|
+
For each NEW ambiguity found, produce:
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
### Ambiguity: [short title]
|
|
55
|
+
**Description:** [what is ambiguous]
|
|
56
|
+
**Suggested clarification:** [specific question to resolve it]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Be specific -- every ambiguity must have a concrete clarifying question.
|
|
60
|
+
|
|
61
|
+
## Phase 4 -- Edge Case Analysis
|
|
62
|
+
|
|
63
|
+
Search the codebase using Glob and Grep for files related to the ticket's subject matter. Check git history for recent changes in those areas:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
git log --oneline -20 -- <relevant-paths>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Identify:
|
|
70
|
+
- Boundary conditions (empty inputs, max values, concurrent access)
|
|
71
|
+
- Error handling gaps in related code
|
|
72
|
+
- Integration risks with other components
|
|
73
|
+
- Data migration or backward compatibility concerns
|
|
74
|
+
|
|
75
|
+
Reference only files in THIS repo. Acknowledge edge cases from other repos if relevant, but do not duplicate them.
|
|
76
|
+
|
|
77
|
+
For each edge case, produce:
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
### Edge Case: [title]
|
|
81
|
+
**Description:** [what could go wrong]
|
|
82
|
+
**Code reference:** [file path and relevant lines or patterns]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Every edge case must reference specific code files or patterns found in the codebase. If no relevant code exists, note that this appears to be a new feature with no existing code to analyze.
|
|
86
|
+
|
|
87
|
+
## Phase 5 -- Verification Methodology
|
|
88
|
+
|
|
89
|
+
For each acceptance criterion, specify a concrete verification method scoped to what THIS repo can test:
|
|
90
|
+
|
|
91
|
+
| Verification Type | When to Use | What to Specify |
|
|
92
|
+
|-------------------|-------------|-----------------|
|
|
93
|
+
| UI | Change affects user-visible interface | Playwright test description with specific assertions |
|
|
94
|
+
| API | Change affects HTTP/GraphQL/RPC endpoints | curl command with expected response status and body |
|
|
95
|
+
| Data | Change involves schema, migrations, queries | Database query or service call to verify state |
|
|
96
|
+
| Performance | Change claims performance improvement | Benchmark description with target metrics |
|
|
97
|
+
|
|
98
|
+
Do not duplicate verification methods already posted by other repos.
|
|
99
|
+
|
|
100
|
+
Produce a table:
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
| Acceptance Criterion | Verification Method | Type |
|
|
104
|
+
|---------------------|--------------------| -----|
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Every verification method must be specific enough that an automated agent could execute it.
|
|
108
|
+
|
|
109
|
+
## Phase 6 -- Verdict
|
|
110
|
+
|
|
111
|
+
Evaluate the findings and produce exactly one verdict:
|
|
112
|
+
|
|
113
|
+
- **`NOT_RELEVANT`** -- No relevant code was found in this repository (Phase 1). The caller should add the triage label and skip implementation in this repo.
|
|
114
|
+
- **`BLOCKED`** -- Ambiguities were found in Phase 3. Work MUST NOT proceed until the ambiguities are resolved by a human. The caller should post findings, add the triage label, and STOP.
|
|
115
|
+
- **`PASSED_WITH_FINDINGS`** -- No ambiguities, but edge cases or verification findings were identified. Work can proceed. The caller should post findings and add the triage label.
|
|
116
|
+
- **`PASSED`** -- No ambiguities, edge cases, or verification gaps found. Work can proceed. The caller should add the triage label.
|
|
117
|
+
|
|
118
|
+
Output format:
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
## Verdict: [NOT_RELEVANT | BLOCKED | PASSED_WITH_FINDINGS | PASSED]
|
|
122
|
+
|
|
123
|
+
**Ambiguities found:** [count]
|
|
124
|
+
**Edge cases identified:** [count]
|
|
125
|
+
**Verification methods defined:** [count]
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Output Structure
|
|
129
|
+
|
|
130
|
+
Structure all output with clear section headers so the caller can parse and post findings:
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
## Triage: [TICKET-KEY] ([repo-name])
|
|
134
|
+
|
|
135
|
+
### Ambiguities
|
|
136
|
+
[Phase 3 findings, or "None found."]
|
|
137
|
+
|
|
138
|
+
### Edge Cases
|
|
139
|
+
[Phase 4 findings, or "None found."]
|
|
140
|
+
|
|
141
|
+
### Verification Methodology
|
|
142
|
+
[Phase 5 table, or "No acceptance criteria to verify."]
|
|
143
|
+
|
|
144
|
+
## Verdict: [NOT_RELEVANT | BLOCKED | PASSED_WITH_FINDINGS | PASSED]
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The caller is responsible for:
|
|
148
|
+
1. Posting the findings as comments on the ticket (using whatever Jira mechanism is available)
|
|
149
|
+
2. Adding the `claude-triaged-{repo}` label to the ticket
|
|
150
|
+
3. If `BLOCKED`: stopping all work and reporting the ambiguities to the human
|
|
@@ -7,6 +7,7 @@ skills:
|
|
|
7
7
|
- jira-evidence
|
|
8
8
|
- jira-verify
|
|
9
9
|
- jira-add-journey
|
|
10
|
+
- ticket-triage
|
|
10
11
|
---
|
|
11
12
|
|
|
12
13
|
# JIRA Agent
|
|
@@ -33,7 +34,24 @@ Use the `jira-verify` skill to check:
|
|
|
33
34
|
|
|
34
35
|
If validation fails, update the ticket with what's missing and escalate.
|
|
35
36
|
|
|
36
|
-
### 3.
|
|
37
|
+
### 3. Analytical Triage Gate
|
|
38
|
+
|
|
39
|
+
Determine the repo name: `basename $(git rev-parse --show-toplevel)`
|
|
40
|
+
|
|
41
|
+
Check if the ticket already has the `claude-triaged-{repo}` label. If yes, skip to Step 4.
|
|
42
|
+
|
|
43
|
+
If not triaged:
|
|
44
|
+
1. Fetch the full ticket details (summary, description, acceptance criteria, comments, labels)
|
|
45
|
+
2. Invoke the `ticket-triage` skill with the ticket details in context
|
|
46
|
+
3. Post the skill's findings (ambiguities, edge cases, verification methodology) as comments on the ticket using Atlassian MCP tools. Prefix all comments with `[{repo}]`.
|
|
47
|
+
4. Add the `claude-triaged-{repo}` label to the ticket
|
|
48
|
+
|
|
49
|
+
**Gating behavior:**
|
|
50
|
+
- If the verdict is `BLOCKED` (ambiguities found): post the ambiguities, do NOT proceed to implementation. Report to the human: "This ticket has unresolved ambiguities. Triage posted findings as comments. Please resolve the ambiguities and retry."
|
|
51
|
+
- If the verdict is `NOT_RELEVANT`: add the label and report "Ticket is not relevant to this repository."
|
|
52
|
+
- If the verdict is `PASSED` or `PASSED_WITH_FINDINGS`: proceed to Step 4.
|
|
53
|
+
|
|
54
|
+
### 4. Determine Intent
|
|
37
55
|
|
|
38
56
|
Map the ticket type to a flow:
|
|
39
57
|
|
|
@@ -47,11 +65,11 @@ Map the ticket type to a flow:
|
|
|
47
65
|
|
|
48
66
|
If the ticket type is ambiguous, read the description to classify. A "Task" that describes broken behavior is a Fix, not a Build.
|
|
49
67
|
|
|
50
|
-
###
|
|
68
|
+
### 5. Delegate to Flow
|
|
51
69
|
|
|
52
70
|
Hand off to the appropriate flow as defined in `.claude/rules/intent-routing.md`. Pass the full ticket context (description, acceptance criteria, credentials, reproduction steps) to the first agent in the flow.
|
|
53
71
|
|
|
54
|
-
###
|
|
72
|
+
### 6. Sync Progress at Milestones
|
|
55
73
|
|
|
56
74
|
Use the `jira-sync` skill to update the ticket at these milestones:
|
|
57
75
|
- **Plan created** — post plan summary, branch name
|
|
@@ -59,14 +77,14 @@ Use the `jira-sync` skill to update the ticket at these milestones:
|
|
|
59
77
|
- **PR ready** — post PR link, summary of changes
|
|
60
78
|
- **PR merged** — post final summary
|
|
61
79
|
|
|
62
|
-
###
|
|
80
|
+
### 7. Post Evidence at Completion
|
|
63
81
|
|
|
64
82
|
Use the `jira-evidence` skill to:
|
|
65
83
|
- Upload verification evidence to the GitHub PR
|
|
66
84
|
- Post evidence summary as a JIRA comment
|
|
67
85
|
- Transition the ticket to Code Review
|
|
68
86
|
|
|
69
|
-
###
|
|
87
|
+
### 8. Suggest Status Transition
|
|
70
88
|
|
|
71
89
|
Based on the milestone, suggest (but don't auto-transition):
|
|
72
90
|
|
|
@@ -11,5 +11,6 @@ For specific improvement types, you can also use:
|
|
|
11
11
|
- `/lisa:plan:lower-code-complexity` — reduce cognitive complexity
|
|
12
12
|
- `/lisa:plan:reduce-max-lines` — reduce file length
|
|
13
13
|
- `/lisa:plan:reduce-max-lines-per-function` — reduce function length
|
|
14
|
+
- `/lisa:plan:improve-tests` — improve test quality
|
|
14
15
|
|
|
15
16
|
$ARGUMENTS
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Analytical triage of a JIRA ticket -- ambiguity detection, edge case analysis, verification methodology"
|
|
3
|
+
allowed-tools: ["Skill"]
|
|
4
|
+
argument-hint: "<TICKET-ID>"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Use the /lisa:ticket-triage skill to run analytical triage on the JIRA ticket. $ARGUMENTS
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nightly-add-test-coverage
|
|
3
|
+
description: "Nightly direct-execution skill for increasing test coverage. Receives pre-computed threshold data, writes tests targeting coverage gaps, updates thresholds, commits, and creates a PR."
|
|
4
|
+
allowed-tools: ["Edit", "MultiEdit", "Write", "Read", "Glob", "Grep", "Bash"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Nightly Test Coverage Improvement
|
|
8
|
+
|
|
9
|
+
The caller provides pre-computed context:
|
|
10
|
+
- **Package manager** (`npm`, `yarn`, or `bun`)
|
|
11
|
+
- **Thresholds file** path (vitest.thresholds.json or jest.thresholds.json)
|
|
12
|
+
- **Current thresholds** (statements, branches, functions, lines percentages)
|
|
13
|
+
- **Proposed thresholds** (each metric increased by the coverage increment, capped at 90%)
|
|
14
|
+
- **Metrics being bumped** (which metrics are below target)
|
|
15
|
+
|
|
16
|
+
## Instructions
|
|
17
|
+
|
|
18
|
+
1. Read CLAUDE.md and package.json for project conventions
|
|
19
|
+
2. Run the project's coverage script with the provided package manager (e.g., `npm run test:cov`, `yarn test:cov`, or `bun run test:cov`) to get the coverage report -- identify gaps BEFORE reading any source files
|
|
20
|
+
3. Parse the coverage output to identify the specific files and lines with the lowest coverage. Prioritize files with the most uncovered lines/branches.
|
|
21
|
+
4. Read only the uncovered sections of source files using the coverage report line numbers -- do not explore the codebase broadly
|
|
22
|
+
5. Write new tests to increase coverage enough to meet the proposed thresholds. Focus on the metrics being bumped -- write tests that cover untested branches, statements, functions, and lines.
|
|
23
|
+
6. Re-run the coverage script with the provided package manager to verify the new thresholds pass
|
|
24
|
+
7. Update the thresholds file with the proposed new threshold values
|
|
25
|
+
8. Re-run the coverage script with the provided package manager to confirm the updated thresholds pass
|
|
26
|
+
9. Commit all changes (new tests + updated thresholds file) with conventional commit messages
|
|
27
|
+
10. Create a PR with `gh pr create` with a title like "test: increase test coverage: [metrics being bumped]" summarizing coverage improvements
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nightly-improve-tests
|
|
3
|
+
description: "Nightly direct-execution skill for improving test quality. In nightly mode, focuses on tests for recently changed files. In general mode, scans all tests for the weakest ones. Commits and creates a PR."
|
|
4
|
+
allowed-tools: ["Edit", "MultiEdit", "Write", "Read", "Glob", "Grep", "Bash"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Nightly Test Quality Improvement
|
|
8
|
+
|
|
9
|
+
The caller provides:
|
|
10
|
+
- **Mode**: "nightly" or "general"
|
|
11
|
+
- **Changed files** (nightly mode only): list of source files changed in the last 24 hours
|
|
12
|
+
|
|
13
|
+
## Nightly Mode
|
|
14
|
+
|
|
15
|
+
1. Read CLAUDE.md and package.json for project conventions
|
|
16
|
+
2. For each changed source file, find its corresponding test file(s)
|
|
17
|
+
3. Analyze those test files for: missing edge cases, weak assertions (toBeTruthy instead of specific values), missing error path coverage, tests that test implementation rather than behavior
|
|
18
|
+
4. Improve the test files with the most impactful changes
|
|
19
|
+
5. Run the full test suite to verify all tests pass
|
|
20
|
+
6. Commit changes with conventional commit messages
|
|
21
|
+
7. Create a PR with `gh pr create` summarizing what was improved and why
|
|
22
|
+
|
|
23
|
+
## General Mode
|
|
24
|
+
|
|
25
|
+
1. Read CLAUDE.md and package.json for project conventions
|
|
26
|
+
2. Scan the test files to find weak, brittle, or poorly-written tests
|
|
27
|
+
3. Look for: missing edge cases, weak assertions (toBeTruthy instead of specific values), missing error path coverage, tests that test implementation rather than behavior
|
|
28
|
+
4. Improve 3-5 test files with the most impactful changes
|
|
29
|
+
5. Run the full test suite to verify all tests pass
|
|
30
|
+
6. Commit changes with conventional commit messages
|
|
31
|
+
7. Create a PR with `gh pr create` summarizing what was improved and why
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nightly-lower-code-complexity
|
|
3
|
+
description: "Nightly direct-execution skill for reducing code complexity thresholds. Receives pre-computed threshold data, refactors violations, updates thresholds, commits, and creates a PR."
|
|
4
|
+
allowed-tools: ["Edit", "MultiEdit", "Write", "Read", "Glob", "Grep", "Bash"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Nightly Code Complexity Reduction
|
|
8
|
+
|
|
9
|
+
The caller provides pre-computed context:
|
|
10
|
+
- **Package manager** (`npm`, `yarn`, or `bun`)
|
|
11
|
+
- **Current thresholds** (cognitiveComplexity, maxLinesPerFunction from eslint.thresholds.json)
|
|
12
|
+
- **Proposed thresholds** (each metric decreased toward target minimums)
|
|
13
|
+
- **Metrics being reduced** (which metrics are above target)
|
|
14
|
+
|
|
15
|
+
## Instructions
|
|
16
|
+
|
|
17
|
+
1. Read CLAUDE.md and package.json for project conventions
|
|
18
|
+
2. Update eslint.thresholds.json with the proposed new threshold values (do NOT change the maxLines threshold)
|
|
19
|
+
3. Run the project's lint script with the provided package manager (e.g., `npm run lint`, `yarn lint`, or `bun run lint`) to find functions that violate the new stricter thresholds
|
|
20
|
+
4. For cognitive complexity violations: use early returns, extract helper functions, replace conditionals with lookup tables
|
|
21
|
+
5. For max-lines-per-function violations: split large functions, extract helper functions, separate concerns
|
|
22
|
+
6. Re-run the lint script with the provided package manager to verify all violations are resolved
|
|
23
|
+
7. Run the project's test script with the provided package manager (e.g., `npm run test`, `yarn test`, or `bun run test`) to verify no tests are broken by the refactoring
|
|
24
|
+
8. Commit all changes (refactored code + updated eslint.thresholds.json) with conventional commit messages
|
|
25
|
+
9. Create a PR with `gh pr create` with a title like "refactor: reduce code complexity: [metrics being reduced]" summarizing the changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plan-improve-tests
|
|
3
|
+
description: This skill should be used when improving test quality. It scans the test suite for weak, brittle, or poorly-written tests, generates a brief with improvement opportunities, and creates a plan with tasks to strengthen the tests.
|
|
4
|
+
allowed-tools: ["Read", "Bash", "Glob", "Grep"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Improve Test Quality
|
|
8
|
+
|
|
9
|
+
Target: $ARGUMENTS
|
|
10
|
+
|
|
11
|
+
If no argument provided, scan the full test suite.
|
|
12
|
+
|
|
13
|
+
## Step 1: Gather Requirements
|
|
14
|
+
|
|
15
|
+
1. **Run test suite** to establish baseline:
|
|
16
|
+
```bash
|
|
17
|
+
bun run test 2>&1 | tail -20
|
|
18
|
+
```
|
|
19
|
+
2. **Scan test files** for quality issues:
|
|
20
|
+
- Weak assertions (`toBeTruthy`, `toBeDefined` instead of specific values)
|
|
21
|
+
- Missing edge cases (no boundary values, no error paths)
|
|
22
|
+
- Implementation coupling (testing internals rather than behavior)
|
|
23
|
+
- Missing error path coverage
|
|
24
|
+
- Duplicated setup that could indicate missing abstractions
|
|
25
|
+
3. **Identify 10-20 test files** with highest improvement potential, noting:
|
|
26
|
+
- File path
|
|
27
|
+
- Issues found (weak assertions, missing edge cases, etc.)
|
|
28
|
+
- Estimated impact of improvement
|
|
29
|
+
|
|
30
|
+
## Step 2: Compile Brief and Delegate
|
|
31
|
+
|
|
32
|
+
Compile the gathered information into a structured brief:
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
Improve test quality across the test suite.
|
|
36
|
+
|
|
37
|
+
Test files needing improvement (ordered by impact):
|
|
38
|
+
1. [test file] - [issues found]
|
|
39
|
+
- Weak assertions: [count]
|
|
40
|
+
- Missing edge cases: [description]
|
|
41
|
+
- Implementation coupling: [description]
|
|
42
|
+
2. ...
|
|
43
|
+
|
|
44
|
+
Verification: `bun run test` -> Expected: All tests pass, improved assertions and coverage
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Invoke `/plan-execute` with this brief to create the implementation plan.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ticket-triage
|
|
3
|
+
description: "Analytical triage gate for JIRA tickets. Detects requirement ambiguities, identifies edge cases from codebase analysis, and plans verification methodology. Posts findings to the ticket and produces a verdict (BLOCKED/PASSED_WITH_FINDINGS/PASSED) that gates whether implementation can proceed."
|
|
4
|
+
allowed-tools: ["Read", "Glob", "Grep", "Bash"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Ticket Triage: $ARGUMENTS
|
|
8
|
+
|
|
9
|
+
Perform analytical triage on the JIRA ticket. The caller has fetched the ticket details (summary, description, acceptance criteria, labels, status, comments) and provided them in context.
|
|
10
|
+
|
|
11
|
+
Repository name for scoped labels and comment headers: determine via `basename $(git rev-parse --show-toplevel)`.
|
|
12
|
+
|
|
13
|
+
## Phase 1 -- Relevance Check
|
|
14
|
+
|
|
15
|
+
Search the local codebase using Glob and Grep for code related to the ticket's subject matter:
|
|
16
|
+
- Keywords from summary and description
|
|
17
|
+
- Component names, API endpoints, database tables
|
|
18
|
+
- Error messages or log strings mentioned in the ticket
|
|
19
|
+
|
|
20
|
+
If NO relevant code is found in this repo:
|
|
21
|
+
- Output: `## Verdict: NOT_RELEVANT`
|
|
22
|
+
- Instruct caller to add the label `claude-triaged-{repo}` and skip this ticket
|
|
23
|
+
|
|
24
|
+
If relevant code IS found, proceed to Phase 2.
|
|
25
|
+
|
|
26
|
+
## Phase 2 -- Cross-Repo Awareness
|
|
27
|
+
|
|
28
|
+
Parse the ticket's existing comments for triage headers from OTHER repositories. Look for patterns like:
|
|
29
|
+
- `*[some-repo-name] Ambiguity detected*`
|
|
30
|
+
- `*[some-repo-name] Edge cases*`
|
|
31
|
+
- `*[some-repo-name] Verification methodology*`
|
|
32
|
+
|
|
33
|
+
Note which phases other repos have already covered and what findings they posted. In subsequent phases:
|
|
34
|
+
- Do NOT duplicate findings already posted by another repo
|
|
35
|
+
- DO add supplementary findings specific to THIS repo's codebase
|
|
36
|
+
|
|
37
|
+
## Phase 3 -- Ambiguity Detection
|
|
38
|
+
|
|
39
|
+
Examine the ticket summary, description, and acceptance criteria. Look for:
|
|
40
|
+
|
|
41
|
+
| Signal | Example |
|
|
42
|
+
|--------|---------|
|
|
43
|
+
| Vague language | "should work properly", "handle edge cases", "improve performance" |
|
|
44
|
+
| Untestable criteria | No measurable outcome defined |
|
|
45
|
+
| Undefined terms | Acronyms or domain terms not explained in context |
|
|
46
|
+
| Missing scope boundaries | What's included vs excluded is unclear |
|
|
47
|
+
| Implicit assumptions | Assumptions not stated explicitly |
|
|
48
|
+
|
|
49
|
+
Skip ambiguities already raised by another repo's triage comments.
|
|
50
|
+
|
|
51
|
+
For each NEW ambiguity found, produce:
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
### Ambiguity: [short title]
|
|
55
|
+
**Description:** [what is ambiguous]
|
|
56
|
+
**Suggested clarification:** [specific question to resolve it]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Be specific -- every ambiguity must have a concrete clarifying question.
|
|
60
|
+
|
|
61
|
+
## Phase 4 -- Edge Case Analysis
|
|
62
|
+
|
|
63
|
+
Search the codebase using Glob and Grep for files related to the ticket's subject matter. Check git history for recent changes in those areas:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
git log --oneline -20 -- <relevant-paths>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Identify:
|
|
70
|
+
- Boundary conditions (empty inputs, max values, concurrent access)
|
|
71
|
+
- Error handling gaps in related code
|
|
72
|
+
- Integration risks with other components
|
|
73
|
+
- Data migration or backward compatibility concerns
|
|
74
|
+
|
|
75
|
+
Reference only files in THIS repo. Acknowledge edge cases from other repos if relevant, but do not duplicate them.
|
|
76
|
+
|
|
77
|
+
For each edge case, produce:
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
### Edge Case: [title]
|
|
81
|
+
**Description:** [what could go wrong]
|
|
82
|
+
**Code reference:** [file path and relevant lines or patterns]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Every edge case must reference specific code files or patterns found in the codebase. If no relevant code exists, note that this appears to be a new feature with no existing code to analyze.
|
|
86
|
+
|
|
87
|
+
## Phase 5 -- Verification Methodology
|
|
88
|
+
|
|
89
|
+
For each acceptance criterion, specify a concrete verification method scoped to what THIS repo can test:
|
|
90
|
+
|
|
91
|
+
| Verification Type | When to Use | What to Specify |
|
|
92
|
+
|-------------------|-------------|-----------------|
|
|
93
|
+
| UI | Change affects user-visible interface | Playwright test description with specific assertions |
|
|
94
|
+
| API | Change affects HTTP/GraphQL/RPC endpoints | curl command with expected response status and body |
|
|
95
|
+
| Data | Change involves schema, migrations, queries | Database query or service call to verify state |
|
|
96
|
+
| Performance | Change claims performance improvement | Benchmark description with target metrics |
|
|
97
|
+
|
|
98
|
+
Do not duplicate verification methods already posted by other repos.
|
|
99
|
+
|
|
100
|
+
Produce a table:
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
| Acceptance Criterion | Verification Method | Type |
|
|
104
|
+
|---------------------|--------------------| -----|
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Every verification method must be specific enough that an automated agent could execute it.
|
|
108
|
+
|
|
109
|
+
## Phase 6 -- Verdict
|
|
110
|
+
|
|
111
|
+
Evaluate the findings and produce exactly one verdict:
|
|
112
|
+
|
|
113
|
+
- **`NOT_RELEVANT`** -- No relevant code was found in this repository (Phase 1). The caller should add the triage label and skip implementation in this repo.
|
|
114
|
+
- **`BLOCKED`** -- Ambiguities were found in Phase 3. Work MUST NOT proceed until the ambiguities are resolved by a human. The caller should post findings, add the triage label, and STOP.
|
|
115
|
+
- **`PASSED_WITH_FINDINGS`** -- No ambiguities, but edge cases or verification findings were identified. Work can proceed. The caller should post findings and add the triage label.
|
|
116
|
+
- **`PASSED`** -- No ambiguities, edge cases, or verification gaps found. Work can proceed. The caller should add the triage label.
|
|
117
|
+
|
|
118
|
+
Output format:
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
## Verdict: [NOT_RELEVANT | BLOCKED | PASSED_WITH_FINDINGS | PASSED]
|
|
122
|
+
|
|
123
|
+
**Ambiguities found:** [count]
|
|
124
|
+
**Edge cases identified:** [count]
|
|
125
|
+
**Verification methods defined:** [count]
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Output Structure
|
|
129
|
+
|
|
130
|
+
Structure all output with clear section headers so the caller can parse and post findings:
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
## Triage: [TICKET-KEY] ([repo-name])
|
|
134
|
+
|
|
135
|
+
### Ambiguities
|
|
136
|
+
[Phase 3 findings, or "None found."]
|
|
137
|
+
|
|
138
|
+
### Edge Cases
|
|
139
|
+
[Phase 4 findings, or "None found."]
|
|
140
|
+
|
|
141
|
+
### Verification Methodology
|
|
142
|
+
[Phase 5 table, or "No acceptance criteria to verify."]
|
|
143
|
+
|
|
144
|
+
## Verdict: [NOT_RELEVANT | BLOCKED | PASSED_WITH_FINDINGS | PASSED]
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
The caller is responsible for:
|
|
148
|
+
1. Posting the findings as comments on the ticket (using whatever Jira mechanism is available)
|
|
149
|
+
2. Adding the `claude-triaged-{repo}` label to the ticket
|
|
150
|
+
3. If `BLOCKED`: stopping all work and reporting the ambiguities to the human
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"code-review@claude-plugins-official": true,
|
|
11
11
|
"coderabbit@claude-plugins-official": true,
|
|
12
12
|
"sentry@claude-plugins-official": true,
|
|
13
|
-
"lisa-rails@lisa": true
|
|
13
|
+
"lisa-rails@lisa": true,
|
|
14
|
+
"impeccable@impeccable": true
|
|
14
15
|
},
|
|
15
16
|
"extraKnownMarketplaces": {
|
|
16
17
|
"CodySwannGT/lisa": {
|
|
@@ -18,6 +19,12 @@
|
|
|
18
19
|
"source": "github",
|
|
19
20
|
"repo": "CodySwannGT/lisa"
|
|
20
21
|
}
|
|
22
|
+
},
|
|
23
|
+
"pbakaus/impeccable": {
|
|
24
|
+
"source": {
|
|
25
|
+
"source": "github",
|
|
26
|
+
"repo": "pbakaus/impeccable"
|
|
27
|
+
}
|
|
21
28
|
}
|
|
22
29
|
},
|
|
23
30
|
"env": {
|