pre-edit-reading

pre-edit-reading is a cursor rule for Cursor from AlphaBitCore/nexus-gateway. It costs 609 tokens per session, scanned A, original, Apache-2.0.

A rule requiring three kinds of documentation to be read before changing code: architecture, user-facing feature details, and coding conventions.

In plain words
What is it for?
Use it before implementing code changes, especially changes affecting architecture or what users see.
Why use it?
It reduces changes that conflict with the system design, documented behavior, or established project practices.

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/alphabitcore/nexus-gateway/pre-edit-reading
Clone the repo
git clone --depth 1 https://github.com/AlphaBitCore/nexus-gateway

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 pre-edit-reading

README.md
[![agentmods](https://agentmods.dev/badge/rules/alphabitcore/nexus-gateway/pre-edit-reading.svg)](https://agentmods.dev/rules/alphabitcore/nexus-gateway/pre-edit-reading)
Your own site
<a href="https://agentmods.dev/rules/alphabitcore/nexus-gateway/pre-edit-reading"><img src="https://agentmods.dev/badge/rules/alphabitcore/nexus-gateway/pre-edit-reading.svg" alt="Measured on agentmods" height="20"></a>
Per session 609 This file is loaded in full into every session.
When invoked 609 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.00609 $0.00609
Opus 5 $0.00304 $0.00304
Sonnet 5 $0.00122 $0.00122
Haiku 4.5 $0.00061 $0.00061

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

Security

Grade A, and why

pre-edit-reading 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 4d 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/pre-edit-reading.mdc · 47 lines

How it starts

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

Pre-edit reading — binding 3-doc requirement

Before writing any code change, you MUST read all three of:

  1. Architecture doc(s) — find your edit area in docs/developers/architecture/README.md and open the listed doc(s).
  2. Feature doc(s) — if the change affects a user-visible surface, open the matching doc:
    • CP-UI menu sections → docs/users/features/cp-ui/<section>.md
    • Agent-UI pages → docs/users/features/agent-ui/<page>.md
    • Cross-feature flows (admin → CP → Hub → effect → audit) → docs/users/features/flows/<flow>.md
  3. Conventionsdocs/developers/workflow/conventions.md for code style, naming, idioms, commit style, PR review checklist.

This rule keeps three things from drifting apart:

  • Architecture (what the code is supposed to do structurally).
  • User-facing surface (what the human-readable contract looks like).
  • Code style (so the change reads consistently with the rest of the repo).

A change that lands without consulting all three is the failure mode that causes architecture rot under new contributors.

How to apply

When the user asks you to edit code:

  1. Read docs/developers/architecture/README.md → find row matching the edit area → open the listed architecture doc(s).
  2. Identify the affected user-facing surface (if any) and open the matching feature doc.
  3. Open docs/developers/workflow/conventions.md if you have not internalised it for this language.
  4. Then write code.

What if a doc is missing?

  • No architecture doc for the edit area → raise it with the user. Either the architecture is genuinely undocumented (start a new arch doc + trigger row in the same PR) or it's a small piece of an existing area and the relevant arch doc covers it implicitly.
  • No feature doc for a user-visible change → raise it with the user. If you're adding a new CP-UI section or Agent-UI page, add the feature doc in the same PR.
  • No conventions for what you're doing → if your work is genuinely a new style decision (e.g., introducing a third UI tier), raise it and propose an addition to docs/developers/workflow/conventions.md.

Read the full file on GitHub · 47 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. 4d ago First seen · 47 lines · 609 tokens per session scan A 9ee2767e94e4

Subscribe to this mod's changes

pre-edit-reading is a cursor rule published in the GitHub repository AlphaBitCore/nexus-gateway (23 stars, last pushed 2d ago), licensed Apache-2.0. It adds 609 tokens to every session, about $0.0030 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-30.