python-coding

python-coding is a skill for Claude Code from Dynokostya/just-works. It costs 49 tokens per session (2,812 once invoked), scanned A, original, Apache-2.0.

A set of rules for writing and editing Python code, covering errors, resource handling, asynchronous code, data models, type safety, and security defaults. Python is a programming language, and the rules defer to conventions already established by the project.

In plain words
What is it for?
Use it when changing `.py` files to inspect the project's Python version and tooling, follow local style, handle errors explicitly, and use timezone-aware and security-safe APIs.
Why use it?
It prevents common bugs such as silently swallowed exceptions, timezone mistakes, and predictable security tokens. It also gives a consistent fallback when a project has no clear coding standards.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: positional $N argument.

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/dynokostya/just-works/python-coding
Any agent
npx skills add Dynokostya/just-works --skill python-coding
Clone the repo
git clone --depth 1 https://github.com/Dynokostya/just-works

Made for: Claude Code.

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-coding

README.md
[![agentmods](https://agentmods.dev/badge/skills/dynokostya/just-works/python-coding.svg)](https://agentmods.dev/skills/dynokostya/just-works/python-coding)
Your own site
<a href="https://agentmods.dev/skills/dynokostya/just-works/python-coding"><img src="https://agentmods.dev/badge/skills/dynokostya/just-works/python-coding.svg" alt="Measured on agentmods" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,812 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 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.1 $0.00049 $0.02812
Opus 5 $0.00024 $0.01406
Sonnet 5 $0.00010 $0.00562
Haiku 4.5 $0.00005 $0.00281

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

Security

Grade A, and why

python-coding scanned grade A with 2 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 yesterday.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- **Never blocking calls in async** -- no `time.sleep()`, bare `open()`, or `requests.get()` inside `async def`. These block the entire event loop, freezing all concurrent tasks. Use `asyncio.sleep()`, `aiofiles`, `httpx

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- **Never `shell=True` in `subprocess`** -- shell interpretation enables command injection if any argument contains user input. Use argument lists: `subprocess.run(["cmd", arg1, arg2])`.
.claude/skills/python-coding/SKILL.md · 284 lines

How it starts

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

Python Coding

Match the project's existing conventions. When uncertain, read 2-3 existing modules to infer the local style. Check pyproject.toml for Python version target, linter config, and tooling. These defaults apply only when the project has no established convention.

Never rules

These are unconditional. They prevent bugs and vulnerabilities regardless of project style.

  • Never except: pass or bare except Exception without re-raise. Catch specific exception types. Broad catches silently swallow bugs — a KeyError from a typo looks the same as a network failure, and you'll spend hours debugging something the traceback would have told you instantly.
  • Never datetime.now() or datetime.utcnow() -- both produce naive datetimes that lose timezone info. Naive datetimes cause subtle bugs when code crosses timezone boundaries (servers, users, DST). Use datetime.now(tz=timezone.utc). Use zoneinfo.ZoneInfo for other timezones, not pytz.
  • Never random for security -- random uses a predictable PRNG; an attacker who observes a few outputs can predict future ones. Use secrets.token_hex(), secrets.token_urlsafe(), or secrets.token_bytes() for tokens, keys, session IDs.
  • Never shell=True in subprocess -- shell interpretation enables command injection if any argument contains user input. Use argument lists: subprocess.run(["cmd", arg1, arg2]).
  • Never interpolate or unsafely deserialize external input -- no string-formatted SQL (parameterized queries only), no yaml.load() (use yaml.safe_load()), no pickle.load() on untrusted data (use JSON/MessagePack), no eval()/exec() (use ast.literal_eval() for literals). All are injection or remote-code-execution vectors.
  • Never mutable default arguments -- def f(items=[]) shares one list across all calls. Appending in one call mutates the default for every subsequent call. Use None sentinel: def f(items: list[str] | None = None) then if items is None: items = [] (not items = items or [], which also replaces a caller's passed-in empty list).
  • Never shadow builtins -- don't use list, dict, id, type, input, hash, map, set, filter as variable names. Shadowing causes confusing errors when you later need the builtin in the same scope.
  • Never blocking calls in async -- no time.sleep(), bare open(), or requests.get() inside async def. These block the entire event loop, freezing all concurrent tasks. Use asyncio.sleep(), aiofiles, httpx.
  • Never += string concatenation in loops -- use "".join(parts). Strings are immutable, so repeated += is quadratic in the general case; CPython has a narrow in-place optimization that often masks it, but it is implementation-specific and easily defeated. join is reliably linear everywhere.

Read the full file on GitHub · 284 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. yesterday First seen · 284 lines · 49 tokens per session scan A cbacd9774bd7

Subscribe to this mod's changes

python-coding is a skill published in the GitHub repository Dynokostya/just-works (14 stars, last pushed yesterday), licensed Apache-2.0. It adds 49 tokens to every session and 2,812 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.

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

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

python

Python development with ruff, mypy, pytest - TDD and type safety.

alinaqi/maggy · 18 tokens

splitting-oversized-modules

Split an oversized Python module (a thousand-plus-line logic.py, models.py, api.py, or its test file) into a package of one module per concern, mechanically and provably without changing behavior. Use on a request to split / break up / decompose a god module or move functions out of one, once a human has agreed to…

PostHog/posthog · 197 tokens