phenobarbital/antigravity-config/python-standards
Claude Code and agent skill by phenobarbital/antigravity-config
- community
Checking that the SKILL.md file is still in the repository.
Apply Python tooling standards including uv package management, pytest testing, ruff/basedpyright code quality, one-line docstrings, and self-documenting code practices. Use this skill when working with Python backend code, managing dependencies, running tests, or ensuring code quality. Apply when installing packages, writing tests, formatting code, type checking, adding docstrings, organizing imports, or deciding whether to create new files vs. extending existing ones. Use for any Python development task requiring adherence to tooling standards and best practices.
Install
npx vskill@latest install phenobarbital/antigravity-config/python-standardsSKILL.md
Python Standards
Core Rule: Use uv for all package operations, pytest for testing, ruff for formatting/linting. Write self-documenting code with minimal comments.
When to use this skill
- When installing or managing Python packages and dependencies
- When writing or running unit tests, integration tests, or test suites
- When formatting Python code or fixing linting issues
- When adding type hints or running type checking
- When writing function/method docstrings
- When organizing imports in Python files
- When deciding whether to create a new Python file or extend existing ones
- When setting up code quality checks (linting, formatting, type checking)
- When running coverage reports or analyzing test results
- When ensuring code follows Python best practices and tooling standards
Package Management - uv Only
MANDATORY: Use `uv` for all Python package operations. Never use `pip` directly.
Why uv: Faster dependency resolution, better lock file management, project standard for consistency.
If you catch yourself typing `pip`: Stop and use uv pip instead.
Testing with pytest
Run tests using `uv run pytest`:
Test markers: Use @pytest.mark.unit and @pytest.mark.integration to categorize tests.
Code Quality Tools
Ruff (Linting & Formatting):
Type Checking:
Run quality checks before marking work complete. Use getDiagnostics tool to verify no errors.
Code Style
Docstrings
Use concise one-line docstrings for most functions:
Multi-line docstrings only for complex functions:
Don't document obvious behavior:
Comments
Write self-documenting code. Minimize inline comments.
Use clear names instead of comments:
Use comments only for:
- Complex algorithms requiring explanation
- Non-obvious business logic or domain rules
- Explaining why a certain approach was taken
- Definition of arguments and return values
- Workarounds for external library bugs (include issue link)
- Performance optimizations that sacrifice clarity
Import Organization
Order: Standard library → Third-party → Local application
Ruff automatically organizes imports. Run ruff check . --fix to sort.
Remove unused imports immediately. Use getDiagnostics to identify them.
Type Hints
Add type hints to all function signatures:
Use modern type syntax (Python 3.10+):
File Organization
Prefer editing existing files over creating new ones.
Before creating a new Python file, ask:
- Can this fit in an existing module?
- Is there a related file to extend?
- Does this truly need to be separate?
Benefits: Reduces file sprawl, maintains coherent structure, easier navigation.
When to create new files:
- New model/entity with distinct responsibility
- New service layer for separate domain
- Test file for new module
- Clear architectural boundary
Common Patterns
Avoid bare `except`:
Use context managers for resources:
Prefer pathlib over os.path:
Verification Checklist
Before marking Python work complete:
- [ ] Used
uvfor all package operations (notpip) - [ ] All tests pass:
uv run pytest - [ ] Code formatted:
ruff format . - [ ] No linting issues:
ruff check . - [ ] Type checking passes:
basedpyright src - [ ] No unused imports (check with
getDiagnostics) - [ ] Docstrings added to public functions
- [ ] Type hints on function signatures
- [ ] Coverage ≥ 80%:
uv run pytest --cov=src --cov-fail-under=80
Quick Reference
| Task | Command | |
|---|---|---|
| Install package | uv pip install package-name | |
| Run tests | uv run pytest | |
| Run with coverage | uv run pytest --cov=src | |
| Format code | ruff format . | |
| Fix linting | ruff check . --fix | |
| Type check (pyright) | basedpyright src | |
| Run Python script | uv run python script.py |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingbackend/.agent/skills/python-standards/SKILL.md
Popularity
- Repository stars
- 13
- 7-day trend score
- 13
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/phenobarbital/antigravity-config/python-standards)