docs-location

A repository rule for documentation pages written in MDX, a Markdown format that can include interactive components.

In plain words
What is it for?
Use it when creating or organizing documentation pages, guides, integrations, plugins, reference material, and environment specifications.
Why use it?
It prevents documentation files from being placed outside the project’s designated documentation directory and keeps the sidebar structure organized.

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/dmno-dev/varlock/docs-location
Clone the repo
git clone --depth 1 https://github.com/dmno-dev/varlock

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 987 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.00987
Opus 5 $0.00000 $0.00494
Sonnet 5 $0.00000 $0.00197
Haiku 4.5 $0.00000 $0.00099

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

Security

Grade A, and why

docs-location 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/docs-location.mdc · 114 lines

How it starts

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

Documentation Pages Location

Rules for placing and organizing documentation pages in the repository.

actions:

  • type: reject conditions:

    • pattern: "^(?!packages/varlock-website/src/content/docs/.*\.mdx$)" message: "Documentation pages (.mdx) must be placed in the packages/varlock-website/src/content/docs directory"
  • type: suggest message: | When creating documentation pages:

    1. Always place documentation files under packages/varlock-website/src/content/docs/:

      packages/varlock-website/src/content/docs/
      ├── getting-started/
      ├── guides/           # how-to guides (nested by topic in the sidebar)
      ├── integrations/     # frameworks, languages, platforms
      ├── plugins/          # secret backends
      ├── reference/        # CLI + schema language
      └── env-spec/
      
    2. Top-level sections become sidebar tabs (Astro docs pattern), configured in packages/varlock-website/src/sidebar.ts and rendered by TabbedSidebar.astro:

      • Getting Started - Onboarding (keep short)
      • Guides - How-to guides, nested into Core / Encryption and delivery / AI and agents / Ops and migration
      • Reference - CLI, schema language, and @env-spec
      • Ecosystem - Integrations and Plugins (nested catalogs)

      Within a tab, nest subgroups so no level has more than ~8–10 siblings.

    3. File naming:

      • Use kebab-case for filenames
      • Always use .mdx
      • Prefer a parent overview page plus children when a topic has independent H2 sections (CLI command groups, per-sandbox-tool, local vs remote MCP, etc.)
    4. Never place documentation files:

      • In the project root
      • Outside packages/varlock-website/src/content/docs/
      • Under guides/ for Docker (use integrations/docker)
    5. Update the sidebar in packages/varlock-website/src/sidebar.ts:

      • Every page must have a corresponding sidebar entry

      • Add the page under the correct nested subgroup (do not append to a flat 15+ item list)

      • Aim for ≤8–10 siblings at any nesting level

      • Example (page under Guides > Core):

        {
          label: 'Guides',
          items: [
            {
              label: 'Core',
              collapsed: true,
              items: [
                { label: 'Schema', slug: 'guides/schema' },
                { label: 'New Feature', slug: 'guides/new-feature' },
              ],
            },
          ],
        }
        

        Top-level labels must stay one of: Getting Started, Guides, Reference, Ecosystem (they render as the tab switcher). Do not add a fifth top-level group without updating TabbedSidebar.astro icons.

    6. If the page is a plugin or integration, also update homepage tiles in packages/varlock-website/src/lib/works-with-tiles.ts when it should appear on the homepage.

examples:

  • input: |

    Bad: Documentation file in wrong location

    docs/my-guide.mdx my-guide.mdx src/content/my-guide.mdx

    Good: Documentation file in correct location

    packages/varlock-website/src/content/docs/guides/my-guide.mdx output: "Correctly placed documentation file"

  • input: |

    Bad: Flat dump into Guides with 20 siblings

    Added guides/new-ai-thing.mdx at the end of the Guides items array

    Good: Nested under the right subgroup

    Added under Guides > AI and agents in sidebar.ts

    output: "Documentation file nested in the correct sidebar subgroup"

Read the full file on GitHub · 114 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 · 114 lines · 987 tokens per session scan A 7654b0fd0ccb

Subscribe to this mod's changes

docs-location is a cursor rule published in the GitHub repository dmno-dev/varlock (4,238 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 987 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.