agentleFS
ossamanahleossamanahle/claude-code-wizard/skills/api-scaffolder/SKILL.md

api-scaffolder

Skill4 starsChanged 8 months agoMITView on GitHub

Scaffold REST API endpoints following project conventions. Use when creating new routes, controllers, or CRUD endpoints in an Express/Node.js project.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. Algovate/agent-skills-deep-dive★ 4same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repositoryOne other file it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    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:

    When this skill is active, you are a senior API developer scaffolding endpoints that follow this project's conventions exactly.

    line 8
  2. Very specific:

    Every endpoint lives at src/api/routes/<resource>/<action>.ts and exports a single route handler:

    line 13
  3. Very specific:

    Use Zod schemas in a sibling schemas.ts file

    line 35
  4. Distinctive:

    Every input field must have a schema — no unvalidated request bodies

    line 36
  5. Distinctive:

    All errors follow this shape:

    line 40
  6. Very specific:

    Every route gets a test at src/api/tests/<resource>/<action>.test.ts:

    line 54
  7. Distinctive:

    Always generate the route handler, the Zod schema, and the test file together — never one without the others

    line 65
  8. Very specific:

    Use the project's existing database client (src/db/client.ts) — do not create new connections

    line 67
  9. Distinctive:

    Do not modify existing route files — only create new ones

    line 79
  10. Distinctive:

    Do not change the database schema or run migrations

    line 80
  11. Distinctive:

    Do not install new dependencies without asking first

    line 81
  12. Very specific:

    Do not create middleware — use existing middleware from src/api/middleware/

    line 82
  13. Distinctive:

    Do not scaffold more endpoints than requested

    line 83

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

When this skill is active, you are a senior API developer scaffolding endpoints that follow this project's conventions exactly.

Conventions

Route file structure

Every endpoint lives at src/api/routes/<resource>/<action>.ts and exports a single route handler:

import { Router } from 'express';
import { validate } from '../../middleware/validate';
import { <Resource>Schema } from './schemas';

const router = Router();

router.<method>('/', validate(<Resource>Schema), async (req, res, next) => {
  try {
    // handler logic
    res.status(<code>).json({ data: result });
  } catch (err) {
    next(err);
  }
});

export default router;

Validation

  • Use Zod schemas in a sibling schemas.ts file
  • Every input field must have a schema — no unvalidated request bodies
  • Return 400 with { error: { code: "VALIDATION_ERROR", details: [...] } } on failure

Error response format

All errors follow this shape:

{
  "error": {
    "code": "RESOURCE_NOT_FOUND",
    "message": "User with id 42 not found",
    "details": []
  }
}

Standard codes: VALIDATION_ERROR, RESOURCE_NOT_FOUND, DUPLICATE_RESOURCE, UNAUTHORIZED, INTERNAL_ERROR.

Test file structure

Every route gets a test at src/api/tests/<resource>/<action>.test.ts:

  • At least 1 happy-path test
  • At least 1 validation-failure test (400)
  • At least 1 not-found test (404) for read/update/delete operations

Naming conventions

  • Resource names: singular, lowercase (user, order, product)
  • File names: create.ts, read.ts, update.ts, delete.ts, list.ts
  • Schema names: Create<Resource>Schema, Update<Resource>Schema, <Resource>Params

Rules

  • Always generate the route handler, the Zod schema, and the test file together — never one without the others
  • Register the new route in src/api/routes/index.ts
  • Use the project's existing database client (src/db/client.ts) — do not create new connections
  • Wrap all async handlers in try/catch with next(err) — never let promises reject silently
  • Return 201 for successful creates, 200 for reads/updates, 204 for deletes

Output Format

For each endpoint scaffolded, report:

  • Files created (with full paths)
  • Route registered at (method + path)
  • Schema fields defined
  • Tests generated (count and names)

What to Avoid

  • Do not modify existing route files — only create new ones
  • Do not change the database schema or run migrations
  • Do not install new dependencies without asking first
  • Do not create middleware — use existing middleware from src/api/middleware/
  • Do not scaffold more endpoints than requested

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.