关于 content-refiner
content-refiner 是用于修订未通过验收检查的课程内容的技能,重点处理字数和连贯性问题。它先判断失败原因,再按内容层级修改并验证结果。
主要功能
- 01诊断字数与连贯性问题
- 02计算所需删减比例
- 03重写开头以补足衔接
- 04按内容层级精简
- 05验证修订后的内容
适用场景
- 01精简超出目标字数的课程
- 02修复缺少前课衔接的开头
- 03同时处理字数与连贯性问题
- 04提交复核前检查修订内容
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ panaversity/ agentfactory --skill content-refiner安装后在 Claude Code 中输入/content-refiner确认已加载。
详细介绍
内容优化器(修复器)
用途
门禁后工具。 将未通过门禁 4 的内容改为合格内容。 重点是精简冗余内容并修复连贯性。
何时使用
- 触发条件:门禁 4(验收审核器)返回
[FAIL]。 - 目标:修复字数或连贯性问题(也可能两者都有)。
- 关键:应用修复之前,先诊断失败原因。
关键:优化前诊断
不要盲目应用修复。 门禁 4 失败的原因各不相同,需要采用不同的策略。
步骤 0:确定失败原因(必做)
询问用户,或查看门禁 4 的失败消息:
| 失败类型 | 问题 | 操作 |
|---|---|---|
| 字数 | “课程是否超出目标字数(通常为 1500 字)?” | 计算需要删减的准确百分比 |
| 连贯性 | “开篇是否提及前一课?” | 仅重写开篇 |
| 两者都有 | “字数和连贯性都存在问题吗?” | 分两个阶段处理 |
诊断示例:
示例 1:仅字数问题
Content: 1950 words, Target: 1500
Excess: 450 words
% to cut: (450 / 1950) × 100 = 23%
→ CUT EXACTLY 23%, not generic 15-20%
示例 2:仅连贯性问题
Opening: "Let's explore this new topic..."
Problem: Doesn't reference Lesson N-1
→ Rewrite opening only; don't cut words
示例 3:两者都有
Word count: 1950 (23% over)
Opening: Generic, missing prior lesson reference
→ Phase 1: Rewrite opening (identify anchor from Lesson N-1)
→ Phase 2: Cut words to 23% (context-aware)
步骤 1:评估内容层级(结合上下文删减)
阅读课程的 frontmatter,以确定层级:
| 层级 | 删减策略 |
|---|---|
| L1(手册) | 保留基础解释;删减展开说明 |
| L2(AI 协作) | 保留“与 AI 一起尝试”部分(核心内容);删减叙述性填充内容 |
| L3(智能) | 保留模式洞见;删减解释性铺垫 |
| L4(规格驱动) | 保留规格细节;删减概念性铺垫 |
优化流程(按层级处理)
阶段 1:衔接构建器(修复连贯性)
如果开篇较为笼统,请先执行此步骤。
公式:
In [Previous Lesson], you [SPECIFIC OUTCOME from Lesson N-1].
Now, we will [CONNECT outcome to new goal] by [STRATEGY].
验证:
- 开篇按名称提及第 N-1 课
- 提及具体成果(而非笼统地说“学到了……”)
- 清楚说明本课为何重要(如何在第 N-1 课的基础上展开)
修复后:如果字数也不合格,请继续使用冗余删减器。
阶段 2:冗余删减器(修复字数)
按以下顺序执行各层级对应的删减:
适用于所有层级:
- 删除重复的“为何重要”部分
- 仅在揭示了不明显的洞见时保留
- 如果正文和“为何重要”部分表达了相同观点 → 删除“为何重要”部分
- 合并重复示例
- 找出重复的解释
- 保留第一个,删除第二个
- 精简各部分之间的过渡
- 将“正如我们之前讨论过的,X……”替换为直接引用
仅适用于 L1-L2(学生仍在打基础): 4. 将“与 AI 一起尝试”部分精简到恰好 2 个提示词
- 保留基础提示词和一个进阶提示词
- 删除额外的探索性提示词
- 保留教学铺垫(解释、示例)
仅适用于 L3-L4(学生已准备好学习高级模式): 4. 精简叙述性铺垫
- 保留模式洞见和规则
- 删除“为何这在理念上很重要”的内容
- 删除初学者级别的解释
- 假设学生已理解基础知识
适用于所有层级: 6. 一个类比规则:为该概念保留最好的类比;删除重复类比 7. 合并表格与文本:只使用一种形式(表格或散文),不可两者兼用 8. 减少示例:保留 2-3 个最佳示例;删除“还可以考虑……”等内容 9. 精简列表:将 5 项列表改为 3 个核心项目
验证:
- 删减后的字数:[目标字数 ± 5%]
- L1 课程未删减 L1 内容
- L3-L4 课程未丢失模式洞见
- “与 AI 一起尝试”:L1-L2 保留 2 个提示词;L3-L4 全部保留
阶段 3:优化后验证(关键)
应用修复后,请确认内容现已通过门禁 4:
✓ Word Count Check:
Current: [X] words
Target: [target_from_spec]
Status: [PASS if ≤target ± 5%, FAIL if over]
✓ Continuity Check:
Opening references Lesson [N-1]? [YES/NO]
Specific outcome mentioned? [YES/NO]
Connection to new lesson clear? [YES/NO]
✓ Layer Appropriateness:
No foundational cuts from L1-L2? [YES/NO]
No pattern insight loss from L3-L4? [YES/NO]
✓ Content Integrity:
Removed examples still explained elsewhere? [YES/NO]
Cut sections non-essential? [YES/NO]
下一步建议:
"Refined content is ready.
Word count: [after] (target: ≤[target])
Continuity: Now references Lesson [N-1]
Recommend re-submitting to acceptance-auditor for Gate 4 re-validation.
Command: [provide re-validation instruction]"
输出格式
## Refinement Report: [Lesson Name]
### Diagnosis
**Issue Found**: [Word count | Continuity | Both]
**Layer**: [L1/L2/L3/L4]
### Metrics
| Metric | Before | After | Target | Status |
|--------|--------|-------|--------|--------|
| Word Count | 1950 | 1485 | ≤1500 | ✅ PASS |
| Continuity | Generic opening | References Lesson 2 | Specific reference | ✅ PASS |
### Fixes Applied
1. **Phase 1**: Rewrote opening to reference "booking-agent implementation" from Lesson 2
2. **Phase 2**: Deleted 240 words using layer-aware cuts:
- Removed redundant "Why This Matters" section (line 45, 120 words)
- Merged duplicate example (lines 67-89, 85 words)
- Cut 1 extra "Try With AI" prompt (35 words)
3. **Phase 3**: Validated word count and continuity
### Ready for Re-validation
✅ Word count: 1485 (≤1500)
✅ Continuity: Opening references Lesson 2
✅ Layer integrity: All L2 AI examples preserved
**Next**: Re-submit to acceptance-auditor for Gate 4 validation
### Refined Content
[Full refined lesson content]
评论
支持 Markdown