Scaffold Feature Module

VerifiedSafe

Automatically creates directory structure and boilerplate files for a new feature module with optional API, components, hooks, and context support.

Sby Skills Guide Bot
DevelopmentBeginner
3/3/2026
Claude Code
#scaffolding#project-structure#react#typescript#feature-modules

Recommended for

Automated summary

Scaffolds a new feature module’s directory structure and boilerplate files under lib/features, with interactive selection of API and UI layers.

Strengths

  • Validates the feature name as kebab-case before creating anything
  • Offers clear multi-select choices for API modules (models, logic) and UI modules (components, hooks, contexts)
  • Adds naming-convention comments inside each generated index.ts file
  • Standardizes folder layout and barrel exports for a consistent project structure

Limitations

  • Generates only index files with comments, not working components, hooks, or API logic
  • Assumes a specific React/TypeScript structure under lib/features that may not match an existing codebase
  • Depends on Claude Code’s AskUserQuestion tool and slash-command workflow
When to use it

Use it when starting a new feature module and you want a consistent folder skeleton before writing implementation code.

When not to use it

Avoid it when the project uses a different directory convention or when you need ready-to-use components and API functions rather than placeholders.

Security analysis

Safe
Quality score82/100

The skill only scaffolds directory structures and boilerplate files under lib/features/<feature-name>/. It declares no allowed tools, uses no network or shell execution, and contains no destructive commands, secret handling, or obfuscated payloads.

No concerns found

How this analysis is made

Examples

Basic feature scaffold
/scaffold-feature user-management
Feature with API and UI layers
/scaffold-feature billing — include API models, API logic, components and hooks
Scaffold from a plain request
Scaffold a new feature module named team-settings with the standard structure.

name: scaffold-feature description: Scaffold a new feature module with the standard directory structure and optional API, components, hooks, and context boilerplate.

Scaffold Feature

Scaffold a new feature module with the standard directory structure and boilerplate files.

Usage

/scaffold-feature <feature-name>

Example: /scaffold-feature user-management

Instructions

Follow these steps to scaffold a new feature:

Step 1: Parse Feature Name

The feature name is provided in $ARGUMENTS. If $ARGUMENTS is empty or missing, use AskUserQuestion to prompt:

What is the name of the feature? (use kebab-case, e.g., user-management)

Step 2: Validate Feature Name

Ensure the feature name:

  • Uses kebab-case (lowercase letters and hyphens only)
  • Does not start or end with a hyphen
  • Is not empty

If invalid, inform the user and ask for a valid name.

Step 3: Ask Which Modules to Include

Use AskUserQuestion with multi-select to ask two questions (API layer and UI layer):

Question 1: API Layer Modules

Question: "Which API modules should be included?" Header: "API" Options:

  1. API Models - "TypeScript types, interfaces, enums, and constants"
  2. API Logic - "Server-side business logic and data fetching functions"

Question 2: UI Layer Modules

Question: "Which UI modules should be included?" Header: "UI" Options:

  1. Components - "React UI components with loading, empty, and error states"
  2. Hooks - "Custom React hooks for data fetching and state management"
  3. Contexts - "React Context + useReducer for complex shared state"

Step 4: Generate Directory Structure

Create the feature directory at lib/features/{feature-name}/.

For each selected module, create the appropriate subdirectories and files:

API Models (if selected)

api/models/index.ts

api/models/index.ts:

// {Feature Name} Models
//
// Add your TypeScript interfaces, types, enums, and constants here.
//
// Naming conventions:
// - {entity}.ts - Interface definitions (e.g., user.ts)
// - {entity}-type.ts - Enum definitions (e.g., user-type.ts)
// - {feature}-constants.ts - Constants (e.g., dashboard-constants.ts)

API Logic (if selected)

api/logic/index.ts

api/logic/index.ts:

// {Feature Name} Logic
//
// Add your server-side business logic and data fetching functions here.
// Use `import "server-only"` for functions that access secrets or APIs.
//
// Naming conventions:
// - get-{resource}.ts - Fetch single resource
// - get-all-{resources}.ts - Fetch collections
// - {action}-{resource}.ts - Mutations (e.g., delete-session.ts)

Components (if selected)

components/index.ts

components/index.ts:

// {Feature Name} Components
//
// Add your React components here. Each component should have its own directory:
//
// components/
// └── {component-name}/
//     ├── {component-name}.tsx         - Main component (orchestrator)
//     ├── {component-name}-view.tsx    - View component (optional)
//     ├── {component-name}-loading.tsx - Loading/skeleton state
//     ├── {component-name}-empty.tsx   - Empty state
//     ├── {component-name}-errored.tsx - Error state
//     └── index.ts                     - Barrel exports

Hooks (if selected)

hooks/index.ts

hooks/index.ts:

// {Feature Name} Hooks
//
// Add your custom React hooks here.
//
// Naming conventions:
// - use-{feature}-{purpose}.ts (e.g., use-user-profile.ts)
// - Always include "use client" directive
// - Export params and return value interfaces

Contexts (if selected)

contexts/index.ts

contexts/index.ts:

// {Feature Name} Contexts
//
// Add your React Context modules here. Each context should have its own directory:
//
// contexts/
// └── {context-name}/
//     ├── {context-name}-state.tsx    - State interface and initial values
//     ├── {context-name}-actions.tsx  - Action types and interfaces
//     ├── {context-name}-reducer.tsx  - Reducer function
//     ├── {context-name}-context.tsx  - React Context creation
//     └── {context-name}-provider.tsx - Provider component

Step 5: Output Summary

After creating all files, output a summary:

Created feature: {feature-name}

lib/features/{feature-name}/
├── api/
│   ├── logic/
│   │   └── index.ts
│   └── models/
│       └── index.ts
├── components/
│   └── index.ts
└── hooks/
    └── index.ts

Next steps:
1. Add your TypeScript types to api/models/
2. Add server-side logic to api/logic/
3. Create components in components/
4. Create hooks in hooks/

Adjust the tree output based on which modules were actually created.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/scaffold-feature-module-mma3jsp3/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/scaffold-feature-module-mma3jsp3' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/scaffold-feature-module-mma3jsp3/download' --output '.skill-downloads/scaffold-feature-module-mma3jsp3/SKILL.md.part' && mv '.skill-downloads/scaffold-feature-module-mma3jsp3/SKILL.md.part' '.skill-downloads/scaffold-feature-module-mma3jsp3/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/scaffold-feature-module-mma3jsp3/SKILL.md' && test -s '.skill-downloads/scaffold-feature-module-mma3jsp3/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/scaffold-feature' && cp -R '.skill-downloads/scaffold-feature-module-mma3jsp3' '.claude/skills/scaffold-feature'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/scaffold-feature-module-mma3jsp3'

openskills read 'scaffold-feature-module-mma3jsp3'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/scaffold-feature-module-mma3jsp3/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills