# Scaffold

Project-aware file generation.

- Repository: https://github.com/SethGammon/Citadel (927 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add SethGammon/Citadel --skill scaffold -g -a claude-code -y`
Codex: `npx skills add SethGammon/Citadel --skill scaffold -g -a codex -y`
Cursor: `npx skills add SethGammon/Citadel --skill scaffold -g -a cursor -y`
Gemini CLI: `npx skills add SethGammon/Citadel --skill scaffold -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add SethGammon/Citadel`

## Description

Project-aware file generation. Reads existing codebase conventions (naming, structure, imports, exports, test patterns) then generates new files that match exactly. Wires generated files into the project's registration points.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# /scaffold, Project-Aware File Generator

## Orientation

**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.

## Protocol

### Step 1: IDENTIFY THE TARGET

Parse the user's request into:
- **type**: component | module | service | route | hook | domain | utility | custom
- **name**: the name the user gave (e.g., "UserProfile", "auth-service", "settings route")
- **description**: what it does, if provided (otherwise leave blank for now)

If the type is ambiguous, ask ONE clarifying question. Do not ask more than one.

### Step 2: FIND EXEMPLARS

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 |

The rest: https://github.com/SethGammon/Citadel/blob/HEAD/skills/scaffold/SKILL.md
