frontend-forms-and-validation

frontend-forms-and-validation is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 107 tokens per session (1,573 once invoked), scanned A, original, Apache-2.0.

A workflow for building forms with shared rules, clear errors, and keyboard and screen-reader support. It covers fields, validation, submission, multi-step flows, and file uploads.

In plain words
What is it for?
It helps create accessible forms that handle untouched, invalid, submitting, failed, and successful states.
Why use it?
It prevents the browser and server from applying different rules, losing entered data, or leaving users unsure how to fix an error.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps create accessible forms that handle untouched, invalid, submitting, failed, and successful states.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmj-90/gaffer/frontend-forms-and-validation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tmj-90/gaffer --skill frontend-forms-and-validation
Clone the repo
git clone --depth 1 https://github.com/tmj-90/gaffer

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for frontend-forms-and-validation

README.md
[![agentmods](https://agentmods.dev/badge/skills/tmj-90/gaffer/frontend-forms-and-validation/github.svg)](https://agentmods.dev/skills/tmj-90/gaffer/frontend-forms-and-validation)
Your own site
<a href="https://agentmods.dev/skills/tmj-90/gaffer/frontend-forms-and-validation"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/frontend-forms-and-validation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for frontend-forms-and-validation

Your own site · 80×15
<a href="https://agentmods.dev/skills/tmj-90/gaffer/frontend-forms-and-validation"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/frontend-forms-and-validation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,573 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00107 $0.01573
Opus 5.5 $0.00043 $0.00629
Sonnet 5.5 $0.00021 $0.00315
Haiku 4.5 $0.00011 $0.00157

Measured 16d ago against content hash a3515eb27ee2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

frontend-forms-and-validation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 16d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

runner/skills/frontend-forms-and-validation/SKILL.md · 96 lines

How it starts

The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Build a form that validates, explains and never loses input

A form is a contract with the server. Share the rules so client and server never disagree, tell the user what is wrong in text next to the field, keep every keystroke through errors and navigation, and make exactly one submission per intent. WCAG 2.2 AA criteria that apply directly: 1.3.1, 1.3.5 (autocomplete), 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.3.7 (redundant entry) and 3.3.8 (accessible authentication).

Steps

  1. Use the repo's form stack. The form library (React Hook Form, TanStack Form, Formik, framework form actions, React 19 useActionState/useFormStatus), the schema library (Zod, Valibot, Yup) and the shared input components. Call search_lore; never add a second form or schema library.
  2. One schema, both sides. Import or generate the schema the API validates with. The client validates for speed; the server validates for truth (the security-input-validation skill). Map the server's field errors (for example an RFC 9457 problem body with per-field errors) back onto the fields, and show form-level errors in the summary — never only in a toast.
  3. Markup that assistive tech understands.
    • Visible <label for> on every control; placeholder is an example, never the label.
    • Groups of radios/checkboxes in fieldset + legend.
    • Required marked in text ("required" or a legend explaining *) plus the required attribute.
    • Help and error text linked by aria-describedby; aria-invalid="true" only after the field has been validated and failed.
    • autocomplete tokens on personal data (name, email, tel, street-address, postal-code, cc-number, one-time-code, new-password, current-password) — required by 1.3.5 and it makes password managers work.
    • The right type/inputmode/enterkeyhint (type="email", inputmode="numeric" for codes, not type="number" for things that are not quantities).
  4. Validate at the right moment. On blur for a field the user has left; on change once a field is showing an error (so it clears as they fix it); everything on submit. Never on the first keystroke. Async checks (username taken) are debounced and cancellable.
  5. On a failed submit: keep all input, show an error summary at the top with links to each field (the GOV.UK pattern), move focus to the summary (or to the only invalid field in short forms), and phrase each message as the fix: "Enter a date in the past", not "Invalid".
  6. Submit exactly once. While the request is pending: a visible pending state on the button, repeated activations ignored, the request carries an idempotency key when the API supports one (the idempotency-and-retries skill). Prefer ignoring re-clicks (or aria-disabled) over disabling the button before submission — a disabled submit hides why the form cannot be sent. After success: confirmation, then navigate or reset as the AC says. A failed submit that clears the form is a bug.
  7. Editing existing records. Load the current value with its version/ETag; submit it back. On 409/412 keep the user's edits and explain the record changed — do not silently overwrite another user's save (the frontend-data-fetching skill).
  8. Preserve work. Multi-step flows keep earlier answers when the user goes back, and never ask for the same information twice (3.3.7). Long forms keep a draft (per the frontend-state-management skill) and warn before leaving with unsaved changes.
  9. Hard inputs. Dates: native input type="date" or the design-system picker, stored as ISO 8601, displayed per locale (the i18n-l10n skill). Money: integer minor units plus currency code. Phone/postcode: lenient parsing, strict validation. Passwords and codes: allow paste and password managers, offer show-password, no cognitive-test CAPTCHA (3.3.8). Files: the file-uploads skill.
  10. Test per AC (the frontend-testing skill), with userEvent and the network mocked:
    • a valid submit sends the expected payload once and shows success;
    • each rule the AC names shows its message, linked to the field (toHaveAccessibleDescription), and aria-invalid is set;
    • a server field error lands on the field; a 500 keeps all input and allows retry;
    • double click / Enter twice → one request;
    • the whole form is completable by keyboard, with fields found by label. Evidence each AC with the record-evidence skill, then stop.

Read the full file on GitHub · 96 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 16d ago Changed · +28 lines · +3 tokens per session a3515eb27ee2
  2. 19d ago First seen · 68 lines · 104 tokens per session scan A 52c5bc804374

Subscribe to this mod's changes

frontend-forms-and-validation is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 17d ago), licensed Apache-2.0. It adds 107 tokens to every session and 1,573 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-28.

Related

Other skills, from other repositories

bulwark-brainstorm

Role-based brainstorming with dual modes: --scoped (sequential Task tool, 5 roles) and --exploratory (Agent Teams peer debate, 4 roles). Use for feasibility assessment and idea validation.

QBall-Inc/the-bulwark · 50 tokens

plan-creation

Create structured implementation plans via a 4-role scrum team (Product Owner, Architect, Eng/Delivery Lead, QA/Critic) with optional Agent Teams peer debate mode.

QBall-Inc/the-bulwark · 38 tokens

anthropic-validator

Validates Claude Code assets (skills, hooks, agents, commands, MCP servers, plugins) against official Anthropic standards. Fetches latest docs dynamically and produces structured validation reports.

QBall-Inc/the-bulwark · 40 tokens

create-subagent

Generates single-purpose Claude Code sub-agents for use via the Task tool. Use when creating dedicated sub-agents, scaffolding agent definitions, or generating agents with diagnostics and permissions setup.

QBall-Inc/the-bulwark · 42 tokens

test-audit

Audit test suites for T1-T4 violations using AST analysis, mock detection, and multi-stage synthesis. Invoke when user asks to audit tests, check test quality, find mock violations, review test effectiveness, or inspect test suites for over-mocking. Triggers automatic rewrites when quality gates fail.

QBall-Inc/the-bulwark · 0 tokens

code-review

Comprehensive code review with distinct aspect based sections. Use when reviewing code, checking for security issues, finding type safety problems, auditing code quality, or when user asks to review code, PRs or changes. Three-phase workflow runs static tools, LLM judgment, and writes diagnostic log.

QBall-Inc/the-bulwark · 61 tokens