Debug Frontend logo

Debug Frontend

Community
yerdaulet-damir
debug-frontend

Systematic 5-step debugging flow for Next.js 15 + React 19 + TypeScript apps. Load when a UI bug is reported, hydration error appears, Server Action returns wrong data, or cache invalidation fails. Forces layer isolation (server vs client, action vs component, cache vs render) before touching code — prevents "fix here, break there" cascades.

Overview

Publisheryerdaulet-damir
Repositoryvibe-coding-rules
Skill namedebug-frontend
Stars
34
Forks
1
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by yerdaulet-damir on GitHub. Read the source before you install it.

Installation

Install the Debug Frontend AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/yerdaulet-damir/vibe-coding-rules/tree/main/.claude/skills/debug-frontend
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/yerdaulet-damir/vibe-coding-rules.git /tmp/vibe-coding-rules
mkdir -p .claude/skills
cp -r /tmp/vibe-coding-rules/.claude/skills/debug-frontend .claude/skills/debug-frontend
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Debug Frontend in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Debug Frontend on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Debug Frontend is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

debug-frontend

Stop. Do not edit any file yet. Work through these 5 steps in order.


Step 1 — Locate the layer

Next.js bugs almost always live in one of 5 layers. Identify which one before touching code.

SymptomLikely layerFirst grep
500 / runtime error in browserClient componentgrep -rn "'use client'" src/features/<domain>/components/
Hydration mismatchServer vs client divergencegrep -rn "Date()|Math.random|window\." src/features/<domain>/
Wrong data after mutationCache invalidationgrep -rn "revalidateTag|revalidatePath" src/features/<domain>/actions.ts
Server Action returns { error: ... } unexpectedlyValidation or repogrep -n "safeParse|throw" src/features/<domain>/actions.ts
Type error / weird undefinedSchema / typesgrep -rn "z\.infer|as any|@ts-ignore" src/features/<domain>/
Slow page / waterfallData fetch shapegrep -n "await " src/app/<route>/page.tsx (count sequential awaits)

Pick one layer. Do not touch any other layer in this debug pass.


Step 2 — Check the 5 most common Next.js antipatterns

These cause the majority of vibe-coded bugs. Grep for each:

bash
# Antipattern 1: 'use client' on a page or layout (forces 100% client tree)
grep -rn "'use client'" src/app/ | grep -E "(page|layout)\.tsx"

# Antipattern 2: useEffect for data fetching (race conditions, no Suspense)
grep -rn "useEffect.*fetch\|useEffect.*async" src/features/

# Antipattern 3: revalidateTag with magic string (typo = silent miss)
grep -rn "revalidateTag(['\"]" src/  # should find nothing — all should use tags.X()

# Antipattern 4: throw for business errors (breaks errors-as-values)
grep -rn "throw new Error" src/features/*/actions.ts

# Antipattern 5: drizzle-orm leaked outside repository.ts
grep -rn "from 'drizzle-orm" src/features/*/components/ src/features/*/actions.ts
ResultRoot causePrinciple
'use client' on page/layoutWhole tree client-rendered, no RSC benefitsC4
useEffect + fetchRace conditions, waterfall, hydration mismatchC9 / D2
Magic-string revalidateTagCache miss in production due to typoD1
throw in Server ActionClient gets generic error, can't show field hintC5
drizzle-orm in componentHexagonal boundary brokenB1 / D6

Step 3 — Reproduce the bug deterministically

Before changing code, prove you can trigger it on demand.

For a UI bug: narrow the user flow:

1. Visit /users
2. Click "Edit" on user 'alice@x.com'
3. Submit form with empty name
4. EXPECTED: error shown next to Name field
5. ACTUAL: page reloads with stale data

For a Server Action bug: call the action in isolation:

typescript
// scratch test
const result = await createUser({ email: '', name: '' });
console.log(result);  // expected: { success: false, error: 'Invalid input' }

For a cache invalidation bug: check both sides:

bash
# 1. Is the read tagged?
grep -A2 "fetch.*users" src/features/users/  # look for next: { tags: [...] }

# 2. Is the write invalidating the same tag?
grep -A3 "revalidateTag" src/features/users/actions.ts

If the read uses tags.user(id) but the write only invalidates tags.userList() — there's your bug.


Step 4 — Fix in the correct layer

Minimum change. Do not refactor unrelated code.

LayerWhere to fix
Server Component bugsrc/features/<domain>/components/<Feature>Page.tsx
Client Component bugsrc/features/<domain>/components/<Leaf>.tsx
Mutation bugsrc/features/<domain>/actions.ts
Validation bugsrc/features/<domain>/schema.ts
Data access bugsrc/features/<domain>/repository.ts
Cache misssrc/lib/cache/tags.ts + relevant action

Hydration mismatches specifically: add suppressHydrationWarning only as a last resort — first try moving the non-deterministic code (Date, random, window) to a client useEffect for initial render or to a server-only computation.


Step 5 — Verify

bash
# Type check
pnpm typecheck

# Lint
pnpm lint

# Run the failing scenario again — must succeed now
pnpm dev
# (manually walk through the reproduction steps from Step 3)

Then run the antipattern greps from Step 2 again. You must not have introduced any new violation while fixing.


Common error → root cause table

Error / SymptomWhere to look firstLikely cause
Hydration failed because the initial UI does not matchClient componentDate() or Math.random() in render
useActionState is undefinedImportsMissing 'use client' directive
Form submits but data doesn't refreshServer ActionMissing revalidateTag or wrong tag
Cannot read properties of undefined (reading 'X') after fetchSchemaAPI response doesn't match Zod schema; safeParse returned error and was ignored
500 on Server Actionactions.tsthrow for a business error instead of returning { success: false }
Page is slow but data loads fast in isolationPage structureSequential awaits creating waterfall (Principle D3)
Shows stale data after router.refresh()CacheTag mismatch between fetch and invalidate
dynamic = 'force-dynamic' but PPR enabled warningnext.configEither remove force-dynamic or remove PPR for that route
Bundle size grewComponent tree'use client' on a page pulled the whole tree client-side

Verification

The skill was applied correctly when:

  • A reproducible scenario exists (Step 3)
  • Fix touches exactly one layer
  • All 5 antipattern greps still come up clean
  • pnpm typecheck && pnpm lint exits 0
  • The reproduction scenario now passes

Frequently asked questions

What does the Debug Frontend AI skill do?

Systematic 5-step debugging flow for Next.js 15 + React 19 + TypeScript apps. Load when a UI bug is reported, hydration error appears, Server Action returns wrong data, or cache invalidation fails. Forces layer isolation (server vs client, action vs component, cache vs render) before touching code — prevents "fix here, break there" cascades.

Why use Debug Frontend on TypingMind?

Because you install it once and use it with any model. Debug Frontend is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Debug Frontend in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/yerdaulet-damir/vibe-coding-rules/tree/main/.claude/skills/debug-frontend. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Debug Frontend?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Debug Frontend?

As many as you like. As long as a model supports skills, you can use Debug Frontend with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Debug Frontend AI skill free?

Yes. It is published on GitHub by yerdaulet-damir under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