@mohammadhprp/system-prompt 0.11.2 → 0.12.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/framework/agents/researcher.md +1 -1
- package/framework/mcps/github-mcp/README.md +1 -1
- package/framework/mcps/github-mcp/configs/.env.example +1 -1
- package/framework/plugins/ponytail/README.md +1 -1
- package/framework/plugins/ponytail/capabilities.md +1 -1
- package/framework/references/standards/pull-requests.md +1 -1
- package/framework/skills/README.md +3 -3
- package/framework/skills/diagram-design/SKILL.md +1 -1
- package/framework/skills/effective-html/SKILL.md +63 -0
- package/framework/skills/effective-html/examples.md +19 -0
- package/framework/skills/effective-html/references/charts-and-data.md +32 -0
- package/framework/skills/effective-html/references/creative-direction.md +48 -0
- package/framework/skills/effective-html/references/design-artifact.md +78 -0
- package/framework/skills/effective-html/references/diagrams.md +68 -0
- package/framework/skills/effective-html/references/documents-and-presentations.md +28 -0
- package/framework/skills/effective-html/references/html-diagram.md +43 -0
- package/framework/skills/effective-html/references/html-plan.md +40 -0
- package/framework/skills/effective-html/references/html-prototype.md +97 -0
- package/framework/skills/effective-html/references/html-wireframe.md +81 -0
- package/framework/skills/effective-html/references/html.md +72 -0
- package/framework/skills/effective-html/references/interfaces.md +17 -0
- package/framework/skills/great-interface/SKILL.md +43 -0
- package/framework/skills/great-interface/references/animations.md +205 -0
- package/framework/skills/great-interface/references/better-accessibility.md +106 -0
- package/framework/skills/great-interface/references/better-colors.md +100 -0
- package/framework/skills/great-interface/references/better-interface.md +132 -0
- package/framework/skills/great-interface/references/better-layout.md +76 -0
- package/framework/skills/great-interface/references/better-typography.md +157 -0
- package/framework/skills/great-interface/references/better-ui.md +107 -0
- package/framework/skills/great-interface/references/better-writing.md +109 -0
- package/framework/skills/great-interface/references/choosing-fonts.md +64 -0
- package/framework/skills/great-interface/references/color-formats.md +90 -0
- package/framework/skills/great-interface/references/color-usage.md +118 -0
- package/framework/skills/great-interface/references/contrast.md +79 -0
- package/framework/skills/great-interface/references/css-cheat-sheet.md +65 -0
- package/framework/skills/great-interface/references/details-and-accessibility.md +119 -0
- package/framework/skills/great-interface/references/enter-exit.md +147 -0
- package/framework/skills/great-interface/references/explain-interface.md +126 -0
- package/framework/skills/great-interface/references/find-the-effect.md +94 -0
- package/framework/skills/great-interface/references/focus-and-keyboard.md +131 -0
- package/framework/skills/great-interface/references/forms.md +84 -0
- package/framework/skills/great-interface/references/from-an-image.md +55 -0
- package/framework/skills/great-interface/references/grouping-and-alignment.md +123 -0
- package/framework/skills/great-interface/references/hit-areas.md +94 -0
- package/framework/skills/great-interface/references/icon-transitions.md +102 -0
- package/framework/skills/great-interface/references/icons.md +110 -0
- package/framework/skills/great-interface/references/interface-review.md +148 -0
- package/framework/skills/great-interface/references/motion-and-zoom.md +79 -0
- package/framework/skills/great-interface/references/no-browser.md +73 -0
- package/framework/skills/great-interface/references/palette-generation.md +104 -0
- package/framework/skills/great-interface/references/palette-structure.md +76 -0
- package/framework/skills/great-interface/references/performance.md +88 -0
- package/framework/skills/great-interface/references/picker.md +76 -0
- package/framework/skills/great-interface/references/read-the-system.md +178 -0
- package/framework/skills/great-interface/references/removed-signals.md +38 -0
- package/framework/skills/great-interface/references/review-format.md +46 -0
- package/framework/skills/great-interface/references/scope-resolution.md +88 -0
- package/framework/skills/great-interface/references/screen-readers.md +101 -0
- package/framework/skills/great-interface/references/semantics-and-aria.md +84 -0
- package/framework/skills/great-interface/references/spacing-and-adaptivity.md +159 -0
- package/framework/skills/great-interface/references/spacing-and-sizing.md +121 -0
- package/framework/skills/great-interface/references/surfaces.md +219 -0
- package/framework/skills/great-interface/references/token-naming.md +97 -0
- package/framework/skills/great-interface/references/variable-fonts-and-opentype.md +105 -0
- package/framework/skills/great-interface/references/variant.md +104 -0
- package/framework/skills/great-interface/references/wrapping-and-punctuation.md +55 -0
- package/framework/skills/taste/SKILL.md +47 -0
- package/framework/skills/taste/examples.md +73 -0
- package/framework/skills/taste/references/brandkit.md +793 -0
- package/framework/skills/taste/references/design-taste-frontend-v1.md +221 -0
- package/framework/skills/taste/references/design-taste-frontend.md +1201 -0
- package/framework/skills/taste/references/full-output-enforcement.md +44 -0
- package/framework/skills/taste/references/gpt-taste.md +69 -0
- package/framework/skills/taste/references/high-end-visual-design.md +93 -0
- package/framework/skills/taste/references/image-to-code.md +1223 -0
- package/framework/skills/taste/references/imagegen-frontend-mobile.md +1460 -0
- package/framework/skills/taste/references/imagegen-frontend-web.md +982 -0
- package/framework/skills/taste/references/industrial-brutalist-ui.md +87 -0
- package/framework/skills/taste/references/minimalist-ui.md +80 -0
- package/framework/skills/taste/references/redesign-existing-projects.md +173 -0
- package/framework/skills/taste/references/stitch-design-taste-design.md +121 -0
- package/framework/skills/taste/references/stitch-design-taste.md +179 -0
- package/package.json +1 -1
- package/src/agent-configs.js +6 -2
- package/src/catalog.js +3 -2
- package/src/cli.js +82 -2
- package/src/doctor.js +84 -0
- package/src/installer.js +337 -154
- package/framework/skills/brand-guidelines/LICENSE.txt +0 -202
- package/framework/skills/brand-guidelines/SKILL.md +0 -73
- package/framework/skills/lavish/SKILL.md +0 -67
- package/framework/skills/lavish/examples.md +0 -31
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# HTML Prototype
|
|
2
|
+
|
|
3
|
+
Build a credible model of a product decision. Match the artifact to the user's context instead of applying a recurring house style. The goal is not to make every possible screen. The goal is to make the important visual or behavioral question testable.
|
|
4
|
+
|
|
5
|
+
## Choose the fidelity mode
|
|
6
|
+
|
|
7
|
+
Use one of two modes:
|
|
8
|
+
|
|
9
|
+
- **Mockup:** Create a polished, responsive, mostly static artifact when the open question is visual hierarchy, layout, typography, color, or product fit.
|
|
10
|
+
- **Prototype:** Create a working flow when the open question is navigation, input, state change, feedback, recovery, or transition.
|
|
11
|
+
|
|
12
|
+
Do not create a separate `html-mockup` skill. Do not add behavior merely to make a mockup seem more complete. If a user asks for both modes, preserve the same content and structure so changes in fidelity remain easy to compare.
|
|
13
|
+
|
|
14
|
+
## Derive the direction from context
|
|
15
|
+
|
|
16
|
+
Inspect the conversation, supplied references, and project before designing. Look for design-system documentation, tokens, existing components, product screenshots, and nearby artifacts.
|
|
17
|
+
|
|
18
|
+
Authority runs in this order:
|
|
19
|
+
|
|
20
|
+
1. The user's explicit visual and functional instructions.
|
|
21
|
+
2. The project's established design language and interaction conventions.
|
|
22
|
+
3. The product, audience, content, and scenario.
|
|
23
|
+
4. Your own design judgment.
|
|
24
|
+
|
|
25
|
+
Before coding, settle:
|
|
26
|
+
|
|
27
|
+
- the user and critical job;
|
|
28
|
+
- the bounded scenario under review;
|
|
29
|
+
- mockup or prototype mode;
|
|
30
|
+
- the source of the visual direction;
|
|
31
|
+
- the relevant state model;
|
|
32
|
+
- the point where the real product would take over.
|
|
33
|
+
|
|
34
|
+
When no design system exists, create a specific direction from the subject and use case. Do not default to a gradient, a dark dashboard, interchangeable cards, or decorative metrics. A prototype for a field tool, an editorial workflow, and a financial approval should not feel like the same product.
|
|
35
|
+
|
|
36
|
+
When [`design-artifact`](design-artifact.md) is available and the visual
|
|
37
|
+
direction remains open, read and compose it with this skill. Use it to choose
|
|
38
|
+
the register, palette, type, and composition; keep this skill authoritative for
|
|
39
|
+
fidelity, state, and interaction completeness.
|
|
40
|
+
|
|
41
|
+
## Scope one credible experience
|
|
42
|
+
|
|
43
|
+
Choose the smallest flow that can answer the review question. Use realistic, internally consistent names, dates, statuses, quantities, and copy.
|
|
44
|
+
|
|
45
|
+
- Make navigation work for the modeled scope.
|
|
46
|
+
- Implement forms with labels, validation, submission feedback, and sensible defaults.
|
|
47
|
+
- Use dialogs only when interruption or confirmation is part of the scenario.
|
|
48
|
+
- Use transitions to clarify continuity or state change, not as decoration.
|
|
49
|
+
- Remove dead buttons. If an action belongs to the real system, explain the boundary instead of pretending it completed.
|
|
50
|
+
|
|
51
|
+
## Model relevant states
|
|
52
|
+
|
|
53
|
+
List the states before building. Include the states that the chosen scenario can actually reach:
|
|
54
|
+
|
|
55
|
+
- loading;
|
|
56
|
+
- empty;
|
|
57
|
+
- error;
|
|
58
|
+
- success;
|
|
59
|
+
- disabled;
|
|
60
|
+
- mobile;
|
|
61
|
+
- domain-specific states from the brief.
|
|
62
|
+
|
|
63
|
+
An asynchronous-looking prototype action should normally show loading, success, and failure or recovery. A collection should normally consider empty state. A gated action should show why it is disabled. Do not force irrelevant states into the main flow just to satisfy a checklist. Make omitted states explicit in the handoff.
|
|
64
|
+
|
|
65
|
+
## Make interaction complete
|
|
66
|
+
|
|
67
|
+
- Use native elements when they provide the right semantics.
|
|
68
|
+
- Support the entire modeled flow with a keyboard.
|
|
69
|
+
- Keep focus visible and place it deliberately after meaningful transitions.
|
|
70
|
+
- Give dialogs an accessible name, contain focus, close on `Escape`, and restore focus to the trigger.
|
|
71
|
+
- Associate form errors with their controls and announce important status changes.
|
|
72
|
+
- Do not hide essential behavior behind hover.
|
|
73
|
+
- Respect `prefers-reduced-motion` while preserving state feedback.
|
|
74
|
+
- Make touch targets usable and prevent accidental page-level horizontal overflow.
|
|
75
|
+
|
|
76
|
+
In mockup mode, preserve semantic structure and visible focus styles even if the controls are not wired. Make the static review boundary clear.
|
|
77
|
+
|
|
78
|
+
## Build contract
|
|
79
|
+
|
|
80
|
+
- Deliver one self-contained `.html` file with essential CSS and JavaScript inline.
|
|
81
|
+
- Require no build tooling, authentication, live API, or external service.
|
|
82
|
+
- Use a responsive composition rather than shrinking a desktop canvas.
|
|
83
|
+
- Keep design tokens small and specific to the chosen direction.
|
|
84
|
+
- Use accessible contrast and more than color alone to communicate state.
|
|
85
|
+
- Prefer depth and correctness in one flow over breadth across a fake product.
|
|
86
|
+
|
|
87
|
+
## Verify and hand off
|
|
88
|
+
|
|
89
|
+
Test the artifact at wide desktop and narrow mobile widths. Exercise every modeled state and control. Test `Tab`, `Shift+Tab`, `Enter`, `Space`, arrow keys where appropriate, and `Escape` for dialogs. Check the console, page overflow, long content, disabled behavior, focus restoration, and reduced-motion mode.
|
|
90
|
+
|
|
91
|
+
Inspect computed foreground and background colors on every distinct surface, especially text that may inherit the body color inside a dark or tinted region. If browser tooling is unavailable, say which visual and interaction checks remain unverified instead of treating source inspection as a substitute.
|
|
92
|
+
|
|
93
|
+
Return the absolute file path, the fidelity mode, the scenario modeled, the states implemented, and the production behavior deliberately left out.
|
|
94
|
+
|
|
95
|
+
## Further reading
|
|
96
|
+
|
|
97
|
+
Read Plannotator's [HTML wireframes and prototypes for coding agents](https://docs.plannotator.ai/learn/code-context/html-wireframes-and-prototypes-for-coding-agents) for guidance on moving from an approved structure to a mockup or working prototype.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# HTML Wireframe
|
|
2
|
+
|
|
3
|
+
Turn a product question into a low-fidelity HTML artifact that is easy to inspect, change, and discuss. The wireframe should help reviewers decide what belongs on the screen and how the task should work. It should not look like a finished product.
|
|
4
|
+
|
|
5
|
+
## Establish the review question
|
|
6
|
+
|
|
7
|
+
Read the conversation, supplied brief, and nearby project material before choosing a layout. Reuse the project's vocabulary, content model, and known product constraints.
|
|
8
|
+
|
|
9
|
+
Authority runs in this order:
|
|
10
|
+
|
|
11
|
+
1. The user's explicit instructions and accepted decisions.
|
|
12
|
+
2. The product's existing structure and terminology.
|
|
13
|
+
3. The user, task, and content being modeled.
|
|
14
|
+
4. Your own layout judgment.
|
|
15
|
+
|
|
16
|
+
Before coding, identify:
|
|
17
|
+
|
|
18
|
+
- the user and the job they need to complete;
|
|
19
|
+
- the screen or bounded flow under review;
|
|
20
|
+
- the information and actions the artifact must contain;
|
|
21
|
+
- the assumptions that can be made safely;
|
|
22
|
+
- the structural questions the wireframe should help answer.
|
|
23
|
+
|
|
24
|
+
Use real labels and representative content. Low fidelity is not permission to use anonymous boxes or lorem ipsum where wording affects the layout.
|
|
25
|
+
|
|
26
|
+
## Explore structure before style
|
|
27
|
+
|
|
28
|
+
When [`design-artifact`](design-artifact.md) is available, read it for
|
|
29
|
+
subject-specific composition and hierarchy guidance without importing editorial
|
|
30
|
+
polish. This skill's low-fidelity contract remains authoritative.
|
|
31
|
+
|
|
32
|
+
When the layout is still unsettled, create two or three meaningfully different directions. Vary product decisions such as:
|
|
33
|
+
|
|
34
|
+
- navigation model;
|
|
35
|
+
- grouping and order;
|
|
36
|
+
- primary-action placement;
|
|
37
|
+
- content density;
|
|
38
|
+
- overview versus step-by-step flow;
|
|
39
|
+
- desktop-to-mobile reflow.
|
|
40
|
+
|
|
41
|
+
Do not call color changes or minor card rearrangements separate directions. Give each direction a short descriptive name and one sentence about its tradeoff.
|
|
42
|
+
|
|
43
|
+
Keep the directions in one HTML file when practical. Use a small, keyboard-operable selector so reviewers can compare them without opening several files. Preserve the same core content and task across directions. If the user has already chosen a structure, build that direction only.
|
|
44
|
+
|
|
45
|
+
## Keep the artifact intentionally unfinished
|
|
46
|
+
|
|
47
|
+
- Use a restrained grayscale palette, system type, plain borders, and simple blocks.
|
|
48
|
+
- Avoid brand colors, gradients, shadows, illustrations, decorative imagery, and polished component styling.
|
|
49
|
+
- Use limited radius and spacing. Enough order should be present to judge hierarchy, but not enough polish to invite a brand review.
|
|
50
|
+
- Show images or rich media as labeled placeholders unless the asset changes a structural decision.
|
|
51
|
+
- Add annotations only when they expose an assumption, open question, or behavior that cannot be shown directly.
|
|
52
|
+
|
|
53
|
+
The wireframe may still be well composed. Intentional unfinishedness is different from careless spacing, illegible type, or broken responsive behavior.
|
|
54
|
+
|
|
55
|
+
## Add only useful behavior
|
|
56
|
+
|
|
57
|
+
Use basic click-through behavior when it helps test navigation, disclosure, or a short task flow. Keep it immediate and plain.
|
|
58
|
+
|
|
59
|
+
- Make links, tabs, and next or back actions work when they are part of the review.
|
|
60
|
+
- Use native controls and visible keyboard focus.
|
|
61
|
+
- Do not build elaborate animation, persistence, simulated APIs, or production state management.
|
|
62
|
+
- Remove controls that have no review purpose, or label them clearly as out of scope.
|
|
63
|
+
|
|
64
|
+
## Build contract
|
|
65
|
+
|
|
66
|
+
- Deliver one self-contained `.html` file with essential CSS and JavaScript inline.
|
|
67
|
+
- Require no build tooling or external service.
|
|
68
|
+
- Use semantic landmarks, headings, lists, forms, and buttons.
|
|
69
|
+
- Make the layout useful at wide desktop and narrow mobile widths.
|
|
70
|
+
- Keep the page free of accidental horizontal overflow.
|
|
71
|
+
- Respect the source material. Do not invent extra product scope to fill space.
|
|
72
|
+
|
|
73
|
+
## Verify and hand off
|
|
74
|
+
|
|
75
|
+
Open the result at desktop and mobile widths. Check reading order, wrapping, overflow, focus visibility, and every implemented click path. Confirm that the directions remain structurally distinct at both sizes.
|
|
76
|
+
|
|
77
|
+
Return the absolute file path, the names and tradeoffs of the directions, and the visual decisions deliberately deferred to a later mockup or prototype.
|
|
78
|
+
|
|
79
|
+
## Further reading
|
|
80
|
+
|
|
81
|
+
Read Plannotator's [HTML wireframes and prototypes for coding agents](https://docs.plannotator.ai/learn/code-context/html-wireframes-and-prototypes-for-coding-agents) for guidance on what to decide at the wireframe stage.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# HTML
|
|
2
|
+
|
|
3
|
+
Build one self-contained HTML file that makes the subject clearer, easier to use, or easier to understand. The standard is consistent care, not a consistent look. Do not reproduce a house palette, typography stack, card system, or layout from prior runs.
|
|
4
|
+
|
|
5
|
+
## Route the request first
|
|
6
|
+
|
|
7
|
+
Use the narrowest skill that owns the main review question:
|
|
8
|
+
|
|
9
|
+
- Read and compose [`design-artifact`](design-artifact.md) with the
|
|
10
|
+
chosen workflow when palette, type, composition, theming, or overall visual
|
|
11
|
+
register remain open. It provides creative direction; it does not replace the
|
|
12
|
+
specialist that owns fidelity, structure, or behavior.
|
|
13
|
+
- Read and follow [`html-wireframe`](html-wireframe.md) when structure, information hierarchy, navigation, or task flow is still unsettled. It should remain visibly low fidelity and may compare two or three layout directions.
|
|
14
|
+
- Read and follow [`html-prototype`](html-prototype.md) when the user needs a polished mockup or a working interactive flow. A mockup is the static fidelity mode inside that skill.
|
|
15
|
+
- Read and follow [`html-plan`](html-plan.md) when the artifact is primarily a plan, roadmap, implementation sequence, or rollout document whose source commitments must remain easy to verify.
|
|
16
|
+
- Read and follow [`html-diagram`](html-diagram.md) when relationships, sequence, topology, state, hierarchy, or system behavior are the main content.
|
|
17
|
+
- Continue with `html` for reports, explainers, presentations, landing pages, data stories, tools, and mixed artifacts that do not have a clearer owner.
|
|
18
|
+
|
|
19
|
+
These sibling links are the nesting mechanism when the collection is installed together. If a specialized skill is unavailable, continue here and load the closest reference below. Do not make the user install another skill before completing the request.
|
|
20
|
+
|
|
21
|
+
## Read the room before designing
|
|
22
|
+
|
|
23
|
+
Inspect the user's request and any material they supplied. When working in a repository, look for its design language in `AGENTS.md`, `CLAUDE.md`, design-system documentation, tokens, existing components, and nearby artifacts.
|
|
24
|
+
|
|
25
|
+
Authority runs in this order:
|
|
26
|
+
|
|
27
|
+
1. The user's explicit visual and functional instructions.
|
|
28
|
+
2. The project's established design system and conventions.
|
|
29
|
+
3. The subject matter, audience, and purpose of this artifact.
|
|
30
|
+
4. Your own design judgment.
|
|
31
|
+
|
|
32
|
+
Before coding, settle five things in working notes:
|
|
33
|
+
|
|
34
|
+
- **Audience and job:** who will use this, and what should they understand or do?
|
|
35
|
+
- **Form:** document, presentation, interface, diagram, or data visualization.
|
|
36
|
+
- **Register:** quiet and workmanlike, polished and editorial, or intentionally expressive.
|
|
37
|
+
- **Fidelity:** whether to preserve the user's structure and wording or synthesize more freely.
|
|
38
|
+
- **Interaction:** what benefits from exploration, sequencing, filtering, or motion, if anything.
|
|
39
|
+
|
|
40
|
+
If the project already answers the visual questions, follow it. Otherwise read
|
|
41
|
+
and compose [`design-artifact`](design-artifact.md) when it is
|
|
42
|
+
available. If the collection was installed without that sibling skill, read
|
|
43
|
+
[`creative-direction.md`](creative-direction.md) before
|
|
44
|
+
choosing the palette, type, composition, or motion.
|
|
45
|
+
|
|
46
|
+
## Load only the guidance the artifact needs
|
|
47
|
+
|
|
48
|
+
- For reports, briefs, plans, explainers, and decks, read [`documents-and-presentations.md`](documents-and-presentations.md).
|
|
49
|
+
- For interfaces, calculators, and other tools that remain in this broad skill, read [`interfaces.md`](interfaces.md).
|
|
50
|
+
- For architecture, process, sequence, state, hierarchy, or concept diagrams, read [`diagrams.md`](diagrams.md).
|
|
51
|
+
- For quantitative charts, tables, metrics, or data stories, read [`charts-and-data.md`](charts-and-data.md).
|
|
52
|
+
|
|
53
|
+
Requests can span forms. Read every reference that materially applies, then give the artifact one coherent direction.
|
|
54
|
+
|
|
55
|
+
## Build contract
|
|
56
|
+
|
|
57
|
+
- Produce one `.html` file with its essential CSS and JavaScript inline. It should work when opened directly, without a build step. Do not require a network connection unless the user permits external dependencies.
|
|
58
|
+
- Use real content. Do not fill prominent space with placeholder copy, decorative statistics, or controls that do nothing.
|
|
59
|
+
- Let content determine structure. A sequence should read in order; a comparison should make differences easy to scan; an interface should expose state and actions; a diagram should make relationships legible.
|
|
60
|
+
- Use semantic HTML, responsive layout, accessible contrast, visible keyboard focus, and reduced-motion handling. Make interactive elements work with a keyboard.
|
|
61
|
+
- Keep the page body free of accidental horizontal overflow. Put intentionally broad content in a contained scrolling or pannable region.
|
|
62
|
+
- Define a small set of CSS tokens for the chosen direction and use them consistently. Tokens are an implementation tool, not a predetermined palette.
|
|
63
|
+
- Treat motion as explanation or feedback. If removing an animation loses no meaning or useful feedback, remove it.
|
|
64
|
+
- Follow the user's or project's theme policy. When none exists, give durable utility artifacts considered light and dark themes if that improves their use. A deliberate single-theme concept is valid.
|
|
65
|
+
|
|
66
|
+
## Finish the work
|
|
67
|
+
|
|
68
|
+
Write the file to the requested location, or choose a clear filename in the current workspace. When browser tooling is available, open it and inspect a wide and narrow viewport. Exercise its controls, check the console, and fix clipping, overlap, illegible text, broken states, and accidental overflow.
|
|
69
|
+
|
|
70
|
+
Before delivery, run one originality check: if the subject were swapped for a neighboring topic, would the same visual concept still make just as much sense? If yes, the direction is too generic; revise the composition, type, color, imagery, or interaction so it belongs to this subject.
|
|
71
|
+
|
|
72
|
+
Return the absolute path and a short description of the artifact's visual and interaction choices.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interfaces and tools
|
|
2
|
+
|
|
3
|
+
Read this for editors, calculators, control panels, and other broad HTML artifacts people operate rather than read straight through. Use `html-prototype` for a styled mockup or a bounded product flow when that skill is available.
|
|
4
|
+
|
|
5
|
+
Lead with the current state and the next useful action. Organize the interface around the user's task, not the shape of the underlying data model.
|
|
6
|
+
|
|
7
|
+
- Make controls look actionable and label them with the result they produce.
|
|
8
|
+
- Show feedback close to the action: pending, success, empty, validation, and error states should all be designed.
|
|
9
|
+
- Preserve state visibly. Selected filters, active modes, changed values, and unsaved work should never be mysteries.
|
|
10
|
+
- Put summaries before detail when scanning matters, while keeping the path to the underlying evidence obvious.
|
|
11
|
+
- Use status color for status, independently from the artifact's decorative accent.
|
|
12
|
+
- Keep forms keyboard-friendly, labels explicit, targets comfortably sized, and destructive actions difficult to trigger accidentally.
|
|
13
|
+
- Prefer a few strong regions over a uniform grid of interchangeable cards.
|
|
14
|
+
|
|
15
|
+
Implement the important path when behavior is part of the request. A convincing static shell with dead controls is worse than a simpler interface whose important path works end to end.
|
|
16
|
+
|
|
17
|
+
On narrow screens, preserve the primary task. Reflow secondary panels, turn dense toolbars into deliberate controls, and contain wide data rather than shrinking it until it is illegible.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: great-interface
|
|
3
|
+
description: >-
|
|
4
|
+
Build, explain, review, and refine product interfaces across accessibility, layout,
|
|
5
|
+
writing, typography, color, UI polish, holistic review, change review, and design variants.
|
|
6
|
+
Use when creating frontend interfaces, reviewing interface quality, explaining how an
|
|
7
|
+
interface works, or comparing UI directions.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Great Interface
|
|
11
|
+
|
|
12
|
+
Use the domain references below as the sources of truth. Load the smallest set that covers
|
|
13
|
+
the request, except for a holistic review, which loads every applicable review domain.
|
|
14
|
+
|
|
15
|
+
## Build and refine
|
|
16
|
+
|
|
17
|
+
- Accessibility: [better-accessibility.md](references/better-accessibility.md)
|
|
18
|
+
- Layout: [better-layout.md](references/better-layout.md)
|
|
19
|
+
- Writing: [better-writing.md](references/better-writing.md)
|
|
20
|
+
- Typography: [better-typography.md](references/better-typography.md)
|
|
21
|
+
- Colors: [better-colors.md](references/better-colors.md)
|
|
22
|
+
- UI polish and motion: [better-ui.md](references/better-ui.md)
|
|
23
|
+
|
|
24
|
+
## Review
|
|
25
|
+
|
|
26
|
+
- Holistic screen or flow review: [better-interface.md](references/better-interface.md)
|
|
27
|
+
- Change, branch, or pull request review: [interface-review.md](references/interface-review.md)
|
|
28
|
+
|
|
29
|
+
## Explore alternatives
|
|
30
|
+
|
|
31
|
+
- Explain how an interface or effect was built: [explain-interface.md](references/explain-interface.md)
|
|
32
|
+
- Build and compare multiple UI directions: [variant.md](references/variant.md)
|
|
33
|
+
|
|
34
|
+
## Ownership
|
|
35
|
+
|
|
36
|
+
Do not duplicate rules across domains. Accessibility owns keyboard support, focus, ARIA,
|
|
37
|
+
semantic structure, hit areas, announcements, and reduced motion. Layout owns grouping,
|
|
38
|
+
spacing, responsive structure, and spatial RTL. Writing owns interface copy. Typography owns
|
|
39
|
+
how text renders and wraps. Colors owns palette systems and color measurement. UI owns
|
|
40
|
+
surfaces, icons, and visual motion. The review references own orchestration and reporting.
|
|
41
|
+
|
|
42
|
+
When domains overlap, report or apply the rule in the owning domain and mention secondary
|
|
43
|
+
effects only where useful.
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Animations
|
|
2
|
+
|
|
3
|
+
Interruptible transitions, press feedback and the restraint that decides whether to animate at all. Staged entrances and exits live in [enter-exit.md](enter-exit.md); icon swaps in [icon-transitions.md](icon-transitions.md).
|
|
4
|
+
|
|
5
|
+
## Interruptible animations
|
|
6
|
+
|
|
7
|
+
Users change intent mid-interaction. Animations that cannot be interrupted make the interface feel broken.
|
|
8
|
+
|
|
9
|
+
### CSS transitions vs. keyframes
|
|
10
|
+
|
|
11
|
+
| | CSS Transitions | CSS Keyframe Animations |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| **Behavior** | Interpolate toward latest state | Run on a fixed timeline |
|
|
14
|
+
| **Interruptible** | Yes, retargets mid-animation | No, restarts from beginning |
|
|
15
|
+
| **Use for** | Interactive state changes (hover, toggle, open/close) | Staged sequences that run once (enter animations, loading) |
|
|
16
|
+
| **Duration** | Fixed; retargets the value mid-flight, not the timeline | Fixed timeline, restarts from the beginning |
|
|
17
|
+
|
|
18
|
+
```css
|
|
19
|
+
/* Good: interruptible transition for a toggle */
|
|
20
|
+
.drawer {
|
|
21
|
+
transform: translateX(-100%);
|
|
22
|
+
transition: transform 200ms ease-out;
|
|
23
|
+
}
|
|
24
|
+
.drawer.open {
|
|
25
|
+
transform: translateX(0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Clicking again mid-animation smoothly reverses, no jank */
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```css
|
|
32
|
+
/* Bad: keyframe animation for interactive element */
|
|
33
|
+
.drawer.open {
|
|
34
|
+
animation: slideIn 200ms ease-out forwards;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Closing mid-animation snaps or restarts, feels broken */
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Prefer CSS transitions for interactive elements. Reserve keyframes for one-shot sequences.
|
|
41
|
+
|
|
42
|
+
## Scale on press
|
|
43
|
+
|
|
44
|
+
A subtle scale-down on click gives buttons tactile feedback. Always `scale(0.96)`, never below `0.95`, which feels exaggerated. Use CSS transitions so a release mid-press returns smoothly.
|
|
45
|
+
|
|
46
|
+
Not every button needs it. Add a `static` prop that disables the scale where the motion would distract.
|
|
47
|
+
|
|
48
|
+
### CSS example
|
|
49
|
+
|
|
50
|
+
```css
|
|
51
|
+
.button {
|
|
52
|
+
transition-property: scale;
|
|
53
|
+
transition-duration: 150ms;
|
|
54
|
+
transition-timing-function: ease-out;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.button:active {
|
|
58
|
+
scale: 0.96;
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Tailwind example
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
<button className="transition-transform duration-150 ease-out active:scale-[0.96]">
|
|
66
|
+
Click me
|
|
67
|
+
</button>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Motion example
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
<motion.button whileTap={{ scale: 0.96 }}>
|
|
74
|
+
Click me
|
|
75
|
+
</motion.button>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Static prop pattern
|
|
79
|
+
|
|
80
|
+
Extract the scale class into a variable and apply it conditionally on a `static` prop:
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
const tapScale = "active:not-disabled:scale-[0.96]";
|
|
84
|
+
|
|
85
|
+
function Button({ static: isStatic, className, children, ...props }) {
|
|
86
|
+
return (
|
|
87
|
+
<button
|
|
88
|
+
className={cn(
|
|
89
|
+
"transition-transform duration-150 ease-out",
|
|
90
|
+
!isStatic && tapScale,
|
|
91
|
+
className,
|
|
92
|
+
)}
|
|
93
|
+
{...props}
|
|
94
|
+
>
|
|
95
|
+
{children}
|
|
96
|
+
</button>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Usage
|
|
101
|
+
<Button>Click me</Button> {/* scales on press */}
|
|
102
|
+
<Button static>Submit</Button> {/* no scale */}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Skip animation on page load
|
|
106
|
+
|
|
107
|
+
Use `initial={false}` on `AnimatePresence` to stop enter animations firing on first render. An element already in its default state animates on later state changes, not on page load.
|
|
108
|
+
|
|
109
|
+
### When it works
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
// Good: icon doesn't animate in on mount, only on state change
|
|
113
|
+
<AnimatePresence initial={false} mode="popLayout">
|
|
114
|
+
<motion.span
|
|
115
|
+
key={isActive ? "active" : "inactive"}
|
|
116
|
+
initial={{ opacity: 0, scale: 0.25, filter: "blur(4px)" }}
|
|
117
|
+
animate={{ opacity: 1, scale: 1, filter: "blur(0px)" }}
|
|
118
|
+
exit={{ opacity: 0, scale: 0.25, filter: "blur(4px)" }}
|
|
119
|
+
>
|
|
120
|
+
<Icon />
|
|
121
|
+
</motion.span>
|
|
122
|
+
</AnimatePresence>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Works well for icon swaps, toggles, tabs and segmented controls, anything with a default state on page load.
|
|
126
|
+
|
|
127
|
+
### When it breaks
|
|
128
|
+
|
|
129
|
+
Never use `initial={false}` where the component relies on its `initial` prop for a first-time enter animation, such as a staggered page hero or a loading state. Removing it skips the entire entrance.
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
// Bad: initial={false} would skip the staggered page enter entirely
|
|
133
|
+
<AnimatePresence initial={false}>
|
|
134
|
+
<motion.div initial="hidden" animate="visible" variants={...}>
|
|
135
|
+
...
|
|
136
|
+
</motion.div>
|
|
137
|
+
</AnimatePresence>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Verify the component still looks right on a full page refresh before applying this.
|
|
141
|
+
|
|
142
|
+
## Suppress transitions on theme switch
|
|
143
|
+
|
|
144
|
+
Flipping the theme changes `color`, `background-color`, `border-color` and `box-shadow` on nearly every element at once. Everything carrying a transition on those properties animates together, so the switch reads as a slow smear rather than an instant change. Disable transitions for the swap and restore them right after.
|
|
145
|
+
|
|
146
|
+
Inject a stylesheet that turns off every transition, force a reflow so the new colors commit while it still applies, then drop it on the next frame:
|
|
147
|
+
|
|
148
|
+
```tsx
|
|
149
|
+
"use client";
|
|
150
|
+
|
|
151
|
+
import { useEffect } from "react";
|
|
152
|
+
|
|
153
|
+
export function DisableThemeTransitions() {
|
|
154
|
+
useEffect(() => {
|
|
155
|
+
const mql = window.matchMedia("(prefers-color-scheme: dark)");
|
|
156
|
+
|
|
157
|
+
const handleChange = () => {
|
|
158
|
+
const style = document.createElement("style");
|
|
159
|
+
style.append(
|
|
160
|
+
document.createTextNode(
|
|
161
|
+
"*,*::before,*::after{transition:none !important}"
|
|
162
|
+
)
|
|
163
|
+
);
|
|
164
|
+
document.head.append(style);
|
|
165
|
+
|
|
166
|
+
const _flushReflow = document.body.offsetHeight;
|
|
167
|
+
|
|
168
|
+
requestAnimationFrame(() => {
|
|
169
|
+
requestAnimationFrame(() => style.remove());
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
mql.addEventListener("change", handleChange);
|
|
174
|
+
return () => mql.removeEventListener("change", handleChange);
|
|
175
|
+
}, []);
|
|
176
|
+
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
`document.body.offsetHeight` is read for its side effect, forcing a synchronous style flush so the new theme resolves while the override is still in the document and no transition starts. The nested `requestAnimationFrame` removes the override only after that paint, restoring transitions before the next interaction.
|
|
182
|
+
|
|
183
|
+
That covers the OS-level change. An in-app toggle needs the same treatment around its own flip: apply the override, change the theme, flush, remove. `next-themes` ships this as `disableTransitionOnChange`.
|
|
184
|
+
|
|
185
|
+
## Motion restraint
|
|
186
|
+
|
|
187
|
+
Motion is a budget, not a garnish. Three rules decide whether an animation belongs at all:
|
|
188
|
+
|
|
189
|
+
- **Give high-frequency interactions instant feedback instead of animation.** Every keystroke, every list-row hover, every tab switch in a work tool. Reserve expressive motion for infrequent moments (first load of a view, success states, empty states); high-frequency interactions get instant feedback or the subtlest possible transition (`opacity`/`background-color` at ≤150ms).
|
|
190
|
+
- **Motion is never the only feedback channel.** Every state change an animation communicates stays visible when it doesn't run: a color change, an icon swap, a label. Users with reduced motion enabled and anyone who blinked still need to see what happened.
|
|
191
|
+
- **Brief and precise beats prominent.** Where a shorter, smaller animation says the same thing, use it. When in doubt cut the duration, not the clarity.
|
|
192
|
+
|
|
193
|
+
```css
|
|
194
|
+
/* Good: high-frequency hover gets a minimal transition */
|
|
195
|
+
.row:hover {
|
|
196
|
+
background-color: var(--surface-hover);
|
|
197
|
+
transition: background-color 100ms ease-out;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* Bad: every hover replays a full entrance */
|
|
201
|
+
.row:hover .row-icon {
|
|
202
|
+
animation: bounceIn 500ms;
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Accessibility
|
|
2
|
+
|
|
3
|
+
Most accessibility is free if you use the platform. Native elements ship with keyboard support, real labels announce themselves and a visible focus ring is one CSS rule.
|
|
4
|
+
|
|
5
|
+
Write every fix in the project's styling system, and use the exact values below rather than familiar-looking substitutes.
|
|
6
|
+
|
|
7
|
+
Reviewing means two walks. Keyboard-only, where every flow completes without a mouse. Then screen-reader, where every control announces a name, a role and its state. When unsure, take the platform default over a custom rebuild, and remove ARIA rather than add it.
|
|
8
|
+
|
|
9
|
+
Contrast measurement and color fixes belong to `better-colors`. Text sizing and iOS input zoom belong to `better-typography`. Spatial RTL layout belongs to `better-layout`.
|
|
10
|
+
|
|
11
|
+
## Native elements first
|
|
12
|
+
|
|
13
|
+
The first rule of ARIA: don't use ARIA when a native element exists. `<button>` for actions, `<a href>` for navigation, never `<div onClick>`. A real link must support Cmd/Ctrl/middle-click. No ARIA is better than bad ARIA. See [semantics-and-aria.md]() for landmarks, button-vs-link and disabled states.
|
|
14
|
+
|
|
15
|
+
## Visible focus rings
|
|
16
|
+
|
|
17
|
+
Style `:focus-visible`, not bare `:focus`. Keyboard users get a ring and mouse users usually don't. Prefer the browser's unmodified indicator.
|
|
18
|
+
|
|
19
|
+
A custom ring needs a project focus token or another explicit color. Verify the whole indicator against every adjacent color it crosses, `currentColor` included. Use at least a `2px` solid perimeter or an equivalent visible area. Never use `outline: none` without a verified replacement, and preserve system colors in forced-colors mode. Recipes are in [focus-and-keyboard.md]().
|
|
20
|
+
|
|
21
|
+
## Full keyboard support
|
|
22
|
+
|
|
23
|
+
Every pointer interaction needs a keyboard path. Follow the ARIA APG patterns: Escape closes overlays, arrow keys move within composite widgets, Tab moves between widgets, Enter and Space activate.
|
|
24
|
+
|
|
25
|
+
Use only `tabindex="0"` to join the natural tab order and `tabindex="-1"` for programmatic focus. Positive values break that order. Composite widgets use roving tabindex, where the active item is `0` and every other is `-1`.
|
|
26
|
+
|
|
27
|
+
## Trap and restore focus
|
|
28
|
+
|
|
29
|
+
Modals set `inert` on the background content, move focus inside on open and return focus to the trigger on close. Add `overscroll-behavior: contain` so background content doesn't scroll.
|
|
30
|
+
|
|
31
|
+
## Minimum hit area
|
|
32
|
+
|
|
33
|
+
WCAG 2.5.8's Level AA baseline is a 24×24 CSS-pixel target, or one of its spacing, equivalent-control, inline, user-agent and essential exceptions. Aim for 44×44px on touch and 40×40px on desktop where density permits. Extend with a pseudo-element when the visible element should stay smaller.
|
|
34
|
+
|
|
35
|
+
Never let extended hit areas overlap. Give decorative layers `pointer-events: none`, so a glow never swallows the clicks meant for the control beneath it. Sizes and collision rules are in [hit-areas.md]().
|
|
36
|
+
|
|
37
|
+
## Label and type every control
|
|
38
|
+
|
|
39
|
+
Every input gets a `<label for>` or a wrapping `<label>`. A placeholder is never a label. Label and control share one hit target, with no dead zone between a checkbox and its text.
|
|
40
|
+
|
|
41
|
+
Add `autocomplete` with a meaningful `name`, plus the `type` and `inputmode` that summon the right keyboard. Never block paste; users paste passwords and one-time codes. See [forms.md]().
|
|
42
|
+
|
|
43
|
+
## Errors that announce
|
|
44
|
+
|
|
45
|
+
Keep submit enabled until the request starts, then disable with a spinner and the original label. Validate on submit. Mark failing fields `aria-invalid="true"`, point `aria-describedby` at the inline error text and focus the first invalid field.
|
|
46
|
+
|
|
47
|
+
Use native `disabled` when a control is genuinely unavailable. Reach for `aria-disabled="true"` only when it should stay focusable, then block pointer, keyboard and form behavior in code and style the state explicitly.
|
|
48
|
+
|
|
49
|
+
## Accessible names everywhere
|
|
50
|
+
|
|
51
|
+
Icon-only buttons need a descriptive `aria-label`. Visible label text must appear in the accessible name. Decorative elements get `aria-hidden="true"`, never on a focusable element.
|
|
52
|
+
|
|
53
|
+
## Don't rely on color alone
|
|
54
|
+
|
|
55
|
+
Status needs a redundant cue: an icon, text, or an underline alongside the color. Work out which WCAG contrast requirement applies, then use `better-colors` to measure the rendered pair. When it fails, report the pair and the requirement it misses, and leave the colors alone unless asked.
|
|
56
|
+
|
|
57
|
+
## Honor prefers-reduced-motion
|
|
58
|
+
|
|
59
|
+
Wrap motion in `@media (prefers-reduced-motion: no-preference)` so it is opt-in. Under reduced motion, replace slides and scales with opacity crossfades, and kill parallax and autoplay entirely.
|
|
60
|
+
|
|
61
|
+
Two rules hold regardless of the preference. Autoplaying media needs a visible pause control, and toasts carrying an action or an error stay until dismissed. See [motion-and-zoom.md]().
|
|
62
|
+
|
|
63
|
+
## Announce dynamic content
|
|
64
|
+
|
|
65
|
+
Three mechanisms, three jobs. `aria-describedby` carries field-specific validation. A polite live region (`role="status"`) carries non-urgent updates not tied to a control, such as toasts and result counts. `role="alert"` carries urgent untied errors and nothing else.
|
|
66
|
+
|
|
67
|
+
Repeated polite announcements need a stable empty region rendered before its text updates. Dynamically inserted alerts vary in support, so test them on the screen readers you target. See [screen-readers.md]().
|
|
68
|
+
|
|
69
|
+
## Alt text by purpose
|
|
70
|
+
|
|
71
|
+
Decorative images get `alt=""`. Informative images describe the meaning. Functional images describe the action: a search icon button is `alt="Search"`, not `alt="magnifying glass"`.
|
|
72
|
+
|
|
73
|
+
## Structure is navigation
|
|
74
|
+
|
|
75
|
+
Use headings that describe their sections and form a coherent outline. Give the page one `<h1>` and nest the levels below it without skipping. Expose one visible primary `<main>` landmark. When repeated navigation or chrome precedes it, make a "Skip to content" link the first focusable element. Anchored headings get `scroll-margin-top`.
|
|
76
|
+
|
|
77
|
+
## Survive zoom and text resize
|
|
78
|
+
|
|
79
|
+
The page must work at 200% zoom and reflow at 320px width without horizontal scrolling. Use `min-height` rather than fixed `height` on text containers. Prefer `rem` breakpoints where they fit the codebase, and never let the viewport meta cap how far the reader can zoom.
|
|
80
|
+
|
|
81
|
+
## Before you finish
|
|
82
|
+
|
|
83
|
+
| Mistake | Fix |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| Custom focus color assumed to work everywhere | Verify it against every adjacent color and in forced-colors mode |
|
|
86
|
+
| Repeated polite update inconsistently announced | Keep a stable empty status region and update its text |
|
|
87
|
+
| `assertive` live region for a routine toast | Use `polite`; reserve `assertive` for errors |
|
|
88
|
+
| `aria-hidden="true"` on a focusable element | Remove it or make the element non-focusable |
|
|
89
|
+
| Submit disabled until the form is valid | Keep it enabled; validate on submit and focus the first error |
|
|
90
|
+
| Hover treatment stuck after a tap on touch | Gate hover styling with `@media (hover: hover)` |
|
|
91
|
+
| Tooltip on a natively `disabled` control | Text beside it, or `aria-disabled` so it stays focusable |
|
|
92
|
+
|
|
93
|
+
## Reporting
|
|
94
|
+
|
|
95
|
+
**Severity.** `HIGH` prevents a task, hides content from assistive technology, or creates a systemic failure. `MEDIUM` makes an interaction meaningfully harder. `LOW` is isolated polish.
|
|
96
|
+
|
|
97
|
+
**Verification.** Without a browser: accessible names on every interactive element, keyboard handlers on non-native controls, focus styles, `prefers-reduced-motion` guards and form labels bound to their inputs. With one: tab the flow in order, read computed names and roles from the accessibility tree, confirm a visible focus indicator at every stop and run an automated audit. Report every check you could not run as `Not verified`.
|
|
98
|
+
|
|
99
|
+
**Format.** Group findings under the principle each violates, ordered by severity, one row per root cause listing every location it appears in:
|
|
100
|
+
|
|
101
|
+
| Severity | Location | Before | After | Why |
|
|
102
|
+
| --- | --- | --- | --- | --- |
|
|
103
|
+
|
|
104
|
+
`Location` is `path/to/file:line`. `Why` names the principle and the user impact.
|
|
105
|
+
|
|
106
|
+
End with `Block` when any `HIGH` remains, `Approve` otherwise, leaving the rest in the table as work to do. Never `Approve` coverage you did not inspect. With nothing to report, state "No actionable accessibility findings" and report verification.
|