designing-python-apis

designing-python-apis is a skill for Claude Code from CHENyiru3/AI-Skills-Collections. It costs 41 tokens per session (387 once invoked), scanned A, original, MIT.

A guide to designing public interfaces for Python libraries: the functions, classes, names, inputs, results, and errors that users see. It also covers compatibility and how to retire an old interface safely.

In plain words
What is it for?
Use it to plan or review Python APIs, choose names and argument shapes, design useful exceptions, and manage renamed or deprecated functions.
Why use it?
A confusing or inconsistent library interface makes every caller learn special cases. These practices help keep common tasks simple while making errors and future changes clearer.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the programming plugin — 13 skills shipped together

Good fit Use it to plan or review Python APIs, choose names and argument shapes, design useful exceptions, and manage renamed or deprecated functions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chenyiru3/ai-skills-collections/api-design
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 CHENyiru3/AI-Skills-Collections --skill api-design
Clone the repo
git clone --depth 1 https://github.com/CHENyiru3/AI-Skills-Collections

Made for: Claude Code.

Or install programming, the plugin that ships this one along with the rest of its 13 skills.

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 designing-python-apis

README.md
[![agentmods](https://agentmods.dev/badge/skills/chenyiru3/ai-skills-collections/api-design/github.svg)](https://agentmods.dev/skills/chenyiru3/ai-skills-collections/api-design)
Your own site
<a href="https://agentmods.dev/skills/chenyiru3/ai-skills-collections/api-design"><img src="https://agentmods.dev/badge/skills/chenyiru3/ai-skills-collections/api-design/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 designing-python-apis

Your own site · 80×15
<a href="https://agentmods.dev/skills/chenyiru3/ai-skills-collections/api-design"><img src="https://agentmods.dev/badge/skills/chenyiru3/ai-skills-collections/api-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 387 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.00041 $0.00387
Opus 5.5 $0.00016 $0.00155
Sonnet 5.5 $0.00008 $0.00077
Haiku 4.5 $0.00004 $0.00039

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

Security

Grade A, and why

designing-python-apis 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.

skills-market/programming/python/api-design/SKILL.md · 37 lines

What it actually says

Python API Design

Start from representative calling code and the package's current supported users. Preserve established naming and behavior unless the requested change includes a migration. Optimize a common call without making exceptional use impossible.

  • Distinguish public exports from internal implementation. A new abstraction needs a concrete caller; underscore naming alone does not enforce privacy.
  • Specify accepted types/shapes, mutability/ownership, return types and side effects. Decide whether an iterable may be consumed once, copied or modified in place.
  • Use keyword-only options when adjacent positional values are ambiguous. Preserve positional/keyword compatibility when changing an existing signature.
  • Distinguish absent values from valid false/empty values. Avoid mutable defaults and coercions that silently erase caller intent.
  • Document actionable exception types and failure conditions; keep diagnostic messages useful without exposing secrets. Do not invent exception classes that the package does not define.
  • For a deprecation, identify affected callers, a replacement, a supported warning path and removal policy. Test that compatibility wrappers preserve results and warning attribution. A rename is not compatible merely because it reads better.

Read EVOLUTION.md for migration work and PATTERNS.md when a builder/factory solves an actual interface problem. Treat examples as illustrative, not a mandate to add patterns.

Validate representative calls and a relevant error/compatibility case. Stop when the requested interface contract is clear and verified; do not require a package redesign for a narrow API question.

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 Changed · -85 lines · -29 tokens per session e61b098809bd
  2. 1mo ago First seen · 122 lines · 70 tokens per session scan A aa6f166f42ab

Subscribe to this mod's changes

designing-python-apis is a skill published in the GitHub repository CHENyiru3/AI-Skills-Collections (2 stars, last pushed 3d ago), licensed MIT. It adds 41 tokens to every session and 387 once invoked, about $0.0002 per session on Opus 5.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-10-02.

Related

designing-python-apis compared with skills from other repositories

designing-python-apis next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
designing-python-apisCHENyiru3/AI-Skills-CollectionsSkill23d agoMITA41Claude Code
mcore-linting-and-formattingNVIDIA/skillsSkill4.0kyesterdayApache-2.0A44Claude Code
python-engineering-guidelinesanywhere-labs/Agents-AnywhereSkill3.4kyesterdayApache-2.0A75Codex
python-review-checklistawslabs/cli-agent-orchestratorSkill1.6ktodayApache-2.0A20Claude Code, Codex
best-practicesFradSer/dotclaudeSkill5968d agoMITA52Claude Code
plankton-code-qualityloulanyue/awesome-claude-notesSkill2711mo agoMITA34Claude Code
python-servicesiliaal/whetstoneSkill36yesterdayMITA48Claude Code, Codex