agentleFS
strongeronstrongeron/ui-guides-agent-rules/.claude/skills/principle-validation-workflow/SKILL.md

principle-validation-workflow

Skill1 starsChanged 10 months agoMITView on GitHub

Comprehensive validation workflow for 200+ principles using parallel agents, screenshot capture, and beads tracking. Use this skill when: - User runs /validate command - User asks to validate principles - User wants to review example quality - User needs to fix theme or link issues Files generated: - doc/validation-results.json - Field completeness + theme - doc/source-links-results.json - Link check results - doc/validation-report.md - Summary report Launch 4 parallel agents using Task tool:

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when:

    line 7
  2. Distinctive:

    Not break the page

    line 357

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Principle Validation Workflow

Comprehensive validation workflow for 200+ principles using parallel agents, screenshot capture, and beads tracking.

Trigger

Use this skill when:

  • User runs /validate command
  • User asks to validate principles
  • User wants to review example quality
  • User needs to fix theme or link issues

Quick Commands

CommandDescription
/validateRun full automated validation
/validate:visualStart visual review with screenshots
/validate:fixFix identified issues
/validate:statusCheck validation progress

Workflow Overview

┌─────────────────────────────────────────────────────────────┐
│                  VALIDATION WORKFLOW                         │
├─────────────────────────────────────────────────────────────┤
│                                                              │
│  Phase 1: Automated Checks                                   │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐                  │
│  │ Fields   │  │ Links    │  │ Theme    │                  │
│  │ Check    │→ │ Check    │→ │ Analysis │                  │
│  └──────────┘  └──────────┘  └──────────┘                  │
│       ↓              ↓             ↓                        │
│  ┌─────────────────────────────────────┐                   │
│  │     Generate Initial Report         │                   │
│  └─────────────────────────────────────┘                   │
│                      ↓                                      │
│  Phase 2: Visual Review (Parallel Agents)                   │
│  ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐         │
│  │ Agent 1 │ │ Agent 2 │ │ Agent 3 │ │ Agent 4 │         │
│  │ inter.  │ │ anim+   │ │ design  │ │ content │         │
│  │ forms   │ │ layout  │ │ perf    │ │ aesth   │         │
│  └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘         │
│       │           │           │           │               │
│       └───────────┴───────────┴───────────┘               │
│                      ↓                                      │
│  ┌─────────────────────────────────────┐                   │
│  │     Merge Findings + Screenshots     │                   │
│  └─────────────────────────────────────┘                   │
│                      ↓                                      │
│  Phase 3: Fix Issues                                        │
│  ┌─────────┐ ┌─────────┐ ┌─────────┐                      │
│  │ Links   │ │ Theme   │ │ Examples│                      │
│  │ Fixer   │ │ Fixer   │ │ Fixer   │                      │
│  └────┬────┘ └────┬────┘ └────┬────┘                      │
│       │           │           │                            │
│       └───────────┴───────────┘                            │
│                      ↓                                      │
│  ┌─────────────────────────────────────┐                   │
│  │  Before/After Screenshots + Report   │                   │
│  └─────────────────────────────────────┘                   │
│                                                              │
└─────────────────────────────────────────────────────────────┘

Phase 1: Automated Validation

Step 1.1: Run Scripts

# Initialize beads tracking
bd update web-ui_guide_react-43b --status=in_progress

# Run all automated checks
npm run validate:all

Step 1.2: Review Results

Files generated:

  • doc/validation-results.json - Field completeness + theme
  • doc/source-links-results.json - Link check results
  • doc/validation-report.md - Summary report

Step 1.3: Initialize Visual Validation

# Create visual validation data from automated results
npm run validate:init

Phase 2: Visual Review (Parallel Agents)

Agent Assignment

Launch 4 parallel agents using Task tool:

AgentSubagent TypeCategoriesPrinciples
1kieran-typescript-reviewerinteractions, forms64
2kieran-typescript-revieweranimations, layout37
3kieran-typescript-reviewerdesign, performance55
4kieran-typescript-reviewercontent, aesthetics44

Agent Prompt Template

## Visual Review: [CATEGORIES]

Review principles in [CATEGORIES] category.

### Setup
1. Dev server at http://localhost:5173
2. Screenshots go to doc/screenshots/

### For Each Principle

1. **Navigate**: Go to http://localhost:5173/#[principle-id]

2. **Screenshot Before**: Capture current state
   ```bash
   npx tsx scripts/capture-screenshots.ts comparison [id] before
  1. Review Checklist:
    • Good example clearly demonstrates principle
    • Bad example shows realistic anti-pattern
    • Visual difference is immediately apparent
    • Works in light mode
    • Works in dark mode (toggle or emulate)
    • No console errors
    • Keyboard accessible (if interaction principle)
  2. Document Issues: For each problem found:
    npx tsx scripts/visual-validation.ts add "[id]" "[category]" "[title]" "[issue]" "[severity]"
  3. If Fixed: Capture after screenshot
    npx tsx scripts/capture-screenshots.ts comparison [id] after
    npx tsx scripts/visual-validation.ts fix "[id]" "[fix description]"

Output Format

Report as JSON:

{
  "agent": 1,
  "categories": ["interactions", "forms"],
  "reviewed": 64,
  "issuesFound": [
    {
      "principleId": "...",
      "issue": "...",
      "severity": "critical|high|medium|low",
      "screenshot": "screenshots/...-before-light.png"
    }
  ],
  "fixed": []
}

### Beads Tracking During Review

```bash
# Mark review tasks as in_progress
bd update web-ui_guide_react-e8c --status=in_progress  # interactions
bd update web-ui_guide_react-39a --status=in_progress  # forms

