Improve rule

From thedaviddias/Front-End-Checklist · View interactive version

Improve rule is an AI agent skill from the GitHub repository thedaviddias/Front-End-Checklist. Use when reviewing or improving a Front-End Checklist rule MDX file to raise its quality score, fix stub prompts, add missing fields, or enrich content with real code examples.

How to use this skill

Skill file

Improve a Front-End Checklist Rule

This skill helps you review and improve the quality of rule MDX files in the Front-End Checklist project. Use it to fix stub content, write better AI prompts, and enrich rules so they score well against the quality rubric.

Quality Dimensions

Every rule is scored across these dimensions (see references/scoring-rubric.md for full details):

| Dimension | Max | What "good" looks like |

|-----------|-----|------------------------|

| prompts.check | 10 | Specific audit instruction, not generic |

| prompts.fix | 10 | Actionable fix steps with CSS/HTML/JS specifics |

| prompts.explain | 10 | Explains the why, not just restates the title |

| tldr | 5 | 3+ concise bullets, each a standalone takeaway |

| whyItMatters | 5 | 1–2 sentences, concrete user impact |

| aiContext | 5 | "Applies to…" — when should an agent use this? |

| relatedRules | 5 | 2+ slug + reason pairs |

| codeExamples | 10 | 3+ ✅/❌ annotated blocks in the body |

| bodyDepth | 10 | 300+ words, not a stub |

| resources | 5 | External links (MDN, WCAG, articles) |

| prompts.codeReview | 5 | Code review workflow prompt (optional) |

Base score: 100 with additional conditional V2 points. Target: ≥ 50 (passing).

Stub Prompts — What to Avoid

These patterns are automatically detected as low-quality:

Replace them with specific, actionable instructions that name the exact HTML attributes, CSS properties, or JavaScript patterns involved.

Check

Run the quality scorer on a specific rule to see its current score:

pnpm score:rules packages/content/rules/en/{category}/{slug}.mdx

Then open the MDX file and identify which dimensions are failing.

Run the structure validator as well:

pnpm validate:rule-structure packages/content/rules/en/{category}/{slug}.mdx

The rule body must follow this order:

Rule Contract V2 adds conditional sections:

Use the repo browser policy plus package-backed compatibility data for browser-support notes. Do not guess support ranges from memory.

Fix

When improving a rule:

  1. Fix stub prompts first — they have the highest point value (30 pts combined)
  1. Add aiContext — one sentence: "Applies to any HTML page with [X]" or "Use when reviewing [Y] in [Z] context"
  1. Add/expand tldr — 3 bullets minimum, each ending with a concrete rule of thumb
  1. Enrich body content — add ✅ good example and ❌ bad example code blocks for each concept
  1. Add relatedRules — link 2+ rules with a reason explaining the connection
  1. Add resources — MDN docs, WCAG success criteria, relevant articles
  1. Fix structure lint issues — rename final Testing/Checklist-style headings to ## Verification, keep optional guidance between Why It Matters and Verification, and never place H2 sections after Verification
  1. Add contract clarity where needed — use Exceptions, verification split, and standards/support notes only when the rule type actually benefits from them

Explain

The quality score is a proxy for how useful the rule is to both human developers and AI agents.

High-quality rules become high-quality skills that Claude can use proactively and precisely.

Code Review

When reviewing a PR that adds or modifies rule MDX files, check:


See references/scoring-rubric.md for the full scoring specification.

Rule page: https://frontendchecklist.io

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.