From hatch3r
Verifies maintainability before commit/release via 8 gates: duplication index, cyclomatic complexity, expand-contract migrations, API breaking changes, ADR presence.
How this skill is triggered — by the user, by Claude, or both
Slash command
/hatch3r:hatch3r-maintainability-verifyThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill defines what "done" means for any feature shipping code, schema migrations, or API spec changes. Run before declaring a feature complete. The 8 gates below mix automated checks (machine-checkable on every PR) with one release-cadence gate (API breaking-change diff at release-cut). Skipping any gate = the feature is not done. Reviewer approval and passing tests alone do not satisfy th...
This skill defines what "done" means for any feature shipping code, schema migrations, or API spec changes. Run before declaring a feature complete. The 8 gates below mix automated checks (machine-checkable on every PR) with one release-cadence gate (API breaking-change diff at release-cut). Skipping any gate = the feature is not done. Reviewer approval and passing tests alone do not satisfy this bar — a destructive single-deploy schema change ships data loss; a breaking change without a major bump breaks consumers silently.
Inputs the skill expects:
src/ source modules (or equivalent).migrations/, db/migrations/, prisma/migrations/, or framework-equivalent.openapi.yaml, openapi.json, *.proto, GraphQL SDL).docs/adr/, doc/adr/) when architectural decisions are touched.jscpd (duplication), eslint with complexity rule (JS/TS) or radon (Python) or lizard (polyglot), oasdiff (REST), buf breaking (Protobuf), graphql-inspector diff (GraphQL).Outputs the skill produces: an 8-line verdict block written to the PR conversation, plus a JSON artifact at .audit-workspace/maintainability-verify-<sha>.json for downstream consumption by hatch3r-release.
Before any work, scan the invocation for unresolved questions in scope, intent, acceptance criteria, target environment, or irreversibility. If any are found, ask the user via the platform-native question tool per agents/shared/user-question-protocol.md. Default path, not exception. Triggers for THIS skill: module scope (single directory vs package boundary vs whole repo), gate selection (duplication-only vs complexity-only vs migration-only vs API-breaking-only vs full), threshold tier per maturity (solo vs team vs scaleup vs enterprise), and refactor authority (propose extraction vs report-only).
Fan-out scales with task size; token cost never justifies serializing independent work (rules/hatch3r-fan-out-discipline.md P8 B2; agents/shared/efficiency-patterns.md). Emit sub_agents_spawned: { count, rationale } in your output.
This skill is the verification HARNESS — it declares HOW each maintainability gate is checked. The DISPATCHER that decides WHEN to run it is the CQ specialist agent:
agents/hatch3r-maintainability.md — invokes this skill as the closing maintainability gate (CQ8) on PRs touching code, schema, or API spec. The agent contributes the review trigger and Phase-4 dispatch; this skill contributes the 8-gate procedure.No duplication: the agent decides WHEN, this skill defines HOW.
npx jscpd <scope> --threshold 5 --reporters json --output .jscpd-report.json --min-lines 30 --min-tokens 50.jscpd.dev.grep -rE '(<NamedPattern>)' <diff-paths> against the named-pattern list in rules/hatch3r-code-standards.md.reused / (reused + newly-authored) ≥ 0.70.complexity: ["error", 10].radon cc -n C <scope> (grades C and below = complexity >10).lizard --CCN 10 <scope>.file:line + CCN score. Refactor recommendation cites the named extraction pattern (guard clause / strategy / table-driven dispatch / early return).mtime of API-reference docs minus latest mtime of the corresponding spec file.git log --follow on the spec file to detect undocumented behavioral changes.rules/hatch3r-migrations.md.pt-online-schema-change / gh-ost / platform-native online DDL).oasdiff breaking <base> <head> exit-code 0 (450+ breaking-change rules per oasdiff.com).buf breaking --against <base> exit-code 0.graphql-inspector diff <base> <head> with no BREAKING rule hits.Sunset (RFC 8594) + Deprecation (RFC 9745) headers required per rules/hatch3r-api-versioning.md when intentionally removing a stable endpoint behind a major-version bump.rules/hatch3r-code-standards.md ADR-trigger list), an ADR file exists under docs/adr/ (or doc/adr/).All 8 gates pass = the feature is "done". Anything less = not done.
The orchestrator running this skill emits a single-line verdict per gate (GATE_N: PASS|FAIL <evidence-path>) and aggregates them. One FAIL on a required gate blocks the merge regardless of reviewer approval status.
Failure escalation per agents/hatch3r-maintainability.md Boundaries → Never section: API breaking change on stable endpoint without major bump → CRITICAL; destructive single-deploy schema change → CRITICAL; missing ADR on decision-class change → High; complexity threshold breach on a single function → Medium; duplication index 5-10% → Medium; >10% → High.
migrations/, db/migrations/, prisma/migrations/.openapi.yaml, openapi.json, *.proto, GraphQL SDL.rules/hatch3r-migrations.md — expand-contract spec.rules/hatch3r-api-design.md — RFC 9457 error format + spec-first mandate.rules/hatch3r-api-versioning.md — deprecation timeline + Sunset header policy.rules/hatch3r-code-standards.md — pattern-reuse precedence + complexity threshold + ADR-trigger list.jscpd.devoasdiff.comdocs.buf.build/breaking/overviewgraphql-inspector.com/martinfowler.com/bliki/ParallelChange.htmlwww.tim-wellhausen.de/papers/ExpandAndContract/ExpandAndContract.htmllearn.microsoft.com/en-us/azure/well-architected/architect-role/architecture-decision-recordnpx claudepluginhub hatch3r/hatch3r --plugin hatch3rVerifies 8 enhancability gates before commit or release: feature-flag adoption, config externalization, semver-versioned APIs, forward-compat headers, extension-point definition, startup config validation, ambiguity detection, and fan-out discipline.
Enforces advanced Python code quality gates beyond basic linting with tools for cognitive complexity, code duplication, architectural boundaries, mutation testing, docstring coverage, type coverage, and AI-generated code detection.
Reviews and verifies code before merge via triage-first checks (up to 16 parallel agents). Pipeline mode verifies vs plans; general mode for PRs/branches/staged changes. Flags findings only.