AI短剧提示词工厂 (AI Drama Prompt Factory) 端到端将小说或故事创意转化为结构化提示词包,输出标准JSON供外部AI生成工具消费。 系统边界:只生产提示词数据,不做图片/视频/音频的实际生成。 --- ⚡ 启动协议(每次任务开始时必须执行) 任何短剧相关任务触发后,在执行任何工作之前,必须先向用户确认以下信息: Step 1:确认项目类型 向用户确认: - A 小说改编 — 用户提供小说/故事文本,改编为短剧提示词 - B 原创短剧 — 用户提供创意/主题,从零创建短剧提示词 Step 2:确认执行模式 向用户确认交付方式: - 🚀 全程模式 — 一次跑完全部Phase,中间不停,最终一次性交付所有产出文件 - 📋 分阶段模式 — 每个Phase完成后输出交付物,等用户确认/修改后再进入下一阶段(推荐) - 🎯 单阶段模式 — 只执行用户指定的某个Phase(需已有前序Phase的产出) Step 3:确认基础参数 向用户确认: - 视觉风格 — 电影写实 / 日系动漫 / 2.5D(默认:电影写实) - 剧本风格 — 标准叙事 / 爽文漫剧(默认:标准叙事) - 目标集数 — 预计多少集(可后续调整) - 每集时长 — 1分钟 / 2分钟 / 3分钟(默认:1-2分钟) - 剧本分镜Markdown输出 — 是否同时输出可读性更强的Markdow…

