project-structure

Organize React/Next.js/TypeScript codebases into feature folders under src.

1|Updated Mar 20, 2026
One-click install
npx skills add https://github.com/Thomashighbaugh/opencode --skill project-structure-thomashighbaugh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: project-structure
Source: https://github.com/Thomashighbaugh/opencode/tree/main/skills/project-structure
Command: npx skills add https://github.com/Thomashighbaugh/opencode --skill project-structure-thomashighbaugh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Organize code by feature/domain to improve maintainability and scalability of React/Next.js/TypeScript projects.

Core Features & Use Cases

  • Unify project structure by feature folders under src/features, src/app, and shared utilities.
  • Enforce unidirectional data flow and clear module boundaries to reduce cross-feature coupling.
  • Use cases include starting a new project, reorganizing an existing codebase, or planning where to place new code.

Quick Start

Create a new feature module under src/features and place related components and APIs there.

Frequently Asked Questions about project-structure

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

FAQPage Schema
How do I organize a React TypeScript codebase by feature?

To organize code by feature, you group related components and APIs under dedicated feature folders within your src directory. This feature-based structure improves maintainability by establishing clear module boundaries and keeping domain-specific logic grouped together.

What is the best way to structure a scalable Next.js application?

The best way to structure a scalable Next.js application is using a standard src layout divided into app, features, and shared utilities. This enforces unidirectional code flow to reduce cross-feature coupling as your project grows.

How does a feature-based architecture prevent cross-feature imports?

Feature-based architecture prevents cross-feature imports by defining strict module boundaries and enforcing unidirectional code flow. It complements ESLint rules to restrict dependencies, stopping one feature from directly importing another feature's internal code.

Can I use this feature-based structure for an existing React project refactor?

Yes, you can apply this feature-based structure to existing React project restructurings. It guides both top-level and feature-level folder layouts, helping you reorganize an existing codebase to improve maintainability during ongoing refactors.

When do I need to restructure my codebase into feature folders?

You need to restructure your codebase into feature folders when maintainability drops due to cross-feature coupling. This approach organizes code by domain, making it easier to locate related components and plan where to place new code.

What are the limitations of a feature-based folder structure in TypeScript apps?

A limitation of a feature-based folder structure in TypeScript apps is the strict dependency management required. You must continuously enforce unidirectional code flow and ESLint rules to prevent cross-feature imports, which can introduce initial setup overhead.