agentleFS
20030419zhanghongyi20030419zhanghongyi/AI-Software-Engineering-Workflow-Template/.cursor/rules/architecture-rules.mdc

AI-Software-Engineering-Workflow-Template / rules

Cursor rule0 starsChanged 6 months agoMITView on GitHub

Architecture and module boundary rules

The file

We split this architecture-rules.mdc into the rules it gives an agent

6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When modifying code, follow this decision process:

    line 32
  2. Distinctive:

    Check if the file to modify belongs to that module.

    line 35
  3. Distinctive:

    If the file belongs to another module → STOP, report, request confirmation.

    line 36
  4. Distinctive:

    If you need cross-module access → only call the next layer's public interface.

    line 37
  5. Distinctive:

    If unsure which module a file belongs to → STOP and ask.

    line 38
  6. Distinctive:

    Update to the architecture document and decision log

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 6,809 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
architecture-rules.mdc
---
description: Architecture and module boundary rules
globs:
alwaysApply: true
---

# Architecture Rules

## Layer Architecture

```
UI Layer → Logic Layer → Data Layer → Platform Adaptation Layer
```

- Upper layers may call lower layers through their public interfaces.
- Lower layers MUST NOT call upper layers.
- Cross-layer calls are PROHIBITED (e.g., UI directly calling Data layer).

## Module Boundaries

Refer to `docs/05_module_boundaries.md` for the definitive module boundary definitions.

### Key Rules

- Each module has a clear responsibility and file scope.
- "What a module does NOT do" is as important as "what it does".
- File ownership must be defined at the directory level.
- AI must check file ownership before modifying any file.

## Boundary Check Process

When modifying code, follow this decision process:

1. Determine which module the current task belongs to.
2. Check if the file to modify belongs to that module.
3. If the file belongs to another module → STOP, report, request confirmation.
4. If you need cross-module access → only call the next layer's public interface.
5. If unsure which module a file belongs to → STOP and ask.

## Architecture Constraints

Architecture constraints defined in `docs/04_architecture.md` under "Key Constraints" and "Rules That Must Not Be Broken" MUST NOT be violated.

Any change that would violate these constraints requires:
1. Documentation of the proposed violation
2. Human approval
3. Update to the architecture document and decision log

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.