name: didacu-create-course description: Generate an interactive educational course on didacu.com with AI-powered slides, quizzes, and progress tracking. Use when the user wants to create a learning course, study a topic, understand a codebase, or generate educational content. argument-hint: "[topic]" allowed-tools: Bash(python3 *), Bash(curl *), Read, Glob, Grep
Create a Didacu Course (Interactive)
You are helping the user generate an educational course on didacu.com. Courses have interactive slides, embedded quizzes, and progress tracking — all generated by AI. Your job is to deeply understand what they want to learn before triggering generation.
Step 0: Authenticate
Check if credentials exist:
python3 ~/.claude/skills/didacu-create-course/scripts/auth.py
This returns JSON. If "authenticated": true, extract api_key and api_url and proceed. If authentication fails, stop and tell the user to try again.
Step 1: Understand the topic
If the user passed a topic as $ARGUMENTS, start with that. Otherwise ask what they want to learn about.
Codebase-first mindset: Users are running this inside Claude Code, so they often want to learn about what they're working on right now. Prompts like "how does auth work in this project", "explain our data model", or "onboard me to this repo" are common and expected — treat them as codebase-aware requests and proactively explore the relevant files.
Then have a conversation to understand their needs. Ask these one or two at a time, naturally — don't dump a list:
What specifically? — Narrow the topic. If they reference their codebase (e.g. "explain the API layer", "how does this service work"), ask which parts or modules they care about most. If it's a general topic, sharpen it — "React" is too broad, "React server components and when to use them" is good.
Why? — What's their goal? Onboarding to a new project, preparing for a code review, understanding a module before refactoring, studying for an interview? This shapes the tone and examples.
What do you already know? — Their experience level with THIS topic (not programming in general). This determines the starting point and depth.
How deep? — Based on their answers, suggest one of:
- Overview (~10 min, 3 sections, costs 1 credit) — Quick intro, great for "what is this?"
- Standard (~25 min, 5 sections, costs 3 credits) — Solid coverage, good default
- Comprehensive (60+ min, 7 sections, costs 5 credits) — Thorough deep-dive
Note: Users get 3 free overview courses per week (no credits needed). Higher depths require credits.
Anything specific to focus on? — Particular aspects, use cases, or pain points they care about.
Adapt your questions based on context. If they're clearly a beginner asking about a broad topic, don't ask about advanced focus areas. If they're an expert, don't explain what depth levels mean. If they pointed at their codebase, skip generic questions and focus on what parts of the code to include.
Step 2: Gather file context
Since this runs inside Claude Code, you have full access to the user's project files. Use this actively — it's the main advantage over creating a course on the website.
If the user's topic relates to their codebase (even loosely), explore the relevant code:
- Use
GlobandGrepto find relevant files - Use
Readto read key files (entry points, configs, the specific modules they want to understand) - Summarize what you find — identify patterns, architecture, key abstractions
- Build an
additionalContextstring with the important parts (keep under 40KB)
Don't just dump file contents. Extract what matters: function signatures, type definitions, data flow, architecture patterns. The AI course generator needs understanding, not raw code.
If the codebase is large, ask the user which parts matter most. If the topic is purely academic (e.g. "quantum computing"), skip this step.
Step 3: Confirm and generate
Summarize what you're about to create:
- Topic and scope
- Depth level (and credit cost)
- Key focus areas
- Any codebase context included
Ask "Does this look right?" before proceeding.
Step 4: Call the API
curl -s -X POST <api_url>/api/v1/courses/generate \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '<JSON_BODY>'
JSON body:
{
"topic": "the specific topic",
"depth": "overview" | "standard" | "comprehensive",
"difficulty": "beginner" | "intermediate" | "advanced",
"language": "en",
"learnerContext": {
"purpose": "...",
"experience": "...",
"additionalNotes": "..."
},
"additionalContext": "summarized codebase context, file contents, etc."
}
Step 5: Handle the response
Check the HTTP status and response JSON:
- 201 (success): The response includes
courseId,slug, andurl. Tell the user the course is generating (1-5 min depending on depth) and share theurlfield directly. Do NOT poll status. - 403 with credit error: The response includes
error,creditBalance,creditCost,freeCoursesRemaining, anddepth. Show the user a clear message:- Display their current credit balance and the cost of the requested depth.
- If
freeCoursesRemaining > 0and they requested a non-overview depth, suggest trying"overview"depth (uses a free slot, no credits needed). - If they have some credits but not enough, suggest a cheaper depth (overview=1, standard=3, comprehensive=5).
- Always mention they can buy credits at https://didacu.com/pricing.
- Offer to retry with a different depth.
- 401: Authentication issue — tell the user to re-authenticate.
- 400: Invalid request — show the error message.
- Other errors: Show the raw error and suggest retrying.