Skip to content

Open-source Python skill for adapting noisy course materials into MarkdownFlow-ready lesson segments (OpenClaw/Claude/Codex compatible).

License

Notifications You must be signed in to change notification settings

ai-shifu/mdf-material-adapter

mdf-material-adapter

中文文档

Production-ready adapter that transforms noisy transcripts or course docs into stable lesson segmentation candidates for MarkdownFlow generation while preserving code blocks, images, and key terms.

Use Cases

  • Raw transcripts are noisy (filler words, repeated phrases) and need deterministic lesson splits.
  • Source material mixes prose, code blocks, and images that must be preserved.
  • You need a structured intermediate artifact before MarkdownFlow lesson script generation.

Non-Goals

  • It does not rewrite course conclusions or alter factual claims.
  • It is not a full instructional design system and does not output final teaching scripts.
  • It does not perform OCR or extract text from binary assets.

Quickstart (3 minutes)

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
mdf-material-adapter --input examples/sample_input.md --output output.json
python -m json.tool output.json | head -n 50

JSON Output Example

{
  "meta": {
    "adapter": "mdf-material-adapter",
    "version": "0.1.0",
    "segment_count": 4
  },
  "ordered_segments": [
    {
      "segment_id": "seg-001",
      "segment_type": "concept",
      "preserve_block": "no"
    },
    {
      "segment_id": "seg-002",
      "segment_type": "code",
      "preserve_block": "yes"
    }
  ],
  "lesson_candidates": [
    {
      "lesson_id": "lesson-01",
      "core_question": "What is the core learning question in this segment?"
    }
  ]
}

Design: Skill Core + Adapters

  • Skill Core (src/mdf_material_adapter/core.py): denoise, semantic segmentation, immutable block indexing, migration cues.
  • CLI Adapter (src/mdf_material_adapter/cli.py): file-in/file-out interface for scripts and pipelines.
  • Ecosystem Adapters:
    • OpenClaw: tool.json + examples/openclaw_demo.md
    • Claude: examples/claude_function_calling.md
    • Codex: scripts/codex_task.md

Relationship to AI-Shifu

This repository is one step in AI-Shifu's course production pipeline: adapting raw material before lesson-level script generation.

Development

pip install -e ".[dev]"
pytest -q

About

Open-source Python skill for adapting noisy course materials into MarkdownFlow-ready lesson segments (OpenClaw/Claude/Codex compatible).

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Languages