project-structure

Organizes React, Next.js, and TypeScript codebases using feature-based architecture with unidirectional imports.

Updated Apr 29, 2026
One-click install
npx skills add https://github.com/dev-khoi/AURA-conHack-2026 --skill project-structure-dev-khoi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: project-structure
Source: https://github.com/dev-khoi/AURA-conHack-2026/tree/main/.opencode/skills/project-structure
Command: npx skills add https://github.com/dev-khoi/AURA-conHack-2026 --skill project-structure-dev-khoi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Deciding where new code belongs becomes chaotic as React and TypeScript projects grow, leading to tangled imports, cross-feature coupling, and unmaintainable folder layouts. This Skill provides a concrete feature-based architecture with clear placement rules and ESLint enforcement. ## Core Features & Use Cases - Feature-Based Organization: Structures code into self-contained feature modules under src/features with api, components, hooks, stores, types, and utils subfolders. - Unidirectional Import Flow: Enforces shared → features → app dependency direction, with ESLint no-restricted-paths configurations to block cross-feature imports. - Decision Tables & Anti-Patterns: Provides lookup tables for where each code type belongs, plus guidance on avoiding barrel files and shared-folder pollution. - Use Case: When starting a new Next.js dashboard, apply this Skill to scaffold the folder structure, configure path aliases, set up ESLint import restrictions, and create the first feature module as a template. ## Quick Start Ask the AI to design a feature-based folder structure for a new React TypeScript project with ESLint rules preventing cross-feature imports.

Frequently Asked Questions about project-structure

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

FAQPage Schema
How do I structure a React TypeScript project by feature?▼

Create a src/features directory where each feature is a self-contained module with api, components, hooks, stores, types, and utils subfolders. Keep shared code in top-level folders like components, hooks, lib, and utils, and compose features at the app level.

How to prevent cross-feature imports in ESLint?▼

Use the import/no-restricted-paths ESLint rule with zones that block each feature folder from importing other features. Add additional zones preventing features from importing app code and shared modules from importing features.

Does feature-based architecture work with Next.js App Router?▼

Yes, keep Next.js route files in the app directory minimal and delegate logic to feature modules under src/features. Route pages simply import and render feature components, preserving feature isolation.

Why avoid barrel files in Vite projects?▼

Barrel files using index.ts re-exports break tree-shaking in Vite, inflating bundle sizes. Import modules directly from their file paths instead, such as importing a component from its exact feature path.

When should a component go in shared components versus a feature folder?▼

Place a component in the shared components folder only when multiple features use it. If only one feature uses the component, keep it inside that feature's components folder to avoid polluting shared code.