Agent skill

Cursor Reference Architecture

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Reference architecture for Cursor IDE projects: directory structure, rules organization, indexing strategy, and team configuration patterns.

MITAuto-check: notesDevelopment

Install Cursor Reference Architecture

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill cursor-reference-architecture -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace cursor-reference-architecture --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/cursor-reference-architecture .claude/skills/cursor-reference-architecture && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cursor-reference-architecture
GitHub stars
2.8k
Token cost
~2.4k tokens
SKILL.md length
432 words
Files
8 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Reference architecture for Cursor IDE projects: directory structure, rules organization, indexing strategy, and team configuration patterns.

  • Works in 4 steps: Put durable engineering conventions in… → Scope rules by repository area and avoid… → Test rule and indexing changes in a… → …
  • Cursor architecture
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 9 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Cursor Reference Architecture is an agent skill from jeremylongshore/tons-of-skills-marketplace. Reference architecture for Cursor IDE projects: directory structure, rules organization, indexing strategy, and team configuration patterns. Triggers on "cursor architecture", "cursor project structure", "cursor best practices", "cursor file structure".

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including reference files (for example `references/configuration-file-architecture.md`, `references/errors.md` and `references/examples.md`). Compatibility notes: Designed for Claude Code

It sits in Development, covering Monorepo tooling. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Cursor architecture
  • Cursor project structure
  • Cursor best practices
  • Cursor file structure

Example prompts

  • “cursor architecture”
  • “cursor project structure”
  • “cursor best practices”
  • “/cursor-reference-architecture”

Requirements

  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(cmd:*)

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Put durable engineering conventions in reviewed rules and keep sensitive/generated paths in ignore files.
  2. Scope rules by repository area and avoid contradictory always-on instructions.
  3. Test rule and indexing changes in a representative workspace before organization-wide rollout.
  4. Review these files through normal pull requests with security and architecture owners when relevant.

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash(cmd:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are yaml and gitignore).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.cursor.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Cursor Reference Architecture loads about 2.4k tokens when it runs, and up to ~4.6k if it reads all its reference files. Until then it costs about 71 tokens; SKILL.md has 432 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~71
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:243
    .env*

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 432 words, ~2,358 tokens.

Download SKILL.mdSave it as .claude/skills/cursor-reference-architecture/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
cursor-reference-architecture
description
Reference architecture for Cursor IDE projects: directory structure, rules organization, indexing strategy, and team configuration patterns. Triggers on "cursor architecture", "cursor project structure", "cursor best practices", "cursor file structure".
allowed-tools
Read, Write, Edit, Bash(cmd:*)
compatibility
Designed for Claude Code
version
1.19.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, cursor, cursor-reference

Cursor Reference Architecture

Overview

Organize Cursor rules, ignore files, repository guidance, and workspace boundaries so AI assistance follows architecture rather than inventing it.

Prerequisites

  • An approved repository architecture, ownership model, and data-classification policy.
  • Maintainers authorized to review .cursor/rules, ignore files, and shared templates.

Instructions

  1. Put durable engineering conventions in reviewed rules and keep sensitive/generated paths in ignore files.
  2. Scope rules by repository area and avoid contradictory always-on instructions.
  3. Test rule and indexing changes in a representative workspace before organization-wide rollout.
  4. Review these files through normal pull requests with security and architecture owners when relevant.

Output

  • A versioned Cursor configuration that maps rules and context boundaries to real repository ownership.

Error Handling

ConditionSafe response
Rules conflictReduce them to one authoritative rule and test in a small workspace.
Sensitive paths are indexedAdd an ignore rule, verify exclusion, and evaluate exposure according to policy.
A shared template breaks a repoRevert the configuration change and use a scoped repository override.

Examples

For a monorepo, commit a reviewed root rule for shared import conventions and scoped rules for each application. Add secrets, generated artifacts, and customer exports to ignore configuration, then verify a sample chat cannot attach those paths.

