agentleFS
flurdyflurdy/agent-skills/skills/contract-test/SKILL.md

contract-test

Skill9 starsChanged 3 months agoMITView on GitHub

Execute existing Pact-lite consumer generation, local sync, normalization and provider verification in an explicit scope. Status delegates to contract-check; setup and repairs are separate.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 13 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run existing project-owned contract commands.

    line 14
  2. Distinctive:

    No build or mutation command is preapproved by this skill's tool declaration.

    line 19
  3. Very specific:

    Only full sequences generation → sync → optional normalization → verification.

    line 36
  4. Distinctive:

    Read the owning repository instructions and actual project topology.

    line 48
  5. Distinctive:

    Do not broaden a named-consumer run to a whole-project sync or normalization target silently.

    line 64
  6. Distinctive:

    Use an inspected scope-aware command, or stop and ask for explicit expansion to the named additional repositories/paths.

    line 65
  7. Distinctive:

    Run the inspected consumer command in each selected consumer's directory, sequentially unless the project proves independent resources.

    line 74
  8. Distinctive:

    Check the command's actual test selection/results and expected contract outputs.

    line 77
  9. Distinctive:

    Stop on failure, missing expected output, or uncertain selection.

    line 79
  10. Distinctive:

    Do not edit consumer tests to make the run pass.

    line 80
  11. Distinctive:

    Run only the preflighted local sync command for the authorized pairs.

    line 90
  12. Distinctive:

    If the inspected project provides normalization, run it only within the authorized destinations.

    line 96
  13. Distinctive:

    Stop on normalization failure.

    line 99
  14. Very specific:

    After all required generation, copying and normalization succeeds, run the inspected verification command for every affected provider (full …

    line 103
  15. Distinctive:

    Stop on a provider failure, name completed/not-run pairs, and hand diagnosis/repairs to a separately requested coding workflow.

    line 107

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

Contract Test — Pact-Lite Runner

Run existing project-owned contract commands. Pact-lite exchanges JSON contracts through local files, without a broker. This skill owns execution, not health auditing, adoption, scaffolding, application/test repair, Git commits or publication. Project-facing integration belongs to the separately authorized setup contract.

No build or mutation command is preapproved by this skill's tool declaration. Explicit run intent selects phases; harness permissions, repository ownership and confirmation rules still apply.

Usage and phase boundaries

/contract-test                    # current service's existing contract target; ask if ambiguous
/contract-test consumer           # generate for current consumer only
/contract-test sync               # copy current consumer's existing output only
/contract-test provider           # verify current provider's existing input only
/contract-test full               # current consumer → affected providers
/contract-test full all           # all declared consumers → all declared providers
/contract-test full <svc> ...     # named consumers → their affected providers
/contract-test status             # compatibility alias, read-only

consumer stops after generation; sync stops after copying; provider stops after verification. Only full sequences generation → sync → optional normalization → verification. Standalone sync neither regenerates nor normalizes files and never implies compatibility. Reject other arguments.

Status compatibility alias

Delegate /contract-test status wholly to /contract-check status, including its rendering and unknown/error semantics. Use Skill(contract-check) or read ~/.agents/skills/contract-check/SKILL.md and follow it. If the authority is missing or unavailable, stop with unavailable status; do not reconstruct health evidence or run tests as a fallback.

Preflight each run

  1. Read the owning repository instructions and actual project topology. Resolve the service and requested roles from existing documentation, test suites and recipes. A service may have both roles; do not guess which target runs consumer versus provider tests.
  2. Discover and inspect existing Makefile targets, package scripts or documented native commands, including delegated scripts and hooks. Target names and language detection alone are not proof of command behavior. In particular, pact-publish may contact a broker: only verified local copy commands belong to this runner. Network publication, deploys, dependency installation and setup require a separate handoff, not an expanded run.
  3. Identify exact input/output paths, expected pairs, normalization behavior and affected provider repositories. Reuse project relationship evidence and the audit's matrix when needed; do not recreate a staleness, CI-coverage or health collector here.
  4. Show the execution plan: repository paths, ordered commands, phases, write destinations and affected consumer/provider pairs. Proceed only within explicit task ownership. Confirm any unresolved expansion or overwrite decision before executing it. A request for one consumer does not authorize unrelated services or repairs.

Do not broaden a named-consumer run to a whole-project sync or normalization target silently. Use an inspected scope-aware command, or stop and ask for explicit expansion to the named additional repositories/paths. The same rule applies to a single-service full run. If the project cannot isolate consumer generation from provider verification, do not pretend it meets full-run ordering; request a separate integration change or a supported, explicitly scoped workflow.

Execute the selected phases

Generate

Run the inspected consumer command in each selected consumer's directory, sequentially unless the project proves independent resources. ALL selected consumers must succeed before sync.

Check the command's actual test selection/results and expected contract outputs. A recent mtime, existing file, or green command that skipped the intended tests is not proof of fresh generation. Stop on failure, missing expected output, or uncertain selection; do not sync partial/stale results. Do not edit consumer tests to make the run pass. Consumer-only execution ends here.

Sync

Immediately before sync, reuse /contract-check uncommitted for destination-pact preservation; never duplicate its Git health checks. Also inspect the exact destination diffs to understand potential overwrites. Unknown audit evidence or unreviewed local changes means stop, not overwrite. The user must explicitly select how to preserve changes and confirm the exact overwrite scope; a run request is not permission to discard unrelated work.

Run only the preflighted local sync command for the authorized pairs. Compare expected source and destination contents before treating copy as complete. Do not invent wildcard copies or delete old pacts. Standalone sync ends after the copy report.

Normalize (full only, when supported)

If the inspected project provides normalization, run it only within the authorized destinations. Record that it changes files; inspect its transformations rather than assuming every UUID/date is noise. No normalizer means an explicitly reported omitted phase, not permission to install one. Stop on normalization failure; do not claim a completed full workflow.

Verify

After all required generation, copying and normalization succeeds, run the inspected verification command for every affected provider (full all: every declared provider). Confirm the intended consumer set was exercised. A command selecting zero relevant tests is not verification. Provider-only execution uses current inputs; it does not imply they were generated or synced now. Stop on a provider failure, name completed/not-run pairs, and hand diagnosis/repairs to a separately requested coding workflow. Never change the API or weaken a contract merely to make this run green.

Report execution, not health

Render phases and consumer/provider pairs with PASS/FAIL/UNKNOWN/NOT-RUN, the command and evidence actually observed, files changed, and any unexecuted phases. Retain partial results and the exact failed command; do not retry after repairs automatically. A full success requires every planned phase and expected pair. No commits, pushes, tracker writes or setup changes follow automatically.

For staleness, sync gaps, CI configuration or broader health questions, point to /contract-check. These remain owned by the audit even when requested during an execution workflow.

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.