frontend-craftsman
Use when polishing a built page to production grade — responsive behavior, overflow control, detail quality, cross-browser checks and the pre-ship verification battery. The last mile before a page may ship.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- frontend-craftsman
- description
- Use when polishing a built page to production grade — responsive behavior, overflow control, detail quality, cross-browser checks and the pre-ship verification battery. The last mile before a page may ship.
03 SKILL.md 正文
Frontend Craftsman
Polish is measurable: no overflow, no off-grid spacing, no off-curve type, no jank, no broken states. This skill is the pre-ship battery.
The polish pass
- Overflow hunt (mobile first): at 390px,
document.documentElement .scrollWidth - clientWidthmust be 0. Hunt the offenders: unshrinkable flex children (min-w-0on every flex text child), fixed widths,sr-onlytables re-expanded by scoped CSS (the F17 anatomy — the clip belongs on a wrapper DIV, not the table), pre/code withoutoverflow-x: auto, 100vw + scrollbar math. Then 320px, 768px, 1024px, 1440px, 1920px. - The grid sweep: every spacing value on the 4px grid (margin, padding, gaps); line-heights on the same scale. The critic's off-grid gate is ≤ 15% — optical corrections allowed, laziness is not.
- Type detail pass: the tracking curve holds at every size; tabular
numerals for any changing number (
font-variant-numeric: tabular-nums— a counter must not jitter its own layout);text-wrap: balanceon heads,text-wrap: prettyon paragraphs where supported; no orphaned single words on the last line of a hero. - State completeness: every interactive element has hover, focus, active, disabled, loading (where async), and empty (where data-driven). Every one of those states keeps AA contrast — the disabled state is the classic violator.
- Dark/light parity (if the site has both): flip schemes on every state. Unconditionally-colored panels under a flipped scheme are the F18 anatomy — tokens, never literal hexes, and never an alpha'd token where the background flips.
- Images:
width/heightattributes on every<img>(the IHDR truth, not guesses),loading="lazy"below the fold,decoding="async"on decorative media, alt per its decision. - Cross-browser: Chromium + Firefox + WebKit, both schemes, one
desktop + one mobile viewport each. The divergence classes: scrollbar
styling,
backdrop-filter(Safari prefix), view-transition support,@supportsgated effects. - The details that read as craft: focus rings aligned to the radius;
::selectionon brand;scroll-margin-topon anchors;aria-currenton nav state; the favicon in BOTH schemes; the 404 in the page's voice;prefers-color-schemehonored on first paint (no flash).
The pre-ship battery (all green or it does not ship)
bun run typecheck && bun run lint && bun run test:unit
bun run build # the production build is the artifact
bun run test:e2e # where the repo ships them
node scripts/design_critic.mjs --route <route> --label ship --enforce
Plus the page's own gates where they exist (the landing's audit/contrast lanes; an app's component suite). A gate that was never run is a claim, not a gate — run them to conclusion, read the output, never cancel mid-flight.
The craftsman's question
At every step: "would an elite team ship this line?" The honest answers are yes, no, or "not yet" — and "not yet" means the task list is not done, not that the standard bends.
04 同仓库更多 Skills
valid-skill
A valid skill for testing purposes.
unknown-field
A skill with an unknown frontmatter field.
nested-child
Nested skill should be ignored.
root-skill-preferred
Root skill should win.
no-frontmatter
暂无简介
child-skill
A nested skill in a subdirectory.