Python Rules
softspark/ai-toolkit
Python coding rules: style, patterns, security, testing. An agent skill from softspark/ai-toolkit.
Python development principles and decision-making. An agent skill from xenitV1/Antigravity-Workflows.
$ npx skills add xenitV1/Antigravity-Workflows --skill python-patterns -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install xenitV1/Antigravity-Workflows python-patterns --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/xenitV1/Antigravity-Workflows.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/python-patterns .claude/skills/python-patterns && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "python-patterns" agent skill from https://github.com/xenitV1/Antigravity-Workflows/tree/main/skills/python-patterns into .claude/skills/python-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-patterns", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/xenitV1/Antigravity-Workflows/tree/main/skills/python-patternsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add xenitV1/Antigravity-Workflows --skill python-patterns -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install xenitV1/Antigravity-Workflows python-patterns --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xenitV1/Antigravity-Workflows.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/python-patterns .agents/skills/python-patterns && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "python-patterns" agent skill from https://github.com/xenitV1/Antigravity-Workflows/tree/main/skills/python-patterns into .agents/skills/python-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-patterns", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add xenitV1/Antigravity-Workflows --skill python-patterns -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install xenitV1/Antigravity-Workflows python-patterns --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xenitV1/Antigravity-Workflows.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/python-patterns .cursor/skills/python-patterns && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "python-patterns" agent skill from https://github.com/xenitV1/Antigravity-Workflows/tree/main/skills/python-patterns into .cursor/skills/python-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-patterns", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/xenitV1/Antigravity-Workflows.git --path skills/python-patterns--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add xenitV1/Antigravity-Workflows --skill python-patterns -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install xenitV1/Antigravity-Workflows python-patterns --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xenitV1/Antigravity-Workflows.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/python-patterns .gemini/skills/python-patterns && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "python-patterns" agent skill from https://github.com/xenitV1/Antigravity-Workflows/tree/main/skills/python-patterns into .gemini/skills/python-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-patterns", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install xenitV1/Antigravity-Workflows python-patternsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add xenitV1/Antigravity-Workflows --skill python-patterns -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/xenitV1/Antigravity-Workflows.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/python-patterns .github/skills/python-patterns && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "python-patterns" agent skill from https://github.com/xenitV1/Antigravity-Workflows/tree/main/skills/python-patterns into .github/skills/python-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-patterns", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add xenitV1/Antigravity-Workflows --skill python-patterns -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install xenitV1/Antigravity-Workflows python-patterns --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/xenitV1/Antigravity-Workflows.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/python-patterns .opencode/skills/python-patterns && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "python-patterns" agent skill from https://github.com/xenitV1/Antigravity-Workflows/tree/main/skills/python-patterns into .opencode/skills/python-patterns/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-patterns", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
python-patternsPython development principles and decision-making. An agent skill from xenitV1/Antigravity-Workflows.
Python Patterns is an agent skill from xenitV1/Antigravity-Workflows. Python development principles and decision-making. Framework selection, async patterns, type hints, project structure. Teaches thinking, not copying.
Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Backend & APIs, covering Backend development and Type safety. It works with Python, Django, FastAPI and Redis. The licence is MIT.
11 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit f0a1fa7. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadWriteEditGlobGrepFrom allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
fastapiFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Python Patterns loads about 2.2k tokens when it runs. Until then it costs about 41 tokens; SKILL.md has 384 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from xenitV1/Antigravity-Workflows at commit f0a1fa7, republished under its MIT licence (© xenitV1). 384 words, ~2,159 tokens.
.claude/skills/python-patterns/SKILL.md (or your agent's skills folder).Python development principles and decision-making for 2025. Learn to THINK, not memorize patterns.
This skill teaches decision-making principles, not fixed code to copy.
What are you building?
│
├── API-first / Microservices
│ └── FastAPI (async, modern, fast)
│
├── Full-stack web / CMS / Admin
│ └── Django (batteries-included)
│
├── Simple / Script / Learning
│ └── Flask (minimal, flexible)
│
├── AI/ML API serving
│ └── FastAPI (Pydantic, async, uvicorn)
│
└── Background workers
└── Celery + any framework| Factor | FastAPI | Django | Flask |
|---|---|---|---|
| Best for | APIs, microservices | Full-stack, CMS | Simple, learning |
| Async | Native | Django 5.0+ | Via extensions |
| Admin | Manual | Built-in | Via extensions |
| ORM | Choose your own | Django ORM | Choose your own |
| Learning curve | Low | Medium | Low |
async def is better when:
├── I/O-bound operations (database, HTTP, file)
├── Many concurrent connections
├── Real-time features
├── Microservices communication
└── FastAPI/Starlette/Django ASGI
def (sync) is better when:
├── CPU-bound operations
├── Simple scripts
├── Legacy codebase
├── Team unfamiliar with async
└── Blocking libraries (no async version)I/O-bound → async (waiting for external)
CPU-bound → sync + multiprocessing (computing)
Don't:
├── Mix sync and async carelessly
├── Use sync libraries in async code
└── Force async for CPU work| Need | Async Library |
|---|---|
| HTTP client | httpx |
| PostgreSQL | asyncpg |
| Redis | aioredis / redis-py async |
| File I/O | aiofiles |
| Database ORM | SQLAlchemy 2.0 async, Tortoise |
Always type:
├── Function parameters
├── Return types
├── Class attributes
├── Public APIs
Can skip:
├── Local variables (let inference work)
├── One-off scripts
├── Tests (usually)# These are patterns, understand them:
# Optional → might be None
from typing import Optional
def find_user(id: int) -> Optional[User]: ...
# Union → one of multiple types
def process(data: str | dict) -> None: ...
# Generic collections
def get_items() -> list[Item]: ...
def get_mapping() -> dict[str, int]: ...
# Callable
from typing import Callable
def apply(fn: Callable[[int], str]) -> str: ...When to use Pydantic:
├── API request/response models
├── Configuration/settings
├── Data validation
├── Serialization
Benefits:
├── Runtime validation
├── Auto-generated JSON schema
├── Works with FastAPI natively
└── Clear error messagesSmall project / Script:
├── main.py
├── utils.py
└── requirements.txt
Medium API:
├── app/
│ ├── __init__.py
│ ├── main.py
│ ├── models/
│ ├── routes/
│ ├── services/
│ └── schemas/
├── tests/
└── pyproject.toml
Large application:
├── src/
│ └── myapp/
│ ├── core/
│ ├── api/
│ ├── services/
│ ├── models/
│ └── ...
├── tests/
└── pyproject.tomlOrganize by feature or layer:
By layer:
├── routes/ (API endpoints)
├── services/ (business logic)
├── models/ (database models)
├── schemas/ (Pydantic models)
└── dependencies/ (shared deps)
By feature:
├── users/
│ ├── routes.py
│ ├── service.py
│ └── schemas.py
└── products/
└── ...Django supports async:
├── Async views
├── Async middleware
├── Async ORM (limited)
└── ASGI deployment
When to use async in Django:
├── External API calls
├── WebSocket (Channels)
├── High-concurrency views
└── Background task triggeringModel design:
├── Fat models, thin views
├── Use managers for common queries
├── Abstract base classes for shared fields
Views:
├── Class-based for complex CRUD
├── Function-based for simple endpoints
├── Use viewsets with DRF
Queries:
├── select_related() for FKs
├── prefetch_related() for M2M
├── Avoid N+1 queries
└── Use .only() for specific fieldsUse async def when:
├── Using async database drivers
├── Making async HTTP calls
├── I/O-bound operations
└── Want to handle concurrency
Use def when:
├── Blocking operations
├── Sync database drivers
├── CPU-bound work
└── FastAPI runs in threadpool automaticallyUse dependencies for:
├── Database sessions
├── Current user / Auth
├── Configuration
├── Shared resources
Benefits:
├── Testability (mock dependencies)
├── Clean separation
├── Automatic cleanup (yield)# FastAPI + Pydantic are tightly integrated:
# Request validation
@app.post("/users")
async def create(user: UserCreate) -> UserResponse:
# user is already validated
...
# Response serialization
# Return type becomes response schema| Solution | Best For |
|---|---|
| BackgroundTasks | Simple, in-process tasks |
| Celery | Distributed, complex workflows |
| ARQ | Async, Redis-based |
| RQ | Simple Redis queue |
| Dramatiq | Actor-based, simpler than Celery |
FastAPI BackgroundTasks:
├── Quick operations
├── No persistence needed
├── Fire-and-forget
└── Same process
Celery/ARQ:
├── Long-running tasks
├── Need retry logic
├── Distributed workers
├── Persistent queue
└── Complex workflowsIn FastAPI:
├── Create custom exception classes
├── Register exception handlers
├── Return consistent error format
└── Log without exposing internals
Pattern:
├── Raise domain exceptions in services
├── Catch and transform in handlers
└── Client gets clean error responseInclude:
├── Error code (programmatic)
├── Message (human readable)
├── Details (field-level when applicable)
└── NOT stack traces (security)| Type | Purpose | Tools |
|---|---|---|
| Unit | Business logic | pytest |
| Integration | API endpoints | pytest + httpx/TestClient |
| E2E | Full workflows | pytest + DB |
# Use pytest-asyncio for async tests
import pytest
from httpx import AsyncClient
@pytest.mark.asyncio
async def test_endpoint():
async with AsyncClient(app=app, base_url="http://test") as client:
response = await client.get("/users")
assert response.status_code == 200Common fixtures:
├── db_session → Database connection
├── client → Test client
├── authenticated_user → User with token
└── sample_data → Test data setupBefore implementing:
Remember: Python patterns are about decision-making for YOUR specific context. Don't copy code—think about what serves your application best.
© xenitV1, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/python-patterns of xenitV1/Antigravity-Workflows.
Open the folder on GitHubat commit f0a1fa7
We found 22 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 7 other GitHub owners. This page covers the copy in xenitV1/Antigravity-Workflows, which our catalogue first saw on October 7, 2026.
Python Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Python Patterns this skillxenitV1/Antigravity-Workflows | 130 | 7 repos | ~2.2k | Automated safety check: Pass | MIT | |
| Python Rulessoftspark/ai-toolkit | 179 | — | ~2.9k | Automated safety check: Pass | Apache-2.0 | |
| Python Developmentsickn33/agentic-awesome-skills | 47k | 1 repos | ~477 | Automated safety check: Pass | MIT | |
| Python Development Python Scaffoldaiskillstore/marketplace | 430 | 6 repos | ~1.9k | Automated safety check: Pass | None | |
| Python Devdoccker/cc-use-exp | 1.1k | — | ~790 | Automated safety check: Pass | Custom licence | |
| Pythonericrisco/rsc-harness | 156 | — | ~3.8k | Automated safety check: Pass | MIT |
softspark/ai-toolkit
Python coding rules: style, patterns, security, testing. An agent skill from softspark/ai-toolkit.
sickn33/agentic-awesome-skills
You are a Python project architecture expert specializing in scaffolding production-ready Python applications.
aiskillstore/marketplace
You are a Python project architecture expert specializing in scaffolding production-ready Python applications.
doccker/cc-use-exp
Python 开发规范。当用户操作 .py、pyproject.toml、requirements.txt、setup.py 文件, 或涉及 FastAPI、Django、Flask、pytest、asyncio 开发时触发。
ericrisco/rsc-harness
A skill your agent uses when the task is Python itself, in any framework or none: PEP 695 generics, mypy --strict typing, dataclass/Protocol/TypedDict/Enum choices, asyncio.TaskGroup, stdlib idioms…
jiushiwon/wg-skills
后端项目静态分析技能。不运行项目,直接扫描源码,为 Java(Spring Boot/Spring Cloud)、Go(Gin/Echo)、Python(FastAPI/Django/Flask)、Node.js(Express/NestJS) 项目产出 4 份报告:① 接口报告(全部 API 清单:方法/路径/入参/出参/鉴权)② 技术报告(语言/框架版本、中间件如…
xenitV1/Antigravity-Workflows
Native multi-agent orchestration using Claude Code's Agent Tool.
xenitV1/Antigravity-Workflows
Mobile-first design thinking and decision-making for iOS and Android apps.
xenitV1/Antigravity-Workflows
Bash/Linux terminal patterns. An agent skill from xenitV1/Antigravity-Workflows.
xenitV1/Antigravity-Workflows
AI operational modes (brainstorm, implement, debug, review, teach, ship, orchestrate).
xenitV1/Antigravity-Workflows
Structured task planning with clear breakdowns, dependencies, and verification criteria.
xenitV1/Antigravity-Workflows
Internationalization and localization patterns. An agent skill from xenitV1/Antigravity-Workflows.
Categories
Python development principles and decision-making. An agent skill from xenitV1/Antigravity-Workflows. Python Patterns is an agent skill from xenitV1/Antigravity-Workflows. Python development principles and decision-making.
Python Patterns fits situations like: tasks that involve Backend development; tasks that involve Type safety.
Run `npx skills add xenitV1/Antigravity-Workflows --skill python-patterns -a claude-code`. Or copy the skill folder (skills/python-patterns in xenitV1/Antigravity-Workflows) into .claude/skills/python-patterns in your project. Claude Code loads it when a task matches its description.
Run `npx skills add xenitV1/Antigravity-Workflows --skill python-patterns -a codex`. Or copy the skill folder (skills/python-patterns in xenitV1/Antigravity-Workflows) into .agents/skills/python-patterns in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add xenitV1/Antigravity-Workflows --skill python-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/python-patterns, .gemini/skills/python-patterns, .github/skills/python-patterns and .opencode/skills/python-patterns in your project.
Going by SKILL.md and its folder, Python Patterns needs the command-line tools its instructions call (fastapi). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Edit, Glob, Grep.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Python Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.2k tokens (SKILL.md is roughly 8.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Python Patterns: Python Rules (softspark/ai-toolkit, 179 stars), Python Development (sickn33/agentic-awesome-skills, 47k stars), Python Development Python Scaffold (aiskillstore/marketplace, 430 stars) and Python Dev (doccker/cc-use-exp, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
xenitV1 (a GitHub user) maintains it in xenitV1/Antigravity-Workflows, which has 130 GitHub stars. The repository holds 42 skills in this directory. The repository was last updated on January 14, 2026.
Source: xenitV1/Antigravity-Workflows on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.