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/architectural-and-structural-rulesgit clone --depth 1 https://github.com/mrharishkumar/fastapi-cursor-boilerplateWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/mrharishkumar/fastapi-cursor-boilerplate/architectural-and-structural-rules)<a href="https://agentmods.dev/rules/mrharishkumar/fastapi-cursor-boilerplate/architectural-and-structural-rules"><img src="https://agentmods.dev/badge/rules/mrharishkumar/fastapi-cursor-boilerplate/architectural-and-structural-rules.svg" alt="Measured on agentmods" height="20"></a>What 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.00559 | $0.00559 |
| Opus 5 | $0.00280 | $0.00280 |
| Sonnet 5 | $0.00112 | $0.00112 |
| Haiku 4.5 | $0.00056 | $0.00056 |
Grade A, and why
architectural-and-structural-rules 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 4d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Project Architecture & Structure Rules
Project Structure
Core Directory Organization
The project follows a layered architecture with clear separation of concerns:
app/
├── main.py # FastAPI application entry point
├── api/ # API layer
│ └── v1/ # API versioning
│ ├── api.py # Main API router aggregation
│ └── endpoints/ # Individual endpoint modules
├── core/ # Core application configuration
│ └── config.py # Settings and configuration
├── db/ # Database layer
│ └── __init__.py # Database connection and session management
├── models/ # SQLAlchemy database models
├── schemas/ # Pydantic data validation schemas
└── services/ # Business logic layer
Architectural Principles
1. Layered Architecture
- API Layer (
app/api/): Responsible for handling HTTP requests/responses, routing, and input validation. - Service Layer (
app/services/): Contains business logic and orchestration. - Data Layer (
app/models/,app/db/): Manages database models and data access. - Core Layer (
app/core/): Handles configuration, security, and shared utilities.
2. Modular Endpoint Organization
- Each feature/domain should have its own endpoint file in
app/api/v1/endpoints/. - Use descriptive filenames:
users.py,products.py,auth.py. - Each endpoint file must contain a single
APIRouterinstance.
3. Model Organization
- Place SQLAlchemy models in
app/models/. - Use singular names for model files:
user.py,product.py. - Each model should reside in its own file for larger projects.
4. Schema Organization
- Place Pydantic schemas in
app/schemas/. - Use plural names for schema files:
users.py,products.py. - Clearly separate request and response schemas.
5. Business Logic
- Business logic should be placed in
app/services/. - Services must be stateless and focused on single responsibilities.
- Utilize dependency injection for database sessions and other dependencies.
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.
- 4d ago First seen · 65 lines · 559 tokens per session scan A dbd43caeb86e
architectural-and-structural-rules is a cursor rule published in the GitHub repository mrharishkumar/fastapi-cursor-boilerplate (3 stars, last pushed 1y ago), licensed MIT. It adds 559 tokens to every session, about $0.0028 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.
monitoring
Monitoring, observability, and alerting rules.
documentation-standards
Documentation standards for code, APIs, and architecture.
token-efficiency
Token optimization rules to reduce AI costs by 30%+.
performance
Frontend performance optimization rules. Apply when optimizing UI or bundle.