Python Sensei for Openclaw

A specialized AI coding assistant that enforces strict Python engineering standards, including type safety, async patterns, and modular architecture.

nakedoshadow
v1.1.0
Mar 8, 2026
0
855
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install shadows-python-sensei

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install shadows-python-sensei using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Python Sensei?

Python Sensei is a comprehensive best-practices enforcer designed to elevate the quality of Python source code. It serves as an automated mentor that reviews, refactors, and structures your code according to modern professional standards. By leveraging Openclaw Skills, this tool ensures your modules are maintainable, performant, and correctly tested, focusing on clean code principles like proper import grouping, strict type hinting, and the use of modern libraries like httpx and pathlib.

The skill is particularly effective for teams looking to maintain a high bar for code quality without manual overhead. It identifies anti-patterns such as mutable default arguments or global state and provides immediate, actionable corrections. Whether you are initializing a new project using a standard src-layout or refactoring complex legacy logic into manageable sub-modules, Python Sensei provides the technical guardrails necessary for robust software engineering.

Python Sensei Use Cases

  • Reviewing existing Python code to identify technical debt and architectural anti-patterns.
  • Initializing new Python projects with standardized directory structures and pyproject.toml configurations.
  • Refactoring synchronous I/O blocks into modern, non-blocking asynchronous patterns.
  • Automating the enforcement of type hints and Google/NumPy style docstrings across large codebases.
  • Validating code changes through integrated syntax checking and automated test execution using pytest.

How Python Sensei Works

  1. The skill scans the project environment to identify Python source files and detect installed quality tools like ruff, mypy, or pytest.
  2. It analyzes the codebase against a strict set of rules including module length limits (500 lines) and specific import hierarchies.
  3. It evaluates function signatures to ensure mandatory type hints and keyword-only arguments are used where appropriate.
  4. It identifies anti-patterns and suggests specific refactoring steps with line-by-line code corrections.
  5. It performs local validation by executing syntax checks and running relevant test suites to ensure that all recommendations maintain functional integrity.

Python Sensei Setup

To utilize this skill effectively, ensure you have a modern Python environment. While it works with standard libraries, installing the recommended toolchain enhances the capabilities of Openclaw Skills.

# Install recommended quality tools
pip install pytest ruff mypy httpx pydantic

The skill will automatically detect these tools on your PATH and adapt its recommendations to use your specific installed toolchain.

Python Sensei Data Schema & Taxonomy

Python Sensei follows a standardized organization for data and metadata within your project to ensure compatibility across the ecosystem of Openclaw Skills:

Component Organization Method
Source Code Located in src/project_name/ with strict module separation.
Tests Stored in tests/ using the test_{module}.py naming convention.
Configuration Managed via pyproject.toml for modern dependency and tool orchestration.
Data Models Defined using @dataclass or Pydantic BaseModel with explicit to_dict methods.
Documentation Inline docstrings for all public functions and module-level headers.

Python Sensei Advanced Features

  • Context-Aware Tool Detection: Automatically scales its review depth based on whether ruff, mypy, or pyright are present in the environment.
  • Async-First Refactoring: Proactively identifies blocking code and suggests modern async/await implementations using httpx and asyncio.gather.
  • Intelligent Module Splitting: Monitors file size and complexity, offering logical split points when modules exceed the 500-line maintainability threshold.
  • Security Boundary Enforcement: Flags dangerous practices like bare exception handling or insecure SQL construction at system boundaries.
  • Seamless Workflow Integration: Operates as part of the Openclaw Skills suite to provide consistent, high-fidelity code output and reviews.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Requires
Github Stars: 0
forks: 0

Featured*