Implement the 031-quality-gates-hygiene feature that strengthens automated quality gates by adding pnpm audit to the check script, v8 coverage thresholds with per-directory auto-ratchet (domain 96%, adapters 71%, persistence 87%), Biome cognitive complexity enforcement (max 15), and keyboard accessibility for the combatant row, while cleaning up all blanket biome-ignore comments, refactoring 5 overly complex functions into smaller helpers, and codifying the early-enforcement principle in the constitution and CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
40
specs/031-quality-gates-hygiene/quickstart.md
Normal file
40
specs/031-quality-gates-hygiene/quickstart.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# Quickstart: Quality Gates & Code Hygiene
|
||||
|
||||
**Feature**: 031-quality-gates-hygiene
|
||||
**Date**: 2026-03-11
|
||||
|
||||
## What This Feature Does
|
||||
|
||||
Strengthens the project's automated quality gates by adding coverage thresholds, cognitive complexity limits, dependency auditing, and cleaning up lint suppressions — all enforced at pre-commit via `pnpm check`.
|
||||
|
||||
## Implementation Order
|
||||
|
||||
1. **Constitution + CLAUDE.md** — Add early-enforcement principle (documentation only)
|
||||
2. **Biome config** — Enable cognitive complexity rule + a11y rule
|
||||
3. **Refactor violations** — Fix 5 cognitive complexity violations + biome-ignore hygiene
|
||||
4. **Coverage** — Install `@vitest/coverage-v8`, configure thresholds
|
||||
5. **Audit** — Add `pnpm audit` to check script
|
||||
6. **Verify** — Run `pnpm check` end-to-end
|
||||
|
||||
## Key Files to Modify
|
||||
|
||||
| File | Change |
|
||||
| ---- | ------ |
|
||||
| `.specify/memory/constitution.md` | PATCH: add early-enforcement rule to Development Workflow |
|
||||
| `CLAUDE.md` | Reflect early-enforcement principle |
|
||||
| `biome.json` | Add complexity + a11y rules |
|
||||
| `vitest.config.ts` | Add coverage config with thresholds |
|
||||
| `package.json` | Add `@vitest/coverage-v8` dep, update check script |
|
||||
| `packages/domain/src/set-initiative.ts` | Remove blanket biome-ignore |
|
||||
| `apps/web/src/components/combatant-row.tsx` | Reduce a11y ignores |
|
||||
| `apps/web/src/adapters/bestiary-adapter.ts` | Refactor `renderEntries` complexity |
|
||||
| `apps/web/src/persistence/encounter-storage.ts` | Refactor `loadEncounter` + rehydration complexity |
|
||||
| `scripts/check-layer-boundaries.mjs` | Refactor `checkLayerBoundaries` complexity |
|
||||
| `scripts/generate-bestiary-index.mjs` | Refactor `buildSourceMap` complexity |
|
||||
| `.gitignore` | Add `coverage/` directory |
|
||||
|
||||
## Verification
|
||||
|
||||
```bash
|
||||
pnpm check # Must pass with all new gates
|
||||
```
|
||||
Reference in New Issue
Block a user