python-clean-code

A read-only review of Python code in the gsc-mcp project. It checks readability, function size, type annotations, naming, error handling, and project-specific rules.

In plain words
What is it for?
Use it to review a Python file or module after adding a tool, during refactoring, or when the code has become difficult to follow.
Why use it?
It finds maintainability and consistency problems before code review or a pull request, without changing the files.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/florianbruniaux/google-search-console-mcp/python-clean-code
Any agent
npx skills add FlorianBruniaux/google-search-console-mcp --skill python-clean-code
Clone the repo
git clone --depth 1 https://github.com/FlorianBruniaux/google-search-console-mcp

Made for: Claude Code, Codex.

Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 753 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00055 $0.00753
Opus 5 $0.00028 $0.00377
Sonnet 5 $0.00011 $0.00151
Haiku 4.5 $0.00006 $0.00075

Measured 2d ago against content hash 4dede04073de, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

python-clean-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/python-clean-code/SKILL.md · 74 lines

How it starts

The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python Clean Code Review

Reviews Python code in gsc-mcp for quality issues. Read-only analysis: produces a findings report, applies no fixes.

When to use

Invoke before opening a PR, after adding a new tool, or when a module feels hard to read. Pass a file path or module name as the argument.

Review Dimensions

1. Function Size and Focus

Flag any function exceeding 30 lines (excluding docstring and blank lines). A function that does more than one thing usually has a name with "and" in it, or a docstring that lists multiple behaviors. Each tool function in tools/ should do exactly one thing: call the API, transform the response, and return the JSON string.

2. Type Hints

Every function signature must be fully annotated. Check for:

  • Missing return type (-> str:, -> None:)
  • Missing parameter types
  • Use of Any without justification
  • list and dict without subscripts where the shape is known (e.g. list[dict] not just list)

3. Naming

Private helpers must start with _. Constants at module level must be in _SCREAMING_SNAKE_CASE. Tool functions exposed to MCP must be lowercase with underscores. No abbreviations that require context to decode (r for rows; svc is acceptable because it appears consistently across the codebase).

4. Error Handling

Tool functions must not silently swallow exceptions. They may catch specific exceptions to convert them into user-friendly error messages, but they must not use bare except: or except Exception: without re-raising or returning a structured error response. Transient Google API errors belong in retry.py, not in tool functions.

5. Duplication

Check for logic duplicated across modules. Common candidates: date range calculation (already in analytics._date_range), URL normalization (already in cross._normalize_url), dimension filter construction (already in ga4._build_dimension_filter). If a function re-implements one of these, flag it.

6. Output Contract Compliance

Read the full file on GitHub · 74 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 74 lines · 55 tokens per session scan A 4dede04073de

Subscribe to this mod's changes

python-clean-code is a skill published in the GitHub repository FlorianBruniaux/google-search-console-mcp (9 stars, last pushed 6d ago), licensed MIT. It adds 55 tokens to every session and 753 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

testing-python

Write and evaluate effective Python tests using pytest. Use when writing tests, reviewing test code, debugging test failures, or improving test coverage. Covers test design, fixtures, parameterization, mocking, and async testing.

PrefectHQ/fastmcp · 45 tokens

gsccli

Use when the user wants to query Google Search Console search analytics (clicks/impressions/CTR/position by query/page/country/device), inspect URL indexing status, manage sitemaps, or send Indexing API notifications via the gsccli shell command. Triggers on GSC, Search Console, sitemap, indexing API, mobile…

nalyk/gsccli · 102 tokens

fastapi-route-change

Use when adding, renaming, or modifying this backend's FastAPI routes, dependencies, middleware, or response behavior.

berntpopp/hpo-link · 29 tokens

testing-python-pytest

Generates professional pytest unit test suites for Python source files, ensuring >90% line and branch coverage per file. Analyzes modules with AST inspection to discover all classes, methods, and functions, then produces well-structured tests following the AAA pattern with fixtures, parametrize, mocking, and…

jenreh/appkit-bpmn-server · 124 tokens

web-analytics

Analyze web traffic, SEO performance, and search engine trends using Google Search Console, Google Analytics 4, and Bing Webmaster Tools. Use when the user asks to analyze traffic, check SEO, or find keyword opportunities.

SeoToolkit/web-analytics-agent-skill · 47 tokens

seo-mcp-reports

Generate professional, visually stunning SEO reports using SEO-MCP tools. Use when generating HTML/PDF SEO reports with charts, metric cards, gradient headers, and agency-quality styling. Covers weekly, monthly, quarterly, technical audit, competitive analysis, and client-friendly agency report formats. Requires…

quantacodes/seomcp-proxy · 113 tokens