root-cause-before-fix

root-cause-before-fix is a cursor rule for Cursor from Flomenco-Inc/flo-plugin. It costs 958 tokens per session, scanned A, original, MIT.

A debugging rule that requires identifying a bug's underlying cause and showing evidence before changing code.

In plain words
What is it for?
Use it when investigating errors or reports that something is not working, especially when logs, API responses, database queries, code paths, or traces can provide evidence.
Why use it?
It helps prevent repeated guesses that fix only symptoms and leave the original problem unresolved.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when investigating errors or reports that something is not working, especially when logs, API responses, database queries, code paths, or traces can provide evidence.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/flomenco-inc/flo-plugin/root-cause-before-fix
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.

Clone the repo
git clone --depth 1 https://github.com/Flomenco-Inc/flo-plugin

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 root-cause-before-fix

README.md
[![agentmods](https://agentmods.dev/badge/rules/flomenco-inc/flo-plugin/root-cause-before-fix/github.svg)](https://agentmods.dev/rules/flomenco-inc/flo-plugin/root-cause-before-fix)
Your own site
<a href="https://agentmods.dev/rules/flomenco-inc/flo-plugin/root-cause-before-fix"><img src="https://agentmods.dev/badge/rules/flomenco-inc/flo-plugin/root-cause-before-fix/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for root-cause-before-fix

Your own site · 80×15
<a href="https://agentmods.dev/rules/flomenco-inc/flo-plugin/root-cause-before-fix"><img src="https://agentmods.dev/badge/rules/flomenco-inc/flo-plugin/root-cause-before-fix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 958 This file is loaded in full into every session.
When invoked 958 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00958 $0.00958
Opus 5.5 $0.00383 $0.00383
Sonnet 5.5 $0.00192 $0.00192
Haiku 4.5 $0.00096 $0.00096

Measured 1mo ago against content hash 3226b0210295, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

root-cause-before-fix 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 1mo 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/root-cause-before-fix.mdc · 91 lines

How it starts

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

Root Cause Before Fix

Before writing any code to fix a bug or address a "not working" report, you MUST state the root cause and evidence. Do not skip this step. Do not say "let me try this" without first saying "the cause is X because of Y."

The problem this prevents

The #1 failure pattern: user reports a bug → agent makes a plausible-looking code change → user tests → still broken → agent makes another guess → still broken → 5 rounds later, a whole day is wasted. The fix is to diagnose before treating.

Required format

Before writing any fix, present this to the user:

**Root cause:** <one sentence — what is actually wrong>
**Evidence:** <the specific log, API response, DB query, code path, or trace that proves it>
**Why this fix:** <how the proposed change addresses the root cause, not just the symptom>

How to gather evidence

For API errors (4xx/5xx)

# Check CloudWatch logs for the Lambda
aws logs filter-log-events \
  --log-group-name /aws/lambda/flo-dev-<service>-<function> \
  --start-time $(date -v-30M +%s000) \
  --profile 469128505698_FlomencoSuperAdmin --region us-east-1 \
  --filter-pattern "ERROR" \
  --query 'events[*].message' --output text | tail -20

For 403 errors specifically

Check whether the route exists in openapi.yaml — API Gateway returns 403 (not 404) for undeclared routes. Also check service_config.yaml for the Lambda mapping. See flo-system-architecture.mdc § "Debugging 403 errors".

For "deployed but not working"

# Verify the Lambda is actually running the new code
aws lambda get-function --function-name flo-dev-<service>-<function> \
  --profile 469128505698_FlomencoSuperAdmin --region us-east-1 \
  --query 'Configuration.{LastModified:LastModified,CodeSha256:CodeSha256}'

For frontend rendering issues

playwright > navigate to https://dev.floapp.co/<page>
playwright > evaluate: document.querySelector('<selector>') !== null
playwright > evaluate: JSON.stringify(window.__REACT_DEVTOOLS_GLOBAL_HOOK__ ? 'devtools' : 'no devtools')
# Check network tab for failed API calls
playwright > evaluate: fetch('https://api.dev.floapp.co/v1/<endpoint>', {headers: {'Authorization': 'Bearer ...'}}).then(r => r.status + ' ' + r.statusText)

Read the full file on GitHub · 91 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. 1mo ago First seen · 91 lines · 958 tokens per session scan A 3226b0210295

Subscribe to this mod's changes

root-cause-before-fix is a cursor rule published in the GitHub repository Flomenco-Inc/flo-plugin (0 stars, last pushed 1mo ago), licensed MIT. It adds 958 tokens to every session, about $0.0038 per session on Opus 5.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.