python-standards
Skill9 starsChanged 4 months agoMITView on GitHub
Python coding standards, testing patterns, and pydantic/typing conventions for the readme2demo codebase. Use when writing or reviewing any Python in src/readme2demo/ or tests/, adding a module, or before committing code changes.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- takayoshitoyoda05/claude-ml-templatetheir own version, first seen Oct 20, 2026
- pablolok/claude-skillstheir own version, first seen Oct 13, 2026
- microsoft/amplifier-module-tool-skillstheir own version, first seen Oct 13, 2026
- microsoft/amplifier-bundle-skillstheir own version, first seen Oct 13, 2026
- L-1124/QQMusicApitheir own version, first seen Oct 8, 2026
- motola10/claude-code-basetheir own version, first seen Jun 26, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- L-1124/QQMusicApi★ 529same name
- microsoft/amplifier-bundle-skills★ 12same name
- microsoft/amplifier-module-tool-skills★ 8same name
- rishapgandhi/python-skills★ 4same name
- motola10/claude-code-base★ 1same name
- pablolok/claude-skills★ 1same name
- takayoshitoyoda05/claude-ml-template★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- docs/llms.txtllms.txt
- add-engineSkill
- add-failure-classSkill
- debug-runSkill
- docker-sandboxSkill
- git-github-operatorSkill
- sandbox-toolchainsSkill
- vhs-videoSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 40
EVERY bug fix carries a regression test whose docstring starts """Regression (<repo> run): ...""" and describes the real failure.
- Very specific: line 45
Prefer table-style asserts on the actual artifact (the rendered commands.sh, the tape text, the guide markdown), not on internal state.
- Very specific: line 60
Run /ship-check. Minimum: full suite green, python -m compileall -q src/ clean, no runs/ or secrets staged.
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Python standards for readme2demo
Python ≥3.10. Match the surrounding code; these are the invariants.
Types & models
- Type hints on every public function signature; return types included.
- Data contracts are pydantic v2 models in
types.py— the single source of truth every stage serializes through. Add a field THERE first, never invent an ad-hoc dict that crosses a stage boundary. Usemodel_dump_json(indent=2)/model_validate_jsonfor run-dir I/O. Optional[X]for nullable; default containers viaField(default_factory=...).- New fields must be backward-compatible (defaulted) — old run dirs on disk must still load.
Purity boundary (enforced, not stylistic)
normalize.pyand every engineparse_transcriptare PURE and deterministic: no LLM calls, no network, no docker, no clock/random that changes output. They are tested against fixtures. If you need an LLM, you are in the wrong module.- LLM calls live only in ingest (planner), distill, tutorial — via
llm.py.
Docstrings
- One-line summary; then WHY when non-obvious. Regression-critical functions carry the failure they defend against (search for "Regression (" in tests).
- Public functions in the pipeline path get a docstring naming their invariant.
Testing (this is where the repo's value lives)
python -m pytest tests/ -qruns in <1s with NO docker/network/API. Keep it that way: mockllm.complete_json, feed fixture transcripts, build models inline. Anything needing real infra is marked@pytest.mark.integration.- EVERY bug fix carries a regression test whose docstring starts
"""Regression (<repo> run): ..."""and describes the real failure. It must fail on the old code. - For grounding/equivalence changes: test BOTH directions — the new-variant is accepted AND an unproven/evil command is still rejected.
- Prefer table-style asserts on the actual artifact (the rendered commands.sh, the tape text, the guide markdown), not on internal state.
Style
- stdlib > third-party; the runtime deps are deliberately few (typer, rich, pydantic, jinja2, anthropic). Don't add a dependency for something stdlib does.
subprocess.run(..., capture_output=True, text=True, timeout=..., errors="replace")is the house pattern for shelling out; always set a timeout.- Fail with a specific, actionable message (name the env var, the file, the fix command) — see the preflight and EngineError messages for the tone.
Before you commit
Run /ship-check. Minimum: full suite green, python -m compileall -q src/
clean, no runs/ or secrets staged.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

