When this fires
Project or milestone completion. User wants to distill what was learned, what patterns emerged, what to reuse. Writes docs/matilha/den/<date>-<topic>.md.
Preconditions
project-status.mdexists.- At least one wave completed.
Execution Workflow
- Read completed waves from project-status.md via Read tool.
- Prompt user for topic (e.g., "auth system patterns").
- Read relevant wave outputs (commits via Bash, spec/plan/review_report via Read) for the topic.
- Synthesize via Write into
docs/matilha/den/<date>-<topic>.mdwith sections: context, patterns observed, decisions + why, would-do-differently. - Update project-status.md
recent_decisionswith pointer to the den file.
Rules: Do
- Cite specific commits + files in findings.
- Include "would-do-differently" section (honest retrospective).
- Timestamp the filename.
Rules: Don't
- Delete existing den files (keep history).
- Write generic advice (be specific to THIS project).
Expected Behavior
Knowledge captured in navigable markdown that informs future /matilha-pack packaging.
Quality Gates
- Den file exists at
docs/matilha/den/<date>-<topic>.md. - Cited commits are real (verifiable via git log).
Companion Integration
No companion integrations in Wave 4a.
Output Artifacts
docs/matilha/den/<date>-<topic>.md.
Example Constraint Language
- Use "must" for: cite wave(s) being distilled.
- Use "should" for: include would-do-differently.
- Use "may" for: split across multiple files for a large project.
Troubleshooting
- "no waves completed": Run
/matilha-gatherfirst. - "topic too broad": Split into multiple den files per sub-topic.
CLI shortcut (optional)
matilha den <topic>(future CLI command; not shipped yet).