component-organization

component-organization is a cursor rule for Cursor from innei-template/smart-webapp-template. It costs 5 tokens per session (574 once invoked), scanned A, original, MIT.

A set of rules for organizing React components by how widely they are reused and which feature they belong to. It separates general interface building blocks, shared app components, and feature-specific modules.

In plain words
What is it for?
Use it to decide whether a component belongs in `src/components/ui/`, `src/components/common/`, or a feature folder under `src/modules/`.
Why use it?
It makes component locations predictable and reduces the risk of mixing reusable interface code with business-specific code.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/innei-template/smart-webapp-template/component-organization
Clone the repo
git clone --depth 1 https://github.com/innei-template/smart-webapp-template

Made for: Cursor.

Per session 5 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 574 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00005 $0.00574
Opus 5 $0.00003 $0.00287
Sonnet 5 $0.00001 $0.00115
Haiku 4.5 $0.00001 $0.00057

Measured 3d ago against content hash 3e55da6f17f8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

component-organization scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/component-organization.mdc · 82 lines

How it starts

The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Component Organization

Follow this component architecture for consistent project structure:

Directory Structure

Base UI Components: src/components/ui/

  • Reusable primitives (buttons, inputs, modals, etc.)
  • Generic components that can be used across any application
  • Based on Radix UI primitives with custom styling
  • Examples: Button, Input, Select, Tooltip, Accordion

Common Components: src/components/common/

  • App-specific shared components
  • Components used across multiple features but specific to this app
  • Examples: ErrorElement, Footer, LoadRemixAsyncComponent, NotFound

Module Components: src/modules/

  • Feature-specific components organized by domain
  • Business logic components that belong to specific features
  • Examples: src/modules/feed/, src/modules/auth/, src/modules/user/

Component Placement Rules

Universal Componentssrc/components/ui/

  • If the component could be used in any React app
  • Pure UI components without business logic
  • Reusable across different domains

Feature Componentssrc/modules/{domain}/

  • If the component is specific to a business domain/feature
  • Contains domain-specific logic or data handling
  • Examples: FeedTimeline, UserProfile, AuthForm

App-Specific Sharedsrc/components/common/

  • If the component is used across features but specific to this app
  • Contains app-specific logic but used in multiple places

Path Aliases

Use ~/ for src/ imports (configured in tsconfig):

// Good
import { Button } from '~/components/ui/button'
import { UserProfile } from '~/modules/user/UserProfile'

// Avoid
import { Button } from '../../../components/ui/button'

Component Examples

// Universal UI component - goes in src/components/ui/
// File: src/components/ui/button/Button.tsx
export function Button({ children, ...props }) {
  return <button className="..." {...props}>{children}</button>
}

// Feature component - goes in src/modules/
// File: src/modules/feed/FeedTimeline.tsx
export function FeedTimeline() {
  // Feed-specific logic and UI
}

// App-specific shared - goes in src/components/common/
// File: src/components/common/AppHeader.tsx
export function AppHeader() {
  // App-specific header with navigation
}

Read the full file on GitHub · 82 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 82 lines · 5 tokens per session scan A 3e55da6f17f8

Subscribe to this mod's changes

component-organization is a cursor rule published in the GitHub repository innei-template/smart-webapp-template (142 stars, last pushed 7d ago), licensed MIT. It adds 5 tokens to every session and 574 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.