Scaffold a new course: $ARGUMENTS
Inputs
Parse the arguments for:
- slug (required) — e.g.,
mdna-primer
- title (required) — e.g., "mDNA Primer: Recovering the Genetics of Ecclesia"
- pathway (optional) — one of: reframation, metanoia, mdna, mx, mdna
If any required input is missing, ask the user.
Before Starting
- Read
_docs/COURSE_STRATEGY.md — the authoritative reference for the 8-week structure and canonical section order
- Read
src/lib/database/schema.ts — find courses, courseWeeks, courseLessons table definitions
- Read
src/lib/schemas/course-learn.ts — understand SECTION_TYPES
- Read
src/lib/config/lesson-types.ts — canonical type list
- Read
scripts/ingest-mdna-course.ts for insert patterns
Course Structure (8 Weeks)
Every course follows this exact structure. 8 weeks total, numbered 1–8. No Week 0.
Week 1 — Introduction & Orientation
| # |
section_type |
Sidebar label |
Purpose |
| 1 |
video |
"Opening video" |
Course promise, who it's for, what to expect |
| 2 |
reading |
(none) |
Course overview: 8-week structure, transformation loop, cohort norms |
| 3 |
chat_dissonance |
"Context discovery" |
Baseline context capture for AI personalisation |
| 4 |
looking_ahead |
(none) |
What happens next; Week 2 preview |
Weeks 2–7 — Core Transformation Modules (The Loop)
Each week follows this order — do not deviate:
| # |
section_type |
Sidebar label |
Purpose |
| 1 |
video |
"Opening video" |
Alan delivers the week's concept (~5 min) |
| 2 |
chat_dissonance |
"Dissonance" |
AI conversation that surfaces tension before the reading |
| 3 |
reading |
(none) |
Main teaching: 2,000–3,500 words |
| 4 |
case_study |
(none) |
Witness: a concrete story that makes the concept real |
| 5 |
chat_action |
"Action step" |
AI conversation: name one concrete step |
| 6 |
chat_reflection |
"Reflection" |
AI conversation: look back after acting |
| 7 |
discussion |
"Cohort meeting" |
Group discussion prompt (share + respond) |
| 8 |
reflection |
"Exit ticket" |
Three close options + next week preview |
Week 8 — Synthesis & Sending
| # |
section_type |
Sidebar label |
Purpose |
| 1 |
chat_dissonance |
"Dissonance" |
The tension between "learned it" and "living it" |
| 2 |
reading |
(none) |
The ecosystem alive — all elements as one system |
| 3 |
case_study |
(none) |
Witness: synthesis and sending |
| 4 |
chat_action |
"Action step" |
Name the 30/60/90 day plan |
| 5 |
chat_reflection |
"Reflection" |
Evidence of change |
| 6 |
discussion |
"Cohort meeting" |
Cohort reflects on the ecosystem |
| 7 |
integration |
(none) |
Week 8 commitment framework |
| 8 |
video |
"Sending video" |
Alan sends the learner — a charge, not a graduation |
| 9 |
reading |
(none) |
Synthesis and sending (final teaching) |
| 10 |
chat_reflection |
"Reflection" |
Final reflection |
| 11 |
field_experiment |
(none) |
The written 30/60/90 day plan |
| 12 |
discussion |
"Commissioning" |
Commissioning session |
| 13 |
integration |
(none) |
Final commitment |
| 14 |
lordship_opening |
(none) |
Sending liturgy (7-movement ritual) |
| 15 |
reflection |
"Exit ticket" |
Course close |
Process
Step 1: Create the ingestion script
Create scripts/scaffold-course-[slug].ts that:
- Connects to the database using the project's postgres/Drizzle setup
- Creates the
courses row with:
- title, slug, description (placeholder), status: "draft"
- duration_weeks: 8
- course_type: "formation"
- pathway_themes:
["<pathway>"] if pathway provided
- organization_id from env TENANT_ORG_ID
- Creates 8
courseWeeks rows (week_number 1–8) with:
- Week 1: "Introduction & Orientation"
- Weeks 2–7: "Week N — [TBD]" (theme to be authored)
- Week 8: "Week 8 — Synthesis & Sending"
- order_index matching week_number
- Creates
courseLessons rows for each week following the canonical section order above
- Each lesson: title (descriptive placeholder), slug (auto-generated from title + week), section_type, section_order (global counter), week_id, course_id, status: "draft", content: "" (empty — to be authored via
/course-author)
- Use the sidebar labels from the tables above where they exist; null otherwise
Step 2: Optionally scaffold markdown files
Ask the user if they also want a markdown content directory. If yes, create:
content-library/courses/[slug]/
course-manifest.json
week-01-introduction.md
week-02-[theme].md
...
week-08-synthesis.md
Each markdown file should have section headers matching the transformation loop:
## Week 2 — Opening Video
[Content TBD — ~700 words, ~5 min]
## Week 2 — Dissonance
[Content TBD — 200-350 words]
## Week 2 — Main Teaching
[Content TBD — 2,000-3,500 words]
## Week 2 — Case Study
[Content TBD — 300-600 words]
## Week 2 — Action Step
[Content TBD — 150-250 words]
## Week 2 — Reflection
[Content TBD — 150-250 words]
## Week 2 — Cohort Meeting
[Content TBD — 200-400 words]
## Week 2 — Exit Ticket
[Content TBD — 150-250 words]
The manifest should list all lessons with ids, types, and week assignments.
Step 3: Report
Output a summary:
- Course created: title (slug)
- Weeks: 8
- Total sections: N
- Sections per week breakdown
- Next steps: "Use
/course-author to generate content for each section"
Rules
- 8 weeks exactly. Week 1 = introduction, Week 8 = synthesis and sending. No Week 0.
- Transformation loop order is fixed for Weeks 2–7: video → chat_dissonance → reading → case_study → chat_action → chat_reflection → discussion → reflection
- Use env TENANT_ORG_ID for organization_id scoping
- Set all content to draft status
- Follow the project's postgres insert patterns from
scripts/ingest-mdna-course.ts
- Never hardcode UUIDs — let the database generate them
- Validate the slug doesn't already exist before inserting
- Reference
_docs/COURSE_STRATEGY.md for any structure questions — it is the authoritative source
1---2name: course-scaffold-23description: Scaffold a new 8-week course with all canonical section types, database rows, and optional markdown file structure. Use when creating a new course from scratch.4---56Scaffold a new course: $ARGUMENTS78## Inputs910Parse the arguments for:11- **slug** (required) — e.g., `mdna-primer`12- **title** (required) — e.g., "mDNA Primer: Recovering the Genetics of Ecclesia"13- **pathway** (optional) — one of: reframation, metanoia, mdna, mx, mdna1415If any required input is missing, ask the user.1617## Before Starting18191. Read `_docs/COURSE_STRATEGY.md` — the authoritative reference for the 8-week structure and canonical section order202. Read `src/lib/database/schema.ts` — find `courses`, `courseWeeks`, `courseLessons` table definitions213. Read `src/lib/schemas/course-learn.ts` — understand SECTION_TYPES224. Read `src/lib/config/lesson-types.ts` — canonical type list235. Read `scripts/ingest-mdna-course.ts` for insert patterns2425## Course Structure (8 Weeks)2627Every course follows this exact structure. **8 weeks total, numbered 1–8. No Week 0.**2829### Week 1 — Introduction & Orientation3031| # | section_type | Sidebar label | Purpose |32|---|-------------|---------------|---------|33| 1 | `video` | "Opening video" | Course promise, who it's for, what to expect |34| 2 | `reading` | *(none)* | Course overview: 8-week structure, transformation loop, cohort norms |35| 3 | `chat_dissonance` | "Context discovery" | Baseline context capture for AI personalisation |36| 4 | `looking_ahead` | *(none)* | What happens next; Week 2 preview |3738### Weeks 2–7 — Core Transformation Modules (The Loop)3940Each week follows this order — **do not deviate**:4142| # | section_type | Sidebar label | Purpose |43|---|-------------|---------------|---------|44| 1 | `video` | "Opening video" | Alan delivers the week's concept (~5 min) |45| 2 | `chat_dissonance` | "Dissonance" | AI conversation that surfaces tension before the reading |46| 3 | `reading` | *(none)* | Main teaching: 2,000–3,500 words |47| 4 | `case_study` | *(none)* | Witness: a concrete story that makes the concept real |48| 5 | `chat_action` | "Action step" | AI conversation: name one concrete step |49| 6 | `chat_reflection` | "Reflection" | AI conversation: look back after acting |50| 7 | `discussion` | "Cohort meeting" | Group discussion prompt (share + respond) |51| 8 | `reflection` | "Exit ticket" | Three close options + next week preview |5253### Week 8 — Synthesis & Sending5455| # | section_type | Sidebar label | Purpose |56|---|-------------|---------------|---------|57| 1 | `chat_dissonance` | "Dissonance" | The tension between "learned it" and "living it" |58| 2 | `reading` | *(none)* | The ecosystem alive — all elements as one system |59| 3 | `case_study` | *(none)* | Witness: synthesis and sending |60| 4 | `chat_action` | "Action step" | Name the 30/60/90 day plan |61| 5 | `chat_reflection` | "Reflection" | Evidence of change |62| 6 | `discussion` | "Cohort meeting" | Cohort reflects on the ecosystem |63| 7 | `integration` | *(none)* | Week 8 commitment framework |64| 8 | `video` | "Sending video" | Alan sends the learner — a charge, not a graduation |65| 9 | `reading` | *(none)* | Synthesis and sending (final teaching) |66| 10 | `chat_reflection` | "Reflection" | Final reflection |67| 11 | `field_experiment` | *(none)* | The written 30/60/90 day plan |68| 12 | `discussion` | "Commissioning" | Commissioning session |69| 13 | `integration` | *(none)* | Final commitment |70| 14 | `lordship_opening` | *(none)* | Sending liturgy (7-movement ritual) |71| 15 | `reflection` | "Exit ticket" | Course close |7273---7475## Process7677### Step 1: Create the ingestion script7879Create `scripts/scaffold-course-[slug].ts` that:80811. Connects to the database using the project's postgres/Drizzle setup822. Creates the `courses` row with:83 - title, slug, description (placeholder), status: "draft"84 - duration_weeks: 885 - course_type: "formation"86 - pathway_themes: `["<pathway>"]` if pathway provided87 - organization_id from env TENANT_ORG_ID883. Creates 8 `courseWeeks` rows (week_number 1–8) with:89 - Week 1: "Introduction & Orientation"90 - Weeks 2–7: "Week N — [TBD]" (theme to be authored)91 - Week 8: "Week 8 — Synthesis & Sending"92 - order_index matching week_number934. Creates `courseLessons` rows for each week following the canonical section order above94 - Each lesson: title (descriptive placeholder), slug (auto-generated from title + week), section_type, section_order (global counter), week_id, course_id, status: "draft", content: "" (empty — to be authored via `/course-author`)95 - Use the sidebar labels from the tables above where they exist; null otherwise9697### Step 2: Optionally scaffold markdown files9899Ask the user if they also want a markdown content directory. If yes, create:100101```102content-library/courses/[slug]/103 course-manifest.json104 week-01-introduction.md105 week-02-[theme].md106 ...107 week-08-synthesis.md108```109110Each markdown file should have section headers matching the transformation loop:111112```markdown113## Week 2 — Opening Video114[Content TBD — ~700 words, ~5 min]115116## Week 2 — Dissonance117[Content TBD — 200-350 words]118119## Week 2 — Main Teaching120[Content TBD — 2,000-3,500 words]121122## Week 2 — Case Study123[Content TBD — 300-600 words]124125## Week 2 — Action Step126[Content TBD — 150-250 words]127128## Week 2 — Reflection129[Content TBD — 150-250 words]130131## Week 2 — Cohort Meeting132[Content TBD — 200-400 words]133134## Week 2 — Exit Ticket135[Content TBD — 150-250 words]136```137138The manifest should list all lessons with ids, types, and week assignments.139140### Step 3: Report141142Output a summary:143- Course created: title (slug)144- Weeks: 8145- Total sections: N146- Sections per week breakdown147- Next steps: "Use `/course-author` to generate content for each section"148149---150151## Rules152153- **8 weeks exactly.** Week 1 = introduction, Week 8 = synthesis and sending. No Week 0.154- **Transformation loop order is fixed** for Weeks 2–7: video → chat_dissonance → reading → case_study → chat_action → chat_reflection → discussion → reflection155- Use env TENANT_ORG_ID for organization_id scoping156- Set all content to draft status157- Follow the project's postgres insert patterns from `scripts/ingest-mdna-course.ts`158- Never hardcode UUIDs — let the database generate them159- Validate the slug doesn't already exist before inserting160- Reference `_docs/COURSE_STRATEGY.md` for any structure questions — it is the authoritative source