New Feature Nextjs logo

New Feature Nextjs

Community
yerdaulet-damir
new-feature-nextjs

Pre-flight checklist for adding a new feature to a Next.js 15 + TypeScript app. Load when creating a new page, route, server action, or feature module. Forces feature-driven colocation, RSC-first thinking, and the typed cache-tag pattern from line one — prevents the most common AI failures (1500-line page.tsx, 'use client' on the layout, scattered revalidateTag magic strings).

Overview

Publisheryerdaulet-damir
Repositoryvibe-coding-rules
Skill namenew-feature-nextjs
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 New Feature Nextjs 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/new-feature-nextjs
  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/new-feature-nextjs .claude/skills/new-feature-nextjs
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable New Feature Nextjs 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 New Feature Nextjs 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 New Feature Nextjs 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.

new-feature-nextjs

Do not open any file for editing until all 6 steps are completed.


Step 1 — Define the feature surface

Write the surface in plain text before any code:

Feature name: users
Routes: /users (list), /users/[id] (detail)
Mutations: createUser, updateUser, deleteUser
Reads: getUser(id), listUsers()
Cache tags: user(id), userList(), userOrders(userId)

If you can't fill all 5 lines in 2 sentences each, the scope is unclear — clarify with the user first.


Step 2 — Pick the folder location (Principle C1)

ScopeLocation
Reusable everywhere (Button, Input)src/components/ui/
Belongs to one business domainsrc/features/<domain>/
Pure helper used in 2+ featuressrc/lib/<area>/
Used in exactly one placecolocate next to that place (Principle C6)

For a new feature, default to src/features/<domain>/ with this structure:

src/features/<domain>/
├── components/         # JSX (server + client)
├── actions.ts          # Server Actions
├── repository.ts       # Drizzle adapter (only file importing drizzle-orm)
├── protocols.ts        # Repository protocol/interface
├── schema.ts           # Zod schemas
└── store.ts            # Zustand (only if genuinely needed)

Step 3 — Add cache tags FIRST (Principle D1)

Before writing any Server Action, add the tags to src/lib/cache/tags.ts:

typescript
// src/lib/cache/tags.ts
export const tags = {
  // ... existing tags
  user: (id: string) => `user:${id}` as const,
  userList: () => 'user:list' as const,
} as const;

Rule: zero revalidateTag('magic-string') in the new feature. Every invalidation goes through the typed DSL. Typos must be compile errors.


Step 4 — Build bottom-up (parallel to FastAPI new-feature skill)

1. Schema (Zod)         → src/features/<domain>/schema.ts
2. Repository protocol  → src/features/<domain>/protocols.ts
3. Repository impl      → src/features/<domain>/repository.ts (Drizzle)
4. Server Actions       → src/features/<domain>/actions.ts (uses tags + repo via Protocol)
5. Components (server)  → src/features/<domain>/components/<Feature>Page.tsx
6. Components (client)  → src/features/<domain>/components/<Leaf>.tsx ('use client')
7. Route               → src/app/<route>/page.tsx (thin, < 20 lines)

Critical rules during build:

  • actions.ts imports usersRepo typed as UsersRepoProtocol — never imports drizzle-orm directly
  • Server Components fetch data and pass Promises down (Principle D3) — don't await and pass values unless you must
  • 'use client' goes on the leaf component that needs useState / onClick / use() — never on the page or layout (Principle C4)
  • app/<route>/page.tsx stays under 20 lines and just imports <Feature>Page (Principle C2)

Step 5 — Wire Suspense + PPR (Principles D3, D4)

Streaming setup in the page:

tsx
// src/app/users/page.tsx
import { UsersPage } from '@/features/users/components/UsersPage';
import { usersRepo } from '@/features/users/repository';

export const experimental_ppr = true;  // D4

export default function Page() {
  const usersPromise = usersRepo.list(50);  // not awaited
  return <UsersPage usersPromise={usersPromise} />;  // streamed via Suspense
}

Server feature page wraps async children in <Suspense>:

tsx
// src/features/users/components/UsersPage.tsx
import { Suspense } from 'react';
import { UserList } from './UserList';

export function UsersPage({ usersPromise }: Props) {
  return (
    <Suspense fallback={<UserListSkeleton />}>
      <UserList usersPromise={usersPromise} />
    </Suspense>
  );
}

Client leaf unwraps with use():

tsx
'use client';
import { use } from 'react';

export function UserList({ usersPromise }: Props) {
  const users = use(usersPromise);
  return <ul>...</ul>;
}

Step 6 — Verify principles before committing

Run these grep checks:

bash
# C2: page is thin (< 20 lines)
wc -l src/app/<route>/page.tsx

# C3: file size cap
find src/features/<domain> -name "*.ts*" | xargs wc -l | sort -rn | head

# C4: no 'use client' on pages or layouts
grep -rn "'use client'" src/app/ | grep -E "(page|layout)\.tsx"

# C5: errors are values, not throws (in Server Actions)
grep -n "throw new" src/features/<domain>/actions.ts

# C8: no `any` and no @ts-ignore
grep -rn ": any\b\| as any\b\|@ts-ignore" src/features/<domain>/

# C10: no inline styles
grep -rn "style=\{\{" src/features/<domain>/

# D1: every revalidateTag goes through tags.X()
grep -n "revalidateTag(['\"]" src/features/<domain>/  # must be empty

# D6: drizzle-orm imported only from repository.ts
grep -rn "from 'drizzle-orm" src/features/<domain>/  # only repository.ts allowed
CheckExpected result
page.tsx line count< 20
Any file > 200 LOCrefactor before commit
'use client' on page/layoutzero hits
throw new in actions.tszero hits (return errors as values)
any / @ts-ignorezero hits
style={{}}zero hits
revalidateTag('...') magic stringzero hits
drizzle-orm outside repository.tszero hits
bash
pnpm typecheck
pnpm lint

Both must pass.


Verification checklist

  • Surface defined in writing before any code
  • Folder location follows feature-driven colocation
  • Cache tags added to lib/cache/tags.ts before Server Actions
  • Build order followed: schema → protocol → repo → action → component → route
  • Server fetch passes Promise down; client unwraps with use()
  • PPR enabled if route has static + dynamic mix
  • All 8 grep checks pass
  • pnpm typecheck && pnpm lint exits 0

Frequently asked questions

What does the New Feature Nextjs AI skill do?

Pre-flight checklist for adding a new feature to a Next.js 15 + TypeScript app. Load when creating a new page, route, server action, or feature module. Forces feature-driven colocation, RSC-first thinking, and the typed cache-tag pattern from line one — prevents the most common AI failures (1500-line page.tsx, 'use client' on the layout, scattered revalidateTag magic strings).

Why use New Feature Nextjs on TypingMind?

Because you install it once and use it with any model. New Feature Nextjs 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 New Feature Nextjs in TypingMind?

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

Which AI models can use New Feature Nextjs?

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 New Feature Nextjs?

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

Is the New Feature Nextjs 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 👇