Skip to content

Add test-gap-audit and docs-sync-audit skills - #2951

Merged
aaronpowell merged 3 commits into
github:mainfrom
specialone0007:add-test-gap-and-docs-sync-audit-skills
Sep 7, 2026
Merged

Add test-gap-audit and docs-sync-audit skills#2951
aaronpowell merged 3 commits into
github:mainfrom
specialone0007:add-test-gap-and-docs-sync-audit-skills

Conversation

@specialone0007

Copy link
Copy Markdown
Contributor

Two repo-agnostic review skills that answer questions the existing testing and documentation skills here don't.

What they do

test-gap-audit asks which behaviour is not covered, rather than how to write a test in a given framework. Given no scope it audits the whole repository: inventories the testable surfaces, then reports which routes, services, jobs and contracts have no tests, too few assertions, or only indirect coverage. Name a feature, PR or branch and it narrows to that.

It bundles coverage_map.py, which detects the test framework and naming convention, then matches every source file to tests three ways — by name, by mirrored path, and by what the test files actually import — and ranks the unmatched by risk keyword and size. The import scan is what makes "no tests found for X" worth reporting rather than merely plausible.

docs-sync-audit compares what the docs claim against what the code does. It bundles docs_drift.py, which checks documented npm run scripts and make targets against the ones that exist, relative Markdown links against the filesystem, and environment variable names in both directions.

It also reports a case a name-only comparison misses: a documented setting that is read by the code, but only inside a module nothing imports — configuration that reads as working and cannot take effect.

How they relate to what's already here

The existing testing and docs skills are framework-specific, which is where most of their value is. These are the repo-agnostic complement rather than an overlap:

  • pytest-coverage raises coverage to 100% inside a pytest project. test-gap-audit decides where coverage is missing across a repository, in any language, and does not run tests.
  • documentation-writer and create-readme write documentation. docs-sync-audit checks whether existing documentation still matches the code.

Neither restates something a frontier model already does well unprompted. The uplift is the discipline: a fixed report contract, and deterministic tooling for the parts a model does expensively and unreliably by hand — matching hundreds of source files to tests, or re-deriving which documented commands actually exist.

Conventions followed

  • Both are read-only: they report, and do not edit unless you explicitly ask for fixes.
  • Both emit the same contract — every finding carries a P0P3 severity and a path:line you can open.
  • Both scripts are Python standard library only and install nothing. They're accelerators, not requirements: each skill keeps its manual fallback commands and still works when the script can't run.
  • Bundled assets are 36 KB and 40 KB, well under the 5 MB guidance.
  • npm run skill:validate passes (418/418), and npm start has been run — the only generated change is the two new rows in docs/README.skills.md.

One note on the build: npm start also rewrites a Dynatrace MCP URL in docs/README.agents.md, which comes from re-fetching external plugin data and is unrelated to this change. I reverted that file so this PR stays scoped to the skills.

Two repo-agnostic review skills that answer questions the existing testing and
documentation skills do not.

test-gap-audit asks which behaviour is not covered, rather than how to write a
test in a given framework. Given no scope it audits the whole repository,
inventories the testable surfaces, and reports which routes, services, jobs and
contracts have no tests, too few assertions, or only indirect coverage. It
bundles coverage_map.py, which detects the test framework and naming convention,
then matches every source file to tests by name, by mirrored path, and by what
the test files actually import, and ranks the unmatched by risk keyword and size.

docs-sync-audit compares what the docs claim against what the code does. It
bundles docs_drift.py, which checks documented npm scripts and make targets
against the ones that exist, relative Markdown links against the filesystem, and
environment variable names in both directions. It also reports a documented
setting that is read only inside a module nothing imports, which is configuration
that reads as working but cannot take effect.

Both are read-only: they report and do not edit unless asked. Both emit the same
contract, so a finding always carries a P0-P3 severity and a path:line you can
open. Both scripts are Python standard library only, install nothing, and are
accelerators rather than requirements, so each skill still works when the script
cannot run.

The existing testing and docs skills here are framework-specific, which is where
most of the value is. These are the repo-agnostic complement: pytest-coverage
raises coverage inside a pytest project, and this decides where coverage is
missing across a repository regardless of language.
@github-actions github-actions Bot added new-submission PR adds at least one new contribution skills PR touches skills labels Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🔒 PR Risk Scan Results

Scanned 5 changed file(s).

Severity Count
🔴 High 0
🟠 Medium 0
ℹ️ Info 2
Severity Rule File Line Match
ℹ️ skill-script-touched skills/docs-sync-audit/scripts/docs_drift.py 1 skills/docs-sync-audit/scripts/docs_drift.py
ℹ️ skill-script-touched skills/test-gap-audit/scripts/coverage_map.py 1 skills/test-gap-audit/scripts/coverage_map.py

