AGENT SKILL

api-spec

Use when the user wants to design, review, or document an API (REST, OpenAPI, versioning, error models, contract testing, authentication), or when generating/maintaining OpenAPI specs as machine-readable context for AI agents.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 0
Forks
1

01 前言 Front Matter

name
api-spec
triggers
[ "user", "model" ]
description
Use when the user wants to design, review, or document an API (REST, OpenAPI, versioning, error models, contract testing, authentication), or when generating/maintaining OpenAPI specs as machine-readable context for AI agents.

03 SKILL.md 正文

API Spec

Design and review HTTP/gRPC/GraphQL APIs, and keep the contract explicit, versioned, and machine-readable (OpenAPI). The spec is the primary context for agents — they work from the spec, not from implementation memory.

Design protocol

  1. Collect constraints — consumers, auth, rate limits, error handling, versioning.
  2. Choose style — REST, gRPC, GraphQL, or hybrid per use case.
  3. Design endpoints — nouns as resources, consistent paths, status codes, error model.
  4. Specify input/output/behavior — every endpoint declares input schema, output schema, observable behavior. A spec lacking I/O is incomplete.
  5. Write the contract — OpenAPI spec (or proto), validated with tools.
  6. Add tests — contract, serialization, happy/unhappy paths.
  7. Document + sync — spec stays in version control, in sync with code.

What a spec must include

  1. Endpoints — paths, methods, parameters, request/response schemas.
  2. Authentication — type, headers, token format.
  3. Error responses — status codes, error schemas, retry semantics.
  4. Versioning — version, deprecation policy, migration path.
  5. Rate limits — rps, burst, backoff strategy.

Process

Design/review API → generate/update OpenAPI → validate against impl →
use spec as agent context → keep in VCS

Anti-patterns

  • No spec, or an outdated one.
  • Spec in prose instead of OpenAPI.
  • Spec not versioned / not in version control.
  • Agents reading implementation code instead of the spec.

Output rule

Deliver a spec file, examples, and a test command. Validate with swagger-codegen or equivalent when available.

04 同仓库更多 Skills

Leostruka
Leostruka/devin-bundle

montador-de-ideias

Use when assembling, expanding, or elevating a raw project idea or initial prompt into an ultra-detailed, first-principles dossier and compiled master prompt with journalistic OSINT market research, Tech Lead and Staff Architect justifications, atomic and modular hardening/optimization, and high-impact contact surfaces.

★ 0
Leostruka
Leostruka/devin-bundle

git-github-adaptive-engineering

Use when any task touches git history, GitHub issues/PRs/releases/CI, repo governance, or branch and merge decisions. Runs the Fase Zero situational-awareness battery, picks one of five delivery flows via the adaptive decision engine, and enforces commit/PR information-density standards. Orchestrates the gh, git-workflows, github-actions, pr, and debug/finish skills.

★ 0
Leostruka
Leostruka/devin-bundle

adaptive-agenda-calendar-routine-engine

Use when planning or executing work across hours, days, weeks, or sprints. Turns the calendar into a strict time-blocked agenda (HH:MM-HH:MM blocks carrying a routine profile, expected inputs, and a handoff output artifact), runs the 5-stage cognitive flow (Radar and Hunt -> Triage plus Steve Jobs conception -> workbench manifest -> >=32-cycle loop -> Close plus Open-Minded Scrum), and unfolds macro calendar milestones into micro agenda blocks through extensions/gcal/wrapper.py.

★ 0
Leostruka
Leostruka/devin-bundle

demo

Use when demonstrating a skill in a fixture project.

★ 0
Leostruka
Leostruka/devin-bundle

duplicate-skill

Use when testing duplicate skill name detection.

★ 0
Leostruka
Leostruka/devin-bundle

duplicate-skill

Use when testing duplicate skill name detection.

★ 0