/moe-learn
Train the MoE classification system from confirmed classifications and user feedback.
Usage
# Confirm a correct classification
/moe-learn --confirm <path> <actual_type>
# Confirm multiple from file
/moe-learn --batch <confirmations.json>
# Show pending confirmations
/moe-learn --pending
# Show learning statistics
/moe-learn --stats
# Export training data
/moe-learn --export <output.json>
# Bootstrap from frontmatter
/moe-learn --bootstrap <docs_path>
Arguments
| Argument | Description |
|---|---|
--confirm <path> <type> | Confirm classification for a specific document |
--batch <file> | Process batch confirmations from JSON file |
--pending | Show classifications awaiting confirmation |
--stats | Show learning system statistics |
--export <file> | Export training data to JSON |
--bootstrap <path> | Bootstrap from documents with frontmatter types |
System Prompt
You are the MoE Learning Manager. Execute the requested learning operation:
-
For --confirm: Record that a document was correctly or incorrectly classified
- Update analyst accuracy scores
- Recalculate dynamic weights
- Update calibration data
-
For --batch: Process multiple confirmations from a JSON file with format:
[{"path": "docs/file.md", "actual_type": "guide"}, ...] -
For --pending: List classifications that haven't been confirmed yet
-
For --stats: Show:
- Total classifications recorded
- Confirmation rate
- Overall accuracy
- Top/bottom analysts by accuracy
-
For --export: Export all training data for analysis
-
For --bootstrap: Scan directory for documents with frontmatter type declarations and use as ground truth
Execute by running:
import sys
sys.path.insert(0, 'scripts/moe_classifier')
from core.learning import get_learner
learner = get_learner()
# For --confirm:
learner.confirm_classification(document_path, actual_type)
# For --stats:
stats = learner.get_stats()
# For --pending:
pending = learner.get_pending_confirmations()
# For --bootstrap:
count = learner.bootstrap_from_frontmatter(docs_path)
Confirmation Format
When confirming classifications, the actual type must be one of:
agent- AI agent definitionscommand- Slash commandsskill- Reusable skillsguide- How-to guidesreference- Reference documentationworkflow- Workflow definitionsadr- Architecture Decision Recordsconfig- Configuration fileshook- Event hooksscript- Automation scripts
Examples
# Confirm correct classification
/moe-learn --confirm docs/guides/SETUP.md guide
# Correct a misclassification
/moe-learn --confirm agents/reviewer.md agent
# Check what needs confirmation
/moe-learn --pending
# See learning progress
/moe-learn --stats
# Bootstrap from existing typed docs
/moe-learn --bootstrap docs/
Related Commands
/moe-calibrate- Threshold and calibration management/moe-workflow- Full classification pipeline/classify- Classify documents
Success Output
When moe-learn completes:
✅ COMMAND COMPLETE: /moe-learn
Action: <confirm|batch|pending|stats|export|bootstrap>
Confirmed: N classifications
Accuracy: N%
Pending: N awaiting
Completion Checklist
Before marking complete:
- Operation identified
- Data processed
- Feedback recorded
- Stats updated
Failure Indicators
This command has FAILED if:
- ❌ No operation specified
- ❌ Invalid type provided
- ❌ Path not found
- ❌ Learning data corrupted
When NOT to Use
Do NOT use when:
- Just classifying (use /classify)
- Managing thresholds (use /moe-calibrate)
- Full pipeline (use /moe-workflow)
Anti-Patterns (Avoid)
| Anti-Pattern | Problem | Solution |
|---|---|---|
| Wrong type | Bad learning | Verify correct type |
| Skip pending | No feedback | Review pending regularly |
| No bootstrap | Slow learning | Bootstrap from frontmatter |
Principles
This command embodies:
- #9 Based on Facts - Learn from ground truth
- #6 Clear, Understandable - Clear learning stats
- #3 Complete Execution - Full learning cycle
Full Standard: CODITECT-STANDARD-AUTOMATION.md