Agent skill Frontend
Design HTML
Build or refine reusable components for a web interface.
Install the skill
Run the command from your project root with Node.js and npm.
npx skills@latest add https://github.com/garrytan/gstack/tree/main/design-html --skill design-html --agent claude-code --yesCheck this file in your project.claude/skills/design-html/SKILL.md
Other ways to install
Choose an assistant interactively
npx skills@latest add https://github.com/garrytan/gstack/tree/main/design-html --skill design-htmlSelect your assistant and choose the project installation scope.
Official instructions
The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. Use the official gstack Design pack and a local browser. Bring an approved mockup, plan or description and real copy. The standalone path has a bundled Pretext file. Framework output adds @chenglou/pretext to the project after approval.
View operation manualWhat this skill helps with
- Build or refine reusable components for a web interface.
Good for
- Component implementation
- Skill name
- design-html
- Scenario
- Build a responsive comparison section
- Deliverable
- A runnable comparison preview and screenshots with measured wrapping at three widths.
- Skill name
design-html- Repository
garrytan/gstack
Give the request a concrete task
A request with an unclear outcome
Match this PNG at one width and fix the card height in CSS.
Real text can wrap to more lines at narrower widths, clipping copy inside fixed cards.
A workflow with observable results
- Choose the output and text layout
- Build the standalone preview
- Verify live wrapping and hand off the HTML
Design HTML operation manual
Turn an approved direction into real HTML that can reflow long labels and descriptions.
Replace the bracketed details with your own project and target.
Choose the output and text layout
Use the brief and real text to decide which Pretext API applies.
Prompt · Step 1Use gstack design-html to interpret [approved comparison section or supplied brief]. Use the real feature labels and descriptions, including [longest localized copy]. Give me the page structure and source tokens, then choose standalone finalized.html with vendored Pretext. Explain which paragraphs need prepare() and layout() for changing width and where normal CSS flow is sufficient.Build the standalone preview
Embed the supplied scaffold, load fonts, and size text from actual content.
Prompt · Step 2Use gstack design-html to build [approved structure] as standalone finalized.html in the selected gstack design output directory. Read the installed pretext-patterns.md. Use the supplied pretext-embed.html and its embedded bundle, set matching text width and line height in JS and CSS, wait for fonts before measuring, and recalculate layouts when widths change. Use semantic headings and preserve the approved content. Point out any font that is fetched separately.Verify live wrapping and hand off the HTML
Review multiple widths and the longest real copy.
- The longest copy wraps without clipping at the named widths.
- The browser evidence and finalized HTML are linked in the handoff.
Prompt · Step 3Use gstack design-html to verify [local preview path] at 1440, 768 and 390 CSS pixels with fonts ready. Compare the long titles and descriptions at each width, report measured line counts for one paragraph, and check keyboard access to the CTA, horizontal overflow and console errors. Return the finalized.html path and all three screenshot paths. Mark checks that could not run.
Find the relevant rule
Point the assistant to the installed Skill and a specific issue.
The source is a plain descriptionReference
- Command or reference
SKILL.md · Step 0: Input Detection- Examples
- Choose the clean-slate input and confirm which product elements are fixed.
Text breaks when the cards shrinkReference
- Command or reference
sections/pretext-patterns.md- Examples
- Check that CSS and the measured text use matching font, width and line height.
Design HTML troubleshooting
How do I set up the full gstack runtime?
The individual install copies the skill files. Follow the official setup to install the full gstack checkout, then run `./setup --host claude --pack design` or `./setup --host codex --pack design` from that checkout. Setup registers skills and can change host settings. Review the official install steps before running it.
Does standalone output need a Pretext install?
Use the bundle and embed scaffold shipped with the skill when available. Framework integration uses @chenglou/pretext as a dependency. External fonts are a separate resource.