Phase 3: Fix Issues

Issue Priority

PriorityTypeFix Approach
P1Broken linksFind replacement or remove
P2Missing examplesCreate component pair
P2Theme issuesAdd dark: classes
P3Redirected linksUpdate to final URL

Fix Subagents

Link Fixer Agent

Fix broken source links from doc/source-links-results.json.

For each error:
1. Search for updated URL using WebSearch
2. Update in src/data/principles.ts
3. Run: npm run validate:links to verify

Track: bd update web-ui_guide_react-64x --status=in_progress

Theme Fixer Agent

Add dark mode to examples in [CATEGORY].

Pattern replacements:
- bg-white → bg-white dark:bg-zinc-900
- bg-gray-50 → bg-gray-50 dark:bg-zinc-800
- text-gray-900 → text-gray-900 dark:text-gray-100
- border-gray-200 → border-gray-200 dark:border-zinc-700

For each file:
1. Read component
2. Add dark: variants
3. Capture before/after screenshots
4. Update visual-validation with fix details

Track: bd update web-ui_guide_react-eyf --status=in_progress

Screenshot Workflow

Capture Commands

# Single principle
npx tsx scripts/capture-screenshots.ts single [id] before
npx tsx scripts/capture-screenshots.ts single [id] after

# Comparison (Good vs Bad side-by-side)
npx tsx scripts/capture-screenshots.ts comparison [id] before

# Batch (all with issues in category)
npx tsx scripts/capture-screenshots.ts batch before [category]

# Full category
npx tsx scripts/capture-screenshots.ts category [name] before

Screenshot Naming

doc/screenshots/
├── [principle-id]-before-light.png
├── [principle-id]-before-dark.png
├── [principle-id]-after-light.png
├── [principle-id]-after-dark.png
└── [principle-id]-before-comparison-light.png

Report Generation

Visual Report

# Generate markdown report with screenshots
npx tsx scripts/visual-validation.ts report

Output: doc/visual-validation-report.md

Report Structure

# Visual Validation Report

## Summary
| Severity | Count |
|----------|-------|
| 🔴 Critical | X |
| 🟠 High | X |
| 🟡 Medium | X |
| 🟢 Low | X |
| ✅ Fixed | X |

## Critical Issues

### principle-id

**Issue**: Description

#### Before (Problem)
| Light Mode | Dark Mode |
|------------|-----------|
| ![Light](before-light.png) | ![Dark](before-dark.png) |

#### After (Fixed)
| Light Mode | Dark Mode |
|------------|-----------|
| ![Light](after-light.png) | ![Dark](after-dark.png) |

#### Fix Applied
```diff
- bg-white
+ bg-white dark:bg-zinc-900

## Beads Integration

### Task Structure

Epic: Principle Validation (web-ui_guide_react-43b) ├── Fix broken source links (web-ui_guide_react-64x) ├── Update redirected links (web-ui_guide_react-4gn) ├── Add dark mode support (web-ui_guide_react-eyf) ├── Visual review: interactions (web-ui_guide_react-e8c) ├── Visual review: animations (web-ui_guide_react-aj3) ├── Visual review: forms (web-ui_guide_react-39a) ├── Visual review: design+content+aesthetics (web-ui_guide_react-hh4) └── Visual review: layout+performance (web-ui_guide_react-th4)


### Workflow Commands

```bash
# Check available work
bd ready

# Start working on a task
bd update [id] --status=in_progress

# Close completed task
bd close [id] --reason="Fixed X issues, see visual-validation-report.md"

# Sync at session end
bd sync

Validation Checklist

Per-Principle Review

  • Data Complete: All fields populated
  • Examples Exist: Good/Bad components found
  • Links Valid: Source URLs return 200
  • Theme Support: Works in light/dark modes
  • Visual Clear: Good/Bad difference obvious
  • Functional: No console errors
  • Accessible: Keyboard navigable (if applicable)
  • Screenshots: Before/after captured

Quality Criteria for Examples

Good Example Must:

  • Demonstrate the principle correctly
  • Use semantic HTML
  • Be keyboard accessible
  • Work in both themes
  • Have no console errors

Bad Example Must:

  • Show realistic anti-pattern
  • Be clearly different from Good
  • Explain why it's problematic
  • Not break the page

Files Reference

FilePurpose
scripts/validate-principles.tsField + theme check
scripts/check-source-links.tsURL validation
scripts/generate-validation-report.tsMarkdown summary
scripts/visual-validation.tsIssue tracking + report
scripts/capture-screenshots.tsPlaywright screenshots
doc/validation-results.jsonAutomated check data
doc/source-links-results.jsonLink check data
doc/validation-report.mdSummary report
doc/visual-validation-data.jsonVisual issues data
doc/visual-validation-report.mdVisual report
doc/screenshots/Screenshot images

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.