Reference architecture patterns for optimizing Cursor IDE project setup. Covers directory structure, rules organization, indexing strategy, and multi-project configuration for maximum AI effectiveness.

Project Layout for Cursor

A well-structured project makes AI features significantly more effective:

my-project/
├── .cursor/
│   └── rules/
│       ├── project.mdc          # alwaysApply: true (stack, conventions)
│       ├── security.mdc         # alwaysApply: true (security constraints)
│       ├── typescript.mdc       # globs: "**/*.ts,**/*.tsx"
│       ├── api-routes.mdc       # globs: "src/api/**/*.ts"
│       ├── database.mdc         # globs: "src/db/**/*.ts,prisma/**"
│       └── testing.mdc          # globs: "**/*.test.ts,**/*.spec.ts"
├── .cursorignore                # Exclude from AI + indexing
├── .cursorindexingignore        # Exclude from indexing only
├── .gitignore
├── src/
│   ├── api/                     # API routes
│   ├── services/                # Business logic
│   ├── db/                      # Database layer
│   ├── types/                   # Shared TypeScript types
│   ├── utils/                   # Utility functions
│   └── components/              # UI components
├── tests/
├── prisma/
├── docs/                        # Architecture docs (good for @Docs)
└── package.json
Show full SKILL.md (194 more words)Show less
Why This Structure Helps Cursor
  1. Glob patterns work predictably: src/api/**/*.ts cleanly scopes API rules
  2. @Files references are intuitive: @src/types/user.ts is discoverable
  3. Indexing is focused: clear separation of code vs build output vs data
  4. Rules inheritance: project-level always-on + directory-scoped rules

Rules Architecture

Layer 1: Always-On Global Rules
yaml
# .cursor/rules/project.mdc
---
description: "Core project context and conventions"
globs: ""
alwaysApply: true
---
# SaaS Dashboard Application

Stack: Next.js 15 (App Router), TypeScript 5.7, PostgreSQL 16, Prisma 6
Auth: NextAuth.js v5 with GitHub OAuth
Styling: Tailwind CSS 4
Testing: Vitest + Playwright
Package manager: pnpm

## Architecture Decisions
- Server Components by default, "use client" only when needed
- Repository pattern for database access
- Zod schemas for all external input validation
- Result types for error handling (never throw from services)
Layer 2: Security (Always-On)
yaml
# .cursor/rules/security.mdc
---
description: "Security constraints for all AI-generated code"
globs: ""
alwaysApply: true
---
# Security Requirements
- NEVER hardcode secrets, API keys, or passwords
- ALWAYS use parameterized queries (no string interpolation in SQL)
- ALWAYS validate and sanitize user input with Zod
- NEVER disable CORS, CSRF protection, or TLS verification
- Use httpOnly, secure, sameSite cookies for auth tokens
- Rate limit all public API endpoints
Layer 3: Technology-Specific (Glob-Scoped)
yaml
# .cursor/rules/react-components.mdc
---
description: "React component patterns"
globs: "src/components/**/*.tsx,app/**/*.tsx"
alwaysApply: false
---
# Component Standards
- Named exports only (no default exports)
- Props interface: {ComponentName}Props
- Use forwardRef for interactive components
- Colocate tests: Component.test.tsx next to Component.tsx
- Loading states: use Suspense boundaries, not conditional rendering
yaml
# .cursor/rules/api-routes.mdc
---
description: "API route handler patterns"
globs: "app/api/**/*.ts,src/api/**/*.ts"
alwaysApply: false
---
# API Route Standards
- All handlers wrapped in withAuth() middleware
- Input validation with Zod (parse body, params, query)
- Response shape: { data: T } or { error: string, code: string }
- HTTP status codes: 200 OK, 201 Created, 400 Bad Request, 401, 403, 404, 500
- Structured logging with requestId for traceability
yaml
# .cursor/rules/database.mdc
---
description: "Database access patterns"
globs: "src/db/**/*.ts,src/repositories/**/*.ts,prisma/**"
alwaysApply: false
---
# Database Conventions
- All queries via repository classes (never raw Prisma in API routes)
- Use transactions for multi-table writes
- Always include select/include to avoid over-fetching
- Pagination: cursor-based for lists, offset for admin tools
- Soft delete: use deletedAt timestamp, never hard delete user data
Layer 4: Manual Reference Rules
yaml
# .cursor/rules/deployment.mdc
---
description: "Deployment and infrastructure patterns"
globs: ""
alwaysApply: false
---
# Deployment
- Vercel for frontend, Railway for API
- Environment variables managed in Vercel/Railway dashboards
- Database migrations: `prisma migrate deploy` in CI
- Feature flags via LaunchDarkly

