Skip to content

Joona-t/lovespark-automation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Sparky mascot

LoveSpark Automation Toolkit

Hands-off quality enforcement for the LoveSpark extension suite
Catch mistakes at write-time, not audit-time.

4 hooks 2 workflows 36 extensions 10 KIs MIT


The Problem

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 /check after each implementation step
  • Remembering to run /postmortem after builds
  • Hoping nothing slipped through

This toolkit makes it automatic.


Architecture

                    ┌──────────────────────────────────────────────┐
                    │           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. │                                                │
    └───────────┘                                                │
                                                                 │

What's Inside

hooks/ — Claude Code Hooks

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 Violations Checked by post-edit-lint.sh

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

workflows/ — GitHub Actions

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

scripts/ — Deployment

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

Installation

1. Claude Code Hooks (automatic — already configured)

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" }] }]
  }
}

2. Git Hooks (one-time)

./scripts/install-hooks.sh

3. GitHub Actions (one-time)

./scripts/setup-ci.sh
# Then commit + push .github/ in each repo

What This Eliminates

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


License

MIT — Part of the LoveSpark suite.

About

Hands-off quality enforcement for the LoveSpark extension suite — hooks, CI/CD, and session automation

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages