flow-api
Skill1 starsChanged 46 days agoMITView on GitHub
API and interface contract design for HTTP, RPC, events, SDKs or module boundaries. Use when adding or changing an endpoint, schema, error model or public interface. Hands off to `flow-plan` or `flow-work`.
In this repository38 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llms.txtllms.txt
- flow-a11ySkill
- flow-adversarial-reviewSkill
- flow-animateSkill
- flow-benchmarkSkill
- flow-brainstormSkill
- flow-commitSkill
- flow-data-migrateSkill
- flow-depsSkill
- flow-designSkill
- flow-diagnoseSkill
- flow-docsSkill
- flow-git-fixSkill
- flow-handoffSkill
- flow-migrateSkill
- flow-observeSkill
- flow-onboardSkill
- flow-orchestrateSkill
- flow-planSkill
- flow-pr-fixSkill
- flow-prototypeSkill
- flow-prune-agent-setupSkill
- flow-redesignSkill
- flow-refactorSkill
- flow-releaseSkill
- flow-repo-briefSkill
- flow-reviewSkill
- flow-shipSkill
- flow-simplifySkill
- flow-specializeSkill
- flow-stylesSkill
- flow-testSkill
- flow-triageSkill
- flow-uiSkill
- flow-verifySkill
- flow-workSkill
- flow-write-skillSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
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
- Distinctive: line 17
Read existing APIs, style guides, schemas and generated clients in the repository.
- Distinctive: line 20
Write two or three real consumer calls first: the request, the response they need, and what they do on failure.
- Distinctive: line 67
Every change is classified, with a migration path for anything breaking.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
API design
Design the contract from the consumer's side, write it down in a machine-checkable form, and make every change's compatibility explicit. Implementation follows the contract, not the reverse.
Phase 1: Know the consumers
- Identify each consumer (browser, mobile client, partner, internal service, library user), how they deploy, and how long old clients stay in the wild. That sets the compatibility budget.
- Read existing APIs, style guides, schemas and generated clients in the repository. Follow the house conventions for naming, casing, pagination, errors and auth even where you would choose differently.
- Write two or three real consumer calls first: the request, the response they need, and what they do on failure.
Phase 2: Shape the contract
- Model: resources or operations named from the domain, not the database. Small, composable operations over one endpoint with many modes.
- Inputs: validate at the boundary, reject unknown or malformed input with a specific error, and document limits (sizes, ranges, rate).
- Errors: one error shape across the surface, with a stable machine-readable code, a human message and the field at fault. Distinguish client errors, conflicts, auth failures and retryable server failures.
- Collections: pagination (keyset or opaque-token for changing data), filtering and sorting with defaults and maximums from day one.
- Writes: idempotency keys or naturally idempotent operations for anything a client may retry; optimistic concurrency where lost updates matter.
- Security: authentication, authorization per resource, and no internal identifiers, stack traces or secrets in responses.
- Async and events: name events in past tense, include a version and an idempotent consumer story, and state ordering and delivery guarantees honestly.
Phase 3: Write it down
Capture the contract in the repository's schema format (for example OpenAPI, a protocol schema, GraphQL SDL, JSON Schema or exported types) with examples for success and each error class. Lint and validate it with the project's tooling, and generate clients or types from it when the repository does.
Phase 4: Check compatibility
- Classify each change: additive (new optional field, new endpoint), behavioral (same shape, new meaning) or breaking (removed or renamed field, new required input, changed type or error).
- Breaking changes need a version, a deprecation window, or an expand, migrate and contract sequence. Behavioral changes are breaking for consumers who depend on them.
- Diff the schema against the published version when tooling allows, and add contract tests that a consumer would notice failing.
Anti-patterns
- Exposing database tables or internal types directly as the public contract.
- Different error shapes per endpoint, or success status codes carrying failures.
- Unbounded list endpoints, or retries that create duplicates.
- Silent breaking changes because "no one uses that field".
Done when
- Consumer calls, the schema and examples agree, and the schema validates.
- Every change is classified, with a migration path for anything breaking.
- Errors, limits, pagination, idempotency and auth are specified, not implied.
Break the implementation into tasks with flow-plan, or build a small contract with flow-work.
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
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.

