structure

structure is a cursor rule for Cursor from BOXELS/cursor-rules. It costs 984 tokens per session, scanned A, original, MIT.

A set of rules for deciding where new files and features belong in a project. It describes folders for source code, shared code, tests, documentation, and database changes.

In plain words
What is it for?
It helps place new components, feature logic, tests, configuration, documentation, and database migrations consistently.
Why use it?
It prevents files from being scattered across the project and makes the codebase easier to navigate.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions AGENTS.md; mentions Cursor.

Good fit It helps place new components, feature logic, tests, configuration, documentation, and database migrations consistently.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/boxels/cursor-rules/structure
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.

Clone the repo
git clone --depth 1 https://github.com/BOXELS/cursor-rules

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for structure

README.md
[![agentmods](https://agentmods.dev/badge/rules/boxels/cursor-rules/structure/github.svg)](https://agentmods.dev/rules/boxels/cursor-rules/structure)
Your own site
<a href="https://agentmods.dev/rules/boxels/cursor-rules/structure"><img src="https://agentmods.dev/badge/rules/boxels/cursor-rules/structure/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for structure

Your own site · 80×15
<a href="https://agentmods.dev/rules/boxels/cursor-rules/structure"><img src="https://agentmods.dev/badge/rules/boxels/cursor-rules/structure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 984 This file is loaded in full into every session.
When invoked 984 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00984 $0.00984
Opus 5 $0.00492 $0.00492
Sonnet 5 $0.00197 $0.00197
Haiku 4.5 $0.00098 $0.00098

Measured yesterday against content hash c8c1f217f625, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-16, from the pricing page.

Security

Grade A, and why

structure 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 yesterday.

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/structure.mdc · 62 lines

How it starts

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

Structure Rules

Project layout

[project-root]/
├── [src or app directory]/
│   ├── [features or modules]/      # Feature-based grouping
│   │   ├── [feature-name]/
│   │   │   ├── [components]/       # Feature-specific components
│   │   │   ├── [hooks or utils]/   # Feature-specific logic
│   │   │   └── [tests]/            # Feature-specific tests
│   ├── [shared or common]/         # Shared utilities, types, constants
│   ├── [components]/               # Shared/global UI components
│   └── [styles or theme]/          # Global styles or theme configuration
├── [api or server directory]/      # API routes, server actions, or backend
├── [public or static]/             # Static assets
├── [config]/                       # Configuration files
├── [tests or __tests__]/           # Global/integration tests
├── [docs]/                          # Agent-facing reference docs (architecture, features)
└── [database or migrations]/       # Database schema and migrations

File placement rules

  • New features go in [feature directory path, e.g. "src/features/[feature-name]/", "app/(routes)/[feature-name]/"]. Each feature directory contains its own components, hooks, utils, and tests.
  • Shared components used by 2+ features go in [shared components path, e.g. "src/components/", "src/shared/components/"].
  • Utility functions go in [utils path, e.g. "src/lib/", "src/utils/", "src/shared/utils/"].
  • Type definitions go in [types path, e.g. "src/types/", "co-located with the feature that owns them", "src/shared/types/"].
  • API routes go in [API path, e.g. "app/api/", "src/pages/api/", "server/routes/"].
  • Database migrations go in [migration path, e.g. "supabase/migrations/", "prisma/migrations/", "alembic/versions/"].
  • Agent/reference documentation goes in [doc folder, e.g. "docs/"] — see documentation.mdc for naming and the "update docs" trigger.
  • Test files go [test location, e.g. "next to the file they test with .test.ts suffix", "in a tests/ directory mirroring src/", "in a top-level tests/ directory"].
  • Configuration files (env, linting, build) stay in the project root.
  • Cursor rules live in .cursor/rules/ as .mdc files with YAML frontmatter (description, alwaysApply, optional globs). Plain .md files in that folder are ignored by Cursor — never create a rule with a .md extension.
  • Cursor skills (multi-step, on-demand workflows) live in .cursor/skills/<skill-name>/SKILL.md. Use a rule for a short standing instruction; use a skill for a repeatable procedure the agent runs when asked.
  • AGENTS.md at the project root is a thin pointer for non-Cursor agents. Don't duplicate rule content into it.

Read the full file on GitHub · 62 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. yesterday First seen · 62 lines · 984 tokens per session scan A c8c1f217f625

Subscribe to this mod's changes

structure is a cursor rule published in the GitHub repository BOXELS/cursor-rules (6 stars, last pushed yesterday), licensed MIT. It adds 984 tokens to every session, about $0.0049 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-09-15.

Related

Other cursor rules, from other repositories

slice-tasks

PLANNING SPINE STEP 2 of 3 — Slice the work: break a scoped PRD into vertical-slice stories in specs/epics/. Use after scope-work (step 1), before plan-work (step 3). Not a substitute for scope-work or plan-work.

danielvm-git/bigpowers · 59 tokens

iris

GitHub operations specialist — branches, pull requests, issues, releases, tags. Called by zeus after review. Never pushes or merges without explicit human approval. Integrates with VS Code GitHub Pull Requests extension.

ils15/pantheon-legacy · 43 tokens

elite-orchestrator

Elite orchestrator for mission-critical, enterprise-scale tasks requiring strategic coordination of 7+ agents across all domains. Makes architectural decisions, manages risk, ensures business continuity, and delivers enterprise-grade outcomes. Use for platform migrations, security incidents, multi-system integrations…

MN-Lizard-Team/aiyu-multi-agent · 94 tokens

feedback-enhanced

Rules for an interactive feedback system that lets users and an AI agent discuss complex development work in real time. It includes guidance for recording decisions, tracking progress and handling detailed inputs such as code and diagrams.

Mr-chen-05/rules-2.1-optimized · 2,968 tokens

project-onboarding-rule

Automatically onboards existing projects into the AI-driven development workflow.

brunogama/ios-cursor-rules · 1,324 tokens

linear-in-review

After finishing a Linear issue, set its status to In Review (never Done).

nate-raubenheimer/lawpracticeza-mcp · 235 tokens