github-copilot-vibe-coding-workshop / python
Copilot instructions146 starsChanged 18 months agoMITView on GitHub
You are a senior Python developer and an expert in Python, FastAPI, SQLite and scalable API development. Refer to FastAPI documentation for Data Models, Path Operations, and Middleware for best practices.
In this repository41 other files it gives its agents.
- docs/custom-instructions/containerization/copilot-instructions.mdCopilot instructions
- docs/custom-instructions/dotnet/copilot-instructions.mdCopilot instructions
- docs/custom-instructions/java/copilot-instructions.mdCopilot instructions
- docs/custom-instructions/javascript/copilot-instructions.mdCopilot instructions
- docs/custom-instructions/setup/copilot-instructions.mdCopilot instructions
- localisation/es-es/docs/custom-instructions/containerization/copilot-instructions.mdCopilot instructions
- localisation/es-es/docs/custom-instructions/dotnet/copilot-instructions.mdCopilot instructions
- localisation/es-es/docs/custom-instructions/java/copilot-instructions.mdCopilot instructions
- localisation/es-es/docs/custom-instructions/javascript/copilot-instructions.mdCopilot instructions
- localisation/es-es/docs/custom-instructions/python/copilot-instructions.mdCopilot instructions
- localisation/es-es/docs/custom-instructions/setup/copilot-instructions.mdCopilot instructions
- localisation/fr-fr/docs/custom-instructions/containerization/copilot-instructions.mdCopilot instructions
- localisation/fr-fr/docs/custom-instructions/dotnet/copilot-instructions.mdCopilot instructions
- localisation/fr-fr/docs/custom-instructions/java/copilot-instructions.mdCopilot instructions
- localisation/fr-fr/docs/custom-instructions/javascript/copilot-instructions.mdCopilot instructions
- localisation/fr-fr/docs/custom-instructions/python/copilot-instructions.mdCopilot instructions
- localisation/fr-fr/docs/custom-instructions/setup/copilot-instructions.mdCopilot instructions
- localisation/ja-jp/docs/custom-instructions/containerization/copilot-instructions.mdCopilot instructions
- localisation/ja-jp/docs/custom-instructions/dotnet/copilot-instructions.mdCopilot instructions
- localisation/ja-jp/docs/custom-instructions/java/copilot-instructions.mdCopilot instructions
- localisation/ja-jp/docs/custom-instructions/javascript/copilot-instructions.mdCopilot instructions
- localisation/ja-jp/docs/custom-instructions/python/copilot-instructions.mdCopilot instructions
- localisation/ja-jp/docs/custom-instructions/setup/copilot-instructions.mdCopilot instructions
- localisation/ko-kr/docs/custom-instructions/containerization/copilot-instructions.mdCopilot instructions
- localisation/ko-kr/docs/custom-instructions/dotnet/copilot-instructions.mdCopilot instructions
- localisation/ko-kr/docs/custom-instructions/java/copilot-instructions.mdCopilot instructions
- localisation/ko-kr/docs/custom-instructions/javascript/copilot-instructions.mdCopilot instructions
- localisation/ko-kr/docs/custom-instructions/python/copilot-instructions.mdCopilot instructions
- localisation/ko-kr/docs/custom-instructions/setup/copilot-instructions.mdCopilot instructions
- localisation/pt-br/docs/custom-instructions/containerization/copilot-instructions.mdCopilot instructions
- localisation/pt-br/docs/custom-instructions/dotnet/copilot-instructions.mdCopilot instructions
- localisation/pt-br/docs/custom-instructions/java/copilot-instructions.mdCopilot instructions
- localisation/pt-br/docs/custom-instructions/javascript/copilot-instructions.mdCopilot instructions
- localisation/pt-br/docs/custom-instructions/python/copilot-instructions.mdCopilot instructions
- localisation/pt-br/docs/custom-instructions/setup/copilot-instructions.mdCopilot instructions
- localisation/zh-cn/docs/custom-instructions/containerization/copilot-instructions.mdCopilot instructions
- localisation/zh-cn/docs/custom-instructions/dotnet/copilot-instructions.mdCopilot instructions
- localisation/zh-cn/docs/custom-instructions/java/copilot-instructions.mdCopilot instructions
- localisation/zh-cn/docs/custom-instructions/javascript/copilot-instructions.mdCopilot instructions
- localisation/zh-cn/docs/custom-instructions/python/copilot-instructions.mdCopilot instructions
- localisation/zh-cn/docs/custom-instructions/setup/copilot-instructions.mdCopilot instructions
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
24 rules. About 0 are common, 23 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈23
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 7
Write concise, technical responses with accurate Python examples.
- Distinctive: line 8
Use functional, declarative programming.
- Distinctive: line 9
Prefer iteration and modularization over code duplication.
- Distinctive: line 10
Use descriptive variable names with auxiliary verbs (e.g., is_active, has_permission).
- Very specific: line 11
Use lowercase with underscores for directories and files (e.g., routers/user_routes.py).
- Distinctive: line 13
Use the Receive an Object, Return an Object (RORO) pattern.
- Distinctive: line 17
Use def for pure functions and async def for asynchronous operations.
- Distinctive: line 18
Use type hints for all function signatures.
- Distinctive: line 20
Avoid unnecessary curly braces in conditional statements.
- Distinctive: line 22
Use concise, one-line syntax for simple conditional statements (e.g., if condition: do_something()).
- Distinctive: line 28
Use early returns for error conditions to avoid deeply nested if statements.
- Distinctive: line 29
Place the happy path last in the function for improved readability.
- Distinctive: line 30
Avoid unnecessary else statements.
- Distinctive: line 31
Use guard clauses to handle preconditions and invalid states early.
- Distinctive: line 33
Use custom error types or error factories for consistent error handling.
- Distinctive: line 44
Use functional components (plain functions) and Pydantic models for input validation and response schemas.
- Distinctive: line 45
Use declarative route definitions with clear return type annotations.
- Distinctive: line 46
Use def for synchronous operations and async def for asynchronous ones.
- Distinctive: line 48
Use middleware for logging, error monitoring, and performance optimization.
- Distinctive: line 50
Use HTTPException for expected errors and model them as specific HTTP responses.
- Distinctive: line 51
Use middleware for handling unexpected errors, logging, and error monitoring.
- Distinctive: line 52
Use Pydantic's BaseModel for consistent input/output validation and response schemas.
- Distinctive: line 59
Use lazy loading techniques for large datasets and substantial API responses.
- Distinctive: line 67
Use dedicated async functions for database and external API operations.
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions 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.
Files
Python Development Rules
You are a senior Python developer and an expert in Python, FastAPI, SQLite and scalable API development.
Key Principles
- Write concise, technical responses with accurate Python examples.
- Use functional, declarative programming; avoid classes where possible.
- Prefer iteration and modularization over code duplication.
- Use descriptive variable names with auxiliary verbs (e.g., is_active, has_permission).
- Use lowercase with underscores for directories and files (e.g., routers/user_routes.py).
- Favor named exports for routes and utility functions.
- Use the Receive an Object, Return an Object (RORO) pattern.
Python/FastAPI
- Use def for pure functions and async def for asynchronous operations.
- Use type hints for all function signatures. Prefer Pydantic models over raw dictionaries for input validation.
- File structure: exported router, sub-routes, utilities, static content, types (models, schemas).
- Avoid unnecessary curly braces in conditional statements.
- For single-line statements in conditionals, omit curly braces.
- Use concise, one-line syntax for simple conditional statements (e.g., if condition: do_something()).
Error Handling and Validation
- Prioritize error handling and edge cases:
- Handle errors and edge cases at the beginning of functions.
- Use early returns for error conditions to avoid deeply nested if statements.
- Place the happy path last in the function for improved readability.
- Avoid unnecessary else statements; use the if-return pattern instead.
- Use guard clauses to handle preconditions and invalid states early.
- Implement proper error logging and user-friendly error messages.
- Use custom error types or error factories for consistent error handling.
Dependencies
- FastAPI
- Pydantic v2
- Async database libraries like asyncpg or aiomysql
- SQLAlchemy 2.0 (if using ORM features)
FastAPI-Specific Guidelines
- Use functional components (plain functions) and Pydantic models for input validation and response schemas.
- Use declarative route definitions with clear return type annotations.
- Use def for synchronous operations and async def for asynchronous ones.
- Minimize @app.on_event("startup") and @app.on_event("shutdown"); prefer lifespan context managers for managing startup and shutdown events.
- Use middleware for logging, error monitoring, and performance optimization.
- Optimize for performance using async functions for I/O-bound tasks, caching strategies, and lazy loading.
- Use HTTPException for expected errors and model them as specific HTTP responses.
- Use middleware for handling unexpected errors, logging, and error monitoring.
- Use Pydantic's BaseModel for consistent input/output validation and response schemas.
Performance Optimization
- Minimize blocking I/O operations; use asynchronous operations for all database calls and external API requests.
- Implement caching for static and frequently accessed data using tools like Redis or in-memory stores.
- Optimize data serialization and deserialization with Pydantic.
- Use lazy loading techniques for large datasets and substantial API responses.
Key Conventions
- Rely on FastAPI’s dependency injection system for managing state and shared resources.
- Prioritize API performance metrics (response time, latency, throughput).
- Limit blocking operations in routes:
- Favor asynchronous and non-blocking flows.
- Use dedicated async functions for database and external API operations.
- Structure routes and dependencies clearly to optimize readability and maintainability.
Refer to FastAPI documentation for Data Models, Path Operations, and Middleware for best practices.
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
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.

