41 lines
1.8 KiB
Markdown
41 lines
1.8 KiB
Markdown
# 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
|
|
```
|