Api Design Spec logo

Api Design Spec

Community
LuckyOneTwoThree
api-design-spec

Use when designing API specifications. Produces API design specifications from confirmed data models and service boundaries, designing RESTful/GraphQL interface contracts, security policies, and authentication schemes, generating OpenAPI 3.0 specs. Data-driven contracts, API fields precisely projected from ER model. Built-in compliance check ensures API security and compliance. Keywords: API design, interface contract, OpenAPI, RESTful, GraphQL, API security, authentication, JWT, OAuth2, RBAC.

Overview

PublisherLuckyOneTwoThree
Repositoryvibe-skill
Skill nameapi-design-spec
Stars
34
Forks
8
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by LuckyOneTwoThree on GitHub. Read the source before you install it.

Installation

Install the Api Design Spec AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/LuckyOneTwoThree/vibe-skill/tree/main/.codex/skills/api-design-spec
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/LuckyOneTwoThree/vibe-skill.git /tmp/vibe-skill
mkdir -p .claude/skills
cp -r /tmp/vibe-skill/.codex/skills/api-design-spec .claude/skills/api-design-spec
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Api Design Spec in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Api Design Spec on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Api Design Spec is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

API Design Specification

Core Principles

  1. Data-Driven Contracts: API contracts designed based on confirmed data models and service boundaries, field definitions evidence-based
  2. Built-in Security: Security policies and authentication designed alongside interfaces, not patched afterward
  3. Compliance by Default: Privacy compliance checks built-in, ensuring API design meets GDPR/MLPS requirements
  4. RESTful Priority: Prefer RESTful style, consider GraphQL for complex query scenarios
  5. Default Deny: Any request not explicitly allowed is denied

Interaction Mode

AI->Human AI suggests, human approves

Input

Input ItemTypeRequiredSourceDescription
PRDmarkdownYesoutput/pm-design/design-prd/prd.mdProduct requirements document
PRD Structured DataJSONYesoutput/pm-design/design-prd/prd.jsonMachine-consumable PRD version, containing features[]/entities[], for programmatic API design consumption
Data ModelJSONYesoutput/backend-data-architecture/data-architecture-spec/er_model.jsonData entity and relationship definitions, API fields precisely projected from Model
Business Data DictionaryJSONOoutput/backend-data-architecture/data-architecture-spec/data_dictionary.jsonBusiness data standards and entity definitions, for field naming and type alignment
Architecture PlanJSONYesoutput/backend-architecture/backend-architecture-spec/architecture_decision.jsonArchitecture pattern, determines whether API is split by service or unified entry
Service DesignJSONYesoutput/backend-architecture/backend-architecture-spec/service_design.jsonService decomposition + bounded contexts, determines API grouping by service
Tech Stack DecisionJSONOoutput/backend-architecture/backend-architecture-spec/tech_stack_decision.jsonUnified tech stack, determines API framework and middleware style
Business ProcessJSONOoutput/pm-design/design-userflow/userflow.jsonUser flow definitions
Security LevelstringYesUser providedStandard / High Security (Finance/Healthcare)
Compliance RequirementsstringOUser providedGDPR / MLPS / PCI-DSS
Multi-tenant RequirementsstringOUser providedWhether multi-tenant isolation is needed
Frontend Page Data RequirementsJSONOoutput/ui-frontend/page-builder/pages.jsonFrontend page data fetching requirements, ensuring API and frontend alignment (available in UI-first flow)
PRD Page Data RequirementsJSONOoutput/pm-design/design-prd/prd.json -> pages[].data_requirementsPage data operation requirements from PRD (read/create/update/delete, related entity, required fields), consumed when pages.json is unavailable in backend-first flow

Execution Steps

Step 1: Resource Identification and Modeling [Core]

Map API resources directly from ER model:

  • Each core data entity maps to a resource (plural noun)
  • API fields precisely projected from Model fields, no longer derived from PRD
  • Identify relationships between resources (one-to-one/one-to-many/many-to-many)
  • Determine CRUD operation requirements for resources
  • Mark which resources need nested resources (sub-resources)
  • Group API resources by bounded context based on service design (service_design.json)

Page Data Requirements Consumption Priority (resolving backend-first timing conflict):

PriorityData SourceAvailability TimingConsumption Method
1pages.json (UI output)UI-first flowDirectly consume pages.json data_flow fields
2prd.json -> pages[].data_requirementsBackend-first flowConsume PRD page data_operations/related_entity/fields, derive API endpoints
3Neither availablePRD and ER model onlyDesign CRUD interfaces only, mark "pending frontend data requirements supplement"

