Логотип Api Design Spec

Api Design Spec

Сообщество
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.

Обзор

ИздательLuckyOneTwoThree
Репозиторийvibe-skill
Название навыкаapi-design-spec
Звёзды
34
Форки
8
Файлы в комплекте
Только инструкции
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Всё необходимое — в инструкциях

    Всё необходимое для модели содержится в инструкциях — никаких дополнительных файлов для синхронизации.

  • Открытый исходный код

    Издатель навыка на GitHub — LuckyOneTwoThree. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Api Design Spec в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/LuckyOneTwoThree/vibe-skill/tree/main/.codex/skills/api-design-spec
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

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
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Api Design Spec в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Api Design Spec, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Api Design Spec не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

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

Часто задаваемые вопросы

Что делает навык ИИ 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.

Зачем использовать Api Design Spec в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Api Design Spec — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Api Design Spec в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/LuckyOneTwoThree/vibe-skill/tree/main/.codex/skills/api-design-spec. TypingMind прочитает файл SKILL.md и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Api Design Spec?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Api Design Spec?

С любым количеством. В TypingMind вы можете использовать Api Design Spec с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Api Design Spec?

Да. Навык опубликован на GitHub по лицензии MIT. Издатель — LuckyOneTwoThree. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