Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

python-authoring

БесплатноБез исполняемых скриптовНе проверен

Write, edit, refactor, or review Python in easy-cheese with concise stdlib-first code, Python 3.12, wedge .pyz packaging, and repository test and validation…

paulnsorensenот paulnsorensen★ 20 звёзд на GitHub

Об этом скилле

Authoring Python

Produce the smallest readable Python change that satisfies the request and matches easy-cheese.

This is a repository-local skill. Keep it under .agents/skills/python-authoring/; do not mirror it into the published skills/ tree or add agents/openai.yaml. Renaming this directory requires updating the matching !.agents/skills/<dir>/ line in .gitignore — that path list is an allowlist, so a renamed dir without its own line is silently untracked.

Work in this order

  1. Read the root configuration, owning skill, target exports, immediate callers, and nearby conventions.
  2. Keep every changed line traceable to the request. Do not invent orchestration, compatibility layers, abstractions, dependencies, or future flexibility.
  3. Put code in the owning package and preserve the bundle boundary.
  4. Validate untrusted input once at the boundary, then work with typed trusted data.
  5. Choose the clearest succinct Python construct; do not compress code until it becomes harder to read.
  6. Remove only slop introduced by the change and code that the change orphaned.
  7. Type-check changed files with basedpyright, run targeted tests, rebuild affected bundles, then run just check.

Keep runtime code stdlib-first

  • Target Python 3.12. Use its language and typing features directly; do not add compatibility code for older versions.
  • Treat the standard library as the default dependency budget for bundled helpers under src/. Any third-party runtime dependency must be pure Python and admitted to requirements/runtime.txt; bundle builds resolve internal and external hashes into an ephemeral requirements file.
  • Reuse the existing JSON-first, optional-YAML manifest boundary instead of importing PyYAML into new bundled modules.
  • Treat configured third-party imports as surface-specific exceptions: PyYAML for existing validators, docs tooling, and manifest/test paths; pytest for tests. A new dependency requires an explicit package and CI decision.
  • Prefer argparse, json, pathlib, tempfile, shutil, zipfile, collections, itertools, and contextlib over hand-written equivalents.

Model and validate data explicitly

  • Parse untrusted text with the appropriate stdlib parser, require the expected container shape, check required keys and value types, and raise a specific error at the boundary.
  • Convert validated mappings into frozen dataclasses or domain value types when named fields and invariants make the contract clearer.
  • Use TypedDict only when a mapping must remain a mapping. It documents a static shape; it does not validate runtime input.
  • Use Enum or Literal for closed value sets and Protocol for structural interfaces that have multiple real consumers.
  • Fully annotate function and public-method boundaries. Omit obvious local annotations when inference is clear.
  • Do not pass raw structured dictionaries beyond the parsing boundary when a named record makes the contract clearer.

Preserve skill package boundaries

  • Keep skill runtime under src/easy_cheese/skills/<skill_name>/ and declare its CLI surface in commands.py.
  • Move code to src/easy_cheese/shared/ only when multiple existing skills need the same behavior; bundle it into each owning archive.
  • Do not import another skill's internals. Each archive carries its complete pure-Python runtime closure.
  • Keep cross-skill orchestration in the owning workflow seam, not a leaf helper. Communicate through public or persisted contracts to avoid reverse dependencies and cycles.
  • Never edit skills/<skill>/scripts/<skill>.pyz by hand. Run just wedge-build after changing archive inputs and just wedge-check to verify committed archives.
  • Keep CLI modules thin: accept argv, return an integer status, print diagnostics to stderr, and propagate failure through a nonzero exit.
  • Keep .github/scripts/ validators read-only. They inspect and report; they do not mutate the workspace.

Prefer succinct, readable Python

  • Use match for genuine shape-based dispatch; keep a simple if for a binary decision.
  • Use a handler mapping for stable command-to-function dispatch; do not create a registry for one or two branches.
  • Use an assignment expression only when it removes a repeated computation or clarifies a loop condition.
  • Use any, all, comprehensions, and generator expressions for pure collection queries or transformations. Keep a loop when it carries state, side effects, or clearer early exits.
  • Prefer generators when the result is consumed once.
  • Use enumerate, direct iteration, f-strings, context managers, and pathlib instead of manual indexing, string assembly, cleanup, or path manipulation.
  • Ignore only named, intentional failures. Never use a bare except, swallow Exception, return an empty default on failure, or use contextlib.suppress(Exception).
  • Keep new top-level functions at 40 lines or fewer unless one contiguous algorithm is clearer than an artificial split.
  • Prefer one c
Полный SKILL.md на GitHub

Установить python-authoring в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл python-authoring?

Write, edit, refactor, or review Python in easy-cheese with concise stdlib-first code, Python 3.12, wedge .pyz packaging, and repository test and validation conventions. Use for Python changes under src/, scripts/, .github/scripts/, or tests/, especially when the user asks for Pythonic, succinct, de-slopped, dataclass-based, CLI, validator, or bundled-helper code.

Как установить скилл python-authoring?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл python-authoring запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить python-authoring с