fragments-govern
SKILL.md
Fragments Govern
Run design governance checks, review pre-commit changes, and fix violations.
Modes
Parse $ARGUMENTS to determine the mode:
- check (default): Run checks and report violations
- fix: Run checks, then automatically fix violations that have auto-fixes
- review: Check only staged/uncommitted UI files (pre-commit review)
- status: Show current violation count and trends
If no mode is specified, default to check.
Check mode
- Verify
@fragments-sdk/governis installed. If not, offer to run/fragments-setup. - If a file path is provided in
$ARGUMENTS, scope the check to that path. - Run:
npx fragments govern check --cloud --format json - Parse the JSON output and present results:
- Group violations by severity (error, warning, info)
- Group by file for easier navigation
- Show the rule name, line number, and a snippet of offending code
- Summarize: "X errors, Y warnings, Z info across N files"
Fix mode
- Run the check to identify violations.
- For violations with auto-fixes:
- Show the proposed change
- Apply it
- For violations without auto-fixes, explain what needs to change and why.
- Re-run the check to confirm fixes applied correctly.
Review mode
Pre-commit design review -- checks only changed files.
- Determine scope:
- If
$ARGUMENTScontains--staged, check only git-staged files - Otherwise check all uncommitted changes (staged + unstaged)
- If
- Gather changed UI files:
git diff --cached --name-only --diff-filter=ACMR -- '*.tsx' '*.jsx' '*.vue' '*.svelte' - For each file, analyze for:
- Design token compliance -- hardcoded colors, spacing, font sizes that should use tokens
- Accessibility -- missing alt text, ARIA labels, keyboard handlers
- Component consistency -- inline styles duplicating utility classes, divergent prop patterns
- Responsive design -- fixed widths on containers, touch targets under 44px
- Present findings grouped by file with line numbers.
- Offer to auto-fix token replacements and missing attributes.
- If no issues: confirm with a short "All clear -- ready to commit."
Status mode
- Run:
npx fragments govern status --cloud --format json - Show: total open violations, trend vs. last check, top 3 most common violation types, files with the most violations.
Check categories reference
When explaining violations, reference these:
- accessibility: Color contrast, ARIA labels, keyboard navigation, focus management, alt text
- consistency: Design token usage, spacing patterns, component prop consistency, naming conventions
- responsive: Breakpoint coverage, flexible layouts, touch targets, viewport handling
Always show the exact rule name so users can look it up or create policy exceptions.
Weekly Installs
1
Repository
fragments-sdk/skillsFirst Seen
12 days ago
Security Audits
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1