huobao-drama (Agent Skills)

GitHub

๐ŸŽฌ ็ซๅฎ็Ÿญๅ‰ง - ๅŸบไบŽAI็š„ไธ€็ซ™ๅผ็Ÿญๅ‰ง็”Ÿๆˆๅนณๅฐ ใ€Šไธ€ๅฅ่ฏ็”ŸๆˆๅฎŒๆ•ด็Ÿญๅ‰ง๏ผŒไปŽๅ‰งๆœฌๅˆฐๆˆ็‰‡ๅ…จ่‡ชๅŠจๅŒ–ใ€‹ Huobao Drama - An AI-Powered End-to-End Short Drama Generator "One Sentence to Complete Drama: Fully Automated from Script to Final Video"

13,975 stars Vue 1 Rule Files Full Docs MCP View JSON API

CLAUDE.md

# CLAUDE.md

## Project Overview

Huobao Drama โ€” AI-powered drama/video production tool. Full TypeScript stack.

## Structure

```
backend/   โ€” Hono + Drizzle ORM + Mastra (AI agents) + mysql2
backend/workspace/ โ€” Agent ๅทฅไฝœ็›ฎๅฝ•๏ผˆMastra Workspace jail ๆ น๏ผ‰
backend/workspace/skills/ โ€” Agent SKILL.md definitions
frontend/  โ€” Nuxt 3 + Vue 3 + TypeScript (pure CSS, no UI framework)
configs/   โ€” config.yaml
data/      โ€” generated static files
```

## Commands

### Backend (`backend/`)
- `npm run dev` โ€” Start dev server with tsx watch (port 5679)
- `npm start` โ€” Start production server
- `npm run typecheck` โ€” TypeScript type checking

### Frontend (`frontend/`)
- `npm run dev` โ€” Vite dev server (port 3013, proxies /api to 5679)
- `npm run build` โ€” Production build

## Architecture

### Backend
- **HTTP**: Hono framework with CORS, logger middleware
- **Database**: Drizzle ORM + mysql2, schema in `src/db/schema.ts`
- **AI Agents**: Mastra framework with AI SDK (OpenAI compatible providers)
- **Agent Types**: script_rewriter, extractor, storyboard_breaker, grid_prompt_generator
- **Agent Chat**: Hono JSON endpoints for agent responses
- **File Storage**: Local filesystem under `data/static/`

### Frontend
- **Vue 3** + TypeScript + Vite
- **Routing**: Vue Router (4 routes: list, detail, workbench, settings)
- **State**: Single composable `useWorkbench.ts` for workbench page
- **API**: Unified fetch client in `src/api/index.ts` with SSE async generator
- **Styling**: Pure CSS with CSS variables (dark theme)

## Database
MySQL is the only runtime database. The backend reads `DATABASE_URL` first, then falls back to `MYSQL_HOST`, `MYSQL_PORT`, `MYSQL_USER`, `MYSQL_PASSWORD`, and `MYSQL_DATABASE`.
Tables are created on startup from `src/db/mysql-schema.ts`.

## Key Config
- `configs/config.yaml` โ€” AI provider defaults
- AI service configs stored in DB (`ai_service_configs` table)
- Agent configs stored in DB (`agent_configs` table)