Skip to main content
rule

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

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/architecture.mdc
Open on GitHub

What 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 bring ARCHITECTURE.md up to date.
  • Add src/cache.ts and list it in ARCHITECTURE.md.
  • Wrap up the task and refresh the app architecture notes.

How to install architecture

Manually: put the files in place

.cursor/rules/architecture.mdc

Frontmatter: description, globs, alwaysApply

Step 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

Similar IDE rules

All IDE rules for Agent setup: memory, context, orchestration →

From the same set2

More in the catalog

Project sponsors

Companies that keep this analytics open