Use to mine ../airlineops for governance habits gzkit lacks; produces a parity scan report (gzkit leads, AirlineOps adopts).
日本語の概要は準備中です。原文の説明を表示しています。
Use after gz-pythonic-pattern-detect marks a candidate applied, to capture the rewrite's before/after proof.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Apply a Pythonic-pattern rewrite to a single candidate flagged by gz-pythonic-pattern-detect, then capture the before/after as a structured evidence file. The chore behind this skill (pythonic-design-pattern-application) records the corpus the team learns from — same shape as ARB receipts for QA claims (AGENTS.md § Attestation), but for refactor moves.
candidate: a row from the most recent pythonic-design-pattern-detection candidates report (file:line + class name)pattern_target: the Pythonic refactor target named in the report (e.g. "first-class function", "@functools.singledispatch")python_example (when DESIGN_PATTERNS_ARCHIVE is set): the archive path (Python/src/<Pattern>/Conceptual/main.py) used as the role-map witness. The archive is a third-party asset gzkit does not ship..gzkit/chores/pythonic-design-pattern-application/proofs/application-YYYY-MM-DD-HHMMSS-<short-slug>.mdarb-step-unittest-<timestamp>) cited inline_[applied | deferred | not-pythonic-rewrite]_ to applied: <evidence-file-path>CHORE-LOG.md entry recording the chore executionOpen the chosen candidate's row in the most recent detection report. Note the local archive example path (Python/src/<Pattern>/Conceptual/main.py) used as the absorption reference for the rewrite shape.
When DESIGN_PATTERNS_ARCHIVE is set, read the example and its Output.txt from that archive and record the role map before editing: roles observed, roles preserved, roles collapsed, and the Python construct that will carry the behavior. When it is unset, record the absence in the evidence file and mark the role map unwitnessed (chore § Python example corpus requirement).
Capture before-state metrics:
uv run xenon --max-absolute C --max-modules C --max-average C src/ > /tmp/xenon-before.txt 2>&1 || true
uv run radon raw src/ -s > /tmp/radon-before.txt 2>&1 || true
Write a semantics-pinning test for the candidate's behavior — not its shape. The test must derive from the operator-facing purpose the code serves, per .gzkit/rules/tests.md § Red-Green-Refactor (tests assert semantics, not strings — invariant 6f). Run it before the rewrite: it must pass against the class form. A RED here means the test does not describe current behavior (fix the test) or it found a defect (stop and route it per AGENTS.md § Defect-fix routing). The same test, unchanged, must pass after the rewrite.
Apply the Pythonic rewrite. Match the target named in the candidate row. If the example-derived target turns out to be wrong for this case, do NOT settle for "close enough" — either pick a different Pythonic target with an explicit rationale, or escalate to operator review.
Run the test under ARB to produce the GREEN receipt:
uv run gz arb step --name unittest -- uv run unittest-parallel -t . -s tests --buffer
Capture the receipt ID printed (arb-step-unittest-<timestamp>).
Capture after-state metrics:
uv run xenon --max-absolute C --max-modules C --max-average C src/ > /tmp/xenon-after.txt 2>&1
uv run radon raw src/ -s > /tmp/radon-after.txt 2>&1
Confirm xenon did not regress (still C/C/C). If it did, the rewrite has compounded complexity rather than reduced it — revert and re-design.
Author the evidence file at .gzkit/chores/pythonic-design-pattern-application/proofs/application-YYYY-MM-DD-HHMMSS-<short-slug>.md per the template in .gzkit/chores/pythonic-design-pattern-application/CHORE.md. Include:
Output.txt pathUpdate the detection report row from _[applied | deferred | not-pythonic-rewrite]_ to applied: .gzkit/chores/pythonic-design-pattern-application/proofs/<filename>.md.
Mark the chore as run:
uv run gz chores run pythonic-design-pattern-application
not-pythonic-rewrite after all and update the detection row accordingly.unittest directly instead of through gz arb step. The corpus needs the receipt ID, not a narrative claim. Re-run under ARB.candidates-*.md files and back-link manually.These thoughts mean STOP — you are about to ship an evidence file that broke its own discipline:
| Thought | Reality |
|---|---|
| "I'll skip the semantics test — the rewrite is obviously equivalent" | Without a behavior-pinning test, the rewrite is unverified. The corpus is the product; un-evidence-able rewrites add noise, not signal. |
| "xenon regressed by one rank, but the after-form is cleaner" | Cleaner-by-eye + heavier-by-metric is the precise failure mode this chore catches. Revert; pick a different target. |
| "I'll bundle three Strategy-class rewrites into one file to save time" | One file per applied candidate is the canon. Bundles lose per-candidate signal. |
"I'll cite unittest -q exit-zero in lieu of an ARB receipt" | Same fabrication failure as ARB receipt fabrication elsewhere — the receipt ID is the proof, not the claim. |
"The detection row says 'first-class function' but I made it a @cached method" | Faithfulness to the named target is the rule. If the target is wrong for this case, name why in the rationale; do not silently deviate. |
"I'll mark the detection row applied without back-linking the evidence" | Orphan applications break the audit trail. The two reports are paired; neither stands alone. |
| "I already know Strategy/Visitor/etc.; I don't need the example" | The local Python example is the witness for role mapping. Without it, the evidence is narrative recall. |
.gzkit/chores/pythonic-design-pattern-application/proofs/assert body matching operator-facing purposeexit_status=1 (an authored RED receipt is itself a defect — see AGENTS.md § Attestation: "A fabricated receipt ID is a fabricated claim").gzkit/chores/pythonic-design-pattern-application/CHORE.mdgz-pythonic-pattern-detect (candidate surfacing)$DESIGN_PATTERNS_ARCHIVE (your own copy; not shipped), Python/src/<Pattern>/Conceptual/main.py.gzkit/rules/tests.md § Red-Green-Refactor (TDD discipline; tests assert semantics, not strings — invariant 6f)complexity-reduction-xenon (the non-regression check this skill cites), gz-arb (the receipt-emitting wrapper)まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
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.
日本語の概要は準備中です。原文の説明を表示しています。