Distill knowledge from recent code changes
Updates knowledge files to match current codebase state from recent changes.
/plugin marketplace add MaxWolf-01/agents/plugin install mx@MaxWolf-01scope-or-instructionsYou are updating knowledge files to match the current state of the codebase.
User's instructions: $ARGUMENTS
If no specific instructions, do a full distillation since the last distill commit.
Look for the most recent commit with message starting with distill::
git log --oneline --grep="^distill:" -1
If none exists, this is the first refinement. Ask the user for a reasonable starting point or lookback period.
Get all commits since last refinement:
git log --oneline <last-refine-hash>..HEAD
Get the cumulative diff:
git diff <last-refine-hash>..HEAD
Check current state:
git status --short
If there are uncommitted changes, ask whether to include them (might be WIP from another agent).
Read task files that were touched (since the last refine-knowledge commit) — they provide context on what was being worked on, what's still brainstorming vs implemented.
Knowledge files describe what IS — grounded in code truth, not aspirational. They're the persistent reference that outlives individual tasks and sessions.
Examples of knowledge files:
stripe-integration linking to related subtopics and tasksCore principles:
Sources section — Same pattern as tasks. Link to code files, external docs, related knowledge. Mark MUST READ vs Reference.
Wiki-links are mandatory — Every knowledge file should link to related files. Orphan files are anti-pattern. The graph structure IS the value.
Describe what IS — Not what was planned, not speculation. Task files are future-oriented; knowledge files are present-tense ground truth.
Link, don't duplicate — Link to code files, don't embed snippets. Link to external docs, don't copy content. Future agents can fetch fresh.
USE principle — Don't write:
When to create a new file vs keep inline:
Split into a separate file when:
Keep inline when:
The test: If you'd say "see the section on X" → keep inline. If you'd say "see the doc on X" → split.
For each file in agent/knowledge/:
Base all updates on the code ground truth. Task files provide context (intent, what was explored) but knowledge files describe what IS, not what was planned.
Make targeted, factual updates:
Do NOT:
Ambiguities: If something is unclear — conflicting information, can't tell if code is intentional or WIP, etc. — use AskUserQuestion. Don't guess.
Secrets: Knowledge with private/secret information goes in agent/knowledge/private/.
Task files: Use a subagent to grep for active task files and present you with a one paragaph summary for each. Those task files that are completed shall be marked with "status: done", and commited together with the knowledge files.
Stage agent files:
git add agent/
Commit with refine-knowledge prefix:
git commit -m "distill: <brief summary>"
Examples:
distill: update tts-flow.md paths after processor refactordistill: add gotcha about Gemini rate limitsdistill: sync knowledge with recent auth changesTell the user what changed and why. If you had to make judgment calls, explain them.