RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/TechSquidTV/Hermes

Cursor rule

.cursor/rules/10-hermes-api.mdc
Cursor rules

Quality

100/100

Scores the file, not the repository.

Length

457 words

16 headings · 2 code blocks

Repository

45

— · pushed 2 days ago

Last changed

3 days ago

First indexed 3 days ago.
TechSquidTV/Hermes/.cursor/rules/10-hermes-api.mdcRawGitHub
1---
2globs:
3 - "packages/hermes-api/**/*.py"
4---
5 
6# Hermes API - Python/FastAPI Rules
7 
8## Python Version
9- Target Python 3.11+
10- Use modern Python features (match/case, type hints, etc.)
11 
12## Code Style
13 
14### Formatting (Black)
15- Line length: 88 characters (configured in `pyproject.toml`)
16- Let Black handle formatting automatically
17- Run: `black .` before committing
18 
19### Import Ordering (isort)
20- Profile: black (configured in `pyproject.toml`)
21- Order: standard library, third-party, local imports
22- Run: `isort .` before committing
23 
24### Type Hints (mypy)
25- All functions must have type hints for parameters and return values
26- Use `typing` module for complex types
27- Comply with mypy strict mode settings in `pyproject.toml`
28- Run: `mypy app` to check types
29 
30## FastAPI Patterns
31 
32### Async/Await
33- Use `async def` for all endpoint handlers
34- Use `await` for database operations and external API calls
35- Import `AsyncSession` for database operations
36 
37### Dependencies
38- Use FastAPI's dependency injection system
39- Define dependencies in `app/api/dependencies.py`
40- Common dependencies:
41 - `get_database_session()` - Database session
42 - `get_current_user_from_token()` - Authenticated user
43 - `get_current_user_optional()` - Optional authentication
44 
45### Error Handling
46- Use `HTTPException` for API errors
47- Include appropriate status codes from `fastapi.status`
48- Provide clear error messages in `detail` field
49- Log errors using structured logging
50 
51### Request/Response Models
52- Define Pydantic models in `app/models/pydantic/`
53- Use type validation and serialization
54- Include field descriptions for API documentation
55- Separate request models from response models
56 
57## Project Structure
58 
59```
60app/
61├── api/ # API routes and endpoints
62│ ├── dependencies.py
63│ └── v1/
64│ ├── endpoints/ # Individual endpoint files
65│ └── router.py # Route registration
66├── core/ # Core configuration
67│ ├── config.py # Settings and configuration
68│ ├── logging.py # Logging setup
69│ └── security.py # Auth/security utilities
70├── db/ # Database layer
71│ ├── base.py # Base model
72│ ├── models.py # SQLAlchemy models
73│ ├── repositories.py # Repository pattern
74│ └── session.py # DB session management
75├── models/ # Data models
76│ └── pydantic/ # Pydantic models
77├── services/ # Business logic
78├── tasks/ # Celery tasks
79└── utils/ # Utility functions
80```
81 
82## Logging
83 
84Use structured logging via `structlog`:
85```python
86from app.core.logging import get_logger
87 
88logger = get_logger(__name__)
89logger.info("Operation completed", user_id=user_id, action="download")
90logger.error("Operation failed", error=str(e), error_type=type(e).__name__)
91```
92 
93## Configuration
94 
95- Use `pydantic-settings` for configuration management
96- Access settings via `app.core.config.settings`
97- Environment variables override default values
98- Never hardcode configuration values
99 
100## Testing
101 
102- Write tests in `tests/` directory
103- Use pytest with async support (`pytest-asyncio`)
104- Follow naming: `test_*.py` for files, `test_*` for functions
105- Use markers: `@pytest.mark.unit`, `@pytest.mark.integration`, `@pytest.mark.slow`
106- Run: `pytest` or `python -m pytest`
107 
108## Dependencies
109 
110Manage dependencies with UV (following `pyproject.toml`):
111- Production dependencies in `[project.dependencies]`
112- Development dependencies in `[dependency-groups.dev]`
113- Pin versions for stability
114- Run: `uv pip compile` to update `uv.lock`
115 

Commands it names

  • black .
  • mypy app
  • pytest-asyncio
  • pytest
  • python -m pytest
  • uv pip compile
  • uv.lock

Sections

  • Hermes API - Python/FastAPI Rules
  • Python Version
  • Code Style
  • Formatting (Black)
  • Import Ordering (isort)
  • Type Hints (mypy)
  • FastAPI Patterns
  • Async/Await
  • Dependencies
  • Error Handling
  • Request/Response Models
  • Project Structure
  • Logging
  • Configuration
  • Testing
  • Dependencies

What it covers

testlint-formatcode-stylearchitecturetypesdependenciesapideploymentdo-not

Stack — with the evidence

typescript

(1.00)

pytest

(0.95)

node

(0.70)

react

(0.70)

fastapi

(0.70)

redis

(0.70)

tailwind

(0.70)

vite

(0.70)

vitest

(0.70)

eslint

(0.70)

ruff

(0.70)

javascript

(0.60)

monorepo

(0.60)

pnpm

(0.60)

docker

(0.60)

github-actions

(0.60)

python

(0.50)

Glob targeting

  • packages/hermes-api/**/*.py

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
TechSquidTV
Language
—
License
—
Archived
no

All configs in this repo

Also in TechSquidTV/Hermes

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
TechSquidTV/Hermes.cursor/rules/00-project.mdc · 45Cursor rulestypescriptmonorepo+15setuplint-formatstylearch+489/1003 days ago
TechSquidTV/Hermes.cursor/rules/10-hermes-app.mdc · 45Cursor rulestypescriptnode+15lint-formatstylearchtypes+588/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-api.mdc · 45Cursor rulestypescriptnode+15stylearchdependenciesapi+277/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-db.mdc · 45Cursor rulestypescriptnode+15teststylearchtesting-strategy+373/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-app-components.mdc · 45Cursor rulestypescriptnode+15archtypesuiperformance+165/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-app-hooks.mdc · 45Cursor rulestypescriptnode+15lint-formatstylearchtypes+373/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-app-routes.mdc · 45Cursor rulestypescriptnode+15archapiuido-not65/1003 days ago
TechSquidTV/Hermes.cursor/rules/30-docker.mdc · 45Cursor rulestypescriptnode+15setupbuildstylesecurity+484/1003 days ago
TechSquidTV/Hermes.cursor/rules/30-docs.mdc · 45Cursor rulestypescriptnode+15setuplint-formatstylearch+381/1003 days ago
TechSquidTV/Hermes.cursor/rules/30-tests.mdc · 45Cursor rulestypescriptpytest+15buildteststylearch+485/1003 days ago
Diff against .cursor/rules/00-project.mdc Diff against .cursor/rules/10-hermes-app.mdc Diff against .cursor/rules/20-hermes-api-api.mdc Diff against .cursor/rules/20-hermes-api-db.mdc Diff against .cursor/rules/20-hermes-api-tests.mdc Diff against .cursor/rules/20-hermes-app-components.mdc Diff against .cursor/rules/20-hermes-app-hooks.mdc Diff against .cursor/rules/20-hermes-app-routes.mdc Diff against .cursor/rules/30-docker.mdc Diff against .cursor/rules/30-docs.mdc Diff against .cursor/rules/30-tests.mdc

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
skillrecordings/egghead-next.cursor/rules/gh-task-plan.mdc · 1.4kCursor rulestypescriptnode+14teststylearchtypes+296/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack