Cursor Rules with Scratchpad & Learning
This skill enables the AI to maintain a `.cursorrules` file as both a **lesson log** and a **task scratchpad**, helping it learn from past mistakes and organize multi-step work effectively.
What This Skill Does
**Maintains a `.cursorrules` file** in the project root as a persistent learning and planning document**Logs reusable patterns** (library versions, model names, fixes, corrections) in the "Lessons" section to avoid repeating mistakes**Uses the "Scratchpad" section** to explain tasks, plan steps, track progress with todo markers, and reflect on milestones**Encourages step-by-step task decomposition** with progress tracking (`[X]` done, `[ ]` pending)**Promotes big-picture thinking** by regularly reviewing and updating the ScratchpadInstructions
1. Initialize or Read the `.cursorrules` File
Before starting any task:
**Read the `.cursorrules` file** in the project rootIf it doesn't exist, create it with the following structure:```markdown
Lessons
User Specified Lessons
[User-provided lessons will go here]Cursor Learned
[AI-learned lessons will go here]Scratchpad
[Task planning and progress tracking will go here]
```
2. Update the Lessons Section
When you encounter something reusable (e.g., a fix, a correction, a library version, a model name):
**Add it to the "Lessons" section** under "Cursor Learned"Use clear, concise bullet pointsInclude context to make the lesson actionable**Example:**
```markdown
Cursor Learned
When using seaborn styles in matplotlib, use 'seaborn-v0_8' instead of 'seaborn'Use 'gpt-4o' as the model name for OpenAI's GPT-4 with vision capabilities```
3. Use the Scratchpad for Task Planning
When you receive a new task:
1. **Review the Scratchpad** for any prior context
2. **Clear old tasks** if they're no longer relevant
3. **Explain the task** briefly
4. **Plan the steps** with todo markers:
- `[ ]` for pending tasks
- `[X]` for completed tasks
**Example:**
```markdown
Scratchpad
Current Task: Add User Authentication
Plan
[X] Research best practices for authentication in Next.js[ ] Implement login page[ ] Add session management[ ] Test authentication flow```
4. Update Progress Regularly
**Mark tasks as complete** (`[X]`) when finished**Reflect on milestones** to maintain depth and big-picture awareness**Update the Scratchpad** after each significant step5. Always Refer to the Scratchpad Before Planning the Next Step
Check the Scratchpad to see what's been done and what's nextUse it to guide your next action and maintain task continuityExample Workflow
1. **User:** "Add a dark mode toggle to the app"
2. **AI:**
- Reads `.cursorrules`
- Updates Scratchpad:
```markdown
# Scratchpad
## Current Task: Add Dark Mode Toggle
### Plan
- [ ] Research dark mode implementation patterns
- [ ] Create toggle component
- [ ] Add theme state management
- [ ] Test toggle functionality
```
- Begins work, marking tasks as complete progressively
3. **AI encounters a mistake:**
- Adds to Lessons:
```markdown
## Cursor Learned
- Use CSS variables for theme switching instead of inline styles for better performance
```
4. **AI completes the task:**
- Marks all tasks `[X]` in Scratchpad
- Reflects on what was learned
Important Notes
**Always read `.cursorrules` before starting a new task****Keep the Scratchpad up to date** to avoid losing context**Use the Lessons section** to prevent repeating past mistakes**Clear the Scratchpad** when switching to unrelated tasks**Reflect on milestones** to improve depth and task accomplishmentConstraints
This skill is designed for use with **Cursor AI** and assumes a `.cursorrules` file in the project rootThe skill requires the AI to have **read and write access** to the `.cursorrules` fileThis is a **workflow enhancement skill**, not a technical implementation skill