
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.
- Installs
- 479
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/paulnsorensen/easy-cheese --skill python-authoring- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads python-authoring automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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
- Read the root configuration, owning skill, target exports, immediate callers, and nearby conventions.
- Keep every changed line traceable to the request. Do not invent orchestration, compatibility layers, abstractions, dependencies, or future flexibility.
- Put code in the owning package and preserve the bundle boundary.
- Validate untrusted input once at the boundary, then work with typed trusted data.
- Choose the clearest succinct Python construct; do not compress code until it becomes harder to read.
- Remove only slop introduced by the change and code that the change orphaned.
- 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 torequirements/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, andcontextlibover 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
TypedDictonly when a mapping must remain a mapping. It documents a static shape; it does not validate runtime input. - Use
EnumorLiteralfor closed value sets andProtocolfor 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 incommands.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>.pyzby hand. Runjust wedge-buildafter changing archive inputs andjust wedge-checkto 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
matchfor genuine shape-based dispatch; keep a simpleiffor 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, andpathlibinstead of manual indexing, string assembly, cleanup, or path manipulation. - Ignore only named, intentional failures. Never use a bare
except, swallowException, return an empty default on failure, or usecontextlib.suppress(Exception). - Keep new top-level functions at 40 lines or fewer unless one contiguous algorithm is clearer than an artificial split.
- Prefer one clear expression to verbose scaffolding, but split dense expressions when intermediate names explain intent.
De-slop before finishing
- Delete narration comments and docstrings that restate the code. Keep non-obvious rationale and public API documentation.
- Remove abstractions with one concrete consumer unless the current task requires the seam.
- Name values after domain concepts, not containers or implementation types.
- Consolidate repetitive tests by behavior; do not add shallow input-variation tests.
- Fix the underlying lint issue instead of adding a suppression.
Type-check with basedpyright
- Run
basedpyright <changed .py files>(fall back touvx basedpyrightif the binary is absent) before finishing. Changed files must report zero errors and warnings. - Repo config lives in
[tool.basedpyright]inpyproject.toml: include paths,pythonVersion = "3.12", and an execution environment pinningsrc/easy_cheese_schemasto 3.11 to honor the published wheel'srequires-python >=3.11.typeCheckingModeis deliberately unset — basedpyright defaults torecommended, which enables every rule with an error/warning split andfailOnWarnings, so a full run fails on warnings too. - The whole repo is basedpyright-clean and
just typecheck(wired intojust check,just ci, and the validate workflow) enforces zero errors and warnings. Any diagnostic your change surfaces is yours to fix before finishing — there is no baseline and no pre-existing backlog to defer to. Imports resolve against.venv-typing;just typecheck-install(re)creates it fromrequirements/typing.txt. - basedpyright is stricter than stock pyright; its extra rules are binding here: assign deliberately ignored call results to
_(reportUnusedCallResult), collapse implicit string concatenations, andcastuntrusted boundary reads to their validated type. - Load build-only modules that are excluded from wheels with
importlib.import_modulepluscast-typedgetattr, not static imports the checker cannot resolve. - Fix the type at its source. When a suppression is genuinely unavoidable, use rule-scoped
# pyright: ignore[ruleName], never a bare# type: ignoreor a file-wide switch —reportIgnoreCommentWithoutRuleflags unscoped ignores. - Use
--outputjsonwhen a tool needs machine-readable diagnostics. In GitHub Actions the CLI detects CI and emits inline PR annotations with no extra flags. - Read exit codes precisely: 0 clean, 1 diagnostics reported, 2 fatal internal error, 3 unreadable config, 4 bad CLI arguments. Treat 2–4 as tooling breakage to fix or report, never as type findings.
- The binary is mise-managed and pinned to an exact version (upstream recommends exact pinning for reproducibility); the
pyrightandpyright-langservershims resolve to basedpyright.
Test and finish
- Test observable behavior and the reason it matters; do not add assertions that can pass when the implementation is broken.
- Keep filesystem tests inside
tmp_pathor an equivalent temporary directory. Do not depend on user paths, repository-external state, network access, or auto-loaded pytest plugins. - Run the most focused affected tests first. Focused pytest and browser commands execute committed
skills/<skill>/scripts/<skill>.pyzarchives without rebuilding them. Keep repository imports unavailable when testing archive isolation. - After archive inputs change, run
just wedge-build, thenjust wedge-checkbefore focused tests execute an archive. Runjust update-generatedwhen generated runtime sources change. - Run
just checkas the final project gate.
Completion check
Confirm:
- Runtime imports obey the stdlib-first, surface-specific dependency policy.
- Boundary input is validated once and converted into an appropriate trusted representation.
- Code lives in the owning skill source or a justified shared module.
- Command registration, generated runtime sources, and committed archives match their inputs when applicable (
scripts/runtime_gates.py,just wedge-check). - CLI and validator failures remain loud, read-only validators remain read-only, and tests are hermetic.
- No silent failures, speculative abstractions, narration comments, unnecessary local annotations, or unrelated cleanup remain.
- Changed Python files pass basedpyright with zero errors and warnings.
- A fresh
just checkrun passed.
FAQ
What does the python-authoring skill do?
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.
How do I install python-authoring?
Run npx skills add https://github.com/paulnsorensen/easy-cheese --skill python-authoring in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/python-authoring/ (personal) or .claude/skills/python-authoring/ (project).
Which AI agents can use python-authoring?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is python-authoring safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains python-authoring?
It is published by paulnsorensen in paulnsorensen/easy-cheese. It has 479 recorded installs.
More from paulnsorensen/easy-cheese
cook
paulnsorensen/easy-cheese
Implement an approved spec or focused task through stale-safe source edits. Use this skill when the user says "implement this", "cook this spec", or "fix this bug". Use it for /cook .cheese/specs/ .md. Also use it when the user says "go" with clear acceptance criteria. Run it alone for an unambiguous task. Use --prototype when the user says "prototype this", "go prototype it", or "spike this out" and wants to refine the result round by round. A spec helps but is not required. Do not use it for fuzzy planning (/mold). Do not use it for no-write discussion (/culture) or review-only work (/age).
mold
paulnsorensen/easy-cheese
Turn a high-leverage design decision into a validated spec through grounded dialogue. Use it when a leverage trigger fires (auth, irreversible effects, concurrency, contracts, destructive ops, a new slice, a cross-slice dependency, an invariant gap) or when the user asks for a spec or design. Typical phrases include "let's design X", "shape this into a spec", "what should the API for Z look like", and "/mold". A feature ask with zero fired triggers is a /cook mini-spec, not a mold; route it through /cheese. Do NOT use it for free-form discussion without artifact intent (/culture), direct implementation (/cook), or research-only questions (/briesearch). Ceremony scales to the ask through references/tiers.md, so a small clear change gets a validated mini-spec without a write-approval turn.
age
paulnsorensen/easy-cheese
Review a diff, PR, branch, or path across thirteen dimensions. Emit a severity-grouped findings report. Use when the user wants a code review. Trigger on "review this", "/age", "is this safe to merge", or "find bugs". Also trigger on "spot security issues", "check for slop", "review my PR", or "what's wrong with this code". Review every requested dimension. Review all thirteen dimensions by default. Do not apply fixes. Route them to /cure. Do not harden tests; route that work to /press.
cure
paulnsorensen/easy-cheese
Apply selected fixes from an /age report, findings list, or CI failure. Run the project gates and hand a clean result to /plate. Use when the user wants selected findings resolved. Do not use for review, test authoring, or direct publication.
cheese
paulnsorensen/easy-cheese
Route an idea, path, pull request, issue, failure, question, or bare /cheese to the correct workflow skill. Use this skill for /cheese, routing requests, help requests, or opening messages without a named workflow skill.
culture
paulnsorensen/easy-cheese
Models problems and trade-offs without writing code or specifications. Use when a workflow needs silent reasoning, or the user asks for "/culture", "no writes", "rubber-duck this", or "these bugs feel connected". Not for specs (/mold), code (/cook), or bug diagnosis and fixes (/pasteurize).
Popular testing & qa skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
grilling
mattpocock/skills
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
migrate-to-shoehorn
mattpocock/skills
Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.
run-train
lllllllama/rigorpilot-skills
Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.
test-driven-development
obra/superpowers
Use when implementing any feature or bugfix, before writing implementation code
finishing-a-development-branch
obra/superpowers
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work