maestro: Command for Claude Code

.claude/commands/validate-contracts.md

validate-contracts is a command for Claude Code from CarlosDanielDev/maestro. It costs 0 tokens per session (590 once invoked), scanned A, original, MIT.

A validation command that compares client-side data models with JSON schemas describing an API's responses. An API contract is an agreed description of an endpoint's paths, fields, and data types.

In plain words
What is it for?
Use it to inspect schemas in docs/api-contracts, locate matching client models, and check response fields, types, and required or optional status.
Why use it?
It helps find mismatches between what an API promises and what the client code expects before those differences cause runtime failures. It can validate all contract files or a selected contract.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: reads .claude/ paths.

This is CarlosDanielDev/maestro's own configuration. It tells Claude Code how to work on maestro itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything maestro configures →

Reuse

Borrowing it

Nothing to install: this file belongs to CarlosDanielDev/maestro. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/CarlosDanielDev/maestro/main/.claude/commands/validate-contracts.md
Clone the repo
git clone --depth 1 https://github.com/CarlosDanielDev/maestro

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for validate-contracts

README.md
[![agentmods](https://agentmods.dev/badge/commands/carlosdanieldev/maestro/validate-contracts/github.svg)](https://agentmods.dev/commands/carlosdanieldev/maestro/validate-contracts)
Your own site
<a href="https://agentmods.dev/commands/carlosdanieldev/maestro/validate-contracts"><img src="https://agentmods.dev/badge/commands/carlosdanieldev/maestro/validate-contracts/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for validate-contracts

Your own site · 80×15
<a href="https://agentmods.dev/commands/carlosdanieldev/maestro/validate-contracts"><img src="https://agentmods.dev/badge/commands/carlosdanieldev/maestro/validate-contracts.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 590 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00590
Opus 5.5 $0.00000 $0.00236
Sonnet 5.5 $0.00000 $0.00118
Haiku 4.5 $0.00000 $0.00059

Measured 1mo ago against content hash b23b759bb76f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

validate-contracts scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/validate-contracts.md · 85 lines

How it starts

The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Validate API Contracts

Validate client-side models against API contract schemas to catch mismatches before runtime.

Usage: /validate-contracts or /validate-contracts items-list


Arguments

$ARGUMENTS contains an optional contract name filter.

  • No arguments: validate ALL contracts in docs/api-contracts/
  • With argument: validate only matching contracts

Instructions

Step 1: Find Contract Schemas

ls docs/api-contracts/*.json

If $ARGUMENTS is provided, filter to matching files.

If no contract files found:

"No API contract schemas found in docs/api-contracts/. Create schemas first using the format defined in .claude/skills/api-contract-validation/SKILL.md."

Step 2: For Each Contract Schema

Read the contract JSON file and extract:

  1. Endpoint — The API endpoint path
  2. Response fields — Each field with its type and required/optional status
  3. Issue reference — The linked issue number

Step 3: Find Corresponding Client Models

For each contract, find the client model that decodes its response:

  1. Search for struct/class/type names that match the response shape
  2. Use Grep to find model definitions in the project
  3. Match by field names

Step 4: Validate Field-by-Field

For each field in the contract schema:

Check Pass Fail
Field exists in model Found MISSING: field 'x' in contract but not in model
Type matches Types align TYPE MISMATCH: 'x' is integer in contract but float in model
Optionality matches required: false → nullable OPTIONALITY MISMATCH: 'x' is optional in contract but required in model

For each field in the model NOT in the contract:

  • GHOST FIELD: 'x' exists in model but not in contract schema

Step 5: Generate Report

API Contract Validation Report
==================================

docs/api-contracts/items-list.json → ItemListResponse
   All 6 fields match. No issues found.

docs/api-contracts/items-detail.json → ItemDetailResponse
   ISSUES:
   - OPTIONALITY MISMATCH: 'total' is optional in contract but required in model
   - GHOST FIELD: 'success' exists in model but not in contract

Summary: 1 passed, 1 failed

Read the full file on GitHub · 85 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 85 lines · 0 tokens per session scan A b23b759bb76f

Subscribe to this mod's changes

validate-contracts is a command published in the GitHub repository CarlosDanielDev/maestro (31 stars, last pushed 20d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 590 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-02.

Related

validate-contracts compared with commands from other repositories

validate-contracts next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
validate-contractsCarlosDanielDev/maestroCommand3120d agoMITA0Claude Code
initfcakyon/claude-codex-settingsCommand1.2kyesterdayApache-2.0A0Claude Code
http-serviceMadAppGang/magusCommand14yesterdayMITA27Claude Code
api-contract-reviewMozurok/fhorja.devCommand1028d agoMITA64Claude Code
buildAzure/ai-gatewayCommand59d agoMITA0Claude Code
start-10-1minicoohei/ai-agent-campCommand3471mo agononeA2Claude Code
fastapimfmezger/ai_agent_dotfilesCommand73mo agoMITA84Claude Code, Gemini CLI