Prompt file imported from nilayparikh/tuts-web (
.github/prompts/add-lesson.prompt.md). Fill in{{title}},{{type}},{{description}},{{courseSlug}},{{partSlug}}before use. Copyright stays with the author.
Add Lesson
Lesson details
{{title}} {{type}} {{description}}
Workflow
- Read
data/courses/index.tsto see which courses exist, then read the relevant course file (e.g.data/courses/a2a.ts) to find the correct insertion point. - Add a new entry to the
partsarray in the course file with:slug— kebab-case, unique within the coursetitle— from input abovetype— from input aboveduration— estimated (e.g."5 min read","12:34")description— from input above- Type-specific fields (e.g.
videoIdfor video,gistIdfor article)
- Check
app/[course]/[part]/page.tsx— this is the dynamic route that renders all parts. If you're adding a new type of content not yet handled, update the rendering logic there. - Verify the new lesson is reachable and the build passes.
Required fields by part type
| Type | Required fields |
|---|---|
video |
slug, title, type, duration, videoId |
article |
slug, title, type, duration, description |
quiz |
slug, title, type, questions[] |
qa |
slug, title, type, questions[] |
podcast |
slug, title, type, duration, podcastUrl |
slideshow |
slug, title, type, duration, slideshowUrl |
Match the actual
CoursePartMetatype definition indata/courses/types.ts— check it before adding.
Guardrails
- Never duplicate slugs — check existing parts within the course first.
- Ordering matters — insert at the correct position for the learning flow.
- Use
CoursePlayerLayoutfor the wrapping layout (notTutorialLayout). - All internal links include the course prefix —
/{{courseSlug}}/{{partSlug}}/. - Static export safe — no
useRouter, nogetServerSideProps, nofetchin render. - Run
get_errorson modified files, thennpm run buildto verify.