conventions

conventions is a cursor rule for Cursor from steph-dove/klaussy-agents. It costs 3,060 tokens per session, scanned A, original, MIT.

Repository guidance for a Python project built with FastAPI, a framework for creating web APIs. It documents the project layout, architecture, important modules, and API routes.

In plain words
What is it for?
Use it when exploring the project, locating core modules, understanding dependencies between files, or working on its API endpoints.
Why use it?
It gives an agent the context needed to navigate the codebase and make changes that fit its existing structure.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions CLAUDE.md.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is bash scripts/test.sh.

Good fit Use it when exploring the project, locating core modules, understanding dependencies between files, or working on its API endpoints.

Compare 6 cursor rules from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/steph-dove/klaussy-agents
agentmods
npx agentmods add rules/steph-dove/klaussy-agents/conventions

Made for: Cursor.

Wrote 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.

agentmods badge for conventions

README.md
[![agentmods](https://agentmods.dev/badge/rules/steph-dove/klaussy-agents/conventions.svg)](https://agentmods.dev/rules/steph-dove/klaussy-agents/conventions)
Your own site
<a href="https://agentmods.dev/rules/steph-dove/klaussy-agents/conventions"><img src="https://agentmods.dev/badge/rules/steph-dove/klaussy-agents/conventions.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,060 This file is loaded in full into every session.
When invoked 3,060 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.03060 $0.03060
Opus 5 $0.01530 $0.01530
Sonnet 5 $0.00612 $0.00612
Haiku 4.5 $0.00306 $0.00306

Measured 8d ago against content hash 98433ab7bfc4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

conventions 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 8d 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.

examples/fastapi/.cursor/rules/conventions.mdc · 189 lines

How it starts

The opening of the file, as written. The whole thing — 189 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md - fastapi

Auto-generated by klaussy-repo-conventions. Customize and extend with project-specific context.

Project Overview

python project using fastapi.

FastAPI framework, high performance, easy to learn, fast to code, ready for production

Directory Structure

For the repository directory map and file layout, see .claude/directory-map.md.

Architecture

Core Modules

The most-imported internal modules — the foundation other code builds on.

  • fastapi/exceptions.py — exceptions (12 dependents)
  • fastapi/openapi/models.py — models (8 dependents)
  • fastapi/types.py — types (8 dependents)
  • fastapi/datastructures.py — datastructures (7 dependents)
  • fastapi/utils.py — utils (5 dependents)
  • fastapi/security/base.py — base (5 dependents)

Key Patterns

  • API routes: 29 endpoints (2 DELETE, 16 GET, 2 PATCH, 7 POST, 2 PUT)

API Routes

  • fastapi/applications.py: GET /users/, GET /items/, GET /items/, GET /items/, +4 more
  • fastapi/background.py: POST /send-notification/{email}
  • fastapi/datastructures.py: POST /files/, POST /uploadfile/
  • fastapi/exceptions.py: GET /items/{item_id}
  • fastapi/param_functions.py: GET /items/{item_id}, GET /items/, GET /users/me/items/
  • fastapi/routing.py: GET /users/, GET /items/, PUT /items/{item_id}, POST /items/, +2 more
  • security/api_key.py: GET /items/, GET /items/, GET /items/
  • security/http.py: GET /users/me, GET /users/me, GET /users/me
  • security/oauth2.py: POST /login, POST /login

Narrative: how the pieces fit together

FastAPI is a thin, typed layer on top of Starlette (ASGI toolkit, routing, middleware, responses) and Pydantic v2 (validation/serialization). It does not implement HTTP itself — it builds request handling around Starlette's Router/Route and delegates ASGI serving to Uvicorn (or any ASGI server) at runtime.

  • fastapi/applications.py — the FastAPI class (class FastAPI(Starlette), ~4.7k lines). This is the top-level app object users instantiate; it owns OpenAPI schema generation/caching, exception handler registration, middleware setup, and delegates actual routing to an internal APIRouter.
  • fastapi/routing.py — the biggest module (~6.4k lines). Defines APIRoute and APIRouter. This is where a decorated path operation function becomes an ASGI-callable: get_request_handler() builds the per-route closure that runs on every request, calling solve_dependencies() to resolve the dependency graph, then run_endpoint_function() to invoke the user's function (sync functions are offloaded to a threadpool via run_in_threadpool, async functions are awaited directly).
  • fastapi/dependencies/utils.py + fastapi/dependencies/models.py — the dependency-injection engine. get_dependant() introspects a callable's signature (via inspect + type hints) to build a Dependant tree at route-registration time; solve_dependencies() walks that tree at request time, resolving path/query/header/cookie/body params, sub-dependencies, and security schemes, with results cached per-request via use_cache=True (default) on repeated sub-dependencies.
  • fastapi/params.py / fastapi/param_functions.py — the Path, Query, Header, Cookie, Body, Form, File, Depends, Security marker classes and their public factory functions. These are what a user writes as default values (Annotated[X, Query(...)] style) that get_dependant() later parses back out.
  • fastapi/_compat/ — the Pydantic version-compatibility shim (shared.py has the common helpers, v2.py has Pydantic-v2-specific code). This is the seam between FastAPI's internals and Pydantic's; the package layer is kept separate from callers even though only Pydantic v2 is supported now.
  • fastapi/encoders.pyjsonable_encoder(), used to convert arbitrary Python/Pydantic return values into JSON-safe primitives before Starlette serializes the response.
  • fastapi/openapi/models.py (Pydantic models mirroring the OpenAPI 3.1 spec), utils.py (walks all registered routes to build the schema dict), docs.py (serves Swagger UI / ReDoc HTML at /docs and /redoc).
  • fastapi/security/ — OAuth2/API-key/HTTP-auth helper classes (OAuth2PasswordBearer, HTTPBasic, APIKeyHeader, etc.). Each is itself a callable Depends-compatible class that also injects an OpenAPI securitySchemes entry.
  • fastapi/middleware/ — thin re-exports/wrappers around Starlette middleware (CORS, GZip, TrustedHost, WSGI bridge) plus asyncexitstack.py, which manages the request-scoped AsyncExitStack used to close yield-style dependencies.

Read the full file on GitHub · 189 lines

Changes

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.

  1. 8d ago First seen · 189 lines · 3,060 tokens per session scan A 98433ab7bfc4

Subscribe to this mod's changes

conventions is a cursor rule published in the GitHub repository steph-dove/klaussy-agents (16 stars, last pushed 11d ago), licensed MIT. It adds 3,060 tokens to every session, about $0.0153 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-30.