main

The main instruction file for an adaptive Memory Bank system, which stores project context between coding sessions.

In plain words
What is it for?
Use it to guide task setup, documentation, planning, implementation, reflection, and archiving across projects.
Why use it?
It defines how to check important files and adjust the amount of planning and documentation to the task's size.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/kfnzero/mantis-mcp-server/main
Clone the repo
git clone --depth 1 https://github.com/kfnzero/mantis-mcp-server

Made for: Cursor.

Per session 2,586 This file is loaded in full into every session.
When invoked 2,586 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02586 $0.02586
Opus 5 $0.01293 $0.01293
Sonnet 5 $0.00517 $0.00517
Haiku 4.5 $0.00259 $0.00259

Measured 2d ago against content hash 79f36113f494, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

main scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/main.mdc · 331 lines

How it starts

The opening of the file, as written. The whole thing — 331 lines — stays where its author put it; the contents beside it link to each section on GitHub.

🔍 ADAPTIVE MEMORY-BASED ASSISTANT SYSTEM

TL;DR: I am an AI with memory that resets between sessions. I use a structured Memory Bank to maintain context. The system scales across four complexity levels from quick bug fixes to complex systems, adapting the process to match task requirements while maintaining essential documentation.

🚨 PLATFORM IDENTIFICATION - FIRST STEP

Before proceeding with any task, identify the operating system:

### Platform Detection
Current environment: [Windows/Mac/Linux]
Command adaptations required: [Yes/No]

🚨 CRITICAL FILE VERIFICATION - SECOND STEP

Verify critical file types (NOT directories):

### File Type Verification
.cursorrules: [File exists/File missing/ERROR: Is a directory]
memory-bank: [Directory exists/Directory missing]
docs/archive: [Directory exists/Directory missing]
tasks.md: [File exists/File missing]

Creating any missing files (NOT directories):

🚨 ADAPTIVE COMPLEXITY LEVELS

Match process complexity to task requirements:

  1. Level 1: Quick Bug Fix

    • Simple errors, UI glitches, minor issues
    • Streamlined process with targeted documentation
    • 2-3 task updates (start/fix/end)
    • Focus: Fix the specific issue
  2. Level 2: Simple Enhancement

    • Small features, minor improvements
    • Basic process with essential documentation
    • 4-6 task updates at key milestones
    • Focus: Clean implementation with clear documentation
  3. Level 3: Intermediate Feature

    • Complete features, significant changes
    • Standard process with full section tracking
    • 8-12 task updates at defined points
    • Focus: Comprehensive planning and documentation
  4. Level 4: Complex System

    • Major systems, architectural changes
    • Full formal process with detailed checkpoints
    • 15+ task updates with formal verification
    • Focus: Architectural integrity and complete documentation

🚨 MISSION-CRITICAL ESSENTIALS

  1. Memory Bank Files - Create/update based on task complexity:
    • projectbrief.md - Core requirements
    • productContext.md - Project purpose
    • activeContext.md - Current focus
    • systemPatterns.md - Architecture
    • techContext.md - Tech stack
    • progress.md - Status & reflections
    • tasks.md - SINGLE SOURCE OF TRUTH for all task tracking

Read the full file on GitHub · 331 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 331 lines · 2,586 tokens per session scan A 79f36113f494

Subscribe to this mod's changes

main is a cursor rule published in the GitHub repository kfnzero/mantis-mcp-server (10 stars, last pushed 12mo ago), licensed MIT. It adds 2,586 tokens to every session, about $0.0129 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.