Postmortem improve

From fritzprix/libr-agent · View interactive version

Postmortem improve is an AI agent skill from the GitHub repository fritzprix/libr-agent. Run a postmortem → improve loop so LibrAgent sessions learn without dirtying project git. Capture evidence-backed failures, then apply a Top-1 update to `@harness/LESSONS.active.md` (app-local; injected into the system prompt) for behavioral defects, or route deterministic tool/code defects to a fix

How to use this skill

Skill file

Postmortem → Improve

Close the loop: observe failure → write truth → change what the next prompt sees.

Primary enzyme (org or solo):

@harness/LESSONS.active.md

App-local under {appData}/harness-lessons/<scopeId>/ (outside project git).

Scope: org-<orgRootSessionId> when in org lineage, else ws-<workspaceHash>.

Harness injects non-empty content into system prompt as ## Active Operational Lessons on the next LLM turn.

Specialist skills own optional secondary mutations (boost, org restructure, …).

Do not invent a parallel org model.

Not This Skill

| Skill | Use for |

| --- | --- |

| teamwork | First-time scaffold / choose substrate |

| org | Create org, spawn/resume org members |

| org (references/org-restructure.md) | Apply role/constitution structural changes |

| delegation-eval-loop | Grade one child sprint (not fleet learning) |

| boost / recruit | Tune or create assistant configs only |

| schedule / loop | Recurring wake-ups (cadence only) |

| agent-init | Workspace agents.md (dirties project git — not default here) |

Core Rules

  1. Evidence before narrative. Prefer tool errors, session status, diffs, coordination files over memory.
  2. Two-track triage (mandatory).
  1. Prompt enzyme or it did not happen. Chat-only conclusions and KANBAN-only backlog are deferred, not Done.
  2. Git-clean by default. Never treat workspace agents.md / SOUL.md / tracked repo edits as the learning channel unless the user explicitly asks.
  3. Bounded ambition. Max 5 active lesson rules; ≤30 lines / 2KB (harness truncates beyond that). Evict before adding a 6th.
  4. Write from the governing session only. Harness rejects @harness writes from children (parent_session_id / depth>0) and from org members whose org_root_session_id != this session. Propose candidate rules in final text; root merges into @harness/LESSONS.active.md.

When to Run

Teamwork/org is optional. Solo sessions skip @teamwork archive steps.

Workflow

1. Gather evidence (short)

Collect only what supports root-cause claims:

If @teamwork/ exists, also skim MISSION.md → ROLES.md → agents.md → KANBAN.md → HANDOFF.md.

2. Write the archive (optional but recommended)

With teamwork: @teamwork/coordination/POSTMORTEMS/YYYY-MM-DD-<slug>.md

Solo / no teamwork: @harness/POSTMORTEMS/YYYY-MM-DD-<slug>.md

Use postmortem-template.md.

Optional index line in @harness/LESSONS.md (or @teamwork/coordination/LESSONS.md if teamwork exists):

- YYYY-MM-DD — <slug> — <one-line lesson> — track: behavior|defect

3. Triage Top-1

Pick one primary actionable. Classify:

| Track | Meaning | Done when |

| --- | --- | --- |

| defect | Tool/schema/handler/environment contract broken | Bug/fix task filed or code patched (user-authorized); LESSONS write forbidden |

| behavior | Agent chose wrong strategy/tool/sequence despite honest tools | @harness/LESSONS.active.md updated with ≤5 structured rules |

Routing helpers (secondary, after enzyme): improvement-routing.md.

4. Apply (behavior track)

Read current @harness/LESSONS.active.md (may be missing). Merge Top-1 rule(s).

Rule syntax (one line each):

- [YYYY-MM-DD] TRIGGER: <when> | FORBIDDEN: <anti-pattern> | REQUIRED: <correct action>

Constraints:

Write with either:

Never rely on default create-mode for updates.

5. Verify learning stuck

Before declaring the cycle complete:

6. Optional secondary routes

After the enzyme step, top remaining actions may go to boost / org restructure / delegation-eval-loop / schedule — see routing table. Keep ≤2 secondary actions.

Cadence (optional)

Use schedule for org-wide cadence; loop only for in-conversation reminders.

Guardrails

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.