agentleFS
manishdashsharmamanishdashsharma/express-backend-skills/skills/api-docs/SKILL.md

api-docs

Skill0 starsChanged 15 days agoMITView on GitHub

Write and maintain Markdown API docs for an Express backend — one api/<module>.md per module plus an api/README.md index with envelope, auth, pagination, scoping, roles and rate-limit conventions — derived from the actual routes, schemas and services. Use when adding or changing routes, when asked to document an API, or when docs drift from code.

20 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use changelog, write-tests and 4 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.
  • HashiCorpSkill

    changelog

    Add a Changie change fragment (`.changes/<major>.x/unreleased/*.yaml`) for a GitHub Pull Request, commit, and push.

    Also in 5 projects that use this

  • SentrySkill

    write-tests

    Write tests following project conventions. Use when adding new tests or modifying existing ones.

    Also in 3 projects that use this

  • MicrosoftSkill

    pr-description

    Draft Nacelle PR titles, pull request descriptions, commit titles, commit descriptions, and squash commit messages. Use when asked for PR or commit wording, a branch summary, or a PR description that can be used in a commit. Omit validation sections from commit bodies and remove filler.

    Also in 3 projects that use this

  • GitHubSkill

    commit-message

    Generate conventional commit messages - use when creating commits, writing commit messages, or asking for git commit help

    Also in 3 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 6 projects that use this

  • BlockSkill

    frontend-design

    Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 19 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Every endpoint lists: who can call it, inputs with limits, the success status and data shape, and every non-obvious error status with when …

    line 77
  2. Distinctive:

    Never put real keys, tokens, emails or customer data in examples.

    line 79
  3. Distinctive:

    Document behaviour a client must know (side effects, idempotency, what gets soft-deleted with it), not implementation details.

    line 80
  4. Distinctive:

    When a route is removed, remove its section.

    line 81

“Common” is measured: kept by at least 6 in 10 of the 19 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 Docs

A route change is not done until its doc is updated in the same change. Docs are read by frontend developers and AI assistants, so they must match the code exactly. If the project already uses OpenAPI/Swagger, update that instead and keep its style.

Source of truth

For each module read: routes/<name>.route.js (paths, methods, middleware order → auth and roles), validations/<name>.schema.js (body/query/params, required, limits, defaults), services/<name>.service.js (returned fields, thrown status codes and messages), and the controller (status code, response key).

api/README.md

# <Project> API

Base URL: `/v1`.

| Module | File | Status |
|---|---|---|
| Health | [health.md](health.md) | live |
| Auth | [auth.md](auth.md) | live |

## Conventions

**Envelope** — `{ "success", "statusCode", "message", "data" }`. Errors: `success: false`, `data: null`.
**Auth** — `Authorization: Bearer <access token>` (15 min). On 401 call `POST /v1/auth/refresh` once, then retry.
**Pagination** — `?page` (default 1), `?limit` (default 20, max 100) → `{ items, pagination: { total, page, limit, hasNextPage } }`.
**Scope** — <how tenancy works>; resources outside your scope return 404.
**Methods** — GET reads, POST everything else. Update = `POST /:id`, delete = `POST /:id/remove`.
**Roles** — <enum values and who counts as admin>.
**Rate limits** — 429 with `RateLimit-*` headers; <tiers>.

api/<module>.md

# Vendors

`/v1/vendors`. All routes require Bearer auth. Scoped to the caller's active store.

The `vendor` object: `{ _id, name, phone, status, createdAt, updatedAt }`.

---

## GET /v1/vendors

Any role. **Query**: `page`, `limit`, `search?` (≤ 100 chars).

**200** → `data`: `{ "items": [ <vendor> ], "pagination": { ... } }`.

---

## POST /v1/vendors

`OWNER` / `MANAGER`.

**Body**: `{ "name", "phone"? }` — `name` 1–100 chars.

**201** → `data`: `{ "vendor": <vendor> }`. **409** phone already used in this store. **403** role not allowed.

---

## POST /v1/vendors/:vendorId/remove

`OWNER` / `MANAGER`. Soft-deletes the vendor.

**200** → `null`. **404** unknown vendor.

Rules

  • Define each object shape once at the top, reference it as <vendor> below.
  • Every endpoint lists: who can call it, inputs with limits, the success status and data shape, and every non-obvious error status with when it happens.
  • Mark optional fields with ?. Write partial updates as "Body (≥ 1): a, b".
  • Never put real keys, tokens, emails or customer data in examples.
  • Document behaviour a client must know (side effects, idempotency, what gets soft-deleted with it), not implementation details.
  • When a route is removed, remove its section; update the README table status.

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.