agentleFS
maidepsmaideps/ai-harness-framework/skills/testing/SKILL.md

testing

Skill2 starsChanged 11 days agoMITView on GitHub

Testing the product inside the harness — which tests go in which layer, acceptance tests from each feature's declared behavior, keeping the gate fast, and judging test quality.

194 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use bundle-dependency-prs, update-library-template and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    bundle-dependency-prs

    Fix broken dependency update PRs and aggregate the ones that work into one PR.

    Also in 7 projects that use this

  • MicrosoftSkill

    update-library-template

    Merges the latest Library.Template into this repo (at position of HEAD) and resolves conflicts.

    Also in 7 projects that use this

  • zetaloopSkill

    assign-copilot

    Assigns a GitHub issue to the Copilot coding agent, optionally specifying a custom agent. Use this when asked to assign an issue to Copilot or delegate an issue to CCA.

    Also in 3 projects that use this

  • NVIDIA-NeMoSkill

    build-and-dependency

    Dev environment setup for Megatron Bridge — container-based development, uv package management, lockfile regeneration, adding dependencies, Slurm container usage, and common build pitfalls.

    Also in 3 projects that use this

  • timmo001Skill

    changeset-scope

    Keep all scoped code work contained to the user-defined changeset. Use for implementation, fixes, diagnosis, refactoring, cleanup, and review when explicit instructions, named files, diffs, branches, pull requests, or injected work scopes define the boundary.

    Also in 3 projects that use this

  • JetBrainsSkill

    module-dependencies

    Add or modify IntelliJ module dependencies in `.iml` files.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 175 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never weaken a test to get green: If an existing test contradicts the declared behavior, the test is wrong: fix it in the same commit and …

    line 39

“Common” is measured: kept by at least 6 in 10 of the 175 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

Testing

The harness runs your tests and makes their results count — SKIP is never PASS, and evidence names the commit that passed — but it ships no tests for your product. This skill is how to write and place them so a feature's gate proves its declared behavior.

When to Use

  • Setting up testing in a project that just adopted the harness
  • Starting a feature: before writing its code, write the test that proves its behavior
  • Fixing a bug
  • npm run check is getting slow, or a test fails only sometimes
  • Deciding whether the tests are good enough, not just green

Workflow

  1. Put each kind of test in its layer. Chain your tools after the harness's own command in package.json — never replace it, or that layer silently loses the harness's checks:

    LayerWhat goes thereExample
    lint, typecheckLinter and type checker"lint": "node scripts/framework-check.mjs lint && eslint ."
    testFast unit and integration tests: the whole suite, deterministic, no real network"test": "node scripts/framework-check.mjs test && vitest run"
    build, e2eThe build; real end-to-end tests (browser, API contract, CLI output)"e2e": "playwright test"

    Other stacks: ruff check + mypy and pytest (Python), go vet and go test ./... (Go), cargo clippy and cargo test (Rust). Until e2e runs real tests it reports SKIP, and SKIP is not verified: wire it before any feature that crosses components.

  2. Write the feature's behavior so it can be checked. "cartTotal() applies a 10% discount above $100", not "improve the cart". The declared behavior in feature_list.json is the spec.
  3. Write the acceptance test first and see it fail, then declare it as the feature's own layer so the gate checks exactly that behavior:
    npm run add-feature -- feat-012 "Cart discount" --behavior "..." --layer "Cart tests=vitest run src/cart"
    Then implement until it passes, with unit tests for the pieces.
  4. Fix bugs the same way: reproduce with a failing test, fix, keep the test as a regression guard.
  5. Never weaken a test to get green. If an existing test contradicts the declared behavior, the test is wrong: fix it in the same commit and say so. If the behavior itself looks wrong, stop and ask.
  6. Keep the gate fast. Keep npm run check under about two minutes — longer than an agent's default command timeout and the agent gets a timeout instead of a verdict. Move slow suites to e2e or a scheduled CI job. Treat a flaky test as a bug: pin times and seeds, fake the network.
  7. Judge the tests, not just the result. A weak test passes the gate as well as a strong one:
    • Coverage: enable your stack's coverage preset in .harness/quality.json as a floor, not a goal.
    • Mutation score (Stryker, mutmut, cargo-mutants) for critical modules, as another quality gate: it measures whether the tests catch bugs.
    • In review, check that each test checks the declared behavior, not just what the code currently does.
    • For the features that matter most, a person writes or approves the acceptance test; the agent writes the unit tests.
  8. In CI, the generated workflow runs npm run check and npm run check-arch. Add the services e2e needs (a database, a browser); keep slow suites in a scheduled job.

Quick Reference

  • Product tools chained after the harness command in lint, typecheck, test, e2e — not replacing it
  • e2e runs real end-to-end tests (or the gap is known: SKIP is not verified)
  • Feature behavior written as a checkable statement
  • Acceptance test written first, declared as the feature's own layer
  • Bugs reproduced by a failing test before the fix
  • No test weakened to pass; a test contradicting the behavior is fixed and called out
  • npm run check under about two minutes; no flaky tests
  • Coverage floor on; mutation score for critical modules

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.