agentleFS
dosu-aidosu-ai/decant/.claude/skills/api-route-change/SKILL.md

api-route-change

Skill74 starsChanged 9 days agoApache-2.0View on GitHub

Add, remove, or change a route served by `decant serve`, including parameters, limits, status codes, response shapes, and SSE events. Use when editing the route table in src/server/routes.ts, the path manifest in src/route-paths.ts, or anything the UI fetches through src/ui/api.ts.

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
  1. Distinctive:

    Keep core modules print-free: the handler shapes HTTP, while queries and stats stay in their modules.

    line 26
  2. Distinctive:

    No outbound network calls.

    line 30
  3. Distinctive:

    Use a scratch archive and a loopback port:

    line 34

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

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Change a serve API route

AGENTS.md invariant 7: the serve routes are a documented local API. These four move together in one change:

  1. The handler and its entry in the route table (src/server/routes.ts), plus the path manifest in src/route-paths.ts.
  2. docs/api/openapi.yaml, the source contract. /api/openapi.json is its runtime representation, so a missing or stale entry is a user-visible bug.
  3. docs/api/routes.md, the prose guide (access control, archive semantics, SSE events).
  4. Contract tests in test/api-contract.test.ts and test/server-routes.test.ts (which pins the route table to the OpenAPI document), plus behavior tests in the relevant test/server*.test.ts file.

Checks before changing semantics

  • Find every UI caller: grep src/ui/ for the path (views live in src/ui/views/). A new default limit or a narrower response can silently truncate what a page renders.
  • Keep core modules print-free: the handler shapes HTTP, while queries and stats stay in their modules.
  • Non-loopback serving needs explicit trusted peers. Host and Origin checks are defense in depth, not authentication; do not weaken either.
  • No outbound network calls. The only runtime networking is the local server.

Manual smoke

Use a scratch archive and a loopback port:

DECANT_DB=/tmp/decant-api.db bun run src/cli.ts --no-sync serve --no-open --port 43111

Done means bun test, bunx tsc --noEmit, and bunx biome check . pass.

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.