Generate Scoped Cursor Rules for Project Architecture
Create targeted .cursorrules files that enforce strict architectural boundaries between frontend, API, and database layers to prevent code leaks.
Agent prompt for Claude and ChatGPT
Prompt
mkdir -p .agents/skills/generate-scoped-cursor-rules-for-project-architecture && curl -sL "https://prompts-gpt.com/prompts/generate-scoped-cursor-rules-for-project-architecture/raw" -o .agents/skills/generate-scoped-cursor-rules-for-project-architecture/SKILL.md---
name: generate-scoped-cursor-rules-for-project-architecture
description: "Create targeted .cursorrules files that enforce strict architectural boundaries between frontend, API, and database layers to prevent code leaks."
---
# Generate Scoped Cursor Rules for Project Architecture
Create targeted .cursorrules files that enforce strict architectural boundaries between frontend, API, and database layers to prevent code leaks.
## Prompt
```
Act as a Senior Software Architect. I need a set of strict rules for my project directory structure to enforce clean architecture. Please ask me these 3 questions first: 1. What are the main top-level directories in your project? 2. Are there specific directories that should never import from each other? 3. Do you have specific naming conventions for files in the API or database layers? Once I answer, provide a structured markdown response containing the .cursorrules content for each directory. Rules must follow these constraints: 1. Use glob patterns for all file path matching. 2. Explicitly forbid cross-tier imports for restricted directories. 3. Include a section for file naming patterns. 4. State the rules in clear, imperative sentences. Output format: For each folder, provide a code block titled with the directory name containing the rules. End with a summary of how these rules prevent common dependency cycles.
```
## Usage Notes
Use this in Cursor to generate custom .cursorrules files. Paste the output into the corresponding directories to ensure the AI composer follows your architectural constraints. Supported by Cursor, Claude, and ChatGPT.
Act as a Senior Software Architect. I need a set of strict rules for my project directory structure to enforce clean architecture. Please ask me these 3 questions first: 1. What are the main top-level directories in your project? 2. Are there specific directories that should never import from each other? 3. Do you have specific naming conventions for files in the API or database layers? Once I answer, provide a structured markdown response containing the .cursorrules content for each directory. Rules must follow these constraints: 1. Use glob patterns for all file path matching. 2. Explicitly forbid cross-tier imports for restricted directories. 3. Include a section for file naming patterns. 4. State the rules in clear, imperative sentences. Output format: For each folder, provide a code block titled with the directory name containing the rules. End with a summary of how these rules prevent common dependency cycles.Example output
Tips and common edits
Why this works
- Forces explicit glob patterns that Cursor interprets directly for file-level constraints.
- Uses imperative language to ensure the AI understands strict forbidden import paths.
- Prevents circular dependencies by creating clear, one-way architectural flows.
Use this in Cursor to generate custom .cursorrules files. Paste the output into the corresponding directories to ensure the AI composer follows your architectural constraints. Supported by Cursor, Claude, and ChatGPT.
Common edits
- Add specific file extensions if you only want to lint certain file types.
- Adjust the forbidden import paths if your project uses different alias patterns like @core or @shared.
Reuse it: Use in a workflowAdapt in the builder
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
More like this
Decompose Framework Migrations into Subagent Work Batches
You get a structured task graph that maps migration steps into isolated, low-risk subagent work batches with defined file boundaries and interface contracts.
Generate Architectural Guardrails for Autonomous Code Agents
Create a strictly defined AGENTS.md file that forces autonomous coding agents like Codex to adhere to your project's specific architectural constraints and style rules.
Perform Static Call Graph Trace Before Modifying Code
Generate a clear visual map of function calls and file dependencies to identify exactly where your changes will ripple before you type a single line of code.
Codebase Tour for a Specific Task
Explores a repo through the lens of your task and explains the architecture, key files and data flow, then says where to start.
Trace an execution path from entry to database
Map out the complete end-to-end execution path of a single user request across layers in an unfamiliar codebase.
Compare no-code automation versus custom scripts
Decide between no-code platforms and custom code scripts for a specific workflow based on maintenance, cost, and scale.
- Design a Scalable API Rate Limiting Architecture
- Plan an incremental refactor for legacy code
- Refactor Nested Excel Formulas with LET and LAMBDA
- Turn a 2D Floor Plan Into a 3D Furnished Cutaway View
- Should This Be an Agent? Single Agent, Workflow or Plain Script Decision
- Architecture Decision Record for a Technology Choice