Add workflow infrastructure — ESLint, Prettier, Husky, Vitest, 7 new skills

Phase 1: Session log archived (1096→91 lines), D031 token access convention
Phase 2: ESLint v9 + Prettier + jsx-a11y, initial config and lint fixes
Phase 3: 7 new skills (polish, harden, normalize, clarify, typeset, quieter, adapt)
         + Vercel reference docs, updated audit/review-component refs
Phase 4: Husky + lint-staged pre-commit hooks, preflight updated to 8 checks
Phase 5: Vitest + Testing Library + /write-tests skill

- Badge.tsx colour maps unified to CSS variables (D031)
- 5 empty interface→type alias fixes (Switch, Radio, Divider, IconButton, Link)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-27 16:41:57 +11:00
parent c5bfeaee2f
commit aa7cdeecf0
33 changed files with 7685 additions and 1088 deletions

View File

@@ -1,6 +1,6 @@
---
name: preflight
description: Pre-commit quality check — verifies TypeScript, Storybook, token sync, and no hardcoded values
description: Pre-commit quality check — verifies TypeScript, ESLint, Prettier, Storybook, token sync, and no hardcoded values
argument-hint: "[--fix to auto-fix issues]"
---
@@ -62,6 +62,24 @@ find src/components/atoms/ -name "*.tsx" ! -name "*.stories.tsx" | xargs grep -L
- **Fail:** Missing exports or displayName
- **Critical:** No — warn but don't block commit
### 6. ESLint
```bash
npm run lint 2>&1
```
- **Pass:** No errors
- **Fail:** ESLint errors → report them
- **Fix:** Run `npm run lint:fix`
- **Critical:** Yes — do not commit if this fails
### 7. Prettier
```bash
npm run format:check 2>&1
```
- **Pass:** All files formatted correctly
- **Fail:** Formatting issues found → report them
- **Fix:** Run `npm run format`
- **Critical:** No — warn but don't block commit (Husky pre-commit hook auto-fixes these)
### Report format
```
PREFLIGHT RESULTS
@@ -71,6 +89,8 @@ PREFLIGHT RESULTS
✓ Token sync ............. PASS
⚠ Hardcoded values ....... WARN (2 issues)
✓ Component exports ...... PASS
✓ ESLint ................. PASS
✓ Prettier ............... PASS
───────────────────────────────
Result: PASS (safe to commit)
```
@@ -79,7 +99,7 @@ Use `PASS`, `FAIL`, or `WARN`. If any critical check fails, the result is `FAIL
If `--fix` was passed, attempt to fix issues automatically (e.g., run `npm run build:tokens` for stale tokens) and re-check.
### 6. Visual QA spot-check (manual review, non-blocking)
### 8. Visual QA spot-check (manual review, non-blocking)
If a component was recently modified, do a quick visual review of the source code for these common issues (adapted from impeccable /polish):