Hatch3r maintainability verify

From hatch3r/hatch3r · View interactive version

Hatch3r maintainability verify is an AI agent skill from the GitHub repository hatch3r/hatch3r. Maintainability verification gate before commit/release — jscpd duplication index, pattern reuse ratio, cyclomatic complexity, expand-contract migrations, API breaking-change discipline, ADR presence

How to use this skill

Skill file

Maintainability Verification Gate

Quick Start

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:

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.

Step 0 — Detect Ambiguity (P8 B1)

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 Discipline (P8 B2)

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, task_structure } in your output.

Invoked by

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:

No duplication: the agent decides WHEN, this skill defines HOW.

Gate 1: Duplication index ≤5%

Gate 2: Pattern-reuse ratio ≥70%

Gate 3: Cyclomatic complexity per function ≤10

Gate 4: Documentation currency ≤180 days on user-facing API surfaces

Gate 5: Expand-contract migration conformance 100%

Gate 6: API breaking-change events on stable endpoints = 0 per release

Gate 7: Named pattern adoption on cross-cutting concerns

Gate 8: ADR present for every architectural decision

Pass criteria

All 8 gates pass = the feature is "done". Anything less = not done.

On fail

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.

When this skill runs

Cross-References

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.