Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/mrharishkumar/fastapi-cursor-boilerplate/api-design-and-implementationgit clone --depth 1 https://github.com/mrharishkumar/fastapi-cursor-boilerplateWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00434 | $0.00434 |
| Opus 5 | $0.00217 | $0.00217 |
| Sonnet 5 | $0.00087 | $0.00087 |
| Haiku 4.5 | $0.00043 | $0.00043 |
Grade A, and why
api-design-and-implementation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
API Design and Implementation
1. Pydantic Validation
- Use Pydantic models for all incoming request bodies and outgoing responses. This ensures automatic data validation and clear API contracts.
- Use
response_modelto define the schema for successful responses. - Use separate Pydantic schemas for creating, updating, and reading resources (e.g., UserCreate, UserUpdate, UserRead).
2. Router Structure
- Create a single
APIRouterinstance per endpoint file. - Use descriptive prefixes when including routers in the main API router.
- Always include proper HTTP status codes, response models, and documentation.
- Use tags to group related endpoints in the API documentation.
- Include docstrings for all endpoint functions.
- Follow RESTful conventions for endpoint paths and HTTP methods.
3. API Router Aggregation
- Import all endpoint routers in
app/api/v1/api.py. - Use meaningful prefixes that match the feature domain.
- Keep the main API router clean and focused on aggregation only.
- Ensure all routers are properly included with appropriate prefixes.
4. Database Configuration and Connection Management
- Database configuration is stored in
app/core/config.pyusing Pydantic Settings. - Use database connection and session management from
app/db/__init__.py. - Use SQLAlchemy's
create_engine()with connection pooling for production. - Implement proper session lifecycle management with dependency injection.
- Use
get_db()dependency function for database sessions in endpoints. - Use database migrations with Alembic for schema changes.
- Implement proper error handling for database connection failures.
5. Logging Standards
- Use module-based naming:
get_logger(__name__)for general module logging.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 39 lines · 434 tokens per session scan A 7ef2c7ed94fd
api-design-and-implementation is a cursor rule published in the GitHub repository mrharishkumar/fastapi-cursor-boilerplate (3 stars, last pushed 12mo ago), licensed MIT. It adds 434 tokens to every session, about $0.0022 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
project-main-rules
You are an expert in building production-ready AI agent applications using Python, FastAPI, LangGraph, and LangChain.
code-optimization
Guidelines for optimizing duplicate and poorly structured code.
new_features
Guidelines for integrating new features into the Task Master CLI.
utilities
// ✅ DO: Create focused, reusable utilities /.
dev_workflow
Guide for using Taskmaster to manage task-driven development workflows.
mcp
Guidelines for implementing and interacting with the Task Master MCP Server.