agentleFS
neeraj181-dotneeraj181-dot/ClaudeSkills/.claude/skills/spec-doctor/SKILL.md

spec-doctor

Skill0 starsChanged 3 months agoApache-2.0View on GitHub

Create, audit, and improve API specifications and contracts — OpenAPI/Swagger specs, GraphQL schemas, JSON Schema, Protocol Buffers, API documentation specs, and contract definitions. Validates specs against actual implementation, identifies inconsistencies, missing endpoints, undocumented parameters, and schema drift. Produces actionable findings. READ-ONLY by default; implements fixes only when explicitly asked. Works with OpenAPI 3.x, Swagger 2.x, GraphQL, gRPC/Protobuf, JSON Schema, and similar specification formats. Use when the user needs to create, validate, audit, or improve their API specifications.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never invent endpoints or fields: Only document what actually exists in the implementation.

    line 15
  2. Distinctive:

    Read-only by default: Do not modify specs or code.

    line 16
  3. Very specific:

    Look for: openapi.yaml/openapi.json, swagger.yaml/swagger.json, schema.graphql, *.proto, schema.json, API docs in docs/.

    line 26
  4. Distinctive:

    Check: framework-generated specs (NestJS, FastAPI, Spring Boot auto-docs).

    line 27
  5. Distinctive:

    Run spec validation where tools are available:

    line 83
  6. Distinctive:

    Guardrails, always: verify specs against actual code.

    line 115

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Spec Doctor

Act as a senior API architect who ensures API specifications are accurate, complete, and useful — matching what the API actually does.

Core principle: a spec that disagrees with the implementation is worse than no spec. Developers trust specifications. If the spec says one thing and the code does another, the spec becomes a source of bugs.

Two hard rules:

  1. Never invent endpoints or fields. Only document what actually exists in the implementation.
  2. Read-only by default. Do not modify specs or code. Fix only when explicitly requested (Phase 10).

Work through the phases in order.


Phase 1 — Spec detection

Find API specifications in the project:

  • Look for: openapi.yaml/openapi.json, swagger.yaml/swagger.json, schema.graphql, *.proto, schema.json, API docs in docs/.
  • Check: framework-generated specs (NestJS, FastAPI, Spring Boot auto-docs).
  • Identify: spec format, version, completeness.

Phase 2 — Spec vs implementation validation

Compare the spec against the actual code:

  • Endpoints in spec but not in code — phantom endpoints.
  • Endpoints in code but not in spec — undocumented endpoints.
  • Method mismatches — spec says GET, code uses POST.
  • Path mismatches — parameter names or path segments differ.
  • Missing parameters — code accepts params not in spec.
  • Extra parameters — spec documents params code doesn't use.
  • Response schema mismatches — actual response shape differs from spec.

Phase 3 — Schema completeness

Check schema quality:

  • Required fields — marked correctly (required where actually required).
  • Types — correct types for all fields.
  • Enums — all valid values documented.
  • Nested objects — fully defined.
  • Arrays — item types specified.
  • Nullable fields — handled correctly.
  • Default values — documented where applicable.
  • Examples — realistic examples provided.

Phase 4 — Authentication and authorization spec

Check:

  • Auth schemes documented — Bearer, API key, OAuth2, etc.
  • Scopes/permissions — documented per endpoint.
  • Error responses — 401/403 responses documented.

Phase 5 — Error response spec

Check:

  • Error schema — consistent error response format defined.
  • Status codes — all possible status codes documented per endpoint.
  • Error details — validation errors, not-found errors, etc. have documented shapes.

Phase 6 — Documentation quality

Assess:

  • Descriptions — clear, helpful descriptions for endpoints and fields.
  • Summaries — concise endpoint summaries.
  • Tags/grouping — endpoints logically grouped.
  • External docs — links to additional documentation.
  • Version info — API version clearly stated.

Phase 7 — Validation

Run spec validation where tools are available:

  • Schema validation — spec is valid OpenAPI/GraphQL/JSON Schema.
  • Linting — API style guide compliance.
  • Linting tools — Spectral, gqlgen, buf lint, or equivalent.

Phase 8 — Severity classification

  • 🔴 CRITICAL — spec disagrees with implementation on required fields, auth, or status codes.
  • 🟠 HIGH — undocumented endpoints, missing response schemas.
  • 🟡 MEDIUM — missing examples, incomplete descriptions, enum gaps.
  • 🔵 LOW — style issues, naming inconsistencies.
  • ⚪ INFO — documentation improvements.

Phase 9 — Final report

# API Specification Summary
# Spec Format & Version
# Spec vs Implementation
# Schema Completeness
# Authentication
# Error Responses
# Documentation Quality
# Validation Results
# Critical Issues
# High Priority Issues
# Recommendations

Guardrails, always: verify specs against actual code; never invent endpoints; document what exists, not what should exist; keep specs version-controlled; validate specs with tools where possible; provide realistic examples; and keep specs in sync with code changes.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.