architecture — Claude Code & Cursor rule: keep ARCHITECTURE.md current
A rule that makes the agent rewrite ARCHITECTURE.md at the end of every task: changed function signatures, new files, the whole picture.
MIT ★ 528 updated 2025-08-21
.cursor/rules/architecture.mdcWhat architecture does
The rule fires as a task wraps up. The agent takes what changed across the app and writes it into ARCHITECTURE.md. New arguments or a different return value on a function? Those get rewritten. A file that did not exist before? It goes into the doc as well. No scripts sit behind it, just one instruction file.
Setup is a single file: .claude/rules/architecture.md for Claude, .cursor/rules/architecture.mdc for Cursor, .devin/rules/architecture.md for Windsurf, .clinerules/architecture.md for Cline. The rule is marked always-on, so it rides along with every request, whatever files the agent touches. That is why the doc gets edited even after a one-line fix.
What it helps with
- keep the architecture write-up in step with a refactor
- register a newly added file in
ARCHITECTURE.md - update a changed function signature in the doc
- give the agent one file to check project layout against
Example prompts for the agent
- Refactor
parse_config, change its arguments, then bringARCHITECTURE.mdup to date. - Add
src/cache.tsand list it inARCHITECTURE.md. - Wrap up the task and refresh the app architecture notes.
How to install architecture
Manually: put the files in place
.cursor/rules/architecture.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.claude/rules/architecture.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/architecture.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/architecture.mdManually: put the files in place
.clinerules/architecture.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about architecture
How do I install architecture in Cursor?
Create .cursor/rules/architecture.mdc and put the rule text inside.
What does architecture do?
It makes the agent record every change in ARCHITECTURE.md when a task ends, including function signatures and new files.
Does it run on every task?
Yes. It is marked as always applied, so it is active for any request, not just for certain files.
Source text
architecture.mdc · MIT
--- description: globs: alwaysApply: true --- At the end of each task, you need to write all changes to ARCHITECTURE.md. And by write all changes, I mean modify the architecture of the entire app. If you've changed a function - modify its params/output or whatever you changed. If you've added a new file - add it to the ARCHITECTURE.md.
© FutureExcited · MIT · FutureExcited/vibe-rules