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.
npx skills add softspark/ai-toolkit --skill python-rulesgit clone --depth 1 https://github.com/softspark/ai-toolkitWrote 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.
[](https://agentmods.dev/skills/softspark/ai-toolkit/python-rules)<a href="https://agentmods.dev/skills/softspark/ai-toolkit/python-rules"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/python-rules/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/softspark/ai-toolkit/python-rules"><img src="https://agentmods.dev/badge/skills/softspark/ai-toolkit/python-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to high
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- high Tool Misuse · line 179 Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).Fix: Validate all tool parameters against an allowlist. Reject dangerous parameter values (shell=True, --force, -rf /) and use safe defaults.
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00055 | $0.02758 |
| Opus 5 | $0.00028 | $0.01379 |
| Sonnet 5 | $0.00011 | $0.00552 |
| Haiku 4.5 | $0.00006 | $0.00276 |
Grade A, and why
python-rules scanned grade A with 1 finding 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 6d 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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
- Never use `os.system()` or `subprocess.run(shell=True)` with user input. How it starts
The opening of the file, as written. The whole thing — 258 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Python Rules
These rules come from app/rules/python/ in ai-toolkit. They cover
the project's standards for coding style, frameworks, patterns,
security, and testing in Python. Apply them when writing or
reviewing Python code.
Python Coding Style
Type Hints
- Type all public function signatures (parameters + return).
- Use
str | None(PEP 604) overOptional[str]on Python 3.10+. - Use
from __future__ import annotationsfor forward references. - Use
TypeAliasortype(3.12+) for complex type aliases. - Use
Protocolfor structural subtyping instead of ABCs where possible.
Naming
- snake_case: variables, functions, methods, modules.
- PascalCase: classes, type aliases, Protocols.
- UPPER_SNAKE: module-level constants.
- Prefix private:
_internal_helper. No double underscore unless name mangling needed. - Prefix unused:
_for intentionally unused variables.
Functions
- Prefer keyword arguments for functions with >2 params.
- Use
*to force keyword-only:def fetch(*, limit: int, offset: int). - Return early to reduce nesting. Avoid deep if/else chains.
- Use
@staticmethodonly for pure utility. Prefer module-level functions.
Imports
- Group: stdlib, third-party, local. Separated by blank lines.
- Use absolute imports. Relative imports only within packages.
- Never
from module import *. Be explicit. - Use
if TYPE_CHECKING:for import-only-for-types to avoid circular imports.
Data Structures
- Use
dataclassesfor plain data containers. - Use Pydantic
BaseModelfor validated data / API schemas. - Use
NamedTuplefor lightweight immutable records. - Use
Enumfor fixed sets of values. PreferStrEnumon 3.11+. - Prefer
dict/listliterals overdict()/list()constructors.
Modern Python
- Use f-strings for formatting. Never
.format()or%for new code. - Use
pathlib.Pathoveros.pathfor file operations. - Use
contextlib.suppress(KeyError)over bare try/except for simple cases. - Use walrus operator
:=when it genuinely improves readability. - Use
match/case(3.10+) for complex conditionals on structured data.
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.
- 6d ago First seen · 258 lines · 55 tokens per session scan A 0baaab7cc1e7
python-rules is a skill published in the GitHub repository softspark/ai-toolkit (170 stars, last pushed yesterday), licensed Apache-2.0. It adds 55 tokens to every session and 2,758 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
bugfix-protocol
Systematic 6-phase debugging protocol. Structured approach to bugs with quick checks, isolated testing, 20-minute rule, and bug report template.
bugfix-protocol
Systematic 6-phase debugging protocol. Structured approach to bugs with quick checks, isolated testing, 20-minute rule, and bug report template.
temporal-python-testing
Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.
hypothesis-testing
Property-based testing with Hypothesis for discovering edge cases and validating invariants. Use when implementing comprehensive test coverage, testing complex logic with many inputs, or validating mathematical properties and invariants across input domains. Triggered by: hypothesis, property-based testing, @given…
test-generator
Generate pytest test cases for Python functions and classes.
python-quality-gate
Python quality checks: ruff, pytest, mypy, bandit in deterministic order.