OpenSpec icon indicating copy to clipboard operation
OpenSpec copied to clipboard

【求助】中文支持

Open MuJianxuan opened this issue 11 months ago • 21 comments

如何使得openspec生成的文档是中文的,并且可以经过openspec的校验

MuJianxuan avatar Dec 10 '25 02:12 MuJianxuan

生成后重新翻译一遍AGENTS.md,放回对应的位置。然后将AGENTS.md中添加一句以后所有的思考和注释都用中文。基本就可以了。

RdSean avatar Dec 10 '25 04:12 RdSean

好哩

MuJianxuan avatar Dec 10 '25 10:12 MuJianxuan

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.

TabishB avatar Dec 10 '25 11:12 TabishB

在系统提示词里要求用中文回复,譬如你用 cursor,那么 rules 里增加:Always respond in 中文

JQSC avatar Dec 11 '25 12:12 JQSC

关键是如何通过 validate 和 archive;经常是任务执行完了,archive总是不通过

ShuBuShao avatar Dec 14 '25 08:12 ShuBuShao

https://github.com/studyzy/OpenSpec-cn 现成的汉化版,直接使用即可!

studyzy avatar Dec 15 '25 02:12 studyzy

https://github.com/studyzy/OpenSpec-cn 现成的汉化版,直接使用即可!

我也在用,不过还是有点问题的,openspec validate 会提示需要MUST关键字之类的

adeewu avatar Dec 19 '25 03:12 adeewu

为啥我直接就是中文,验证也能过,用得也是openspec

2ue avatar Dec 22 '25 14:12 2ue

为啥我直接就是中文,验证也能过,用得也是openspec

直接用的 openspec 就可以通过 validate和archive么?

ShuBuShao avatar Dec 23 '25 06:12 ShuBuShao

https://github.com/ruan-cat/monorepo/tree/main/claude-code-marketplace/common-tools/skills/openspec 安装个skills解决

terranc avatar Dec 23 '25 10:12 terranc

@TabishB When will multilingual support be available?

KodeChicken avatar Dec 24 '25 09:12 KodeChicken

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-delta spec.md files.
  • 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).

lovelybowen avatar Dec 25 '25 06:12 lovelybowen

为啥我直接就是中文,验证也能过,用得也是openspec

你确定吗?你是中文,验证也通过?

xtdw12345 avatar Dec 30 '25 17:12 xtdw12345

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-delta spec.md files.

  • 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,实测有效~

FranzKafkaYu avatar Dec 31 '25 07:12 FranzKafkaYu

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-delta spec.md files.所有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

postbird avatar Jan 02 '26 11:01 postbird

将下面的内容拷贝到project.md中,就可以解决你这个问题了。

OpenSpec Documentation Conventions

  • 中文文档优先 - 所有OpenSpec相关文档(proposal.md, spec.md, design.md等)使用中文编写
  • 需求表达方式 - 内容使用中文,但必须保留英文校验关键詞 (如 MAY, SHOULD, MUST, SHALL) 以通过工具校验。推荐格式:"系统 必须 (MUST) ..."
  • 场景描述格式 - 保持#### Scenario:格式标准,内容使用中文描述
  • 校验兼容性 - 注意OpenSpec工具的正则校验可能针对英文关键词,需要平衡中文表达和工具要求
  • 文档结构 - 遵循OpenSpec标准结构,但内容本地化为中文

mufengCc avatar Jan 29 '26 03:01 mufengCc

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

如果您遇到任何问题,请告诉我。

TabishB avatar Jan 29 '26 04:01 TabishB

如何使得openspec生成的文档是中文的,并且可以经过openspec的校验

已经支持了,初始化完改个配置就行了

kmq116 avatar Feb 06 '26 02:02 kmq116

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!

postbird avatar Feb 07 '26 07:02 postbird

Very good. Thank you for your efforts, sir.

lzh-programmer avatar Feb 09 '26 09:02 lzh-programmer