520-xml-structure

520-xml-structure is a cursor rule for Cursor from savagelysubtle/BIG-BRAIN-Memory-Bank. It costs 0 tokens per session (1,455 once invoked), scanned A, original, MIT.

A formatting rule for Cursor Rule files, which are Markdown files that tell Cursor how to work in a codebase. It recommends putting instructions into XML-like sections such as context, requirements, and examples.

In plain words
What is it for?
Use it when creating or editing `.mdc` Cursor Rule files, especially when organizing instructions for a particular type of code.
Why use it?
It helps keep rule files easy for people to read and for AI tools to interpret consistently.

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/savagelysubtle/big-brain-memory-bank/520-xml-structure
Clone the repo
git clone --depth 1 https://github.com/savagelysubtle/BIG-BRAIN-Memory-Bank

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 520-xml-structure

README.md
[![agentmods](https://agentmods.dev/badge/rules/savagelysubtle/big-brain-memory-bank/520-xml-structure.svg)](https://agentmods.dev/rules/savagelysubtle/big-brain-memory-bank/520-xml-structure)
Your own site
<a href="https://agentmods.dev/rules/savagelysubtle/big-brain-memory-bank/520-xml-structure"><img src="https://agentmods.dev/badge/rules/savagelysubtle/big-brain-memory-bank/520-xml-structure.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,455 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.01455
Opus 5 $0.00000 $0.00727
Sonnet 5 $0.00000 $0.00291
Haiku 4.5 $0.00000 $0.00145

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

Security

Grade A, and why

520-xml-structure 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 5d 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/Codebase/Patterns/520-xml-structure.mdc · 199 lines

How it starts

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


description: WHEN creating or editing Cursor Rule (.mdc) files ENSURE using proper XML structure for clarity and AI parsing globs: ["**/*.mdc"] alwaysApply: false

TL;DR: Provides guidance on using XML structure in Cursor Rules to improve clarity and help AI parse instructions effectively.

1.0.0

<structure-element>
  <tag>context</tag>
  <purpose>Explains when and why the rule applies</purpose>
  <example><![CDATA[<context>

This rule applies when working with React components. ]]>

<structure-element>
  <tag>requirements</tag>
  <purpose>Lists what must be followed when the rule is active</purpose>
  <example><![CDATA[<requirements>

Use functional components instead of class components Implement proper prop type validation Follow React hooks best practices ]]>

<structure-element>
  <tag>examples</tag>
  <purpose>Provides implementation examples</purpose>
  <example><![CDATA[<examples>
<structure-element>
  <tag>details</tag>
  <purpose>Contains detailed sections with specific information</purpose>
  <example><![CDATA[<details>

SECTION TITLE Detailed information about this section

<principle>
  <n>Place Critical Content First</n>
  <description>Organize sections in descending order of importance</description>
  <steps>
    <step>Essential requirements first</step>
    <step>Implementation details next</step>
    <step>Examples and edge cases last</step>
  </steps>
</principle>

<principle>
  <n>Progressive Disclosure</n>
  <description>Reveal information based on complexity and importance</description>
  <steps>
    <step>Start with the most essential instructions</step>
    <step>Add details in subsequent sections</step>
    <step>Place edge cases and rare scenarios at the end</step>
  </steps>
</principle>

Read the full file on GitHub · 199 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. 5d ago First seen · 199 lines · 0 tokens per session scan A 13a0ddabf8e6

Subscribe to this mod's changes

520-xml-structure is a cursor rule published in the GitHub repository savagelysubtle/BIG-BRAIN-Memory-Bank (5 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,455 tokens. 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.