428-pre-task-rule-review

428-pre-task-rule-review is a cursor rule for coding agents from hamzaamjad/cursor-rules. It costs 0 tokens per session (1,317 once invoked), scanned A, original, MIT.

A project rule that tells an AI agent to find and apply relevant Cursor rules before starting a task. Cursor rules are written instructions that guide how an agent works in a code project.

In plain words
What is it for?
It helps agents discover documentation and choose applicable rules, especially in projects with information spread across many folders and files.
Why use it?
It reduces the chance that the agent misses project-specific instructions or has to correct its approach halfway through a task.

Cursor rule

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/hamzaamjad/cursor-rules/428-pre-task-rule-review
Clone the repo
git clone --depth 1 https://github.com/hamzaamjad/cursor-rules

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 428-pre-task-rule-review

README.md
[![agentmods](https://agentmods.dev/badge/rules/hamzaamjad/cursor-rules/428-pre-task-rule-review.svg)](https://agentmods.dev/rules/hamzaamjad/cursor-rules/428-pre-task-rule-review)
Your own site
<a href="https://agentmods.dev/rules/hamzaamjad/cursor-rules/428-pre-task-rule-review"><img src="https://agentmods.dev/badge/rules/hamzaamjad/cursor-rules/428-pre-task-rule-review.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,317 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.01317
Opus 5 $0.00000 $0.00659
Sonnet 5 $0.00000 $0.00263
Haiku 4.5 $0.00000 $0.00132

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

Security

Grade A, and why

428-pre-task-rule-review 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.

rules/400-patterns/428-pre-task-rule-review.mdc · 105 lines

How it starts

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


alwaysApply: true

pre-task-rule-review.mdc

  • Purpose: To ensure AI agents proactively review and apply relevant Cursor rules before beginning any task, preventing mid-task course corrections and ensuring consistent quality from project initiation. Empirical Impact: Pre-task rule application reduces rework by 60-75% and improves first-pass quality by 40%. Enhancement: Documentation discovery phase reduces context-gathering time by 70% for complex projects.

  • Requirements:

    1. Documentation Discovery Phase (Complex Projects Only):
      • Trigger: Projects with scattered context (>5 directories, multiple phases, or fragmented documentation)
      • Process: Execute systematic documentation mapping using parallel file reading
      • Identify: README files, methodology documents, architectural decisions, phase summaries
      • Map: Cross-references between documentation systems and implementation files
      • Catalog: Available context sources with relevance scoring
      • Output: Comprehensive context map for informed rule selection
    2. Rule Discovery Phase: At task initiation, identify 3-5 potentially relevant rules based on:
      • Task domain (analytics, engineering, integration, etc.)
      • Task type (refactoring, new development, debugging, etc.)
      • Technologies involved (Python, SQL, APIs, databases, etc.)
      • Complexity level (simple, moderate, complex)
      • Documentation context (from Phase 1 for complex projects)
    3. Rule Review Process:
      • Use fetch_rules tool to retrieve identified rule content
      • Extract key requirements, patterns, and validation criteria
      • Note any conflicts or overlaps between rules
      • Identify domain-specific guidelines (e.g., SQL best practices, API design)
    4. Application Strategy:
      • Integrate rule requirements into task planning phase
      • Reference specific rule sections when making design decisions
      • Use rule validation criteria as checkpoints during execution
      • Apply rule patterns proactively rather than reactively
    5. Rule Integration Examples:
      • Database work → Review sql-correctness.mdc, sql-performance.mdc
      • Python development → Apply python-clean-code.mdc, code-generation-patterns.mdc
      • API integration → Follow api-design-guidelines.mdc, backend-security.mdc
      • Complex tasks → Apply stepwise-autonomy.mdc, 80-20-prioritization.mdc
      • Complex projects → Execute documentation discovery before rule selection
  • Validation:

    • Check: Were relevant rules identified before task execution began?
    • Check: Are rule requirements integrated into the task plan?
    • Check: Do implementation decisions reference specific rule guidance?
    • Check: Are rule validation criteria applied as checkpoints?
    • Complex projects: Was documentation discovery completed before rule selection?
  • Examples:

    • Scenario: Database optimization task

      • Rule Review: Fetch sql-performance.mdc, sql-correctness.mdc, stepwise-autonomy.mdc
      • Integration: Apply performance patterns, include verification steps, use 80/20 prioritization
      • Execution: Reference rule requirements when designing queries, validate against rule criteria
    • Scenario: API integration project

      • Rule Review: Fetch api-design-guidelines.mdc, backend-security.mdc, dependency-management.mdc
      • Integration: Follow security patterns, apply consistent API design, manage dependencies properly
      • Execution: Use rule patterns for authentication, error handling, and testing
    • Scenario: Complex multi-phase project continuation

      • Documentation Discovery: Map scattered documentation across 6+ systems using parallel reading
      • Context Synthesis: Identify methodology documents, architectural decisions, phase summaries
      • Rule Selection: Choose rules based on comprehensive context understanding
      • Execution: Apply framework integration patterns with full project context

Read the full file on GitHub · 105 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 · 105 lines · 0 tokens per session scan A 620e513db730

Subscribe to this mod's changes

428-pre-task-rule-review is a cursor rule published in the GitHub repository hamzaamjad/cursor-rules (2 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,317 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.