Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
jr2804 avatar

Python Ultimate

  • 101 installs
  • Updated July 30, 2026
  • jr2804/prompts

python-ultimate is an agent skill that validates Python path variable names and forbidden style patterns via an included check_path_naming.py script.

About

python-ultimate is an agent skill backed by a small uv-run validator that encodes strict path-variable naming and forbidden-pattern rules for Python repos. Solo builders and tiny teams shipping Python CLIs, APIs, or SaaS backends install it when chat-generated code drifts into lazy names (data, tmp) or legacy typing/import shortcuts that fail review. The script answers whether a symbol looks like a file, directory, or exceptional path, then can walk directories to flag violations and banned constructs listed in FORBIDDEN_REASON—guards around TYPE_CHECKING, Optional bracket syntax, os.path instead of pathlib, and noqa band-aids. It fits naturally in Ship/review workflows but also during Build/backend passes when you want the agent to propose names that already match house style. Complexity is intermediate because you must align variable intent with the enum and refactor types rather than silencing linters.

  • CLI validator: single-name check plus --check-files and --check-forbidden directory scans
  • PathValidity enum classifies variables as is_file, is_dir, is_path_exceptional, or invalid
  • Forbids TYPE_CHECKING guards, Optional[T], os.path, and noqa suppressions per reference docs
  • Uses ast + tokenize over Python sources (Python ≥3.10, uv-run script)
  • Encourages pathlib.Path and pipe unions (T | None) for modern typing style

Python Ultimate by the numbers

  • 101 all-time installs (skills.sh)
  • +7 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #104 of 290 Python skills by installs in the Skillselion catalog
  • Data as of Aug 2, 2026 (Skillselion catalog sync)
npx skills add https://github.com/jr2804/prompts --skill python-ultimate

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs101
Last updatedJuly 30, 2026
Repositoryjr2804/prompts

What it does

Enforce python-ultimate file, directory, and path variable naming rules across a codebase before merge or release.

Who is it for?

Python maintainers who want deterministic naming enforcement on a src/ tree with uv and Python 3.10+.

Skip if: Projects that rely on blanket noqa fixes or are not Python; it will force refactors away from those escape hatches.

When should I use this skill?

When enforcing python-ultimate naming on new symbols or auditing a tree with --check-files / --check-forbidden.

What you get

You get a concrete violation list and naming classification (file vs dir) so refactors land before merge instead of after CI noise.

  • Per-name PathValidity label
  • Directory violation report from --check-files
  • Forbidden-pattern report from --check-forbidden

By the numbers

  • Four PathValidity outcomes: is_file, is_dir, is_path_exceptional, invalid
  • Requires Python >=3.10 per script metadata

Files

SKILL.mdMarkdownGitHub ↗

Python Ultimate

Single Python reference with quick routes for standards, tooling, workflows, and best practices.

Quick Start

Writing code? → Start with Coding Standards Checking naming? → Go to Naming Conventions Building a CLI? → Go to CLI Development Fixing linter errors? → Go to Linter Rules Writing tests? → Go to Testing Debugging a bug? → Go to Debugging Refactoring? → Go to Refactoring Reviewing code? → Go to Code Review Auditing codebase? → Go to Auditing Documenting? → Go to Documentation Planning a feature? → Go to Planning Bulk operations? → Go to Refactoring (10+ files)

Slash Commands

The /python-ultimate command accepts an optional sub-command argument to run a targeted guideline review. When invoked without a sub-command (e.g., just /python-ultimate), run a general antipattern check using the Antipatterns / Forbidden Styles Index section below.

Routing

Match the sub-command argument to one of the sections below and follow its workflow. If the argument does not match any known sub-command, explain the available options (you can output the table from python-ultimate help).

______________________________________________________________________

python-ultimate help

When the sub-command is help (or when the user asks for available commands), render the following table so the user sees all available options:

Sub-Command                    │ What It Reviews                                        │ Reference
───────────────────────────────┼────────────────────────────────────────────────────────┼──────────────────────────────────
python-ultimate naming         │ File/dir variable naming (_file/_dir/_path suffixes)  │ references/naming-conventions.md
python-ultimate type-checking  │ TYPE_CHECKING guards and Optional[T] usage             │ references/type-checking.md
python-ultimate imports        │ Required-vs-optional import patterns                    │ references/imports-optional-dependencies.md
python-ultimate coding-standards│ Type hints, f-strings, pathlib, docstrings, comments, data modeling │ references/coding-standards.md
python-ultimate linter-rules   │ Ruff violations (E402, B007, B008, S108, etc.)         │ references/linter-rules.md
python-ultimate debugging      │ Systematic 4-phase debugging process                   │ references/debugging.md
python-ultimate testing        │ Test organization, fixtures, mocking, TDD, coverage    │ references/testing.md
python-ultimate audit          │ 6-dimension codebase audit                             │ references/auditing.md
python-ultimate verification   │ Evidence-based completion claims                       │ references/verification.md
python-ultimate code-review    │ Code review feedback evaluation                        │ references/code-review.md

______________________________________________________________________

python-ultimate naming

Reviews file and directory variable naming conventions (_file / _dir / _path suffixes).

Workflow:

1. Open references/naming-conventions.md and load the "1. Files and Directories" section 2. Scan the codebase for bare path names (path, file, dir, output, source, target) used as Path variables 3. Check for prefix patterns (dir_output → should be output_dir) 4. Find generic path variable names missing suffixes (results → ambiguous) 5. Report findings using the standard antipattern response format

______________________________________________________________________

python-ultimate type-checking

Scans for TYPE_CHECKING guards and Optional[T] usage.

Workflow:

1. Open references/type-checking.md and load the "Rule: Never Use TYPE_CHECKING Guards" section 2. Search for TYPE_CHECKING imports: rg "TYPE_CHECKING" src/ 3. Search for Optional[ usage: rg "Optional\[" src/ 4. For each finding, identify the root cause (circular imports, type-only imports) 5. Recommend the appropriate alternative (shared types module, protocols, forward refs, local imports) 6. Report findings using the standard antipattern response format

______________________________________________________________________

python-ultimate imports

Reviews import patterns — distinguishes required vs optional dependencies.

Workflow:

1. Open references/imports-optional-dependencies.md and load the hard rule 2. Check pyproject.toml to determine which packages are required vs optional 3. Search for try/except ImportError patterns guarding required deps: rg "except ImportError" src/ 4. For each match, classify: required dep → normal top-level import; optional dep → localized handling 5. Report findings using the standard antipattern response format

______________________________________________________________________

python-ultimate coding-standards

Reviews compliance with coding standards: type hints, f-strings, pathlib, docstrings, comments, prohibited patterns, vague input/output types.

Workflow:

1. Open references/coding-standards.md and load relevant sections 2. For each prohibited pattern, search with targeted grep patterns:

  • Optional\[ → must be T | None
  • \.format\( or % formatting → must be f-strings
  • os\.path\. → must be pathlib.Path
  • # noqa → fix root issue

3. Check for vague input/output types with multiple isinstance checks 4. Report findings using the standard antipattern response format

______________________________________________________________________

python-ultimate linter-rules

Reviews and fixes specific Ruff linter violations using context-aware patterns.

Workflow:

1. Open references/linter-rules.md and load the relevant rule section 2. Run ruff check src/ to identify violations 3. For each violated rule, apply the context-specific fix pattern from the reference:

  • E402 → Move import to top of module
  • B007 → Prefix unused loop variable with _
  • B008 → Use None sentinel (except Typer Annotated parameters)
  • S108 → Use tempfile or tmp_path fixture
  • PLC0415 → Move import to module level
  • NPY002 → Use default_rng()
  • S311 → Use secrets for security contexts

4. Re-run ruff check src/ to confirm fixes 5. Report findings using the standard antipattern response format

______________________________________________________________________

python-ultimate debugging

Initiates the systematic 4-phase debugging process.

Workflow:

1. Open references/debugging.md and load the full 4-phase process 2. Phase 1 — Root Cause: Reproduce the issue, read error messages, trace data flow from symptom to origin 3. Phase 2 — Pattern: Find working examples, compare against broken code, list every difference 4. Phase 3 — Hypothesis: Form a single testable hypothesis, make the smallest possible change to test it 5. Phase 4 — Implementation: Write a failing test first, implement the fix, verify all tests pass 6. Remember the iron law: No fixes without root cause investigation first. 7. If 3+ fixes have failed, stop and reassess architecture rather than continuing to guess

______________________________________________________________________

python-ultimate testing

Reviews test organization, coverage, fixtures, mocking, and TDD compliance.

Workflow:

1. Open references/testing.md for patterns and standards 2. Check test file naming: test_<module>.py convention 3. Check test class naming: Test<Name> PascalCase 4. Check test method naming: test_<description> snake_case 5. Run coverage: uv run pytest --cov=src --cov-report=term-missing 6. Review fixture quality (descriptive names, proper scope, teardown) 7. Report findings using the standard antipattern response format

______________________________________________________________________

python-ultimate audit

Runs a 6-dimension codebase audit.

Workflow:

1. Open references/auditing.md and load all six dimensions 2. For each dimension (Architecture, Quality, Security, Performance, Testing, Maintainability):

  • Scan with grep/glob for relevant red flags
  • Rate findings by severity (Critical, High, Medium, Low)

3. Synthesize into an audit report using the format from references/auditing.md 4. Include an executive summary with health score and top recommendation 5. Include an action plan with immediate/short-term/medium-term/backlog items

______________________________________________________________________

python-ultimate verification

Verifies that completion claims are backed by fresh evidence.

Workflow:

1. Open references/verification.md and load the iron law and gate function 2. For each claim, determine what command proves it 3. Run the full command, read the output, check the exit code 4. Only then state the result — with evidence, not assumptions 5. Forbidden words: should, probably, might, likely 6. Report results using the standard antipattern response format

______________________________________________________________________

python-ultimate code-review

Evaluates code review feedback and responds with technical rigor.

Workflow:

1. Open references/code-review.md and load the full workflow 2. Follow the READ → UNDERSTAND → VERIFY → EVALUATE → RESPOND → IMPLEMENT sequence 3. For each feedback item: verify against codebase reality, evaluate technical soundness 4. No performative agreement — respond with technical reasoning or push back with evidence 5. Push back when: suggestion breaks existing functionality, violates YAGNI, lacks full context

______________________________________________________________________

Expected /python-ultimate Response Format

For consistency across agents, format all sub-command responses as:

1. Summary — total findings by severity and category 2. Findings — one item per finding: file:line, matched pattern class, short rationale 3. Fix Guidance — preferred replacement pattern with one concrete before/after example 4. References — direct links to the relevant section in references/*.md 5. Verification — exact command(s) run and observed result

Use concise, technical language. Avoid performative agreement and avoid speculative wording.

Antipatterns / Forbidden Styles Index

Canonical quick-reference for common bad or forbidden patterns. Detailed rationale and examples stay in reference files.

CategoryForbidden patternPreferred patternSource
Type checkingTYPE_CHECKING import guardsRefactor module boundaries, use forward refs/protocolsreferences/type-checking.md
Type hintsOptional[T]`T \None`
String formatting.format() and % formattingf-stringsreferences/coding-standards.md
Pathsos.path usagepathlib.Pathreferences/coding-standards.md
Lint suppression# noqa to hide issuesFix root issuereferences/coding-standards.md
Import policyDefensive try/except ImportError for required depsNormal top-level imports for required depsreferences/imports-optional-dependencies.md
Path variable namingBare names like path, file, output for pathsUse _file / _dir suffixesreferences/naming-conventions.md
Path variable namingPrefix forms dir_x, file_xSuffix forms x_dir, x_filereferences/naming-conventions.md
CommentsRestating obvious code intentExplain why/constraints onlyreferences/coding-standards.md
Debugging workflowGuess-and-check fixes before RCAFollow 4-phase processreferences/debugging.md
Debugging behaviorRepeated "one more try" after multiple failuresStop and reassess architecturereferences/debugging.md
Code review behaviorPerformative agreement phrasesTechnical response and evidencereferences/code-review.md
Data modelingUsing pydantic for lightweight internal structs, or dataclass at trust boundariesdataclass for internal DTOs; pydantic for validation/API boundariesreferences/coding-standards.md

______________________________________________________________________

Coding Standards

Core Python coding rules. See references/coding-standards.md for full details.

Type Hints

Mandatory everywhere. Use pipe syntax (T | None), never Optional[T]. Python 3.10+ required.

def process(data: str, limit: int | None = None) -> list[str]: ...

Never use `TYPE_CHECKING` guards. See references/type-checking.md for alternatives.

String Formatting

Use f-strings only. No .format() or % formatting.

Code Size Limits

TargetLimit
Module< 250 lines
Function< 75 lines
Class< 200 lines

Docstrings

Google style. Required for public functions and classes.

Prohibited Patterns

  • TYPE_CHECKING guards
  • os.path (use pathlib.Path)
  • Optional[T] (use T | None)
  • # noqa comments
  • sys.path manipulation
  • Defensive try/except ImportError for required dependencies (see references/imports-optional-dependencies.md)
  • Vague or wide parameter/return types with hidden isinstance/hasattr checks and None-as-error returns (see references/coding-standards.md)
  • Using pydantic for lightweight internal structs, or dataclass for untrusted/API data (see references/coding-standards.md)

______________________________________________________________________

Naming Conventions

Variable naming standards for clarity and consistency. See references/naming-conventions.md for full details.

Files and Directories

PatternSuffixExample
Files_fileoutput_file, config_file
Directories_dircache_dir, output_dir
Unknown type_pathdata_path (exceptional only)

Anti-patterns (always invalid for path variables):

  • Bare generic names: path, file, folder, dir, directory, output, input, source, target, dest
  • Prefix instead of suffix: dir_output, file_config
  • Missing suffix: results, data, config (ambiguous)

See references/naming-conventions.md for the complete anti-pattern list.

Test Naming

  • Files: test_<module>.py
  • Classes: Test<DataProcessor> (PascalCase with Test prefix)
  • Methods: test_<description> (snake_case with test\_ prefix)

Automated Validation

# Check a variable name
uv run assets/check_path_naming.py output_file
# Output: is_file

# Scan for violations
uv run assets/check_path_naming.py --check-files src/

# Scan for core forbidden patterns
uv run assets/check_path_naming.py --check-forbidden src/

# Repro fixture scan (see assets/examples)
uv run assets/check_path_naming.py --check-forbidden assets/examples/

Reference fixture files and expected output: assets/examples/forbidden-scan-expected.md

______________________________________________________________________

CLI Development

Building Python CLIs with Typer or Click. See references/cli-development.md.

Framework Selection

Use Typer for new projects (type-hint driven, less boilerplate). Use Click for complex parameter handling.

Key Patterns

  • Parameter validation with type hints
  • Rich output formatting
  • Environment variable integration
  • Exit codes for error states

______________________________________________________________________

Linter Rules

Context-aware fixes for Ruff linter rules. See references/linter-rules.md.

Covered Rules

RuleDescriptionQuick Fix
E402Module-level import not at topMove imports to top
B007Unused loop variablePrefix with _
B008Function call in default argUse None sentinel
S108Hardcoded temp file pathUse tempfile
PLC0415Import not at top-levelMove to module level
NPY002Legacy numpy randomUse numpy.random
S311Standard randomUse secrets for security

Typer Exception

B008 is allowed for Typer Annotated parameters. See references/linter-rules.md.

______________________________________________________________________

Testing

Test organization, fixtures, mocking, and TDD. See references/testing.md.

Quick Commands

uv run pytest -v --tb=short
uv run pytest --cov=src --cov-report=term-missing

Key Practices

  • Co-located tests: <module>_test.py alongside implementation
  • 90%+ coverage target
  • Fixtures in conftest.py
  • Parameterized testing for multiple inputs
  • unittest.mock for external dependencies

TDD Cycle

Red → Green → Refactor. No production code without a failing test first. See references/testing.md.

______________________________________________________________________

Debugging

Systematic 4-phase debugging process. See references/debugging.md.

Iron Law

No fixes without root cause investigation first.

4-Phase Process

1. Root Cause — Reproduce, isolate, trace data flow 2. Pattern Analysis — Identify state changes, timing issues 3. Hypothesis — Form testable prediction 4. Implementation — Minimal fix, verify with test

Red Flags

  • "Let me just try changing X"
  • Fixing symptoms without understanding cause
  • Multiple failed fix attempts

______________________________________________________________________

Refactoring

Find → Replace → Verify workflow. See references/refactoring.md.

Workflow

1. Find — Grep for target pattern 2. Replace — Edit with replace_all for bulk changes 3. Verify — Run tests, check for regressions

Code Transfer

Line-based code movement between files. See references/refactoring.md.

______________________________________________________________________

Code Review

Receiving and evaluating code review feedback. See references/code-review.md.

Workflow

Read → Understand → Verify → Evaluate → Respond → Implement

Key Principles

  • No performative agreement
  • Push back with technical reasoning
  • Verify feedback before implementing
  • Evaluate: is the suggestion correct?

______________________________________________________________________

Auditing

6-dimension codebase analysis. See references/auditing.md.

Dimensions

1. Architecture — Structure, modularity, dependencies 2. Quality — Readability, complexity, duplication 3. Security — Input validation, secrets, injection 4. Performance — Bottlenecks, memory, I/O 5. Testing — Coverage, quality, edge cases 6. Maintainability — Documentation, technical debt

Severity Ratings

Critical → High → Medium → Low

______________________________________________________________________

Documentation

10-section documentation structure. See references/documentation.md.

Workflow

Explore → Map → Read → Synthesize

Sections

Project Overview, Architecture, Key Components, Data Flow, API Reference, Configuration, Setup Guide, Development Guide, Testing, Deployment

Mermaid Diagrams

Use for architecture, sequence, and flowchart visualizations.

______________________________________________________________________

Planning

PLAN.md living document for feature implementation. See references/planning.md.

When to Use

Features spanning 3-15 prompts. Self-contained for fresh sessions.

Structure

Goal → Context → Phases → Validation → Progress → Decisions → Notes

______________________________________________________________________

Project Setup

Project structure, dependencies, and imports. See references/project-setup.md.

Key Tools

  • uv for dependency management
  • src layout for packages
  • pyproject.toml for configuration

Import Order

1. Standard library 2. Third-party 3. Local (absolute imports)

______________________________________________________________________

File Analysis

Non-destructive file and codebase analysis. See references/file-analysis.md.

Tools

  • stat for metadata
  • wc for line counts
  • Grep for pattern searching
  • Glob for file discovery

______________________________________________________________________

Type Checking Alternatives

Never use TYPE_CHECKING guards. See references/type-checking.md.

Alternatives

1. Extract shared types to dedicated modules 2. Use protocols for structural typing 3. Forward references (string literals) 4. Local imports (last resort)

______________________________________________________________________

Bulk Operations

High-efficiency Python execution for 10+ file operations. 90-99% token savings vs. iterative approaches.

When to use:

  • Bulk operations (10+ files)
  • Complex multi-step workflows
  • Iterative processing across many files
  • User mentions efficiency/performance

Workflow pattern:

1. Analyze locally — Use metadata operations (file counts, grep patterns) 2. Process locally — Execute all transformations in Python 3. Return summary — Report counts, not full data

Example patterns:

# Bulk refactor across 50 files
from pathlib import Path
import re

files = list(Path('.').glob('**/*.py'))
modified = 0

for f in files:
    content = f.read_text()
    new_content = re.sub(r'old_pattern', 'new_pattern', content)
    if new_content != content:
        f.write_text(new_content)
        modified += 1

result = {'files_scanned': len(files), 'files_modified': modified}
# Code audit metadata extraction
from pathlib import Path
import ast

files = list(Path('src').glob('**/*.py'))
complexity_issues = []

for f in files:
    tree = ast.parse(f.read_text())
    for node in ast.walk(tree):
        if isinstance(node, ast.FunctionDef):
            # Calculate simple complexity metric
            nested = sum(1 for n in ast.walk(node) if isinstance(n, (ast.If, ast.For, ast.While)))
            if nested > 10:
                complexity_issues.append({'file': str(f), 'function': node.name, 'complexity': nested})

result = {'files_audited': len(files), 'high_complexity': len(complexity_issues)}

Best practices:

  • ✅ Return summaries, not full data
  • ✅ Batch operations where possible
  • ✅ Use pathlib.Path for file operations
  • ✅ Handle errors gracefully, return error counts
  • ❌ Don't read full source into context when metadata suffices
  • ❌ Don't process files one-by-one interactively

Token savings scale with file count:

FilesInteractiveBulk OperationSavings
10~5K tokens~500 tokens90%
50~25K tokens~600 tokens97.6%
100~150K tokens~1K tokens99.3%

______________________________________________________________________

Reference Files

All detailed content lives in references/. Load only what you need:

FileContent
coding-standards.mdType hints, formatting, size limits, docstrings, comments, data modeling
cli-development.mdTyper/Click, parameters, Rich output, env vars
linter-rules.mdRuff rules E402, B007, B008, S108, PLC0415, NPY002, S311
testing.mdFixtures, parameterized, mocking, TDD, coverage
type-checking.mdTYPE_CHECKING alternatives, protocols, forward refs
debugging.md4-phase process, red flags, rationalizations
refactoring.mdBulk operations, code transfer, safety checks
code-review.mdReceiving feedback, push back, evaluation
auditing.md6-dimension analysis, severity ratings
documentation.md10-section structure, Mermaid diagrams
planning.mdPLAN.md template and example
file-analysis.mdMetadata, line counting, pattern searching
project-setup.mdProject structure, uv, imports
verification.mdPre-commit hooks, tox, Makefile targets
imports-optional-dependencies.mdRequired vs optional dependency import patterns

Related skills

How it compares

Use instead of ad-hoc Ruff-only chats when you need opinionated path semantics and explicit forbidden-pattern gates beyond generic PEP 8.

FAQ

Who is python-ultimate for?

It is for Python developers and small teams who want agent-generated code to follow strict path naming and documented anti-patterns before shipping.

When should I use python-ultimate?

Run it during Ship/review before merging, while scaffolding Build/backend modules, or when validating a Validate/prototype spike so path variables and imports match house rules early.

Is python-ultimate safe to install?

The skill is a local AST/tokenize scanner without network calls; still review the Security Audits panel on this Prism page before running --check-forbidden on untrusted repositories.

Pythonbackendtesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.