Pythonic
Write, edit, refactor, or review Python in easy-cheese with concise stdlib-first code, Python 3.12, self-contained .pyz packaging, and repository test and validation conventions. Use for Python changes under src/, shared/scripts/, scripts/, .github/scripts/, or tests/, especially when the user asks for Pythonic, succinct, de-slopped, dataclass-based, CLI, validator, or bundled-helper code.From its SKILL.md
npx -y skills add paulnsorensen/easy-cheese --skill pythonicAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 15 stars15 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
- runs commandsInstructs the agent to run 2 commands, including `just check` and 1 more.
SKILL.md
6.2 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
Pythonic
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/pythonic/; do not mirror it into the published skills/ tree or add agents/openai.yaml.
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.
- 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 dependency budget for bundled helpers under
src/andshared/scripts/. Do not add Pydantic, Requests, pandas, or another runtime dependency. - 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 a skill-owned executable helper in its registered
src/<skill>/source directory. - Move code to
shared/scripts/only when multiple existing skills need the same behavior. - Register executable subcommands in
scripts/build_pyz.pyunderSKILLS. UseShared(...)for shared entry points andEXTRA_MODULESonly for an explicit cross-skill source dependency. - Do not casually import another skill's internals. Each generated bundle must contain only its owning source plus explicitly registered local or shared dependencies.
- Never edit
skills/<skill>/scripts/*.pyzby hand. Runjust bundleafter changingsrc/,shared/scripts/, or bundle registration, and commit the regenerated bundle with its source when publication is in scope. - 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
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.
- Delete narration comments and docstrings that restate the code. Keep non-obvious rationale and public API documentation.
- Prefer one clear expression to verbose scaffolding, but split dense expressions when intermediate names explain intent.
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. - For bundle changes, exercise the generated
.pyzwith repository imports unavailable and verify cross-skill code is absent unless explicitly registered. - Run the most focused affected tests first.
- Run
just bundlewhen bundle inputs changed. - 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.
- Bundle registration and generated
.pyzfiles match their sources when applicable. - 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.
- A fresh
just checkrun passed.