Transform source documents into structured courses via the Teach authoring API. Use when building courses from existing content.
Transform source documents (markdown files, articles, documentation) into structured courses using the Teach authoring API. This skill analyzes source materials, proposes course structure, and creates courses via CLI scripts.
Source documents become structured learning paths, not just copied content.
The skill doesn't just copy files - it analyzes structure, infers units and lessons, identifies audience layers, and creates a coherent course with competencies.
Set the API URL (optional if using default):
export TEACH_API_URL="http://localhost:4100/api"
Start the authoring API:
cd /path/to/teach
pnpm dev:authoring-api
Analyze source documents to understand their structure.
deno run --allow-read --allow-env scripts/analyze-sources.ts /path/to/sources
This produces a course plan showing:
Review the generated plan with the user. Modify as needed:
If content needs expansion, use the research skill:
Create the course structure via API:
# Create the course
deno run --allow-net --allow-env scripts/create-course.ts \
--title "Working with AI" \
--description "A practical guide"
# Add units
deno run --allow-net --allow-env scripts/add-unit.ts \
--course-id <course-id> \
--title "Foundations"
# Add lessons with content
deno run --allow-net --allow-env --allow-read scripts/add-lesson.ts \
--unit-id <unit-id> \
--title "What AI Is and Isn't" \
--content-file /path/to/what-ai-is-and-isnt.md \
--audience-layer general
# Add competencies
deno run --allow-net --allow-env scripts/add-competency.ts \
--course-id <course-id> \
--name "Understanding AI Limitations" \
--cluster-name "AI Literacy"
Verify the course in the authoring UI:
Analyze a directory of markdown files and propose course structure.
# Human-readable output
deno run --allow-read --allow-env scripts/analyze-sources.ts /path/to/sources
# JSON output (for programmatic use)
deno run --allow-read --allow-env scripts/analyze-sources.ts /path/to/sources --json
What it does:
.md files (excluding READMEs)Create a new course.
deno run --allow-net --allow-env scripts/create-course.ts \
--title "Course Title" \
--description "Description" \
--json
Add a unit to a course.
deno run --allow-net --allow-env scripts/add-unit.ts \
--course-id <id> \
--title "Unit Title" \
--description "Description" \
--order 1
Add a lesson to a unit.
deno run --allow-net --allow-env --allow-read scripts/add-lesson.ts \
--unit-id <id> \
--title "Lesson Title" \
--description "Description" \
--content-file /path/to/content.md \
--audience-layer general \
--order 1
Audience layers:
general - Introductory content for all learnerspractitioner - Intermediate content for regular usersspecialist - Advanced/technical content for expertsAdd a competency to a course.
# Creates cluster if needed
deno run --allow-net --allow-env scripts/add-competency.ts \
--course-id <id> \
--name "Competency Name" \
--cluster-name "Cluster Name"
# Use existing cluster
deno run --allow-net --allow-env scripts/add-competency.ts \
--cluster-id <id> \
--name "Competency Name"
List existing courses.
deno run --allow-net --allow-env scripts/list-courses.ts
deno run --allow-net --allow-env scripts/list-courses.ts --json
User: "Build a course from inbox/ai-education/"
Workflow:
Analyze the source directory:
deno run --allow-read --allow-env scripts/analyze-sources.ts inbox/ai-education/
Review the proposed structure:
# Course Plan: AI Education
**Source:** inbox/ai-education/
**Total:** 12 lessons, ~15,000 words
## Proposed Structure
### 1. Layer 1: Foundations
- **What AI Is and Isn't** [general]
- **Basic Prompting** [general]
- **When to Use AI** [general]
- **Data and Privacy** [general]
### 2. Layer 2: Effective Use
- **Why AI Gives Mediocre Results** [practitioner]
- **Framework-First Prompting** [practitioner]
...
Confirm structure with user, then build:
# Create course
deno run --allow-net --allow-env scripts/create-course.ts \
--title "Working with AI: A Practical Guide" \
--description "Standalone articles about working effectively with AI tools"
# Get course ID from output, then create units and lessons...
Direct user to http://localhost:4101/courses/<id> to review
For content gaps:
For learning objectives:
For content design:
Problem: Just copying files without structure analysis Fix: Always run analyze-sources.ts first; review and refine structure
Problem: All lessons at same level without units Fix: Group related lessons into units; use directory structure as guide
Problem: Assuming source materials are complete Fix: Identify gaps; use research skill to expand; ask user about missing topics
Problem: Course without learning objectives Fix: Always add competencies; extract from headings or define explicitly
Course data is persisted via the authoring API:
apps/authoring-api/data/authoring.db| Data | Location | Access |
|---|---|---|
| Courses | API database | API or UI |
| Units | API database | API or UI |
| Lessons | API database | API or UI |
| Competencies | API database | API or UI |
| Source analysis | Console output | Re-run script |
# API endpoint (default: http://localhost:4100/api)
export TEACH_API_URL="http://localhost:4100/api"
# For research integration
export TAVILY_API_KEY="your-key-here"
The authoring API isn't running:
cd /path/to/teach
pnpm dev:authoring-api
Use list-courses.ts to verify course ID:
deno run --allow-net --allow-env scripts/list-courses.ts
Source directory may only contain READMEs (which are skipped):
.md files that aren't named README.md