LeoYeAI/agent-master-skills / skills/ai-shifu-course-creator
ai-shifu-course-creator
VerifiedConvert raw course material into optimized, runnable MarkdownFlow teaching scripts and deploy them as live courses through a five-phase pipeline covering segmentation, orchestration, generation, optimization, and deployment.
references/cli-reference.md
View on GitHub# CLI Reference
All commands use `{skillDir}/scripts/shifu-cli.py`. Prefix every call with:
```bash
python3 {skillDir}/scripts/shifu-cli.py <command>
```
## Authentication
Run login once — the token persists in `{skillDir}/.env` for subsequent commands:
```bash
# Step 1: Send SMS verification code
login --phone 13800138000 --region cn
# Step 2: Complete login with the code
login --phone 13800138000 --region cn --sms-code 123456
```
Region options: `cn` (maps to `https://app.ai-shifu.cn`) or `global` (maps to `https://app.ai-shifu.com`). You can also use `--base-url` to override the URL directly.
Alternatively, set environment variables or CLI flags:
- `--base-url` or `SHIFU_BASE_URL` in `.env`
- `--token` or `SHIFU_TOKEN` in `.env`
### Agent Login Flow
When no valid token is available, guide the user through login:
1. Ask the user to choose their region:
- 1: China mainland
- 2: Non-China-mainland
2. **If the user chooses non-China-mainland**: CLI login is not supported for this region. Tell the user to log in manually at `https://app.ai-shifu.com`, copy their token from the browser, and set it via `--token` or by adding `SHIFU_TOKEN=<token>` and `SHIFU_BASE_URL=https://app.ai-shifu.com` to `{skillDir}/.env`. Then stop — do not proceed with the SMS flow.
3. **If the user chooses China mainland**: continue with the SMS login flow below.
4. Ask for their registered phone number.
5. Send SMS code:
`python3 {skillDir}/scripts/shifu-cli.py login --phone <phone> --region cn`
6. Ask the user for the verification code they received.
7. Complete login:
`python3 {skillDir}/scripts/shifu-cli.py login --phone <phone> --region cn --sms-code <code>`
8. Token is automatically saved — proceed with the requested operation.
Always use CLI commands. Never make raw HTTP/API calls directly.
## Query Commands
```bash
list # List all courses
show <shifu_bid> # Show course details + outline tree
show <shifu_bid> <outline_bid> # Read a lesson's MDF content
history <shifu_bid> <outline_bid> # MDF revision history
export <shifu_bid> [-o file.json] # Export course as JSON
```
## Create Commands
```bash
create --name "Title" [--description "Desc"]
add-chapter <shifu_bid> --name "Chapter Name"
add-lesson <shifu_bid> --name "Name" --mdf-file lesson.md --parent-bid <chapter_bid>
```
## Update Commands
```bash
update-meta <shifu_bid> [--name "..."] [--description "..."] [--system-prompt-file prompt.md]
update-lesson <shifu_bid> <outline_bid> --mdf-file lesson.md # Uses optimistic locking
rename-lesson <shifu_bid> <outline_bid> --name "New Name"
reorder <shifu_bid> --order bid1,bid2,bid3
```
`update-lesson` fetches the current revision before saving. If another user modified the lesson since you last read it, the server returns a conflict.
## Delete Commands
```bash
delete-lesson <shifu_bid> <outline_bid>
```
## Bulk Import
```bash
# Flat JSON import
import <shifu_bid> --json-file course.json
import --new --json-file course.json
# One-step build + import from course directory
import <shifu_bid> --course-dir ./course-a/ [--title "..."] [--chapter-name "..."]
import --new --course-dir ./course-a/ [--title "..."] [--chapter-name "..."]
# Local build only (offline, generates shifu-import.json)
build --course-dir ./course-a/ [-o shifu-import.json] [--title "..."] [--chapter-name "..."]
```
The `build` command works entirely offline — it reads local MDF files and produces `shifu-import.json` without any network calls. The `import --course-dir` option combines build + import in one step.
Build behavior:
- **Course title** resolution order: `--title` CLI arg -> first heading in `README.md` -> directory name
- **Chapter structure**: if `structure.json` exists, generates multi-chapter structure per its definition; otherwise creates a single chapter (named via `--chapter-name` or defaults to course title) containing all `lesson-*.md` files in sorted order
- **Lesson title** resolution order: `title` field in `structure.json` -> `lesson_title: ...` line in MDF content -> filename derived (e.g., `lesson-01.md` -> "Lesson 01")
## State Management
```bash
publish <shifu_bid> # Publish course (makes it live)
archive <shifu_bid> # Archive course
unarchive <shifu_bid> # Restore archived course
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |