Files
video-create/.claude/skills/video-from-script/references/account-system.md
sion123 86b9b7948d feat(video-from-script): 重构工作流为子Agent分步执行并新增提示词模板系统
将视频制作工作流拆分为独立子步骤:分镜 → 图片提示词 → 生图 → 视频提示词 → 生视频 → 成片,每步由子Agent独立执行。引入prompts/目录统一管理提示词模板(分镜.md、图片提示词.md、视频提示词.md),通过account.json的storyboardPrompt/imageStylePrompt/videoStylePrompt字段引用。

变更内容:
- 新增confirmed机制和pipeline.js confirm命令,生图后必须人工确认才能继续
- manifest schema改用shotDesc/narration/duration/directorRef替代旧字段
- 文件命名规则从keyword改为slug(从shotDesc/narration派生)
- 删除旧的storyboard-rules.md和prompt-rules.md
- pipeline.js脚本拆分为lib/目录下的独立模块(cmd-init/cmd-confirm/cmd-validate/phase-*)
- 新增cmd-create-account支持一键创建带prompts目录的账号
- capcut_assemble支持narration字段替代text作为字幕源
- 新增.gitclaude/settings.json权限配置
2026-04-30 21:18:31 +08:00

177 lines
5.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 账号系统规范
> 每个账号独立管理视觉风格、提示词策略和 CapCut 配置。
> 一个账号可以有多种视觉风格,每种风格是一个独立的 style 文件。
---
## 目录结构
```
accounts/ # 项目根目录下
├── _template/ # 新账号模板(复制此目录创建新账号)
│ ├── account.json
│ ├── prompts/ # 提示词模板目录(子 Agent 系统提示词)
│ │ └── .gitkeep
│ ├── references/ # 参考图目录
│ │ └── .gitkeep
│ └── styles/ # 风格文件目录(可多个)
│ └── .gitkeep
└── {account}/ # 用户创建的账号(目录名 = account.json 的 id输出目录用 name 命名)
├── account.json
├── prompts/ # 提示词模板(账号专属)
│ ├── 分镜.md # 口播文案 → 分镜表
│ ├── 图片提示词.md # shotDesc → imagePrompt
│ └── 视频提示词.md # shotDesc → videoPrompt
├── references/ # 参考图(所有风格共用)
│ ├── ref_001.png
│ └── ref_002.png
└── styles/ # 风格文件(一个文件 = 一种视觉风格)
├── cyberpunk-character.md
├── dark-archive.md
└── neon-city.md
```
---
## account.json 字段说明
```json
{
"id": "tech-talk",
"name": "科技解说",
"description": "科技类短视频账号,深色背景,赛博朋克风格",
"imageModel": "gemini",
"videoModel": "kling",
"batchSize": 30,
"storyboardPrompt": "prompts/分镜.md",
"imageStylePrompt": "prompts/图片提示词.md",
"videoStylePrompt": "prompts/视频提示词.md",
"capcut": {
"effects": ["录制边框 III"],
"filter": "电影感:40",
"subtitleStyle": {
"fontSize": 36,
"color": "#FFFFFF",
"highlightColor": "#FF6B35",
"bold": true
},
"defaultBGM": "https://example.com/bgm_tech.mp3"
}
}
```
| 字段 | 类型 | 说明 |
|------|------|------|
| `id` | string | 账号唯一标识(与目录名一致) |
| `name` | string | 账号显示名 |
| `description` | string | 一句话描述 |
| `defaultFormat` | string | 默认画幅9:16 / 16:9 / 1:1 / 4:3 |
| `imageModel` | string | 默认图片模型 |
| `videoModel` | string | 默认视频模型 |
| `batchSize` | number | 默认批量生成数量 |
| `storyboardPrompt` | string | 分镜提示词模板路径(相对于账号目录) |
| `imageStylePrompt` | string | 图片提示词模板路径(相对于账号目录) |
| `videoStylePrompt` | string | 视频提示词模板路径(相对于账号目录) |
| `capcut.effects` | string[] | CapCut 特效名称列表 |
| `capcut.filter` | string | CapCut 滤镜,格式 "名称:强度" |
| `capcut.subtitleStyle` | object | 字幕样式(字号、颜色、高亮色、加粗) |
| `capcut.defaultBGM` | string | 默认背景音乐 URL |
---
## 提示词模板prompts/
每个账号在 `prompts/` 目录下维护三个子 Agent 提示词模板:
| 文件 | 用途 | Step |
|------|------|------|
| `分镜.md` | 口播文案 → 分镜表shotDesc/narration/duration/directorRef | Step 1 |
| `图片提示词.md` | shotDesc + directorRef → imagePrompt | Step 2-A |
| `视频提示词.md` | shotDesc + directorRef → videoPrompt | Step 3-A |
这些文件定义了子 Agent 的角色、入参、出参、词库和示例。路径在 account.json 中以相对路径引用Agent 读取 account.json 后自动定位。
### 与 style 文件的关系
- **prompts/** — 子 Agent 的系统提示词(定义 HOW 生成提示词)
- **styles/** — 视觉规则参考(定义 WHAT 风格应该长什么样:颜色、构图、禁止项)
- prompts 模板内部会引用 styles 中定义的色彩体系、构图规则等
---
## 风格文件styles/
每种视觉风格一个文件,文件名即风格名。文件内包含视觉规则参考。
### 风格文件结构
```markdown
# 风格名称
一句话描述风格。
---
## 核心视觉要素
### 色调方案
### 构图模式
### 示例
### 模型参数MJ/Gemini/Kling
### 禁止项
```
### 风格文件命名
使用中文命名,直观识别:
- `赛博东方角色.md`
- `暗黑禁书档案.md`
- `霓虹城市.md`
- `水墨山水.md`
---
## 创建新账号
### 一键创建(推荐)
```bash
node scripts/pipeline.js create-account \
--id military \
--name "军事账号" \
--desc "军事主题短视频,暗黑漫画风格" \
--video-model veo3-fast-frames \
--references ./ref1.png,./ref2.png
```
自动完成:创建目录 → 生成 account.json → 复制参考图 → 上传 OSS → 回写 URL → 生成风格骨架。
### 手动创建
1. 复制 `_template/` 目录,重命名为账号 ID
2. 编辑 `account.json` 填写账号信息(含 prompts 路径)
3.`prompts/` 中放入提示词模板(从 `工作流程/` 草稿区复制)
4.`references/` 中放入参考图(所有风格共用)
5. 上传参考图到 OSSURL 写入 account.json
- `node scripts/oss-upload.js ../../accounts/{id}/references/{图片文件}`
- 将返回的 URL 写入 `styles.{styleName}.references[].url`
6.`styles/` 中创建风格文件(至少一个)
### 校验账号
```bash
node scripts/pipeline.js validate-account --account military
```
检查id 匹配、必填字段、prompts 模板存在、参考图完整性、风格文件存在、OSS URL 有效。
## 添加新风格
在账号的 `styles/` 目录下新建 `.md` 文件即可,文件名即风格 ID。
Claude 调用时指定风格名,如 "用 cyberpunk-eastern-character 风格"。