project-structure

Organize React/Next.js/TypeScript projects with feature-based architecture and ESLint enforcement.

5|Updated Oct 17, 2011
One-click install
npx skills add https://github.com/klen/dotfiles --skill project-structure-klen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: project-structure
Source: https://github.com/klen/dotfiles/tree/main/.config/opencode/skills/project-structure
Command: npx skills add https://github.com/klen/dotfiles --skill project-structure-klen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a robust, scalable, and maintainable approach to organizing code within React, Next.js, and TypeScript projects, moving away from traditional type-based folders to a feature-driven architecture.

Core Features & Use Cases

  • Feature-Based Architecture: Organizes code by feature/domain, promoting modularity and independence.
  • Unidirectional Code Flow: Enforces a clear, predictable flow of dependencies (sharedfeaturesapp).
  • Scalability: Designed to handle medium-to-large projects effectively.
  • Use Case: When starting a new React/Next.js project or refactoring an existing one, use this Skill to establish a clean, feature-centric directory structure and enforce best practices for code organization and dependency management.

Quick Start

Apply the project-structure skill to guide the organization of a new React/Next.js codebase.

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 large React or Next.js project structure?

To organize a large React or Next.js project, use a feature-based architecture that groups code by domain, promoting modularity and independence instead of traditional type-based folders. This approach solves scalability and maintainability issues.

What is unidirectional code flow in TypeScript project architecture?

Unidirectional code flow in TypeScript project architecture enforces a clear, predictable dependency path from shared components to features, ending at the app level. This structure establishes strict dependency management and efficient code placement.

How do I refactor an existing React codebase to feature-based architecture?

Refactor an existing React codebase to feature-based architecture by reorganizing directories around feature domains, applying detailed structure guidelines, and enforcing strict isolation and unidirectional code flow using ESLint.

Does feature-based architecture work for medium-to-large Next.js applications?

Feature-based architecture is specifically designed to handle medium-to-large Next.js applications effectively. It ensures modularity and clear dependency management, satisfying requirements for scalability in complex codebases.

How do I enforce strict dependency management in a React project structure?

Enforce strict dependency management in a React project structure by applying ESLint rules that maintain feature isolation and unidirectional code flow. This prevents unauthorized imports and ensures efficient code placement.

Why should I choose feature-based folders over type-based folders in React?

Choose feature-based folders over type-based folders in React to promote feature isolation and modularity. This shift prevents scalability issues in large codebases by enforcing unidirectional code flow and clear dependency management.