usm/mcp-contracts
MCP contracts tool — extracts the contracts array from a feature .usm file, including id, description, applies_after, and must_have.
Intent
Agents need to review a feature's contracts to plan tests or verify guarantees. The contracts tool returns the full contracts array from a feature file, formatted for easy agent consumption.
Flows
Get feature contracts (get-contracts)
Agent retrieves all contracts for a feature
- get → feature .usm file path
- parse → contracts array
- observe → contract count and details
Contracts
contracts-feature-only
Contracts tool only works on feature files
Acceptance criteria:
- [ ] Returns error if file is not a feature
- [ ] Returns contractCount and full contracts array
- [ ] Each contract includes id, description, must_have
Tests
contracts-from-feature
Given:
- feature_with_contracts: true
Then:
- assertion: contracts array returned with correct count
contracts-from-service
Given:
- service_usm_file: true
Then:
- assertion: error returned "not a feature file"
Implementation
- Primary: src/mcp/contracts.ts
- Test code status: none
See Also
- usm/mcp-flows