When prd.json pages[].data_requirements is available, derive API endpoints following these rules:

  • data_operations contains "read" -> corresponding GET endpoint
  • data_operations contains "create" -> corresponding POST endpoint
  • data_operations contains "update" -> corresponding PUT/PATCH endpoint
  • data_operations contains "delete" -> corresponding DELETE endpoint
  • related_entity -> maps to corresponding resource path
  • fields -> serves as subset of response fields or request fields

Resource Naming Conventions:

  • Use plural nouns: /courses not /course
  • Nested resources max 2 levels: /courses/{id}/lessons
  • Use kebab-case: /user-groups not /userGroups

Step 2: Interface and Specification Design [Core]

Design standard interfaces for each resource:

OperationMethodPathDescription
List QueryGET/resourcesPagination + filtering + sorting
Detail QueryGET/resources/{id}Single resource details
CreatePOST/resourcesCreate new resource
Full UpdatePUT/resources/{id}Replace entire resource
Partial UpdatePATCH/resources/{id}Update specified fields
DeleteDELETE/resources/{id}Delete resource

Define unified request/response formats, error code system, and versioning strategy.

Error Code System Specification:

Error Code RangeCategoryExample
10000-19999General errors (validation/auth/rate limiting)10001 Validation failed, 10002 Unauthenticated, 10003 Permission denied, 10004 Rate limited
20000-29999Business logic errors20001 Resource not found, 20002 State conflict, 20003 Business rule violation
30000-39999Data layer errors30001 Unique constraint violation, 30002 Data stale, 30003 Foreign key constraint violation
40000-49999External service errors40001 Downstream timeout, 40002 Third-party service error

Unified Error Response Format:

json
{
  "error": {
    "code": 20001,
    "message": "Resource not found",
    "detail": "Course with id 'abc' not found",
    "trace_id": "req-xxx"
  }
}

Service Boundary Adaptation:

  • Microservices: API split by service, each service generates independent OpenAPI tags or separate files
  • Monolithic: API unified entry, grouped by bounded context using tags
  • BFF pattern: Differentiated API for different frontends (Web/Mobile)

Stage Gate: Each resource has CRUD definition + error code system + service ownership

Step 3: Interface Security Design [Core]

Classify interfaces by sensitivity level:

LevelInterface TypeAccess ControlAudit Requirements
L1-PublicHealth check, public docsNo authenticationNone
L2-AuthenticatedUser personal info, business queriesToken authenticationQuery logs
L3-AuthorizedWrite operations, admin functionsToken + permission checkOperation logs + change records
L4-SensitivePayments, keys, data exportToken + permission + secondary verificationFull audit + alerts

Design rate limiting strategy, data security (encryption/masking/input validation), CORS and security headers.

Stage Gate: 100% of interfaces have security level + rate limiting rules, L4 interface security policies are complete

Step 4: Authentication and Authorization Design [Core]

Select authentication scheme based on business scenario, design permission model, multi-tenant isolation and session management:

Authentication Scheme Selection:

ScenarioRecommended SchemeDescription
Monolithic + self-built user systemJWT + Refresh TokenStateless, easy to scale
Third-party login neededOAuth2 + JWTSupports social account login
Enterprise internal systemSSO (SAML/OIDC)Integrates enterprise identity provider
Microservices + inter-service callsJWT + Service AccountInter-service mTLS or API Key

Permission Model Design:

ModelApplicable ScenarioComplexity
RBACFixed roles (<=10), infrequent permission changesLow
RBAC + Permission GroupsMany roles (10-50), need flexible combinationMedium
ABACContext-dependent permissions (time/location/data attributes)High

Multi-tenant Isolation Strategy:

StrategyApplicable ScenarioIsolation Level
Shared database + tenant_idTenants >100, cost-sensitiveLogical isolation
Schema isolationTenants 10-100, moderate isolation requirementsSchema-level isolation
Separate databaseTenants <10, high security requirementsPhysical isolation

Session Management:

  • Token expiration strategy (short-lived Access Token + long-lived Refresh Token)
  • Concurrent login control (single device / multi-device)
  • Token revocation mechanism (blacklist / version number)

Stage Gate: Authentication scheme + permission model + session management complete

Step 5: Compliance Check [Core]

Built-in privacy compliance assessment:

  • Personal information collection minimum necessity principle check
  • Cross-border data transfer compliance check
  • User consent mechanism design
  • Data retention and deletion policy
  • Generate security requirements checklist

Stage Gate: Compliance check has no P0 issues

Output

Metadata Output: output/backend-api-design/api-design-spec/

Output Files:

  • openapi.yaml -- OpenAPI 3.0 specification
  • security-policy.json -- Security policy
  • auth-scheme.json -- Authentication and authorization scheme
  • compliance-checklist.json -- Compliance checklist
  • api-coverage.json -- PRD/frontend alignment coverage report

