All-in-one Python coding assistant that generates, reviews, refactors, tests, and documents Python code. This skill should be used when users need help writing Python functions/classes, reviewing code for bugs and anti-patterns, refactoring for quality, generating pytest tests, or creating docstrings and documentation. Triggers on: "write python", "review python", "refactor", "generate tests", "add docstrings", "python help", "code quality".
Generate, review, refactor, test, and document Python code with production-grade quality.
Does: Generate Python code from descriptions. Review code for bugs, anti-patterns, type issues. Refactor code for readability and performance. Generate pytest test suites. Create docstrings and documentation. Scaffold modules and packages.
Does NOT: Execute Python code at runtime. Manage virtual environments or dependencies. Deploy applications. Handle non-Python languages.
Gather context to ensure successful implementation:
| Source | Gather |
|--------|--------|
| Codebase | Existing structure, patterns, conventions to integrate with |
| Conversation | User's specific requirements, constraints, preferences |
| Skill References | Domain patterns from references/ (Python best practices, style guides) |
| User Guidelines | Project-specific conventions, team standards |
Ensure all required context is gathered before implementing. Only ask user for THEIR specific requirements (domain expertise is in this skill).
Input: Natural language description of desired functionality.
Workflow:
Output: Complete Python code with type annotations, docstrings, error handling.
Input: Python source code to review.
Checklist:
except: clauses — catch specific exceptionsdef f(x=[])).format() or %pathlib.Path, not string concatenationimport * in non-__init__ moduleswith)Output: Issue list with severity (Critical/Warning/Info), line references, fix suggestions.
Input: Python code + refactoring goal (readability, performance, DRY, typing).
Strategies:
Output: Refactored code + summary of changes with rationale.
Input: Python code to test.
Workflow:
test_<func>_<scenario>)@pytest.fixture for shared setup@pytest.mark.parametrize for input variationsunittest.mockpytest.raisesOutput: Complete pytest file with fixtures, parametrized tests, mocks.
Input: Python code lacking documentation.
Generate:
Output: Documented code with Google-style docstrings.
User request
│
├─ "Write/create/generate [Python]" → Operation 1: Generate
├─ "Review/check/audit [code]" → Operation 2: Review
├─ "Refactor/improve/clean [code]" → Operation 3: Refactor
├─ "Test/add tests [for code]" → Operation 4: Generate Tests
├─ "Document/docstring [code]" → Operation 5: Document
└─ Ambiguous → Ask: "Generate, review, refactor, test, or document?"
except:pathlib.Path for file pathstype: ignore without justificationfrom module import * outside __init__.pyBefore delivering any output:
| File | When to Read |
|------|--------------|
| references/python-patterns.md | Best practices, anti-patterns, style guide details |
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer