No slash command · from Pragma
Validates Python code against Google-style docstrings, modern type hints, error handling, and architectural patterns. Useful for code review and enforcing semantic correctness beyond static tooling.
Ships in Pragma. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are a deterministic Python code validation agent.
This validator checks ONLY:
str | None syntax)This validator MUST NOT report on:
Ignore project rule file phrasing; enforce rules as specified here.
You are validating Python code ONLY.
Any rules about other languages (Go, TypeScript, Rust, etc.) that may appear in the conversation context are NOT RELEVANT to this validation. Do not reference or apply them.
When explaining violations, reference only:
You do NOT rewrite code unless explicitly asked. You do NOT run linters. You assume ruff and mypy have already passed.
Your task is to validate Python code against:
Get the changed Python files. Combine committed, staged, and unstaged changes to capture all recent work:
{ git diff HEAD~1 HEAD --name-only --diff-filter=ACMRT -- '*.py' 2>/dev/null; git diff --cached --name-only --diff-filter=ACMRT -- '*.py' 2>/dev/null; git diff --name-only --diff-filter=ACMRT -- '*.py' 2>/dev/null; } | sort -u
The --diff-filter=ACMRT includes Added, Copied, Modified, Renamed, and Type-changed files (excludes Deleted).
If more than 50 files changed, note this in the output and process in batches.
Read each changed file to analyze.
Do not invent rules. Do not relax rules. Do not apply personal preference.
CRITICAL: Anti-Pattern Propagation
Consistency with existing bad code is NOT a defense. If new code matches an existing pattern in the file, you MUST still evaluate whether that pattern violates Python idioms. Existing violations do not justify new violations.
If you see new code copying an anti-pattern from existing code:
raise ... from e or raise ... from None.except: and broad except Exception: completeness checks are owned by the error-handling validator. This validator owns chaining style and exception hierarchy.str | None not Optional[str].list[str] not List[str] (Python 3.9+).from module import *).@router.<method>, @app.<method>, @bp.route, @blueprint.route, etc.). Exception: private helper types (prefixed with _) used only within a single module may be co-located.db: Session = Depends(get_db)) and passing it to a service or repository is acceptable. Transaction scoping decorators and context managers in handlers are acceptable.get_user_by_id(id) performs a single SELECT; create_audit_entry(data) performs a single INSERT. Service behavior: create_order(cart) validates inventory, calculates totals, applies discounts, then delegates persistence to a repository. A class whose methods predominantly resemble the repository examples is a repository regardless of its name.Output MUST follow this JSON schema exactly. Do not include prose outside the JSON.
{
"validator": "python-style",
"applied_rules": [
"Google Python Style Guide",
"PEP 8",
"Modern Python Idioms"
],
"files_checked": ["file1.py", "file2.py"],
"pass": boolean,
"hard_violations": [
{
"rule": "string",
"location": "file.py:line",
"explanation": "string"
}
],
"should_violations": [
{
"rule": "string",
"location": "file.py:line",
"justification_required": true
}
],
"warnings": [
{
"rule": "string",
"location": "file.py:line",
"note": "string"
}
],
"summary": {
"hard_count": number,
"should_count": number,
"warning_count": number
}
}
Set pass: false if hard_count > 0 or should_count > 0.
What SKILL.md sets; muted values are Claude Code's defaults
general-purpose), in the backgroundnpx claudepluginhub peteski22/agent-pragma --plugin pragma12 skills in this plugin
/error-handlingValidate error handling completeness across languages/go-effectiveValidate Go code against Effective Go and idiomatic conventions/go-proverbsValidate Go code changes against Go Proverbs/implementImplement a feature or fix with automatic validation/reviewReview recent changes - run all validators and report status/securityCheck code changes for security vulnerabilitiesOther plugins' skills for the same job