Use to mine ../airlineops for governance habits gzkit lacks; produces a parity scan report (gzkit leads, AirlineOps adopts).
日本語の概要は準備中です。原文の説明を表示しています。
Use when gates are green but code still looks Java-flavored, to surface Pythonic refactor candidates.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Run the pythonic-design-pattern-detection chore to surface structural refactor candidates that mechanical metric chores (pythonic-refactoring, complexity-reduction-xenon, module-sloc-cap-radon) cannot catch. The chore's scanner walks src/ AST-by-AST and flags class shapes whose Pythonic equivalent is cleaner — paired with the Python examples of a local Refactoring Guru archive (DESIGN_PATTERNS_ARCHIVE) as the absorption surface.
root: source tree to scan (default src)out: markdown candidates report path. The scanner requires --out and has no default; the convention is .gzkit/chores/pythonic-design-pattern-detection/proofs/candidates-YYYY-MM-DD.mdxenon_band (optional): xenon hot-spot band to cross-reference, default BDESIGN_PATTERNS_ARCHIVE (optional): path to your own copy of the local Refactoring
Guru archive. No default — it is a third-party asset gzkit does not ship, and a
hardcoded default resolves only on the machine that authored it (GHI #900). Unset,
the corpus step is skipped and the chore records the disposition as provisional.out path enumerating every match with file:line, class name, AST signal, Pythonic refactor target, local Python example path, output path, role map, and Pythonic collapsexenon-hotspots-YYYY-MM-DD.txt cross-reference under the same proofs/CHORE-LOG.md entry recording the chore executionConfirm chore is registered:
uv run gz chores show pythonic-design-pattern-detection
Run scanner self-test before scanning real source — proves the detector set still recognises its own fixtures:
uv run python .gzkit/chores/pythonic-design-pattern-detection/scan.py --self-test
Run the scanner against src:
uv run python .gzkit/chores/pythonic-design-pattern-detection/scan.py \
--root src \
--out .gzkit/chores/pythonic-design-pattern-detection/proofs/candidates-$(date +%Y-%m-%d).md
Cross-reference complexity hotspots:
uv run xenon --max-absolute B src/ \
> .gzkit/chores/pythonic-design-pattern-detection/proofs/xenon-hotspots-$(date +%Y-%m-%d).txt 2>&1 || true
Open the candidates report. For each candidate:
Python/src/<Pattern>/Conceptual/main.py plus Output.txt when present) as the role-map witness. With DESIGN_PATTERNS_ARCHIVE unset, record that the corpus was unavailable and mark the disposition provisionalExample, Output, Role map, and Pythonic collapse in the candidate row before deciding dispositionapplied, deferred, or not-pythonic-rewriteapplied: route to gz-pythonic-pattern-apply to capture evidencedeferred: file or cite a tracking GHI, paste the issue number into the rownot-pythonic-rewrite: name the concrete reason inline (the class shape genuinely fits — e.g. State machine with many transitions)For reference-mode patterns (Bridge, Flyweight, Factory Method) — open the matching archive example side-by-side with any module ranked B-or-worse by xenon. Add an inline ## Reference-mode candidates section to the report.
Run the chore's acceptance criteria. gz chores run executes acceptance.json — the full uv run gz test suite and the scanner self-test — and appends the result to proofs/CHORE-LOG.md:
uv run gz chores run pythonic-design-pattern-detection
scan.py and the failing fixture; either fix the detector or update the fixture if the rewrite was intentional.--out omitted: the scanner exits 2 with a usage error; pass the report path. It creates the parent directory itself.gz chores show cannot find the chore: the project copy is missing or damaged. Run uv run gz chores doctor --dry-run first and sync any unsynced .gzkit/chores/ edits, because repairing a damaged slug rewrites its surviving definition files (.gzkit/rules/chores.md § Two-Surface Layout); then uv run gz chores doctor restores it and keeps proofs/.NO_CANDIDATES_DETECTED): AST signals returned zero hits. Switch to reference-mode review against local Python examples; do not assume the codebase is Pythonic everywhere — Bridge, Flyweight, Factory Method are not detected mechanically.uv run python .gzkit/chores/pythonic-design-pattern-detection/scan.py — never a shadow scannerapplied/deferred/not-pythonic-rewrite) before the chore is considered done for this period.gzkit/chores/pythonic-design-pattern-detection/proofs/ — never elsewhereapplied dispositions route to gz-pythonic-pattern-apply for evidence capture; orphan applications (no detection-report row) are a defectThese thoughts mean STOP — you are about to ship a detection pass that broke its own discipline:
| Thought | Reality |
|---|---|
| "I'll skip the self-test, the scanner worked yesterday" | Detector drift is silent. Self-test is a 1-second guard against authoring fake reports. |
"I'll mark all candidates not-pythonic-rewrite to clear the queue" | The disposition is a per-candidate judgment, not a queue-clearer. False not-pythonic-rewrite is dishonest triage. |
| "The reference-mode patterns aren't detected, so I'll skip them" | Reference-mode exists because AST detection misses them. Skipping reference-mode collapses the chore to mechanical-only. |
| "AST said zero candidates, the codebase must be clean" | Bridge, Flyweight, Factory Method need eye-review against the local examples. Trust the examples, not the absence of AST hits. |
| "I know the pattern already" | The local Python example is the observed role-map witness. Skipping it turns the chore back into memory-driven pattern matching. |
"I'll run gz chores run before completing dispositions, log first" | The CHORE-LOG records execution, not completeness. Disposition triage must precede the run, or the log is a lie. |
gz-pythonic-pattern-apply--self-test before a real scan.gzkit/chores/pythonic-design-pattern-detection/proofs/Python/src/<Pattern>/Conceptual/main.py evidencetests/ or features/ (excluded by default — do not override without reason).gzkit/chores/pythonic-design-pattern-detection/CHORE.md.gzkit/chores/pythonic-design-pattern-detection/scan.pyPython/src/<Pattern>/Conceptual/main.py inside the archive DESIGN_PATTERNS_ARCHIVE points at (not shipped; GHI #900)gz-pythonic-pattern-apply (evidence capture for applied refactors)pythonic-refactoring (idiom-level), complexity-reduction-xenon (metric-level)CHORE.md § Pythonic-first absorption stance, .gzkit/rules/tests.md § Tests assert semantics, not stringsまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Use to mine ../airlineops for governance habits gzkit lacks; produces a parity scan report (gzkit leads, AirlineOps adopts).
日本語の概要は準備中です。原文の説明を表示しています。
Use to file a GitHub issue when a finding needs its own work order or the operator asks; OBPI corrections stay in its change log.
日本語の概要は準備中です。原文の説明を表示しています。
Use to do the work a GHI describes, verify it and close the issue with evidence in one sweep.
日本語の概要は準備中です。原文の説明を表示しています。
Use to triage the open GHI queue before planning or choosing what to pull; produces a ranked deliverable.
日本語の概要は準備中です。原文の説明を表示しています。
Run the guarded repository sync ritual; commit-time hooks enforce the cheap gates and the pre-push hook runs gz check.
日本語の概要は準備中です。原文の説明を表示しています。
Run the guarded repository sync ritual; the hooks your pre-commit config declares enforce the quality gates.
日本語の概要は準備中です。原文の説明を表示しています。