Curate and load contexts with quality gate filtering and memory synthesis
Filters contexts by quality, extracts relevant information, and synthesizes a curated memory context for your task.
/plugin marketplace add eLafo/centauro/plugin install centauro@hermesYou are orchestrating a 3-phase context curation pipeline that filters contexts by quality, extracts relevant information, and synthesizes a curated memory context.
Coordinate three phases with dynamic scaling:
This command requires the Context Engineering skill. If not loaded, invoke centauro:context-engineering before proceeding.
task (required): Task description for curation quality-threshold (optional): Minimum quality score (0.00-1.00), default: 0.70
Examples:
# Use default threshold (0.70)
/centauro:curate "Add OAuth2 authentication"
# Custom strict threshold
/centauro:curate "Add OAuth2 authentication" --quality-threshold 0.85
# Custom lenient threshold
/centauro:curate "Add OAuth2 authentication" --quality-threshold 0.60
Validate quality-threshold:
If quality-threshold provided:
- Must be number between 0.00 and 1.00
- If outside range ā Error message with correct range
If not provided:
- Use default: 0.70 (Grade C minimum)
Example validation:
ā
Arguments validated:
- Task: "Add OAuth2 authentication"
- Quality threshold: 0.70 (Grade C minimum)
Count total contexts:
find .centauro/contexts -name "*.md" | wc -l
Display:
š Context Repository Status:
- Total contexts: [N] files
- Directory: .centauro/contexts/
Purpose: Token-efficient filtering
Use the Task tool to launch context-scanner agent:
Analyze all contexts using frontmatter-only scan and apply quality gate.
TASK: [user's task description]
QUALITY_THRESHOLD: [validated threshold]
CONTEXT_DIRECTORY: .centauro/contexts/
Process:
1. Scan frontmatter of all .md files in context directories
2. Apply quality gate: Include only contexts where estimated_quality >= [threshold]
3. Assess task relevance for passing contexts
4. Return three lists: PASS, FAIL, NO_QUALITY
Return structured output with:
- PASS list (quality + relevance scores)
- FAIL list (with reasons)
- NO_QUALITY list (missing metadata)
- Machine-readable format for Phase 2 handoff
Extract from scanner output:
Handle NO_QUALITY contexts:
If NO_QUALITY list is not empty:
ā ļø Quality Gate: [N] contexts missing quality metadata
Contexts without quality scores:
- [file1.md]
- [file2.md]
...
Options:
A) Skip them (safest, fastest) - Proceed without these contexts
B) Load anyway (ignore gate) - Include in Phase 2 without quality check
C) Auto-assess now (adds ~30s) - Run quality assessment first
Your choice? [A/B/C]
Wait for user input. If user chooses C, they should run /centauro:assess-quality first (future command).
ā
Phase 1 Complete: Frontmatter Scan
**Quality Gate Results:**
- Threshold: [0.XX] (Grade [X] minimum)
- ā
PASS: [N] contexts (meet quality + relevant)
- ā FAIL: [M] contexts (below threshold)
- ā ļø NO_QUALITY: [P] contexts (missing metadata)
**Top Passing Contexts:**
1. [file1.md] - Quality: 0.XX, Relevance: 0.XX
2. [file2.md] - Quality: 0.XX, Relevance: 0.XX
3. [file3.md] - Quality: 0.XX, Relevance: 0.XX
... (top 5)
**Proceeding to Phase 2 with [N] contexts**
If PASS list is empty:
ā No contexts passed quality gate
All contexts failed the quality threshold of [0.XX].
Suggestions:
1. Lower threshold: Try --quality-threshold 0.60
2. Check context quality: Run /centauro:assess-quality
3. Use simpler command: /centauro:load (no quality gate)
Stop execution if PASS list empty.
Purpose: Extract relevant information from quality-approved contexts
Group PASS list by component type:
c1-instructions: [file1.md, file2.md, ...]
c2-knowledge: [file3.md, file4.md, ...]
c4-memory: [file5.md, ...]
c5-state: [file6.md, ...]
Estimate Phase 2 token cost:
tokens_per_file = 3000 (average)
total_tokens = PASS_count Ć 3000
If total_tokens > 50,000:
ā ļø High Token Usage Detected
Phase 2 will process [N] contexts (~[X]K tokens estimated).
This may take longer and consume more resources.
Options:
A) Load all (may be slow, ~[Y] seconds)
B) Load top 10 by relevance only
C) Raise threshold to 0.[higher] for fewer contexts
D) Load only CRITICAL priority contexts
Your choice? [A/B/C/D]
Wait for user input. Adjust PASS list based on choice.
Launch N context-manager agents in parallel (one per component type with passing files).
IMPORTANT: Use a single message with multiple Task tool calls for true parallelism.
For each component type with passing files:
Extract relevant information from [component] contexts for the task.
TASK: [user's task description]
COMPONENT: [c1-instructions|c2-knowledge|c4-memory|c5-state]
FILES TO PROCESS:
- path/to/file1.md
- path/to/file2.md
...
For each file:
1. Read full content
2. Extract key methodologies/knowledge/memory/state relevant to task
3. Identify unique insights
4. Summarize in 3-5 bullet points
Return structured summary:
FILE: [path]
SUMMARY: [1-2 sentences]
KEY_POINTS:
- [Point 1]
- [Point 2]
...
Example for 3 component types:
Launch all 3 agents simultaneously in one message:
Collect all extraction summaries from parallel agents.
Display Phase 2 Summary:
ā
Phase 2 Complete: Content Extraction
**Extracts by Component:**
- c1-instructions: [N] contexts extracted
- c2-knowledge: [M] contexts extracted
- c4-memory: [P] contexts extracted
- c5-state: [Q] contexts extracted
**Total:** [X] contexts processed
**Estimated tokens:** ~[Y]K
**Time:** ~[Z] seconds
**Sample extracts:**
ā c1-instructions/auth_workflow.md: "OAuth2 authorization code flow with PKCE..."
ā c2-knowledge/oauth2_guide.md: "4 grant types, auth code most secure..."
... (top 3)
**Proceeding to Phase 3: Memory Synthesis**
Purpose: Create unified memory context
extracted_contexts = total number of contexts from Phase 2
If extracted_contexts < 15:
ā STRATEGY = "simple"
ā AGENTS = 1 (memory-meta-synthesizer)
If extracted_contexts >= 15:
ā STRATEGY = "parallel"
ā AGENTS = 4 + 1 (component-synthesizers + meta-synthesizer)
Display:
š Phase 3 Strategy: [simple|parallel]
- Extracted contexts: [N]
- Synthesis mode: [simple (1 agent) | parallel (5 agents)]
Launch 1 memory-meta-synthesizer agent:
Create unified memory context from Phase 2 extracts.
MODE: simple
TASK: [user's task description]
QUALITY_THRESHOLD: [threshold used]
EXTRACTS: [All Phase 2 summaries]
Process:
1. Aggregate all extracts
2. Identify cross-component patterns
3. Detect dependencies and relationships
4. Synthesize unified memory context
5. Auto-generate filename: memory_curation_[task-slug]_[timestamp].md
6. Ensure .centauro/contexts/c4-memory/curated/ directory exists
7. Write synthesized memory to curated folder
8. Return file path and confirmation
Include in memory:
- Component summaries (c1, c2, c4, c5)
- Cross-component patterns
- Dependencies
- Contradictions (if any)
- Implementation guidance
- Provenance (source contexts)
- Quality self-assessment
Phase 3a: Launch 4 component-synthesizer agents in parallel
IMPORTANT: Use a single message with multiple Task tool calls.
For each component with extracts:
Synthesize all [component] extracts into consolidated summary.
COMPONENT_TYPE: [c1-instructions|c2-knowledge|c4-memory|c5-state]
TASK: [user's task description]
EXTRACTS: [All Phase 2 summaries for this component]
Process:
1. Read all extracts for this component type
2. Identify patterns (consensus/complementary/unique)
3. Consolidate information
4. Flag contradictions
5. Provide source attribution
6. Return component-level summary
Follow component-specific synthesis structure.
Launch all 4 simultaneously.
Phase 3b: After 3a completes, launch 1 memory-meta-synthesizer agent:
Create unified memory context from component summaries.
MODE: meta
TASK: [user's task description]
QUALITY_THRESHOLD: [threshold used]
COMPONENT_SUMMARIES: [All Phase 3a outputs]
Process:
1. Take pre-synthesized component summaries
2. Identify cross-component patterns
3. Map dependencies and relationships
4. Synthesize holistic memory context
5. Auto-generate filename: memory_curation_[task-slug]_[timestamp].md
6. Ensure .centauro/contexts/c4-memory/curated/ directory exists
7. Write synthesized memory to curated folder
8. Return file path and confirmation
Include in memory:
- Component summaries (from Phase 3a)
- Cross-component patterns
- Dependencies
- Contradictions (if any)
- Implementation guidance
- Provenance (source contexts)
- Quality self-assessment
ā
Phase 3 Complete: Memory Synthesis
**Synthesis Mode:** [simple|parallel]
**Component summaries:** [N if parallel, else "direct"]
**Cross-patterns identified:** [X]
**Dependencies mapped:** [Y]
**Memory Context Created:**
š `.centauro/contexts/c4-memory/curated/memory_curation_[slug]_[timestamp].md`
Present comprehensive summary:
# ā
Context Curation Complete
## Curation Summary
**Task:** [user's task description]
**Quality Threshold:** [0.XX] (Grade [X] minimum)
**Total Time:** ~[X] seconds
## Pipeline Results
### Phase 1: Frontmatter Scan
- Contexts scanned: [N]
- Passed quality gate: [M]
- Failed quality gate: [P]
- Missing quality metadata: [Q]
### Phase 2: Content Extraction
- Contexts extracted: [M]
- Components involved: [c1, c2, c4, c5]
- Token usage: ~[X]K
### Phase 3: Memory Synthesis
- Mode: [simple|parallel]
- Agents used: [1|5]
- Cross-patterns identified: [Y]
## Curated Memory Context
**Location:** `.centauro/contexts/c4-memory/curated/memory_curation_[slug]_[timestamp].md`
**Content includes:**
- Methodologies from [N] c1 contexts
- Knowledge from [M] c2 contexts
- Historical decisions from [P] c4 contexts
- Current state from [Q] c5 contexts
**Estimated Quality:** Grade [A-F] (self-assessed)
## Next Steps
**You can now:**
1. **View the curated memory:**
```bash
Read .centauro/contexts/c4-memory/curated/memory_curation_[slug]_[timestamp].md
Use in future sessions: The curated memory is now a c4-memory context. It will be scanned in future curations.
Load for current task: The synthesized information is available for your task: "[task]"
Share with team: Share the curated memory file with teammates working on similar tasks.
Ready to proceed with your task!
---
## Error Handling
### Invalid Quality Threshold
```markdown
ā Invalid quality threshold: [value]
Quality threshold must be a number between 0.00 and 1.00.
Examples:
- 0.60 (Grade D+ minimum)
- 0.70 (Grade C minimum) ā default
- 0.80 (Grade B- minimum)
- 0.90 (Grade A- minimum)
Usage: /centauro:curate "task" --quality-threshold 0.80
ā Context directory not found: .centauro/contexts/
This command requires a context repository.
Action:
1. Initialize: /centauro:setup
2. Or check directory path
ā Phase 1 failed: Context scanner error
Error: [error message from agent]
Action:
- Check .centauro/contexts/ directory exists
- Check contexts have valid YAML frontmatter
- Try: /centauro:load (simpler alternative)
ā Phase 2 failed: Extraction error in [component]
Error: [error message from agent]
Partial results available from:
- ā
c1-instructions: [N] contexts
- ā
c2-knowledge: [M] contexts
- ā c4-memory: Failed
Continue with partial results? (yes/no)
ā Phase 3 failed: Synthesis error
Error: [error message from agent]
Extraction completed successfully ([N] contexts).
Synthesis could not complete.
Action:
- Check .centauro/contexts/c4-memory/curated/ permissions
- Phase 2 extracts are available but not synthesized
- You can manually review Phase 2 results
Automation First: This command should be highly automated. Only prompt user for critical decisions (NO_QUALITY handling, high token usage).
Clear Communication: Always explain what's happening at each phase. Include progress indicators.
Adaptive Scaling: Automatically choose synthesis strategy based on workload. User doesn't need to think about it.
Graceful Degradation: If some contexts fail, continue with what works. Don't fail completely.
Token Efficiency: Phase 1 reads only frontmatter. Only Phase 2 reads full content of quality-approved contexts.
Parallel Execution: Launch multiple agents simultaneously when possible (Phase 2, Phase 3a).
This command complements:
/centauro:detect - Analysis without loading/centauro:load - Simpler loading without quality gate/centauro:build - Create new contexts/centauro:reflect - Update contexts after task completionTypical workflow:
/centauro:curate "task" ā Quality-filtered curation/centauro:reflect ā Extract learnings, update contextsA successful curation:
/centauro:load with quality filtering/centauro:load for simpler, faster loading without quality gate/centauro:assess-quality (future command) to batch-assess contexts