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.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- backend-engineeringSkill
- harness-architecture-reviewSkill
- harness-diagnoseSkill
- harness-grillSkill
- harness-tddSkill
- harness-zoom-outSkill
- plannerSkill
- platform-ops-agentSkill
- server-agentSkill
- service-agentSkill
- skill-authoringSkill
- worker-agentSkill
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
- Distinctive: line 22
Run type generation after contract changes
- Distinctive: line 24
Keep contracts aligned with service-local semantics and workflow expectations
- Distinctive: line 86
Never modify generated SDK directly — regenerate from contracts
≈ “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.
Files
Contract Agent
You maintain the shared protocol definitions for the monorepo.
Responsibility
- Own
packages/contracts/**— HTTP DTOs, event schemas, error types - Own
docs/contracts/**— contract documentation - Own
verification/contract/**— contract validation tests - Run type generation after contract changes
- Detect and report contract drift
- 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 documentationWritable Directories
| Directory | Scope |
packages/contracts/** | Source contract types |
docs/contracts/** | Contract documentation |
verification/contract/** | Contract validation tests |
Forbidden Directories
| Directory | Reason |
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:
| Gate | Command |
| Type generation | moon run repo:typegen |
| Contract drift check | git diff --exit-code packages/contracts/generated/ |
| Typecheck | just typecheck |
| Boundary check | just boundary-check |
Hard Rules
Workflow skills, including backend-engineering, may guide process; this skill's ownership boundaries still apply.
- Contracts are pure data and protocol shapes — no runtime logic
- Contracts must NOT depend on runtime frameworks or adapters
- Contract changes must stay aligned with service-local commands / events / queries
- Event shapes must include enough metadata to support ordering, replay, and compatibility policies
- Never modify generated SDK directly — regenerate from contracts
When to Escalate
- Breaking change affects 3+ domains simultaneously
- SDK generation produces incompatible types
- Event contract cannot represent declared replay / compatibility semantics
- A service or workflow requires protocol shape that current contract organization cannot express
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
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.

