Agent skill
python-style
Apply Python best practices when reviewing or writing code, including PEP 8, type annotations, docstrings, and common anti-patterns to avoid.
Install this agent skill to your Project
npx add-skill https://github.com/weakincentives/weakincentives/tree/main/demo-skills/python-style
SKILL.md
Python Style Skill
Apply Python best practices when reviewing or writing code.
Style Guidelines
- Follow PEP 8 for formatting
- Use type annotations for all public functions (PEP 484)
- Write docstrings for public APIs (PEP 257)
- Prefer f-strings over .format() or % formatting
Common Issues to Flag
- Missing type annotations on public functions
- Mutable default arguments (def foo(items=[]))
- Bare except clauses (except: instead of except Exception:)
- Using assert for validation (stripped in optimized mode)
References
- PEP 8: https://peps.python.org/pep-0008/
- PEP 484: https://peps.python.org/pep-0484/
- PEP 257: https://peps.python.org/pep-0257/
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
code-review
Perform thorough code reviews checking for security vulnerabilities, error handling, test coverage, performance issues, and proper logging.
ascii-art
Generate creative ASCII art for text banners, logos, and decorative elements using various character patterns and styles.
setup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
scaffold-exercises
Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
obsidian-vault
Search, create, and manage notes in the Obsidian vault with wikilinks and index notes. Use when user wants to find, create, or organize notes in Obsidian.
Didn't find tool you were looking for?