scaffold-flat

Scaffold React components and co-located tests in flat project layouts.

Updated Dec 23, 2025
One-click install
npx skills add https://github.com/sf-bcca/PromptArchitect-Studio --skill scaffold-flat
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: scaffold-flat
Source: https://github.com/sf-bcca/PromptArchitect-Studio/tree/main/.gemini/skills/scaffold-flat
Command: npx skills add https://github.com/sf-bcca/PromptArchitect-Studio --skill scaffold-flat

SYSTEM DOCUMENTATION & REQUIREMENTS

๐Ÿ’ก This Skill includes scripts (resource) components.

What problem does it solve?

Generates React components and their co-located tests following the project's Flat Structure (no src/ folder), eliminating repetitive boilerplate and ensuring consistency across UI code.

Core Features & Use Cases

  • Flat structure: no src/ directory; components and tests live in the root component folders.
  • Co-located tests: unit tests sit next to components (e.g., Header.tsx and Header.test.tsx).
  • Strict typing: all components use React.FC<Props> and defined interfaces.
  • Deterministic scaffolding: outputs a ready-to-run component scaffold and its test file.
  • Example: creating a UserProfile yields components/UserProfile.tsx and components/UserProfile.test.tsx.

Quick Start

Create a new component by running the scaffold script, for example: node .gemini/skills/scaffold-flat/scripts/create_component.cjs UserProfile

Frequently Asked Questions about scaffold-flat

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold React components with co-located tests in a flat project structure?โ–ผ

Scaffolding React components with co-located tests in a flat structure uses a deterministic script to generate ComponentName.tsx and ComponentName.test.tsx files together directly under a root components folder, omitting the src directory entirely.

What is co-located testing for React components?โ–ผ

Co-located testing for React components places unit test files next to the components they validate, such as Header.test.tsx sitting directly beside Header.tsx in the same folder, ensuring tests are easy to locate and maintain.

Does this React scaffolding tool enforce strict typing?โ–ผ

Yes, this React scaffolding tool enforces strict typing by applying React.FC<Props> and defined interfaces within the deterministic template, ensuring all generated UI code maintains strict type safety.

Can I generate React components without a src directory?โ–ผ

Yes, you can generate React components without a src directory because this tool specifically targets flat project layouts, outputting files directly into a root components folder.

How do I create a new React component and test file using a script?โ–ผ

You create a new React component and test file by executing the scaffold script with the component name as an argument, which outputs ready-to-run ComponentName.tsx and ComponentName.test.tsx files instantly.

What are the limitations of using a flat structure for React components?โ–ผ

A limitation of using a flat structure for React components is that it omits the traditional src directory, which may conflict with existing repository configurations or build tools that explicitly expect source files within a src folder.