Skip to content

skill: add visual consistency and heading anchor checks to frontend review#65

Merged
wilsonwangdev merged 1 commit into
mainfrom
skill/frontend-review-visual-anchors
May 7, 2026
Merged

skill: add visual consistency and heading anchor checks to frontend review#65
wilsonwangdev merged 1 commit into
mainfrom
skill/frontend-review-visual-anchors

Conversation

@wilsonwangdev
Copy link
Copy Markdown
Owner

Extend skills/frontend-interaction-review/SKILL.md with two new check groups that surfaced as repeated failure classes during content-page UX iteration (captured in memory feedback_content_page_ux.md).

Changes

Visual consistency (new)

  • Spacing values must reference CSS variables (e.g., --space-sm, --space-lg) rather than bare rem/px literals.
  • Divider-style borders reviewed as a set, not individually — mixed widths or color tokens create visual noise.
  • Decorative heading styles scoped to their container, not declared globally on h3.
  • Inline critical background/color CSS in <head> with a light-mode media query to prevent dark-theme FOUC.
  • Typography fundamentals within roughly ±15% of a baseline such as GitHub Markdown CSS.

Heading anchors (new)

  • Anchor icon on the left of the heading for predictable position.
  • tabindex="-1" + aria-label instead of aria-hidden on focusable elements.
  • Unicode-aware slugify (\p{L}\p{N} with the u flag).
  • Anchor clicks use history.replaceState with element.getAttribute('href') — not element.href.

Why

The six existing check groups (tooltip, overflow, hover, transition, responsive, scroll) did not cover these patterns, and each recurred across multiple sessions. Encoding them here moves the lesson from session memory into the Layer 2 skill so any project adopting the skill benefits.

Tested

npm run build succeeds — 26 pages generated. The skill file remains Layer 2 (no project-specific paths or values).

…eview

Add two new check groups to frontend-interaction-review that surfaced
as repeated failure classes during content-page UX iteration:

- Visual consistency: CSS variable references for spacing, divider
  borders audited as a set, scoped decorative heading styles, inline
  critical CSS for FOUC prevention on dark themes, typography baseline
  proximity (GitHub Markdown CSS as reference point).
- Heading anchors: left-positioned anchors for predictable layout,
  tabindex="-1" + aria-label instead of aria-hidden on focusable
  elements, Unicode-aware slugify (\p{L}\p{N} with u flag),
  history.replaceState with getAttribute('href') for intra-page
  navigation.

Both groups are Layer 2 — generic criteria with no project-specific
paths or values.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-master-handbook Ready Ready Preview, Comment May 7, 2026 3:22pm

@wilsonwangdev wilsonwangdev merged commit 6010342 into main May 7, 2026
3 checks passed
wilsonwangdev added a commit that referenced this pull request May 7, 2026
…ules (#67)

Add three rules to AGENTS.md Quality Baseline that encode the
content-page UX lessons captured in session memory
(`feedback_content_page_ux.md`).

## Changes
Three new bullets in the Quality Baseline section:

- Spacing, border-width, and colors must reference `--space-*`,
`--border-*`, and color tokens. Bare `rem`/`px` literals for margin,
padding, gap, or border-width are a review finding. Points at the new
`content/guides/css-variable-consistency/` guide for rationale.
- Adding or changing a divider-style border requires auditing all
existing dividers in the file as a set. Mixed widths (1px vs 2px) or
mixed color tokens (`--border` vs `--border-bright`) count as
inconsistency.
- Dark-theme pages must inline critical `background`/`color` CSS in
`<head>` with a light-mode media-query fallback to prevent FOUC.

## Why
The frontend-interaction-review skill's new Visual consistency group (PR
#65) already encodes these rules. Mirroring them in the Quality Baseline
makes them discoverable during pre-work without requiring the agent to
open the skill file first — most pre-work checks live in AGENTS.md
today.

## Relation to other open PRs
- PR #65 adds the skill-level version of the same rules.
- PR #66 adds the Layer 1 rationale guide.
- This PR (#?) adds the project-specific baseline enforcement. Each
lives in a different file; no rebase coordination needed.

## Tested
`npm run build` succeeds — 26 pages generated. The added guide reference
(`content/guides/css-variable-consistency/en.md`) is correct relative to
merged state once PR #66 lands.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wilsonwangdev wilsonwangdev deleted the skill/frontend-review-visual-anchors branch May 7, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant