From routic
Use when designing Python API server route module layout where URL paths map strictly to directories and route.py files.
How this skill is triggered — by the user, by Claude, or both
Slash command
/routic:api-server-designThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Design Python API server modules with strict path-based routing: every URL segment maps to one directory, and each routable path owns a local `route.py`.
Design Python API server modules with strict path-based routing: every URL segment maps to one directory, and each routable path owns a local route.py.
Given a routes root such as app/routes, append the normalized URL segments and end with route.py:
/v1/org -> app/routes/v1/org/route.py
/v1/org/{org_id} -> app/routes/v1/org/_param_org_id/route.py
Static path segments keep their URL name as the directory name:
/v1 -> v1/
/org -> org/
Dynamic path parameters use Python package-safe _param_ directory names:
/{org_id} -> _param_org_id/
/{user_id} -> _param_user_id/
The _param_ prefix keeps dynamic segments visually distinct while preserving normal Python imports, static analysis, and package tooling.
Only map path segments. Ignore query strings, fragments, hosts, schemes, HTTP methods, and trailing slashes.
/v1/org and /v1/org/ as the same route module.v1, v2, and internal.{name} to _param_name._param_ prefix.[org_id] in Python projects.route.py./v1/org -> <routes_root>/v1/org/route.py
/v1/org/{org_id} -> <routes_root>/v1/org/_param_org_id/route.py
/v1/org/{org_id}/users -> <routes_root>/v1/org/_param_org_id/users/route.py
/v1/org/{org_id}/users/{id} -> <routes_root>/v1/org/_param_org_id/users/_param_id/route.py
The API definitions for a path live in that path's route.py. For example, a FastAPI route module may look like:
from fastapi import APIRouter
router = APIRouter()
@router.get("")
async def get_org() -> dict:
return {"ok": True}
When showing framework examples, use an empty path ("") inside route.py because the directory path already carries the URL prefix.
This skill only defines path-to-module mapping.
Do not prescribe:
Mention framework code only as an example of what may live inside route.py.
Ask only when needed to implement the next step:
app/routes?route.py modules.npx claudepluginhub allen2c/routic --plugin routicCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.