Reference manually with @Cursor Rules in Chat when discussing deployment.

Indexing Strategy

Optimized .cursorignore
gitignore
# Build output
dist/
build/
.next/
out/
.vercel/
.turbo/
coverage/

# Dependencies
node_modules/
.pnpm-store/

# Generated
*.min.js
*.min.css
*.d.ts.map
*.tsbuildinfo
pnpm-lock.yaml

# Data / Assets
*.csv
*.sql
*.sqlite
*.png
*.jpg
*.gif
*.svg
*.ico
*.woff
*.woff2
*.ttf

# Environment
.env*

# IDE
.vscode/
.idea/
.cursorindexingignore for Large References
gitignore
# Not indexed, but accessible via @Files
docs/api-spec.yaml
tests/fixtures/
scripts/migration-data/

Monorepo Architecture

Turborepo / pnpm Workspaces
monorepo/
├── .cursor/
│   └── rules/
│       ├── monorepo.mdc         # alwaysApply: true (shared conventions)
│       ├── shared-types.mdc     # globs: "packages/shared/**"
│       ├── api.mdc              # globs: "apps/api/**"
│       └── web.mdc              # globs: "apps/web/**"
├── .cursorignore
├── apps/
│   ├── api/
│   ├── web/
│   └── admin/
├── packages/
│   ├── shared/
│   ├── ui/
│   └── config/
├── turbo.json
└── pnpm-workspace.yaml

Key rule for monorepos:

yaml
# .cursor/rules/monorepo.mdc
---
description: "Monorepo import conventions"
globs: ""
alwaysApply: true
---
# Import Conventions
- Import shared types: import { User } from '@myorg/shared'
- Import UI components: import { Button } from '@myorg/ui'
- NEVER use relative paths across package boundaries
- Each package has its own tsconfig.json extending root

Configuration Files Summary

