hatch3r-ai-ux-patterns

hatch3r-ai-ux-patterns is a cursor rule for Cursor from hatch3r/hatch3r. It costs 0 tokens per session (3,990 once invoked), scanned A, original, MIT.

A set of interface rules for products that use AI assistants or language models, covering streaming responses, tool actions, approvals, cancellation, undo, and citations.

In plain words
What is it for?
It is for designing chat, copilot, assistant, and agent interfaces.
Why use it?
It helps make AI features understandable and gives users control when generated actions or answers are incomplete or wrong.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit It is for designing chat, copilot, assistant, and agent interfaces.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/hatch3r/hatch3r/hatch3r-ai-ux-patterns
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.

Clone the repo
git clone --depth 1 https://github.com/hatch3r/hatch3r

Made for: Cursor.

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 hatch3r-ai-ux-patterns

README.md
[![agentmods](https://agentmods.dev/badge/rules/hatch3r/hatch3r/hatch3r-ai-ux-patterns.svg)](https://agentmods.dev/rules/hatch3r/hatch3r/hatch3r-ai-ux-patterns)
Your own site
<a href="https://agentmods.dev/rules/hatch3r/hatch3r/hatch3r-ai-ux-patterns"><img src="https://agentmods.dev/badge/rules/hatch3r/hatch3r/hatch3r-ai-ux-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 3,990 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.00000 $0.03990
Opus 5 $0.00000 $0.01995
Sonnet 5 $0.00000 $0.00798
Haiku 4.5 $0.00000 $0.00399

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

Security

Grade A, and why

hatch3r-ai-ux-patterns 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 4d 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.

rules/hatch3r-ai-ux-patterns.mdc · 135 lines

How it starts

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

AI/Agentic UX Patterns (2026)

Pillars: P2 (Scientific & Practical Quality), CQ2 (UX Quality)

Scope

This rule applies when the end-user project ships LLM-driven UI — chat, assistant, copilot, agent dashboards, generative UI surfaces. It does NOT govern the LLM backend itself (model selection, prompt engineering, retrieval pipeline). For non-AI UX rules (loading, empty, error, partial states; form patterns; microcopy), cross-reference rules/hatch3r-ux-states-and-flows.md. When both rules apply to the same surface, the non-AI rule sets the baseline and this rule layers AI-specific behavior on top.

Backend companion: rules/hatch3r-ai-evals.md defines eval harness, prompt versioning, cost telemetry, prompt caching, model fallback, and hallucination-as-SLI. Apply both rules for any LLM-driven feature.

Detection: this rule activates when the project imports an AI SDK (ai, @ai-sdk/*, openai, @anthropic-ai/sdk, @google/generative-ai), or contains files under ai/, chat/, assistant/, agents/, llm/, copilot/. Adding any of these to a project that previously had no AI surface triggers the full ruleset on the next agent run.

Streaming-First Defaults

  • Every LLM-driven surface uses framework-agnostic streaming hooks: useChat, useCompletion, or useObject from Vercel AI SDK UI (or equivalent for non-React stacks). Hand-rolled SSE or fetch against the model endpoint is a regression in 2026.
  • Render progressive tokens from the moment the request starts. Pair with a skeleton state during the pre-token window (request-sent, first-token-pending). A blank surface during model latency is a regression.
  • Render markdown incrementally without re-parsing the whole buffer on every chunk (Vercel AI Elements MessageResponse pattern). Use a streaming-safe markdown renderer that tracks last-rendered offset and appends from there.
  • Emit chunk-level error boundaries. If a stream fails mid-flight, retain prior tokens, render an inline retry control adjacent to the truncated response, and do not blank the surface or reset the message body.
  • Indicate completion explicitly via a final-token marker or onFinish callback transition. Stale "thinking" indicators after stream-end erode trust and waste user attention.
  • Non-streaming responses on LLM-driven surfaces are a regression. The narrow exception is structured-output endpoints that must return a single validated JSON payload (useObject already streams partial objects — prefer that).
  • Typing indicator policy: show only while no token has arrived; switch to streamed content the moment the first delta lands. Two-second indicator timeouts that linger past first-token are a regression.
  • Backpressure: when the model emits faster than the renderer can paint, batch deltas to one paint per animation frame (requestAnimationFrame) rather than dropping tokens or queuing into an unbounded buffer.
  • Message model — AI SDK 6+ breaking change (verify before pinning a version): since AI SDK 6 (GA 2025-12-22) and retained in AI SDK 7 (current stable major, GA 2026-06-25), every useChat message is an ordered parts array, not a flat content string, and handleSubmit / handleInputChange are replaced by sendMessage({ text }). Part types: text, reasoning, file, source-url/source-document, and — for tools — tool-${toolName} (static tools) or dynamic-tool (tools unknown at compile time, e.g. MCP); a tool invocation is one part whose state field transitions input-streaminginput-availableoutput-available/output-error, not separate tool-call/tool-result entries — switching on those strings matches nothing. Render by iterating message.parts; code that reads message.content silently drops the cards the §Tool-Call UI Cards section mandates — text still renders but the tool call never appears. Re-check ai-sdk.dev/docs/ai-sdk-ui for the current major before adopting a pinned version (part typing verified against ai-sdk.dev/docs/ai-sdk-ui/chatbot-tool-usage, accessed 2026-07-12).

Read the full file on GitHub · 135 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. 4d ago First seen · 135 lines · 0 tokens per session scan A a74017c1a5f2

Subscribe to this mod's changes

hatch3r-ai-ux-patterns is a cursor rule published in the GitHub repository hatch3r/hatch3r (26 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,990 tokens. 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-03.