npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-gradual-architecture

v1.0.1

Published

Incremental React architecture guidelines as an agent skill

Readme

React Gradual Architecture

Incremental React code organization guidelines for AI-assisted development

An agent skill that helps you organize React code without over-structuring. The core philosophy: start small (one file), extract only when it improves clarity or reuse.

Overview

This skill provides 12 practical rules across 5 categories to help you:

  • Create new React features without premature structure
  • Organize component files and folders incrementally
  • Refactor growing components at the right time
  • Decide when to extract hooks, UI, or utils
  • Structure feature directories and shared code

Key principle: Apply the smallest change that restores clarity. Extract only when it improves readability or enables reuse.

Installation

Install this skill in your AI coding environment:

npx add-skill vandriesh/react-gradual-architecture

Or manually add to your .cursor/skills/ or equivalent directory.

Quick Start

When working with AI coding assistants, use prompts like:

Create a new React authentication feature following @react-gradual-architecture principles
Refactor this component using @react-gradual-architecture guidelines

The skill will guide the AI to:

  1. Start in a single file
  2. Extract only when scanning becomes difficult
  3. Organize by feature, not by type
  4. Keep state local, lift only when needed

Rules Summary

Foundation (CRITICAL)

  • Framework conventions - Keep domain code framework-agnostic

Starting (CRITICAL)

  • Start small - Begin features in a single file
  • Component composition - Prefer composition over configuration

Organization & Structure (HIGH)

  • Features folder - Place features under src/features/<feature>/
  • Locality - Keep related files close to the feature
  • Reuse boundaries - Wait for the second use before extracting
  • Feature README - Document structure and specifications

Extraction (MEDIUM)

  • Extract when scrolling - If scanning is difficult, extract
  • Hooks vs functions - Hooks for React logic, plain functions for everything else
  • UI/logic/utils - Extract when concerns diverge
  • Container/presentational - Separate data from UI when needed

Data & State (MEDIUM)

  • Types placement - Define types where data is born
  • State placement - Keep state local, lift only as high as needed

Documentation

  • SKILL.md - Quick reference guide for AI agents
  • AGENTS.md - Comprehensive guide with detailed examples (1000+ lines)
  • rules/ - Individual rule files with edge cases
  • examples/PROMPTS.md - Example prompts for common tasks

Compatibility

  • React
  • Works with Cursor, GitHub Copilot, and other AI coding assistants

Examples

Creating a new feature

Create a user profile feature following @react-gradual-architecture:
- Start in a single file
- Add display and edit functionality
- Handle data fetching

The AI will create a single UserProfile.tsx file and only extract when the file grows beyond ~100 lines or concerns diverge.

Refactoring existing code

Refactor this 300-line component using @react-gradual-architecture principles:
- Extract when scanning (comprehending) becomes difficult
- Separate UI from data logic
- Keep types where data is born

See examples/PROMPTS.md for more examples.

Philosophy

This skill embraces gradual architecture - the idea that structure should emerge from needs, not be imposed upfront:

  1. Start simple - One file is enough to begin
  2. Extract when needed - Let pain points guide extraction
  3. Organize by domain - Feature folders, not technical folders
  4. Keep things close - Locality reduces cognitive load
  5. Wait for patterns - Second use reveals the right abstraction

Contributing

Contributions welcome! Please feel free to submit issues or pull requests.

License

MIT License - see LICENSE file for details.

Author

Created by @vandriesh

Resources