| name | m2m |
| description | M2M compression scan, compile, promote, batch, and benchmark for 0102 documentation optimization |
| version | 1.0.0 |
| author | 66 |
| agents | [66] |
| domain | documentation_optimization |
| intent_type | COMPRESSION |
| promotion_state | production |
| user_invocable | true |
| category | workflow |
| evals | [] |
/m2m - M2M Compression Skill
Self-service M2M (machine-to-machine) documentation compression for 0102.
Commands
Parse the argument after /m2m to determine the subcommand:
/m2m or /m2m scan
Run M2M compression scan on the full repo. Show candidates with action levels.
from pathlib import Path
from modules.ai_intelligence.ai_overseer.src.m2m_compression_sentinel import M2MCompressionSentinel
sentinel = M2MCompressionSentinel(Path('.'))
result = sentinel.check(force=True)
print(f"Files scanned: {result['files_scanned']}")
print(f"Candidates: {result['candidates_found']}")
print(f"Auto-apply: {result['auto_apply_count']}")
print(f"Stage-promote: {result['stage_promote_count']}")
print(f"Stage-review: {result['stage_review_count']}")
print(f"Savings: {result['total_estimated_savings_percent']:.1f}%")
staged = sentinel.list_staged()
print(f"Currently staged: {staged['total_staged']}")
/m2m compile <path>
Compile a specific file to M2M format and save to .m2m/staged/.
sentinel = M2MCompressionSentinel(Path('.'))
result = sentinel.compile_to_staged("<path>", use_qwen=False)
If no path given, compile all unstaged auto_apply candidates.
/m2m promote <staged_path>
Promote a staged M2M file to live documentation. Creates backup automatically.
sentinel = M2MCompressionSentinel(Path('.'))
result = sentinel.promote_staged("<staged_path>")
/m2m rollback <target_path>
Rollback a promoted file to its original from backup.
sentinel = M2MCompressionSentinel(Path('.'))
result = sentinel.rollback("<target_path>")
/m2m batch <n>
Stage the next N unstaged auto_apply files (smallest first). Default: 10.
sentinel = M2MCompressionSentinel(Path('.'))
candidates_paths = sentinel._collect_candidate_files()
analyses = []
for fp in candidates_paths:
a = sentinel._analyze_file(fp)
if a and a.prose_density > 0.3 and a.action == 'auto_apply':
analyses.append(a)
analyses.sort(key=lambda a: a.line_count)
staged = sentinel.list_staged()
staged_names = {f['original_name'].strip() for f in staged['files']}
unstaged = [a for a in analyses if a.filename not in staged_names]
batch = unstaged[:N]
for a in batch:
result = sentinel.compile_to_staged(a.path, use_qwen=False)
/m2m benchmark
Run performance benchmarks on the M2M compression pipeline.
Execute the benchmark test suite:
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest modules/ai_intelligence/ai_overseer/tests/test_m2m_compression_sentinel.py::TestBenchmarks -v -s
/m2m eval
Evaluate M2M quality by comparing staged files against originals using HoloIndex embedding model.
sentinel = M2MCompressionSentinel(Path('.'))
result = sentinel.evaluate_staged()
/m2m status
Show current staged files and their status.
sentinel = M2MCompressionSentinel(Path('.'))
staged = sentinel.list_staged()
Execution
When invoked, run the appropriate Python code inline using the Bash tool. Report results in a compact table format. All operations are local and reversible.