kb-postmortem
Skill2 starsChanged 8 days agoMITView on GitHub
Post-publish retrospective on one ingested source — collect deterministic proxy metrics (ingest-stats), refresh the failure-signal backlog with increment context (snapshot the old backlog.yaml BEFORE skill-mine, then diff), read the digest routing deviations, and write one standardized report with recommendations only (skill-evolve triggers, gate/truth updates, proposals-resolve dry-run commands). Use when the user says "postmortem this ingest / 复盘这次入库 / how did this book's ingest go / ingest retrospective for <source>". Only for a source already published; "run a KB QA / audit coverage" is kb-qa, "semantic health check" is wiki-lint-semantic, and "distill this failure into the skill" is skill-evolve — none of those trigger this.
In this repository23 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ingestSkill
- kb-qaSkill
- kb-querySkill
- kb-reviewSkill
- kb-saveSkill
- pipeline-doctorSkill
- skill-evolveSkill
- source-preflightSkill
- source-xraySkill
- wiki-lint-semanticSkill
- ingestSkill
- kb-postmortemSkill
- kb-qaSkill
- kb-querySkill
- kb-reviewSkill
- kb-saveSkill
- pipeline-doctorSkill
- skill-evolveSkill
- source-preflightSkill
- source-xraySkill
- wiki-lint-semanticSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
After a source publishes, turn the manual "lessons learned" pass into a standard step: deterministic proxy metrics + digest deviations + …
- Very specific: line 81
Never run proposals-resolve --apply, skill-adopt, or any vault/DB write from this skill.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
kb-postmortem — post-publish ingest retrospective (report-only)
After a source publishes, turn the manual "lessons learned" pass into a standard step: deterministic
proxy metrics + digest deviations + backlog delta → one report. Recommendations only — every follow-up
action (skill-evolve, gate edits, proposals-resolve --apply) is decided by the human.
Project truth: AGENTS.md.
1. Triggers / Non-triggers
- Triggers: "postmortem
<source>", "复盘这次入库", "how did this ingest go", "ingest retrospective / review this book's ingest". - Non-triggers (never fire):
- "run a KB QA / audit coverage / spot-check evidence / run the Q-chain" →
kb-qa. - "semantic health check / contradictions / L4 / Q2 added value" →
wiki-lint-semantic. - "distill this failure into the skill / evolve a skill / handle backlog item N" →
skill-evolve(this skill only recommends it). - "work the review queue item by item" →
kb-review. - the source is not published yet → finish the ingest (lint gate) first; this skill never runs mid-ingest.
- "run a KB QA / audit coverage / spot-check evidence / run the Q-chain" →
2. Inputs
source_id— must showlint/publishedinstatus.- Proxy metrics via
ingest-stats(windows, stage durations and reruns, lint failures ≈ rollbacks, pages estimate, violations by kind). Token/cost numbers are not available — never invent them. pipeline-workspace/staging/<src>/digest.md: the per-chapter content-routing table + logged deviations.- The old
pipeline-workspace/skill-evolution/backlog.yaml— read and snapshot it BEFORE runningskill-mine: skill-mine overwrites the whole file, so mining first destroys the increment context. - Residue in
wiki/Review-Queue/for this source.
3. Outputs
One standardized report pipeline-workspace/reports/postmortem/<src>-<YYYY-MM-DD>.md with four sections:
- Proxy metrics (from
ingest-stats; honest scope — no invented token/cost data). - Digest routing deviations (from
digest.md; absent → marked degraded). - Backlog delta (old snapshot vs refreshed) + skill-evolve trigger recommendations (recurring signatures with
count>= 2 only). - Gate /
AGENTS.mdupdate recommendations.
Plus a suggested-commands list: proposals-resolve dry-runs for signatures this ingest's fixes
covered. Recommendations only — this skill never executes them.
4. Dependencies
- CLI:
status,ingest-stats,skill-mine;proposals-resolveappears in suggestions only (human confirms and runs--apply). staging/<src>/digest.md(may be absent for md fast-path sources → degraded, noted in the report).- Truth:
AGENTS.md. No new LLM judgement enters the CLI.
5. Persisted artifacts
- The report
pipeline-workspace/reports/postmortem/<src>-<YYYY-MM-DD>.md(the old-backlog snapshot is embedded in its delta section). - No vault page is written; no DB row is changed (
skill-mineonly rewrites the derivedbacklog.yaml).
6. CLI commands
python scripts/pipeline.py status # W1: confirm lint/published
python scripts/pipeline.py ingest-stats --source <src> --json # W2: proxy metrics
# W3: FIRST copy/read pipeline-workspace/skill-evolution/backlog.yaml (old state), THEN:
python scripts/pipeline.py skill-mine # refresh (overwrites backlog.yaml)
# suggested only — never auto-run by this skill:
python scripts/pipeline.py proposals-resolve --signature <kind> --source <src> # dry-run first7. Workflow
| Sub-unit | Input | Output | Acceptance | Persisted | Failure stop |
| W1 confirm published | status | source is lint/published | otherwise stop | — | not published |
| W2 metrics | ingest-stats --json | metrics section | numbers come from the state db, none invented | report draft | non-zero exit |
| W3 backlog delta | old backlog.yaml snapshot → skill-mine → diff | delta section | old file snapshotted before mining | snapshot in report | mine fails |
| W4 digest deviations | staging/<src>/digest.md | deviations section | absent → degraded note, continue | report draft | — |
| W5 write report | W2–W4 | reports/postmortem/<src>-<date>.md | four sections present | the report | — |
| W6 recommendations | delta + deviations | skill-evolve / gate / proposals-resolve suggestions | commands are suggestions only, count>=2 rule | report section | — |
8. Failure stops / recovery
- Source not
lint/published→ stop and point to the finishing gate (lint) orkb-reviewfor pending violations. ingest-statsexits non-zero → stop, report the error verbatim.digest.mdmissing (md fast-path source) → do not stop; mark the deviations section degraded.- Never run
proposals-resolve --apply,skill-adopt, or any vault/DB write from this skill. - Recovery: the report is idempotent — re-running the retrospective overwrites the same day's file.
9. Acceptance criteria
- Report exists at
pipeline-workspace/reports/postmortem/<src>-<YYYY-MM-DD>.mdwith the four sections. - The old backlog was snapshotted before
skill-mineran (the delta section shows old vs new). - Zero vault writes, zero DB changes;
proposals-resolveappears only as suggested dry-run commands. - skill-evolve recommendations name only recurring signatures (
count>= 2).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

