Post-Mortem Analysis
Analyze chat histories to identify successes, failures, and improvement opportunities. Generate actionable recommendations for updating project configuration files (.cursorrules , skills, etc.) to prevent similar issues.
When to Use
-
User asks for a "post-mortem" or "retrospective"
-
User wants to analyze what went well or wrong in a session
-
User wants to improve agent behavior based on past interactions
-
User provides a chat export file or URL for analysis
Input Sources
The analysis can work with:
-
Current session: Analyze the ongoing conversation (default if no file provided)
-
File path: Chat export in JSON, markdown, or text format
-
URL: Link to a shared chat export
Process
Phase 1: Analysis
Load and analyze chat:
-
If no file specified: Analyze the current conversation history
-
If file path provided: Read the chat export file
-
If URL provided: Fetch the chat export using WebFetch
-
Parse the conversation flow and identify key interactions
-
Extract tool usage patterns and decision points
-
Note any error messages, confusion, or repeated attempts
Categorize interactions:
-
Successful patterns: What worked well and why
-
Failed patterns: What went wrong and root causes
-
Missed opportunities: Where the agent could have been more effective
-
User friction points: Where the user had to provide additional guidance
Phase 2: Assessment
Skill usage review:
-
Identify skills that were (or should have been) applied
-
Locate and read skill files in .cursor/skills/ or ~/.cursor/skills/
-
Assess whether skill instructions were clear and complete
Identify root causes:
-
Missing context in project rules or skills
-
Unclear or ambiguous instructions
-
Missing skills or workflow guidance
-
Tool selection issues
-
Architecture understanding gaps
Pattern analysis:
-
Recurring mistakes or confusion
-
Successful strategies that should be reinforced
-
Dependencies that weren't clear
-
Workflow steps that were skipped or misunderstood
Phase 3: Recommendations
Project rules improvements (.cursorrules ):
-
Missing architectural context to add
-
Workflow patterns to emphasize
-
Common pitfalls to warn about
-
Examples that would clarify usage
Skill enhancements:
-
New skills that should be created
-
Existing skills that need updates
-
Additional constraints needed
-
Process clarifications
-
Tool usage guidelines
Phase 4: Implementation
Present findings:
-
Summary of what went well
-
Key issues identified
-
Specific recommendations with rationale
-
Proposed changes to configuration files
User confirmation:
-
STOP: Present findings and ask "Review these recommendations. Proceed with updating files? (y/n)"
-
Allow user to modify or reject specific recommendations
Apply improvements:
-
Update .cursorrules with approved changes
-
Modify or create skills as needed
-
Document changes made
Example Interactions
Analyze current session:
"Do a post-mortem on this chat"
-
Review current conversation history
-
Identify issues or missed opportunities
-
Present recommendations
-
Get confirmation before updating files
Analyze external chat:
"Post-mortem this chat export ~/Downloads/session.json - focus on the build process issues"
-
Read the chat export file
-
Focus analysis on build-related interactions
-
Identify missing documentation or skills
-
Present recommendations
-
Get confirmation before updating files
Output Checklist
-
Analysis report: What went well vs. what went wrong
-
Root cause analysis: Why issues occurred
-
Actionable recommendations: Specific file changes to prevent recurrence
-
Updated configuration: Improved rules and skills (after user approval)