-
Notifications
You must be signed in to change notification settings - Fork 520
Description
Feature Request
Add a hook that triggers before context compaction (or session end) to check if there's anything worth compounding, and if so, automatically run the /workflows:compound command.
Motivation
The /workflows:compound command captures valuable knowledge - solved problems, learnings, patterns discovered - but requires manual invocation. By the time you think to run it, the context may have already been compacted or the session ended, losing that valuable context.
A pre-compact hook would ensure knowledge gets captured at the optimal moment - when the full context is still available and fresh.
Proposed Behavior
- Trigger: Before context compaction or session end
- Check: Analyze the session for compoundable content:
- Problems that were solved
- Significant debugging sessions
- Pattern discoveries or learnings
- Non-trivial fixes with root cause analysis
- Action: If compoundable content is detected, prompt to run
/workflows:compound(or auto-run based on user preference)
Acceptance Criteria
- Hook triggers before context compaction
- Intelligently detects if session contains compoundable material
- Respects user preference (prompt vs auto-run)
- Doesn't trigger for trivial sessions (simple Q&A, quick fixes)
- Works with the existing
/workflows:compoundcommand
Context
Discussed in the Every Discord. This aligns with the core plugin philosophy: "Each unit of engineering work should make subsequent units of work easier—not harder."
Currently, the /workflows:compound command has auto-invoke trigger phrases like "that worked" and "it's fixed", but a pre-compact hook would provide a safety net for capturing knowledge before context is lost.
Related
/workflows:compoundcommand:plugins/compound-engineering/commands/workflows/compound.md- Existing auto-invoke triggers (lines 166-169 in compound.md)