Skip to main content

/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

ArgumentDescription
--confirm <path> <type>Confirm classification for a specific document
--batch <file>Process batch confirmations from JSON file
--pendingShow classifications awaiting confirmation
--statsShow 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:

  1. For --confirm: Record that a document was correctly or incorrectly classified

    • Update analyst accuracy scores
    • Recalculate dynamic weights
    • Update calibration data
  2. For --batch: Process multiple confirmations from a JSON file with format:

    [{"path": "docs/file.md", "actual_type": "guide"}, ...]
  3. For --pending: List classifications that haven't been confirmed yet

  4. For --stats: Show:

    • Total classifications recorded
    • Confirmation rate
    • Overall accuracy
    • Top/bottom analysts by accuracy
  5. For --export: Export all training data for analysis

  6. 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 definitions
  • command - Slash commands
  • skill - Reusable skills
  • guide - How-to guides
  • reference - Reference documentation
  • workflow - Workflow definitions
  • adr - Architecture Decision Records
  • config - Configuration files
  • hook - Event hooks
  • script - 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/
  • /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-PatternProblemSolution
Wrong typeBad learningVerify correct type
Skip pendingNo feedbackReview pending regularly
No bootstrapSlow learningBootstrap 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