agentleFS
RoninForgeRoninForge/roninforge-fastapi/skills/fastapi-validate/SKILL.md

fastapi-validate

Skill0 starsChanged 8 months agoMITView on GitHub

Scan a FastAPI project for Pydantic v1 leftovers, async anti-patterns, missing response models, database session issues, and security gaps.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when auditing a FastAPI project for quality, performance, or security issues.

    line 10
  2. Distinctive:

    Check for Pydantic v1 patterns:

    line 14
  3. Distinctive:

    Check for async anti-patterns:

    line 21
  4. Distinctive:

    Check for missing response models:

    line 29
  5. Distinctive:

    Check for database issues:

    line 33
  6. Distinctive:

    Check for security issues:

    line 39
  7. Distinctive:

    Check for deprecated patterns:

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Validate FastAPI Project

When to Use

Use this skill when auditing a FastAPI project for quality, performance, or security issues.

Instructions

  1. Check for Pydantic v1 patterns:
    • .dict(), .json(), .parse_obj(), .parse_raw(), .__fields__
    • @validator, @root_validator
    • class Config: with orm_mode
    • conint, constr, confloat constrained types
    • from pydantic import BaseSettings (moved to pydantic-settings)
  2. Check for async anti-patterns:
    • requests.* in async def endpoints
    • time.sleep() in async def endpoints
    • open() file I/O in async def endpoints
    • Sync database drivers (psycopg2, PyMySQL) with async engine
    • Missing await on async calls
    • CPU-heavy code without run_in_executor
  3. Check for missing response models:
    • Endpoints without response_model parameter
    • Response models that expose sensitive fields (password, hashed_password, secret_key)
  4. Check for database issues:
    • Sessions not using dependency injection (manual creation without cleanup)
    • Missing expire_on_commit=False on async sessions
    • Lazy loading without eager load options (causes N+1 or MissingGreenlet)
    • Missing pool_pre_ping=True on engine
  5. Check for security issues:
    • Hardcoded secrets
    • Missing authentication on protected endpoints
    • CORS with allow_origins=["*"] in production
    • Exception caught and details exposed to client
    • File uploads without size/type validation
    • Missing rate limiting on public endpoints
  6. Check for deprecated patterns:
    • @app.on_event("startup"/"shutdown") (use lifespan)
    • Inline Depends() instead of Annotated
  7. Produce a summary report with issue count, severity, file locations, and fixes.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.