feat(codebase-readiness, agent-ready): score and install regression-aware quality gates - #44
Merged
Merged
Conversation
dgalarza
force-pushed
the
feature/agent-quality-ratchets
branch
2 times, most recently
from
August 27, 2026 11:41
0dd0af7 to
e128bf9
Compare
…ates Score whether a codebase blocks new or worsened structural debt, not just whether tooling exists. - New shared reference references/quality-gates.md: what a regression-aware gate is (complexity, duplication, reliable dead-code checks, baseline treatment of legacy debt, blocking merge-base-aware PR CI, reproducible local commands, tests of the gate), a single Gate Maturity Level (L0-L4), native tooling per language, and a credit-ownership table so Code Clarity (structural coverage), Consistency (lint-debt treatment), Feedback Loops (actionability, reproducibility, gate tests), and Change Safety (blocking semantics, baseline governance) each score one distinct slice. Top-band credit everywhere requires CI that blocks; report-only tooling is capped. - recon.sh: QUALITY GATES section (tooling, baseline files with grow/shrink history, soft-fail and merge-base markers in CI, local commands, gate tests, CODEOWNERS) ending in a heuristic 'Suggested Gate Maturity Level' line; detect flat ESLint/Biome configs; exclude build output from counts - SKILL.md: the Quality gates line is copied from recon into the snapshot and required before agents launch; shared reference wired into the Test & CI, Code Quality, and Architecture agent prompts; report snapshot must match the agents' snapshot; Phase 6 points L0-L2 codebases at agent-ready quality-gates mode - Dimension guides: examine bullets, evidence commands, band notes, modifiers, and output lines for the four affected dimensions - Report template: Gate Maturity section mirroring the snapshot line and a verification-cost row; README dimension table - Bump to 1.8.0
Install a regression-aware quality gate using the project's native tools: legacy debt is inventoried in a human-reviewed baseline and allowed to stay; new or worsened complexity, duplication, or dead code fails merge-base-aware PR CI; stale entries must be pruned so the baseline only shrinks. - SKILL.md: quality-gates mode (detect tools, prefer native baseline/diff modes such as golangci-lint new-from-merge-base, detekt, PHPStan, RuboCop todo, otherwise install the stdlib engine; report/check/baseline commands via the task runner; CI; CODEOWNERS; docs; self-test), integrated into scaffold (Step 8) and audit (Quality Gate section and auto-fix offers); startup suggests the mode when the assessment is L0-L2 - references/quality-gates-pattern.md: the cross-language contract with adapter recipes for TS/JS, Ruby, Python, Go, JVM, Rust, PHP, the baseline review protocol, CI shape, and debt-fixture snippets - assets/quality-gate.py: fingerprint baseline engine (identity ignores line numbers and numeric values; first integer tracked as a metric so a higher value is 'worsened'); --changed-only via merge-base; GitHub annotations; tool failure is not a pass. baseline requires --reason, prints a review summary, supports --dry-run, is refused in CI, and stays unreviewed (check fails) until --approve --reviewed-by; --prune only tightens - assets: CI template, docs guide template, self-test template proving a clean tree passes, synthetic debt fails, and stale entries are pruned (on a temp baseline copy marked reviewed, so it runs before approval) - AGENTS.md template: Definition of Done and directives; docs structure template gains guides/quality-gates.md - tests/test_quality_gate.py (19 unit tests) run in CI via a test-templates job; README; bump to 1.5.0
dgalarza
force-pushed
the
feature/agent-quality-ratchets
branch
from
August 27, 2026 19:38
388af14 to
73e0ec5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the two existing skills so that regression-aware quality gates are scored by
codebase-readinessand installed byagent-ready. No new plugin. (The earlierquality-ratchetplugin on this branch has been removed; nothing from it was kept.)A regression-aware gate: the project's native complexity / duplication / dead-code tools, a baseline that lets legacy debt stay, PR CI that blocks new or worsened debt relative to the merge-base, the same commands locally and in CI, a human-reviewed baseline, and tests of the gate itself.
codebase-readiness → 1.8.0
references/quality-gates.md(new, shared): defines the gate, a single Gate Maturity Level (L0 none → L1 report-only → L2 threshold → L3 regression-aware blocking → L4 governed) determined once in Phase 1 and recorded in the snapshot, native tooling per language, anti-patterns, and a credit-ownership table so the four dimensions never double-count:recon.shgains a=== QUALITY GATES ===section (tooling, baseline files with grow/shrink history, soft-fail and merge-base markers in CI, local commands, gate tests, CODEOWNERS).agent-ready → 1.5.0
quality-gatesmode (SKILL.md), integrated into scaffold (Step 8) and audit (Quality Gate section: governed / ungoverned / report-only / absent, plus auto-fix offers), with thecheckcommand and three directives added to the AGENTS.md template's Definition of Done / conventions.references/quality-gates-pattern.md: the cross-language contract (report/check/baseline), two routes — Option A native baseline/diff modes (golangci-lintnew-from-merge-base, detekt--baseline, PHPStan baseline +reportUnmatchedIgnoredErrors, RuboCop todo regenerated) and Option B a stdlib engine — with adapter recipes for TS/JS, Ruby, Python, Go, JVM, Rust, PHP, the baseline review protocol, CI shape, and debt-fixture snippets.assets/quality-gate.py: fingerprint baseline engine (identity ignores line numbers and numeric values; first integer in a message is tracked as a metric so a higher complexity value counts as worsened); merge-base-aware--changed-onlyand changed-file attribution; GitHub annotations; tool failure ≠ pass.baselinerequires--reason, prints a review summary (by rule / top files), supports--dry-run, is refused underCI, and writes the baseline unreviewed —checkfails until a human runs--approve --reviewed-by NAME. Stale entries failcheckuntilbaseline --pruneremoves them (prune only tightens, so agents may run it). CODEOWNERS on the baseline file is required by the mode.assets/quality-gate-ci-template.yml(fetch-depth 0, base fetch, no continue-on-error, runs the self-test),assets/quality-gates-guide-template.md(docs/guides/quality-gates.md),assets/quality-gate-test-template.sh(proves clean tree passes / synthetic debt fails / stale entry pruned, on a temp copy of the baseline).tests/test_quality_gate.py: 18 unit tests for the engine — legacy passes after review, line moves don't create new findings, new / worsened-metric / worsened-count fail, stale → prune → pass, prune tightens metrics and the ratchet holds,--reasonrequired, refused in CI, unreviewed fails, extend resets review, dry-run writes nothing,--changed-onlyscoping via merge-base, tool failure is an error, jsonl format. Wired into CI as atest-templatesjob.Validation
quick_validate.pypasses for both skills; all plugin.json + marketplace.json parse; both workflow YAMLs parsepython3 -W error -m unittest discover -s plugins/agent-ready/tests→ 18/18recon.shsyntax-checked and run (new section produces output on this repo)plugin.jsonfiles andmarketplace.jsonNot done