style-guide

style-guide is a skill for Claude Code from Kevin-Liu-01/Agent-Machines. It costs 26 tokens per session (1,374 once invoked), scanned A, original, MIT.

A concise set of rules for writing and reviewing maintainable Python code, including limits on function size, file size, nesting, and types.

In plain words
What is it for?
Use it when writing or reviewing Python functions, modeling JSON and domain data, and checking code structure before a pull request.
Why use it?
It catches patterns that make code difficult to understand or change, such as deeply nested logic, untyped data, and oversized functions.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit Use it when writing or reviewing Python functions, modeling JSON and domain data, and checking code structure before a pull request.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kevin-liu-01/agent-machines/style-guide
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.

Any agent
npx skills add Kevin-Liu-01/Agent-Machines --skill style-guide
Clone the repo
git clone --depth 1 https://github.com/Kevin-Liu-01/Agent-Machines

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 style-guide

README.md
[![agentmods](https://agentmods.dev/badge/skills/kevin-liu-01/agent-machines/style-guide/github.svg)](https://agentmods.dev/skills/kevin-liu-01/agent-machines/style-guide)
Your own site
<a href="https://agentmods.dev/skills/kevin-liu-01/agent-machines/style-guide"><img src="https://agentmods.dev/badge/skills/kevin-liu-01/agent-machines/style-guide/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.

agentmods 80×15 button for style-guide

Your own site · 80×15
<a href="https://agentmods.dev/skills/kevin-liu-01/agent-machines/style-guide"><img src="https://agentmods.dev/badge/skills/kevin-liu-01/agent-machines/style-guide.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,374 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00026 $0.01374
Opus 5 $0.00013 $0.00687
Sonnet 5 $0.00005 $0.00275
Haiku 4.5 $0.00003 $0.00137

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

Security

Grade A, and why

style-guide 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 9d 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.

knowledge/skills/style-guide/SKILL.md · 163 lines

How it starts

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

Dedalus Style Guide: Quick Reference

Hard Limits

  • Functions: 70 lines max
  • Files: 500 lines max (excluding inline tests)
  • Nesting: 3 levels max
  • Arguments: 5 max (excluding self/cls)
  • PRs: 200 changed LOC max

I/O Convention

# I/O function: io: Io as first parameter
async def fetch_user(io: Io, user_id: str) -> User | None: ...

# Pure function: no io parameter
def compute_discount(user: User, cart: Cart) -> Decimal: ...

Types

  • No Any. Period. If you reach for Any, you have not modeled the domain.
  • No object as a type annotation. It is Any in disguise.
  • For heterogeneous JSON, use JSONValue, JSONObject, JSONPrimitive, or JSONArray from core.types.json. These are proper recursive RFC 8259 types. There is no excuse for dict[str, object] or dict[str, Any].
  • No **kwargs: Any without justification.
  • Use typed structures (dataclass, TypedDict, Pydantic) instead of dicts.
  • Pydantic at boundaries, plain types internally.
  • Replace anonymous tuples with frozen dataclasses or named types.

Functions

  • Early returns instead of nesting
  • One thing per function: if you need "and", split it
  • Named parameters at call sites: fetch_user(io=io, user_id=uid)
  • Return value in own variable for debuggability: result = ...; return result
  • No chaining construction + method: Foo(x).bar() hides the instance. Split into foo = Foo(x) then result = foo.bar().
  • Split compound assertions: assert a; assert b not assert a and b

Error Handling

  • Specific exceptions with domain context: ChargeError(org_id, reason)
  • Never catch bare Exception without # noqa: BLE001
  • Never swallow with pass
  • Namespace pattern: BillingError.ChargeError
  • Result types for domain logic, try/except at boundaries

No Fallbacks

# Bad: silent, undebuggable
model = request.model or config.default_model or "gpt-4"

# Good: explicit precedence with early returns
def get_model(request, config):
    if request.model:
        return request.model
    if config.default_model:
        return config.default_model
    raise ValueError("model is required")

Read the full file on GitHub · 163 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. 9d ago First seen · 163 lines · 26 tokens per session scan A b8bbd6b5435c

Subscribe to this mod's changes

style-guide is a skill published in the GitHub repository Kevin-Liu-01/Agent-Machines (29 stars, last pushed today), licensed MIT. It adds 26 tokens to every session and 1,374 once invoked, about $0.0001 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-09-03.