post-mortem
Session analysis, pattern detection, and self-improvement orchestration for workflow closure.
Skill by lshtram
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/lshtram-post-mortem
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: productivity
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/post-mortem
What's inside
- Skill name
post-mortem- Description
- Session analysis, pattern detection, and self-improvement orchestration for workflow closure.
- License
- MIT
- Instructions
- 363 lines in SKILL.md · view on GitHub
Before installing
- Instructions read files in your home folder (~/.ssh, ~/.aws…)
Files (1)
- SKILL.md
SKILL.md (first lines)
# Post-Mortem — Session Analysis & Self-Improvement Skill
**Agent:** Librarian (orchestrator)
**Phase:** Closure (Phase 5 in BUILD, Phase 4 in DEBUG/REVIEW)
**Priority:** MANDATORY — Runs at the end of every completed workflow
**Consolidates:** self-improve, pattern-detector, intelligent-pattern-detector, pattern-implementer
---
## IRON LAW
**EVERY COMPLETED WORKFLOW GETS A POST-MORTEM. NO EXCEPTIONS.**
Even if the workflow was perfect. Especially if the workflow was perfect — document WHY it worked so we can replicate it.
---
## Purpose
Run the complete self-improvement cycle at workflow closure:
1. Collect session data
2. Detect meaningful patterns (not noise)
3. Classify: real issues vs. normal development patterns
4. Present findings to user
5. Implement approved improvements
6. Update memory
---
## Process Flow
```mermaid
graph TD
A[Workflow Complete] --> B[Collect Session Data]
B --> C[Analyze Patterns]
C --> D{Meaningful Patterns?}
D -->|No| E[Document: Clean Session]
D -->|Yes| F[Classify Patterns]
F --> G[Present to User]
G --> H{User Approves?}
H -->|Yes| I[Implement Changes]
H -->|No| J[Document: User Declined]
H -->|Partial| K[Implement Approved Only]
I --> L[Update Memory]
J --> L
K --> L
E --> L
L --> M[Done]
```
---
## Step 1: Collect Session Data
Run the session copy script to extract messages:
```bash
python3 ~/.config/opencode/nso/scripts/copy_session.py
```
**Input:** `~/.local/share/opencode/storage/message/`
**Output:** `.opencode/logs/session.json`
The script:
- Reads OpenCode message storage
- Filters to current project (auto-detected from git/directory)
- Skips already-reviewed messages (tracked in `reviewed_sessions.json`)
- Outputs structured JSON
---
## Step 2: Pattern Detection
Analyze the session data for meaningful patterns. This combines rule-based detection with LLM understanding.
### Pattern Categories
#### Real Issues (Flag for Action)
| Pattern | Severity | Detection Rule | Suggested Action |
|---|---|---|---|
| `repeated_failure` | HIGH | Same file modified 5+ times with similar changes | Add to patterns.md, suggest refactoring |
| `context_loss` | HIGH | Agent starts work without reading requirements | Add gate to agent prompt |
| `validation_gap` | HIGH | Moved to closure without running tests | Flag for process improvement |
| `missing_approval` | HIGH | Oracle phases without user approval messages | Flag gate violation |
| `workflow_bypass` | MEDIUM | Jumped phases (e.g., no Architecture before Implementation) | Flag, may be intentional |
| `tool_errors` | MEDIUM | Consistent tool failures in session | Investigate tool configuration |
| `3_fix_escalation` | MEDIUM | 3+ fix attempts for same issue | Add to patterns.md as gotcha |
#### Normal Development (Don't Flag)
| Pattern | Why It's Normal | Note |
|---|---|---|
| `rapid_iteration` | Consecutive build calls during feature work | Healthy TDD cycle |
| `exploration` | Trying different approaches | Learning/discovery phase |
| `refactoring` | Multiple changes to same file, improving quality | Part of GREEN→REFACTOR |
| `model_switch` | Different models used | Document but don't flag |
#### System Health (Informational)
| Pattern | What It Shows | Action |
|---|---|---|
| `session_duration` | How long workflows take | Track in trends.json |
| `agent_effectiveness` | Which agents succeed/fail most | Track for tuning |
| `phase_duration` | Time per phase | Identify bottlenecks |
### Detection Implementation
The Librarian analyzes `session.json` using these rules:
```python
def detect_patterns(session_data):
patterns = []
# Rule 1: Repeated failures (same file, 5+ changes)
file_changes = count_file_modifications(session_data)
for file, count in file_changes.items():
if count >= 5:
patterns.append({
"type": "repeated_failure",From lshtram/nso, MIT.
More from lshtram/nso
- 0.408score
integration-verifier
lshtram
Verify integration tests and E2E scenarios, detect failures, and provide rollback options
SkillDFreshness: DClaude Code +9 - 0.408score
skill-creator
lshtram
Create or improve skills using the Claude Code skill standard.
SkillDFreshness: DClaude Code +9 - 0.406score
tdd
lshtram
Test-Driven Development enforcement with rationalization prevention, verification checklist, and delete-and-restart rule.
SkillDFreshness: DClaude Code +9 - 0.406score
router
lshtram
Intelligent intent detection and workflow routing for NSO.
SkillDFreshness: DClaude Code +9 - 0.404score
ui-design-system
lshtram
Comprehensive UI/UX design system skill — component generation, design tokens, accessibility, and responsive design.
SkillDFreshness: DClaude Code +9 - 0.404score
bug-investigator
lshtram
Investigate bugs with LOG FIRST approach, regression tests, and variant coverage.
SkillDFreshness: DClaude Code +9 - 0.404score
architectural-review
lshtram
Multi-expert architecture review with simplicity checklist and debate-driven analysis.
SkillDFreshness: DClaude Code +9 - 0.404score
memory-update
lshtram
Force an on-demand update of NSO memory files with comprehensive context.
SkillDFreshness: DClaude Code +9 - 0.404score
systematic-debugging
lshtram
4-phase debugging methodology with root cause analysis, 3-fix escalation, and scientific method enforcement.
SkillDFreshness: DClaude Code +9 - 0.404score
code-reviewer
lshtram
Review code with confidence scoring (≥80), two-stage review, and CRITICAL issue blocking.
SkillDFreshness: DClaude Code +9 - 0.404score
verification-gate
lshtram
IDENTIFY→RUN→READ→VERIFY→CLAIM gate function with forbidden language detection and fresh evidence requirement.
SkillDFreshness: DClaude Code +9 - 0.401score
rm-validate-intent
lshtram
Verify drafted requirements match the user's stated intent.
SkillDFreshness: DClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Feb 15, 2026 (8 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/lshtram/nso
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from lshtram
- 0.408score
skill-creator
lshtram
Create or improve skills using the Claude Code skill standard.
SkillDFreshness: DClaude Code +9 - 0.408score
integration-verifier
lshtram
Verify integration tests and E2E scenarios, detect failures, and provide rollback options
SkillDFreshness: DClaude Code +9 - 0.406score
tdd
lshtram
Test-Driven Development enforcement with rationalization prevention, verification checklist, and delete-and-restart rule.
SkillDFreshness: DClaude Code +9 - 0.406score
router
lshtram
Intelligent intent detection and workflow routing for NSO.
SkillDFreshness: DClaude Code +9 - 0.405score
platform-agentic-cicd-orchestrator
lshtram
Use when doing cross-layer planning, drift reconciliation, and CI/CD promotion across UI, n8n, and backend layers
SkillDFreshness: DClaude Code +9 - 0.404score
bug-investigator
lshtram
Investigate bugs with LOG FIRST approach, regression tests, and variant coverage.
SkillDFreshness: DClaude Code +9
Cite this page
post-mortem skill. Agent Mart. https://agentmart.dev/skills/lshtram-post-mortem (last updated 2026-10-24)