Repository navigation
Calibrate python-best-practices to v1.3.0 (70 rules) - #2
Merged
Merged
Conversation
Cleanup/calibration pass responding to external review. Correct a misstated Python version claim, soften rules that over-reach on documented stdlib behavior, align root/per-skill docs with the current rule count and section order, and add one new rule for preserving tracebacks when logging handled exceptions. Rule fixes: - data-sentinel-when-none-is-valid: drop false typing.Sentinel 3.13 claim (PEP 661 is Draft, targets 3.15); fix __repr__ to "UNSET"; soften ban on object() sentinels since PEP 661 itself shows it. - simplify-extract-after-duplication: rename to reflect drift-risk framing; resolve 2-vs-3-copy mismatch between SKILL.md and body. - perf-compile-regex-module-level: acknowledge re module's internal cache for module-level calls; pitch is readability + hot-path lookup avoidance, not recompilation fear. - perf-combine-iterations: drop third-party toolz suggestion; reference itertools stdlib building blocks instead. - imports-scope-helpers-to-usage: rewrite to promote substantial logic to module scope rather than encouraging nested-function clutter. New rule: - error-log-exception-context: use logger.exception(...) inside except blocks; preserve tracebacks when recovering from failures. Cross-references: - data-explicit-variants <-> data-discriminated-unions link both directions (behavior split vs. data shape split). - api-model-cohesion links to data-derive-dont-store. Docs harmonization: - Root README: "50+ rules" -> 70; current section order and typical impacts replace stale Critical tiers. - Per-skill README: section order now matches SKILL.md and _sections.md; impact column added to section table. - Root AGENTS.md philosophy: observational framing replaces "shortcut the agent is tempted to take," matching per-skill tone. - SKILL.md + metadata.json bumped to 1.3.0 / 70 rules. - Regenerated AGENTS.md and test-cases.json. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cleanup/calibration pass responding to external review. The skill was already close to the Vercel shape philosophically, but had doc drift, one materially wrong Python-version claim, and a few rules that over-reached on documented stdlib behavior. This PR fixes those issues and adds one high-signal rule to land at 70 rules.
typing.Sentinel("UNSET")3.13 claim (PEP 661 is still Draft, targets 3.15). Softenperf-compile-regex-module-levelto acknowledge theremodule's internal cache for module-level calls. Remove the third-partytoolzsuggestion fromperf-combine-iterations. Rewriteimports-scope-helpers-to-usageso it doesn't implicitly encourage nested-function clutter. Resolve the 2-vs-3-copy mismatch insimplify-extract-after-duplication.error-log-exception-context— preserve tracebacks when logging handled exceptions (logger.exception(...)insideexcept, orexc_info=...outside one). Brings rule count to 70.README.mdand per-skillREADME.mdnow matchSKILL.mdand_sections.mdon rule count (70), section order (Data, Error, Types, API, Simplification, Performance, Naming, Imports), and typical impact per section. RootAGENTS.mdphilosophy rewritten to the observational tone used in the per-skill template (no more "shortcut the agent is tempted to take"). Version bumped to 1.3.0.data-explicit-variants↔data-discriminated-unionsnow link both directions (behavior split vs. data-shape split).api-model-cohesionlinks todata-derive-dont-store.🤖 Generated with Claude Code