mscodebase-intelligence: Command for OpenCode

.opencode/command/postmortem.md

postmortem is a command for OpenCode from ManSio/mscodebase-intelligence. It costs 15 tokens per session (479 once invoked), scanned A, original, MIT.

A post-mortem command for turning an incident into a running guard, meaning a check that can fail if the same class of problem returns. It records the symptom, root cause, missed check, fix, guard, and broader problem class.

In plain words
What is it for?
Use it after a defect or incident to identify the exact cause, add a regression check, and strengthen an existing class of protection instead of creating duplicate notes.
Why use it?
A narrative about an outage or bug does not prevent recurrence by itself. Requiring the fix and guard together reduces the chance that a temporary correction is undone.

Command for OpenCode

Written for OpenCode: installed under .opencode/.

This is ManSio/mscodebase-intelligence's own configuration. It tells OpenCode how to work on mscodebase-intelligence itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mscodebase-intelligence configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ManSio/mscodebase-intelligence. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/ManSio/mscodebase-intelligence/main/.opencode/command/postmortem.md
Clone the repo
git clone --depth 1 https://github.com/ManSio/mscodebase-intelligence

Made for: OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for postmortem

README.md
[![agentmods](https://agentmods.dev/badge/commands/mansio/mscodebase-intelligence/postmortem/github.svg)](https://agentmods.dev/commands/mansio/mscodebase-intelligence/postmortem)
Your own site
<a href="https://agentmods.dev/commands/mansio/mscodebase-intelligence/postmortem"><img src="https://agentmods.dev/badge/commands/mansio/mscodebase-intelligence/postmortem/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for postmortem

Your own site · 80×15
<a href="https://agentmods.dev/commands/mansio/mscodebase-intelligence/postmortem"><img src="https://agentmods.dev/badge/commands/mansio/mscodebase-intelligence/postmortem.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 479 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00015 $0.00479
Opus 5.5 $0.00006 $0.00192
Sonnet 5.5 $0.00003 $0.00096
Haiku 4.5 $0.00002 $0.00048

Measured 26d ago against content hash bc06ab492cfd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

postmortem scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 26d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.opencode/command/postmortem.md · 52 lines

What it actually says

You are running the POST-MORTEM phase. A post-mortem that produces only a narrative has failed — its output must be something that fires next time.

Structure

  1. Symptom — what was observed, in terms someone else would recognise. Not what you think caused it.
  2. Root cause — the specific line, value, or assumption. "The regex was not anchored" beats "regexes are fragile".
  3. Why it survived — the check that should have caught it, and why it did not. This is the part that generalises.
  4. Fix — with the commit sha.
  5. Guard — the thing that now fails. A guard is code that runs. "Be more careful" is not a guard.
  6. Class — the family this belongs to. If the family already has an entry, add to it; do not create a parallel one.

Rules

  • One entry per incident, ≤15 lines. No stack traces, no raw pytest dumps. A diary nobody reads protects nothing.
  • The guard ships in the same change as the fix. A fix without a guard is a coincidence waiting to be undone.
  • Check the registry before writing. A repeated class gets a stronger guard, not a new note.
  • Record what you got wrong in the diagnosis. Self-correction is the most reusable part of the entry.

Sweep for the class

After the guard is in place, ask: where else does this pattern exist? Report N of M and how many distinct idioms. A rule applied in one place and not two lines later proves the rule was known and not followed — a different problem from not knowing it.

Output

## [YYYY-MM-DD] <name> — Status
**Symptom:** ...
**Root cause:** <file:line>
**Why it survived:** ...
**Fix:** <sha>
**Guard:** <what now fails, and where>
**Class:** P-### / new class
**Class sweep:** N of M places, K idioms
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 26d ago First seen · 52 lines · 15 tokens per session scan A bc06ab492cfd

Subscribe to this mod's changes

postmortem is a command published in the GitHub repository ManSio/mscodebase-intelligence (3 stars, last pushed 5d ago), licensed MIT. It adds 15 tokens to every session and 479 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-04.