spec-sync

spec-sync is a command for Claude Code from sigistry/marketplace. It costs 21 tokens per session (1,109 once invoked), scanned A, original, MIT.

A command that compares an API description with the code that handles its requests. An API description, such as an OpenAPI, GraphQL, or protocol-buffer file, documents available operations and data formats.

In plain words
What is it for?
Use it to inspect API routes, parameters, responses, and schemas; report drift; and reconcile the specification with handler code.
Why use it?
It finds differences between what an API promises and what the implementation actually does, without starting the server or sending requests.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: model in frontmatter.

Part of the api-contract-keeper plugin — 4 skills, 3 commands, 2 agents shipped together

Good fit Use it to inspect API routes, parameters, responses, and schemas; report drift; and reconcile the specification with handler code.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/sigistry/marketplace/spec-sync
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/sigistry/marketplace

Made for: Claude Code.

Or install api-contract-keeper, the plugin that ships this one along with the rest of its 4 skills, 3 commands, 2 agents.

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 spec-sync

README.md
[![agentmods](https://agentmods.dev/badge/commands/sigistry/marketplace/spec-sync/github.svg)](https://agentmods.dev/commands/sigistry/marketplace/spec-sync)
Your own site
<a href="https://agentmods.dev/commands/sigistry/marketplace/spec-sync"><img src="https://agentmods.dev/badge/commands/sigistry/marketplace/spec-sync/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 spec-sync

Your own site · 80×15
<a href="https://agentmods.dev/commands/sigistry/marketplace/spec-sync"><img src="https://agentmods.dev/badge/commands/sigistry/marketplace/spec-sync.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,109 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.00021 $0.01109
Opus 5.5 $0.00008 $0.00444
Sonnet 5.5 $0.00004 $0.00222
Haiku 4.5 $0.00002 $0.00111

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

Security

Grade A, and why

spec-sync 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.

plugins/api-contract-keeper/commands/spec-sync.md · 59 lines

How it starts

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

Compare the API specification in $ARGUMENTS (or auto-discover it: openapi.yaml/openapi.json, swagger.{yaml,json}, *.graphql/schema.graphql, or a buf/proto file) against the actual handler code, report every point of drift, and reconcile it. This is a static analysis, no server is started and no requests are sent. Load the openapi-drift skill for the drift-signal catalog and breaking-change rules.

Process

Step 1: Locate the spec and detect the framework

Find the spec, then detect the web framework so you know how to read routes, params, and schemas from code:

Framework Signal
Express express(), app.get/post, router.<verb>, routes/
Fastify fastify(), fastify.route, schema: route options
NestJS @Controller, @Get/@Post, *.controller.ts, @ApiProperty
Koa koa-router, router.<verb>, ctx.body
FastAPI APIRouter, @app.get, response_model=, Pydantic models
Django REST Framework urls.py, ViewSet, serializers.py, *_views.py
Flask @app.route, @bp.route, blueprints
Spring Boot @RestController, @GetMapping, @RequestBody, DTOs
Go net/http / Gin http.HandleFunc, mux.HandleFunc, r.GET, gin.Context
Rails config/routes.rb, *_controller.rb, respond_to, strong params

For GraphQL, compare the SDL (type, input, enum, field args, nullability !) against resolver signatures and the code-first schema builders (Nexus, TypeGraphQL, Strawberry, gqlgen, graphql-ruby).

Step 2: Build both models and diff them

Extract the endpoint surface from both sides and align them by path+method (or GraphQL type+field). Compare on these axes and record which side each fact came from:

Axis Spec side Code side
Route exists paths./x.get a registered handler for GET /x
Path/query params parameters[] route tokens, req.query, @Query, request.args
Request body schema requestBody.content.schema validation schema / DTO / serializer
Response schema responses.200.content.schema returned object / response_model / DTO
Status codes declared responses keys res.status(), raise HTTPException, render status:
Required vs optional required: [...], nullable validator .optional(), Optional[...], ?
Auth/security security, securitySchemes auth middleware/decorators/guards

Read the full file on GitHub · 59 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 · 59 lines · 21 tokens per session scan A 7cc7a2aaa8cc

Subscribe to this mod's changes

spec-sync is a command published in the GitHub repository sigistry/marketplace (3 stars, last pushed 3d ago), licensed MIT. It adds 21 tokens to every session and 1,109 once invoked, about $0.0001 per session on Opus 5.5. 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-08-31.