cursorrules

Repository instructions for an AI coding assistant working with ContextGit, a tool that links requirements and documentation to the code and tests. They define checks to run before and after changing documentation or requirements.

In plain words
What is it for?
Use them when adding or editing requirements and documentation, scanning the project index, checking outdated links, and keeping related records synchronized.
Why use it?
They reduce the risk of changing documentation without updating its links, identifiers, or related requirements.

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/mohamedsaleh14/contextgit/cursorrules
Clone the repo
git clone --depth 1 https://github.com/Mohamedsaleh14/ContextGit

Made for: Cursor.

Per session 421 This file is loaded in full into every session.
When invoked 421 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.00421 $0.00421
Opus 5 $0.00211 $0.00211
Sonnet 5 $0.00084 $0.00084
Haiku 4.5 $0.00042 $0.00042

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

Security

Grade A, and why

cursorrules 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.

.cursorrules · 53 lines

What it actually says

Cursor Rules for ContextGit

This Project Uses contextgit for Requirements Traceability

This repository is managed with contextgit. The AI assistant MUST follow these workflows:

When Making Changes to Requirements or Documentation

  1. BEFORE editing any file in docs/:

    • Run contextgit relevant-for-file <path> to understand related requirements
    • Run contextgit extract <ID> to get precise context for specific requirements
  2. AFTER editing any file in docs/:

    • Run contextgit scan docs/ --recursive to update the index
    • Run contextgit status --stale to check for broken links
    • If stale links found, update affected downstream items

When Adding New Requirements

  1. Generate a new ID: contextgit next-id <type>
    • Types: business, system, architecture, code, test, decision
  2. Add YAML frontmatter to the Markdown file with the generated ID
  3. Run contextgit scan docs/ --recursive to register it

When a Requirement Changes

  1. After editing, run contextgit scan docs/ --recursive
  2. Check for stale downstream items: contextgit status --stale --format json
  3. Update downstream items if needed
  4. Mark as synchronized: contextgit confirm <ID>

JSON Output for Parsing

Always use --format json when the output needs to be parsed:

contextgit show SR-010 --format json
contextgit status --stale --format json
contextgit extract SR-010 --format json

Detection

This is a contextgit project if .contextgit/config.yaml exists.

Project Info

  • Tool: contextgit v1.0.1
  • Purpose: Requirements traceability for LLM-assisted development
  • Index file: .contextgit/requirements_index.yaml
  • Config file: .contextgit/config.yaml
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 · 53 lines · 421 tokens per session scan A b75567c78f34

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository Mohamedsaleh14/ContextGit (10 stars, last pushed 9mo ago), licensed MIT. It adds 421 tokens to every session, about $0.0021 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.