@fabianmch/templatemaster2000
v0.1.3
Published
An expert Claude Code agent that builds reusable project templates from stubs (skeleton files + rules).
Downloads
539
Maintainers
Readme
TemplateMaster2000
An expert template builder for Claude Code. Give it a stub — a set of skeleton files plus a set of rules — and it produces a complete, reusable project template that follows those rules consistently.
The goal is to make high-quality, opinionated starter templates for any stack. The first two targets are:
- Next.js + React monorepo
- Python + FastAPI
…with more stacks to follow using the same stub-driven approach.
What is a "stub"?
A stub is the raw material the builder works from. It has two parts:
| Part | What it is | Examples |
|------|-----------|----------|
| Structure | A skeleton file tree or scaffold showing the shape of the project | apps/web/, packages/ui/, a partial pyproject.toml, an empty app/main.py |
| Guidelines | The rules the finished template must obey | naming conventions, required files, lint/format config, folder boundaries, placeholder syntax, licensing headers |
The builder maps every node of the structure to a concrete file and applies the
guidelines uniformly across all of them, leaving clearly-named placeholders
({{PLACEHOLDER_NAME}}) wherever real per-use variation belongs.
The template-builder agent
The core of this project is a Claude Code subagent defined in
.claude/agents/template-builder.md. It:
- Restates the goal so misunderstandings surface early.
- Maps the structure stub to concrete files, preserving hierarchy.
- Applies every guideline uniformly, stopping to ask when two rules conflict.
- Uses consistent, descriptive placeholders.
- Writes the files and adds a short usage note (what to fill in, which rules to keep).
It has access to Read, Write, Edit, Glob, Grep, AskUserQuestion — enough to inspect a
stub and write a template, with no shell or network access it doesn't need.
Installing on your local machine
1. Install Claude Code
You need the Claude Code CLI (or the VS Code / JetBrains extension, which bundles it):
npm install -g @anthropic-ai/claude-codeThen authenticate by running claude once in any directory and following the prompt.
2. Get the agent onto your machine
Claude Code loads agents from two places:
.claude/agents/in a project — available only in that project.~/.claude/agents/— available in every project on your machine.
Install the agent with a single npx command — pick the scope you want:
# into the current project (./.claude/agents)
npx @fabianmch/templatemaster2000 install
# into your user directory, available everywhere (~/.claude/agents)
npx @fabianmch/templatemaster2000 install --globalOther commands:
npx @fabianmch/templatemaster2000 list # show which agents the package bundles
npx @fabianmch/templatemaster2000 install --force # overwrite existing filesThe installer copies three things into .claude/: the agent(s) into
.claude/agents/, the slash commands into .claude/commands/, and the template
reference library into .claude/templates/ (the agent reads its stubs from
there). It touches nothing else. Existing files are skipped unless you pass
--force.
Project-scoped agents win over user-scoped ones if both define the same name.
3. Verify it's loaded
Start Claude Code and confirm the agent is available:
claudeThen ask something like "list my available agents", or just invoke it directly (below).
Using the agent
Start a Claude Code session in the folder where you want the template created, then describe the job. You can let Claude delegate automatically, or name the agent explicitly:
Use the template-builder agent to turn the stub in ./stubs/nextjs-monorepo
into a project template.Give it both inputs — the structure and the guidelines. For example:
Build a template from this stub:
Structure:
apps/web/ (Next.js app router)
packages/ui/ (shared React components)
packages/config/ (shared eslint/tsconfig)
turbo.json
package.json
Guidelines:
- pnpm workspaces, Turborepo
- TypeScript strict mode everywhere
- each package name prefixed @acme/
- app name is a {{APP_NAME}} placeholderIf you leave out the structure or the guidelines, the agent will ask for the missing piece before generating anything — it won't invent rules you didn't give it.
Roadmap
- [x]
template-builderagent - [x] npm / npx installer
- [ ] Reference stub: Next.js + React monorepo
- [ ] Reference stub: Python + FastAPI
- [ ] Additional stacks
- [ ] Optional GitHub-automation variant of the agent (non-interactive, comments missing inputs instead of prompting)
Repository layout
TemplateMaster2000/
├─ .claude/
│ ├─ agents/
│ │ └─ template-builder.md # the expert template-builder subagent (source of truth)
│ ├─ commands/ # slash commands that hand off to the agent
│ │ ├─ template-new.md
│ │ ├─ template-app.md
│ │ └─ template-from-stub.md
│ └─ templates/ # the reference stub library the agent reads
│ └─ frontend/Next.js_monorepo/
├─ bin/
│ └─ install.js # `npx @fabianmch/templatemaster2000 install` CLI
├─ package.json # npm package + bin entry
└─ README.mdEverything under
.claude/is both what this repo uses locally and what the npm installer ships — a single source of truth, no duplication. Because the layout is identical in the source repo and in an installed project, the agent's.claude/templates/references resolve the same way everywhere.
