td-python-coding-guidelines
Skill12 starsChanged 6 months agoApache-2.0View on GitHub
Use when writing or reviewing Python code, fixing lint/docstring/import/naming/exception/type annotation issues, unifying team style, or migrating `.py` files toward Google style.
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- brainstormingSkill
- change-verificationSkill
- context-packet-fastpathSkill
- core-workflow-contractSkill
- developer-workflowSkill
- development-branch-closeoutSkill
- dispatching-parallel-agentsSkill
- evolution-loopSkill
- executing-plansSkill
- frontend-designer-workflowSkill
- frontend-design-guardrailsSkill
- quality-assurance-workflowSkill
- repo-init-gateSkill
- repo-init-manual-fallbackSkill
- repo-init-officialSkill
- repo-init-scanSkill
- root-cause-fixer-workflowSkill
- root-cause-investigationSkill
- search-fastpathSkill
- security-reviewer-workflowSkill
- senior-project-expertSkill
- senior-project-expert-workflowSkill
- spec-execution-fastpathSkill
- specification-writer-workflowSkill
- spec-review-gauntletSkill
- structured-reviewSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- target-instructions-bootstrapSkill
- target-memory-bootstrapSkill
- target-spec-bootstrapSkill
- td-java-coding-guidelinesSkill
- technical-architect-workflowSkill
- test-driven-developmentSkill
- verification-before-completionSkill
- web-experience-auditSkill
- workspace-isolationSkill
- writing-plansSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 32
Do not load everything at once.
- Distinctive: line 36
If existing repository conventions conflict with PyGuide, follow the target repository convention and explicitly mention the difference.
- Distinctive: line 45
Prefer small, low-risk changes.
- Distinctive: line 46
Keep import, naming, docstring, exception, and type annotation styles consistent.
- Very specific: line 47
When suppressing lint, explain why and keep the suppression as narrow as possible, such as a line-level or block-level # pylint: …
- Distinctive: line 48
Test modules may be lighter than production modules for docstrings and overridden method descriptions, but empty or uninformative comments …
- Very specific: line 54
Writing or changing code: read references/style-rules.md, then references/language-rules.md.
- Very specific: line 55
Handling exceptions or reviewing error paths: read references/exceptions.md.
- Very specific: line 56
Adding type annotations or migrating typing: read references/type-annotations.md.
- Very specific: line 57
Code review: use the A-N checklist in references/review-checklist.md and follow its output template.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Google Python Coding Guidelines (Google PyGuide)
Aligned with the official document: https://google.github.io/styleguide/pyguide.html.
Coverage: section 2 language rules (2.1-2.21) and section 3 style rules (3.1-3.19).
Reference Files
| File | Scope | When To Load |
references/language-rules.md | Section 2.1-2.21 language-level rules: lint, imports, exceptions, default values, truthiness, decorators, threading, __future__, general type-annotation rules, and related topics. | Before writing or refactoring code. |
references/style-rules.md | Section 3.1-3.18 style-level rules: semicolons, line length, whitespace, comments, docstrings, strings, logging, TODOs, import formatting, naming table, main, and function length. | When writing, formatting, or standardizing style. |
references/exceptions.md | Deep dive for section 2.4: assert boundaries, custom exceptions, the two catch-all exceptions, exception chaining, Raises: constraints, and anti-patterns. | When handling exceptions or reviewing error paths. |
references/type-annotations.md | Section 2.21 and 3.19.1-3.19.16 type annotation details: NoneType, TypeAlias, TypeVar, generics, TYPE_CHECKING, and related topics. | When annotating public APIs, refactoring types, or migrating typing usage. |
references/review-checklist.md | A-N review checklist with an output template. | During code review. |
Workflow
- Identify the task type
- Writing or refactoring code: read
style-rules.mdandlanguage-rules.md. - Exception handling: read
exceptions.md. - Type annotations or typing migration: read
type-annotations.md. - Code review: use
review-checklist.md. - Bulk style migration: handle imports, naming, and docstrings first; then exceptions and type annotations; then run lint and tests.
- Writing or refactoring code: read
- Load references on demand
- Do not load everything at once. Choose the one or two files most relevant to the task.
- Implement changes or provide review comments
- Provide executable fixes, not just descriptions of problems.
- If existing repository conventions conflict with PyGuide, follow the target repository convention and explicitly mention the difference.
- In change or PR descriptions, tag each change with its topic, such as imports, naming, docstring, exceptions, typing, and so on.
- Keep output traceable
- Classify review comments as
Critical,Major, orMinorby using the output template at the end ofreview-checklist.md. - In change summaries, state whether behavior changed. The default expectation is no behavior change.
- Classify review comments as
Constraints
- Prefer small, low-risk changes. Avoid unrelated refactors.
- Keep import, naming, docstring, exception, and type annotation styles consistent.
- When suppressing lint, explain why and keep the suppression as narrow as possible, such as a line-level or block-level
# pylint: disable=xxx. - Test modules may be lighter than production modules for docstrings and overridden method descriptions, but empty or uninformative comments are still forbidden.
- Public APIs must have type annotations. Nullable types must be explicit, such as
X | None. Prefercollections.abc.*abstract containers. Raises:should list only exceptions that are part of the API contract. Do not list exceptions caused by API misuse.
Quick Entry Points
- Writing or changing code: read
references/style-rules.md, thenreferences/language-rules.md. - Handling exceptions or reviewing error paths: read
references/exceptions.md. - Adding type annotations or migrating typing: read
references/type-annotations.md. - Code review: use the A-N checklist in
references/review-checklist.mdand follow its output template. - Bulk style migration: imports / naming / docstrings -> exceptions -> type annotations -> lint / tests.
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.

