Skip to content

Instantly share code, notes, and snippets.

@jwynia
Last active July 13, 2025 19:38
Show Gist options
  • Save jwynia/de1ec3466c1dbe6c9a63dd106faaa2ef to your computer and use it in GitHub Desktop.
Save jwynia/de1ec3466c1dbe6c9a63dd106faaa2ef to your computer and use it in GitHub Desktop.
Claude Code command for /retrospective that reviews a task for lessons learned in a context network project. Goes in /.claude/commands/retrospective.md

Context Network Retrospective Agent Prompt

Task Context

You are conducting a retrospective analysis after completing a task. Your goal is to identify what should be captured in the context network and what adjustments need to be made to existing documentation.

Critical Domain Boundary Reminder

Remember the distinction:

  • Context Network: Planning documents, architecture decisions, design discussions, implementation strategies
  • Project Artifacts: Source code, configuration files, public documentation, tests

Retrospective Analysis Process

Phase 1: Task Review

  1. Task Summary

    • What was the original task objective?
    • What was actually accomplished?
    • Were there any deviations from the original plan?
  2. Decision Inventory

    • What architectural or design decisions were made?
    • What trade-offs were considered?
    • What alternatives were rejected and why?
  3. Discovery Log

    • What unexpected challenges emerged?
    • What new patterns or approaches were discovered?
    • What assumptions proved incorrect?

Phase 2: Context Network Gap Analysis

  1. Missing Documentation

    • Were there planning documents that would have helped but didn't exist?
    • What design decisions were made that aren't captured anywhere?
    • Are there new patterns that should be documented?
  2. Outdated Information

    • Did you encounter documentation that was incorrect or misleading?
    • Are there nodes whose relationships have changed?
    • Has the confidence level of any information changed (Established → Evolving)?
  3. Relationship Gaps

    • Are there connections between nodes that weren't documented?
    • Did you discover new cross-domain relationships?
    • Are there navigation paths that would have been helpful?

Phase 3: Update Requirements

For each identified gap or update need, determine:

  1. Update Type

    • New node creation
    • Existing node modification
    • Relationship establishment/modification
    • Navigation guide enhancement
  2. Priority Assessment

    • Critical: Would cause immediate problems if not updated
    • Important: Would improve future work significantly
    • Nice-to-have: Would enhance understanding but not critical
  3. Update Scope

    • Single node update
    • Multiple related nodes
    • Structural changes to network organization

Phase 4: Context Network Updates

For each update, follow this process:

New Node Creation

## Node: [Title]

### Classification
- Domain: [Where does this fit?]
- Stability: [How often will this change?]
- Abstraction: [What level of detail?]
- Confidence: [How certain are we?]

### Key Content
[What is the essential information?]

### Critical Relationships
- Depends on: [What must be understood first?]
- Enables: [What does this make possible?]
- Conflicts with: [What does this contradict?]

### Task Context
- Discovered during: [Task name]
- Relevance: [Why this matters for future work]

Node Modification

## Update for: [Node Title]

### What Changed
- Previous understanding: [What we thought before]
- New understanding: [What we know now]
- Reason for change: [What led to this update]

### Impact Assessment
- Affected relationships: [Which connections need review?]
- Downstream implications: [What else might need updating?]

Relationship Documentation

## New Relationship: [Source][Type][Target]

### Relationship Details
- Type: [depends-on, enables, conflicts-with, etc.]
- Strength: [Critical, Important, Informational]
- Discovery context: [How was this discovered?]

### Navigation Implications
- When following this path: [What should users know?]
- Common use cases: [When would someone traverse this?]

Phase 5: Changelog Entry

Create a comprehensive changelog entry:

## Retrospective: [Task Name] - [Date]

### Task Summary
- Objective: [What we set out to do]
- Outcome: [What was accomplished]
- Key learnings: [Most important discoveries]

### Context Network Updates

#### New Nodes Created
- [Node Name]: [Brief description and why it was needed]

#### Nodes Modified  
- [Node Name]: [What changed and why]
  - Classification changes: [If any]
  - Content updates: [Summary]
  - Relationship changes: [New/modified connections]

#### New Relationships
- [Source][Type][Target]: [Why this connection matters]

#### Navigation Enhancements
- [Path or guide updated]: [What improved]

### Patterns and Insights
- Recurring themes: [What patterns emerged?]
- Process improvements: [How could future work be better?]
- Knowledge gaps identified: [What's still missing?]

### Follow-up Recommendations
1. [Recommendation]: [Rationale and priority]
2. [Recommendation]: [Rationale and priority]

### Metrics
- Nodes created: [Count]
- Nodes modified: [Count]
- Relationships added: [Count]
- Estimated future time saved: [Rough estimate]

Execution Checklist

  • Reviewed all decisions made during task
  • Identified all planning/architecture content created
  • Checked for outdated documentation encountered
  • Documented new patterns or approaches discovered
  • Created/updated all relevant context network nodes
  • Established/updated all important relationships
  • Updated navigation guides where helpful
  • Created comprehensive changelog entry
  • Identified follow-up improvements needed

Quality Checks

Before completing the retrospective:

  1. Placement Verification: Are all planning/architecture documents in the context network (not project root)?
  2. Relationship Completeness: Are bidirectional relationships properly documented?
  3. Classification Accuracy: Do all classifications reflect current understanding?
  4. Navigation Utility: Would someone else be able to find this information when needed?
  5. Future Value: Will these updates save time or prevent problems in future work?

Output Format

Provide your retrospective analysis in the following structure:

  1. Task Review Summary
  2. Identified Gaps and Updates (grouped by priority)
  3. Completed Updates (with file paths)
  4. Changelog Entry
  5. Recommendations for Future Work

Completion

When the retrospective ic complete, ensure that all relevant information, decisions, recommendations, etc. are written into the context network. What is presented as a summary to the user is ephemeral and should be seen as a convenience communication about what's already been written to the context network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment