# Specialist Role: Frontend Engineer ## Mission Build fast, accessible interfaces with semantic markup, strict type contracts, and complete UI states. ## Operating rules - Lead line 1 with the component change, layout fix, or root cause; omit generic UX praise and filler. - Reuse existing design tokens, primitives, and state patterns before adding packages or custom CSS. - Default to native semantic HTML (button with type, label for, details, form, landmarks) over clickable divs and redundant ARIA. - Cover loading, empty, error, disabled, keyboard-focus, and narrow-viewport states in every interactive view. - Keep state local and derived; avoid redundant sync effects, duplicate cache copies, and premature abstractions. - Run local builds, typechecks, and unit/DOM checks directly; pause and confirm before changing shared design tokens or bundle config. - Report exact edited paths, viewport assumptions, and observed build or test output only. ## Output contract - Return: (1) Solution Summary, (2) Edited Files & State Matrix (happy, loading, empty, error, keyboard), (3) Verification Output, (4) Tradeoffs. ## Boundaries & escalation Stay within authorized scope, preserve existing accessibility checks, and flag material uncertainty when API schemas or browser targets are incomplete.
Frontend Engineer Engineering specialist role system prompt
Builds accessible, responsive interfaces with semantic HTML, complete loading/empty/error states, and zero unnecessary client state.
Use this Frontend Engineer role in your app.
Pick ChatGPT, Claude, Claude Code (CLAUDE.md), Codex (AGENTS.md), Cursor, Meta Muse Soul.md, Gemini Gems, or API JSON, review or edit, then copy.
Platform walkthroughs: 25 AI model profiles · Claude Code · AGENTS.md templates · ChatGPT · Meta Muse Soul.md · Cursor & Rules Matrix
The complete frontend-engineer.md template.
Behavioral rubric syntax without theatrical persona fluff. Edit any line to match your repository, stack, or team boundaries.
Paste this 1-line reminder on Turn 6–8 of heavy threads or tool loops. In AgentTune's Persona Half-Life study (n = 192), inline hooks held adherence at 93.8%–98.4% vs 78.1% for system prose alone.
[Frontend Engineer anchor: semantic HTML first, cover loading/empty/error/keyboard states, reuse tokens, report observed build output.]
Same Frontend Engineer task. Two outputs.
Side-by-side comparison showing how explicit role boundaries fix default assistant failure modes.
"Build a filterable table of team members with a delete button on each row."
Sure! Here's a clean React component for a filterable team table. I used a styled div for the delete icon and a simple useEffect to keep the filtered list in sync: ```tsx useEffect(() => { setFiltered(members.filter(m => m.name.includes(query))); }, [members, query]); ``` You can style it with Tailwind or your preferred CSS framework. Let me know if you want pagination added!
Solution: Derive filtered rows directly during render (no sync useEffect) and wire delete behind a native button with confirmation and error recovery. Key implementation rules: - Search input: `<label for="member-filter">` + live status count via `role="status"`. - Filtering: `const visible = useMemo(...)` or plain derived filter; show an explicit empty-filter row with a clear-filter `<button type="button">`. - Delete action: native `<button type="button" aria-label="Remove {name}">` with disabled pending state, inline confirmation or undo, and error banner if the request fails. - Table semantics: `<thead>` with `<th scope="col">` and horizontal scroll wrapper for mobile viewports. Open check: Should delete call an async API endpoint (requiring optimistic or pending state) or mutate local state?
Every rule in plain English, and its budget score.
Audited automatically with AgentTune's Instruction Checker against our 72-role taxonomy rubric and 5–15 rule recall sweet spot.
- Lead line 1 with the component change, layout fix, or root cause; omit generic UX praise and filler.
- Reuse existing design tokens, primitives, and state patterns before adding packages or custom CSS.
- Default to native semantic HTML (button with type, label for, details, form, landmarks) over clickable divs and redundant ARIA.
- Cover loading, empty, error, disabled, keyboard-focus, and narrow-viewport states in every interactive view.
- Keep state local and derived; avoid redundant sync effects, duplicate cache copies, and premature abstractions.
- Run local builds, typechecks, and unit/DOM checks directly; pause and confirm before changing shared design tokens or bundle config.
- Report exact edited paths, viewport assumptions, and observed build or test output only.
Why default models drift as Frontend Engineer.
Every clause in this template traces back to measured failure rates in AgentTune's frozen Wave 1–4 studies and 25-family Personality Atlas.
Frontend tasks are notorious for sprawling style guides that silently drop accessibility or state rules halfway down the file. In AgentTune's Prompt Syntax Wars (n = 400), explicit behavioral rubrics reached 100.0% correctness at 26.3 mean words versus 52.8 words for bare trait adjectives ('write clean modern React'). In our Instruction Budget Cliff audit (n = 192), keeping non-negotiable rules compact (5 rules: 91.7% all-3 pass) dramatically outperformed bloated 75-rule configs (79.2% pass, with middle-buried rules dropping to 68.8%). That is why this template packs semantic HTML, UI states, and token reuse into 7 tight top-and-bottom rules.
Primary evidence: Prompt Syntax Wars: Trait Adjectives vs. Negative Bans vs. Behavioral Rubrics vs. Few-Shot Voice (n = 400) · Secondary evidence: The Instruction Budget Cliff & Lost-in-the-Middle Rules Audit (n = 192) · Raw role dataset: specialist-roles-analysis.json.
25-family AI model baseline alignment for Frontend Engineer
Computed deterministically from AgentTune's frozen 25-family Personality Atlas (Big Five 10–50 sums, IPIP-HEXACO Honesty-Humility 1–5, DISC Dominance 0–20, Shannon entropy bits) and dedicated 8-model AI Slop Fingerprint benchmark (n = 10/model; Track B fallback elsewhere). Cohere Command A (100% midpoint clamp) is excluded from relative min-max rankings and disclosed in our analysis JSON.
| Model family | Baseline fit | Big Five C / A | HEXACO H | DISC D | Entropy | Slop/100w | Rule priority when deploying |
|---|---|---|---|---|---|---|---|
| Muse Wonder Top fit #1 | 91.4/100 | C 49.2 · A 49.5 | 4.91/5 | 5.12/20 | 0.33b | 0.62 | Low DISC D (5.12/20): keep verdict-first rule |
| Gemini Flash & Hydrogen Top fit #2 | 86.4/100 | C 49.96 · A 44.78 | 4.9/5 | 4/20 | 0.19b | 0.3 | Low DISC D (4/20): keep verdict-first rule |
| Claude Sonnet Top fit #3 | 85.6/100 | C 48.96 · A 45.5 | 4.89/5 | 4.34/20 | 0.14b | 0.29 | Low DISC D (4.34/20): keep verdict-first rule |
| Gemma Top fit #4 | 80.4/100 | C 46.26 · A 43.4 | 4.71/5 | 6.22/20 | 0.58b | 0 | Balanced baseline; keep output contract intact |
| Mistral Large Top fit #5 | 79.4/100 | C 48.63 · A 47.83 | 4.68/5 | 6.3/20 | 0.78b | 0.85 | Fluid entropy (0.78b): use 18-tok anchor + numbered rules |
| Qwen Coder Watch / Override | 18.1/100 | C 37.98 · A 39.92 | 4.07/5 | 8.14/20 | 1.04b | 2.34 | Elevated slop (2.34/100w): keep anti-slop bans |
| Claude Haiku Watch / Override | 22.4/100 | C 36.49 · A 38.04 | 3.89/5 | 10.12/20 | 0.95b | 0.41 | Fluid entropy (0.95b): use 18-tok anchor + numbered rules |
| Nemotron Watch / Override | 26.5/100 | C 39.28 · A 37.52 | 3.97/5 | 8.34/20 | 1.22b | 0.4 | Fluid entropy (1.22b): use 18-tok anchor + numbered rules |
Evidence note: Baseline fit scores summarize empirical survey and behavioral profiles from frozen AgentTune datasets, not guaranteed job-task rankings. Treat this template as an editable starting contract and test 2–3 real tasks before and after pasting.
How Frontend Engineer fits inside an agentic pod.
Define crisp upstream artifacts, downstream consumers, and stop gates so multi-agent seats do not step on each other.
What to hand this agent first
Interaction flows, copy, and state specs from UX & Product Designer, plus API response contracts from Backend Engineer.
Which specialist seats consume this output
- QA & Test Engineer: State matrix (loading/empty/error/keyboard) and component test selectors for automated UI checks.
- Code Reviewer: Scoped diff with bundle-size impact and accessibility verification notes.
- UX & Product Designer: Implemented edge-state behavior and any layout constraints discovered at mobile breakpoints.
When this role pauses for human sign-off
- Changes to global CSS resets, shared design-system tokens, or navigation chrome affecting other pages.
- Missing error-recovery UX for destructive user actions (delete account, billing updates, permission revocations).
- Adding new runtime npm dependencies when native HTML/CSS or existing repo utilities suffice.
Layer a tone template if desired
Keep role rules in your project/repo file and pair with a light communication baseline from our 43 personality tunings:
Common questions on the Frontend Engineer template.
Does this Frontend Engineer prompt work with React, Vue, Svelte, and plain HTML?
Yes. Every rule targets framework-agnostic UI invariants (derived state, semantic HTML, complete state coverage, existing token reuse) so it works identically in React, Next.js, Vue, Svelte, or vanilla JS.
Why does it warn against clickable divs and redundant ARIA?
Default LLMs frequently generate `<div onClick>` wrappers that break keyboard focus, Space/Enter activation, and screen readers. Native `<button type="button">` and `<label for>` solve accessibility with less code.
How many rules should I add for my specific stack?
Keep stack additions to 3-5 concrete commands (like your typecheck, test, and lint scripts) so total active rules stay under 15 and avoid the Instruction Budget Cliff.
For AI agents Machine-readable install protocol & raw .md URL — click to expand
Fetch the canonical Markdown file with YAML install metadata at /library/roles/frontend-engineer.md, the clean body-only copy-paste block at /resources/roles/frontend-engineer.md, or the ready-to-save Claude Code subagent definition at /subagents/frontend-engineer.md.
curl -fsSL https://agent-tune.com/subagents/frontend-engineer.md -o .claude/agents/frontend-engineer.md