一键导入
audit-tests
Audit corpus and highlight tests for tests that pass for the wrong reason — designed to pass rather than designed to catch regressions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Audit corpus and highlight tests for tests that pass for the wrong reason — designed to pass rather than designed to catch regressions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Fix multiple GitHub issues on an integration branch. Issues touching different areas (grammar, scanner, queries, bindings, tests) run in parallel worktrees; issues sharing an area or affecting cross-binding code run sequentially. Each goes through fix, simplify, review, and remediation before merging. Use when asked to fix several issues at once.
Complete workflow for fixing GitHub issues — investigation, implementation, review, testing, documentation.
Read a GitHub issue, develop a resolution plan via sequential thinking, rate difficulty/complexity/priority, label low-priority when warranted.
Fetch open GitHub issues and produce a read-only triage report with quick wins and recommended groupings.
Review project activity (issues, commits, changelog) and draft entries for docs/lessons_learned.md.
Audit grammar / query / binding changes for correctness, performance, and quality. Use when asked to review changes, diffs, or pull requests.
| name | audit-tests |
| description | Audit corpus and highlight tests for tests that pass for the wrong reason — designed to pass rather than designed to catch regressions. |
Audit test code for tests that pass for the wrong reason. Goal: find tests that look like coverage but would not catch a real regression.
Determine what to audit based on $ARGUMENTS:
| Argument | Scope |
|---|---|
| (empty) | Tests in unstaged + staged changes (git diff HEAD) |
staged | Tests in staged changes only |
branch | Tests in all branch commits vs main |
| file path | Specific test file (test/corpus/*.txt, test/highlight/*.groovy) |
| directory path | All test files under the directory |
test/corpus/ and
highlight tests under test/highlight/.For every test in scope, answer three questions:
; ^^^^ @capture markers.If 1 and 3 disagree, that is a finding.
FINDING: <short title>
FILE: <path>:<line range>
EVIDENCE: <what is wrong and why>
SEVERITY: false-pass | weak-assertion | wrong-target | incidental
EFFORT: trivial | small | medium
test/corpus/)(source_file)
have no children, or only opaque parents? A test that asserts "parses
to some source_file" catches almost nothing.Elvis chain whose input is a ?: b
(single Elvis, not a chain) is false-pass.elvis_expression
defines field('value', ...) and field('default', ...). If the
expected tree omits the field labels, a regression that drops the
field wiring still passes.(binary_expression) when the new rule
(elvis_expression) was supposed to handle it? That is a wrong-target
test masquerading as coverage of the new rule. This is the exact
anti-pattern SPECIFICATION.md §3.2 promises to avoid.if_statement rule
should be tested with if, if/else, if/else if/else, nested if,
and if followed by a closure — not just one canonical example.?: / ? : / .. /
<< / ==> must include the tie-break cases enumerated in
SPECIFICATION.md §8.1 (operators-precedence-tiebreaks.txt).
Without those, a precedence regression silently changes the tree
shape for valid inputs.test/highlight/); ^^^^^ @keyword aligned to
fewer characters than the keyword spans is a silent partial check.MyClass::new as @function, the highlight tests must include a
non-qualified call (new MyClass()) to confirm the regex did not
over-match. Same applies to the Groovy 4 contextual keywords
(async, await, etc.) which are identifiers outside their keyword
positions.(source_file) with no children is a smoke
test, not a regression test.For every finding, run:
npx tree-sitter test --include "<test-name regex>"
Confirm the test currently passes. For false-pass findings, the
strongest verification is mutation: temporarily perturb grammar.js
(e.g. delete the elvis_expression rule, or replace it with a generic
binary_expression), regenerate (npx tree-sitter generate), and re-run
the test. If the test still passes, the false-pass is confirmed.
Revert the grammar change after.
This step is mandatory. Do not report findings based solely on reading.
## Test Audit: <scope>
### False-pass
| # | Finding | File:Line | Effort | Evidence |
### Weak assertions
| # | Finding | File:Line | Effort | Evidence |
### Wrong target
| # | Finding | File:Line | Effort | Evidence |
### Summary
- Tests audited: N
- Findings: N
- Verdict: PASS | FINDINGS TO FIX
For each finding, fix the test directly:
After fixing, re-run npx tree-sitter test to verify everything still
passes.
npx tree-sitter test after fixes to confirm nothing else broke.