Feature arch
Skill Pythoughts-labs/react-frontend-skills/skills/feature-arch
React feature-based architecture guidelines for scalable applications (formerly feature-architecture). This skill should be used when writing, reviewing, or refactoring React code to ensure proper feature organization. Triggers on tasks involving project structure, feature organization, module boundaries, cross-feature imports, data fetching patterns, or component composition.From its SKILL.md
npx -y skills add Pythoughts-labs/react-frontend-skills --skill feature-archAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.0 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it
Feature-Based Architecture Best Practices
Comprehensive architecture guide for organizing React applications by features, enabling scalable development with independent teams. Contains 42 rules across 8 categories, prioritized by impact from critical (directory structure, imports) to incremental (naming conventions).
When to Apply
Reference these guidelines when:
- Creating new features or modules
- Organizing project directory structure
- Setting up import rules and boundaries
- Implementing data fetching patterns
- Composing components from multiple features
- Reviewing code for architecture violations
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Directory Structure | CRITICAL | struct- |
| 2 | Import & Dependencies | CRITICAL | import- |
| 3 | Module Boundaries | HIGH | bound- |
| 4 | Data Fetching | HIGH | fquery- |
| 5 | Component Organization | MEDIUM-HIGH | fcomp- |
| 6 | State Management | MEDIUM | fstate- |
| 7 | Testing Strategy | MEDIUM | test- |
| 8 | Naming Conventions | LOW | name- |
Quick Reference
1. Directory Structure (CRITICAL)
struct-feature-folders- Organize by feature, not technical typestruct-feature-self-contained- Make features self-containedstruct-shared-layer- Use shared layer for truly generic code onlystruct-flat-hierarchy- Keep directory hierarchy flatstruct-optional-segments- Include only necessary segmentsstruct-app-layer- Separate app layer from features
2. Import & Dependencies (CRITICAL)
import-unidirectional-flow- Enforce unidirectional import flowimport-no-cross-feature- Prohibit cross-feature importsimport-public-api- Export through public API onlyimport-avoid-barrel-files- Avoid deep barrel file re-exportsimport-path-aliases- Use consistent path aliasesimport-type-only- Use type-only imports for types
3. Module Boundaries (HIGH)
bound-feature-isolation- Enforce feature isolationbound-interface-contracts- Define explicit interface contractsbound-feature-scoped-routing- Scope routing to feature concernsbound-minimize-shared-state- Minimize shared state between featuresbound-event-based-communication- Use events for cross-feature communicationbound-feature-size- Keep features appropriately sized
4. Data Fetching (HIGH)
fquery-single-responsibility- Keep query functions single-purposefquery-colocate-with-feature- Colocate data fetching with featuresfquery-parallel-fetching- Fetch independent data in parallelfquery-avoid-n-plus-one- Avoid N+1 query patternsfquery-feature-scoped-keys- Use feature-scoped query keysfquery-server-component-fetching- Fetch at server component level
5. Component Organization (MEDIUM-HIGH)
fcomp-single-responsibility- Apply single responsibility to componentsfcomp-composition-over-props- Prefer composition over prop drillingfcomp-container-presentational- Separate container and presentational concernsfcomp-props-as-data-boundary- Use props as feature boundariesfcomp-colocate-styles- Colocate styles with componentsfcomp-error-boundaries- Use feature-level error boundaries
6. State Management (MEDIUM)
fstate-feature-scoped-stores- Scope state stores to featuresfstate-server-state-separation- Separate server state from client statefstate-lift-minimally- Lift state only as high as necessaryfstate-context-sparingly- Use context sparingly for feature statefstate-reset-on-unmount- Reset feature state on unmount
7. Testing Strategy (MEDIUM)
test-colocate-with-feature- Colocate tests with featurestest-feature-isolation- Test features in isolationtest-shared-utilities- Create feature-specific test utilitiestest-integration-at-app-layer- Write integration tests at app layer
8. Naming Conventions (LOW)
name-feature-naming- Use domain-driven feature namesname-file-conventions- Use consistent file naming conventionsname-descriptive-exports- Use descriptive export names
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Individual rules:
references/{prefix}-{slug}.md
Related Skills
- For feature planning, see
feature-specskill - For data fetching, see
tanstack-queryskill - For React component patterns, see
react-19skill
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
What ships with it: 45 files
104.0 KB alongside SKILL.md
references/
- bound-event-based-communication.md2.6 KB
- bound-feature-isolation.md2.3 KB
- bound-feature-scoped-routing.md2.3 KB
- bound-feature-size.md2.3 KB
- bound-interface-contracts.md2.1 KB
- bound-minimize-shared-state.md2.2 KB
- fcomp-colocate-styles.md2.2 KB
- fcomp-composition-over-props.md2.4 KB
- fcomp-container-presentational.md2.5 KB
- fcomp-error-boundaries.md2.5 KB
- fcomp-props-as-data-boundary.md2.5 KB
- fcomp-single-responsibility.md2.6 KB
- fquery-avoid-n-plus-one.md2.3 KB
- fquery-colocate-with-feature.md2.0 KB
- fquery-feature-scoped-keys.md2.1 KB
- fquery-parallel-fetching.md2.2 KB
- fquery-server-component-fetching.md2.3 KB
- fquery-single-responsibility.md2.0 KB
- fstate-context-sparingly.md2.1 KB
- fstate-feature-scoped-stores.md2.2 KB
- fstate-lift-minimally.md2.3 KB
- fstate-reset-on-unmount.md2.3 KB
- fstate-server-state-separation.md2.6 KB
- import-avoid-barrel-files.md2.0 KB
- import-no-cross-feature.md2.4 KB
- import-path-aliases.md1.8 KB
- import-public-api.md2.0 KB
- import-type-only.md2.1 KB
- import-unidirectional-flow.md2.2 KB
- name-descriptive-exports.md2.0 KB
- name-feature-naming.md1.9 KB
- name-file-conventions.md2.3 KB
- _sections.md1.5 KB
- struct-app-layer.md2.0 KB
- struct-feature-folders.md2.0 KB
- struct-feature-self-contained.md1.8 KB
- struct-flat-hierarchy.md1.6 KB
- struct-optional-segments.md1.9 KB
- AGENTS.md9.2 KB
- metadata.json940 B
5 more files not listed here. See all 45 in the repository.