@codyswann/lisa 1.78.8 → 1.78.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/skills/nightly-add-test-coverage/SKILL.md +23 -10
- package/plugins/lisa/skills/nightly-improve-tests/SKILL.md +12 -14
- package/plugins/lisa/skills/nightly-lower-code-complexity/SKILL.md +12 -13
- 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/skills/nightly-add-test-coverage/SKILL.md +23 -10
- package/plugins/src/base/skills/nightly-improve-tests/SKILL.md +12 -14
- package/plugins/src/base/skills/nightly-lower-code-complexity/SKILL.md +12 -13
package/package.json
CHANGED
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"lodash": ">=4.18.1"
|
|
77
77
|
},
|
|
78
78
|
"name": "@codyswann/lisa",
|
|
79
|
-
"version": "1.78.
|
|
79
|
+
"version": "1.78.9",
|
|
80
80
|
"description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
|
|
81
81
|
"main": "dist/index.js",
|
|
82
82
|
"exports": {
|
|
@@ -15,13 +15,26 @@ The caller provides pre-computed context:
|
|
|
15
15
|
|
|
16
16
|
## Instructions
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
### Phase 1: Identify gaps
|
|
19
|
+
|
|
20
|
+
1. 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
|
|
21
|
+
2. Parse the coverage output to identify the specific files and lines with the lowest coverage. Prioritize files with the most uncovered lines/branches.
|
|
22
|
+
3. Read ONE existing test file to learn the project's testing patterns (mocks, imports, assertions). Do not read more than one.
|
|
23
|
+
|
|
24
|
+
### Phase 2: Write tests incrementally — one file at a time
|
|
25
|
+
|
|
26
|
+
For each source file with low coverage (starting with the lowest):
|
|
27
|
+
|
|
28
|
+
4. Read only the uncovered sections of the source file using the coverage report line numbers -- do not explore the codebase broadly
|
|
29
|
+
5. Write a test file targeting the uncovered branches/lines for that source file
|
|
30
|
+
6. Run the test file in isolation (e.g., `npx vitest run tests/my-new-test.test.ts`) to verify it passes before moving on
|
|
31
|
+
7. If the test fails, fix it immediately. Do not move to the next file until the current test passes.
|
|
32
|
+
8. Repeat steps 4-7 for the next source file. Stop once you estimate the proposed thresholds will be met.
|
|
33
|
+
|
|
34
|
+
### Phase 3: Verify and ship
|
|
35
|
+
|
|
36
|
+
9. Run the full coverage script to verify the new thresholds pass
|
|
37
|
+
10. Update the thresholds file with the proposed new threshold values
|
|
38
|
+
11. Re-run the coverage script to confirm the updated thresholds pass
|
|
39
|
+
12. Commit all changes (new tests + updated thresholds file) with conventional commit messages
|
|
40
|
+
13. Create a PR with `gh pr create` with a title like "test: increase test coverage: [metrics being bumped]" summarizing coverage improvements
|
|
@@ -12,20 +12,18 @@ The caller provides:
|
|
|
12
12
|
|
|
13
13
|
## Nightly Mode
|
|
14
14
|
|
|
15
|
-
1.
|
|
16
|
-
2.
|
|
17
|
-
3.
|
|
18
|
-
4.
|
|
19
|
-
5.
|
|
20
|
-
6.
|
|
21
|
-
7. Create a PR with `gh pr create` summarizing what was improved and why
|
|
15
|
+
1. For each changed source file, find its corresponding test file(s)
|
|
16
|
+
2. 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
|
|
17
|
+
3. Improve the test files with the most impactful changes
|
|
18
|
+
4. Run the full test suite to verify all tests pass
|
|
19
|
+
5. Commit changes with conventional commit messages
|
|
20
|
+
6. Create a PR with `gh pr create` summarizing what was improved and why
|
|
22
21
|
|
|
23
22
|
## General Mode
|
|
24
23
|
|
|
25
|
-
1.
|
|
26
|
-
2.
|
|
27
|
-
3.
|
|
28
|
-
4.
|
|
29
|
-
5.
|
|
30
|
-
6.
|
|
31
|
-
7. Create a PR with `gh pr create` summarizing what was improved and why
|
|
24
|
+
1. Scan the test files to find weak, brittle, or poorly-written tests
|
|
25
|
+
2. Look for: missing edge cases, weak assertions (toBeTruthy instead of specific values), missing error path coverage, tests that test implementation rather than behavior
|
|
26
|
+
3. Improve 3-5 test files with the most impactful changes
|
|
27
|
+
4. Run the full test suite to verify all tests pass
|
|
28
|
+
5. Commit changes with conventional commit messages
|
|
29
|
+
6. Create a PR with `gh pr create` summarizing what was improved and why
|
|
@@ -14,16 +14,15 @@ The caller provides pre-computed context:
|
|
|
14
14
|
|
|
15
15
|
## Instructions
|
|
16
16
|
|
|
17
|
-
1.
|
|
18
|
-
2.
|
|
19
|
-
3.
|
|
20
|
-
4.
|
|
21
|
-
5.
|
|
22
|
-
6. For
|
|
23
|
-
7.
|
|
24
|
-
8.
|
|
25
|
-
9.
|
|
26
|
-
10. Run the
|
|
27
|
-
11.
|
|
28
|
-
12.
|
|
29
|
-
13. Create a PR with `gh pr create` with a title like "refactor: reduce code complexity: [metrics being reduced]" summarizing the changes
|
|
17
|
+
1. Update eslint.thresholds.json with the proposed new threshold values (do NOT change the maxLines threshold)
|
|
18
|
+
2. 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
|
|
19
|
+
3. **Before editing**, check each violating file's total line count (`wc -l`). If a file is within 20 lines of its `max-lines` ESLint limit (typically 300), extract helpers into a **separate companion file** (e.g., `fooHelpers.ts`) instead of adding them to the same file. Extracting functions into the same file adds net lines and can create new max-lines violations.
|
|
20
|
+
4. Fix violations one file at a time. Read only the specific function that violates — do not pre-read all files upfront. Fix it, then move to the next.
|
|
21
|
+
5. For cognitive complexity violations: use early returns, extract helper functions, replace conditionals with lookup tables
|
|
22
|
+
6. For max-lines-per-function violations: split large functions, extract helper functions, separate concerns
|
|
23
|
+
7. After each file edit, run the project's formatter (e.g., `bun run format` or `npx prettier --write <file>`) to ensure line counts reflect the final formatted state before moving on
|
|
24
|
+
8. Re-run the lint script with the provided package manager to verify all violations are resolved (both the target metric AND max-lines)
|
|
25
|
+
9. Run the TypeScript compiler to catch type errors early: `npx tsc --noEmit 2>&1 | head -30`. If there are type errors, fix them now — do NOT wait until the commit step. Pre-commit hooks run type checking, and discovering errors at commit time wastes turns.
|
|
26
|
+
10. 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
|
|
27
|
+
11. Commit all changes (refactored code + updated eslint.thresholds.json) with conventional commit messages
|
|
28
|
+
12. Create a PR with `gh pr create` with a title like "refactor: reduce code complexity: [metrics being reduced]" summarizing the changes
|
|
@@ -15,13 +15,26 @@ The caller provides pre-computed context:
|
|
|
15
15
|
|
|
16
16
|
## Instructions
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
### Phase 1: Identify gaps
|
|
19
|
+
|
|
20
|
+
1. 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
|
|
21
|
+
2. Parse the coverage output to identify the specific files and lines with the lowest coverage. Prioritize files with the most uncovered lines/branches.
|
|
22
|
+
3. Read ONE existing test file to learn the project's testing patterns (mocks, imports, assertions). Do not read more than one.
|
|
23
|
+
|
|
24
|
+
### Phase 2: Write tests incrementally — one file at a time
|
|
25
|
+
|
|
26
|
+
For each source file with low coverage (starting with the lowest):
|
|
27
|
+
|
|
28
|
+
4. Read only the uncovered sections of the source file using the coverage report line numbers -- do not explore the codebase broadly
|
|
29
|
+
5. Write a test file targeting the uncovered branches/lines for that source file
|
|
30
|
+
6. Run the test file in isolation (e.g., `npx vitest run tests/my-new-test.test.ts`) to verify it passes before moving on
|
|
31
|
+
7. If the test fails, fix it immediately. Do not move to the next file until the current test passes.
|
|
32
|
+
8. Repeat steps 4-7 for the next source file. Stop once you estimate the proposed thresholds will be met.
|
|
33
|
+
|
|
34
|
+
### Phase 3: Verify and ship
|
|
35
|
+
|
|
36
|
+
9. Run the full coverage script to verify the new thresholds pass
|
|
37
|
+
10. Update the thresholds file with the proposed new threshold values
|
|
38
|
+
11. Re-run the coverage script to confirm the updated thresholds pass
|
|
39
|
+
12. Commit all changes (new tests + updated thresholds file) with conventional commit messages
|
|
40
|
+
13. Create a PR with `gh pr create` with a title like "test: increase test coverage: [metrics being bumped]" summarizing coverage improvements
|
|
@@ -12,20 +12,18 @@ The caller provides:
|
|
|
12
12
|
|
|
13
13
|
## Nightly Mode
|
|
14
14
|
|
|
15
|
-
1.
|
|
16
|
-
2.
|
|
17
|
-
3.
|
|
18
|
-
4.
|
|
19
|
-
5.
|
|
20
|
-
6.
|
|
21
|
-
7. Create a PR with `gh pr create` summarizing what was improved and why
|
|
15
|
+
1. For each changed source file, find its corresponding test file(s)
|
|
16
|
+
2. 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
|
|
17
|
+
3. Improve the test files with the most impactful changes
|
|
18
|
+
4. Run the full test suite to verify all tests pass
|
|
19
|
+
5. Commit changes with conventional commit messages
|
|
20
|
+
6. Create a PR with `gh pr create` summarizing what was improved and why
|
|
22
21
|
|
|
23
22
|
## General Mode
|
|
24
23
|
|
|
25
|
-
1.
|
|
26
|
-
2.
|
|
27
|
-
3.
|
|
28
|
-
4.
|
|
29
|
-
5.
|
|
30
|
-
6.
|
|
31
|
-
7. Create a PR with `gh pr create` summarizing what was improved and why
|
|
24
|
+
1. Scan the test files to find weak, brittle, or poorly-written tests
|
|
25
|
+
2. Look for: missing edge cases, weak assertions (toBeTruthy instead of specific values), missing error path coverage, tests that test implementation rather than behavior
|
|
26
|
+
3. Improve 3-5 test files with the most impactful changes
|
|
27
|
+
4. Run the full test suite to verify all tests pass
|
|
28
|
+
5. Commit changes with conventional commit messages
|
|
29
|
+
6. Create a PR with `gh pr create` summarizing what was improved and why
|
|
@@ -14,16 +14,15 @@ The caller provides pre-computed context:
|
|
|
14
14
|
|
|
15
15
|
## Instructions
|
|
16
16
|
|
|
17
|
-
1.
|
|
18
|
-
2.
|
|
19
|
-
3.
|
|
20
|
-
4.
|
|
21
|
-
5.
|
|
22
|
-
6. For
|
|
23
|
-
7.
|
|
24
|
-
8.
|
|
25
|
-
9.
|
|
26
|
-
10. Run the
|
|
27
|
-
11.
|
|
28
|
-
12.
|
|
29
|
-
13. Create a PR with `gh pr create` with a title like "refactor: reduce code complexity: [metrics being reduced]" summarizing the changes
|
|
17
|
+
1. Update eslint.thresholds.json with the proposed new threshold values (do NOT change the maxLines threshold)
|
|
18
|
+
2. 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
|
|
19
|
+
3. **Before editing**, check each violating file's total line count (`wc -l`). If a file is within 20 lines of its `max-lines` ESLint limit (typically 300), extract helpers into a **separate companion file** (e.g., `fooHelpers.ts`) instead of adding them to the same file. Extracting functions into the same file adds net lines and can create new max-lines violations.
|
|
20
|
+
4. Fix violations one file at a time. Read only the specific function that violates — do not pre-read all files upfront. Fix it, then move to the next.
|
|
21
|
+
5. For cognitive complexity violations: use early returns, extract helper functions, replace conditionals with lookup tables
|
|
22
|
+
6. For max-lines-per-function violations: split large functions, extract helper functions, separate concerns
|
|
23
|
+
7. After each file edit, run the project's formatter (e.g., `bun run format` or `npx prettier --write <file>`) to ensure line counts reflect the final formatted state before moving on
|
|
24
|
+
8. Re-run the lint script with the provided package manager to verify all violations are resolved (both the target metric AND max-lines)
|
|
25
|
+
9. Run the TypeScript compiler to catch type errors early: `npx tsc --noEmit 2>&1 | head -30`. If there are type errors, fix them now — do NOT wait until the commit step. Pre-commit hooks run type checking, and discovering errors at commit time wastes turns.
|
|
26
|
+
10. 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
|
|
27
|
+
11. Commit all changes (refactored code + updated eslint.thresholds.json) with conventional commit messages
|
|
28
|
+
12. Create a PR with `gh pr create` with a title like "refactor: reduce code complexity: [metrics being reduced]" summarizing the changes
|