Hands-off quality enforcement for the LoveSpark extension suite
Catch mistakes at write-time, not audit-time.
LoveSpark has excellent quality tools — ls-check, audit-contrast, /audit-a11y, /postmortem — but every single one requires manual invocation. A typical build session wastes 10-20 minutes on:
- Manually loading context (known-issues.md, color-decisions.md)
- Remembering to run
/checkafter each implementation step - Remembering to run
/postmortemafter builds - Hoping nothing slipped through
This toolkit makes it automatic.
┌──────────────────────────────────────────────┐
│ 4 Layers of Automation │
└──────────────────────────────────────────────┘
┌─────────────────────┐ ┌─────────────────────┐ ┌──────────────────┐
│ Layer 1: CC Hooks │ │ Layer 2: Git Hooks │ │ Layer 3: CI/CD │
│ (Claude Code) │ │ (any editor) │ │ (GitHub) │
└──────┬──────────────┘ └──────┬──────────────┘ └──────┬───────────┘
│ │ │
PostToolUse ──┐ pre-commit ──┐ push/PR ──┐
(Edit/Write) │ (git commit) │ (main) │
│ │ │ │ │ │
┌────▼──────┐│ ┌─────▼────┐ │ ┌─────▼───┐ │
│post-edit- ││ │ls-check │ │ │ls-check │ │
│lint.sh ││ │--pre- │ │ │--strict │ │
│ ││ │commit │ │ │ │ │
│ 10 KI ││ │ │ │ │ Full │ │
│ checks ││ │ Fast │ │ │ suite │ │
│ <0.5s ││ │ grep │ │ │ + JSON │ │
└───────────┘│ └──────────┘ │ └─────────┘ │
│ │ │
PreToolUse ───┤ ┌────────────────┐│ ┌───────────────┐│
(git commit) │ │install-hooks.sh││ │contrast-audit ││
│ │ │Symlinks to all ││ │Weekly Monday ││
┌────▼──────┐│ │36 repos ││ │Auto-issue on ││
│ls-check ││ └────────────────┘│ │regression ││
│--pre- ││ │ └───────────────┘│
│commit ││ │ │
│ ││ │ │
│ Blocks ││ │ │
│ bad ││ │ │
│ commits ││ │ │
└───────────┘│ │ │
│ │ │
SessionStart ─┤ │ │
│ │ │ │
┌────▼──────┐│ ┌──────────────────────────────────────┐ │
│session- ││ │ Layer 4: Session │ │
│context.sh ││ │ │ │
│ ││ │ SessionStart → auto-load KI count │ │
│ Auto-load ││ │ SessionEnd → flag postmortem │ │
│ KI count ││ │ │ │
│ + pending ││ └──────────────────────────────────────┘ │
│ postmort. ││ │
└───────────┘│ │
│ │
SessionEnd ───┘ │
│ │
┌────▼──────┐ │
│post- │ │
│session.sh │ │
│ │ │
│ Flag │ │
│ postmort. │ │
└───────────┘ │
│
| File | Event | What it catches | Speed |
|---|---|---|---|
post-edit-lint.sh |
PostToolUse (Edit/Write) | 10 KI violations on just-edited file | <0.5s |
session-context.sh |
SessionStart | Auto-loads KI count, extension info, pending postmortems | <1s |
post-session.sh |
SessionEnd | Flags postmortem if changes were detected | <0.5s |
| KI | What | File types |
|---|---|---|
| KI-001 | --ls-pink-accent as background for white text |
CSS |
| KI-005 | Popup missing role="dialog" |
HTML |
| KI-006 | outline: none without :focus-visible |
CSS |
| KI-008 | Animations without prefers-reduced-motion |
CSS |
| KI-011 | innerHTML usage (XSS risk) |
JS |
| KI-020 | setTimeout in service workers |
JS |
| KI-021 | Empty catch blocks |
JS |
| KI-026 | External CDN links in extensions | HTML |
| KI-027 | Missing CSP in manifest.json |
HTML |
| KI-029 | setInterval in content scripts |
JS |
| File | Trigger | What it does |
|---|---|---|
ls-check.yml |
Push/PR to main |
Full ls-check --strict quality gate |
contrast-audit.yml |
Weekly Monday + manual | WCAG contrast audit, auto-creates issue on regression |
| File | Purpose |
|---|---|
install-hooks.sh |
Symlink git pre-commit hooks into all extension repos |
setup-ci.sh |
Copy GitHub Actions workflows to all extension repos |
Hooks are configured in ~/.claude/settings.json. They fire automatically:
{
"hooks": {
"PostToolUse": [{ "matcher": "Write|Edit", "hooks": [{ "type": "command", "command": "~/.claude/hooks/post-edit-lint.sh" }] }],
"PreToolUse": [{ "matcher": "Bash", "hooks": [{ "type": "command", "command": "..." }] }],
"SessionStart": [{ "hooks": [{ "type": "command", "command": "~/.claude/hooks/session-context.sh" }] }],
"SessionEnd": [{ "hooks": [{ "type": "command", "command": "~/.claude/hooks/post-session.sh" }] }]
}
}./scripts/install-hooks.sh./scripts/setup-ci.sh
# Then commit + push .github/ in each repo| Before (manual) | After (automated) |
|---|---|
| "Read known-issues.md before UI work" | SessionStart hook outputs KI count automatically |
"Run /check after implementation" |
PostToolUse hook auto-lints every edit |
"Run ls-check before committing" |
PreToolUse hook blocks bad commits |
"Run /postmortem after builds" |
SessionEnd flags pending postmortems |
| "Hope nothing slipped through" | GitHub Actions catches everything on push |
Estimated time saved per session: 10-20 minutes
MIT — Part of the LoveSpark suite.
