【求助】中文支持
如何使得openspec生成的文档是中文的,并且可以经过openspec的校验
生成后重新翻译一遍AGENTS.md,放回对应的位置。然后将AGENTS.md中添加一句以后所有的思考和注释都用中文。基本就可以了。
好哩
Sorry about the experience, I'm aiming to get in Multi-Lingual support in the coming month 🙇 There's an open PR for it but I think there's a few updates that need to happen to ensure it's implemented correctly. Sorry about the delay.
在系统提示词里要求用中文回复,譬如你用 cursor,那么 rules 里增加:Always respond in 中文
关键是如何通过 validate 和 archive;经常是任务执行完了,archive总是不通过
https://github.com/studyzy/OpenSpec-cn 现成的汉化版,直接使用即可!
https://github.com/studyzy/OpenSpec-cn 现成的汉化版,直接使用即可!
我也在用,不过还是有点问题的,openspec validate 会提示需要MUST关键字之类的
为啥我直接就是中文,验证也能过,用得也是openspec
为啥我直接就是中文,验证也能过,用得也是openspec
直接用的 openspec 就可以通过 validate和archive么?
https://github.com/ruan-cat/monorepo/tree/main/claude-code-marketplace/common-tools/skills/openspec 安装个skills解决
@TabishB When will multilingual support be available?
I solved this by directly adding a Language and Communication section to openspec/AGENTS.md.
Language and Communication
- Default to Simplified Chinese for all OpenSpec artifacts and interaction, including
proposal.md,design.md,tasks.md, and spec/spec-deltaspec.mdfiles. - For tool compatibility, keep only OpenSpec structural tokens/headings in English:
- Requirement/Scenario headings:
### Requirement:,#### Scenario: - Requirement section headings:
## ADDED|MODIFIED|REMOVED|RENAMED Requirements - Scenario step keywords:
**GIVEN**,**WHEN**,**THEN**,**AND THEN** - Normative keyword:
SHALL(recommended; write the rest in Chinese, e.g.系统 SHALL ...)
- Requirement/Scenario headings:
- Keep CLI commands, paths, and parameters as-is, and display them in code format (e.g.,
openspec validate <id> --strict).
为啥我直接就是中文,验证也能过,用得也是openspec
你确定吗?你是中文,验证也通过?
I solved this by directly adding a Language and Communication section to openspec/AGENTS.md.
Language and Communication
Default to Simplified Chinese for all OpenSpec artifacts and interaction, including
proposal.md,design.md,tasks.md, and spec/spec-deltaspec.mdfiles.For tool compatibility, keep only OpenSpec structural tokens/headings in English:
- Requirement/Scenario headings:
### Requirement:,#### Scenario:- Requirement section headings:
## ADDED|MODIFIED|REMOVED|RENAMED Requirements- Scenario step keywords:
**GIVEN**,**WHEN**,**THEN**,**AND THEN**- Normative keyword:
SHALL(recommended; write the rest in Chinese, e.g.系统 SHALL ...)Keep CLI commands, paths, and parameters as-is, and display them in code format (e.g.,
openspec validate <id> --strict).
Great,实测有效~
I solved this by directly adding a Language and Communication section to openspec/AGENTS.md.我通过直接在openspec/AGENTS.md中添加语言和通信部分来解决这个问题。
Language and Communication
- Default to Simplified Chinese for all OpenSpec artifacts and interaction, including
proposal.md,design.md,tasks.md, and spec/spec-deltaspec.mdfiles.所有OpenSpec工件和交互都默认为简体中文,包括、、和spec/spec-delta文件。- For tool compatibility, keep only OpenSpec structural tokens/headings in English: 为了工具兼容性,只保留英文的OpenSpec结构标记/标题:
- Requirement/Scenario headings:
### Requirement:,#### Scenario:需求/场景标题:,- Requirement section headings: 要求章节标题:
## ADDED|MODIFIED|REMOVED|RENAMED Requirements- Scenario step keywords:
**GIVEN**,**WHEN**,**THEN**,**AND THEN**场景步骤关键词:,,,- Normative keyword:
SHALL(recommended; write the rest in Chinese, e.g.系统 SHALL ...)规范关键词:(推荐,其余部分用中文书写,例如)- Keep CLI commands, paths, and parameters as-is, and display them in code format (e.g.,
openspec validate <id> --strict).保持CLI命令、路径和参数不变,并以代码格式(例如)显示它们。
Thanks for your help! It works for me
将下面的内容拷贝到project.md中,就可以解决你这个问题了。
OpenSpec Documentation Conventions
- 中文文档优先 - 所有OpenSpec相关文档(proposal.md, spec.md, design.md等)使用中文编写
- 需求表达方式 - 内容使用中文,但必须保留英文校验关键詞 (如 MAY, SHOULD, MUST, SHALL) 以通过工具校验。推荐格式:"系统 必须 (MUST) ..."
- 场景描述格式 - 保持
#### Scenario:格式标准,内容使用中文描述 - 校验兼容性 - 注意OpenSpec工具的正则校验可能针对英文关键词,需要平衡中文表达和工具要求
- 文档结构 - 遵循OpenSpec标准结构,但内容本地化为中文
FYI in the new version of OpenSpec i.e 1.0+ we support multiple languages out of the box:
https://github.com/Fission-AI/OpenSpec/blob/main/docs/multi-language.md
let me know if you have any issues
顺便一提,在新版 OpenSpec(即 1.0 及以上版本)中,我们原生支持多种语言:
https://github.com/Fission-AI/OpenSpec/blob/main/docs/multi-language.md
如果您遇到任何问题,请告诉我。
如何使得openspec生成的文档是中文的,并且可以经过openspec的校验
已经支持了,初始化完改个配置就行了
I think we can close this issue, I have applied the new version openspec, it works well in my several project! Thanks for @TabishB 's job!
Very good. Thank you for your efforts, sir.