agentleFS
mmccallammccalla/coding-agent-skill-library/skills/api-design-and-lifecycle/SKILL.md

api-design-and-lifecycle

Skill4 starsChanged 5 months agoApache-2.0View on GitHub

Designs HTTP/service APIs with OpenAPI, resource models, authZ, versioning, deprecation and contract tests. Use when defining or evolving service APIs, not dataset or event contracts.

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 7 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when designing, reviewing or evolving application or service APIs: resource models, request/response schemas, authentication …

    line 15
  2. Very specific:

    Use data-contract-design for producer–consumer agreements on datasets, tables, files or data products (quality, freshness, semantics).

    line 19
  3. Very specific:

    Use schema-registry-and-contracts for event schemas, compatibility modes and streaming registry governance.

    line 20
  4. Very specific:

    Use message-based-integration-design when the primary style is messaging, brokers or EIP topology rather than a service API.

    line 21
  5. Very specific:

    Use deprecation-and-migration alone when the work is a general migration plan without API resource or OpenAPI design.

    line 22
  6. Distinctive:

    Add contract tests (consumer-driven or provider-side schema/status checks) in CI so breaking changes fail before release.

    line 36
  7. Very specific:

    Do not design dataset or event payloads here.

    line 72
  8. Distinctive:

    Do not rely on client-only authorisation or hidden “admin” query flags.

    line 73
  9. Distinctive:

    Do not break consumers without a versioning or deprecation path.

    line 74
  10. Distinctive:

    Do not treat OpenAPI as optional documentation.

    line 75
  11. Distinctive:

    Do not return stack traces or secrets in error bodies.

    line 76
  12. Distinctive:

    Do not invent fields in production responses that are absent from the published contract.

    line 77

≈ “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

API Design and Lifecycle

When to use

Use this skill when designing, reviewing or evolving application or service APIs: resource models, request/response schemas, authentication and authorisation, versioning, deprecation, OpenAPI specifications and consumer-facing contract tests. Apply it to REST-style and similar request/response service interfaces that agents or clients call.

When not to use

  • Use data-contract-design for producer–consumer agreements on datasets, tables, files or data products (quality, freshness, semantics).
  • Use schema-registry-and-contracts for event schemas, compatibility modes and streaming registry governance.
  • Use message-based-integration-design when the primary style is messaging, brokers or EIP topology rather than a service API.
  • Use deprecation-and-migration alone when the work is a general migration plan without API resource or OpenAPI design.

Objective

Produce a clear, implementable API design and lifecycle plan: resources, operations, authZ, OpenAPI contract, versioning and deprecation rules, and executable contract tests that protect consumers without conflating service APIs with data or event contracts.

Procedure

  1. Clarify consumers, use cases and success criteria. Prefer resource-oriented models over ad-hoc RPC bags of endpoints unless an RPC style is already established.
  2. Define resources, identifiers, relationships, collections, error shapes and idempotency expectations for write operations.
  3. Specify authentication and authorisation per operation: who may call, which scopes or roles apply, and how denial is represented. Enforce authZ server-side.
  4. Author or update an OpenAPI description as the source of truth for paths, methods, parameters, schemas and status codes. Keep examples realistic and non-secret.
  5. Choose a versioning strategy (URI, header or negotiated) and compatibility rules for additive versus breaking changes. Document how clients discover versions.
  6. Define deprecation: announcement, sunset timeline, migration guidance and monitoring of deprecated usage before removal.
  7. Add contract tests (consumer-driven or provider-side schema/status checks) in CI so breaking changes fail before release.
  8. Record operational concerns: rate limits, pagination, correlation IDs, safe error messages and observability hooks.

Required outputs

# API design: <service or capability>

## Consumers and use cases
## Resource model
| Resource | Identifier | Operations | Notes |

## AuthN / AuthZ
| Operation | AuthN | AuthZ rule | Denial behaviour |

## OpenAPI
- Spec path:
- Notable schemas / status codes:

## Versioning and compatibility
- Strategy:
- Breaking-change policy:

## Deprecation
- Announcement:
- Sunset date / criteria:
- Migration path:

## Contract tests
| Test | Consumer / provider | Assertion |

## Risks and open questions

Rules

  • Do not design dataset or event payloads here; route those to data-contract-design or schema-registry-and-contracts.
  • Do not rely on client-only authorisation or hidden “admin” query flags.
  • Do not break consumers without a versioning or deprecation path.
  • Do not treat OpenAPI as optional documentation; keep it aligned with implementation and tests.
  • Do not return stack traces or secrets in error bodies.
  • Do not invent fields in production responses that are absent from the published contract.

Related skills

  • data-contract-design — dataset and data-product contracts
  • schema-registry-and-contracts — event schema registry and compatibility
  • message-based-integration-design — messaging and EIP style selection
  • deprecation-and-migration — broader deprecation and migration discipline

References

Verification

  • Resource model and operations are explicit.
  • AuthN/AuthZ rules are defined per sensitive operation.
  • OpenAPI (or equivalent) contract is identified and kept current.
  • Versioning and deprecation paths are documented.
  • Contract tests are specified for CI.
  • Scope excludes dataset/event contract design unless explicitly linked.

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.