Fastapi Agent Rule
FastAPI best practices and patterns for building modern Python web APIs
Structured JSON Schema
Use with automated API pipelines, LangChain, or custom image generators
{
"system_prompt": "# FastAPI Best Practices\n\n## Project Structure\n- Use proper directory structure\n- Implement proper module organization\n- Use proper dependency injection\n- Keep routes organized by domain\n- Implement proper middleware\n- Use proper configuration management\n\n## API Design\n- Use proper HTTP methods\n- Implement proper status codes\n- Use proper request/response models\n- Implement proper validation\n- Use proper error handling\n- Document APIs with OpenAPI\n\n## Models\n- Use Pydantic models\n- Implement proper validation\n- Use proper type hints\n- Keep models organized\n- Use proper inheritance\n- Implement proper serialization\n\n## Database\n- Use proper ORM (SQLAlchemy)\n- Implement proper migrations\n- Use proper connection pooling\n- Implement proper transactions\n- Use proper query optimization\n- Handle database errors properly\n\n## Authentication\n- Implement proper JWT authentication\n- Use proper password hashing\n- Implement proper role-based access\n- Use proper session management\n- Implement proper OAuth2\n- Handle authentication errors properly\n\n## Security\n- Implement proper CORS\n- Use proper rate limiting\n- Implement proper input validation\n- Use proper security headers\n- Handle security errors properly\n- Implement proper logging\n\n## Performance\n- Use proper caching\n- Implement proper async operations\n- Use proper background tasks\n- Implement proper connection pooling\n- Use proper query optimization\n- Monitor performance metrics\n\n## Testing\n- Write proper unit tests\n- Implement proper integration tests\n- Use proper test fixtures\n- Implement proper mocking\n- Test error scenarios\n- Use proper test coverage\n\n## Deployment\n- Use proper Docker configuration\n- Implement proper CI/CD\n- Use proper environment variables\n- Implement proper logging\n- Use proper monitoring\n- Handle deployment errors properly\n\n## Documentation\n- Use proper docstrings\n- Implement proper API documentation\n- Use proper type hints\n- Keep documentation updated\n- Document error scenarios\n- Use proper versioning",
"prompt_type": "agent_rule",
"framework": "cursor",
"globs": "**/*.py, app/**/*.py, api/**/*.py",
"compatible_models": [
"Claude 3.5 Sonnet",
"GPT-4o",
"Cursor AI",
"Gemini 2.5 Flash"
],
"download_filename": "fastapi.cursorrules",
"tags": [
"cursor",
"cursorrules",
"agent",
"coding",
"fastapi"
]
}
Voice Search & FAQs
Natural voice queries and direct answers for Siri, Google Assistant & Perplexity
"What is the best AI Agents prompt for Cursor AI / Claude 3.5?"
The Fastapi Agent Rule blueprint is optimized for Cursor AI / Claude 3.5 to produce high-precision output with verified JSON formatting.
"How do I prompt Cursor AI / Claude 3.5 for Fastapi Agent Rule?"
Use the verified Fastapi Agent Rule prompt from JsonPrompts.in. Copy the prompt or structured JSON blueprint and paste it directly into Cursor AI / Claude 3.5.
"Where can I find free Cursor AI / Claude 3.5 prompt templates for AI Agents?"
JsonPrompts.in offers free verified AI Agents JSON prompt blueprints including Fastapi Agent Rule, with zero sign-up required.