api-agent

Builds FastAPI endpoints, Pydantic schemas, and PostGIS spatial queries for the LANES backend.

Updated Jun 21, 2026
One-click install
npx skills add https://github.com/pu-roi/LANES --skill api-agent-pu-roi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-agent
Source: https://github.com/pu-roi/LANES/tree/main/.agents/skills/api-agent
Command: npx skills add https://github.com/pu-roi/LANES --skill api-agent-pu-roi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It provides specialized guidance for developing and modifying the LANES backend, ensuring FastAPI endpoints, Pydantic schemas, SQLAlchemy models, and PostGIS spatial queries follow consistent security and architectural standards. ## Core Features & Use Cases - FastAPI Endpoint Development: Build documented REST APIs in app/api/ with thin route handlers and business logic placed in app/services/. - Spatial Query Support: Write optimized PostGIS queries using geoalchemy2 functions like ST_Intersects and ST_DWithin for flood-zone routing logic. - Security Enforcement: Prevent IDOR vulnerabilities by verifying resource ownership through FastAPI dependencies before accessing user data. - Use Case: When adding a new endpoint to submit crowdsourced flood reports, use this Skill to create the Pydantic schema, the route handler with ownership checks, and the service-layer logic while keeping dependencies tracked in requirements.txt. ## Quick Start Ask the agent to create a new FastAPI endpoint with Pydantic validation and PostGIS spatial filtering for flood reports.

Frequently Asked Questions about api-agent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a FastAPI endpoint with Pydantic validation?▼

Define a Pydantic schema for the request and response payloads, then create a route handler in app/api/ that uses the schema as a type-annotated parameter. Keep the handler thin by delegating business logic to app/services/.

How do I write PostGIS spatial queries with SQLAlchemy?▼

Use the geoalchemy2 library with SQLAlchemy to run spatial functions like ST_Intersects and ST_DWithin against geometry columns. These functions filter records based on geographic relationships such as points within flood zones.

How do I prevent IDOR vulnerabilities in FastAPI?▼

Never trust an ID taken directly from a URL path. Use FastAPI dependencies to verify that the authenticated user owns the requested resource before returning or modifying any data.

Can I modify SQLAlchemy models or generate Alembic migrations automatically?▼

No, database schema changes require explicit human developer approval first. After approval, generate migrations with alembic revision --autogenerate and verify they apply cleanly with alembic upgrade head.

What should I do when adding a new Python dependency to the backend?▼

Immediately add the new library to backend/requirements.txt whenever you import it. This prevents broken builds when other developers pull the changes and install dependencies in their own environments.