agentleFS
Global-Software-ConsultingGlobal-Software-Consulting/project-scaffolding-skills/skills/scaffold-app/SKILL.md

scaffold-app

Skill8 starsChanged 8 months agoMITView on GitHub

Scaffold a production-ready folder structure, base components, routing, types, and env setup for an already-configured React (Vite), Next.js, or React Native project. Run after /setup-project.

  • Reads credentials

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. hadyfayed/laravel-agent★ 14same name
    2. StephanSergio/vibe-stack★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository6 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

44 rules. About 0 are common, 14 are distinctive, and 30 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈14

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 30

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check the current directory for:

    line 16
  2. Very specific:

    Read package.json (and package.json in the project root if monorepo).

    line 26
  3. Very specific:

    If coming from /create-frontend-project, the app type is already known — skip this question.

    line 62
  4. Distinctive:

    Follow the reference file exactly.

    line 98
  5. Distinctive:

    Create the directory if it doesn't exist

    line 100
  6. Distinctive:

    Write the file with the content from the reference

    line 101
  7. Very specific:

    If heroui (React Vite only):

    line 103
  8. Very specific:

    Use HeroUI Button instead of plain <button> in layout/marketing components

    line 109
  9. Very specific:

    Use HeroUI Card, CardBody for feature cards and pricing cards

    line 110
  10. Very specific:

    Use HeroUI Navbar, NavbarBrand, NavbarContent, NavbarItem for the site header

    line 111
  11. Very specific:

    Import and use HeroUI components directly in client components ('use client')

    line 114
  12. Very specific:

    Use HeroUI Button, Card, CardBody, Navbar components directly

    line 115
  13. Very specific:

    If shadcn: use shadcn/ui Button, Card components

    line 116
  14. Very specific:

    If tailwind-only or none: use plain HTML + Tailwind classes

    line 117
  15. Very specific:

    If redux: use Redux store patterns in auth/app hooks

    line 118
  16. Very specific:

    If zustand: use Zustand store patterns

    line 119
  17. Very specific:

    If react-hook-form: use RHF in form components

    line 120
  18. Very specific:

    If formik: use Formik in form components

    line 121
  19. Very specific:

    If i18n detected (next-intl):

    line 122
  20. Very specific:

    Use t() for all user-visible strings

    line 123
  21. Very specific:

    If i18n detected (react-i18next): use t() for all user-visible strings

    line 127
  22. Very specific:

    If ANIMATIONS: motion AND app type is Landing or Consumer:

    line 128
  23. Very specific:

    Next.js: Create src/components/ui/FadeIn.tsx as a 'use client' wrapper (see reference/nextjs/motion.md).

    line 130
  24. Very specific:

    Keep animations minimal: fade-in (opacity 0→1) + slide-up (y: 24→0), duration 0.4–0.5s, ease-out.

    line 131
  25. Very specific:

    Use AppShell with <Sidebar /> on the left (default in reference)

    line 135
  26. Distinctive:

    If heroui: use the HeroUI Sidebar variant from the reference's "HeroUI Variants" section

    line 136
  27. Very specific:

    Use AppShell with <TopNav /> at the top (top nav variant from reference)

    line 138
  28. Very specific:

    Create TopNav.tsx instead of Sidebar.tsx

    line 140
  29. Distinctive:

    If heroui: use the HeroUI TopNav variant from the reference's "HeroUI Variants" section

    line 141
  30. Very specific:

    Delete src/App.css (unless it has custom styles)

    line 149
  31. Very specific:

    Keep src/index.css (contains Tailwind imports)

    line 151
  32. Very specific:

    Delete public/vite.svg and src/assets/react.svg if unused

    line 152
  33. Distinctive:

    After scaffolding is complete, ask:

    line 167
  34. Very specific:

    If skeleton extras selected: use HeroUI Skeleton component (from @heroui/react) instead of plain CSS pulse

    line 179
  35. Distinctive:

    After extras are handled (or skipped), print:

    line 185
  36. Distinctive:

    Run the correct dev command for the project type in the background (so it doesn't block the conversation):

    line 226
  37. Very specific:

    Use the Bash tool with run_in_background: true.

    line 233
  38. Distinctive:

    After the dev server question is resolved, always generate CLAUDE.md without asking.

    line 253
  39. Very specific:

    Follow the complete generate-claude-md skill from Step 1 through Step 6:

    line 255
  40. Distinctive:

    Write CLAUDE.md to the project root, commit it

    line 258
  41. Distinctive:

    Never overwrite files that already have meaningful content — check first with Read tool

    line 268
  42. Distinctive:

    Always adapt component code to the detected UI library

    line 269
  43. Distinctive:

    If i18n is detected, all user-facing strings must use translation keys (add keys to locale files too)

    line 270
  44. Very specific:

    Create .env.example with all variables documented but empty values

    line 271

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Scaffold App

You are a project scaffolding assistant. Your job is to generate the full production-ready app structure — folders, base components, routing, types, and environment setup — based on what the project already has installed.

Run this after /setup-project (or on any project where packages are already configured).


Step 1 — Detect Project Type

Check the current directory for:

  • next.config.* → Next.js
  • vite.config.* → React (Vite)
  • app.json with expo key → React Native (Expo)
  • android/ + ios/ without expo → React Native (CLI)

Step 2 — Detect Installed Packages

Read package.json (and package.json in the project root if monorepo). Build a profile:

UI_LIBRARY:        heroui | shadcn | tailwind-only | none
STATE_MANAGER:     redux | zustand | none
ROUTER:            react-router | tanstack-router | expo-router | react-navigation | none
HTTP_CLIENT:       tanstack-query+axios | axios | native-fetch | none
I18N:              react-i18next | next-intl | i18next | none
AUTH:              nextauth | jwt-custom | none
FORMS:             react-hook-form | formik | none
ANIMATIONS:        motion | none

Detect by checking dependencies and devDependencies for:

  • @heroui/react → heroui
  • @radix-ui/react-* or components.json file → shadcn
  • tailwindcss without above → tailwind-only
  • @reduxjs/toolkit → redux
  • zustand → zustand
  • react-router-dom → react-router
  • @tanstack/router → tanstack-router
  • expo-router → expo-router
  • @react-navigation/native → react-navigation
  • @tanstack/react-query → tanstack-query
  • axios → axios
  • next-intl → next-intl
  • react-i18next → react-i18next
  • next-auth → nextauth
  • react-hook-form → react-hook-form
  • formik → formik
  • motion → motion

Step 3 — Confirm App Type

If coming from /create-frontend-project, the app type is already known — skip this question.

Otherwise ask:

"What kind of app is this? A) Dashboard / Admin app B) Landing / Marketing site C) Consumer app (user-facing, accounts) D) General purpose"

If Dashboard / Admin is selected, ask one more question:

"What layout style do you want for the dashboard? A) Sidebar navigation (left sidebar + main content area — most common for admin panels) B) Top navigation bar (sticky top nav + full-width content — cleaner for data-heavy apps)"

Store the answer as LAYOUT_STYLE: sidebar | topnav and use it in Step 5.


Step 4 — Read the Reference File

Based on project type + app type, read the reference file:

Project TypeApp TypeReference File
React (Vite)Dashboard / Consumer~/.claude/project-scaffolding/reference/scaffold/react-dashboard.md
React (Vite)Landing / General~/.claude/project-scaffolding/reference/scaffold/react-landing.md
Next.jsDashboard / Consumer~/.claude/project-scaffolding/reference/scaffold/nextjs-dashboard.md
Next.jsLanding / General~/.claude/project-scaffolding/reference/scaffold/nextjs-landing.md
React NativeAny~/.claude/project-scaffolding/reference/scaffold/react-native-app.md

Read the file now with the Read tool before proceeding.


Step 5 — Execute the Scaffold

Follow the reference file exactly. For every file it specifies:

  1. Create the directory if it doesn't exist
  2. Write the file with the content from the reference
  3. Adapt component code to the detected package profile:
    • If heroui (React Vite only):
      • Wrap app with HeroUIProvider in src/main.tsx (CRITICAL — React Vite only, required for HeroUI styles)
        import { HeroUIProvider } from '@heroui/react'
        // wrap: <HeroUIProvider><App /></HeroUIProvider>
      • Use HeroUI Button instead of plain <button> in layout/marketing components
      • Use HeroUI Card, CardBody for feature cards and pricing cards
      • Use HeroUI Navbar, NavbarBrand, NavbarContent, NavbarItem for the site header
    • If heroui (Next.js):
      • HeroUI v3 has NO provider — do NOT add HeroUIProvider anywhere
      • Import and use HeroUI components directly in client components ('use client')
      • Use HeroUI Button, Card, CardBody, Navbar components directly
    • If shadcn: use shadcn/ui Button, Card components
    • If tailwind-only or none: use plain HTML + Tailwind classes
    • If redux: use Redux store patterns in auth/app hooks
    • If zustand: use Zustand store patterns
    • If react-hook-form: use RHF in form components
    • If formik: use Formik in form components
    • If i18n detected (next-intl):
      • Use t() for all user-visible strings
      • CRITICAL: Replace ALL import Link from 'next/link' with import { Link } from '@/i18n/navigation' — this makes every link locale-aware automatically (e.g. Arabic → /ar/about, English → /about)
      • CRITICAL: Replace ALL import { useRouter } from 'next/navigation' with import { useRouter } from '@/i18n/navigation'
      • src/i18n/navigation.ts must exist (created by next-intl setup step) — it exports locale-aware Link, useRouter, usePathname, redirect
    • If i18n detected (react-i18next): use t() for all user-visible strings
    • If ANIMATIONS: motion AND app type is Landing or Consumer:
      • React (Vite): Wrap key landing sections with motion.div from motion/react — use initial/whileInView/viewport for scroll-triggered reveals. Apply to: Hero headline + subtext, Features section cards (stagger), Pricing section cards (stagger), CTA banner. Import pattern: import { motion } from 'motion/react'
      • Next.js: Create src/components/ui/FadeIn.tsx as a 'use client' wrapper (see reference/nextjs/motion.md). Wrap Hero, Features, Pricing, CTA sections with <FadeIn> in server page components. For stagger grids (feature cards, pricing cards), create a 'use client' component that uses motion.div with variants + staggerChildren.
      • Keep animations minimal: fade-in (opacity 0→1) + slide-up (y: 24→0), duration 0.4–0.5s, ease-out. CTA buttons get whileHover={{ scale: 1.03 }}.
      • Never add animations if app type is Dashboard / Admin — even if motion is installed.
  4. If app type is Dashboard, apply the LAYOUT_STYLE choice:
    • If LAYOUT_STYLE = sidebar:
      • Use AppShell with <Sidebar /> on the left (default in reference)
      • If heroui: use the HeroUI Sidebar variant from the reference's "HeroUI Variants" section
    • If LAYOUT_STYLE = topnav:
      • Use AppShell with <TopNav /> at the top (top nav variant from reference)
      • Replace AppShell.tsx content with the top nav version
      • Create TopNav.tsx instead of Sidebar.tsx
      • If heroui: use the HeroUI TopNav variant from the reference's "HeroUI Variants" section
  5. Skip files that duplicate what's already set up (e.g. if axios.ts already exists in src/lib/, skip it)

Step 6 — Clean Up Vite Boilerplate

For React (Vite) projects, remove the default boilerplate:

  • Delete src/App.css (unless it has custom styles)
  • Clear src/App.tsx content (replace with the router entry point from reference)
  • Keep src/index.css (contains Tailwind imports)
  • Delete public/vite.svg and src/assets/react.svg if unused

Step 7 — Commit

git add .
git commit -m "feat: scaffold app structure — folder layout, base components, routing, types"

Step 8 — Optional Extras

After scaffolding is complete, ask:

"Want me to add any of these extras? (comma-separated or 'none')

  1. Skeleton loading components (recommended — prevents layout shift on data load)
  2. Toast notifications via sonner (recommended — user feedback for API calls)
  3. Error boundary (recommended — prevents full app crash from one component error)
  4. Dark mode toggle button
  5. None"

Then add what was selected on top of the already-scaffolded structure.

For heroui adaptation of selected extras:

  • If skeleton extras selected: use HeroUI Skeleton component (from @heroui/react) instead of plain CSS pulse

Step 9 — All Done

After extras are handled (or skipped), print:

✅ All done!

Project: [project-name]/
App type: [Dashboard / Landing / Consumer]

Structure created:
  src/
    components/   — shared UI components
    features/     — feature modules
    hooks/        — custom hooks
    utils/        — helpers (cn, formatDate, etc.)
    types/        — shared TypeScript types
    services/     — API layer
    [store/]      — state (if Redux/Zustand detected)
    [i18n/]       — translations (if i18n detected)

Commands:
  yarn dev              — start dev server
  yarn build            — production build
  yarn preview          — preview production build
  [npx expo start]      — React Native dev server

[If auth detected]:
  Demo: admin@example.com / password

Start here:
  src/features/         — add your first feature module
  src/services/         — wire up your real API endpoints

Then ask:

"Want me to start the dev server now? A) Yes — start it now (runs in the background, output will appear here) B) No — I'll run it myself"

If A — start it now:

Run the correct dev command for the project type in the background (so it doesn't block the conversation):

  • React (Vite): yarn dev (from the project directory)
  • Next.js: yarn dev (from the project directory)
  • React Native (Expo): npx expo start (from the project directory)
  • React Native (CLI): npx react-native start (from the project directory)

Use the Bash tool with run_in_background: true. After launching, tell the user:

"Dev server started in the background. Open: http://localhost:5173 (Vite) or http://localhost:3000 (Next.js) Output will appear in this conversation when the server is ready."

If B — user runs it themselves:

Show the exact command to copy-paste:

"Run this in your terminal from the project directory:

cd [project-name]
yarn dev
```"

Step 10 — Generate CLAUDE.md

After the dev server question is resolved, always generate CLAUDE.md without asking.

Follow the complete generate-claude-md skill from Step 1 through Step 6:

  • The stack profile is already fully known from Step 2 of this scaffold flow — skip re-detection
  • The app type is already known — pass it through directly
  • Write CLAUDE.md to the project root, commit it

Tell the user after generating:

"Generated CLAUDE.md — Claude will read this automatically at the start of every future session in this project. No need to explain the stack again."


Rules

  • Never overwrite files that already have meaningful content — check first with Read tool
  • Always adapt component code to the detected UI library
  • If i18n is detected, all user-facing strings must use translation keys (add keys to locale files too)
  • Create .env.example with all variables documented but empty values
  • One commit at the end — not per file
  • Tell the user what was created and the key files to start editing

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.