, line)\n if header_match:\n level = len(header_match.group(1))\n title = header_match.group(2).strip()\n \n if current_section:\n current_section['end_line'] = i\n current_section['content_preview'] = '\\n'.join(\n lines[current_section['start_line']:min(current_section['start_line']+5, i)]\n )\n sections.append(current_section)\n \n current_section = {\n 'title': title,\n 'level': level,\n 'start_line': i + 1,\n 'end_line': None,\n }\n \n # 处理最后一个章节\n if current_section:\n current_section['end_line'] = len(lines)\n current_section['content_preview'] = '\\n'.join(\n lines[current_section['start_line']:min(current_section['start_line']+5, len(lines))]\n )\n sections.append(current_section)\n \n return {\n 'type': 'markdown',\n 'total_lines': len(lines),\n 'sections': sections,\n 'keywords': extract_keywords(content),\n }\n\n\nclass PythonParser:\n \"\"\"Python 代码解析器\"\"\"\n \n @staticmethod\n def parse(content: str, filepath: str) -> Dict[str, Any]:\n lines = content.split('\\n')\n sections = []\n \n # 匹配类和函数定义\n patterns = [\n (r'^class\\s+(\\w+)', 'class'),\n (r'^def\\s+(\\w+)', 'function'),\n (r'^async\\s+def\\s+(\\w+)', 'async_function'),\n ]\n \n for i, line in enumerate(lines):\n for pattern, section_type in patterns:\n match = re.match(pattern, line)\n if match:\n # 获取文档字符串预览\n docstring = ''\n if i + 1 \u003c len(lines):\n next_lines = lines[i+1:i+6]\n for nl in next_lines:\n if '\"\"\"' in nl or \"'''\" in nl:\n docstring = nl.strip().strip('\"\"\"').strip(\"'''\")\n break\n \n sections.append({\n 'title': match.group(1),\n 'type': section_type,\n 'start_line': i + 1,\n 'docstring': docstring,\n })\n \n return {\n 'type': 'python',\n 'total_lines': len(lines),\n 'sections': sections,\n 'keywords': extract_keywords(content),\n }\n\n\nclass JSONParser:\n \"\"\"JSON 文档解析器\"\"\"\n \n @staticmethod\n def parse(content: str, filepath: str) -> Dict[str, Any]:\n try:\n data = json.loads(content)\n return {\n 'type': 'json',\n 'total_lines': len(content.split('\\n')),\n 'structure': JSONParser._extract_structure(data),\n 'keywords': extract_keywords(content),\n }\n except json.JSONDecodeError:\n return {\n 'type': 'json',\n 'total_lines': len(content.split('\\n')),\n 'structure': {'error': 'Invalid JSON'},\n 'keywords': [],\n }\n \n @staticmethod\n def _extract_structure(data, depth=0, max_depth=3) -> Dict[str, Any]:\n if depth >= max_depth:\n return {'type': type(data).__name__, 'truncated': True}\n \n if isinstance(data, dict):\n return {\n 'type': 'object',\n 'keys': list(data.keys())[:20],\n 'children': {k: JSONParser._extract_structure(v, depth+1, max_depth) \n for k, v in list(data.items())[:10]}\n }\n elif isinstance(data, list):\n return {\n 'type': 'array',\n 'length': len(data),\n 'sample': JSONParser._extract_structure(data[0], depth+1, max_depth) if data else None\n }\n else:\n return {'type': type(data).__name__}\n\n\nclass TextParser:\n \"\"\"纯文本解析器 - 按段落分割\"\"\"\n \n @staticmethod\n def parse(content: str, filepath: str) -> Dict[str, Any]:\n lines = content.split('\\n')\n paragraphs = []\n current_para = {'start_line': 1, 'text': ''}\n \n for i, line in enumerate(lines):\n if line.strip() == '':\n if current_para['text'].strip():\n current_para['end_line'] = i\n current_para['preview'] = current_para['text'][:200]\n paragraphs.append(current_para)\n current_para = {'start_line': i + 2, 'text': ''}\n else:\n current_para['text'] += line + '\\n'\n \n # 最后一段\n if current_para['text'].strip():\n current_para['end_line'] = len(lines)\n current_para['preview'] = current_para['text'][:200]\n paragraphs.append(current_para)\n \n return {\n 'type': 'text',\n 'total_lines': len(lines),\n 'paragraphs': len(paragraphs),\n 'sections': [{'title': f'段落 {i+1}', 'start_line': p['start_line'], \n 'end_line': p['end_line'], 'preview': p['preview']} \n for i, p in enumerate(paragraphs[:50])],\n 'keywords': extract_keywords(content),\n }\n\n\nclass HTMLParser:\n \"\"\"HTML 文档解析器\"\"\"\n \n @staticmethod\n def parse(content: str, filepath: str) -> Dict[str, Any]:\n lines = content.split('\\n')\n sections = []\n \n # 匹配主要的结构标签\n for i, line in enumerate(lines):\n for tag in ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'section', 'article', 'header', 'footer', 'main', 'nav']:\n pattern = rf'\u003c{tag}[^>]*>([^\u003c]*)\u003c/{tag}>'\n match = re.search(pattern, line, re.IGNORECASE)\n if match:\n sections.append({\n 'title': match.group(1).strip() or f'\u003c{tag}>',\n 'type': tag,\n 'start_line': i + 1,\n })\n \n return {\n 'type': 'html',\n 'total_lines': len(lines),\n 'sections': sections,\n 'keywords': extract_keywords(re.sub(r'\u003c[^>]+>', '', content)), # 移除HTML标签后提取关键词\n }\n\n\nclass GenericCodeParser:\n \"\"\"通用代码解析器\"\"\"\n \n @staticmethod\n def parse(content: str, filepath: str) -> Dict[str, Any]:\n lines = content.split('\\n')\n sections = []\n \n # 通用函数/类匹配模式\n patterns = [\n (r'^\\s*(function|def|async\\s+function|async\\s+def)\\s+(\\w+)', 'function'),\n (r'^\\s*(class)\\s+(\\w+)', 'class'),\n (r'^\\s*(const|let|var)\\s+(\\w+)\\s*=\\s*(async\\s+)?\\(', 'arrow_function'),\n (r'^\\s*export\\s+(default\\s+)?(function|class|const)\\s+(\\w+)', 'export'),\n ]\n \n for i, line in enumerate(lines):\n for pattern, section_type in patterns:\n match = re.match(pattern, line)\n if match:\n name = match.groups()[-1] if match.groups() else 'unknown'\n sections.append({\n 'title': name,\n 'type': section_type,\n 'start_line': i + 1,\n })\n \n return {\n 'type': 'code',\n 'total_lines': len(lines),\n 'sections': sections,\n 'keywords': extract_keywords(content),\n }\n\n\n# 解析器映射\nPARSERS = {\n 'markdown': MarkdownParser,\n 'python': PythonParser,\n 'json': JSONParser,\n 'yaml': JSONParser, # YAML 也用 JSON 解析器(简化)\n 'text': TextParser,\n 'html': HTMLParser,\n 'javascript': GenericCodeParser,\n 'typescript': GenericCodeParser,\n 'css': GenericCodeParser,\n 'xml': HTMLParser,\n 'csv': TextParser,\n 'sql': GenericCodeParser,\n 'shell': GenericCodeParser,\n}\n\n\ndef index_file(filepath: str) -> Optional[Dict[str, Any]]:\n \"\"\"索引单个文件\"\"\"\n path = Path(filepath)\n \n if not path.exists():\n return None\n \n ext = path.suffix.lower()\n if ext not in SUPPORTED_EXTENSIONS:\n return None\n \n try:\n with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:\n content = f.read()\n except Exception as e:\n return {'error': str(e), 'filepath': filepath}\n \n parser_type = SUPPORTED_EXTENSIONS[ext]\n parser = PARSERS.get(parser_type, TextParser)\n \n result = parser.parse(content, filepath)\n result.update({\n 'filepath': str(path.absolute()),\n 'filename': path.name,\n 'extension': ext,\n 'size_bytes': path.stat().st_size,\n 'modified_time': datetime.fromtimestamp(path.stat().st_mtime).isoformat(),\n 'hash': get_file_hash(filepath),\n })\n \n return result\n\n\ndef index_directory(dirpath: str, recursive: bool = True) -> Dict[str, Any]:\n \"\"\"索引整个目录\"\"\"\n path = Path(dirpath)\n \n if not path.exists() or not path.is_dir():\n return {'error': f'目录不存在: {dirpath}'}\n \n files = []\n if recursive:\n for ext in SUPPORTED_EXTENSIONS.keys():\n files.extend(path.rglob(f'*{ext}'))\n else:\n for ext in SUPPORTED_EXTENSIONS.keys():\n files.extend(path.glob(f'*{ext}'))\n \n indexed_files = []\n total_lines = 0\n all_keywords = []\n \n for f in files:\n # 跳过隐藏文件和常见忽略目录\n if any(part.startswith('.') or part in ['node_modules', '__pycache__', 'venv', '.git'] \n for part in f.parts):\n continue\n \n result = index_file(str(f))\n if result and 'error' not in result:\n indexed_files.append(result)\n total_lines += result.get('total_lines', 0)\n all_keywords.extend(result.get('keywords', []))\n \n # 汇总关键词\n keyword_freq = {}\n for kw in all_keywords:\n keyword_freq[kw] = keyword_freq.get(kw, 0) + 1\n top_keywords = sorted(keyword_freq.items(), key=lambda x: x[1], reverse=True)[:50]\n \n return {\n 'type': 'directory',\n 'path': str(path.absolute()),\n 'total_files': len(indexed_files),\n 'total_lines': total_lines,\n 'files': indexed_files,\n 'top_keywords': [kw for kw, _ in top_keywords],\n 'indexed_at': datetime.now().isoformat(),\n }\n\n\ndef main():\n parser = argparse.ArgumentParser(description='文档索引器 - 快速扫描文档结构')\n parser.add_argument('path', help='文档路径或目录')\n parser.add_argument('--output', '-o', default='doc_index.json', help='输出索引文件路径')\n parser.add_argument('--update', '-u', action='store_true', help='增量更新现有索引')\n parser.add_argument('--no-recursive', action='store_true', help='不递归扫描子目录')\n \n args = parser.parse_args()\n path = Path(args.path)\n \n if not path.exists():\n print(f'❌ 路径不存在: {args.path}')\n return 1\n \n print(f'📚 正在索引: {args.path}')\n \n if path.is_file():\n result = index_file(str(path))\n if result:\n result = {'type': 'single_file', 'files': [result], 'indexed_at': datetime.now().isoformat()}\n else:\n result = index_directory(str(path), recursive=not args.no_recursive)\n \n if 'error' in result:\n print(f'❌ 索引失败: {result[\"error\"]}')\n return 1\n \n # 保存索引\n output_path = Path(args.output)\n with open(output_path, 'w', encoding='utf-8') as f:\n json.dump(result, f, ensure_ascii=False, indent=2)\n \n # 打印摘要\n if result['type'] == 'directory':\n print(f'✅ 索引完成!')\n print(f' 📁 文件数: {result[\"total_files\"]}')\n print(f' 📝 总行数: {result[\"total_lines\"]}')\n print(f' 🔑 关键词: {\", \".join(result[\"top_keywords\"][:10])}')\n else:\n file_info = result['files'][0]\n print(f'✅ 索引完成!')\n print(f' 📄 文件: {file_info[\"filename\"]}')\n print(f' 📝 行数: {file_info[\"total_lines\"]}')\n if 'sections' in file_info:\n print(f' 📑 章节数: {len(file_info[\"sections\"])}')\n \n print(f' 💾 索引保存至: {output_path}')\n \n return 0\n\n\nif __name__ == '__main__':\n exit(main())\n","content_type":"text/x-python; charset=utf-8","language":"python","size":15276,"content_sha256":"67ebeb8ab47ddd40bc28f31ea6c8952ed7c02ab8262bb1c6df43d550eb52160b"},{"filename":"scripts/doc_search.py","content":"#!/usr/bin/env python3\n\"\"\"\ndoc_search.py - 文档搜索器\n在已索引的文档中搜索关键词,返回匹配的上下文\n\n用法:\n python3 doc_search.py --index doc_index.json --query \"关键词\"\n python3 doc_search.py --index doc_index.json --query \"关键词1 关键词2\" --context 3\n\"\"\"\n\nimport argparse\nimport json\nimport re\nfrom pathlib import Path\nfrom typing import Dict, List, Any, Tuple\n\n\ndef load_index(index_path: str) -> Dict[str, Any]:\n \"\"\"加载索引文件\"\"\"\n with open(index_path, 'r', encoding='utf-8') as f:\n return json.load(f)\n\n\ndef search_in_file(filepath: str, keywords: List[str], context_lines: int = 2, \n max_matches: int = 10) -> List[Dict[str, Any]]:\n \"\"\"在文件中搜索关键词\"\"\"\n try:\n with open(filepath, 'r', encoding='utf-8', errors='ignore') as f:\n lines = f.readlines()\n except Exception as e:\n return [{'error': str(e)}]\n \n matches = []\n \n # 构建正则表达式(大小写不敏感)\n patterns = [re.compile(re.escape(kw), re.IGNORECASE) for kw in keywords]\n \n for i, line in enumerate(lines):\n # 检查是否匹配任一关键词\n matched_keywords = []\n for kw, pattern in zip(keywords, patterns):\n if pattern.search(line):\n matched_keywords.append(kw)\n \n if matched_keywords:\n # 获取上下文\n start_idx = max(0, i - context_lines)\n end_idx = min(len(lines), i + context_lines + 1)\n \n context = []\n for j in range(start_idx, end_idx):\n prefix = '>>>' if j == i else ' '\n context.append(f'{j+1:4d} {prefix} {lines[j].rstrip()}')\n \n matches.append({\n 'line_number': i + 1,\n 'matched_keywords': matched_keywords,\n 'line': line.strip(),\n 'context': '\\n'.join(context),\n })\n \n if len(matches) >= max_matches:\n break\n \n return matches\n\n\ndef search_in_index(index: Dict[str, Any], keywords: List[str], \n context_lines: int = 2, max_matches_per_file: int = 5) -> Dict[str, Any]:\n \"\"\"在整个索引中搜索\"\"\"\n files = index.get('files', [])\n results = []\n total_matches = 0\n \n for file_info in files:\n filepath = file_info['filepath']\n filename = file_info['filename']\n \n # 先检查索引中的关键词\n file_keywords = set(file_info.get('keywords', []))\n keyword_hits = sum(1 for kw in keywords if kw.lower() in \n (k.lower() for k in file_keywords))\n \n # 在文件中搜索\n matches = search_in_file(filepath, keywords, context_lines, max_matches_per_file)\n \n if matches and 'error' not in matches[0]:\n results.append({\n 'filename': filename,\n 'filepath': filepath,\n 'keyword_relevance': keyword_hits / len(keywords) if keywords else 0,\n 'matches': matches,\n 'match_count': len(matches),\n })\n total_matches += len(matches)\n \n # 按相关性排序\n results.sort(key=lambda x: (x['match_count'], x['keyword_relevance']), reverse=True)\n \n return {\n 'query': keywords,\n 'total_files_searched': len(files),\n 'files_with_matches': len(results),\n 'total_matches': total_matches,\n 'results': results,\n }\n\n\ndef highlight_keywords(text: str, keywords: List[str]) -> str:\n \"\"\"高亮关键词(用 ** 包裹)\"\"\"\n for kw in keywords:\n pattern = re.compile(f'({re.escape(kw)})', re.IGNORECASE)\n text = pattern.sub(r'**\\1**', text)\n return text\n\n\ndef format_results(search_results: Dict[str, Any], show_context: bool = True) -> str:\n \"\"\"格式化搜索结果\"\"\"\n output = []\n \n query = ' '.join(search_results['query'])\n output.append(f'🔍 搜索: \"{query}\"')\n output.append(f'📁 搜索文件数: {search_results[\"total_files_searched\"]}')\n output.append(f'✅ 匹配文件数: {search_results[\"files_with_matches\"]}')\n output.append(f'📍 总匹配数: {search_results[\"total_matches\"]}')\n output.append('=' * 60)\n \n if not search_results['results']:\n output.append('\\n❌ 未找到匹配结果')\n return '\\n'.join(output)\n \n for file_result in search_results['results']:\n output.append(f'\\n📄 {file_result[\"filename\"]}')\n output.append(f' 路径: {file_result[\"filepath\"]}')\n output.append(f' 匹配数: {file_result[\"match_count\"]}')\n output.append('-' * 40)\n \n for match in file_result['matches']:\n output.append(f'\\n 📍 行 {match[\"line_number\"]}: {highlight_keywords(match[\"line\"], search_results[\"query\"])}')\n \n if show_context:\n output.append(' 上下文:')\n for ctx_line in match['context'].split('\\n'):\n output.append(f' {ctx_line}')\n \n return '\\n'.join(output)\n\n\ndef main():\n parser = argparse.ArgumentParser(description='文档搜索器')\n parser.add_argument('--index', '-i', required=True, help='索引文件路径')\n parser.add_argument('--query', '-q', required=True, help='搜索关键词(空格分隔多个)')\n parser.add_argument('--context', '-c', type=int, default=2, help='上下文行数')\n parser.add_argument('--max-matches', '-m', type=int, default=5, help='每个文件最大匹配数')\n parser.add_argument('--no-context', action='store_true', help='不显示上下文')\n parser.add_argument('--json', action='store_true', help='输出 JSON 格式')\n \n args = parser.parse_args()\n \n # 加载索引\n try:\n index = load_index(args.index)\n except Exception as e:\n print(f'❌ 无法加载索引: {e}')\n return 1\n \n # 解析关键词\n keywords = args.query.split()\n \n if not keywords:\n print('❌ 请提供搜索关键词')\n return 1\n \n # 执行搜索\n results = search_in_index(index, keywords, args.context, args.max_matches)\n \n # 输出结果\n if args.json:\n print(json.dumps(results, ensure_ascii=False, indent=2))\n else:\n print(format_results(results, show_context=not args.no_context))\n \n return 0 if results['total_matches'] > 0 else 1\n\n\nif __name__ == '__main__':\n exit(main())\n","content_type":"text/x-python; charset=utf-8","language":"python","size":6502,"content_sha256":"9fcd1d68bea17f4eb75e31ed821a9b64e5e84bb61e793c32ac006ae8f2ad473d"},{"filename":"scripts/doc_summarize.py","content":"#!/usr/bin/env python3\n\"\"\"\ndoc_summarize.py - 文档结构摘要器\n基于索引生成文档的结构化概览\n\n用法:\n python3 doc_summarize.py --index doc_index.json\n python3 doc_summarize.py --index doc_index.json --depth 3 --keywords\n\"\"\"\n\nimport argparse\nimport json\nfrom pathlib import Path\nfrom typing import Dict, List, Any\n\n\ndef load_index(index_path: str) -> Dict[str, Any]:\n \"\"\"加载索引文件\"\"\"\n with open(index_path, 'r', encoding='utf-8') as f:\n return json.load(f)\n\n\ndef format_size(size_bytes: int) -> str:\n \"\"\"格式化文件大小\"\"\"\n if size_bytes \u003c 1024:\n return f'{size_bytes} B'\n elif size_bytes \u003c 1024 * 1024:\n return f'{size_bytes / 1024:.1f} KB'\n else:\n return f'{size_bytes / (1024 * 1024):.1f} MB'\n\n\ndef summarize_file(file_info: Dict[str, Any], depth: int = 2, show_keywords: bool = False) -> str:\n \"\"\"生成单个文件的摘要\"\"\"\n output = []\n \n filename = file_info.get('filename', '未知文件')\n total_lines = file_info.get('total_lines', 0)\n file_type = file_info.get('type', 'unknown')\n size = file_info.get('size_bytes', 0)\n \n output.append(f'📄 {filename}')\n output.append(f' 类型: {file_type} | 行数: {total_lines} | 大小: {format_size(size)}')\n \n # 显示章节结构\n sections = file_info.get('sections', [])\n if sections:\n output.append(f' 📑 章节结构 ({len(sections)} 个):')\n \n shown_sections = 0\n for s in sections:\n level = s.get('level', 1)\n if level \u003c= depth:\n title = s.get('title', '未命名')\n start = s.get('start_line', '?')\n end = s.get('end_line', '?')\n s_type = s.get('type', '')\n \n indent = ' ' * level\n type_tag = f' [{s_type}]' if s_type and s_type not in ['section'] else ''\n output.append(f' {indent}• {title}{type_tag} (行 {start}-{end})')\n shown_sections += 1\n \n if shown_sections >= 20:\n output.append(f' ... 还有 {len(sections) - shown_sections} 个章节')\n break\n \n # JSON 结构\n if 'structure' in file_info:\n structure = file_info['structure']\n if isinstance(structure, dict):\n if structure.get('type') == 'object':\n keys = structure.get('keys', [])\n output.append(f' 🔑 顶级键: {\", \".join(keys[:15])}')\n if len(keys) > 15:\n output.append(f' ... 还有 {len(keys) - 15} 个键')\n elif structure.get('type') == 'array':\n output.append(f' 📦 数组长度: {structure.get(\"length\", \"?\")}')\n \n # 关键词\n if show_keywords:\n keywords = file_info.get('keywords', [])\n if keywords:\n output.append(f' 🔑 关键词: {\", \".join(keywords[:15])}')\n \n return '\\n'.join(output)\n\n\ndef summarize_directory(index: Dict[str, Any], depth: int = 2, \n show_keywords: bool = False, max_files: int = 20) -> str:\n \"\"\"生成目录索引的摘要\"\"\"\n output = []\n \n path = index.get('path', '未知目录')\n total_files = index.get('total_files', 0)\n total_lines = index.get('total_lines', 0)\n indexed_at = index.get('indexed_at', '?')\n \n output.append('=' * 60)\n output.append(f'📁 文档集索引摘要')\n output.append('=' * 60)\n output.append(f'📍 路径: {path}')\n output.append(f'📊 统计: {total_files} 个文件, {total_lines} 行')\n output.append(f'🕐 索引时间: {indexed_at}')\n \n # 全局关键词\n top_keywords = index.get('top_keywords', [])\n if top_keywords:\n output.append(f'🔑 热门关键词: {\", \".join(top_keywords[:20])}')\n \n output.append('-' * 60)\n \n # 按类型分组\n files = index.get('files', [])\n by_type = {}\n for f in files:\n ftype = f.get('type', 'unknown')\n if ftype not in by_type:\n by_type[ftype] = []\n by_type[ftype].append(f)\n \n output.append(f'\\n📊 文件类型分布:')\n for ftype, file_list in sorted(by_type.items(), key=lambda x: -len(x[1])):\n total_lines_in_type = sum(f.get('total_lines', 0) for f in file_list)\n output.append(f' • {ftype}: {len(file_list)} 个文件, {total_lines_in_type} 行')\n \n output.append(f'\\n📄 文件列表 (显示 {min(max_files, len(files))}/{len(files)}):')\n output.append('-' * 60)\n \n # 按行数排序,大文件优先\n sorted_files = sorted(files, key=lambda x: x.get('total_lines', 0), reverse=True)\n \n for i, file_info in enumerate(sorted_files[:max_files]):\n if i > 0:\n output.append('')\n output.append(summarize_file(file_info, depth, show_keywords))\n \n if len(files) > max_files:\n output.append(f'\\n... 还有 {len(files) - max_files} 个文件未显示')\n output.append(' 使用 --max-files 增加显示数量')\n \n return '\\n'.join(output)\n\n\ndef summarize_single_file(index: Dict[str, Any], depth: int = 2, \n show_keywords: bool = False) -> str:\n \"\"\"生成单文件索引的摘要\"\"\"\n files = index.get('files', [])\n if not files:\n return '❌ 索引中没有文件'\n \n file_info = files[0]\n output = []\n \n output.append('=' * 60)\n output.append(f'📄 文档摘要')\n output.append('=' * 60)\n output.append(summarize_file(file_info, depth, show_keywords))\n \n # 额外的详细信息\n sections = file_info.get('sections', [])\n if sections and len(sections) > 5:\n output.append('\\n' + '=' * 60)\n output.append('📑 完整章节目录:')\n output.append('=' * 60)\n \n for i, s in enumerate(sections, 1):\n level = s.get('level', 1)\n title = s.get('title', '未命名')\n start = s.get('start_line', '?')\n end = s.get('end_line', '?')\n \n indent = ' ' * (level - 1)\n output.append(f'{i:3d}. {indent}{title} (行 {start}-{end})')\n \n return '\\n'.join(output)\n\n\ndef main():\n parser = argparse.ArgumentParser(description='文档结构摘要器')\n parser.add_argument('--index', '-i', required=True, help='索引文件路径')\n parser.add_argument('--depth', '-d', type=int, default=2, help='显示的章节层级深度')\n parser.add_argument('--keywords', '-k', action='store_true', help='显示关键词')\n parser.add_argument('--max-files', '-m', type=int, default=20, help='最大显示文件数')\n parser.add_argument('--json', action='store_true', help='输出 JSON 格式')\n \n args = parser.parse_args()\n \n # 加载索引\n try:\n index = load_index(args.index)\n except Exception as e:\n print(f'❌ 无法加载索引: {e}')\n return 1\n \n if args.json:\n # 输出精简的 JSON 摘要\n summary = {\n 'type': index.get('type'),\n 'path': index.get('path'),\n 'total_files': index.get('total_files'),\n 'total_lines': index.get('total_lines'),\n 'top_keywords': index.get('top_keywords', [])[:20],\n 'files': [\n {\n 'filename': f.get('filename'),\n 'type': f.get('type'),\n 'total_lines': f.get('total_lines'),\n 'sections_count': len(f.get('sections', [])),\n }\n for f in index.get('files', [])\n ]\n }\n print(json.dumps(summary, ensure_ascii=False, indent=2))\n else:\n # 生成文本摘要\n if index.get('type') == 'directory':\n print(summarize_directory(index, args.depth, args.keywords, args.max_files))\n else:\n print(summarize_single_file(index, args.depth, args.keywords))\n \n return 0\n\n\nif __name__ == '__main__':\n exit(main())\n","content_type":"text/x-python; charset=utf-8","language":"python","size":8003,"content_sha256":"c1ae195a2d8905204cff95a642e16b095fdc9b1f9007d1c1f6f9f251a8f38eb2"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"AI短剧提示词工厂 (AI Drama Prompt Factory)","type":"text"}]},{"type":"paragraph","content":[{"text":"端到端将小说或故事创意转化为结构化提示词包,输出标准JSON供外部AI生成工具消费。","type":"text"}]},{"type":"paragraph","content":[{"text":"系统边界:只生产提示词数据,不做图片/视频/音频的实际生成。","type":"text","marks":[{"type":"strong"}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"⚡ 启动协议(每次任务开始时必须执行)","type":"text"}]},{"type":"paragraph","content":[{"text":"任何短剧相关任务触发后,在执行任何工作之前,必须先向用户确认以下信息:","type":"text","marks":[{"type":"strong"}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 1:确认项目类型","type":"text"}]},{"type":"paragraph","content":[{"text":"向用户确认:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"A 小说改编","type":"text","marks":[{"type":"strong"}]},{"text":" — 用户提供小说/故事文本,改编为短剧提示词","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"B 原创短剧","type":"text","marks":[{"type":"strong"}]},{"text":" — 用户提供创意/主题,从零创建短剧提示词","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 2:确认执行模式","type":"text"}]},{"type":"paragraph","content":[{"text":"向用户确认交付方式:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"🚀 全程模式","type":"text","marks":[{"type":"strong"}]},{"text":" — 一次跑完全部Phase,中间不停,最终一次性交付所有产出文件","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"📋 分阶段模式","type":"text","marks":[{"type":"strong"}]},{"text":" — 每个Phase完成后输出交付物,等用户确认/修改后再进入下一阶段(推荐)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"🎯 单阶段模式","type":"text","marks":[{"type":"strong"}]},{"text":" — 只执行用户指定的某个Phase(需已有前序Phase的产出)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 3:确认基础参数","type":"text"}]},{"type":"paragraph","content":[{"text":"向用户确认:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"视觉风格","type":"text","marks":[{"type":"strong"}]},{"text":" — 电影写实 / 日系动漫 / 2.5D(默认:电影写实)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"剧本风格","type":"text","marks":[{"type":"strong"}]},{"text":" — 标准叙事 / 爽文漫剧(默认:标准叙事)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"目标集数","type":"text","marks":[{"type":"strong"}]},{"text":" — 预计多少集(可后续调整)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"每集时长","type":"text","marks":[{"type":"strong"}]},{"text":" — 1分钟 / 2分钟 / 3分钟(默认:1-2分钟)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"剧本分镜Markdown输出","type":"text","marks":[{"type":"strong"}]},{"text":" — 是否同时输出可读性更强的Markdown分镜表格文档?(默认:否,仅输出JSON)","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"确认完成后,开始执行第一个Phase。","type":"text","marks":[{"type":"strong"}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"核心铁律(Phase 5组装时必须遵守)","type":"text"}]},{"type":"paragraph","content":[{"text":"铁律一:分镜图片提示词中必须使用角色和道具的名字","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"✅ 张慧芬转身替病床上的陈易(觉醒前)整理输液管\n❌ 48岁中年女性转身替24岁苍白男性整理输液管","type":"text"}]},{"type":"paragraph","content":[{"text":"铁律二:视频提示词必须基于分镜图片提示词派生","type":"text","marks":[{"type":"strong"}]},{"text":" 视频是图片的动态延伸,不能独立生成。","type":"text"}]},{"type":"paragraph","content":[{"text":"铁律三:提示词使用中文自然语言描述","type":"text","marks":[{"type":"strong"}]},{"text":" 连贯的场景叙述句,不是英文标签堆叠。","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"全流程架构","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"启动协议 → Phase 1 策划 → Phase 2 设计 → Phase 3 剧本 → Phase 4 诊断 → Phase 5 组装\n ↑ │\n └────────┘\n (修改≤3轮)","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"路径","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"流程","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"诊断","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"A: 小说改编","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"全5阶段","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"必须","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"B: 原创短剧","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase 1→2→3→5","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"可选","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 1:策划","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"📥 输入","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"路径A:小说/故事文本(短篇直接读取,超过3万字先建索引,参见 ","type":"text"},{"text":"references/doc-reader-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/doc-reader-guide.md","title":null}}]},{"text":")","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"路径B:用户的创意描述/主题","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"📤 交付物(2个文件)","type":"text"}]},{"type":"paragraph","content":[{"text":"文件1:","type":"text","marks":[{"type":"strong"}]},{"text":"planning/story-outline.md","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"必须包含以下完整结构:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"# 故事大纲:{作品名称}\n\n## 1. 基础信息\n- 作品名称:{名称}\n- 来源:{原创/改编自《XX》}\n- 写作视角:{第一人称/第三人称全知/等}\n- 视觉风格:{电影写实/日系动漫/2.5D}\n- 剧本风格:{标准叙事/爽文漫剧}\n- 目标集数:{N}集\n- 每集时长:{N}分钟\n\n## 2. 时空背景\n{年代、地点、社会环境、特殊设定,150-300字}\n\n## 3. 叙事结构\n- 结构类型:{三幕/五幕/单元剧}\n- 递进模式:{描述}\n- 情绪曲线概要:{描述}\n\n## 4. 核心冲突\n{主角+困境+对抗力量+逆袭路径,100-200字}\n\n## 5. 角色清单\n\n### 主要角色\n| 角色名 | 性别 | 年龄 | 身份 | 核心特征 | 外观变体 |\n|--------|------|------|------|---------|---------|\n| 陈易 | 男 | 24 | 大学生/觉醒者 | 外表懦弱内心坚韧 | 觉醒前、觉醒后 |\n| ... | | | | | |\n\n### 次要角色\n| 角色名 | 性别 | 身份 | 故事功能 |\n|--------|------|------|---------|\n| ... | | | |\n\n## 6. 关键道具\n| 道具名 | 外观概述 | 剧情功能 | 首次出现 |\n|--------|---------|---------|---------|\n| 天机古卷 | 泛黄线装古书 | 主角能力来源 | 第1集 |\n\n## 7. 核心场景清单\n| 场景名 | 类型 | 出现集数 |\n|--------|------|---------|\n| 医院普通病房 | 室内 | 第1-2集 |\n| 世界杯决赛球场 | 室外 | 第5-6集 |","type":"text"}]},{"type":"paragraph","content":[{"text":"文件2:","type":"text","marks":[{"type":"strong"}]},{"text":"planning/episodes-plan.md","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"# 分集规划\n\n## 第1集「{标题}」\n- 核心事件:{一句话概述}\n- 涉及角色:{角色列表}\n- 主要场景:{场景列表}\n- 情绪走向:{如:压抑→微光}\n- 集尾钩子:{悬念/反转描述}\n- 预计镜头数:{N}\n\n## 第2集「{标题}」\n...","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"✅ Phase 1 完成标志","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"story-outline.md 包含全部7个章节","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"episodes-plan.md 覆盖所有目标集数","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"每集有明确的集尾钩子","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"⏸️ 分阶段模式","type":"text"}]},{"type":"paragraph","content":[{"text":"输出以上2个文件后,告知用户:","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Phase 1 策划完成。请查看故事大纲和分集规划,确认无误后我将进入 Phase 2 设计阶段。如需调整请告知。","type":"text"}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 2:设计","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"📥 输入","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 1 的 story-outline.md(角色清单、场景清单、道具清单、风格定义)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"📤 交付物(4类文件)","type":"text"}]},{"type":"paragraph","content":[{"text":"文件1:","type":"text","marks":[{"type":"strong"}]},{"text":"characters/{角色名}.json","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":"(每个角色一个文件)","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"json"},"content":[{"text":"{\n \"name\": \"陈易\",\n \"character_id\": \"char_chenyi\",\n \"gender\": \"男\",\n \"age\": 24,\n \"identity\": \"被雷劈获得超能力的普通大学生\",\n \"personality\": {\n \"core_traits\": \"外表懦弱内心坚韧\",\n \"speech_style\": \"初期怯懦,觉醒后沉稳有力\",\n \"motivation\": \"证明自己的价值\"\n },\n \"voice_default\": {\n \"gender\": \"male\",\n \"age_desc\": \"青年男性\",\n \"timbre\": \"初期虚弱低沉,觉醒后清亮有力\"\n },\n \"variants\": {\n \"觉醒前\": {\n \"description\": \"病号服状态,虚弱苍白\",\n \"appearance\": \"短发凌乱/黑色、面色苍白\",\n \"outfit\": \"蓝白条纹病号服、病号裤、无鞋、无配饰\",\n \"prompt\": \"现代、24岁、男、短发凌乱/黑色、蓝白条纹病号服、病号裤、无、面色苍白,电影写实风格,高质量,真实光影,电影级打光,8K分辨率,超高清细节,全身,纯色背景,面向镜头\"\n },\n \"觉醒后\": {\n \"description\": \"运动装状态,精神焕发\",\n \"appearance\": \"短发利落/黑色、目光锐利\",\n \"outfit\": \"灰色运动外套、深蓝色运动裤、白色运动鞋、无配饰\",\n \"prompt\": \"现代、24岁、男、短发利落/黑色、灰色运动外套、深蓝色运动裤、白色运动鞋、无配饰,电影写实风格,高质量,真实光影,电影级打光,8K分辨率,超高清细节,全身,纯色背景,面向镜头\"\n }\n }\n}","type":"text"}]},{"type":"paragraph","content":[{"text":"角色提示词公式:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"{时代}、{年龄}岁、{性别}、{发型/发色}、{上装}、{下装}、{鞋/配饰}、{面部特征},\n{风格标签},全身,纯色背景,面向镜头","type":"text"}]},{"type":"paragraph","content":[{"text":"文件2:","type":"text","marks":[{"type":"strong"}]},{"text":"scenes/{场景名}.json","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":"(每个场景一个文件)","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"json"},"content":[{"text":"{\n \"name\": \"医院普通病房\",\n \"scene_id\": \"scene_hospital_room\",\n \"type\": \"室内\",\n \"era\": \"中国现代\",\n \"key_elements\": [\"白色墙面\", \"输液架\", \"病床\", \"窗户\"],\n \"variants\": {\n \"白天\": {\n \"lighting\": \"窗户透入柔和自然光\",\n \"prompt\": \"中国现代,电影写实风格,室内,白天,现代医院普通病房,白色墙面干净整洁,输液架立在病床旁,病床白色床单,窗户透入柔和自然光\"\n },\n \"夜晚\": {\n \"lighting\": \"走廊灯光透过门缝微弱照入\",\n \"prompt\": \"中国现代,电影写实风格,室内,深夜,现代医院普通病房,白色墙面,病床旁输液架,走廊灯光透过门缝微弱照入,氛围安静压抑\"\n }\n }\n}","type":"text"}]},{"type":"paragraph","content":[{"text":"场景提示词公式:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"{时代},{风格},{室内/室外},{时间},{环境详描}","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"文件3:","type":"text","marks":[{"type":"strong"}]},{"text":"props/{道具名}.json","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":"(每个关键道具一个文件,普通道具不需要)","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"json"},"content":[{"text":"{\n \"name\": \"天机古卷\",\n \"prop_id\": \"prop_ancient_book\",\n \"type\": \"信物\",\n \"story_function\": \"主角能力来源,被雷劈时的护身符\",\n \"prompt\": \"中国古代,电影写实风格,信物,泛黄卷边的线装书,封面为深蓝色布面,边角磨损严重,书页间夹有干枯的银杏叶书签,纸质泛黄,封面深蓝色布面,书签枯黄色\"\n}","type":"text"}]},{"type":"paragraph","content":[{"text":"道具提示词公式:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"{时代},{风格},{类型},{外观详描},{材质/颜色}","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"文件4:","type":"text","marks":[{"type":"strong"}]},{"text":"style/style-guide.json","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":"(全局唯一)","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"json"},"content":[{"text":"{\n \"style_type\": \"电影写实\",\n \"era\": \"中国现代\",\n \"character_prompt_suffix\": \"电影写实风格,高质量,真实光影,电影级打光,8K分辨率,超高清细节\",\n \"scene_prompt_suffix\": \"电影写实风格\",\n \"storyboard_prompt_suffix\": \"写实风格,电影级打光,8K分辨率,超细节刻画\",\n \"storyboard_enhance_tags\": [\"高对比度光影\", \"动态模糊感\", \"电影级质感\", \"8K超高清\"],\n \"target_ratio\": \"9:16\"\n}","type":"text"}]},{"type":"paragraph","content":[{"text":"详细规范:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/design-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/design-guide.md","title":null}}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"✅ Phase 2 完成标志","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"所有主要角色都有 .json 文件,每个角色至少1个variant且含完整prompt","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"所有核心场景都有 .json 文件,至少1个variant且含完整prompt","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"所有关键道具都有 .json 文件且含完整prompt","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"style-guide.json 已创建","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"所有提示词风格后缀与 style-guide 一致","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"⏸️ 分阶段模式","type":"text"}]},{"type":"paragraph","content":[{"text":"输出所有设计文件后,向用户展示:","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Phase 2 设计完成。共生成 {N} 个角色(含 {M} 个状态变体)、{N} 个场景、{N} 个道具的设计卡和提示词。","type":"text"}]},{"type":"paragraph","content":[{"text":"角色一览:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"陈易:觉醒前(病号服)/ 觉醒后(运动装)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"张慧芬:默认(护士装)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"...","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"请确认角色/场景/道具设计是否需要调整,确认后进入 Phase 3 剧本生成。","type":"text"}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 3:剧本","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"📥 输入","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 1 的 episodes-plan.md","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 2 的全部角色/场景/道具设计文件","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"路径A:原著对应章节文本","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"📤 交付物(每集2-3个文件)","type":"text"}]},{"type":"paragraph","content":[{"text":"文件1:","type":"text","marks":[{"type":"strong"}]},{"text":"scripts/ep{NN}/script.json","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":"(核心交付物)","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"json"},"content":[{"text":"{\n \"episode\": {\n \"number\": 1,\n \"title\": \"天降奇才\",\n \"duration_target\": \"90s\",\n \"style\": \"标准叙事\",\n \"emotion_arc\": \"压抑→微光\"\n },\n \"shots\": [\n {\n \"shot_id\": \"ep01_sh01\",\n \"shot_number\": 1,\n \"duration\": \"3s\",\n \"characters\": [\n { \"name\": \"陈勇\", \"variant\": \"默认\" },\n { \"name\": \"张慧芬\", \"variant\": \"默认\" },\n { \"name\": \"陈易\", \"variant\": \"觉醒前\" }\n ],\n \"scene\": \"医院普通病房\",\n \"scene_variant\": \"白天\",\n \"shot_type\": \"近景\",\n \"camera_movement\": \"固定\",\n \"action_desc\": \"画面右侧陈勇背影离去,张慧芬转身替病床上的陈易整理输液管,轻叹气,眼神略带无奈\",\n \"dialogue\": {\n \"speaker\": \"张慧芬\",\n \"text\": \"唉,陈易,你的医药费已经拖欠三天了...\",\n \"emotion\": \"无奈叹息\"\n },\n \"sfx\": [\"脚步声远去\", \"输液管碰撞\"],\n \"bgm\": \"无\",\n \"source_anchor\": \"P-003\",\n \"emotion_level\": 2,\n \"narration\": null\n },\n {\n \"shot_id\": \"ep01_sh02\",\n \"shot_number\": 2,\n \"...\": \"...\"\n }\n ],\n \"episode_summary\": {\n \"total_shots\": 15,\n \"characters_used\": [\"陈易\", \"张慧芬\", \"陈勇\"],\n \"scenes_used\": [\"医院普通病房\"],\n \"hook\": \"陈易在病床上突然睁开双眼,瞳孔中闪过金色光芒\"\n }\n}","type":"text"}]},{"type":"paragraph","content":[{"text":"每个shot必须包含的字段:","type":"text","marks":[{"type":"strong"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"字段","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"类型","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"必须","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"说明","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"shot_id","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"string","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"ep{NN}_sh{NN}","type":"text","marks":[{"type":"code_inline"}]},{"text":" 全局唯一","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"shot_number","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"int","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"集内序号","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"duration","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"string","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"目标时长(如\"3s\")","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"characters","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"array","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"出场角色,每个含name和variant","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"scene","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"string","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"场景名(对应scenes/下的文件)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"scene_variant","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"string","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"场景变体(白天/夜晚等)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"shot_type","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"string","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"特写/近景/中景/全景/远景","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"camera_movement","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"string","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"固定/推/拉/摇/跟","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"action_desc","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"string","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"动作+表情+位置的自然语言描述","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"dialogue","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"object/null","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"有对白时:speaker+text+emotion;无对白时:null","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"sfx","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"array","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"音效列表(可为空数组)","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"bgm","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"string","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"BGM描述或\"无\"","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"source_anchor","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"string","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"原文锚点(改编)或\"原创\"","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"emotion_level","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"int","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"情绪强度1-5","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"narration","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"string/null","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"✅","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"旁白文本(爽文风格时使用)或null","type":"text"}]}]}]}]},{"type":"paragraph","content":[{"text":"文件2:","type":"text","marks":[{"type":"strong"}]},{"text":"continuity/ep{NN}-state.json","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":"(连贯性状态)","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"json"},"content":[{"text":"{\n \"episode\": 1,\n \"character_states\": {\n \"陈易\": {\n \"variant\": \"觉醒前\",\n \"location\": \"医院病房\",\n \"emotion\": \"昏迷中\",\n \"carrying\": []\n },\n \"张慧芬\": {\n \"variant\": \"默认\",\n \"location\": \"医院病房\",\n \"emotion\": \"无奈疲惫\",\n \"carrying\": []\n }\n },\n \"planted_threads\": [\n { \"thread\": \"陈易的医药费问题\", \"planted_at\": \"ep01_sh01\" }\n ],\n \"resolved_threads\": [],\n \"props_status\": {\n \"天机古卷\": \"在陈易枕头下\"\n },\n \"next_hook\": \"陈易在病床上突然睁开双眼,瞳孔中闪过金色光芒\"\n}","type":"text"}]},{"type":"paragraph","content":[{"text":"详细规范:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/script-generation-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/script-generation-guide.md","title":null}}]},{"text":" ","type":"text"},{"text":"爽文风格:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/manga-drama-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/manga-drama-guide.md","title":null}}]},{"text":" ","type":"text"},{"text":"连贯性管理:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/continuity-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/continuity-guide.md","title":null}}]}]},{"type":"paragraph","content":[{"text":"文件3(可选):","type":"text","marks":[{"type":"strong"}]},{"text":"scripts/ep{NN}/script.md","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":"(Markdown分镜表格文档)","type":"text","marks":[{"type":"strong"}]}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"仅当用户在启动协议中选择\"是\"输出Markdown时才生成此文件。","type":"text"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"# 第{N}集「{标题}」分镜剧本\n\n> 情绪走向:{情绪弧线} | 目标时长:{时长} | 镜头总数:{N}\n\n## 分镜表\n\n| 镜头号 | 时长 | 角色 | 场景/变体 | 景别 | 运镜 | 动作描述 | 对白 | 音效 | BGM | 原文锚点 |\n|--------|------|------|----------|------|------|---------|------|------|-----|---------|\n| ep01_sh01 | 3s | 陈勇(默认)、张慧芬(默认)、陈易(觉醒前) | 医院普通病房/白天 | 近景 | 固定 | 画面右侧陈勇背影离去,张慧芬转身替病床上的陈易整理输液管,轻叹气,眼神略带无奈 | 张慧芬:\"唉,陈易,你的医药费已经拖欠三天了...\"(无奈叹息) | 脚步声远去、输液管碰撞 | 无 | P-003 |\n| ep01_sh02 | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |\n\n## 集尾钩子\n\n{钩子描述}\n\n## 本集统计\n\n- 总镜头数:{N}\n- 涉及角色:{角色列表}\n- 涉及场景:{场景列表}\n- 含对白镜头:{N}个\n- 情绪高点镜头:{镜头号列表}","type":"text"}]},{"type":"paragraph","content":[{"text":"Markdown分镜表生成规则:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"表格字段与 ","type":"text"},{"text":"script.json","type":"text","marks":[{"type":"code_inline"}]},{"text":" 中的 shot 字段一一对应","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"角色列写为 ","type":"text"},{"text":"角色名(变体)","type":"text","marks":[{"type":"code_inline"}]},{"text":",无变体时只写角色名","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"对白列格式为 ","type":"text"},{"text":"说话人:\"台词\"(情绪)","type":"text","marks":[{"type":"code_inline"}]},{"text":",无对白时填 ","type":"text"},{"text":"—","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"音效列多个音效用顿号分隔,无音效时填 ","type":"text"},{"text":"—","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"此文件作为可读性辅助文档,","type":"text"},{"text":"script.json 仍为唯一权威数据源","type":"text","marks":[{"type":"strong"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"✅ Phase 3 完成标志(每集)","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"script.json 包含所有镜头,每个shot的所有必须字段齐全","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"shot_id 全局无重复","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"characters 中引用的角色名和variant都存在于Phase 2的设计文件中","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"scene 引用的场景名和variant都存在于Phase 2的设计文件中","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"集尾有钩子","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ep{NN}-state.json 已生成","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"【如用户选择Markdown输出】script.md 已生成,表格内容与 script.json 一致","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"⏸️ 分阶段模式","type":"text"}]},{"type":"paragraph","content":[{"text":"每集剧本完成后,向用户展示:","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Phase 3 第{N}集剧本完成。共 {M} 个镜头,涉及角色:{列表},涉及场景:{列表}。 集尾钩子:{钩子描述} [如已选择Markdown输出] 同时输出了 Markdown 分镜表格文档 ","type":"text"},{"text":"scripts/ep{NN}/script.md","type":"text","marks":[{"type":"code_inline"}]},{"text":"。","type":"text"}]},{"type":"paragraph","content":[{"text":"[如为改编项目] 即将进入 Phase 4 诊断,对照原著校验忠实度。 [如为原创项目] 是否需要调整?确认后可直接进入 Phase 5 组装提示词。","type":"text"}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 4:诊断(小说改编必须,原创可选)","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"📥 输入","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 3 的 script.json","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"原著文本(通过source_anchor定位对应段落)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"📤 交付物(1个文件)","type":"text"}]},{"type":"paragraph","content":[{"text":"文件:","type":"text","marks":[{"type":"strong"}]},{"text":"continuity/diagnosis-ep{NN}.md","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"# 第{N}集诊断报告\n\n## 总评\n- **综合评分:{分数}/100**\n- **结论:{✅ 通过 / ❌ 未通过}**\n- 致命问题(🔴):{数量}个\n- 严重问题(🟠):{数量}个\n- 一般问题(🟡):{数量}个\n\n## 各维度评分\n\n| 维度 | 得分 | 权重 | 加权分 |\n|------|------|------|--------|\n| 情节忠实度 | {x}/100 | 35% | {y} |\n| 对白还原度 | {x}/100 | 25% | {y} |\n| 角色一致性 | {x}/100 | 20% | {y} |\n| 情感曲线 | {x}/100 | 10% | {y} |\n| 连贯性 | {x}/100 | 10% | {y} |\n| **合计** | | **100%** | **{总分}** |\n\n## 问题清单\n\n### 🔴 致命问题\n1. **[ep01_sh05]** {问题描述}\n - 原著:{原文内容}\n - 剧本:{剧本内容}\n - 修改建议:{具体修改方案}\n\n### 🟠 严重问题\n...\n\n### 🟡 一般问题\n...\n\n## 亮点\n- {做得好的地方}\n\n## 修改清单(按镜头号排序)\n| 镜头 | 级别 | 修改内容 |\n|------|------|---------|\n| ep01_sh05 | 🔴 | {具体修改指导} |\n| ep01_sh12 | 🟠 | {具体修改指导} |","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"通过标准","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"综合评分 ≥ 75","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"无致命问题(🔴)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"严重问题(🟠)≤ 2个","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"诊断闭环","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"剧本 → 诊断 → ✅ 通过(≥75) → Phase 5\n → ❌ 未通过 → 按修改清单逐镜头修改 → 再诊断(最多3轮)\n → 仍未通过 → 提示用户人工介入","type":"text"}]},{"type":"paragraph","content":[{"text":"详细规范:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/diagnosis-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/diagnosis-guide.md","title":null}}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"✅ Phase 4 完成标志","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"diagnosis-ep{NN}.md 已输出","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"综合评分 ≥ 75 且满足通过标准","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"如未通过,修改后的script.json已更新","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"⏸️ 分阶段模式","type":"text"}]},{"type":"paragraph","content":[{"text":"诊断完成后,向用户展示:","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Phase 4 诊断完成。第{N}集评分:{分数}/100,{✅通过/❌未通过}。 [通过] 即将进入 Phase 5 组装提示词包。 [未通过] 发现 {N} 个问题需要修改(致命{N}个/严重{N}个),是否立即修改?","type":"text"}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Phase 5:提示词组装","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"📥 输入","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 2 的全部角色/场景/道具/风格文件","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Phase 3 的 script.json(已通过诊断)","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"📤 交付物(2个文件)","type":"text"}]},{"type":"paragraph","content":[{"text":"文件1:","type":"text","marks":[{"type":"strong"}]},{"text":"output/project-manifest.json","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":"(全项目唯一,首次生成后增量更新)","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"json"},"content":[{"text":"{\n \"project\": {\n \"title\": \"项目名\",\n \"source_title\": \"原著名(如有)\",\n \"genre\": \"都市逆袭\",\n \"era\": \"中国现代\",\n \"total_episodes\": 20,\n \"target_ratio\": \"9:16\"\n },\n \"style\": {\n \"style_type\": \"电影写实\",\n \"character_prompt_suffix\": \"电影写实风格,高质量,真实光影,电影级打光,8K分辨率,超高清细节\",\n \"storyboard_prompt_suffix\": \"写实风格,电影级打光,8K分辨率,超细节刻画\"\n },\n \"characters\": {\n \"陈易\": {\n \"gender\": \"男\",\n \"age\": 24,\n \"variants\": {\n \"觉醒前\": { \"prompt\": \"完整角色提示词...\" },\n \"觉醒后\": { \"prompt\": \"完整角色提示词...\" }\n }\n }\n },\n \"scenes\": {\n \"医院普通病房\": {\n \"variants\": {\n \"白天\": { \"prompt\": \"完整场景提示词...\" },\n \"夜晚\": { \"prompt\": \"完整场景提示词...\" }\n }\n }\n },\n \"props\": {\n \"天机古卷\": { \"prompt\": \"完整道具提示词...\" }\n }\n}","type":"text"}]},{"type":"paragraph","content":[{"text":"文件2:","type":"text","marks":[{"type":"strong"}]},{"text":"output/ep{NN}-prompt-package.json","type":"text","marks":[{"type":"code_inline"},{"type":"strong"}]},{"text":"(每集一个)","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"json"},"content":[{"text":"{\n \"episode\": {\n \"number\": 1,\n \"title\": \"天降奇才\",\n \"shot_count\": 15,\n \"characters_used\": [\"陈易\", \"张慧芬\", \"陈勇\"],\n \"scenes_used\": [\"医院普通病房\"]\n },\n \"shots\": [\n {\n \"shot_id\": \"ep01_sh01\",\n \"shot_number\": 1,\n \"duration\": \"3s\",\n\n \"script\": {\n \"characters\": [\n { \"name\": \"陈勇\", \"variant\": \"默认\" },\n { \"name\": \"张慧芬\", \"variant\": \"默认\" },\n { \"name\": \"陈易\", \"variant\": \"觉醒前\" }\n ],\n \"scene\": \"医院普通病房\",\n \"scene_variant\": \"白天\",\n \"shot_type\": \"近景\",\n \"action_desc\": \"画面右侧陈勇背影离去,张慧芬转身替病床上的陈易整理输液管\",\n \"dialogue\": {\n \"speaker\": \"张慧芬\",\n \"text\": \"唉,陈易,你的医药费已经拖欠三天了...\",\n \"emotion\": \"无奈叹息\"\n },\n \"source_anchor\": \"P-003\"\n },\n\n \"storyboard_prompt\": \"中国现代,医院普通病房,白色墙面,输液架,病床,柔和冷光,近景镜头(胸部以上),画面右侧陈勇背影离去,张慧芬转身替病床上的陈易(觉醒前)整理输液管,轻叹气,眼神略带无奈,写实风格,电影级打光,8K分辨率,超细节刻画\",\n\n \"video_prompt\": \"场景为中国现代医院普通病房,白色墙面干净整洁,输液架立在病床旁,柔和冷光洒满房间。镜头从张慧芬(女)的近景开始,她站在病床边,目光望向画面右侧,陈勇(男)的背影正缓缓走出病房门口,写实风格,电影级打光。切镜到张慧芬(女)的近景(胸部以上),她收回目光转身面向病床上的陈易,双手轻柔整理输液管,轻叹气,嘴唇微动说着:\\\"唉,陈易,你的医药费已经拖欠三天了...\\\",眼神略带无奈,超细节刻画手部动作,8K分辨率。最后切镜到两人同框的中景,张慧芬(女)整理好输液管后低头看着陈易,病房里安静无声,氛围忧虑而沉重,无背景音乐。陈勇是男性,张慧芬是女性\",\n\n \"audio_spec\": {\n \"dialogue\": {\n \"text\": \"唉,陈易,你的医药费已经拖欠三天了...\",\n \"speaker\": \"张慧芬\",\n \"speaker_gender\": \"female\",\n \"voice_desc\": \"中年女性,声音疲惫温和,带叹息感,语速缓慢\",\n \"emotion\": \"无奈叹息\"\n },\n \"sfx\": [\n { \"type\": \"脚步声远去\", \"timing\": \"陈勇离开时\", \"volume\": \"低\" },\n { \"type\": \"输液管碰撞\", \"timing\": \"张慧芬整理时\", \"volume\": \"轻微\" }\n ],\n \"bgm\": {\n \"mood\": \"无\",\n \"note\": \"无背景音乐,保持安静压抑氛围\"\n }\n }\n }\n ],\n \"continuity\": {\n \"character_states\": {\n \"陈易\": { \"variant\": \"觉醒前\", \"location\": \"医院病房\" },\n \"张慧芬\": { \"variant\": \"默认\", \"location\": \"医院病房\" }\n },\n \"next_hook\": \"陈易在病床上突然睁开双眼,瞳孔中闪过金色光芒\"\n }\n}","type":"text"}]},{"type":"paragraph","content":[{"text":"每个shot必须包含的3个提示词字段:","type":"text","marks":[{"type":"strong"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"字段","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"类型","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"说明","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"storyboard_prompt","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"string","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"分镜图片提示词。中文自然语言。角色用名字引用。","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"video_prompt","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"string","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"视频提示词。基于storyboard_prompt派生。含切镜/对白/性别声明。","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"audio_spec","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"object","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"音频描述。含dialogue(对白+voice_desc)、sfx(音效)、bgm(BGM)。","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"分镜图片提示词组装公式","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"{时代},{场景描述},{光影},{景别},\n{角色名(状态)} + {位置} + {动作} + {表情},\n{风格},{画质标签}","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"视频提示词派生公式","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"场景为{场景描述扩写}。\n镜头从{角色名(性别)}的{景别}开始,{动作},{风格}。\n切镜到{角色名(性别)}的{景别},{动作},{对白:\"台词\"},{表情}。\n最后切镜到{景别},{氛围收束}。\n{角色A}是{性别},{角色B}是{性别}","type":"text"}]},{"type":"paragraph","content":[{"text":"详细组装规则:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/assembly-rules.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/assembly-rules.md","title":null}}]},{"text":" ","type":"text"},{"text":"提示词示例:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/prompt-examples.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/prompt-examples.md","title":null}}]},{"text":" ","type":"text"},{"text":"平台适配:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/platform-adapters.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/platform-adapters.md","title":null}}]},{"text":" ","type":"text"},{"text":"完整Schema:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"references/api-schema.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/api-schema.md","title":null}}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"✅ Phase 5 完成标志(每集)","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"project-manifest.json 已生成/更新","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ep{NN}-prompt-package.json 已生成","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"每个shot都包含 storyboard_prompt + video_prompt + audio_spec","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"storyboard_prompt 中角色用名字引用,有变体的标注了状态","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"video_prompt 基于 storyboard_prompt 派生,角色标注了性别,末尾有性别汇总","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"全部提示词风格标签与 style-guide 一致","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"JSON 合法可被 JSON.parse() 解析","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"⏸️ 分阶段模式","type":"text"}]},{"type":"paragraph","content":[{"text":"每集提示词包完成后,向用户展示:","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Phase 5 第{N}集提示词包组装完成。","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"共 {M} 个镜头","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"分镜图片提示词:{M} 条","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"视频提示词:{M} 条","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"含对白镜头:{M} 个","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"输出文件:output/ep{NN}-prompt-package.json","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"是否继续生成下一集?或需要调整某个镜头的提示词?","type":"text"}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"交付物总览","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"全项目文件清单","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"{project-name}/\n├── planning/\n│ ├── story-outline.md ← Phase 1\n│ └── episodes-plan.md ← Phase 1\n│\n├── characters/\n│ ├── 陈易.json ← Phase 2\n│ ├── 张慧芬.json ← Phase 2\n│ └── ...\n│\n├── scenes/\n│ ├── 医院普通病房.json ← Phase 2\n│ └── ...\n│\n├── props/\n│ └── 天机古卷.json ← Phase 2\n│\n├── style/\n│ └── style-guide.json ← Phase 2\n│\n├── scripts/\n│ ├── ep01/script.json ← Phase 3\n│ ├── ep01/script.md ← Phase 3(可选,Markdown分镜表)\n│ ├── ep02/script.json ← Phase 3\n│ ├── ep02/script.md ← Phase 3(可选)\n│ └── ...\n│\n├── continuity/\n│ ├── ep01-state.json ← Phase 3\n│ ├── ep02-state.json ← Phase 3\n│ ├── diagnosis-ep01.md ← Phase 4\n│ └── diagnosis-ep02.md ← Phase 4\n│\n└── output/\n ├── project-manifest.json ← Phase 5(首次生成后增量更新)\n ├── ep01-prompt-package.json ← Phase 5\n ├── ep02-prompt-package.json ← Phase 5\n └── ...","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"各Phase交付物速查","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"交付物","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"文件格式","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"数量","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase 1 策划","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"story-outline.md + episodes-plan.md","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Markdown","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"2个","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase 2 设计","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"{角色}.json + {场景}.json + {道具}.json + style-guide.json","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"JSON","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"按角色/场景/道具数量","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase 3 剧本","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"script.json + ep{NN}-state.json + script.md(可选)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"JSON + Markdown","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"每集2-3个","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase 4 诊断","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"diagnosis-ep{NN}.md","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Markdown","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"每集1个","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Phase 5 组装","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"project-manifest.json + ep{NN}-prompt-package.json","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"JSON","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"1 + 每集1个","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"特殊模式","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"单镜头调试","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"用户:\"预览第1集镜头3的提示词\"\n→ 输出该镜头的完整链路:\n 1. 涉及角色的立绘提示词\n 2. 涉及场景的场景提示词\n 3. 分镜图片提示词\n 4. 视频提示词\n 5. 音频描述","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"续写模式","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"用户:\"继续生成下一集\"\n→ 读取最近一集的 ep{NN}-state.json\n→ 从 Phase 3 开始(→4→5)","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"补建模式","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"用户已有剧本,只需要提示词\n→ 跳过Phase 1/3,先确认Phase 2设计件是否齐全\n→ 如缺少设计件,从剧本描述中自动提取生成(降级模式)\n→ 进入Phase 5组装","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"ai-drama-prompt-factory","author":"@skillopedia","source":{"stars":2012,"repo_name":"openclaw-master-skills","origin_url":"https://github.com/leoyeai/openclaw-master-skills/blob/HEAD/skills/ai-drama-prompt-factory/SKILL.md","repo_owner":"leoyeai","body_sha256":"8e3db95911f16c6d0ff4d0b1b3c573b6a3e86ea04b24c97b0841e36d59792afa","cluster_key":"cd5f44501ca27c5743f1c639b753db5f2edcdec9bbd6feb09a499ab672c0d3df","clean_bundle":{"format":"clean-skill-bundle-v1","source":"leoyeai/openclaw-master-skills/skills/ai-drama-prompt-factory/SKILL.md","attachments":[{"id":"63c95a56-5b76-5de2-86ad-8498bf111a8f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/63c95a56-5b76-5de2-86ad-8498bf111a8f/attachment.json","path":"_meta.json","size":300,"sha256":"76244c47d907a0f01ba120a5187ac19426819fd41b2b38a621135d581d31d0ba","contentType":"application/json; charset=utf-8"},{"id":"e03d276b-d926-57e3-b28c-f732ae43b54f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e03d276b-d926-57e3-b28c-f732ae43b54f/attachment.json","path":"assets/negative-prompts.json","size":2456,"sha256":"bb37a781b672a1fe5b78b83a7335ff22854a2bbb0cdff3b08e5c8f86cef13e53","contentType":"application/json; charset=utf-8"},{"id":"331a8fde-e220-5a67-8fc7-f8c302a87628","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/331a8fde-e220-5a67-8fc7-f8c302a87628/attachment.json","path":"assets/project-template.json","size":1134,"sha256":"7888e43e456096e3119b6661a6fa1b195d1497458611f55267e389485dc47a14","contentType":"application/json; charset=utf-8"},{"id":"4d0f2951-58d8-56db-9312-734ba1387e2e","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4d0f2951-58d8-56db-9312-734ba1387e2e/attachment.md","path":"references/api-schema.md","size":11298,"sha256":"65e2114dfbc5c3d164ec974b8813166e9dc20cc4938951907f04005fde327bc9","contentType":"text/markdown; charset=utf-8"},{"id":"20afcb99-7f22-56cc-9693-42e1bc8b0969","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/20afcb99-7f22-56cc-9693-42e1bc8b0969/attachment.md","path":"references/assembly-rules.md","size":10335,"sha256":"f6377a8be24bc9951f1d5de10add77b2efb0a9e72894c17b226e097d3f528756","contentType":"text/markdown; charset=utf-8"},{"id":"07eb1401-47d0-5f80-bb74-831573d3241a","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/07eb1401-47d0-5f80-bb74-831573d3241a/attachment.md","path":"references/continuity-guide.md","size":1938,"sha256":"d405e2617b2f90daf94e288a6f5610be2d5431324c01080e550b262ef08e5624","contentType":"text/markdown; charset=utf-8"},{"id":"000a04b7-1e25-5866-b398-14e82f73b925","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/000a04b7-1e25-5866-b398-14e82f73b925/attachment.md","path":"references/design-guide.md","size":4006,"sha256":"15611d787bb7921cf0ece2b63444b20b450cfa5eb6bc8e2fdd4820edc5450c81","contentType":"text/markdown; charset=utf-8"},{"id":"94d4ddd8-4b38-5fb6-b166-ef0d5b658f1a","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/94d4ddd8-4b38-5fb6-b166-ef0d5b658f1a/attachment.md","path":"references/diagnosis-guide.md","size":3111,"sha256":"c0112c90b737ff9a79ee1a84804007194b5aa5e08c48cda1e1b19d88073cf01b","contentType":"text/markdown; charset=utf-8"},{"id":"fad64968-59c4-5758-80dd-82ebf4e5255d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/fad64968-59c4-5758-80dd-82ebf4e5255d/attachment.md","path":"references/doc-reader-guide.md","size":1199,"sha256":"ac754d0ef5038344a44bf43250c6dc46f189a9d885c7ab3d0a782e5f491645b5","contentType":"text/markdown; charset=utf-8"},{"id":"78dd9808-122b-5d25-b07b-a2c024cb5a18","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/78dd9808-122b-5d25-b07b-a2c024cb5a18/attachment.md","path":"references/manga-drama-guide.md","size":2482,"sha256":"0024001c40a8f4cb827f97d33faefaf92e013dde207172f06472c48b8ef9e632","contentType":"text/markdown; charset=utf-8"},{"id":"10b04d84-6d15-5ac6-9530-c62e0497215b","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/10b04d84-6d15-5ac6-9530-c62e0497215b/attachment.md","path":"references/planning-guide.md","size":2337,"sha256":"7af04fa7f97c3a94bf0b7cbad71fbe0a92ae38cb3714d1a49df0f66d2d2ae63b","contentType":"text/markdown; charset=utf-8"},{"id":"334e5ef7-9824-5c70-9188-7a42842ecb9d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/334e5ef7-9824-5c70-9188-7a42842ecb9d/attachment.md","path":"references/platform-adapters.md","size":4274,"sha256":"eb4f3b689c5242011b34aaeeba4c94715807060797e7476c75ceaa45c5781ff9","contentType":"text/markdown; charset=utf-8"},{"id":"bd525990-903e-576c-8391-88704e6e3c2f","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/bd525990-903e-576c-8391-88704e6e3c2f/attachment.md","path":"references/prompt-examples.md","size":3796,"sha256":"c3677bf22de90549d8ad1e6d628fc0e9bf56d10b32b07213cee93cf44146ec11","contentType":"text/markdown; charset=utf-8"},{"id":"8657e3de-020c-56e5-ac97-e8fb42e8b6bb","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/8657e3de-020c-56e5-ac97-e8fb42e8b6bb/attachment.md","path":"references/script-generation-guide.md","size":3416,"sha256":"cfd19ebc2b64289dd837c4b40dc912821ae699c0e9af980e8a70d00910326136","contentType":"text/markdown; charset=utf-8"},{"id":"70b802a5-0727-5ea0-b0f9-c43c540e5c6b","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/70b802a5-0727-5ea0-b0f9-c43c540e5c6b/attachment.py","path":"scripts/doc_fetch.py","size":7925,"sha256":"449d5f1282f0489012c8ba5afa43375b739afa624058d22b736a835b96847e57","contentType":"text/x-python; charset=utf-8"},{"id":"18ea5dd7-3314-5190-9352-312667fd17c1","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/18ea5dd7-3314-5190-9352-312667fd17c1/attachment.py","path":"scripts/doc_indexer.py","size":15276,"sha256":"67ebeb8ab47ddd40bc28f31ea6c8952ed7c02ab8262bb1c6df43d550eb52160b","contentType":"text/x-python; charset=utf-8"},{"id":"63665557-df23-5b88-80b1-6d5362b437aa","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/63665557-df23-5b88-80b1-6d5362b437aa/attachment.py","path":"scripts/doc_search.py","size":6502,"sha256":"9fcd1d68bea17f4eb75e31ed821a9b64e5e84bb61e793c32ac006ae8f2ad473d","contentType":"text/x-python; charset=utf-8"},{"id":"8f342d21-145b-58e4-8fb7-b4bd89e56827","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/8f342d21-145b-58e4-8fb7-b4bd89e56827/attachment.py","path":"scripts/doc_summarize.py","size":8003,"sha256":"c1ae195a2d8905204cff95a642e16b095fdc9b1f9007d1c1f6f9f251a8f38eb2","contentType":"text/x-python; charset=utf-8"}],"bundle_sha256":"f0e3a56f1c7573048f497b8e3c6c2afa0ab5dd991dea70941f9ce0df03456d45","attachment_count":18,"text_attachments":18,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"skills/ai-drama-prompt-factory/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"integrations-apis","category_label":"Integrations"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"integrations-apis","import_tag":"clean-skills-v1","description":"AI短剧提示词工厂 - 端到端将小说/故事创意转化为结构化提示词包(角色立绘+场景+道具+分镜图片+视频+音频)的完整流水线。一个入口启动全流程,内部自动按阶段推进:策划→设计→剧本→诊断→提示词组装→API JSON输出。支持小说改编和原创短剧两条路径。触发词:AI短剧、短剧制作、小说转短剧、短剧提示词、提示词工厂、短剧全流程、小说改编短剧、生成短剧、AI视频剧本、短剧项目、分镜提示词、视频提示词、prompt factory。"}},"renderedAt":1782989796761}

