agentleFS
vibestackdevvibestackdev/vibe-stack/.cursor/rules/context-management.mdc

vibe-stack / rules

Cursor rule8 starsChanged 8 months agoMITView on GitHub

Context window management — prevents AI from losing track during long sessions

The file

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    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:

    If a feature requires changes to more than 4 files, break it into sequential sub-tasks.

    line 11
  2. Distinctive:

    If the conversation has been going for more than 5 turns, summarize what has been done and what remains before generating more code.

    line 23
  3. Distinctive:

    When discussing code, ALWAYS use the full path relative to the project root.

    line 36
  4. Distinctive:

    Do NOT mix unrelated changes in a single response.

    line 52
  5. Distinctive:

    If a rule file grows beyond that, split it into focused sub-rules.

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 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
context-management.mdc
---
description: Context window management — prevents AI from losing track during long sessions
globs: ["*"]
alwaysApply: false
---

# Context Management Rules

## RULE 1: Break Large Tasks Into Sub-Tasks

If a feature requires changes to more than 4 files, break it into sequential sub-tasks.
Complete and verify each sub-task before starting the next.

Example — "Add a blog feature with CRUD":
1. Sub-task 1: Database migration + RLS policies
2. Sub-task 2: Server Actions (create, read, update, delete)
3. Sub-task 3: UI components (list, detail, form)
4. Sub-task 4: Route handlers + API endpoints
5. Sub-task 5: Integration testing

## RULE 2: Summarize Before Continuing

If the conversation has been going for more than 5 turns, summarize
what has been done and what remains before generating more code.

Template:
```
Before continuing, let me summarize:
✅ Completed: [list of completed items]
🔄 In progress: [current item]
📋 Remaining: [list of remaining items]
```

## RULE 3: Reference Files By Full Path

When discussing code, ALWAYS use the full path relative to the project root.
This prevents confusion between similarly named files.

✅ CORRECT: "Update `src/app/dashboard/page.tsx`"
❌ WRONG: "Update the dashboard page"

✅ CORRECT: "Import from `@/lib/supabase/server`"
❌ WRONG: "Import the Supabase client"

## RULE 4: One Concern Per Message

Each AI message should address ONE concern clearly:
- ONE file modification with before/after
- ONE bug fix with explanation
- ONE new feature with complete implementation

Do NOT mix unrelated changes in a single response. This makes
review harder and increases the chance of introducing bugs.

## RULE 5: Keep Rule Files Under 150 Lines

Individual `.mdc` rule files should stay under 150 lines.
If a rule file grows beyond that, split it into focused sub-rules.

This mirrors the principle from production AI harnesses:
keep the index lightweight, put details in separate files.

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.