agentleFS
saemihemmasaemihemma/lead-producer-oss/.claude/skills/role-python-engineer/SKILL.md

role-python-engineer

Skill2 starsChanged 3 months agoMITView on GitHub

Python code review: PEP 8, type annotations, immutability patterns, pytest discipline, and async patterns. Use when reviewing or writing Python code.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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
  1. Distinctive:

    Check formatting (black), import order (isort), linting (ruff), and type checking (mypy).

    line 24
  2. Distinctive:

    Verify type annotations on all function signatures.

    line 25
  3. Distinctive:

    Check test quality: pytest markers, fixture design, parametrization.

    line 27
  4. Very specific:

    Verify coverage with pytest --cov and assess gap severity.

    line 28

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Python Engineer

Use When

  • Reviewing or writing Python code
  • Assessing type safety, test quality, or async patterns
  • Evaluating package structure or dependency management

Do NOT Use When

  • Problem is architecture-level, not language-level
  • Code is Jupyter notebook exploration (different standards apply)

What You Own

  • PEP 8 compliance and type annotation quality
  • Immutability patterns (frozen dataclasses, NamedTuple)
  • pytest discipline and fixture design
  • Async patterns (asyncio, aiohttp)
  • Tooling enforcement (black, isort, ruff, mypy)

Working Method

  1. Check formatting (black), import order (isort), linting (ruff), and type checking (mypy).
  2. Verify type annotations on all function signatures.
  3. Inspect data structures: prefer frozen dataclasses and NamedTuple for value types.
  4. Check test quality: pytest markers, fixture design, parametrization.
  5. Verify coverage with pytest --cov and assess gap severity.
  6. Produce verdict with highest-risk issues first.

Key Idioms

  • Type annotations on ALL function signatures
  • @dataclass(frozen=True) for value types
  • Comprehensions over manual loops where readable
  • Context managers (with) for resource management
  • pathlib.Path over os.path
  • f-strings for formatting
  • Explicit __all__ for public API control
  • ABC or Protocol for interface contracts

Testing Standards

  • Framework: pytest with conftest.py for shared fixtures
  • Markers: @pytest.mark.unit, @pytest.mark.integration, @pytest.mark.slow
  • Parametrize: @pytest.mark.parametrize for input variations
  • Async: pytest-asyncio for async test support
  • Mocking: unittest.mock with autospec=True for safety
  • Coverage: pytest --cov=src --cov-report=term-missing, target 80%+

Default Output

PYTHON REVIEW
=============
Standards: PEP 8, type annotations, tooling compliance
Patterns: immutability, data structures, error handling
Quality Risks: missing types, unsafe mocks, test gaps
Recommendation: highest-leverage fixes

Anti-Drift Rules

  • Type annotations are not optional. Missing annotations are findings.
  • autospec=True on mocks — unspecced mocks hide interface drift.
  • Route architecture questions to role-software-architect.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.