Skip to content

Files for proposal in non-English will prevent the openspec tools validation. #243

Closed

Description

@Readon

It seems that openspec tools would validate the proposal related files by character filter.

However, if those Markdown files is written in non-English then the validation could fail.

So there are two possible way to fix it:

  1. ask LLM only generate Markdown files in English.
  2. include all keywords represent MUST in other languages into the tools.

Activity

  1. changed the title [-]Files for proposal in non-English will prevent the openspec tools fail.[/-] [+]Files for proposal in non-English will prevent the openspec tools validation.[/+] on Oct 26, 2025
  2. yha9806 commented on Nov 5, 2025

    @yha9806

    Hi! I'd like to work on this issue.

    Problem: OpenSpec currently requires requirements to contain SHALL or MUST keywords (RFC 2119), enforced as an ERROR. This blocks users writing specs in non-English languages.

    Proposed Solution: Change SHALL/MUST validation from ERROR to WARNING level.

    Rationale:

    • ✅ Maintains best practice recommendations for English documentation
    • ✅ Removes blocker for international users
    • ✅ Teams that want strict enforcement can use --strict mode
    • ✅ Minimal code change (2 lines)

    Approach:

    1. Update src/core/validation/validator.ts to emit WARNING instead of ERROR
    2. Update validation message to be guidance-focused
    3. Add test cases for non-English content validation
    4. Ensure --strict mode still enforces the check

    OpenSpec Proposal: I've created a proposal following the OpenSpec framework: relax-shall-must-validation

    I'll submit a PR shortly. Thanks!

  3. yha9806 commented on Nov 6, 2025

    @yha9806

    🎉 临时修复版本已发布

    在官方版本合并前,你可以使用我发布的临时版本:

    npm install -g @haoruiyyyu/openspec

    包含的修复:

    • ✅ SHALL/MUST 验证从 ERROR 降级为 WARNING
    • ✅ 支持非英文文档(中文、日语、西班牙语等)
    • ✅ --strict 模式仍然强制执行检查

    修复详情:

    # 非英文文档现在可以通过验证
    openspec validate my-chinese-spec
    # ⚠ WARNING: Requirement should contain SHALL or MUST (RFC 2119 best practice)
    # ✅ Validation passed
    
    # 严格模式仍然会失败(如需要)
    openspec validate --strict my-chinese-spec
    # ❌ Validation failed (warnings treated as errors)

    npm 包信息:

    官方 PR:#284


    注:这是临时版本,官方 PR 合并后请切换回官方版本。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions