React Principles — Draft New Recipe (internal)
You draft a new cookbook recipe for the React Principles project. This is an internal maintainer skill — invoked by the cookbook author or contributors, not by end users.
When to invoke
- User says "draft a new recipe" or "create a recipe for X"
- User asks to add a new cookbook topic
- User asks for a recipe template
Inputs needed
Ask the user for:
- Recipe slug — lowercase, hyphenated (e.g.,
error-boundaries, data-visualization)
- Recipe title — full title (e.g., "Error Boundaries in React")
- Category — one of:
Foundations — fundamental concepts (TypeScript, components, hooks, state)
Patterns — applied techniques (server state, forms, tables)
Auth Flows, Data Viz, API Integration, Dashboards, Landing Pages — domain-specific
- One-sentence description — shown in the recipe card
- Principle statement — the core opinion of the recipe (what to do and why)
- 3-5 rules — concrete guidelines that follow from the principle
- Pattern code — a representative code example (filename + code)
- Implementation context — does the recipe need separate Next.js and Vite implementations, or is the pattern framework-agnostic?
If the user doesn't have all the details ready, generate a scaffold with TODO comments where they need to fill in.
What to read first
Read existing recipes for structural reference:
src/features/cookbook/data/recipes/server-state.ts
src/features/cookbook/data/recipes/client-state.ts
src/features/cookbook/data/recipes/form-validation.ts
src/features/cookbook/data/recipes/data-tables.ts
src/features/cookbook/data/recipes/api-integration.ts
src/features/cookbook/data/types.ts
Match the RecipeDetail type exactly.
Template
File: src/features/cookbook/data/recipes/<slug>.ts
import type { RecipeDetail } from "@/features/cookbook/data/types";
export const <camelCaseSlug>: RecipeDetail = {
slug: "<slug>",
title: "<Title>",
breadcrumbCategory: "<Category>",
description:
"<One-sentence description.>",
principle: {
text: "<The core principle. State what to do and why, in 1-3 sentences.>",
tip: "<One actionable tip developers should remember.>",
},
rules: [
{ title: "<Rule 1 title>", description: "<One-sentence rule.>" },
{ title: "<Rule 2 title>", description: "<One-sentence rule.>" },
{ title: "<Rule 3 title>", description: "<One-sentence rule.>" },
],
pattern: {
filename: "<filename>.tsx",
code: \`<pattern code as backtick-quoted string>\`,
},
implementation: {
nextjs: {
description:
"<How this is applied in Next.js App Router context. 1-2 sentences.>",
filename: "<path/filename>.tsx",
code: \`<Next.js-specific implementation code>\`,
},
vite: {
description:
"<How this differs (or doesn't) in Vite context. 1-2 sentences.>",
filename: "<path/filename>.tsx",
code: \`<Vite-specific implementation code>\`,
},
},
lastUpdated: "<Month DD, YYYY — today's date>",
contributor: { name: "Singgih Budi Purnadi", role: "Frontend & Mobile Developer" },
// demoKey: "<key>", // uncomment if a live demo exists
};
Rules for the draft
- Code blocks use plain backtick-quoted strings — not template literals (no
${} expansions), so the code is shown literally in the cookbook UI
- Filenames in pattern/implementation use paths relative to project root — e.g.,
components/UserForm.tsx, not ./UserForm.tsx
lastUpdated uses long-form date — e.g., "May 14, 2026"
- Principle and rules are opinionated — recipes are not neutral references, they take a stance
- Vite implementation is OPTIONAL — if pattern is framework-agnostic, the vite section can mirror nextjs section or be omitted (check existing recipes for whether to include)
After generating
Tell the user:
- The file path created
- Reminder to register the recipe in
src/features/cookbook/data/cookbook-data.ts:
- Add to
RECIPES array with status: "coming-soon" initially
- Set
order to the next available number
- Choose appropriate
icon, gradient, tags, category
- Reminder to export from
src/features/cookbook/data/index.ts if there's a barrel
- Reminder to flip status to
"published" only after content is final and verified
Audit / quality checklist
After drafting, the recipe should be audited via the reactprinciples-audit-recipe skill before publishing. Mention this to the user.
What you should NOT do
- Don't generate the
cookbook-data.ts entry automatically — the maintainer chooses ordering, tags, and gradient. Just tell them what fields to fill.
- Don't set
status: "published" — new recipes start as "coming-soon" until reviewed
- Don't invent code examples that aren't representative of the actual codebase — read existing files first
Reference
See existing recipes for structural and tonal reference. The cookbook lives at reactprinciples.dev/cookbook.
1---2name: reactprinciples-recipe3description: Draft a new React Principles cookbook recipe in the standard structure. Internal maintainer skill.4---56# React Principles — Draft New Recipe (internal)78You draft a new cookbook recipe for the [React Principles](https://www.reactprinciples.dev) project. This is an internal maintainer skill — invoked by the cookbook author or contributors, not by end users.910## When to invoke1112- User says "draft a new recipe" or "create a recipe for X"13- User asks to add a new cookbook topic14- User asks for a recipe template1516## Inputs needed1718Ask the user for:19201. **Recipe slug** — lowercase, hyphenated (e.g., `error-boundaries`, `data-visualization`)212. **Recipe title** — full title (e.g., "Error Boundaries in React")223. **Category** — one of:23 - `Foundations` — fundamental concepts (TypeScript, components, hooks, state)24 - `Patterns` — applied techniques (server state, forms, tables)25 - `Auth Flows`, `Data Viz`, `API Integration`, `Dashboards`, `Landing Pages` — domain-specific264. **One-sentence description** — shown in the recipe card275. **Principle statement** — the core opinion of the recipe (what to do and why)286. **3-5 rules** — concrete guidelines that follow from the principle297. **Pattern code** — a representative code example (filename + code)308. **Implementation context** — does the recipe need separate Next.js and Vite implementations, or is the pattern framework-agnostic?3132If the user doesn't have all the details ready, generate a scaffold with TODO comments where they need to fill in.3334## What to read first3536Read existing recipes for structural reference:3738```39src/features/cookbook/data/recipes/server-state.ts40src/features/cookbook/data/recipes/client-state.ts41src/features/cookbook/data/recipes/form-validation.ts42src/features/cookbook/data/recipes/data-tables.ts43src/features/cookbook/data/recipes/api-integration.ts44src/features/cookbook/data/types.ts45```4647Match the `RecipeDetail` type exactly.4849## Template5051File: `src/features/cookbook/data/recipes/<slug>.ts`5253```ts54import type { RecipeDetail } from "@/features/cookbook/data/types";5556export const <camelCaseSlug>: RecipeDetail = {57 slug: "<slug>",58 title: "<Title>",59 breadcrumbCategory: "<Category>",60 description:61 "<One-sentence description.>",62 principle: {63 text: "<The core principle. State what to do and why, in 1-3 sentences.>",64 tip: "<One actionable tip developers should remember.>",65 },66 rules: [67 { title: "<Rule 1 title>", description: "<One-sentence rule.>" },68 { title: "<Rule 2 title>", description: "<One-sentence rule.>" },69 { title: "<Rule 3 title>", description: "<One-sentence rule.>" },70 ],71 pattern: {72 filename: "<filename>.tsx",73 code: \`<pattern code as backtick-quoted string>\`,74 },75 implementation: {76 nextjs: {77 description:78 "<How this is applied in Next.js App Router context. 1-2 sentences.>",79 filename: "<path/filename>.tsx",80 code: \`<Next.js-specific implementation code>\`,81 },82 vite: {83 description:84 "<How this differs (or doesn't) in Vite context. 1-2 sentences.>",85 filename: "<path/filename>.tsx",86 code: \`<Vite-specific implementation code>\`,87 },88 },89 lastUpdated: "<Month DD, YYYY — today's date>",90 contributor: { name: "Singgih Budi Purnadi", role: "Frontend & Mobile Developer" },91 // demoKey: "<key>", // uncomment if a live demo exists92};93```9495## Rules for the draft96971. **Code blocks use plain backtick-quoted strings** — not template literals (no `${}` expansions), so the code is shown literally in the cookbook UI982. **Filenames in pattern/implementation use paths relative to project root** — e.g., `components/UserForm.tsx`, not `./UserForm.tsx`993. **`lastUpdated` uses long-form date** — e.g., "May 14, 2026"1004. **Principle and rules are opinionated** — recipes are not neutral references, they take a stance1015. **Vite implementation is OPTIONAL** — if pattern is framework-agnostic, the vite section can mirror nextjs section or be omitted (check existing recipes for whether to include)102103## After generating104105Tell the user:1061071. The file path created1082. Reminder to register the recipe in `src/features/cookbook/data/cookbook-data.ts`:109 - Add to `RECIPES` array with `status: "coming-soon"` initially110 - Set `order` to the next available number111 - Choose appropriate `icon`, `gradient`, `tags`, `category`1123. Reminder to export from `src/features/cookbook/data/index.ts` if there's a barrel1134. Reminder to flip status to `"published"` only after content is final and verified114115## Audit / quality checklist116117After drafting, the recipe should be audited via the `reactprinciples-audit-recipe` skill before publishing. Mention this to the user.118119## What you should NOT do120121- Don't generate the `cookbook-data.ts` entry automatically — the maintainer chooses ordering, tags, and gradient. Just tell them what fields to fill.122- Don't set `status: "published"` — new recipes start as `"coming-soon"` until reviewed123- Don't invent code examples that aren't representative of the actual codebase — read existing files first124125## Reference126127See existing recipes for structural and tonal reference. The cookbook lives at [reactprinciples.dev/cookbook](https://www.reactprinciples.dev/cookbook).