|
| 1 | +# DojoWatch |
| 2 | + |
| 3 | +AI-native visual regression testing engine — Claude Code plugin + GitHub Actions CI. |
| 4 | + |
| 5 | +## Architecture |
| 6 | + |
| 7 | +- **Plugin-first**: Slash commands are the primary local interface. Claude Code IS the local AI engine. |
| 8 | +- **Scripts in `scripts/`**: Standalone TypeScript, runnable via `npx tsx`. Used by both slash commands and CI. |
| 9 | +- **Gemini for CI**: `scripts/analyze-gemini.ts` handles batch analysis in GitHub Actions. |
| 10 | +- **No npm publish**: This is a Claude Code plugin, not a published package. |
| 11 | + |
| 12 | +## Conventions |
| 13 | + |
| 14 | +- TypeScript strict mode, ESM only (`"type": "module"`) |
| 15 | +- All shared types in `scripts/types.ts` |
| 16 | +- Pre-filter has a **zero false-negative guarantee**: only byte-identical screenshots skip analysis |
| 17 | +- Scripts must be runnable standalone (for CI) AND callable from slash commands via Bash |
| 18 | +- Use `picocolors` for terminal output, never `chalk` |
| 19 | +- Use `execFileSync` not `execSync` — avoid shell injection |
| 20 | +- Test fixtures in `tests/fixtures/` |
| 21 | + |
| 22 | +## File layout |
| 23 | + |
| 24 | +| Directory | Purpose | |
| 25 | +|-----------|---------| |
| 26 | +| `commands/` | Claude Code slash commands (markdown with YAML frontmatter) | |
| 27 | +| `agents/` | Claude Code agents (markdown with YAML frontmatter) | |
| 28 | +| `skills/` | Claude Code skills (`SKILL.md` + `references/`) | |
| 29 | +| `scripts/` | Core TypeScript scripts (capture, prefilter, analyze, etc.) | |
| 30 | +| `templates/` | User-facing templates (config example, GitHub Actions) | |
| 31 | +| `tests/` | Vitest tests + PNG fixtures | |
| 32 | + |
| 33 | +## Script naming |
| 34 | + |
| 35 | +Scripts double as both importable modules and CLI entrypoints: |
| 36 | +- Export functions for programmatic use |
| 37 | +- Include `if (isDirectRun)` block for CLI execution |
| 38 | +- Accept args via `process.argv` when run directly |
| 39 | + |
| 40 | +## Classification schema |
| 41 | + |
| 42 | +Visual diffs are classified as: |
| 43 | +- **REGRESSION**: Unintended visual change (bug). Severity: high/medium/low. |
| 44 | +- **INTENTIONAL**: Deliberate change (feature, design update). |
| 45 | +- **NOISE**: Insignificant rendering variance (anti-aliasing, sub-pixel). |
| 46 | + |
| 47 | +See `skills/visual-regression/references/classification-schema.md` for full criteria. |
0 commit comments