agentleFS
repopromptrepoprompt/repoprompt-ce/.agents/skills/rpce-test-quality/SKILL.md

rpce-test-quality

Skill943 starsChanged 2 months agoApache-2.0View on GitHub

Select, design, review, consolidate, or remove RepoPrompt CE tests, diagnostic harnesses, and smoke checks by regression value and maintenance cost. Use when the task centers on test, diagnostic, or smoke coverage, including whether a single regression test is worth committing. Do not use for feature or bug-fix work merely because it may need coverage, or for routine test or validation execution.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Search existing direct and outcome-level coverage.

    line 13
  2. Distinctive:

    Add, consolidate, redesign, classify as diagnostics, or omit.

    line 16
  3. Distinctive:

    Do not use smoke as the only protection for deterministic logic.

    line 29
  4. Distinctive:

    Commit only when the test protects a current contract with plausible impact, fails for a meaningful defect, asserts an observable result, …

    line 33
  5. Very specific:

    Use exact XCTest filters shaped as RepoPromptTests.<Suite>/testMethod or RepoPromptClaudeCompatibleProviderTests.<Suite>/testMethod.

    line 41

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “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

RepoPrompt CE Test Quality

Protect meaningful current contracts, not changed lines or method counts. Maximize regression signal per maintenance cost. Follow AGENTS.md and the repository harness in docs/testing.md.

Decide Before Writing

  1. Name the current behavior and plausible defect: user failure, data loss, protocol/security break, race, persistence error, malformed input, or costly operational failure.
  2. Search existing direct and outcome-level coverage.
  3. Define an observable oracle that distinguishes broken from fixed behavior.
  4. Choose the lowest layer that faithfully reproduces the risk.
  5. Add, consolidate, redesign, classify as diagnostics, or omit.

For a bug, prefer a test that fails against known-bad behavior. If no stable contract, credible defect, or discriminating oracle can be named, do not add a test.

Choose the Layer

  • Isolated core: deterministic decisions, transformations, parsers, state machines, policy, invariants, and failure semantics.
  • Provider package: provider protocol, codec, translation, launch arguments, and model mapping under Packages/RepoPromptAgentProviders/Tests.
  • Root SwiftPM: module behavior without a GUI, including actors, persistence, fixtures, subprocess adapters, in-process MCP, and deterministic concurrency under Tests/RepoPromptTests.
  • Runtime diagnostics: assembled-app-only rendering, restoration, routing instrumentation, churn, or resource investigations. Require a bounded scenario, privacy-safe machine-readable evidence, entry point, and cleanup path. Without an acceptance threshold, a benchmark is diagnostics.
  • Live/packaged smoke: real app/MCP wiring, bundle layout, embedded helpers, ownership, signing, provenance, and a few critical journeys.
  • Structural guard: last resort when executable behavior, compiler boundaries, lint, or guardrails cannot cheaply enforce a narrow constraint.

Do not use smoke as the only protection for deterministic logic.

Quality Gate

Commit only when the test protects a current contract with plausible impact, fails for a meaningful defect, asserts an observable result, adds distinct coverage at the lowest faithful layer, and is deterministic and maintainable relative to risk.

Redesign or omit invocation-only, no-crash, non-nil-only, source-shape, symbol-presence, constant-restatement, report-only, arbitrary-sleep, coverage-driven, and omnibus tests unless that fact is the explicit contract and no stronger oracle exists.

Author and Validate

Assert exact outcomes and negative boundaries. Keep one coherent contract per test; use labeled tables only for equivalent cases. Control time, randomness, locale, environment, resources, ordering, and concurrency; use gates, clocks, or continuations instead of sleeps. Use temporary resources and verify important cleanup or ownership. Add production seams only when narrow, deterministic, behavior-preserving, and justified.

Use exact XCTest filters shaped as RepoPromptTests.<Suite>/testMethod or RepoPromptClaudeCompatibleProviderTests.<Suite>/testMethod. For ordinary changes, run the smallest focused daemon test first:

make dev-test FILTER=RepoPromptTests.<Suite>/testMethod
make dev-provider-test FILTER=RepoPromptClaudeCompatibleProviderTests.<Suite>/testMethod

Broaden to the affected target or full suite when the change crosses shared infrastructure, package boundaries, generated surfaces, or test harness behavior. Follow repository style and guardrails as applicable. Do not launch the app for ordinary logic.

For optimization or performance work, define the workload, acceptance threshold, comparable environment, sample validity rules, and retained evidence before measuring. Keep diagnostic and wake-probe runs separate from performance samples. Do not create a replacement test registry, executable census, or repository-wide scoreboard merely to track method counts.

Required Handoff

Report:

  • protected contract, plausible defect, layer, and oracle;
  • exact added, renamed, consolidated, or removed test IDs and mappings;
  • focused and broader validation commands/results appropriate to the changed boundary;
  • measurement protocol and sample validity when performance evidence is applicable;
  • coverage omitted, removed, moved to diagnostics, or replaced by a guardrail, with justification.

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.