FileCommitted to GitPurpose
.cursor/rules/*.mdcYesAI behavior rules (team-shared)
.cursorignoreYesFile exclusion from AI + indexing
.cursorindexingignoreYesFile exclusion from indexing only
settings.json (Cursor)No (machine-local)Editor preferences
keybindings.json (Cursor)No (machine-local)Custom shortcuts

Enterprise Considerations

  • Rules as code: Treat .cursor/rules/ changes like infrastructure changes -- require PR review
  • Template repository: Create a company template repo with standard rules, ignore files, and onboarding docs
  • Compliance mapping: Map security rules to specific compliance controls (SOC 2 CC6.1, etc.)
  • Architecture documentation: Keep docs/ directory indexed so AI can reference architecture decisions via @Docs

Resources

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 7 other files (references) in skills/.curated/cursor-reference-architecture of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/configuration-file-architecture.md
  • references/errors.md
  • references/examples.md
  • references/monorepo-architecture.md
  • references/project-structure-patterns.md
  • references/team-configuration.md
  • references/workflow-architecture.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Cursor Reference Architecture next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cursor Reference Architecture compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cursor Reference Architecture this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2.4kAutomated safety check: NotesMIT
Nx Importnrwl/nx29k6 repos~3.5kAutomated safety check: PassMIT
Nx Workspacenomcopter/react-mosaic4.8k8 repos~1.9kAutomated safety check: PassCustom licence
Electron Multi-Process ArchitectureiOfficeAI/AionUi33k1 repos~1.8kAutomated safety check: PassApache-2.0
Nx Run Tasksnomcopter/react-mosaic4.8k8 repos~613Automated safety check: PassCustom licence
Astro Developerwithastro/astro63k1 repos~1.5kAutomated safety check: PassCustom licence

Similar skills

  • Nx Import

    nrwl/nx

    Import, merge, or combine repositories into an Nx workspace using nx import.

    29k GitHub starsUsed in 6 repos~3.5k tokens
    DevelopmentAuto-check passed
  • Nx Workspace

    nomcopter/react-mosaic

    Explore and understand Nx workspaces. An agent skill from nomcopter/react-mosaic.

    4.8k GitHub starsUsed in 8 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Tells the agent where new code belongs in an Electron multi-process project and which APIs each process may use, with rules for new bridges, services, agents and workers.

    33k GitHub starsUsed in 1 repo~1.8k tokens
    DevelopmentAuto-check passed
  • Nx Run Tasks

    nomcopter/react-mosaic

    Helps with running tasks in an Nx workspace. An agent skill from nomcopter/react-mosaic.

    4.8k GitHub starsUsed in 8 repos~613 tokens
    DevelopmentAuto-check passed
  • Astro Developer

    withastro/astro

    Official

    Comprehensive guide for developing in the Astro monorepo. An agent skill from withastro/astro.

    63k GitHub starsUsed in 1 repo~1.5k tokens
    DevelopmentAuto-check passed
  • Moves a package from another TryGhost repository into Ghost as an internal workspace package while keeping its Git history, with checkpoints for the steps that need an administrator.

    56k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Categories

Questions about Cursor Reference Architecture

What does Cursor Reference Architecture do?

Reference architecture for Cursor IDE projects: directory structure, rules organization, indexing strategy, and team configuration patterns. Cursor Reference Architecture is an agent skill from jeremylongshore/tons-of-skills-marketplace. Reference architecture for Cursor IDE projects: directory structure, rules organization, indexing strategy, and team configuration patterns.

When should I use Cursor Reference Architecture?

Cursor Reference Architecture fits situations like: Cursor architecture; Cursor project structure; Cursor best practices; Cursor file structure.

How do I install Cursor Reference Architecture in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill cursor-reference-architecture -a claude-code`. Or copy the skill folder (skills/.curated/cursor-reference-architecture in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/cursor-reference-architecture in your project. Claude Code loads it when a task matches its description.

How do I install Cursor Reference Architecture in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill cursor-reference-architecture -a codex`. Or copy the skill folder (skills/.curated/cursor-reference-architecture in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/cursor-reference-architecture in your project. Codex loads it when a task matches its description.

Can I use Cursor Reference Architecture in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill cursor-reference-architecture -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cursor-reference-architecture, .gemini/skills/cursor-reference-architecture, .github/skills/cursor-reference-architecture and .opencode/skills/cursor-reference-architecture in your project.

What does Cursor Reference Architecture need to run?

SKILL.md names no scripts, command-line tools or credentials: Cursor Reference Architecture is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(cmd:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Cursor Reference Architecture access the network?

SKILL.md names 1 domain. As links in the text: docs.cursor.com. This is read from the text; nothing was executed.

Is Cursor Reference Architecture safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Cursor Reference Architecture use?

Cursor Reference Architecture is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cursor Reference Architecture use?

About 2.4k tokens (SKILL.md is roughly 9.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.3k tokens, read only when the agent opens those files.

What are the alternatives to Cursor Reference Architecture?

Skills that share tags, products or a category with Cursor Reference Architecture: Nx Import (nrwl/nx, 29k stars), Nx Workspace (nomcopter/react-mosaic, 4.8k stars), Electron Multi-Process Architecture (iOfficeAI/AionUi, 33k stars) and Nx Run Tasks (nomcopter/react-mosaic, 4.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cursor Reference Architecture?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.