rugged-gemini: Skill for Claude Code

.gemini/skills/python-idioms/SKILL.md

python-idioms is a skill for Claude Code, Gemini CLI from irahardianto/rugged-gemini. It costs 0 tokens per session (2,466 once invoked), scanned A, original, MIT.

A guide to readable, explicit Python code using type hints, structural interfaces, and clear data shapes.

In plain words
What is it for?
Use it when defining Python functions and public APIs, describing data structures, creating reusable interfaces, and organizing typed application code.
Why use it?
It makes Python programs easier to understand and helps tools catch incorrect values and mismatched interfaces earlier.

Skill for Claude CodeGemini CLI

Written for Claude Code and Gemini CLI: paths in frontmatter, but also installed under .gemini/. Also seen: mentions Gemini CLI.

This is irahardianto/rugged-gemini's own configuration. It tells Claude Code and Gemini CLI how to work on rugged-gemini itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything rugged-gemini configures →

Reuse

Borrowing it

Nothing to install: this file belongs to irahardianto/rugged-gemini. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/irahardianto/rugged-gemini/main/.gemini/skills/python-idioms/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/irahardianto/rugged-gemini

Made for: Claude Code, Gemini CLI.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for python-idioms

README.md
[![agentmods](https://agentmods.dev/badge/skills/irahardianto/rugged-gemini/python-idioms.svg)](https://agentmods.dev/skills/irahardianto/rugged-gemini/python-idioms)
Your own site
<a href="https://agentmods.dev/skills/irahardianto/rugged-gemini/python-idioms"><img src="https://agentmods.dev/badge/skills/irahardianto/rugged-gemini/python-idioms.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,466 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.02466
Opus 5 $0.00000 $0.01233
Sonnet 5 $0.00000 $0.00493
Haiku 4.5 $0.00000 $0.00247

Measured 3d ago against content hash cef4f6b308f6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

python-idioms 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 3d 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.

.gemini/skills/python-idioms/SKILL.md · 301 lines

How it starts

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

Python Idioms and Patterns

Python rewards explicitness and readability. Follow Zen of Python. If it reads like plain English, it's idiomatic.

Scope: Python coding idioms. Layout: @.gemini/skills/project-structure-python/SKILL.md. Tests: GEMINI.md § Testing Strategy. Logging: @.gemini/skills/logging-and-observability-principles/SKILL.md.

Type Hints — Non-Negotiable

Always annotate function signatures and public APIs. Use from __future__ import annotations.

from __future__ import annotations
from collections.abc import Sequence

def calculate_discount(items: Sequence[Item], coupon: Coupon) -> float: ...
  1. X | None over Optional[X] (3.10+):

    def find_user(user_id: str) -> User | None: ...
    
  2. TypeAlias and TypeVar:

    from typing import TypeVar, TypeAlias
    T = TypeVar("T")
    UserId: TypeAlias = str
    
  3. Protocol for structural interfaces (duck-typing):

    from typing import Protocol
    
    class TaskStorage(Protocol):
        def get_by_id(self, task_id: str) -> Task: ...
        def save(self, task: Task) -> None: ...
    
  4. TypedDict for structured boundary dicts:

    from typing import TypedDict
    
    class CreateTaskRequest(TypedDict):
        title: str
        priority: Literal["low", "medium", "high"]
    

Error Handling

General: GEMINI.md § Error Handling Principles. Python-specific below.

  1. Specific exceptions over except Exception:

    try:
        task = storage.get_by_id(task_id)
    except TaskNotFoundError:
        raise HTTPException(status_code=404, detail="Task not found")
    
  2. Domain exception hierarchies:

    class FathError(Exception):
        """Base exception for all domain errors."""
    
    class NotFoundError(FathError):
        def __init__(self, resource: str, resource_id: str) -> None:
            self.resource = resource
            self.resource_id = resource_id
            super().__init__(f"{resource} '{resource_id}' not found")
    
    class ValidationError(FathError):
        def __init__(self, field: str, message: str) -> None:
            self.field = field
            self.message = message
            super().__init__(f"Validation failed on '{field}': {message}")
    

Read the full file on GitHub · 301 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. 3d ago First seen · 301 lines · 0 tokens per session scan A cef4f6b308f6

Subscribe to this mod's changes

python-idioms is a skill published in the GitHub repository irahardianto/rugged-gemini (5 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,466 tokens. 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-09-03.

Related

Other skills, from other repositories

matlab

Build, review, migrate, and safely plan MATLAB or GNU Octave numerical workflows, including arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.

K-Dense-AI/scientific-agent-skills · 42 tokens

pennylane

Hardware-agnostic quantum ML framework with automatic differentiation. Use when training quantum circuits via gradients, building hybrid quantum-classical models, or needing device portability across IBM/Google/Rigetti/IonQ. Best for variational algorithms (VQE, QAOA), quantum neural networks, and integration with…

K-Dense-AI/scientific-agent-skills · 98 tokens

dd-code-generation

Use pup CLI for immediate Datadog operations or generate code for integration into applications.

DataDog/pup · 16 tokens

rocm-kernels

Provides guidance for writing and benchmarking optimized Triton kernels for AMD GPUs (MI355X, R9700) on ROCm, targeting HuggingFace diffusers (LTX-Video, SD3, FLUX) and transformers. Core kernels: RMSNorm, RoPE 3D, GEGLU, AdaLN. Includes XCD swizzle, autotune, diffusers integration patterns, and LTX-Video pipeline…

huggingface/kernels · 93 tokens

holoscan-install-wheel

Install Holoscan SDK Python wheel via pip into a venv. Use for Python installs; not for native C++/apt or Conda installs.

NVIDIA/skills · 37 tokens

typing-exclusion-worker

Python typing exclusion worker: remove assigned mypy exclusion modules in small scoped batches, fix typing issues, run validation, and produce a structured completion summary. Use when running parallel typing-debt workers or when asked to remove modules from pyproject mypy exclusion overrides.

getsentry/skills · 57 tokens