api-coverage.json Schema:

json
{
  "type": "object",
  "required": ["prd_coverage", "frontend_coverage"],
  "properties": {
    "prd_coverage": {
      "type": "object",
      "required": ["total_features", "covered_features", "coverage_rate", "uncovered"],
      "properties": {
        "total_features": { "type": "integer" },
        "covered_features": { "type": "integer" },
        "coverage_rate": { "type": "string" },
        "uncovered": { "type": "array", "items": { "type": "object", "properties": { "feature": { "type": "string" }, "reason": { "type": "string" } } } }
      }
    },
    "frontend_coverage": {
      "type": "object",
      "properties": {
        "total_pages": { "type": "integer" },
        "covered_pages": { "type": "integer" },
        "uncovered": { "type": "array", "items": { "type": "object", "properties": { "page": { "type": "string" }, "missing_apis": { "type": "array", "items": { "type": "string" } } } } }
      }
    }
  }
}

Decision Rules

ConditionDecision
Many-to-many relationship between resourcesCreate association resource
Query conditions >=5Consider providing GraphQL endpoint
Security level = High SecurityL3+ interfaces all require request signing + full audit
Number of roles <=10 and fixedUse RBAC
Number of roles >10 or frequently changingUse RBAC + permission groups
Multi-tenant + tenant count >100Shared database + tenant_id
Involves personal privacy dataMandatory masking + encrypted storage + compliance check
Compliance requirements include GDPRData export interface + data deletion interface

Quality Checks

  • Each resource has complete CRUD interface definition
  • API resources correspond one-to-one with ER model entities
  • API request/response fields 100% have Model field support
  • API grouping consistent with service boundaries
  • 100% of interfaces have security level annotation
  • L2+ interfaces 100% have authentication requirements
  • Authentication scheme covers all user scenarios
  • Permission model covers all roles and permissions
  • Compliance check has no P0 issues
  • Sensitive fields 100% have masking or encryption strategy
  • PRD feature points 100% have API endpoint coverage
  • Frontend page data requirements 100% have API correspondence (when frontend input or PRD page data requirements exist)

Degradation Strategy

Missing Upstream InputDegradation PlanOutput Impact
Data model missingDerive core entities from PRD, mark "pending data model confirmation"Resource definitions based on derivation, fields may be incomplete
Architecture plan missingDefault monolithic architecture, API unified entryAPI splitting strategy may not match
Service design missingDesign API by resource independently, mark "service ownership pending confirmation"API grouping may be inconsistent with service boundaries
Tech stack decision missingDefault Express + TypeScriptAPI framework style may not match
Business process missingDesign CRUD interfaces onlyMissing cross-resource business interfaces
PRD missingCannot design APIOutput is empty
Security level not specifiedDefault standard levelMay not meet high security requirements
Frontend page data requirements missingPrefer consuming prd.json pages[].data_requirements to derive API endpoints; if PRD also lacks page data, design CRUD interfaces based on PRD and ER model onlyMay lack frontend-specific data aggregation interfaces and pagination/filtering requirements

Upstream Change Response

Upstream ChangeImpact ScopeResponse Strategy
PRD feature points added/removedAPI endpoints added/removedMark affected API endpoints, generate change list
Data model changeAPI request/response structureMark affected fields, assess backward compatibility
Architecture plan changeAPI grouping and entry strategyRe-evaluate API splitting strategy by service
Service design changeAPI resource ownershipRe-divide API groups, assess cross-service API adjustments
API Change TypeCompatibilityNotification ScopeNotification Method
New endpointBackward compatibleapi-design-implMark new endpoint, implementation Skill can incrementally generate
Deleted endpointBreaking changeapi-design-implMust have human confirmation, provide migration plan
Modified field typeBreaking changeapi-design-implMust have human confirmation, provide compatibility plan

Frequently asked questions

What does the Api Design Spec AI skill do?

Use when designing API specifications. Produces API design specifications from confirmed data models and service boundaries, designing RESTful/GraphQL interface contracts, security policies, and authentication schemes, generating OpenAPI 3.0 specs. Data-driven contracts, API fields precisely projected from ER model. Built-in compliance check ensures API security and compliance. Keywords: API design, interface contract, OpenAPI, RESTful, GraphQL, API security, authentication, JWT, OAuth2, RBAC.

Why use Api Design Spec on TypingMind?

Because you install it once and use it with any model. Api Design Spec is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Api Design Spec in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/LuckyOneTwoThree/vibe-skill/tree/main/.codex/skills/api-design-spec. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Api Design Spec?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Api Design Spec?

As many as you like. As long as a model supports skills, you can use Api Design Spec with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Api Design Spec AI skill free?

Yes. It is published on GitHub by LuckyOneTwoThree under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