markdown-formatting

A set of writing rules for Markdown and MDX documentation pages. MDX is Markdown that can also contain interactive components, such as tabs, in a documentation website.

In plain words
What is it for?
It is for writing documentation pages with the required file types, HTML-style elements, US English, line limits, and sentence-based line breaks.
Why use it?
It keeps documentation files consistent and compatible with the site that publishes them. The rules reduce formatting differences, broken components, and noisy line changes.

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/consensys/doc.linea/markdown-formatting
Clone the repo
git clone --depth 1 https://github.com/Consensys/doc.linea

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 741 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.00741
Opus 5 $0.00000 $0.00370
Sonnet 5 $0.00000 $0.00148
Haiku 4.5 $0.00000 $0.00074

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

Security

Grade A, and why

markdown-formatting 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/markdown-formatting.mdc · 87 lines

How it starts

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

Markdown formatting

File format

  • Use .mdx for all pages under docs/ (not .md), so React components and Docusaurus elements (like <Tabs>) render correctly. This rule doesn't apply to root-level files such as this repo's own README.mdx/CONTRIBUTING.md.
  • Prefer HTML-like formatting over plain Markdown syntax for elements like tables (use <table> rather than pipe/dash Markdown tables). Several elements already require HTML syntax (<Tabs>, images), so using it everywhere avoids mixing both styles on one page.

Line wrapping

  • Default to US English usage.
  • Respect the 100-character line limit from .editorconfig. Use the full 100 characters before wrapping. Don't break lines early at convenient points, and only wrap when a line would actually exceed the limit.
  • Never break words or URLs when wrapping a line.
  • Use semantic line breaks: start each new sentence on a new line, even when it would still fit within the 100-character limit on the previous line. This is independent of the wrap rule above and keeps future diffs scoped to the sentence that changed.

Headings

  • Don't add a top-level # Heading unless you want the rendered page heading to read differently from the frontmatter title (Docusaurus pulls title for the sidebar label, not the H1).

Frontmatter

Every page needs YAML frontmatter with at least title and description:

---
title: Title of the article
description: Description of the article
---

Don't add an image field manually: the social card is generated automatically on build.

  • Link to other docs pages with site-relative paths and no .mdx extension (for example, ./transaction-finality, not ./transaction-finality.mdx).
  • The ](/ pattern is an absolute link; ](./ and ](../ are relative links. Prefer relative links within the same tab.
  • Use descriptive link text embedded in the sentence. Don't use "click here" or a bare URL.
  • If you move or rename a page, see .cursor/rules/contributor-workflow.mdc for the redirects.json requirement.

Read the full file on GitHub · 87 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 · 87 lines · 0 tokens per session scan A 216635ed4c46

Subscribe to this mod's changes

markdown-formatting is a cursor rule published in the GitHub repository Consensys/doc.linea (474 stars, last pushed 5d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 741 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-30.