spec-sync

spec-sync is a command for coding agents 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

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

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.

agentmods
npx agentmods add commands/sigistry/marketplace/spec-sync
Clone the repo
git clone --depth 1 https://github.com/sigistry/marketplace

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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00021 $0.01109
Opus 5 $0.00010 $0.00554
Sonnet 5 $0.00004 $0.00222
Haiku 4.5 $0.00002 $0.00111

Measured 4d ago against content hash 7cc7a2aaa8cc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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. 4d 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 yesterday), licensed MIT. It adds 21 tokens to every session and 1,109 once invoked, about $0.0001 per session on Opus 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.