Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
黄南光
/
wiki_knowledge
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 341502d2
authored
Jul 14, 2026
by
黄南光
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
docs: define writer yaml block list rules
1 parent
43069030
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
docs/superpowers/specs/2026-07-14-writer-yaml-block-lists-design.md
docs/superpowers/specs/2026-07-14-writer-yaml-block-lists-design.md
0 → 100644
View file @
341502d
# Writer YAML 块列表约束设计
## 目标
减少 Writer 生成 Wiki frontmatter 时的 YAML 语法错误,重点消除
`brand: [未知品牌[待确认]]`
这类“行内数组与业务方括号冲突”导致的整批重试。
## 范围
-
Planner 继续输出 JSON,数组仍使用标准 JSON 行内形式,如
`"brand": ["问界"]`
。
-
Writer 输出的 YAML frontmatter 中,
`series`
、
`brand`
、
`business_category`
、
`sub_business`
、
`role`
、
`related`
、
`sources`
、
`tags`
、
`skill_tag`
全部使用块列表。
-
YAML 列表的每个字符串元素使用双引号,确保
`[待确认]`
、
`[待审批]`
、冒号、井号等字符不会被解释为 YAML 语法。
-
不改变 Writer 的整体输出协议,不把 frontmatter 生成迁移到 Python;该架构优化留待独立改造。
## 模型约束
Schema 与 Skill 使用同一合法示例:
```
yaml
series
:
-
"
鸿蒙智行"
brand
:
-
"
未知品牌[待确认]"
business_category
:
-
"
轻改类"
sub_business
:
-
"
太阳膜"
role
:
-
"
驻店销售"
related
:
[]
sources
:
-
"
ware/raw/轻改产品.pdf"
tags
:
[]
skill_tag
:
[]
```
Writer 系统提示词明确禁止
`field: [value]`
行内数组。首次校验失败后的重试提示同时给出上述块列表规则,使模型只修复格式而不需要猜测合法写法。
## 错误处理
-
保留现有
`frontmatter.loads()`
、共享 contract 校验和重试机制作为最后防线。
-
不使用正则自动修复无效 YAML,避免错误改写正文或带特殊字符的字段值。
-
页面仍需全部通过统一预检后才能进入事务发布。
## 测试
-
静态检查 Schema 和 Skill 的 Writer YAML 示例,不允许九个多值字段使用非空行内数组。
-
检查 Writer 系统提示词包含块列表规则、禁止行内数组及
`[待确认]`
合法示例。
-
检查重试提示包含同一格式约束。
-
保持 Planner JSON 数组、list-only contract、页面覆盖、多系列路径与事务回归测试通过。
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment