@ctxr/skill-frontend-excellence 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/LICENSE +21 -0
- package/README.md +114 -0
- package/SKILL.md +227 -0
- package/package.json +63 -0
- package/references/accessibility.md +396 -0
- package/references/audit-workflow.md +390 -0
- package/references/components.md +247 -0
- package/references/data-viz.md +457 -0
- package/references/defects.md +152 -0
- package/references/design.md +513 -0
- package/references/forms.md +485 -0
- package/references/lighthouse.md +242 -0
- package/references/motion.md +642 -0
- package/references/performance.md +416 -0
- package/references/pre-launch.md +342 -0
- package/references/responsive.md +519 -0
- package/references/seo.md +422 -0
- package/references/ui-ux.md +565 -0
- package/scripts/check-no-dashes.mjs +90 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Three new reference files: `references/audit-workflow.md` (19-phase multi-page audit and polish workflow with capture script and final acceptance gate), `references/components.md` (when to extract, the 11 widget families, component contract checklist, drift detection with collector snippet, CSS patterns that prevent drift), and `references/defects.md` (29-row symptom-to-fix lookup, canonical 9-check programmatic geometry sweep, per-check thresholds).
|
|
12
|
+
- Five new "Multi-page consistency" rules in SKILL.md (rules 31 through 35), covering extraction at three instances, no page-local CSS overrides on shared widgets, before-and-after screenshots at canonical viewports, re-render after every fix group on shared widgets, and a clean geometry sweep at `1440x900` and `375x812`.
|
|
13
|
+
- New "Multi-Page Polish Loop" section in SKILL.md indexing the 19 phases with deep links into `audit-workflow.md`.
|
|
14
|
+
- Six new gates in SKILL.md "Self-Improvement" for multi-page audit work (widget inventory built, baseline and after screenshots at both viewports, geometry sweep clean, drift collector clean, per-route audit table delivered).
|
|
15
|
+
- New "Canonical Audit Capture Viewports" subsection in `references/responsive.md` defining `1440x900` (desktop) and `375x812` (mobile) as the standard capture sizes for multi-page polish.
|
|
16
|
+
- New "Cross-page consistency" and "Mobile drawer scroll lock" subsections in `references/ui-ux.md`.
|
|
17
|
+
- New "Lang, Main, and Skip Link" mini-checklist in `references/accessibility.md`.
|
|
18
|
+
- New "Reference Comparison Heuristics" section in `references/design.md` (the 16 visual quality tests).
|
|
19
|
+
- New section 17 "Multi-Page Polish Gate" in `references/pre-launch.md` (renumbers the prior 17 to 18).
|
|
20
|
+
- New JS-sample policy in `CONTRIBUTING.md` (~30 line cap, standard DOM and CSSOM APIs only, framework-neutral introduction sentence).
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Quick Reference in SKILL.md grew from 30 to 35 highest-leverage rules. Rules 1 through 30 keep their existing slots; rules 31 through 35 are appended under the new "Multi-page consistency" sub-heading. Section heading updated.
|
|
25
|
+
- "When to Use" in SKILL.md adds the multi-page audit and polish trigger.
|
|
26
|
+
- "Workflow" in SKILL.md frames the rendered browser as the source of truth and points readers to the Multi-Page Polish Loop when the work is auditing or polishing an existing site.
|
|
27
|
+
- Subsumed `visual-polish-websites` skill: every practice from that skill (operating rules, 19-phase workflow, widget inventory, screenshot-driven evidence, geometry sweep, defect lookup, reference-level heuristics, final acceptance gate) is now covered in the merged skill, with framework-named extraction examples replaced by a single framework-neutral component contract.
|
|
28
|
+
- Repositioned as an Agent Skills package supporting both Claude Code and OpenAI Codex CLI (plus any other harness that follows the open Agent Skills standard). README headline, package.json description, and keywords now lead with cross-harness framing rather than Claude-only branding. No content changes: the SKILL.md prose was already provider-neutral.
|
|
29
|
+
- Reordered package.json keywords to lead with `agent-skills`, `agents-md`, `codex`, `claude-code` so registry searches for open-standard terms surface this package first.
|
|
30
|
+
- Updated git-submodule install path in README from `.claude/skills/` to `.agents/skills/` to match the canonical install topology used by `@ctxr/kit`.
|
|
31
|
+
- Declared `publishConfig.access: "public"` so scoped npm publish does not require a trailing `--access public`.
|
|
32
|
+
|
|
33
|
+
## [0.1.0] - 2026-05-08
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- Initial release. SKILL.md plus 11 reference docs covering Lighthouse mastery, performance optimisation, accessibility (WCAG 2.2 AA), SEO, UI/UX patterns, design aesthetics, responsive layout, motion and animation, forms and feedback, data visualisation, and a pre-launch verification checklist.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 skill-frontend-excellence contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Frontend Excellence Skill (Claude Code, Codex CLI)
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@ctxr/skill-frontend-excellence)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
[](https://agentskills.io)
|
|
6
|
+
|
|
7
|
+
> Supports Claude Code and OpenAI Codex CLI via the open Agent Skills standard. Content-only Markdown: one entry point (`SKILL.md`) plus topical references under `references/`. No runtime, no scripts, no framework assumptions.
|
|
8
|
+
|
|
9
|
+
A holistic, framework-agnostic playbook for shipping ultra-fast, accessible, search-friendly, visually distinctive web interfaces. Combines Lighthouse mastery, UI/UX patterns, design aesthetics, performance, accessibility, SEO, motion, forms, layout, data visualization, and a 19-phase multi-page audit workflow with widget standardization and geometry sweeps. Every rule is expressed as a principle plus a concrete check, never as a library API, so the guidance applies to vanilla HTML/CSS/JS, React, Vue, Svelte, Astro, Solid, Next.js, Nuxt, SvelteKit, Remix, Qwik, Lit, and Web Components alike.
|
|
10
|
+
|
|
11
|
+
The skill encodes a single, opinionated bar (see [North Star Targets](#north-star-targets)). Treat any failure as a blocking defect, not a polish task.
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Install into your project
|
|
17
|
+
npx @ctxr/kit install @ctxr/skill-frontend-excellence
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Open the project in any Agent Skills-compatible harness. The skill auto-activates from its YAML frontmatter the moment a prompt touches how an interface looks, feels, moves, loads, ranks, or is interacted with. There is no slash command to invoke; the skill is content-only.
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
|
|
24
|
+
- An Agent Skills-compatible harness ([Claude Code](https://claude.ai/code) CLI/IDE, or OpenAI Codex CLI)
|
|
25
|
+
- A project directory where you want the skill installed. Project-scope installs land at `.agents/skills/skill-frontend-excellence/`; user-scope installs (`--user`) land at `~/.agents/skills/skill-frontend-excellence/`. Discovery-mirror symlinks at `.claude/skills/` (and `~/.codex/skills/` at user scope) are created automatically so both harnesses find the skill without extra configuration.
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
### Manual
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
git clone https://github.com/ctxr-dev/skill-frontend-excellence.git /tmp/skill-frontend-excellence
|
|
33
|
+
mkdir -p .agents/skills
|
|
34
|
+
cp -r /tmp/skill-frontend-excellence .agents/skills/skill-frontend-excellence
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Git Submodule
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git submodule add https://github.com/ctxr-dev/skill-frontend-excellence.git \
|
|
41
|
+
.agents/skills/skill-frontend-excellence
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Pins the skill at a specific commit; update explicitly via `git submodule update --remote`.
|
|
45
|
+
|
|
46
|
+
## Usage
|
|
47
|
+
|
|
48
|
+
Agent Skills-compatible harnesses (Claude Code, Codex CLI) surface this skill automatically based on the YAML frontmatter at the top of `SKILL.md`. The `description` field tells the host when to load it: any prompt that touches how an interface looks, feels, moves, loads, ranks, or is interacted with will trigger activation.
|
|
49
|
+
|
|
50
|
+
When the skill is active, the host reads `SKILL.md` first (the entry point with the North Star Targets, priority stack, workflow, the Multi-Page Polish Loop, and the 35 highest-leverage rules), then loads only the topical reference under `references/` that matches the current work. There is nothing to invoke manually; install the skill and proceed with the task.
|
|
51
|
+
|
|
52
|
+
For the canonical entry point, read [`SKILL.md`](SKILL.md).
|
|
53
|
+
|
|
54
|
+
## What's Inside
|
|
55
|
+
|
|
56
|
+
| File | Use when |
|
|
57
|
+
|------|---------|
|
|
58
|
+
| [SKILL.md](SKILL.md) | Entry point. North Star Targets, priority stack, workflow, Multi-Page Polish Loop, the 35 highest-leverage rules, self-improvement checklist. |
|
|
59
|
+
| [references/lighthouse.md](references/lighthouse.md) | Running a Lighthouse audit, interpreting scores, fixing failing audits, setting up CI gates. |
|
|
60
|
+
| [references/performance.md](references/performance.md) | Optimizing assets, JS execution, hydration, render strategy, network, caching, fonts, images. |
|
|
61
|
+
| [references/accessibility.md](references/accessibility.md) | WCAG 2.2 AA: semantic HTML, ARIA, keyboard, focus, screen reader, contrast, dynamic type, reduced motion. |
|
|
62
|
+
| [references/seo.md](references/seo.md) | Meta tags, headings, structured data, canonicals, sitemaps, robots, internal linking, content quality. |
|
|
63
|
+
| [references/ui-ux.md](references/ui-ux.md) | Touch targets, navigation, density, hover/press/focus states, hierarchy, empty/loading/error states. |
|
|
64
|
+
| [references/design.md](references/design.md) | Typography, color, spacing, composition, atmosphere, dark/light parity, avoiding generic AI styling. |
|
|
65
|
+
| [references/responsive.md](references/responsive.md) | Breakpoints, mobile-first, container queries, fluid typography, safe areas, viewport units. |
|
|
66
|
+
| [references/motion.md](references/motion.md) | Timing, easing, principles, reduced-motion, transform-only animation, choreography. |
|
|
67
|
+
| [references/forms.md](references/forms.md) | Validation, error placement, autofill, autosave, success/error states, multi-step flows. |
|
|
68
|
+
| [references/data-viz.md](references/data-viz.md) | Chart selection, axes, legends, color, accessibility, large datasets. |
|
|
69
|
+
| [references/pre-launch.md](references/pre-launch.md) | Final verification gate before declaring a page complete. |
|
|
70
|
+
| [references/audit-workflow.md](references/audit-workflow.md) | Auditing or polishing an existing multi-page site against a reference; route-by-route capture, fix, and verify procedure. |
|
|
71
|
+
| [references/components.md](references/components.md) | Standardizing repeated widgets, defining component contracts, detecting drift across pages. |
|
|
72
|
+
| [references/defects.md](references/defects.md) | Symptom-to-fix lookup for common visible defects and the canonical programmatic geometry sweep. |
|
|
73
|
+
|
|
74
|
+
## North Star Targets
|
|
75
|
+
|
|
76
|
+
Every interface should meet these bars before being considered "done". Treat any failure as a blocking defect, not a polish task.
|
|
77
|
+
|
|
78
|
+
| Category | Mobile target | Desktop target | Source |
|
|
79
|
+
|----------|--------------|----------------|--------|
|
|
80
|
+
| Lighthouse Performance | >= 95 | >= 99 | Lighthouse |
|
|
81
|
+
| Lighthouse Accessibility | 100 | 100 | Lighthouse + axe |
|
|
82
|
+
| Lighthouse Best Practices | 100 | 100 | Lighthouse |
|
|
83
|
+
| Lighthouse SEO | 100 | 100 | Lighthouse |
|
|
84
|
+
| Largest Contentful Paint (LCP) | < 2.5s | < 2.0s | Core Web Vitals |
|
|
85
|
+
| Interaction to Next Paint (INP) | < 200ms | < 200ms | Core Web Vitals |
|
|
86
|
+
| Cumulative Layout Shift (CLS) | < 0.1 | < 0.05 | Core Web Vitals |
|
|
87
|
+
| Time to First Byte (TTFB) | < 800ms | < 600ms | Core Web Vitals |
|
|
88
|
+
| First Contentful Paint (FCP) | < 1.8s | < 1.0s | Lighthouse |
|
|
89
|
+
| Total Blocking Time (TBT) | < 200ms | < 100ms | Lighthouse |
|
|
90
|
+
| Initial JS payload (gzipped) | < 90 KB | < 130 KB | Budget |
|
|
91
|
+
| Initial CSS payload (gzipped) | < 25 KB | < 35 KB | Budget |
|
|
92
|
+
| Web font payload (per screen) | <= 2 families, <= 4 weights | same | Budget |
|
|
93
|
+
|
|
94
|
+
These are the universal bar. A given project may consciously relax a budget for a specific surface (e.g., a heavily interactive client-rendered tool that legitimately ships more JS), but the relaxation should be a recorded, justified exception, not a default.
|
|
95
|
+
|
|
96
|
+
## Contributing
|
|
97
|
+
|
|
98
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for local setup, editing conventions, and the strict style rules (framework-agnostic phrasing, generic placeholders, no em or en dashes).
|
|
99
|
+
|
|
100
|
+
## Releasing
|
|
101
|
+
|
|
102
|
+
Releases are PR-gated. Version bumps land on `main` through a review gate like any other change; only the tag push and npm publish are automated.
|
|
103
|
+
|
|
104
|
+
1. **Actions, Release, Run workflow.** Branch selector: `main` (the workflow refuses any other ref). Version bump: `patch`, `minor`, or `major`.
|
|
105
|
+
2. The workflow bumps `package.json` on a fresh `release/v<version>` branch and opens a release PR.
|
|
106
|
+
3. Review and merge the PR (the diff is just version fields).
|
|
107
|
+
4. On merge, `tag-on-main.yml` detects the version change, creates the annotated `v<version>` tag, and pushes it.
|
|
108
|
+
5. The tag push triggers `publish.yml`, which runs validation, verifies tag/version agreement, and publishes to npm via OIDC trusted publishing.
|
|
109
|
+
|
|
110
|
+
See [GitHub Releases](https://github.com/ctxr-dev/skill-frontend-excellence/releases) for the changelog, and [CHANGELOG.md](CHANGELOG.md) for the in-repo history.
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
[MIT](LICENSE)
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-excellence
|
|
3
|
+
description: Holistic, framework-agnostic playbook for shipping ultra-fast, accessible, search-friendly, visually distinctive web interfaces. Combines Lighthouse mastery (target 95+ mobile, 99+ desktop, 100 A11y/BP/SEO), UI/UX patterns drawn from Apple HIG and Material Design, design aesthetics that avoid generic AI styling, plus deep guidance on performance, accessibility, SEO, motion, forms, layout, and data visualization. Apply this when building, reviewing, refactoring, or polishing any web UI regardless of framework (vanilla HTML/CSS/JS, React, Vue, Svelte, Astro, Solid, Next.js, Nuxt, SvelteKit, Remix, Qwik, Lit, Web Components). Use to make decisions about typography, color, spacing, motion, contrast, semantic structure, asset loading, render strategy, hydration, third-party scripts, image formats, font loading, JS budgets, CSS architecture, ARIA, keyboard flows, focus management, structured data, meta tags, and Core Web Vitals.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Frontend Excellence
|
|
7
|
+
|
|
8
|
+
A single, holistic skill for delivering web interfaces that look unforgettable, perform near the top of the Lighthouse curve, and degrade gracefully across devices and assistive technologies. Framework-agnostic by design: every rule is expressed as a principle plus a concrete check, never as a library API.
|
|
9
|
+
|
|
10
|
+
## When to Use
|
|
11
|
+
|
|
12
|
+
Apply this skill any time the work changes how an interface **looks, feels, moves, loads, ranks, or is interacted with**. Examples:
|
|
13
|
+
|
|
14
|
+
- Building or refactoring any page, form, modal, navigation, table, chart, or component
|
|
15
|
+
- Choosing typography, color, spacing, motion, or visual style
|
|
16
|
+
- Auditing or improving Core Web Vitals (LCP, INP, CLS), bundle size, or hydration cost
|
|
17
|
+
- Auditing or improving accessibility (contrast, keyboard, screen reader, focus, dynamic type)
|
|
18
|
+
- Auditing or improving on-page SEO (titles, descriptions, headings, structured data, canonicals)
|
|
19
|
+
- Reviewing visual polish, hierarchy, contrast, density, dark/light mode parity
|
|
20
|
+
- Replacing generic AI-flavored styling with a distinctive aesthetic direction
|
|
21
|
+
- Auditing or polishing an existing multi-page site against a reference design or production baseline
|
|
22
|
+
|
|
23
|
+
Skip this skill for backend logic, infrastructure, data pipelines, or non-visual scripting.
|
|
24
|
+
|
|
25
|
+
## North Star Targets
|
|
26
|
+
|
|
27
|
+
Every interface should meet these bars before being considered "done". Treat any failure as a blocking defect, not a polish task.
|
|
28
|
+
|
|
29
|
+
| Category | Mobile target | Desktop target | Source |
|
|
30
|
+
|----------|--------------|----------------|--------|
|
|
31
|
+
| Lighthouse Performance | >= 95 | >= 99 | Lighthouse |
|
|
32
|
+
| Lighthouse Accessibility | 100 | 100 | Lighthouse + axe |
|
|
33
|
+
| Lighthouse Best Practices | 100 | 100 | Lighthouse |
|
|
34
|
+
| Lighthouse SEO | 100 | 100 | Lighthouse |
|
|
35
|
+
| Largest Contentful Paint (LCP) | < 2.5s | < 2.0s | Core Web Vitals |
|
|
36
|
+
| Interaction to Next Paint (INP) | < 200ms | < 200ms | Core Web Vitals |
|
|
37
|
+
| Cumulative Layout Shift (CLS) | < 0.1 | < 0.05 | Core Web Vitals |
|
|
38
|
+
| Time to First Byte (TTFB) | < 800ms | < 600ms | Core Web Vitals |
|
|
39
|
+
| First Contentful Paint (FCP) | < 1.8s | < 1.0s | Lighthouse |
|
|
40
|
+
| Total Blocking Time (TBT) | < 200ms | < 100ms | Lighthouse |
|
|
41
|
+
| Initial JS payload (gzipped) | < 90 KB | < 130 KB | Budget |
|
|
42
|
+
| Initial CSS payload (gzipped) | < 25 KB | < 35 KB | Budget |
|
|
43
|
+
| Web font payload (per screen) | <= 2 families, <= 4 weights | same | Budget |
|
|
44
|
+
|
|
45
|
+
These are the universal bar. A given project may consciously relax a budget for a specific surface (e.g., a heavily interactive client-rendered tool that legitimately ships more JS), but the relaxation should be a recorded, justified exception, not a default.
|
|
46
|
+
|
|
47
|
+
## Priority Stack (read top-down on any review)
|
|
48
|
+
|
|
49
|
+
1. **Crawlability and indexability** (does the page exist in the index, with the right canonical and meta?)
|
|
50
|
+
2. **Accessibility correctness** (semantic HTML, contrast, keyboard, focus, screen reader)
|
|
51
|
+
3. **Core Web Vitals** (LCP, INP, CLS, TTFB)
|
|
52
|
+
4. **Layout and responsive integrity** (no horizontal scroll, no clipped content, safe-area respect)
|
|
53
|
+
5. **Visual hierarchy and intentional aesthetic** (typography, color, spacing, motion, density)
|
|
54
|
+
6. **Interaction quality** (hover, press, focus, loading, error, empty, success states)
|
|
55
|
+
7. **Forms and feedback** (validation, error placement, recovery, autofill, autosave)
|
|
56
|
+
8. **Motion and animation** (purposeful, reduced-motion safe, transform-only)
|
|
57
|
+
9. **Data and charts** (legible, accessible, responsive)
|
|
58
|
+
10. **Polish and craft** (icon discipline, dark/light parity, brand fidelity)
|
|
59
|
+
|
|
60
|
+
Higher-priority items always block lower-priority items. Never trade contrast for aesthetics. Never trade INP for animation.
|
|
61
|
+
|
|
62
|
+
## Reference Index
|
|
63
|
+
|
|
64
|
+
Detailed guidance lives in `references/`. Load the relevant file when the work touches that domain.
|
|
65
|
+
|
|
66
|
+
| File | Use when |
|
|
67
|
+
|------|---------|
|
|
68
|
+
| [Lighthouse mastery](references/lighthouse.md) | Running a Lighthouse audit, interpreting scores, fixing specific failing audits, setting up CI gates |
|
|
69
|
+
| [Performance deep dive](references/performance.md) | Optimizing assets, JS execution, hydration, render strategy, network, caching, fonts, images |
|
|
70
|
+
| [Accessibility mastery](references/accessibility.md) | Semantic HTML, ARIA, keyboard, focus, screen reader, contrast, dynamic type, reduced motion |
|
|
71
|
+
| [SEO playbook](references/seo.md) | Meta tags, headings, structured data, canonicals, sitemaps, robots, internal linking, content quality |
|
|
72
|
+
| [UI/UX principles](references/ui-ux.md) | Touch targets, navigation, density, hover/press/focus states, hierarchy, empty/loading/error states |
|
|
73
|
+
| [Design aesthetics](references/design.md) | Typography, color theory, spacing, composition, atmosphere, dark/light parity, avoiding AI slop |
|
|
74
|
+
| [Responsive layout](references/responsive.md) | Breakpoints, mobile-first, container queries, fluid typography, safe areas, viewport units |
|
|
75
|
+
| [Motion and animation](references/motion.md) | Timing, easing, principles, reduced-motion, transform-only, choreography |
|
|
76
|
+
| [Forms and feedback](references/forms.md) | Validation, error placement, autofill, autosave, success/error states, multi-step flows |
|
|
77
|
+
| [Data visualization](references/data-viz.md) | Chart selection, axes, legends, color, accessibility, large datasets |
|
|
78
|
+
| [Pre-launch checklist](references/pre-launch.md) | Final verification gate before declaring a page complete |
|
|
79
|
+
| [Multi-page audit workflow](references/audit-workflow.md) | Auditing or polishing an existing multi-page site against a reference; route-by-route capture, fix, and verify procedure |
|
|
80
|
+
| [Component discipline](references/components.md) | Standardizing repeated widgets, defining component contracts, detecting drift across pages |
|
|
81
|
+
| [Visual defects and geometry checks](references/defects.md) | Symptom-to-fix lookup for common visible defects and the canonical programmatic geometry sweep |
|
|
82
|
+
|
|
83
|
+
## Workflow
|
|
84
|
+
|
|
85
|
+
### 1. Frame the work
|
|
86
|
+
|
|
87
|
+
Before writing code, capture:
|
|
88
|
+
|
|
89
|
+
- **Audience and intent**: who is using this, and what task are they trying to complete (discovering, comparing, deciding, doing the job, recovering from error)
|
|
90
|
+
- **Indexability**: is this surface indexed by search engines, or behind authentication? (Affects SEO requirements only; performance and accessibility bars are universal.)
|
|
91
|
+
- **Aesthetic direction**: pick one bold lane (refined-minimal, editorial, brutalist, organic, retro-futuristic, luxury, playful, industrial). See [design.md](references/design.md). Refuse to default to "Inter on white with a purple gradient".
|
|
92
|
+
- **Constraints**: render strategy (SSR / SSG / CSR / ISR / streaming / islands / resumable), hydration model, browser support floor, locale, writing direction (LTR / RTL)
|
|
93
|
+
|
|
94
|
+
The rendered browser is the source of truth at every phase. Do not judge visual quality from code alone; capture screenshots, compare against the reference, fix, and re-capture. When the work is auditing or polishing an existing multi-page site rather than building new, switch to the 19-phase Multi-Page Polish Loop below; the strategic frame above still applies.
|
|
95
|
+
|
|
96
|
+
### 2. Plan the structure
|
|
97
|
+
|
|
98
|
+
- One H1 per page. Sequential H2 -> H3, no skipped levels.
|
|
99
|
+
- Land the LCP element in the first viewport. It must be a real, served asset with declared dimensions, not lazy-loaded, not behind hydration.
|
|
100
|
+
- Reserve space for every async element (image, video, ad, embed, late-injected component) using `aspect-ratio`, fixed height, or skeleton.
|
|
101
|
+
- Place navigation, primary action, and trust signals above the fold on the relevant device class.
|
|
102
|
+
- Decide which sections are server-rendered, which are streamed, which are deferred, and which are client-only. Justify every client-only choice.
|
|
103
|
+
|
|
104
|
+
### 3. Build with budgets
|
|
105
|
+
|
|
106
|
+
For each surface, declare and verify:
|
|
107
|
+
|
|
108
|
+
- JS payload budget (initial route, gzipped)
|
|
109
|
+
- CSS payload budget (initial route, gzipped)
|
|
110
|
+
- Image payload budget (above-the-fold)
|
|
111
|
+
- Font budget (families, weights, subsets, byte total)
|
|
112
|
+
- Third-party script budget (count and total ms of main-thread time)
|
|
113
|
+
|
|
114
|
+
Reject any addition that breaks a budget without an explicit, recorded waiver.
|
|
115
|
+
|
|
116
|
+
### 4. Verify
|
|
117
|
+
|
|
118
|
+
Run the full Lighthouse + axe + visual + responsive + dark-mode + reduced-motion + keyboard + screen-reader pass before declaring the work complete. See [pre-launch.md](references/pre-launch.md).
|
|
119
|
+
|
|
120
|
+
## Multi-Page Polish Loop
|
|
121
|
+
|
|
122
|
+
When the work is auditing or polishing an existing multi-page site, **read [audit-workflow.md](references/audit-workflow.md) first** for the full procedure (operating rules, capture script, per-phase detail, final acceptance gate). The 19 phases below are the index; deep links jump into the corresponding sections. Component extraction discipline lives in [components.md](references/components.md); the defect lookup and geometry sweep live in [defects.md](references/defects.md).
|
|
123
|
+
|
|
124
|
+
1. **Discover Context**: identify project root, build system, source directories, dev server, reference target, and route scope.
|
|
125
|
+
2. **Inventory Routes**: build a route list from links, sitemaps, route manifests, and known required pages.
|
|
126
|
+
3. **Inventory Repeated Widgets**: catalogue the 11 widget families across routes; record source, contract, and variants.
|
|
127
|
+
4. **Capture Baseline**: screenshot every route at `1440x900` and `375x812` before editing.
|
|
128
|
+
5. **Capture Reference**: screenshot the reference target at the same viewports.
|
|
129
|
+
6. **Audit Each Route**: walk header, hero, sections, cards, buttons, typography, color, images, forms, footer, and responsive behavior at each viewport.
|
|
130
|
+
7. **Prioritize Fixes**: broken routes first, then global shell, then cross-page widget drift, then cross-page component defects, then page-specific issues.
|
|
131
|
+
8. **Patch With Component Discipline**: fix the canonical contract, not page-local CSS.
|
|
132
|
+
9. **Patch With Design Discipline**: tokens first; stable dimensions, gap, max-width, focus-visible, and per-role image loading.
|
|
133
|
+
10. **Verify After Every Fix Group**: rebuild, re-capture, side-by-side compare; check shared components on every route.
|
|
134
|
+
11. **Run Programmatic Geometry Checks**: viewport overflow, text overflow, sub-44 targets, duplicate arrows, dropdown centering, drawer scroll-lock, focus presence.
|
|
135
|
+
12. **Component Drift Checks**: collect computed styles and bounding boxes per family across pages; flag unexplained differences.
|
|
136
|
+
13. **Interaction QA**: open dropdowns, drawers, modals, tabs; verify Esc, outside-click, scroll-lock, focus ring, accessible names.
|
|
137
|
+
14. **Accessibility Validation**: lang, main, headings, labels, alt, contrast, focus order, no traps, skip link.
|
|
138
|
+
15. **Lighthouse and Performance Polish**: responsive `srcset`, intrinsic dimensions, LCP preload, lazy below the fold, font budget.
|
|
139
|
+
16. **Reference-Level Design Heuristics**: 16 yes-or-no quality tests against the reference target.
|
|
140
|
+
17. **Common Defects and Fixes**: 29-row symptom-to-fix lookup; apply the standard fix at the right layer.
|
|
141
|
+
18. **Deliverables**: per-page checklist, widget inventory, before-and-after screenshots, validation summary.
|
|
142
|
+
19. **Final Acceptance Gate**: 16-item binary checklist; not done until every item is yes.
|
|
143
|
+
|
|
144
|
+
## Quick Reference: The 35 Highest-Leverage Rules
|
|
145
|
+
|
|
146
|
+
A condensed view. Every rule has a longer treatment in the references.
|
|
147
|
+
|
|
148
|
+
### Performance (the levers that actually move the score)
|
|
149
|
+
|
|
150
|
+
1. **One LCP image, optimized end-to-end.** Serve AVIF first, WebP fallback, responsive `srcset` with at least 3 widths, declared `width`/`height`, `fetchpriority="high"`, no lazy-load, preload only if the image is rendered by client JS.
|
|
151
|
+
2. **Inline critical CSS for above-the-fold; defer the rest.** Aim for under 14 KB of inline CSS so it fits in the first TCP round trip.
|
|
152
|
+
3. **Self-host fonts, subset to used glyphs, `font-display: swap` for body, `optional` for display.** Preload at most one critical font weight. Never preload 4 weights.
|
|
153
|
+
4. **Cap initial JS at the budget.** Code-split by route and by interaction. Defer hydration of below-the-fold islands. Prefer server components or static HTML where possible.
|
|
154
|
+
5. **No layout-shifting late content.** Reserve space with `aspect-ratio`, `min-height`, or skeletons. The CLS budget is < 0.1 mobile / < 0.05 desktop.
|
|
155
|
+
6. **Animate only `transform` and `opacity`.** Anything that triggers layout (width/height/top/left/margin) is forbidden in animations.
|
|
156
|
+
7. **Pin third-party scripts to async/defer with `fetchpriority="low"`.** Treat every third-party script as a Lighthouse hostage. Audit count and total CPU monthly.
|
|
157
|
+
8. **Cache aggressively at the edge.** Static assets get immutable + 1 year. HTML gets stale-while-revalidate. API responses get the longest TTL the data allows.
|
|
158
|
+
|
|
159
|
+
### Accessibility (the levers that actually move the score AND help real users)
|
|
160
|
+
|
|
161
|
+
9. **Semantic HTML first; ARIA only where semantics fall short.** A `<button>` beats `<div role="button">` every time.
|
|
162
|
+
10. **Contrast >= 4.5:1 for body, >= 3:1 for large text and meaningful UI graphics.** Verify in both light and dark mode separately.
|
|
163
|
+
11. **Visible focus on every interactive element**, with 2-4px outline and 3:1 contrast against the surface and against the element's resting state.
|
|
164
|
+
12. **One H1; sequential headings; no skipped levels; no headings used as styling hooks.**
|
|
165
|
+
13. **Every input has a programmatic label.** Placeholder is not a label.
|
|
166
|
+
14. **Every meaningful image has descriptive alt; every decorative image has `alt=""`.**
|
|
167
|
+
15. **Keyboard parity.** Everything reachable by mouse must be reachable, operable, and visible-when-focused by keyboard.
|
|
168
|
+
16. **Respect `prefers-reduced-motion`** by removing or shortening non-essential animation, never by leaving full motion in place.
|
|
169
|
+
|
|
170
|
+
### SEO (the levers that actually move the score AND drive traffic)
|
|
171
|
+
|
|
172
|
+
17. **Unique, intent-matching `<title>` and `<meta name="description">` per page.** 50-60 char title, 140-160 char description.
|
|
173
|
+
18. **Self-referencing canonical on every indexable page.** No conflicting canonicals between hreflang variants.
|
|
174
|
+
19. **One H1 with the primary intent term used naturally.** Sequential H2/H3.
|
|
175
|
+
20. **Descriptive, kebab-case, lowercase URLs without tracking params in canonical.**
|
|
176
|
+
21. **JSON-LD structured data where applicable** (Organization, WebSite, BreadcrumbList, Article, FAQPage, Product, SoftwareApplication, HowTo).
|
|
177
|
+
22. **Internal linking with descriptive anchor text.** No "click here". No orphan pages.
|
|
178
|
+
23. **`robots: index, follow` on indexable pages**, `noindex` on private, search-result, or duplicate pages.
|
|
179
|
+
24. **XML sitemap lists only canonical, indexable, 200-status URLs**, referenced from robots.txt.
|
|
180
|
+
|
|
181
|
+
### UI/UX (the levers that move perceived quality)
|
|
182
|
+
|
|
183
|
+
25. **Touch targets >= 44x44pt** (iOS) or **>= 48x48dp** (Android), with 8px+ spacing between adjacent targets.
|
|
184
|
+
26. **Every async action has loading -> success/error feedback within 100ms of the trigger.** Skeleton screens beat spinners after 300ms.
|
|
185
|
+
27. **One primary CTA per screen.** Secondary actions visually subordinate; destructive actions visually separated.
|
|
186
|
+
28. **State the empty state.** Empty lists, empty searches, and zero-data charts get a specific message, not a blank canvas.
|
|
187
|
+
|
|
188
|
+
### Design (the levers that move "this looks designed")
|
|
189
|
+
|
|
190
|
+
29. **Pick a distinctive type pairing.** Refuse Inter + system-ui defaults. Pair a characterful display face with a refined body face. Cap to 2 families and 4 weights.
|
|
191
|
+
30. **Commit to a dominant color with one or two sharp accents.** Timid, evenly-distributed palettes read as generic. Use semantic tokens, never raw hex in components.
|
|
192
|
+
|
|
193
|
+
### Multi-page consistency (the levers that prevent cross-page drift)
|
|
194
|
+
|
|
195
|
+
31. **Extract repeated markup at the third instance** (or at the second with clear future reuse, or at any visible drift). One source of truth or one named variant; no third option.
|
|
196
|
+
32. **No page-local CSS overrides on shared widgets.** Components own their visual contract; pages adjust only what the component exposes.
|
|
197
|
+
33. **Capture before-and-after screenshots at `1440x900` and `375x812` for every visible change.** Vague claims of improvement without screenshot evidence are not evidence.
|
|
198
|
+
34. **Re-render every route after every fix group on shared widgets.** A global change verified on one page is not verified.
|
|
199
|
+
35. **Geometry sweep returns zero issues at both audit viewports** (viewport bleed, text overflow, sub-44 targets, duplicate arrows, drawer scroll-lock, focus presence). See [defects.md](references/defects.md).
|
|
200
|
+
|
|
201
|
+
## Self-Improvement
|
|
202
|
+
|
|
203
|
+
After applying this skill, before declaring work complete:
|
|
204
|
+
|
|
205
|
+
- Did Lighthouse run on real production builds (not dev mode) with throttled mobile and desktop presets?
|
|
206
|
+
- Did axe (or equivalent) run with zero violations on every changed page?
|
|
207
|
+
- Did the page render correctly at 320px, 375px, 768px, 1024px, 1280px, and 1920px?
|
|
208
|
+
- Did the page render correctly in light and dark mode independently (not by CSS-inverting one)?
|
|
209
|
+
- Did the page render correctly with `prefers-reduced-motion: reduce`?
|
|
210
|
+
- Did the page work end-to-end with keyboard only?
|
|
211
|
+
- Did the page survive a screen reader pass (VoiceOver or NVDA) for the primary task?
|
|
212
|
+
- Did the LCP element ship with `fetchpriority="high"`, declared dimensions, and a real served asset?
|
|
213
|
+
- Did all custom fonts load with `font-display` set, and is the count <= 2 families / 4 weights?
|
|
214
|
+
- Did every async section reserve space?
|
|
215
|
+
- Did every interactive element have visible focus and meet contrast?
|
|
216
|
+
- Did the page expose unique title, description, canonical, OG, Twitter, and (where applicable) JSON-LD?
|
|
217
|
+
|
|
218
|
+
For multi-page audit and polish work, also confirm:
|
|
219
|
+
|
|
220
|
+
- Was a widget inventory built for every shared family (header, hero, section, CTA, card, media, list, interactive, empty, legal, 404)?
|
|
221
|
+
- Were baseline screenshots captured at `1440x900` and `375x812` before any edits?
|
|
222
|
+
- Were after screenshots captured at `1440x900` and `375x812` for every changed route?
|
|
223
|
+
- Did the geometry sweep return zero issues on every audited route at both viewports?
|
|
224
|
+
- Did the drift collector return no unexplained differences for any shared widget family?
|
|
225
|
+
- Was a per-route audit table (issues found, fixes applied, before, after) delivered with the change?
|
|
226
|
+
|
|
227
|
+
If any answer is "no" or "not checked", the work is not done.
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ctxr/skill-frontend-excellence",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Agent Skills playbook (Claude Code, Codex CLI): framework-agnostic guide for shipping ultra-fast, accessible, search-friendly, visually distinctive web interfaces. Lighthouse mastery, UI/UX, design aesthetics, performance, accessibility, SEO, motion, forms, layout, data-viz, multi-page audit workflow, component standardization, geometry sweep.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/ctxr-dev/skill-frontend-excellence.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/ctxr-dev/skill-frontend-excellence#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/ctxr-dev/skill-frontend-excellence/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"agent-skills",
|
|
17
|
+
"agents-md",
|
|
18
|
+
"codex",
|
|
19
|
+
"claude-code",
|
|
20
|
+
"skill",
|
|
21
|
+
"frontend",
|
|
22
|
+
"lighthouse",
|
|
23
|
+
"accessibility",
|
|
24
|
+
"seo",
|
|
25
|
+
"ui-ux",
|
|
26
|
+
"design",
|
|
27
|
+
"performance",
|
|
28
|
+
"core-web-vitals",
|
|
29
|
+
"ai",
|
|
30
|
+
"agents",
|
|
31
|
+
"ctxr"
|
|
32
|
+
],
|
|
33
|
+
"files": [
|
|
34
|
+
"SKILL.md",
|
|
35
|
+
"references/",
|
|
36
|
+
"scripts/check-no-dashes.mjs",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE",
|
|
39
|
+
"CHANGELOG.md"
|
|
40
|
+
],
|
|
41
|
+
"ctxr": {
|
|
42
|
+
"type": "skill",
|
|
43
|
+
"target": "folder"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=20"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"lint": "markdownlint-cli2 \"**/*.md\" \"#node_modules\"",
|
|
53
|
+
"lint:fix": "markdownlint-cli2 --fix \"**/*.md\" \"#node_modules\"",
|
|
54
|
+
"validate:no-dashes": "node scripts/check-no-dashes.mjs",
|
|
55
|
+
"validate": "npm run validate:no-dashes && npm run lint",
|
|
56
|
+
"prepare": "husky",
|
|
57
|
+
"prepublishOnly": "npm run validate"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"husky": "^9.1.0",
|
|
61
|
+
"markdownlint-cli2": "^0.14.0"
|
|
62
|
+
}
|
|
63
|
+
}
|