From mumei
Generate a retrospective markdown for an archived (or about-to-be-archived) mumei feature. Reads requirements / design / tasks / spec-reviews / reviews / cost-log and emits muse.md with AC count, Wave count, review iter counts, fix-spiral detection, token cost, cache hit rate, and hook firing breakdown. Triggered by the user invoking /mumei:muse <feature> after /mumei:shelve (or before, if explicitly requested). Read-only with respect to feature content; writes only the muse.md output file.
How this skill is triggered — by the user, by Claude, or both
Slash command
/mumei:muse <feature><feature>This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Produce a single markdown document summarising a finished mumei feature so the team builds institutional knowledge instead of forgetting what happened.
Produce a single markdown document summarising a finished mumei feature so the team builds institutional knowledge instead of forgetting what happened.
/mumei:muse <feature> after /mumei:shelve.phase: done feature before archival (rare; lets them edit the muse.md before shelve moves the docs).This skill is disable-model-invocation: true — only fires on explicit user request. Never auto-trigger.
The skill resolves the feature directory in this order:
.mumei/archive/*/<feature>/ — archived feature.mumei/specs/<feature>/ — spec vehicle, not yet archived.mumei/plans/<feature>/ — plan vehicle, not yet archivedRefuse with a clear message if none match.
feature="$1"
[[ -n "$feature" ]] || { echo "usage: /mumei:muse <feature>" >&2; exit 1; }
# Resolve feature dir.
feature_dir=""
for candidate in $(find .mumei/archive -maxdepth 3 -type d -name "$feature" 2>/dev/null) \
".mumei/specs/${feature}" \
".mumei/plans/${feature}"; do
if [[ -d "$candidate" ]]; then
feature_dir="$candidate"
break
fi
done
[[ -n "$feature_dir" ]] || { echo "feature not found: $feature" >&2; exit 1; }
# Cost-log backfill: if the feature has no cost-log.jsonl yet
# (older features may come up empty), try to recover the data from
# Claude Code's session logs. Always best-effort — graceful fail is
# mandatory. The script returns 0 even when no records can be
# recovered and writes a "partial backfill only" line to stderr.
cost_log="${feature_dir}/cost-log.jsonl"
if [[ ! -f "$cost_log" ]] || [[ "$(wc -c <"$cost_log")" -eq 0 ]]; then
bash "${CLAUDE_PLUGIN_ROOT}/scripts/cost-backfill.sh" "$feature_dir" || true
fi
# Delegate the heavy lifting to scripts/generate-muse.sh which knows
# how to read all the input files (including the now-possibly-backfilled
# cost-log.jsonl) and produce the markdown.
bash "${CLAUDE_PLUGIN_ROOT}/scripts/generate-muse.sh" "$feature_dir"
The generator script writes muse.md into feature_dir. Tell the user the path, then suggest committing it (when the feature lives under archive) or letting /mumei:shelve carry it along (when it's still under specs/plans).
The cost section in muse.md reflects whatever ended up in cost-log.jsonl after the backfill attempt: forward-recorded entries (from the SubagentStop hook), backfilled entries (from session logs), or — when neither path produced data — (no data) with a stderr warning that historical cost is unavailable.
# <feature> retrospective
## Metrics
- AC count: N
- Wave count: M
- Total tasks: T (X completed, Y pending)
- Spec review iters: requirements R / design D / tasks K (cap at 3 each)
- Phase 5 review iters: I (cap reached: yes/no)
- Total token cost: <input> in / <output> out / <cache_read> cached / <cache_create> new-cache
- Cache hit rate: <pct>%
- Wall-clock: created → done
## Patterns detected
- Incremental-fix spirals (iter N introduced a HIGH not in iter N-1): K instances
- Hook rule firing top 5: ...
- Files with most edits: ...
## Lessons (free-form, user-edited)
(empty placeholder for the user to fill)
## Process improvements suggested
- (auto-detected suggestions based on patterns)
(no data) and move on. A feature aborted mid-Phase 1 still benefits from a muse retrospective.feature_dir/muse.md exists, suggest a timestamped sibling instead.Provides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.
npx claudepluginhub hir4ta/mumei --plugin mumei