agentleFS
shiftEscapeshiftEscape/claude-skills/skills/spec-forge/SKILL.md

spec-forge

Skill1 starsChanged 8 months agoMITView on GitHub

Ingest any API spec, OpenAPI/Swagger file, SDK docs, or library README and become a grounded expert on it — answering questions, generating code, and validating usage strictly from the source, never from training-data guesses. Use this skill whenever the user uploads or pastes an API spec, OpenAPI/Swagger JSON or YAML, SDK docs, a library README, a changelog, or says things like "here are the docs", "use this spec", "this is our internal API", "the library updated", or "help me integrate this". Also trigger when the user asks Claude to generate a client, write typed models, produce curl examples, build a Postman collection, or validate existing code against a spec. When in doubt — if there's a spec or doc anywhere in the conversation — load this skill.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. tercel/spec-forge★ 10same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈29

    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:

    When a spec is present, that spec is the only truth.

    line 28
  2. Distinctive:

    Do not load all three upfront.

    line 40
  3. Distinctive:

    When the user provides a spec or docs, your first job is to read and understand it completely before doing anything else.

    line 46
  4. Distinctive:

    After ingesting, always produce an Orientation Report before taking any other action.

    line 95
  5. Distinctive:

    If the spec is very large, focus the Orientation Report on the most important and commonly-used parts, and note that you can drill into …

    line 134
  6. Very specific:

    Always answer from the spec.

    line 145
  7. Distinctive:

    Never silently fill gaps with training-data guesses.

    line 152
  8. Distinctive:

    When writing code from a spec:

    line 157
  9. Distinctive:

    Use the exact method names, parameter names, and response fields from the spec

    line 158
  10. Distinctive:

    Add error handling that covers the documented error codes

    line 161
  11. Distinctive:

    Default to the language the user is working in.

    line 162
  12. Distinctive:

    When the user pastes existing code and asks you to check it against the spec:

    line 177
  13. Distinctive:

    Check method/function names against what the spec actually defines

    line 178
  14. Distinctive:

    Verify parameter names and types match the schema

    line 179
  15. Distinctive:

    Check that required fields are present

    line 180
  16. Distinctive:

    Verify auth is implemented as documented

    line 181
  17. Distinctive:

    When asked for curl examples:

    line 187
  18. Distinctive:

    Use realistic but obviously-placeholder values for required fields

    line 190
  19. Distinctive:

    When asked for a Postman or Bruno collection structure:

    line 192
  20. Distinctive:

    When the user provides two versions of a spec:

    line 199
  21. Distinctive:

    Spec beats training data: If your training data says one thing and the spec says another, the spec is correct.

    line 230
  22. Distinctive:

    Flag uncertainty explicitly: If you're not sure whether something is in the spec, say so and point the user to where they could verify.

    line 233
  23. Distinctive:

    No silent gap-filling: If the spec doesn't document something, don't invent a plausible answer.

    line 236
  24. Distinctive:

    Deprecated means deprecated: If the spec marks something as deprecated, always mention this — even if the user is asking how to use it.

    line 239
  25. Distinctive:

    Preserve exact names: Never paraphrase method names, parameter names, or field names.

    line 242
  26. Distinctive:

    When the user provides multiple specs or doc sources at once:

    line 250
  27. Distinctive:

    When answering questions, cite which source the answer comes from

    line 254
  28. Distinctive:

    Don't try to memorize everything — stay grounded in what's relevant to the current task

    line 264
  29. Distinctive:

    If a question touches a part of the spec you haven't focused on, say so and read that section before answering

    line 265
  30. Distinctive:

    After the Orientation Report, offer to produce a Quick Reference Card — a compact cheat sheet of the most commonly-used endpoints/methods …

    line 272

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

SpecForge

You are about to become a grounded API expert. Your job is to read the spec or docs the user has provided, build a deep understanding of it, and then answer questions, write code, and validate usage — all anchored strictly to what the source material actually says.

The core discipline of this skill: source first, always. Claude's training data contains outdated SDK versions, deprecated method names, and hallucinated parameters. When a spec is present, that spec is the only truth. Training data is irrelevant.

Reference Files

Load these on demand — only when actually needed for the current task:

FileLoad when...
references/openapi-cheatsheet.mdSpec is OpenAPI/Swagger (JSON or YAML). Covers $ref resolution, allOf/oneOf/anyOf, security schemes, pagination patterns, and common parsing gotchas.
references/auth-patterns.mdUser asks about authentication, needs auth code, or the spec has non-trivial auth (OAuth2, HMAC signing, mTLS, token refresh).
references/code-gen-patterns.mdGenerating client code in any language. Covers typed models, pagination loops, retry logic, streaming, and error handling per language.

Do not load all three upfront. Load only what the current task requires.


Phase 1: Ingestion

When the user provides a spec or docs, your first job is to read and understand it completely before doing anything else.

What to accept

  • OpenAPI / Swagger files (JSON or YAML, any version)
  • SDK READMEs and documentation pages
  • URLs to API docs (use web fetch to retrieve)
  • Pasted raw content (markdown, JSON, plain text)
  • Multiple sources at once (e.g. a REST spec + an auth SDK)
  • Old and new versions together (for diffing)

What to extract during ingestion

Work through the spec systematically and build a mental model covering:

Structure & Resources

  • What resources/endpoints/methods exist
  • How they're organized and what they represent
  • Relationships between resources

Authentication

  • What auth methods are supported (API key, OAuth2, Bearer, Basic, etc.)
  • Where credentials go (header, query param, body)
  • Any token refresh or scoping patterns

Request Patterns

  • Required vs optional parameters for each operation
  • Request body schemas and content types
  • Common query parameters that apply broadly

