From citadel
Generates new files like components, modules, services, routes, hooks by analyzing codebase conventions for naming, structure, imports, exports, tests, and wiring into registration points.
npx claudepluginhub sethgammon/citadel --plugin citadelThis skill uses the workspace's default tool permissions.
**Use when:** Creating a new component, module, service, route, hook, domain, or utility with existing examples in the project.
Generates new API endpoints, UI components, backend modules, shared packages, and database collections following existing codebase patterns.
Generates project scaffolds, components, and CI/CD pipelines for Go CLI/libraries, Python packages, Node apps, Rust, React. Includes tests, Makefiles, configs. Invoke via /scaffold.
Generates complete production-ready projects from descriptions: directory structure, code, tests, docs, config, git init. Orchestrates pipeline with verification to ensure builds and tests pass.
Share bugs, ideas, or general feedback.
Use when: Creating a new component, module, service, route, hook, domain, or utility with existing examples in the project.
Do NOT use when: The file has no precedent (use /marshal for unconstrained generation), you're modifying existing files (use /refactor), or the project has no conventions yet.
Needs: target type, name, and optional description.
Parse the user's request into:
If the type is ambiguous, ask ONE clarifying question. Do not ask more than one.
Search the codebase for 2-3 existing files of the same type.
Search strategy by type:
| Type | Search Pattern | What to Look For |
|---|---|---|
| component | **/*.tsx in the same directory or sibling directories | Functional components with similar complexity |
| module | Same directory as where new module will live | Registration pattern, exports, config shape |
| service | **/services/**, **/lib/** | Class vs function, singleton vs factory, error handling |
| route | Router config files, **/routes.*, **/pages/** | Route definition format, lazy loading, guards |
| hook | **/hooks/**, **/use*.ts | Naming, parameter patterns, return types, cleanup |
| domain | Top-level domain/feature directories | Manifest structure, entry point, internal layout |
| utility | **/utils/**, **/helpers/** | Pure function style, type signatures, JSDoc |
For each exemplar, extract:
hooks/ dir?).test.ts next to file? __tests__/ directory? separate tests/ tree?).types.ts? shared types file?)Output a brief analysis (3-5 lines) summarizing the conventions you found.
Based on the exemplars, determine which files to generate. Not every project needs every file. Only generate what the project's conventions call for.
Decision matrix:
| File | Generate IF... |
|---|---|
| Main file | Always |
Types file (.types.ts) | Project separates types into their own files (check exemplars) |
Test file (.test.ts) | Project has co-located tests for this type of file |
| Barrel/index file | Project uses barrel exports AND this file's directory doesn't already have one |
| Barrel update | Project uses barrel exports AND the directory already has an index file |
Style file (.module.css, .styled.ts) | Project uses co-located styles for this type |
Storybook file (.stories.tsx) | Project has stories for this type of file |
Do NOT generate:
describe('...', () => { it.todo('...') })For each file in the set, generate content by adapting the closest exemplar.
Rules:
// TODO: implement, // Add logic here)Match the exemplar's props pattern, state management, utility imports, async patterns, and error handling exactly.
Find every registration point the exemplars use and add the new file there.
Common wiring points (check which ones the project uses):
| Wiring Point | How to Find It | What to Add |
|---|---|---|
| Barrel exports | index.ts in the same or parent directory | export { NewThing } from './NewThing' |
| Route registration | Router config file (search for exemplar's route) | New route entry matching the pattern |
| Module registry | Bootstrap/registration file | New registration call |
| Navigation/sidebar | Nav config array | New nav entry if appropriate |
| Lazy loading map | Dynamic import map | New lazy import entry |
| Type unions | Discriminated unions that list all variants | New variant if this is a new "type" of thing |
Rules:
Run typecheck — every generated file must pass. Fix failures before exiting. If typecheck is unavailable, do a manual read-through for syntax and import correctness.
{path} already exists. Overwrite it?" and wait for confirmation.Reversibility: Amber — creates new files and modifies registration points; git checkout to undo.
Cost: No cost actions — file generation only; no agents spawned, no confirmation needed.
Trust: No gates — safe at all trust levels; overwrite confirmation is in Fringe Cases.
All of these must be true before the skill exits:
Output a summary in this format:
SCAFFOLD COMPLETE
Created:
- path/to/MainFile.tsx (component)
- path/to/MainFile.test.tsx (test)
- path/to/MainFile.types.ts (types)
Wired into:
- path/to/index.ts (barrel export)
- path/to/routes.ts (route registration)
Conventions matched from:
- path/to/ExemplarA.tsx
- path/to/ExemplarB.tsx
Typecheck: PASS
---HANDOFF---
- Scaffolded: {name} ({type})
- Created: {N} files, wired into {N} registration points
- Conventions matched from: {exemplar names}
- Reversibility: green -- new files only, delete to undo
---