同步:nuwa技能优化、脚本创作技能完善、提示词vs素材库分析及memory日志更新
This commit is contained in:
1 parent
aa5585c79e
commit
8f7ec9e794
29 files changed
+1059
-264
No files matched your search
@@ -101,9 +101,112 @@ def check_primary_sources(content: str) -> tuple[bool, str]:
|
||||
return passed, f"一手来源占比: {primary}/{total} ({ratio:.0%}) {'✅' if passed else '❌ (应>50%)'}"
|
||||
|
||||
|
||||
def check_terminology_adaptation(content: str) -> tuple[bool, str]:
|
||||
"""检查面向用户交付物中是否有内部术语残留。
|
||||
检查section标题和正文,确保没有学术黑话。"""
|
||||
# SKILL.md文件是给AI agent用的,保留术语是合理的
|
||||
is_skill_file = bool(re.search(r'^---\s*\nname:\s*', content, re.MULTILINE))
|
||||
if is_skill_file:
|
||||
return True, "SKILL.md文件(给AI agent用),术语保留 ✅"
|
||||
|
||||
# 完整的禁用术语列表(含正文检查)
|
||||
jargon_terms = [
|
||||
'心智模型', '决策启发式', '表达DNA', '诚实边界',
|
||||
'内在张力', '智识谱系', '反模式',
|
||||
'三重验证', '跨域复现', '生成力', '排他性'
|
||||
]
|
||||
|
||||
# 检查section标题(## 开头的行)
|
||||
section_headers = re.findall(r'^##\s+.*$', content, re.MULTILINE)
|
||||
jargon_in_headers = []
|
||||
for header in section_headers:
|
||||
for term in jargon_terms:
|
||||
if term in header:
|
||||
jargon_in_headers.append(f'标题"{header.strip()}"含"{term}"')
|
||||
|
||||
# 检查正文中的术语残留(排除在代码块/引用块中的情况)
|
||||
jargon_in_body = []
|
||||
lines = content.split('\n')
|
||||
in_code_block = False
|
||||
for i, line in enumerate(lines, 1):
|
||||
if line.strip().startswith('```'):
|
||||
in_code_block = not in_code_block
|
||||
continue
|
||||
if in_code_block:
|
||||
continue
|
||||
for term in jargon_terms:
|
||||
if term in line:
|
||||
# 排除在"禁用词列表"中提到术语本身的情况
|
||||
if '禁用' in line or '不出现' in line or '❌' in line:
|
||||
continue
|
||||
jargon_in_body.append(f'第{i}行含"{term}": {line.strip()[:60]}...')
|
||||
|
||||
all_issues = jargon_in_headers + jargon_in_body[:5] # 最多显示5条正文问题
|
||||
|
||||
if all_issues:
|
||||
return False, f"❌ 术语残留: {'; '.join(all_issues[:5])}"
|
||||
return True, "面向用户交付物,无术语残留 ✅"
|
||||
|
||||
|
||||
def check_persona_card_format(content: str) -> tuple[bool, str]:
|
||||
"""检查短视频人设卡是否符合12段标准结构。
|
||||
当文件名包含'人设'或'账号卡片'时触发此检查。"""
|
||||
# 判断是否是人设卡
|
||||
if not re.search(r'人设|账号卡片|persona', content[:200], re.IGNORECASE):
|
||||
return True, "非人设卡文件(跳过12段结构检查)"
|
||||
|
||||
expected_sections = [
|
||||
'账号核心定位', '账号内容基因', '角色原型库', '情绪结构',
|
||||
'视听风格', '五大内容打法', '内容规则', '系列内容规划',
|
||||
'差异化壁垒', '红线清单', '当前需解决的问题', '人设底线'
|
||||
]
|
||||
|
||||
found_sections = []
|
||||
missing_sections = []
|
||||
for section in expected_sections:
|
||||
if re.search(rf'##\s+.*{section}', content):
|
||||
found_sections.append(section)
|
||||
else:
|
||||
missing_sections.append(section)
|
||||
|
||||
if missing_sections:
|
||||
return False, f"❌ 缺少段落: {', '.join(missing_sections)}"
|
||||
return True, f"12段结构完整 ✅ ({len(found_sections)}/12)"
|
||||
|
||||
# 检查学术化表达
|
||||
def check_academic_writing(content: str) -> tuple[bool, str]:
|
||||
"""检查正文中是否有学术化表达(人设卡场景)。"""
|
||||
# SKILL.md文件不检查
|
||||
is_skill_file = bool(re.search(r'^---\s*\nname:\s*', content, re.MULTILINE))
|
||||
if is_skill_file:
|
||||
return True, "SKILL.md文件(跳过学术化检查)"
|
||||
|
||||
academic_patterns = [
|
||||
'认知框架', '降维打击', '范式', '策略性', '结构化',
|
||||
'方法论体系', '底层逻辑架构', '思维范式', '认知操作系统'
|
||||
]
|
||||
|
||||
found = []
|
||||
lines = content.split('\n')
|
||||
in_code_block = False
|
||||
for i, line in enumerate(lines, 1):
|
||||
if line.strip().startswith('```'):
|
||||
in_code_block = not in_code_block
|
||||
continue
|
||||
if in_code_block:
|
||||
continue
|
||||
for pattern in academic_patterns:
|
||||
if pattern in line:
|
||||
found.append(f'第{i}行: "{pattern}"')
|
||||
|
||||
if found:
|
||||
return False, f"❌ 学术化表达: {'; '.join(found[:3])}"
|
||||
return True, "无学术化表达 ✅"
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
print("用法: python3 quality_check.py <SKILL.md路径>")
|
||||
print("用法: python3 quality_check.py <文件路径>")
|
||||
sys.exit(1)
|
||||
|
||||
skill_path = Path(sys.argv[1])
|
||||
@@ -113,16 +216,40 @@ def main():
|
||||
|
||||
content = skill_path.read_text(encoding='utf-8')
|
||||
|
||||
checks = [
|
||||
("心智模型数量", check_mental_models),
|
||||
("模型局限性", check_limitations),
|
||||
("表达DNA辨识度", check_expression_dna),
|
||||
("诚实边界", check_honest_boundary),
|
||||
("内在张力", check_tensions),
|
||||
("一手来源占比", check_primary_sources),
|
||||
]
|
||||
# 判断文件类型
|
||||
is_skill_file = bool(re.search(r'^---\s*\nname:\s*', content, re.MULTILINE))
|
||||
is_persona_card = bool(re.search(r'人设|账号卡片|persona', content[:500], re.IGNORECASE))
|
||||
|
||||
if is_skill_file:
|
||||
# SKILL.md文件:运行全部检查(内部术语是合理的)
|
||||
checks = [
|
||||
("心智模型数量", check_mental_models),
|
||||
("模型局限性", check_limitations),
|
||||
("表达DNA辨识度", check_expression_dna),
|
||||
("诚实边界", check_honest_boundary),
|
||||
("内在张力", check_tensions),
|
||||
("一手来源占比", check_primary_sources),
|
||||
("术语通俗化", check_terminology_adaptation),
|
||||
]
|
||||
file_type = "SKILL.md(AI agent Skill文件)"
|
||||
elif is_persona_card:
|
||||
# 人设卡:只运行面向用户的检查项
|
||||
checks = [
|
||||
("术语通俗化", check_terminology_adaptation),
|
||||
("人设卡12段结构", check_persona_card_format),
|
||||
("学术化表达", check_academic_writing),
|
||||
]
|
||||
file_type = "人设卡(面向编导/创作者)"
|
||||
else:
|
||||
# 其他面向用户的文档
|
||||
checks = [
|
||||
("术语通俗化", check_terminology_adaptation),
|
||||
("学术化表达", check_academic_writing),
|
||||
]
|
||||
file_type = "面向用户文档"
|
||||
|
||||
print(f"质量检查: {skill_path.name}")
|
||||
print(f"文件类型: {file_type}")
|
||||
print("=" * 50)
|
||||
|
||||
passed_count = 0
|
||||
|
||||
Reference in new issue
Block a user