A Python CLI system for AI-assisted adaptation of training course modules. One person maintains base content; Claude adapts it for unlimited audiences and locales.
generate-variant.py— Core CLI: reads a module (base.md+metadata.yaml), calls Claude API, writes an audience-adapted variant tovariants/upload-to-moodle.py— Uploads generated variants to a local Moodle LMS via Docker for previewprompts/adapt.md— Version-controlled system prompt governing Claude's adaptation behaviorRUBRIC.md— Quality scoring rubric (1–5 per dimension) for evaluating base modules and variantsexample-course/— Working example: Prompt Engineering Fundamentals (4 modules: concept, demo, exercise, assessment)variants/— Generated output (gitignored exceptmanifest.yaml)
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
export ANTHROPIC_API_KEY=your_key_here # or add to .env# Generate a variant
python3 generate-variant.py --module example-course/01-concept --audience developer
python3 generate-variant.py --module example-course/02-demo --audience executive --locale es-MX
# Start local Moodle (Docker)
docker compose up -d
# Upload variants to Moodle (first time)
python upload-to-moodle.py --setup-moodle
# Subsequent runs
python upload-to-moodle.py| Preset | Who they are |
|---|---|
developer |
Engineers building with LLMs/APIs — technical, mechanism-first |
executive |
Senior leaders — ROI framing, business outcomes |
champion |
Internal trainers — facilitation notes, timing, debrief prompts |
technical-writer |
Doc professionals — structured authoring analogies |
Custom audiences are supported: --audience "healthcare compliance officers with no prior AI experience"
Each module is a directory with exactly two files:
01-concept/
├── base.md # Content — plain Markdown, audience-agnostic
└── metadata.yaml # Structured data: ID, type, objectives, version, tags
Module types: concept | demo | exercise | assessment
- Create a subdirectory (e.g.,
my-course/) - Add numbered module subdirectories with
base.md+metadata.yaml - Score each module against
RUBRIC.md— must score ≥3 on all dimensions before publishing - Generate variants:
python3 generate-variant.py --module my-course/01-concept --audience developer
Every generation appends to variants/manifest.yaml — the audit trail tracking module ID, audience, locale, output file, timestamp, model, and token counts (for cost visibility).
base.mdhas no front matter — the script prepends YAML front matter to each generated variantprompts/adapt.mdis version-controlled — changes affect all future variants; commit with a clear rationale message- Generated variant files are gitignored; only
manifest.yamlis committed - Add audience presets by extending
AUDIENCE_PROFILESdict ingenerate-variant.py - Module IDs (e.g.,
pe-fundamentals-01) are stable across versions and used as manifest keys
anthropic>=0.40.0— Claude API clientpyyaml>=6.0— metadata parsing and manifest writespython-dotenv>=1.0—.envfile support for API keyrequests>=2.31.0— Moodle REST API callsmarkdown>=3.5.0— Markdown-to-HTML conversion for Moodle upload