Multi-Product Context System

March 9, 2026 ยท View on GitHub

Stop explaining your codebase architecture to AI every session.

Two Cursor rules and one lean tracker that give every AI agent instant context about your multi-product workspace. No setup beyond copying files. Works with Cursor and any AI coding tool that supports rules files.

The Problem

If you're building more than one product (or a monorepo with multiple apps), you know this pain:

  • Every new AI session starts with "which codebase is this? what's the directory structure?"
  • You waste 5-10 minutes re-explaining your architecture before any real work happens
  • TODO tracking is scattered across multiple stale files
  • Agents don't know what's in progress, what's next, or what just shipped
  • Context from previous sessions is lost

What It Does

Product Context Rule (product-context.mdc): Loads your full product map into every AI session automatically. The agent knows from line 1 which products exist, where their code lives, what domains they serve, and what shared infrastructure they use.

TODO Sync Rule (todo-master-sync.mdc): Instructs the AI to check and update a lean work tracker at the start and end of every session. Agents mark items "In Progress" when you start, "Completed" when you finish, and add new items when you create plans.

Lean Tracker (TODO_Master.md): One-screen view of what's active, what's next, and what just shipped. Max 30 items. Each item references its plan file and the agent session working on it, so you can resume anywhere.

Quick Setup

# 1. Copy the product context rule to your Cursor config
cp product-context.mdc ~/.cursor/rules/

# 2. Copy the TODO sync rule to your project
cp todo-master-sync.mdc your-project/.cursor/rules/

# 3. Copy the tracker template to your project
cp TODO_Master.md your-project/docs/

# 4. Edit product-context.mdc with your actual products

That's it. Next time you open a Cursor session, the AI will have your full product map and know what's in flight.

How It Works

flowchart TD
    SessionStart["New Cursor session"] --> LoadRules["product-context.mdc loads automatically"]
    LoadRules --> AgentKnows["Agent knows: products, directories, domains, infrastructure"]
    SessionStart --> SyncRule["todo-master-sync.mdc loads automatically"]
    SyncRule --> CheckTracker["Agent checks TODO_Master.md"]
    CheckTracker --> MarkInProgress["Marks current work 'In Progress'"]
    UserWorks["You work on features"] --> AgentUpdates["Agent updates tracker on completion"]
    AgentUpdates --> NextSession["Next session picks up where you left off"]

Two layers work together:

  1. product-context.mdc gives the agent your architecture map (which product = which directory = which domain)
  2. todo-master-sync.mdc keeps a lean tracker updated across sessions (what's active, what's next, what shipped)

File Descriptions

product-context.mdc

A Cursor rule with alwaysApply: true that contains your product map. Edit this once with your actual products:

  • Product names, domains, and directory paths
  • Shared infrastructure (database, auth, functions, storage)
  • Routing guide ("when the user says X, look in Y")

todo-master-sync.mdc

A Cursor rule that instructs agents to:

  • Check the tracker on session start
  • Mark items "In Progress" when working on them
  • Move items to "Recently Completed" with a date and summary when done
  • Add new items to "Up Next" when new plans are created

TODO_Master.md

A lean work tracker with three sections:

  • In Progress: What you're actively working on (with plan file references and agent IDs)
  • Up Next: Prioritized backlog (one line per item)
  • Recently Completed: What just shipped (with dates and summaries)

Max 30 items. When it grows beyond that, prune completed items to your session log.

Example Scenarios

Without Multi-Product Context

You: "Fix the gallery bug"
Agent: "Which gallery? What project? What framework? Can you show me the directory structure?"
You: "It's in the art app, which is a separate repo that deploys through the main project..."
Agent: "OK, and where are the Cloud Functions?"
You: "They're shared across all products in the main monorepo..."
(10 minutes of context-setting before any real work)

With Multi-Product Context

You: "Fix the gallery bug in the art app"
Agent: (already knows art app = ProductC/web/, shared functions = your-app/functions/)
Agent: "I see the gallery component at ProductC/web/src/components/Gallery.jsx. The issue is..."
(immediate productive work)

Session Continuity

Session 1: Agent marks "Auth Overhaul" as In Progress, works on it, notes "OAuth flow done, refresh tokens remaining"
Session 2: New agent reads TODO_Master.md, sees the status, picks up exactly where Session 1 left off

Customization

Adding More Products

Add a new section to product-context.mdc:

### Product D (Internal Tool)
- Domain: admin.yourcompany.com
- Web: your-app/admin/
- Purpose: Internal dashboards and tooling
- Key features: User management, analytics, moderation

And add to the routing guide:

- "Admin" / "internal" / "dashboard" โ†’ your-app/admin/

Product Abbreviations

Use short codes in the tracker for readability:

CodeProduct
AConsumer App
BBusiness Platform
CArt App
AllShared Infrastructure

Scaling to Many Products

The system works the same way whether you have a few products or dozens. The product context rule just gets longer. The tracker stays lean because each item is one line.

Design Decisions

  • Always-apply rules: Both .mdc files use alwaysApply: true so they load in every session without manual activation.
  • Lean tracker, not micro-tasks: The tracker holds epics and features, not sub-tasks. Sub-tasks live in plan files. This keeps it scannable.
  • Agent IDs for resumability: Each In Progress item notes which agent session owns it, so you can resume context by referencing the right transcript.
  • No dependencies: Pure markdown files. No packages, no build step, no config beyond editing the templates.
  • Privacy-first: The templates contain placeholder values. Your actual product names, domains, and infrastructure details stay local and never need to be shared.

Works With

  • Cursor (primary target; uses .cursor/rules/ directory)
  • Claude Code (uses CLAUDE.md for project context; adapt the product map into your CLAUDE.md)
  • Any AI coding tool that supports system prompts or project-level instructions

From the Creator

Built by Coy Byron (Valyss LLC), creator of Model Matchmaker, an open-source tool that routes your AI prompts to the right model and mode based on your prompt patterns.

Contributing

Open an issue or PR if you want to improve the templates, add examples for specific tech stacks, or adapt for other AI coding tools.

License

MIT