sprint-lessons-learned

sprint-lessons-learned is a cursor rule for Cursor from rm2thaddeus/Pixel_Detective. It costs 0 tokens per session (1,636 once invoked), scanned D, original, MIT.

A checklist of lessons from an earlier software sprint, including ways to prevent browser display mismatches and backend import failures. A hydration error happens when server-generated and browser-generated page markup differ.

In plain words
What is it for?
Use it when changing themes or client-side code in Next.js, preventing circular imports in backend code, and checking production builds.
Why use it?
It highlights mistakes that caused lengthy debugging and sets checks to reduce the chance of repeating them.

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/rm2thaddeus/pixel_detective/sprint-lessons-learned
Clone the repo
git clone --depth 1 https://github.com/rm2thaddeus/Pixel_Detective

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 sprint-lessons-learned

README.md
[![agentmods](https://agentmods.dev/badge/rules/rm2thaddeus/pixel_detective/sprint-lessons-learned.svg)](https://agentmods.dev/rules/rm2thaddeus/pixel_detective/sprint-lessons-learned)
Your own site
<a href="https://agentmods.dev/rules/rm2thaddeus/pixel_detective/sprint-lessons-learned"><img src="https://agentmods.dev/badge/rules/rm2thaddeus/pixel_detective/sprint-lessons-learned.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,636 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 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.01636
Opus 5 $0.00000 $0.00818
Sonnet 5 $0.00000 $0.00327
Haiku 4.5 $0.00000 $0.00164

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

Security

Grade D, and why

sprint-lessons-learned scanned grade D with 3 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.

Strips warnings and disclaimersmediumAnti-refusal

Omitting safety caveats hides risk from the user and is a common jailbreak preamble.

- [ ] **Build Success:** npm run build passes without warnings

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

1. Clear Next.js cache: rm -rf .next

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

2. Check server status: curl localhost:3025/health
.cursor/rules/sprint-lessons-learned.mdc · 215 lines

How it starts

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

Sprint 10 Critical Lessons Learned - Master Reference

🚨 CRITICAL FAILURES & SOLUTIONS FROM SPRINT 10

This rule captures the most expensive mistakes from Sprint 10 that must NEVER be repeated.

🔥 LESSON 1: Hydration Errors Are Project Killers

Problem: Recurring Next.js hydration errors with Chakra UI dark mode consumed days of debugging time.

Root Cause: Server/client HTML mismatches from theme system and browser-only APIs.

✅ PREVENTION PROTOCOL:

# BEFORE any theme or client-side work:
1. Set up proper ColorModeScript in <head>
2. Use mounted state pattern for client-only components  
3. Test in production build: npm run build && npm start
4. NEVER use window/localStorage in render phase

🚫 FORBIDDEN: Any theme changes without hydration testing.


🔥 LESSON 2: Backend Circular Imports Crash Everything

Problem: Circular imports between main.py and routers caused backend startup failures.

Root Cause: Routers importing from main.py to access shared state.

✅ PREVENTION PROTOCOL:

# ALWAYS use dependency injection pattern:
# 1. Create dependencies.py with AppState class
# 2. Use @asynccontextmanager lifespan in main.py
# 3. Routers import dependencies, NEVER main.py
# 4. Use Depends() for all shared resources

🚫 FORBIDDEN: Any router importing from main.py or app.state access.


🔥 LESSON 3: MCP Browser Tools Setup Is Complex

Problem: Browser Tools MCP failures wasted hours on "simple" debugging tasks.

Root Cause: 3-component setup (Node.js v18+, server on 3025, Chrome extension) with silent failures.

✅ PREVENTION PROTOCOL:

# BEFORE using Browser Tools MCP:
1. Verify Node.js ≥18: node --version
2. Start server: npx @agentdeskai/browser-tools-server@latest
3. Install Chrome extension in developer mode
4. Test basic MCP: mcp_browser-tools_wipeLogs
5. Verify full functionality: mcp_browser-tools_takeScreenshot

🚫 FORBIDDEN: Using Browser Tools MCP without 3-component verification.

Read the full file on GitHub · 215 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 · 215 lines · 1,636 tokens per session scan D 216a69a83403

Subscribe to this mod's changes

sprint-lessons-learned is a cursor rule published in the GitHub repository rm2thaddeus/Pixel_Detective (21 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,636 tokens. A static security scan graded it D with 3 findings (strips warnings and disclaimers, recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.