Separate frontend planning scopes

This commit is contained in:
Wayner Barrios
2026-07-28 14:09:20 -04:00
parent ad211a879c
commit 7ccfa329af
2 changed files with 45 additions and 3 deletions
+15 -3
View File
@@ -8,6 +8,18 @@ This skill guides creation of distinctive, production-grade frontend interfaces
The user provides frontend requirements: a component, page, application, or interface to build. They may include context about the purpose, audience, or technical constraints.
## Scope and requirements
Before design thinking, classify the request and plan the appropriate ownership boundary. Ask only about missing information that materially changes structure, behavior, integration, or accessibility; when requirements are sufficient, proceed without a round trip.
- **Page or application**: Plan the user journey, information architecture, content hierarchy, navigation and route context, page-level states, full-viewport responsive composition, and one coherent visual concept.
- **Isolated or reusable component**: Plan its responsibility, public inputs and content, events, variants, loading/empty/error/disabled/selected states where applicable, host context, intrinsic sizing, keyboard and focus semantics, tokens, and composition boundaries.
- **Hybrid work**: Plan both layers and keep page-owned requirements out of reusable component internals.
A component must not invent an unrelated page shell, global landmarks, document-level `<h1>`, global typography or background, or viewport metadata. A page must not collapse planning into individual components without first establishing page hierarchy, navigation, content flow, and responsive behavior.
All three tracks converge into the design thinking, implementation, anti-generic guidance, self-critique, and optional validation below; do not duplicate those stages per track.
## Design Thinking
Before coding, understand the context and commit to a BOLD aesthetic direction:
@@ -62,11 +74,11 @@ Models tend to confidently praise their own mediocre output, so do not ask yours
Accessibility:
- Body-text contrast is at least 4.5:1; large text (24px+, or 18.66px+ bold) and the borders of UI controls and meaningful icons are at least 3:1. Meaning is never carried by color alone.
- Semantics are native: `<button>` for actions, `<a href>` for navigation, real `<label>`s for inputs; exactly one `<h1>` with headings in order; `<header>`, `<nav>`, `<main>`, and `<footer>` landmarks.
- Semantics are native: `<button>` for actions, `<a href>` for navigation, and real `<label>`s for inputs. A page or document has exactly one `<h1>`, headings in order, and appropriate `<header>`, `<nav>`, `<main>`, and `<footer>` landmarks. A component owns native controls, labels, accessible names, and local heading order; it does not add a document-level `<h1>`, global landmarks, or `<meta name="viewport">` merely to satisfy this rubric.
- Every `<img>` has an `alt` attribute (empty `alt=""` when decorative); icon-only controls carry an accessible name.
- First rule of ARIA: prefer a native element over an ARIA role — no ARIA beats wrong ARIA.
- Every interactive element is keyboard-operable and shows a visible focus indicator; the default outline is never removed without a stronger replacement.
- A `<meta name="viewport">` is present and zoom is not disabled; content reflows to a single column with no horizontal scrolling down to 320px wide.
- Every interactive element is keyboard-operable and shows a visible focus indicator; each component owns this keyboard and focus behavior, and the default outline is never removed without a stronger replacement.
- For a page or document, a `<meta name="viewport">` is present and zoom is not disabled; page-level content reflows to a single column with no horizontal page scrolling down to 320px wide. Components reflow inside their host or container. Intrinsically two-dimensional controls may preserve necessary internal scrolling while preventing unintended page overflow and retaining keyboard access.
Craft:
+30
View File
@@ -34,3 +34,33 @@ test("frontend-design: enforces variety / anti-convergence across generations",
assert.match(skill, /Vary across generations/i);
assert.match(skill, /diverge/i);
});
test("frontend-design: resolves material requirements before implementation", () => {
assert.match(skill, /##\s*Scope and requirements/i);
assert.match(skill, /ask only about missing information.*materially changes/is);
assert.ok(
skill.indexOf("## Scope and requirements") < skill.indexOf("Then implement working code"),
"scope planning precedes implementation",
);
});
test("frontend-design: separates page and component ownership", () => {
assert.match(skill, /Page or application/i);
assert.match(skill, /information architecture.*navigation.*viewport/is);
assert.match(skill, /Isolated or reusable component/i);
assert.match(skill, /inputs.*events.*variants.*states.*host context/is);
assert.match(skill, /Hybrid work/i);
assert.match(skill, /component.*must not.*page shell.*global landmarks.*viewport metadata/is);
assert.match(skill, /page.*must not.*collapse.*individual components/is);
});
test("frontend-design: preserves objective accessibility thresholds", () => {
for (const value of ["4.5:1", "3:1", "320px", "line-height", "45-75", "three times per second"]) {
assert.ok(skill.includes(value), `missing objective check ${value}`);
}
assert.match(skill, /keyboard-operable.*visible focus/is);
assert.match(skill, /native element.*ARIA/is);
assert.match(skill, /zoom is not disabled/i);
assert.match(skill, /page.*exactly one `<h1>`.*landmarks/is);
assert.match(skill, /component.*document-level `<h1>`.*landmarks.*`<meta name="viewport">`/is);
});