AI短剧提示词工厂 (AI Drama Prompt Factory) 端到端将小说或故事创意转化为结构化提示词包,输出标准JSON供外部AI生成工具消费。 系统边界:只生产提示词数据,不做图片/视频/音频的实际生成。 --- ⚡ 启动协议(每次任务开始时必须执行) 任何短剧相关任务触发后,在执行任何工作之前,必须先向用户确认以下信息: Step 1:确认项目类型 向用户确认: - A 小说改编 — 用户提供小说/故事文本,改编为短剧提示词 - B 原创短剧 — 用户提供创意/主题,从零创建短剧提示词 Step 2:确认执行模式 向用户确认交付方式: - 🚀 全程模式 — 一次跑完全部Phase,中间不停,最终一次性交付所有产出文件 - 📋 分阶段模式 — 每个Phase完成后输出交付物,等用户确认/修改后再进入下一阶段(推荐) - 🎯 单阶段模式 — 只执行用户指定的某个Phase(需已有前序Phase的产出) Step 3:确认基础参数 向用户确认: - 视觉风格 — 电影写实 / 日系动漫 / 2.5D(默认:电影写实) - 剧本风格 — 标准叙事 / 爽文漫剧(默认:标准叙事) - 目标集数 — 预计多少集(可后续调整) - 每集时长 — 1分钟 / 2分钟 / 3分钟(默认:1-2分钟) - 剧本分镜Markdown输出 — 是否同时输出可读性更强的Markdow…