lbedner/aegis-stack/add-api-endpoint
Claude Code and agent skill by lbedner/aegis-stack
- community
Checking that the SKILL.md file is still in the repository.
Use when adding a new HTTP endpoint to this project's FastAPI backend. Covers the router module, request and response schemas, dependency wiring, router registration, the health surface, and the API test.
Install
npx vskill@latest install lbedner/aegis-stack/add-api-endpointSKILL.md
Add API endpoint
Add an HTTP route to the FastAPI backend. Endpoints live under app/components/backend/api/ and are mounted by a single registration file, so a route is not reachable until it is both defined and registered.
When to use
Use when adding or changing an HTTP route the backend serves.
Do NOT use for background work (that is a job, not a request) or for scheduled work. Do NOT hand-add a whole new service or component this way; use the aegis CLI for that.
Files that change
app/components/backend/api/: endpoint modules live here. Add<name>.py
with an APIRouter, or a <name>/router.py package for a group of routes.
app/components/backend/api/routing.py: register the router here (import it
and mount it with app.include_router(...)).
app/components/backend/api/deps.py: shared FastAPI dependencies; add one
here if the endpoint needs a reusable dependency.
app/components/backend/api/health.py: the health surface; wire a check if
the endpoint fronts a new subsystem.
tests/api/: addtest_<name>_endpoints.py.
Procedure
- Write the failing test first in
tests/api/test_<name>_endpoints.py, driving
the route through the test client. Confirm it fails for the right reason (the route does not exist yet).
- Define the request and response schemas as Pydantic or SQLModel classes.
- Create the router module in
app/components/backend/api/with an
APIRouter() and the route handlers as async def.
- Register the router in
app/components/backend/api/routing.py: import it and
call app.include_router(...).
- Add any reusable dependency to
app/components/backend/api/deps.py, and wire
a health check in health.py if the endpoint fronts a new subsystem.
- Run the gates and fix anything red.
Gates
make check: lint, typecheck, and test.
Pitfalls
- A router that is defined but never registered in
routing.pyreturns 404; the
registration step is what makes the route reachable.
- Route handlers are async
def; a blocking call inside one stalls the event
loop and slows every request, so use the async client or run blocking work off the loop.
- Returning a raw dict instead of the declared response model skips validation
and drifts the response from its schema.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingaegis/templates/copier-aegis-project/{{ project_slug }}/.claude/skills/add-api-endpoint/SKILL.md
Popularity
- Repository stars
- 130
- Repository forks
- 10
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/lbedner/aegis-stack/add-api-endpoint)