Nts scaffold internal tool
Skill juncoding/nextjs-trpc-prisma-starter/skills/nts-scaffold-internal-tool
Claude Code plugin: scaffold and maintain lightweight internal management systems on Next.js + tRPC + Prisma in SPA mode
npx -y skills add juncoding/nextjs-trpc-prisma-starter --skill nts-scaffold-internal-toolAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Scaffold a brand-new lightweight internal management system on Next.js + tRPC + Prisma in SPA / client-component mode. Use this whenever the user wants to start a new internal tool, admin dashboard, back-office app, CRUD app, management system, or operational SaaS starter — even if they don't name the stack. Walks the user through an interactive Q&A (project name, location, database, auth, cache, MCP, deployment target), then generates the canonical folder structure, dependencies, sample tRPC router, sample service, Prisma schema starter, .env.example, and CLAUDE.md.
SKILL.md
11.0 KB, as published. Nobody here has run it
Scaffold a new internal management tool
This skill bootstraps a brand-new project on the Next.js + tRPC + Prisma in SPA mode stack. It is the entry point for the nextjs-trpc-prisma-starter plugin and is invoked either explicitly via /nts-scaffold-tool or when the user expresses intent to start a new internal management system.
When to use this skill
Use this skill when the user is starting a brand-new project in one of these shapes:
- Internal admin dashboard / management system
- Back-office tool for staff
- Internal CRUD app
- Lightweight operational SaaS
- ERP-style line-of-business app
- Anything where the user says "scaffold / init / start / create a new <internal tool kind>"
Do NOT use this skill for:
- Adding a feature to an existing project (those have their own skills —
add-cache,add-mcp,add-auth). - Public-facing marketing sites, content sites, e-commerce storefronts (SEO matters, different stack tradeoffs).
- Mobile-first products (tRPC is TypeScript-only without an adapter).
Why an interactive flow
The stack is opinionated but the project has variables (database, auth provider, whether to wire cache from day one, deploy target). Asking up front means the generated project is complete and consistent rather than half-configured. The user can always add things later via the add-* skills.
Use the AskUserQuestion tool for each step so the user gets a clean UI with options. Ask one question per AskUserQuestion call, not all at once — they shape later questions (e.g. answering "PostgreSQL" determines which Prisma adapter to install).
Conversation flow
Walk the user through these questions in this order. Stop and confirm before any file write.
1. Project name
Open-ended. Validate: lowercase, hyphens-only, no spaces, valid as both a folder name and an npm package name.
2. Project location
Options:
- New directory under current working directory (e.g.
./<project-name>/) - Use current working directory (must be empty — check first with
ls -A) - Custom absolute path
If "current directory" is chosen, run ls -A and abort if anything other than .git/ is present. Don't overwrite the user's stuff.
3. Database
Options:
- PostgreSQL (recommended) — production default. Uses
@prisma/adapter-pgdriver. - SQLite — for prototyping / very small deployments. No driver adapter needed.
- MySQL — if the team has existing MySQL infrastructure.
Skip MongoDB — Prisma supports it but the patterns in architecture-patterns assume relational. Tell the user that if they ask.
4. Auth
Options:
- Better Auth (recommended) — modern, RBAC built-in, MCP plugin available, credentials + magic-link + OAuth providers.
- NextAuth / Auth.js — if the user has prior experience.
- Skip for now — generate without auth wiring; user can run
/nts-add-authlater.
5. Cache
Options:
- Skip (recommended for start) — Next.js's default in-process cache is fine until measurably not.
- Redis — wire
ioredis+ a small cache helper from day one. Addsdocker-compose.ymlservice.
6. MCP entry point
Options:
- Yes (recommended) — wires
/api/mcp/route.tswith Better Auth'smcpplugin acting as OAuth provider. Adds onerfq_search-style example tool. Requires Better Auth (from step 4) — if user skipped auth, warn and offer to enable both. - Skip — easy to add later via
/nts-add-mcp.
7. Deployment target
Options:
- Self-hosted Docker (e.g. on EC2) — adds
Dockerfile,docker-compose.yml,next.config.tswithoutput: 'standalone'. - Vercel — adds
vercel.tsconfig, no Dockerfile. - Both / undecided — adds the Docker bits but doesn't strip Vercel compat.
8. Email / templates (optional)
Options:
- Skip
- Resend + Handlebars
9. Confirm
Show a summary of all choices and the file/folder list that will be generated. User confirms or backs up.
Generated structure
Files generated are derived from the answers above plus the templates in assets/. The canonical layout is documented in references/folder-structure.md — read it before writing.
Top level:
<project-name>/
├── src/
│ ├── app/
│ │ ├── (auth)/login/page.tsx
│ │ ├── (dashboard)/
│ │ │ ├── layout.tsx
│ │ │ └── page.tsx # placeholder home
│ │ ├── api/
│ │ │ ├── trpc/[trpc]/route.ts
│ │ │ ├── mcp/route.ts # if MCP=yes
│ │ │ └── auth/[...all]/route.ts # if Better Auth
│ │ ├── layout.tsx
│ │ └── providers.tsx # tRPC + React Query providers
│ ├── server/
│ │ ├── db/client.ts
│ │ ├── auth/
│ │ │ ├── index.ts
│ │ │ ├── session.ts
│ │ │ └── permissions.ts
│ │ ├── modules/
│ │ │ └── _example/ # sample service + schema + types
│ │ ├── api/ # tRPC routers
│ │ │ ├── root.ts
│ │ │ ├── trpc.ts # context + base procedures
│ │ │ └── routers/
│ │ │ └── _example.ts
│ │ ├── mcp/ # if MCP=yes
│ │ │ ├── registry.ts
│ │ │ └── tools/_example.ts
│ │ └── lib/
│ │ ├── logger.ts
│ │ ├── errors.ts
│ │ └── cache.ts # if cache=Redis
│ ├── features/ # feature-specific client UI
│ ├── components/ui/ # shadcn primitives (added as needed)
│ ├── lib/
│ │ ├── trpc-react.ts # client-side tRPC + RQ hooks
│ │ └── utils.ts
│ ├── hooks/
│ └── env.ts # @t3-oss/env-nextjs
├── prisma/
│ ├── schema.prisma
│ ├── migrations/
│ └── seed.ts
├── tests/
│ └── e2e/ # Playwright if requested
├── public/
├── docs/
│ ├── handoff.md # session-handoff doc (start-here for Claude)
│ └── architecture.md # link to plugin's docs/
├── .env.example
├── .gitignore
├── CLAUDE.md # generated, reflects choices
├── Dockerfile # if deploy=docker
├── docker-compose.yml # postgres + (redis if cache)
├── next.config.ts
├── tsconfig.json
├── package.json
├── jest.config.js
└── README.md
Generation steps in order
Execute these steps sequentially. After each step, briefly confirm completion before moving on.
- Create root + directory tree.
mkdir -pthe full tree. - Write
package.jsonusingassets/package.json.template, filling in the dependencies based on choices. - Write
tsconfig.json,next.config.ts,jest.config.jsfrom templates. - Write
prisma/schema.prismausingassets/prisma-schema.starter.prisma, swapping the datasource provider per the DB choice. - Write
src/env.tswith@t3-oss/env-nextjsschema reflecting which env vars are required given the choices. - Write
.env.exampleusingreferences/env-example-template.md— only include keys that the project actually needs (e.g. omitREDIS_URLif cache=skip). - Write the tRPC scaffolding —
src/server/api/{trpc,root}.tsplus a single_examplerouter showing the protectedProcedure pattern. - Write the service-layer scaffolding —
src/server/modules/_example/with a minimal service, schema, and types showinguserId-first + permission check + audit pattern. - Write the auth scaffolding (if not skipped) — Better Auth config + session helper + permissions helper.
- Write the MCP route (if requested) —
src/app/api/mcp/route.ts+src/server/mcp/registry.ts+ one example tool. - Write the client providers —
src/app/providers.tsxwiring tRPC + React Query. - Write
Dockerfile+docker-compose.ymlif Docker deploy. - Write
CLAUDE.mdusingreferences/claude-md-template.md, filled in with the choices. This is the contract for future Claude sessions on the project. - Write
docs/handoff.mdstub — empty section headers, ready to be filled in as the project grows. - Write
README.mdfor the project — short, repo-facing. git init+ first commitchore: initial scaffold from nextjs-trpc-prisma-starter.- Verification step — run
pnpm install,pnpm prisma generate,pnpm tsc --noEmit. Report results. Do not try to run migrations (no DB yet); the user owns that.
Key templates and references
The work is data-driven from the answers + these files:
references/stack-rationale.md— explains why this stack (read if user asks "why not X").references/folder-structure.md— the canonical layout, expanded with comments.references/claude-md-template.md— theCLAUDE.mdtemplate with variable slots.references/env-example-template.md— the.env.exampletemplate, keyed by which optional features were enabled.assets/*.template— actual file bodies to drop in, with{{VARIABLE}}slots.
When writing a file, read the corresponding template, substitute variables, then write. Don't generate from scratch — the templates carry months of hard-won decisions.
Post-scaffold
After the scaffold lands, point the user at the next moves:
pnpm devto start.- Edit
prisma/schema.prismato add their first real model. pnpm prisma migrate dev --name initto apply./nts-add-cache,/nts-add-mcp,/nts-add-authto retrofit later.- See
docs/architecture.mdin the project for ongoing patterns.
Sanity guards
- Never overwrite an existing file without explicit confirmation. Always
lsthe target directory first. - Never run
pnpm installin the user's current directory if the project location is "new subdirectory" —cdinto the new dir first. - Never push to a remote automatically. The user owns that.
- Never invent dependencies — every dep in
package.json.templateexists and is on a real version. - Never skip the CLAUDE.md step — it's the most load-bearing file in the project's future, since every future Claude session reads it first.