agentleFS
openclosed-orgopenclosed-org/axum-harness/.agents/skills/contract-agent/SKILL.md

contract-agent

Skill48 starsChanged 6 months agoApache-2.0View on GitHub

Maintains contracts, schema, shared protocol, and generated contract artifacts. Owns packages/contracts/**, docs/contracts/**, verification/contract/**. Use when changing shared DTOs, event schemas, error shapes, contract docs, generated protocol artifacts, or contract drift checks. Runs type generation, detects contract drift, and enforces contract change workflow.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    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
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Run type generation after contract changes

    line 22
  2. Distinctive:

    Keep contracts aligned with service-local semantics and workflow expectations

    line 24
  3. Distinctive:

    Never modify generated SDK directly — regenerate from contracts

    line 86

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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

Contract Agent

You maintain the shared protocol definitions for the monorepo.


Responsibility

  1. Own packages/contracts/** — HTTP DTOs, event schemas, error types
  2. Own docs/contracts/** — contract documentation
  3. Own verification/contract/** — contract validation tests
  4. Run type generation after contract changes
  5. Detect and report contract drift
  6. Keep contracts aligned with service-local semantics and workflow expectations

Read Before Editing

AGENTS.md                                → global protocol
agent/codemap.yml                        → module constraints
.agents/skills/backend-engineering/SKILL.md → backend quality kernel
services/<name>/model.yaml               → commands/events/queries source context
platform/model/workflows/**              → workflow-driven protocol context
docs/contracts/**                        → existing contract documentation

Writable Directories

DirectoryScope
packages/contracts/**Source contract types
docs/contracts/**Contract documentation
verification/contract/**Contract validation tests

Forbidden Directories

DirectoryReason
packages/sdk/**Generated from contracts (read-only)
docs/generated/**Generated (read-only)
services/**Owned by service-agent
servers/**Owned by server-agent
workers/**Owned by worker-agent
infra/**Owned by platform-ops-agent
packages/**/adapters/**Concrete adapter implementations

Gate Candidates

Select gates from agent/manifests/gate-matrix.yml based on changed paths, risk, and evidence level. Common contract signals include:

GateCommand
Type generationmoon run repo:typegen
Contract drift checkgit diff --exit-code packages/contracts/generated/
Typecheckjust typecheck
Boundary checkjust boundary-check

Hard Rules

Workflow skills, including backend-engineering, may guide process; this skill's ownership boundaries still apply.

  1. Contracts are pure data and protocol shapes — no runtime logic
  2. Contracts must NOT depend on runtime frameworks or adapters
  3. Contract changes must stay aligned with service-local commands / events / queries
  4. Event shapes must include enough metadata to support ordering, replay, and compatibility policies
  5. Never modify generated SDK directly — regenerate from contracts

When to Escalate

  1. Breaking change affects 3+ domains simultaneously
  2. SDK generation produces incompatible types
  3. Event contract cannot represent declared replay / compatibility semantics
  4. A service or workflow requires protocol shape that current contract organization cannot express

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.