This is an automated soft-gate report. Findings indicate review targets and do not block merge by themselves.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🔍 Vally Lint Results

✅ All checks passed

Scope Checked
Skills 2
Agents 0
Total 2
Severity Count
❌ Errors 0
⚠️ Warnings 0
ℹ️ Advisories 0

Summary

Level Finding
ℹ️ ✅ docs-sync-audit (2/2 checks passed)
ℹ️ ✓ [spec-compliance] All 1 skill(s) are spec-compliant.
ℹ️ ✓ spec-compliance: All spec checks passed.
ℹ️ ✓ [valid-refs] All file references across 1 skill(s) are valid.
ℹ️ ✓ valid-refs: All file references resolve to existing files within the skill directory.
ℹ️ 1 skill(s) linted, 1 passed
ℹ️ ✅ test-gap-audit (2/2 checks passed)
ℹ️ ✓ [spec-compliance] All 1 skill(s) are spec-compliant.
ℹ️ ✓ spec-compliance: All spec checks passed.
ℹ️ ✓ [valid-refs] All file references across 1 skill(s) are valid.
Full linter output
### Linting skills/docs-sync-audit
✅ docs-sync-audit (2/2 checks passed)
    ✓ [spec-compliance] All 1 skill(s) are spec-compliant.
        ✓ spec-compliance: All spec checks passed.
    ✓ [valid-refs] All file references across 1 skill(s) are valid.
        ✓ valid-refs: All file references resolve to existing files within the skill directory.

1 skill(s) linted, 1 passed

### Linting skills/test-gap-audit
✅ test-gap-audit (2/2 checks passed)
    ✓ [spec-compliance] All 1 skill(s) are spec-compliant.
        ✓ spec-compliance: All spec checks passed.
    ✓ [valid-refs] All file references across 1 skill(s) are valid.
        ✓ valid-refs: All file references resolve to existing files within the skill directory.

1 skill(s) linted, 1 passed

specialone0007 and others added 2 commits September 5, 2026 13:32
Two CI failures on the first push.

codespell flagged `testng` and `shouldBe` in coverage_map.py. Both are
legitimate identifiers rather than typos: TestNG is the Java test framework the
script detects by name, and shouldBe is the Kotlin and Scala assertion method
matched by its assertion-detection regex. Added both to ignore-words-list with a
comment each, following the convention already used for the other entries.

validate-readme failed because I had reverted docs/README.agents.md. `npm start`
rewrites a Dynatrace MCP URL there from re-fetched external plugin data, which is
unrelated to these skills, so I had excluded it to keep the diff scoped. That was
wrong: the check regenerates every generated file and compares, so the commit has
to carry whatever the build produces. Restored.
@aaronpowell
aaronpowell enabled auto-merge (squash) September 7, 2026 02:51
@aaronpowell
aaronpowell merged commit 5f7e3d0 into github:main Sep 7, 2026
15 of 16 checks passed
aaronpowell pushed a commit that referenced this pull request Sep 7, 2026
…as evidence (#2976)

Ports four corrections these two skills received upstream after a second trial
run against a real repository. #2951 merged the snapshot taken before them. The
bundled scripts are already identical to their upstream versions and are not
touched here.

1. Neither skill told the agent that text read out of the audited repository is
   data rather than instruction. These skills exist to read untrusted
   repositories, so a README, a code comment, a commit message or a dependency
   manifest reached the model with no framing -- and a line claiming a file is
   approved, or telling the audit to skip a module, reads exactly like a
   guardrail. Both skills now carry the rule and report such text as a finding
   instead of following it.

2. The citation rule allowed anchors to land beside the symbol rather than on
   it: the blank line above a definition, a decorator, or a line inside a
   multi-line literal. In one trialled file every anchor sat two lines above the
   def it named. The rule is now a single applicable test -- the line you cite
   must literally contain the thing you name, and a cited range must contain it
   on the first line. Quoted text is cited at the line the quoted characters are
   on, because a comment has its own line number and it is usually not the line
   of the code beside it.

3. "Never restate a count without the raw output in front of you" was ignored
   twice in that trial, so the rule flips from prohibition to requirement: any
   number stated must appear under Checks Run next to the command that produced
   it. Unwilling to show the command means describing the pattern rather than
   counting it.

4. Both Related Skills sections said the skill is one of seven and that the
   other five cover the remaining ground. Six, not five. Each section now names
   its sibling in this repository and links the remaining five out.

Front matter is unchanged, so the generated README tables do not move.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-submission PR adds at least one new contribution skills PR touches skills

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants