agentleFS
patonkikhpatonkikh/APES/skills/architecture/api-designer/skill.md

api-designer

Skill3 starsChanged 4 months agoMITView on GitHub

Design REST or event-based APIs from container architecture: resources, operations, schemas, error model, and versioning strategy. Use when working on solution architecture, C4 diagrams, APIs, ADRs, or system design.

34 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use shopify-expert, monitoring-expert and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • JeffallanSkill

    shopify-expert

    Builds and debugs Shopify themes (.liquid files, theme.json, sections), develops custom Shopify apps (shopify.app.toml, OAuth, webhooks), and implements Storefront API integrations for headless storefronts. Use when building or customizing Shopify themes, creating Hydrogen or custom React storefronts, developing Shopify apps, implementing checkout UI extensions or Shopify Functions, optimizing performance, or integrating third-party services. Invoke for Liquid templating, Storefront API, app development, checkout customization, Shopify Plus features, App Bridge, Polaris, or Shopify CLI workflows.

    Also in 7 projects that use this

  • JeffallanSkill

    monitoring-expert

    Configures monitoring systems, implements structured logging pipelines, creates Prometheus/Grafana dashboards, defines alerting rules, and instruments distributed tracing. Implements Prometheus/Grafana stacks, conducts load testing, performs application profiling, and plans infrastructure capacity. Use when setting up application monitoring, adding observability to services, debugging production issues with logs/metrics/traces, running load tests with k6 or Artillery, profiling CPU/memory bottlenecks, or forecasting capacity needs.

    Also in 9 projects that use this

  • +10 more from Jeffallan

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 33 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use nouns for resources, HTTP verbs for actions.

    line 41
  2. Distinctive:

    Document request/response schemas:

    line 54
  3. Distinctive:

    Use OpenAPI-compatible structure without requiring OpenAPI syntax.

    line 61
  4. Distinctive:

    Follow Richardson Maturity Model Level 2+ for REST.

    line 127
  5. Distinctive:

    Use ISO 8601 for dates, UUID for IDs.

    line 128
  6. Distinctive:

    Document idempotency for POST/PUT where applicable.

    line 129

“Common” is measured: kept by at least 6 in 10 of the 33 edited versions of this file we could read. “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 Designer

Purpose

Design REST or event-based APIs from container architecture: resources, operations, schemas, error model, and versioning strategy.

Input: Container diagram, functional requirements, integration points
Output: API Design document with resource model, endpoint catalog, schema definitions, and error conventions Examples: See examples.md for worked input/output.


Workflow

Step 1: Identify API boundaries

From container diagram, list APIs to design:

  • Public (external consumers)
  • Internal (service-to-service)
  • Partner (B2B integrations)

One API surface per container that exposes HTTP/gRPC/events.

Step 2: Define resource model

Map domain entities to resources:

ResourceDescriptionRelationships

Use nouns for resources, HTTP verbs for actions. Avoid verb-based URLs.

Step 3: Specify operations

For each resource, document:

MethodPathOperationRequestResponseAuth

Include pagination, filtering, sorting for collections.

Step 4: Define schemas

Document request/response schemas:

  • Field names, types, required/optional
  • Validation rules
  • Enum values
  • Idempotency keys where needed

Use OpenAPI-compatible structure without requiring OpenAPI syntax.

Step 5: Design error model

Standard error envelope:

FieldPurpose
codeMachine-readable error code
messageHuman-readable description
detailsField-level errors (optional)
request_idTracing

Map HTTP status codes to error categories.

Step 6: Versioning and compatibility

Define:

  • Versioning strategy (URL path, header, or content negotiation)
  • Breaking vs non-breaking change rules
  • Deprecation policy

Step 7: Validate

Run Validation checklist.


Decision Rules

ConditionAction
No container diagramStop; run container-diagram-builder
RPC-style operations dominateConsider gRPC/event schema alongside REST
Breaking change neededDocument migration path and version bump
Sensitive data in URLMove to request body or header
More than 30 endpoints in MVPPrioritize Must-have FRs; defer Should-have

Validation

  • API boundaries aligned with containers
  • Resource model uses nouns consistently
  • All Must-have FRs traceable to endpoints
  • Error model defined with status code mapping
  • Auth requirement per endpoint
  • Versioning strategy stated
  • Pagination defined for list endpoints
  • No implementation code (framework-specific)

Anti-patterns

  • Chatty APIs — multiple calls where one would suffice.
  • Verb URLs — /getUser, /createOrder.
  • Inconsistent naming — mixing camelCase and snake_case across endpoints.
  • Missing error codes — generic 500 for all failures.
  • Breaking changes without version — modifying existing contracts silently.

Best Practices

  • Follow Richardson Maturity Model Level 2+ for REST.
  • Use ISO 8601 for dates, UUID for IDs.
  • Document idempotency for POST/PUT where applicable.
  • Align with ADRs for protocol choices.
  • Include rate limiting and auth scopes in design.

Output Structure

# API Design: [API Name]

## Overview
- **Base URL:** [pattern]
- **Protocol:** REST | gRPC | Events
- **Version:** v1

## Resources
| Resource | Description |
|----------|-------------|

## Endpoints
| Method | Path | Operation | Auth | FR ref |
|--------|------|-----------|------|--------|

## Schemas
### [ResourceName]
| Field | Type | Required | Validation |
|-------|------|----------|------------|

## Error Model
| HTTP | Code | When |
|------|------|------|

## Versioning
[Strategy and rules]

## Open Questions
- [ ] [Question]

Next Skills

OutcomeRecommended Skill
Plan cross-system integrationarchitecture/integration-planner
Review API securityarchitecture/architecture-review
Document API decisionarchitecture/adr-generator
Analyze data flowsarchitecture/data-flow-analyzer

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.