agentleFS
majiayu000majiayu000/test-loop/.claude/skills/drill/SKILL.md

drill

Skill0 starsChanged 37 days agoMITView on GitHub

Verify the closed test loop actually reacts by injecting one intentionally failing test, running each of the five loop tools, and recording the result. Use after init-loop and after any change to a loop tool.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 3 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After editing any of the five loop tools.

    line 22
  2. Distinctive:

    After a refactor that touches CI, the pre-commit hook, or the report-render script.

    line 23
  3. Distinctive:

    Do not use this skill to verify a real failure.

    line 26
  4. Very specific:

    Run the report renderer: Verify the JSON summary has the failures_by_class field populated and the Markdown report has a Failures by class …

    line 53
  5. Very specific:

    Run swift test. Expect red.

    line 85
  6. Very specific:

    Run bash scripts/render_report.sh.

    line 86
  7. Very specific:

    Run bash scripts/check_drift.sh.

    line 88
  8. Very specific:

    Create Sources/<Target>/DrillUndocumentedFixture.swift, stage it, run the hook.

    line 91

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

drill

Prove the loop is wired correctly by breaking it on purpose.

When to use

  • Right after init-loop.
  • After editing any of the five loop tools.
  • After a refactor that touches CI, the pre-commit hook, or the report-render script.

Do not use this skill to verify a real failure. The drill is for verifying the loop, not for triaging a regression.

Inputs

NameRequiredDefaultDescription
target_pathyesnoneThe project to drill.
languageyesnoneOne of swift, python, go, rust. Picks the injection template.
expected_failuresno1The number of distinct failing tests to inject. One is the minimum needed to exercise the failure-classify step. Two or more tests whether the classifier deduplicates duplicate failure lines.
drill_labelnoclosed-loop-drillA short label used in test names so the drill fixture can be located later if cleanup is interrupted.

Output

PathContents
docs/knowledge/drill-YYYY-MM-DD.mdEvidence document: the commands that ran, the output captured, the verdict per step, and any defects found.
docs/reports/<date>/Rendered test report from the injected failure (this is the "real" run the loop produces).
working treeBriefly contains the drill fixture file. Cleaned up on success.

Algorithm (eight steps)

  1. Inject a test fixture file containing the expected number of failing tests. Use the language-specific template. Place the file in the project's test directory under a name ending in DrillTests.
  2. Run the test runner. The expected outcome is the test suite fails with the same number of failures as injected.
  3. Run the report renderer. Verify the JSON summary has the failures_by_class field populated and the Markdown report has a Failures by class section.
  4. Run the drift check. It should report drift: clean ✅ — the drill fixture is in the test directory, not the source directory, and so should not introduce drift. If it does, that is a finding for the drill report.
  5. Run the pre-commit hook in dry-run mode. The fixture is intentional and should be staged to test the hook. The hook is expected to allow the test file (it only inspects the source directory), and a subsequent drill injects an undocumented source file to verify the hook blocks.
  6. Run the pre-commit hook with a staged undocumented public symbol. The hook should exit non-zero and print a message pointing at the knowledge base.
  7. Clean up the injected fixtures and verify the working tree is empty.
  8. Write the drill evidence document.

Worked example (Swift)

In a Swift project with the loop already installed:

  1. Create Tests/<Target>Tests/ClosedLoopDrillTests.swift:

    @Test func drillAssertsWrongValue() {
        #expect(SessionDuration.thirtyMinutes.endDate(from: Date(timeIntervalSince1970: 0))
               == Date(timeIntervalSince1970: 100))
    }
  2. Run swift test. Expect red.
  3. Run bash scripts/render_report.sh. Expect the report to list the failing test under ASSERTION_FAILURE.
  4. Run bash scripts/check_drift.sh. Expect drift: clean.
  5. Stage the test file, run .githooks/pre-commit. Expect exit 0 (test files are not in scope).
  6. Create Sources/<Target>/DrillUndocumentedFixture.swift, stage it, run the hook. Expect exit 1.
  7. rm the two fixtures, git reset, swift test — back to green.
  8. Write docs/knowledge/drill-2026-06-02.md.

Anti-patterns

  • Leaving the fixture in the working tree. The drill is supposed to be invisible. A leftover fixture corrupts the next commit.
  • Drilling the loop but never reading the report. The drill produces an evidence document for a reason. If the report does not contain the expected sections, the loop is broken; the user must read the report to find that out.
  • Drilling the same day, twice. Two drills on the same day overwrite each other's evidence document. Wait until tomorrow, or pass a custom drill_label to disambiguate.

Cross-references

  • init-loop — runs this skill automatically on first install.
  • drift-check — exercised by step 4 of the drill.
  • failure-classify — exercised by step 3.
  • report-render — exercised by step 3.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.