본문으로 건너뛰기
cccskills
무료GitHub에 공개

gz-complexity-advisor

Use when the operator says "preview complexity advisor", "complexity diagnosis" or "intrinsic complexity attestation".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

gz-complexity-advisor

Run gz complexity advise, the trigger-time surface of the complexity-doctrine cluster (ADR-0.0.27 corpus, 0.0.28 thresholds, 0.0.29 advisor, 0.0.30 authoring guidance). It measures per-function radon_cc in a file or directory, and for every function that crosses an advise, warn or block band of .gzkit/rules/complexity-thresholds.json it emits a diagnosis: archetype, doctrinal frame, proof ranges and recommended move. It exits 3 when any crossing is in the block band and 0 otherwise.

The table's radon_cc bands are stricter than the xenon ceiling the pre-commit hook enforces (.gzkit/rules/pythonic.md § Size Limits & Refactoring), so a tree that commits cleanly can still exit 3 here.

This skill ends at the diagnosis. It does not refactor, and it does not attest on the operator's behalf.

When to Use

  1. Ad-hoc preview-before-fail — see the diagnosis for a file before xenon refuses a commit.
  2. After a xenon failure — the auto-chain hook is not installed in this repository, so run the advisor by hand on the files xenon named.
  3. Irreducible complexity — the operator wants to record that a function's complexity is intrinsic.

Ad-hoc preview

uv run gz complexity advise src/gzkit/commands/validate_cmd.py
uv run gz complexity advise src/gzkit/ --json

Output Contract

Declared form: structured prose (default human-readable). Each diagnosis prints Metric | Band | Value | Archetype, then Authority, Citation, Excerpt, Recommended, and File with the line range and node kind, followed by the function's source. --auto-chain selects the condensed commit-time presentation instead.

Machine-readable mode: --json emits an array of AdvisorDiagnosis objects with metric, crossing_band, crossing_value, archetype, doctrinal_frame, proof, recommended_move and intrinsic_attestation.

When no archetype rule in data/advisor_archetype_rules.json matches a crossing, the archetype is unclassified: the doctrinal frame and move are the metric's general ones, not an archetype's. No rule covers the advise band, so every advise-band crossing is unclassified.

Auto-chain hook

.pre-commit-config.yaml runs plain xenon. The composite hook complexity-advisor-auto-chain (OBPI-0.0.29-05) is installed only by uv run python -m gzkit.hooks.install_complexity_advisor. Once installed, it runs xenon and, on failure, diagnoses the staged Python files in its own process, printing to stderr and failing the commit on a block crossing. It wraps the advisor in a timeout, .gzkit.json § advisor_timeout_seconds (30 seconds when unset) unless the hook is run with --timeout; on timeout it lets the commit through and appends a record to .gzkit/insights/advisor-failures.jsonl. Skip it for one commit with SKIP=complexity-advisor-auto-chain git commit.

Intrinsic-complexity attestation

Two paths exist. Either one makes gz complexity advise and the auto-chain hook print intrinsic complexity attested by '<attestor>' on <date>: <reason> for that function instead of a diagnosis, so it no longer fails the run.

  • @intrinsic_complexity(reason=..., attestor=...) on the function, with both arguments as non-empty string literals: the advisor reads the declaration from the parsed source, never importing the file. Use it for known-irreducible functions whose complexity will not change.
  • --attest-intrinsic takes <file_path>:<qualname> as the path, plus --reason and --attestor (a handle, never a real name; an omitted --attestor takes .gzkit.json § authorship.attestor_handle). It refuses a function that crosses no band and refuses without an interactive terminal. The operator types ATTEST to confirm, and it appends an intrinsic-complexity-attestation event to the ledger, whose shape gz validate --intrinsic-attestation checks. Later advisor runs honour it, matched on the resolved file path and qualname.

The operator runs --attest-intrinsic themselves; the agent drafts the reason.

uv run gz complexity advise src/gzkit/commands/adr_audit.py:_collect_obpi_findings --attest-intrinsic \
  --reason "<why this complexity is intrinsic>" --attestor g0

Related

  • Manpage: docs/user/manpages/complexity-advise.md
  • Runbook: docs/user/runbook.md § Governance Doctrine Surfaces
  • Sister skill: gz-complexity-guide (authoring-time hints)
  • Parent ADR: docs/design/adr/foundation/ADR-0.0.29-complexity-advisor/
  • Threshold table: .gzkit/rules/complexity-thresholds.json (ADR-0.0.28)
  • Distillation: gz-complexity-distill

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use to mine ../airlineops for governance habits gzkit lacks; produces a parity scan report (gzkit leads, AirlineOps adopts).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tvproductions/gzkit92026년 10월 21일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tvproductions/gzkit92026년 10월 21일 업데이트

ghi-close

무료

Use to do the work a GHI describes, verify it and close the issue with evidence in one sweep.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tvproductions/gzkit92026년 10월 21일 업데이트

Use to triage the open GHI queue before planning or choosing what to pull; produces a ranked deliverable.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tvproductions/gzkit92026년 10월 21일 업데이트

git-sync

무료

Run the guarded repository sync ritual; commit-time hooks enforce the cheap gates and the pre-push hook runs gz check.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tvproductions/gzkit92026년 10월 21일 업데이트

git-sync

무료

Run the guarded repository sync ritual; the hooks your pre-commit config declares enforce the quality gates.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

tvproductions/gzkit92026년 10월 21일 업데이트

tvproductions의 스킬 모두 보기

이 스킬의 문제 신고