scaffold

Generates boilerplate for new modules, features, or components based on existing project conventions. Detects patterns from the codebase and produces new code that looks like it belongs. Ensures consistency without manual template maintenance.

23 stars

Best use case

scaffold is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Generates boilerplate for new modules, features, or components based on existing project conventions. Detects patterns from the codebase and produces new code that looks like it belongs. Ensures consistency without manual template maintenance.

Teams using scaffold should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/scaffold/SKILL.md --create-dirs "https://raw.githubusercontent.com/christophacham/agent-skills-library/main/skills/architecture/scaffold/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/scaffold/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How scaffold Compares

Feature / AgentscaffoldStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Generates boilerplate for new modules, features, or components based on existing project conventions. Detects patterns from the codebase and produces new code that looks like it belongs. Ensures consistency without manual template maintenance.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Skill: Scaffold

## What This Skill Does

Generates **convention-aware boilerplate** for new modules, features, or components. Instead of starting from scratch (and introducing inconsistencies), this skill analyzes existing code to learn the project's patterns, then generates new code that follows the same structure, naming, imports, and organization.

## When to Use

- When creating a new module, service, component, or feature
- When the user says "add a new <X> like the existing ones"
- As part of `implement-phase` when a step requires creating new files

Do NOT use this for modifying existing code — use `refactor` for that.

## Execution Model

- **Always**: the primary agent runs this skill directly.
- **Rationale**: scaffolding requires reading existing code patterns and creating new files — primary agent capabilities.
- **Output**: new source files + optional test files.

## Workflow

### Step 1: Identify What to Scaffold

Use the `question` tool to determine:

1. What type? (module, component, service, endpoint, model, CLI command)
2. What name?
3. Is there an existing example to follow? (e.g., "like the auth module")

### Step 2: Find Reference Examples

Locate existing code of the same type:

```bash
# Find similar modules/components
find . -name "*.ts" -path "*/services/*" | head -5
find . -name "*.py" -path "*/models/*" | head -5
```

Read 1-2 reference files to extract:

- File structure (sections, imports, exports)
- Naming conventions (PascalCase, snake_case)
- Comment patterns (JSDoc, docstrings)
- Error handling patterns
- Type/interface patterns

### Step 3: Read Project Conventions

Check `AGENTS.md` for explicit conventions:

- Module structure rules
- Naming requirements
- Required boilerplate (license headers, type guards)
- Dependencies between modules

### Step 4: Generate Scaffold

Create the new files following discovered patterns:

1. **Source file(s)** with proper structure, imports, exports
2. **Test file(s)** matching the project's test conventions
3. **Index/barrel file** if the project uses them
4. **Type definitions** if the project has separate type files

Every generated file should:

- Follow the same import style as reference files
- Use the same export pattern
- Include the same boilerplate (error types, logging, etc.)
- Have placeholder implementations marked with `// TODO: implement` or `pass`

### Step 5: Verify Structure

```bash
# Show what was created
find <new-module-path> -type f
```

Check:

- File naming matches convention
- Directory placement is correct
- Imports resolve (no broken references)
- Types are consistent

### Step 6: Run Quick Check

If the project has a type checker:

```bash
npx tsc --noEmit  # TypeScript
mypy <module>      # Python
```

Verify the scaffold doesn't break the build.

## Rules

1. **Pattern first**: always analyze existing code before generating. Never use generic templates that don't match the project.
2. **Complete but minimal**: generate all required files (source, test, types) but keep implementations as stubs.
3. **No surprises**: the generated code should look like a team member wrote it. Same style, same patterns, same structure.
4. **Imports must resolve**: verify that all imports in the generated code point to real modules.
5. **Test file included**: always generate a corresponding test file, even if it only has a placeholder test.
6. **No built-in explore agent**: do NOT use the built-in `explore` subagent type.

Related Skills

genderapi-io-automation

23
from christophacham/agent-skills-library

Automate Genderapi IO tasks via Rube MCP (Composio). Always search tools first for current schemas.

gender-api-automation

23
from christophacham/agent-skills-library

Automate Gender API tasks via Rube MCP (Composio). Always search tools first for current schemas.

fred-economic-data

23
from christophacham/agent-skills-library

Query FRED (Federal Reserve Economic Data) API for 800,000+ economic time series from 100+ sources. Access GDP, unemployment, inflation, interest rates, exchange rates, housing, and regional data. Use for macroeconomic analysis, financial research, policy studies, economic forecasting, and academic research requiring U.S. and international economic indicators.

fidel-api-automation

23
from christophacham/agent-skills-library

Automate Fidel API tasks via Rube MCP (Composio). Always search tools first for current schemas.

fastapi-templates

23
from christophacham/agent-skills-library

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

fastapi-router-py

23
from christophacham/agent-skills-library

Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or add...

fastapi-pro

23
from christophacham/agent-skills-library

Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns.

expo-api-routes

23
from christophacham/agent-skills-library

Guidelines for creating API routes in Expo Router with EAS Hosting

esm

23
from christophacham/agent-skills-library

Comprehensive toolkit for protein language models including ESM3 (generative multimodal protein design across sequence, structure, and function) and ESM C (efficient protein embeddings and representations). Use this skill when working with protein sequences, structures, or function prediction; designing novel proteins; generating protein embeddings; performing inverse folding; or conducting protein engineering tasks. Supports both local model usage and cloud-based Forge API for scalable inference.

eodhd-apis-automation

23
from christophacham/agent-skills-library

Automate Eodhd Apis tasks via Rube MCP (Composio). Always search tools first for current schemas.

dotnet-backend

23
from christophacham/agent-skills-library

Build ASP.NET Core 8+ backend services with EF Core, auth, background jobs, and production API patterns.

dotnet-backend-patterns

23
from christophacham/agent-skills-library

Master C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuratio...