reflection-examples

A reference card with examples for reviewing a coding session, including successes, difficulties, and lessons learned.

In plain words
What is it for?
Use it after implementing a feature or fixing a problem to document what worked, what failed, and what to change next time.
Why use it?
It makes the reasons behind problems and useful improvements easier to record consistently.

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/kfnzero/mantis-mcp-server/reflection-examples
Clone the repo
git clone --depth 1 https://github.com/kfnzero/mantis-mcp-server

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,488 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.01488
Opus 5 $0.00000 $0.00744
Sonnet 5 $0.00000 $0.00298
Haiku 4.5 $0.00000 $0.00149

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

Security

Grade A, and why

reflection-examples 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.

.cursor/rules/Extended Details/reflection-examples.mdc · 223 lines

How it starts

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

Reflection Format Examples

⚠️ CORRECT FORMAT EXAMPLES ⚠️

Example 1: Frontend Feature Reflection

## REFLECTION

### What Went Well
- React component architecture allowed for clean separation of concerns, making it easy to isolate and test individual components
- CSS module approach eliminated style conflicts and scoping issues entirely
- Implementation of custom hooks for form validation significantly reduced code duplication across multiple forms
- State management with Context API was sufficient for this feature scope without needing Redux
- Test-driven development approach caught several edge cases early in the development process

### Challenges
- Initial approach to form validation was too complex and had to be refactored
- Performance issues arose with real-time filtering of large datasets
- Mobile responsiveness required significant adjustments to the original design
- Browser compatibility issues with CSS Grid required additional fallbacks

### Lessons Learned
- Start with simpler validation approaches and add complexity as needed
- Consider pagination or virtualization early when dealing with large datasets
- Mobile-first design would have prevented later responsiveness issues
- Testing cross-browser compatibility earlier would have saved time
- Breaking components into smaller, more focused pieces improves maintainability
- Custom hooks are powerful for extracting and reusing logic

### Improvements for Next Time
- Implement a mobile-first design approach from the beginning
- Set up comprehensive browser testing earlier in the process
- Consider performance implications earlier when designing data-heavy features
- Create a more systematic approach to component props and interfaces
- Establish clearer boundaries between component responsibilities
- Document component APIs more thoroughly as they're developed

Example 2: Backend API Reflection

## REFLECTION

### What Went Well
- Middleware-based architecture made error handling consistent across all endpoints
- Input validation using a schema-based approach caught invalid requests early
- Repository pattern provided clean separation between database and business logic
- Unit testing each layer independently made debugging easier
- Automated integration tests with a test database ensured reliable API behavior
- Consistent error response format improved client experience

### Challenges
- Initial database schema had performance issues with complex queries
- Authentication flow had security vulnerabilities in the first implementation
- Error handling was inconsistent across different parts of the application
- Managing test data became complex as the number of tests grew

### Lessons Learned
- Database schema design should consider query patterns from the beginning
- Security reviews should happen earlier in the development process
- Consistent error handling requires a centralized approach
- Test data management benefits from factory patterns
- Input validation should happen as early as possible in the request lifecycle
- Documentation-driven development clarifies API design before implementation
- Environment-specific configuration is critical for smooth deployment

### Improvements for Next Time
- Start with security considerations as a first-class concern
- Design database schema with specific query patterns in mind
- Implement more comprehensive input validation from the start
- Create better tooling for test data management
- Establish clear patterns for handling asynchronous operations
- Include performance testing earlier in the development cycle
- Improve logging for better production debugging

Read the full file on GitHub · 223 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. 2d ago First seen · 223 lines · 1,488 tokens per session scan A acc8c1c86393

Subscribe to this mod's changes

reflection-examples is a cursor rule published in the GitHub repository kfnzero/mantis-mcp-server (10 stars, last pushed 12mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,488 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.