base-template-generator — Claude Code subagent: what it does
base-template-generator writes the starting file set for a new component, endpoint or project config, then reuses templates that worked before.
no license ★ 850 updated 2026-10-26
.claude/agents/base-template-generator.mdWhat base-template-generator does
Point it at a new component or endpoint and it lays out the starting files. React work comes back as Component.tsx, Component.test.tsx, Component.module.css and index.ts; a REST endpoint as routes.ts, controller.ts, service.ts, types.ts and tests.ts.
Before writing, the agent looks up earlier templates that scored well and borrows their shape. Afterwards it saves the result with a quality score. Similar project structures are found by walking a graph of linked nodes: component, API, tests, config.
The hooks shell out to npx claude-flow@alpha to read and write those patterns, and they swallow any error. Without that package you still get the files, but nothing gets learned from them. The agent is at 2.0.0-alpha.
What it helps with
- scaffold a React component with tests and styling
- split a new REST endpoint into controller, service and repository layers
- get a starter config for a project from scratch
- reuse templates that scored well in earlier sessions
- find a similar project structure before generating files
Example prompts for the agent
- Generate the skeleton for a
UserProfilecomponent with types, tests and styles. - Create a REST endpoint template for user management with validation and tests.
- Put together a starter config for a new TypeScript project.
How to install base-template-generator
Manually: put the files in place
.claude/agents/base-template-generator.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/base-template-generator.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/base-template-generator.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about base-template-generator
How do I install base-template-generator in Claude Code?
Put the agent file at .claude/agents/base-template-generator.md inside your project; Claude reads subagents from that folder.
What does base-template-generator do?
It produces starter files for a component, an API endpoint or a project config, drawing on template patterns stored earlier.
What does the pattern memory need to work?
The hooks call npx claude-flow@alpha to store and search patterns. Skip that package and generation still runs, but no patterns get recorded.