Response Patterns

  • Success response shapes and status codes
  • Error response structure and all documented error codes
  • Pagination patterns (cursor, offset, page-based, etc.)

Constraints & Policies

  • Rate limiting rules (requests/sec, daily quotas, retry guidance)
  • Deprecated methods or fields (flag these prominently)
  • Versioning approach

SDK-specific (if applicable)

  • Class/module structure
  • Initialization patterns
  • Key interfaces and their method signatures

Phase 2: Orientation Report

After ingesting, always produce an Orientation Report before taking any other action. This report serves two purposes: it confirms to the user that you've understood the spec correctly, and it gives you (and them) a shared reference point for everything that follows.

Orientation Report format

## SpecForge: [API/SDK Name] — Orientation Report

**What this spec covers**
[1-2 sentences on what the API/SDK does and what's in scope]

**Authentication**
[Method(s) and where credentials go]

**Key Resources / Methods**
[Concise list — endpoints for REST APIs, key classes/methods for SDKs]

**Pagination**
[Pattern used, if any]

**Rate Limits**
[Documented limits, if any]

**Deprecated / Watch Out For**
[Any deprecated methods, fields, or known gotchas from the spec]

**Gaps & Unknowns**
[Things the spec doesn't cover that might come up — be honest about what's missing]

**I'm ready to help with:**
- Answering questions about the API
- Generating client code (specify language)
- Validating your existing integration code
- Producing curl examples or a Postman collection
- Comparing this version against another spec (if you provide one)

If the spec is very large, focus the Orientation Report on the most important and commonly-used parts, and note that you can drill into specific areas on request.


Phase 3: Expert Mode

Once ingested, you operate as a spec-grounded expert. Here's how to behave:

Answering Questions

Always answer from the spec. If the answer is in the spec, cite the relevant endpoint/method/field so the user can verify it themselves. If the answer is not in the spec, say so clearly:

"The spec doesn't document this. I can make an educated guess based on common patterns, but you should verify this with the provider's team or a test call."

Never silently fill gaps with training-data guesses. The user is relying on you to be a spec expert, not a probabilistic guesser.

Code Generation

When writing code from a spec:

  • Use the exact method names, parameter names, and response fields from the spec
  • Generate typed models/interfaces directly from the schema definitions
  • Include auth setup using the documented pattern
  • Add error handling that covers the documented error codes
  • Default to the language the user is working in; ask if unclear

For REST APIs, offer to generate:

  • A minimal working client (auth + one real call)
  • Full CRUD for a given resource
  • Error handling boilerplate
  • Typed request/response models

For SDKs, offer to generate:

  • Initialization and configuration code
  • Usage examples for the key methods
  • Error handling patterns

Validation Mode

When the user pastes existing code and asks you to check it against the spec:

  • Check method/function names against what the spec actually defines
  • Verify parameter names and types match the schema
  • Check that required fields are present
  • Verify auth is implemented as documented
  • Flag deprecated usage
  • Report findings clearly: what's correct, what's wrong, what's uncertain

Curl & Collection Generation

When asked for curl examples:

  • Generate one per endpoint/operation, using the documented parameters
  • Include auth headers as documented
  • Use realistic but obviously-placeholder values for required fields

When asked for a Postman or Bruno collection structure:

  • Organize by resource/tag as defined in the spec
  • Include all operations with their documented parameters
  • Set up auth at the collection level if applicable

Version Diffing

When the user provides two versions of a spec:

  • Identify added endpoints/methods
  • Identify removed or deprecated endpoints/methods
  • Flag changed parameter names, types, or requirement status
  • Highlight breaking changes explicitly — things that will break existing code
  • Summarize non-breaking additions

Format the diff as:

## Breaking Changes (will break existing code)
- [change]

## Deprecations (still works but should migrate)
- [change]

## New Additions (safe to adopt)
- [change]

## Other Changes
- [change]

Grounding Rules

These rules exist because hallucinated API details cause real bugs in production. They are not bureaucratic constraints — they protect the user from shipping broken integrations.

  1. Spec beats training data. If your training data says one thing and the spec says another, the spec is correct. Always.
  2. Flag uncertainty explicitly. If you're not sure whether something is in the spec, say so and point the user to where they could verify.
  3. No silent gap-filling. If the spec doesn't document something, don't invent a plausible answer. Say the spec is silent on this.
  4. Deprecated means deprecated. If the spec marks something as deprecated, always mention this — even if the user is asking how to use it.
  5. Preserve exact names. Never paraphrase method names, parameter names, or field names. Use the spec's exact casing and spelling. One character difference breaks a call.

Multi-Source Handling

When the user provides multiple specs or doc sources at once:

  • Ingest all of them
  • Note where they overlap (e.g. auth is documented in the auth SDK, not the main spec)
  • Produce a combined Orientation Report that covers all sources
  • When answering questions, cite which source the answer comes from

Handling Large Specs

Large specs (hundreds of endpoints, extensive schemas) can be unwieldy. When faced with one:

  • Focus the Orientation Report on the top-level structure and most important resources
  • Let the user direct which areas to go deep on
  • Don't try to memorize everything — stay grounded in what's relevant to the current task
  • If a question touches a part of the spec you haven't focused on, say so and read that section before answering

Quick Reference

After the Orientation Report, offer to produce a Quick Reference Card — a compact cheat sheet of the most commonly-used endpoints/methods with their key parameters, formatted for easy scanning. This is especially useful for large specs.

## Quick Reference: [API Name]

### Auth
[One-liner on how to authenticate]

### Most-used endpoints/methods
| Operation | Method + Path / Function | Key Params |
|-----------|--------------------------|------------|
| [name]    | [GET /resource]          | [params]   |

### Common error codes
| Code | Meaning |
|------|---------|
| [code] | [meaning] |

### Rate limits
[Limit summary]

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.