Skip to content

Conversation

@eust-w
Copy link

@eust-w eust-w commented Nov 11, 2025

Add comprehensive multilingual support to OpenSpec, allowing users to select their preferred language during initialization. All generated templates, configuration files, and instructions will be provided in the selected language.

Closes #299

  • feat: add language selection to openspec init command
  • Add language selection prompt in interactive mode before AI tool selection
  • Support option for non-interactive mode with validation
  • Display available languages with native names (English, 中文, Français, 日本語, العربية)
  • Default to English (en-US) if no selection is made
  • Store selected language in for consistency
  • feat: extend OpenSpecConfig interface with language field
  • Add field to OpenSpecConfig interface
  • Define SUPPORTED_LANGUAGES constant with language options
  • Support en-US (default), zh-CN, fr-FR, ja-JP, ar-SA
  • Create CONFIG_FILE_NAME constant for config.json
  • feat: create multilingual template system
  • Create i18n directory structure under src/core/templates/i18n/
  • Implement language-specific templates for each supported language:
    • agents-root-stub.ts (root AGENTS.md stub)
    • agents-template.ts (full AGENTS.md template, 457 lines)
    • project-template.ts (project context template)
    • slash-command-templates.ts (proposal, apply, archive commands)
  • Update TemplateManager to support language parameter in all methods
  • Add fallback to English for unsupported languages
  • feat: update all configurators to support multilingual content
  • Update ToolConfigurator interface to accept language parameter
  • Modify all AI tool configurators (Claude, Cursor, Cline, etc.) to pass language to templates
  • Update SlashCommandConfigurator base class to support language
  • Ensure all generated configuration files use selected language
  • feat: update openspec update command to respect language settings
  • Read language configuration from openspec/config.json
  • Use stored language when regenerating templates
  • Maintain language consistency across update operations
  • test: add comprehensive tests for multilingual functionality
  • Add unit tests for language selection in non-interactive mode
  • Add integration tests verifying Chinese template generation
  • Add tests for French, Japanese, and Arabic template generation
  • Verify config.json creation and language persistence
  • Test language reading in extend mode
  • docs: update CLI help text with language option
  • Add option description to init command help
  • List supported language codes in help text
  • Update AGENTS.md template to include multilingual instructions

Summary by CodeRabbit

  • New Features

    • Multilingual support with interactive prompt and --language CLI flag; en-US, zh-CN, fr-FR, ja-JP, ar-SA supported (expandable)
    • Selected language is persisted in project configuration
  • Behavior Changes

    • All generated docs, templates, tool configs, and slash command content use the chosen language; changing language regenerates localized templates where needed
  • Tests

    • Added tests for selection, persistence, extend-mode behavior, and localized output across supported locales

…I#299)

Add comprehensive multilingual support to OpenSpec, allowing users to select their preferred language during initialization. All generated templates, configuration files, and instructions will be provided in the selected language.

Closes Fission-AI#299

* feat: add language selection to openspec init command

- Add language selection prompt in interactive mode before AI tool selection
- Support  option for non-interactive mode with validation
- Display available languages with native names (English, 中文, Français, 日本語, العربية)
- Default to English (en-US) if no selection is made
- Store selected language in  for consistency

* feat: extend OpenSpecConfig interface with language field

- Add  field to OpenSpecConfig interface
- Define SUPPORTED_LANGUAGES constant with language options
- Support en-US (default), zh-CN, fr-FR, ja-JP, ar-SA
- Create CONFIG_FILE_NAME constant for config.json

* feat: create multilingual template system

- Create i18n directory structure under src/core/templates/i18n/
- Implement language-specific templates for each supported language:
  - agents-root-stub.ts (root AGENTS.md stub)
  - agents-template.ts (full AGENTS.md template, 457 lines)
  - project-template.ts (project context template)
  - slash-command-templates.ts (proposal, apply, archive commands)
- Update TemplateManager to support language parameter in all methods
- Add fallback to English for unsupported languages

* feat: update all configurators to support multilingual content

- Update ToolConfigurator interface to accept language parameter
- Modify all AI tool configurators (Claude, Cursor, Cline, etc.) to pass language to templates
- Update SlashCommandConfigurator base class to support language
- Ensure all generated configuration files use selected language

* feat: update openspec update command to respect language settings

- Read language configuration from openspec/config.json
- Use stored language when regenerating templates
- Maintain language consistency across update operations

* test: add comprehensive tests for multilingual functionality

- Add unit tests for language selection in non-interactive mode
- Add integration tests verifying Chinese template generation
- Add tests for French, Japanese, and Arabic template generation
- Verify config.json creation and language persistence
- Test language reading in extend mode

* docs: update CLI help text with language option

- Add  option description to init command help
- List supported language codes in help text
- Update AGENTS.md template to include multilingual instructions
@eust-w eust-w requested a review from TabishB as a code owner November 11, 2025 10:09
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 11, 2025

Walkthrough

Adds multilingual support across OpenSpec: language selection in init (CLI flag and prompt), persisted openspec/config.json language, i18n core and localized templates for en-US/zh-CN/fr-FR/ja-JP/ar-SA, updates to TemplateManager/configurators/init/update flows, file-system JSON helpers, and tests.

Changes

Cohort / File(s) Summary
Specs & Docs
openspec/changes/add-multilingual-support/proposal.md, openspec/changes/add-multilingual-support/specs/cli-init/spec.md, openspec/changes/add-multilingual-support/tasks.md, openspec/specs/cli-init/spec.md
Adds multilingual proposal, detailed CLI-init spec (language selection, storage, templates), and task checklist.
CLI entry
src/cli/index.ts
Adds --language option to init and forwards it to InitCommand.
Core config & types
src/core/config.ts
Extends OpenSpecConfig with optional language; adds LanguageOption, SUPPORTED_LANGUAGES, DEFAULT_LANGUAGE, and CONFIG_FILE_NAME.
i18n core
src/core/i18n/index.ts
New i18n module: resources scaffold, getLanguage, t lookup, simple template stub and param interpolation.
Template manager
src/core/templates/index.ts
TemplateManager gains language param (default en-US), language-specific getters (Claude, Cline, Costrict, AgentsStandard, SlashCommandBody) and routing/fallback to locale templates.
Init flow
src/core/init.ts
InitCommand resolves language (flag → config → prompt), persists openspec/config.json, and passes language into template generation and configurators; adds helpers for read/write and prompting.
Update flow
src/core/update.ts
Reads persisted language (config.json), uses TemplateManager with language for AGENTS.md, and passes language to configurators and slash updates.
Configurators (all)
src/core/configurators/*
ToolConfigurator signature widened to accept optional language; each configurator passes language to TemplateManager to produce localized templates.
Slash commands
src/core/configurators/slash/base.ts
generateAll, updateExisting, and getBody accept language and use language-specific slash command bodies.
Language templates
src/core/templates/i18n/zh-CN/*, src/core/templates/i18n/fr-FR/*, src/core/templates/i18n/ja-JP/*, src/core/templates/i18n/ar-SA/*
Adds localized agentsRootStub, agentsTemplate, projectTemplate, and slash-command-templates for each locale.
File-system helpers
src/utils/file-system.ts
Adds readJsonFile<T> and writeJsonFile helpers for JSON config persistence.
Tests
test/core/init.test.ts
Adds tests for language selection, config.json creation, localized outputs across locales, and extend-mode language scenarios.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI as CLI (src/cli/index.ts)
    participant Init as InitCommand (src/core/init.ts)
    participant FS as FileSystem (src/utils/file-system.ts)
    participant Template as TemplateManager (src/core/templates/index.ts)
    participant Tools as Configurators (src/core/configurators/*)

    User->>CLI: openspec init [--language zh-CN]
    CLI->>Init: new InitCommand({ language: 'zh-CN' })

    rect rgba(223,243,255,0.6)
      Note over Init: Resolve language (flag → config → prompt)
      Init->>FS: readJsonFile(openspec/config.json)
      Init->>Init: promptForLanguage() (if needed)
      Init->>FS: writeJsonFile(openspec/config.json, { language: 'zh-CN' })
    end

    rect rgba(255,247,230,0.6)
      Note over Init,Template: Generate localized templates
      Init->>Template: getTemplates(context, 'zh-CN')
      Template-->>Init: [project.md (zh-CN), AGENTS.md (zh-CN), ...]
      Init->>Tools: configureAITools(..., 'zh-CN')
      Tools->>Template: getClaudeTemplate('zh-CN') / getAgentsStandardTemplate('zh-CN')
      Tools->>FS: write localized files
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Areas to prioritize:

  • src/core/init.ts — language resolution, read/write helpers, extend-mode semantics.
  • src/core/templates/index.ts — routing, fallback behavior and new language getters.
  • src/core/update.ts — config read and propagation to update flows.
  • Consistency and completeness of i18n template files across locales.
  • src/utils/file-system.ts — JSON read/write correctness and error handling.
  • Tests in test/core/init.test.ts — ensure mocks align with prompt/CLI behavior.

Possibly related PRs

Suggested reviewers

  • TabishB

Poem

🐰
I hopped through files both near and far,
Brought words for projects in each language bar.
AGENTS and project briefs now sing in five tongues,
Config saved true — the global choir has begun! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add multilingual support for OpenSpec initialization' clearly and concisely describes the main change: adding multilingual support to the initialization process.
Linked Issues check ✅ Passed The PR implementation meets the core objectives from issue #299: language selection in init, config.json persistence, multilingual templates for AGENTS.md and project.md, language parameter propagation through configurators, and language support in the update command.
Out of Scope Changes check ✅ Passed All changes are directly aligned with the multilingual support feature scope. The PR adds language infrastructure, templates, configurators, and related tooling without introducing unrelated modifications.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
src/core/configurators/qoder.ts (1)

36-42: LGTM! Language parameter correctly integrated.

The addition of the optional language parameter with a sensible default and proper pass-through to TemplateManager.getClaudeTemplate(language) enables multilingual support while maintaining backward compatibility.

Consider updating the JSDoc comment (lines 25-35) to document the new language parameter:

  /**
   * Configure Qoder integration for a project
   * 
   * Creates or updates QODER.md file with OpenSpec instructions.
   * Uses Claude-compatible template for instruction content.
   * Wrapped with OpenSpec markers for future updates.
   * 
   * @param {string} projectPath - Absolute path to project root directory
   * @param {string} openspecDir - Path to openspec directory (unused but required by interface)
+  * @param {string} language - Language code for generated content (default: 'en-US')
   * @returns {Promise<void>} Resolves when configuration is complete
   */
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d32e50f and b3b2df3.

📒 Files selected for processing (37)
  • openspec/changes/add-multilingual-support/proposal.md (1 hunks)
  • openspec/changes/add-multilingual-support/specs/cli-init/spec.md (1 hunks)
  • openspec/changes/add-multilingual-support/tasks.md (1 hunks)
  • openspec/specs/cli-init/spec.md (4 hunks)
  • src/cli/index.ts (2 hunks)
  • src/core/config.ts (1 hunks)
  • src/core/configurators/agents.ts (1 hunks)
  • src/core/configurators/base.ts (1 hunks)
  • src/core/configurators/claude.ts (1 hunks)
  • src/core/configurators/cline.ts (1 hunks)
  • src/core/configurators/codebuddy.ts (1 hunks)
  • src/core/configurators/costrict.ts (1 hunks)
  • src/core/configurators/qoder.ts (1 hunks)
  • src/core/configurators/qwen.ts (1 hunks)
  • src/core/configurators/slash/base.ts (3 hunks)
  • src/core/i18n/index.ts (1 hunks)
  • src/core/init.ts (9 hunks)
  • src/core/templates/i18n/ar-SA/agents-root-stub.ts (1 hunks)
  • src/core/templates/i18n/ar-SA/agents-template.ts (1 hunks)
  • src/core/templates/i18n/ar-SA/project-template.ts (1 hunks)
  • src/core/templates/i18n/ar-SA/slash-command-templates.ts (1 hunks)
  • src/core/templates/i18n/fr-FR/agents-root-stub.ts (1 hunks)
  • src/core/templates/i18n/fr-FR/agents-template.ts (1 hunks)
  • src/core/templates/i18n/fr-FR/project-template.ts (1 hunks)
  • src/core/templates/i18n/fr-FR/slash-command-templates.ts (1 hunks)
  • src/core/templates/i18n/ja-JP/agents-root-stub.ts (1 hunks)
  • src/core/templates/i18n/ja-JP/agents-template.ts (1 hunks)
  • src/core/templates/i18n/ja-JP/project-template.ts (1 hunks)
  • src/core/templates/i18n/ja-JP/slash-command-templates.ts (1 hunks)
  • src/core/templates/i18n/zh-CN/agents-root-stub.ts (1 hunks)
  • src/core/templates/i18n/zh-CN/agents-template.ts (1 hunks)
  • src/core/templates/i18n/zh-CN/project-template.ts (1 hunks)
  • src/core/templates/i18n/zh-CN/slash-command-templates.ts (1 hunks)
  • src/core/templates/index.ts (2 hunks)
  • src/core/update.ts (4 hunks)
  • src/utils/file-system.ts (1 hunks)
  • test/core/init.test.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
openspec/changes/*/{proposal.md,tasks.md,design.md,specs/**/spec.md}

📄 CodeRabbit inference engine (openspec/AGENTS.md)

Scaffold each change with proposal.md, tasks.md, optional design.md, and delta spec files under openspec/changes//specs//spec.md

Files:

  • openspec/changes/add-multilingual-support/proposal.md
  • openspec/changes/add-multilingual-support/tasks.md
  • openspec/changes/add-multilingual-support/specs/cli-init/spec.md
openspec/changes/*/**

📄 CodeRabbit inference engine (openspec/AGENTS.md)

Choose a unique kebab-case, verb-led change-id (add-, update-, remove-, refactor-) for openspec/changes//

Files:

  • openspec/changes/add-multilingual-support/proposal.md
  • openspec/changes/add-multilingual-support/tasks.md
  • openspec/changes/add-multilingual-support/specs/cli-init/spec.md
openspec/changes/*/tasks.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

Track implementation steps in tasks.md and mark each completed item with '- [x]' once finished

Files:

  • openspec/changes/add-multilingual-support/tasks.md
openspec/{specs/**/spec.md,changes/*/specs/**/spec.md}

📄 CodeRabbit inference engine (openspec/AGENTS.md)

openspec/{specs/**/spec.md,changes/*/specs/**/spec.md}: Write requirements using SHALL/MUST for normative wording
Every requirement must include at least one scenario, formatted exactly with a '#### Scenario: ' header (no bullets or bold)
Under ADDED, introduce new capabilities as standalone requirements rather than altering existing ones

Files:

  • openspec/changes/add-multilingual-support/specs/cli-init/spec.md
  • openspec/specs/cli-init/spec.md
openspec/changes/*/specs/**/spec.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

openspec/changes/*/specs/**/spec.md: Use ADDED, MODIFIED, REMOVED, or RENAMED sections when authoring deltas; place changed requirements under the correct operation header
For MODIFIED requirements, paste the full existing requirement block (header through scenarios) and ensure the header text matches exactly (whitespace-insensitive)
Use RENAMED when only the requirement name changes; if behavior changes too, use RENAMED plus MODIFIED referencing the new name

Files:

  • openspec/changes/add-multilingual-support/specs/cli-init/spec.md
openspec/specs/**/spec.md

📄 CodeRabbit inference engine (openspec/AGENTS.md)

Keep current, deployed specs in openspec/specs//spec.md (one focused capability per directory)

Files:

  • openspec/specs/cli-init/spec.md
🧠 Learnings (19)
📚 Learning: 2025-10-21T03:05:07.856Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T03:05:07.856Z
Learning: Use @/openspec/AGENTS.md to learn the project structure and guidelines

Applied to files:

  • src/core/templates/i18n/ja-JP/agents-template.ts
  • src/core/templates/i18n/ja-JP/agents-root-stub.ts
  • src/core/templates/i18n/zh-CN/agents-root-stub.ts
  • src/core/templates/i18n/zh-CN/agents-template.ts
  • src/core/templates/i18n/ar-SA/agents-root-stub.ts
  • src/core/templates/i18n/fr-FR/agents-root-stub.ts
  • src/core/templates/i18n/fr-FR/agents-template.ts
  • src/core/configurators/agents.ts
  • openspec/specs/cli-init/spec.md
  • src/core/update.ts
📚 Learning: 2025-10-21T03:05:07.856Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T03:05:07.856Z
Learning: Use @/openspec/AGENTS.md to learn spec format and conventions

Applied to files:

  • src/core/templates/i18n/ja-JP/agents-template.ts
  • src/core/templates/i18n/ja-JP/agents-root-stub.ts
  • src/core/templates/i18n/ar-SA/agents-template.ts
  • src/core/templates/i18n/zh-CN/agents-root-stub.ts
  • src/core/templates/i18n/zh-CN/agents-template.ts
  • src/core/templates/i18n/ar-SA/agents-root-stub.ts
  • src/core/templates/i18n/fr-FR/agents-root-stub.ts
  • src/core/templates/i18n/fr-FR/agents-template.ts
  • openspec/specs/cli-init/spec.md
  • src/core/update.ts
📚 Learning: 2025-10-21T03:05:07.856Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T03:05:07.856Z
Learning: Use @/openspec/AGENTS.md to learn how to create and apply change proposals

Applied to files:

  • src/core/templates/i18n/ja-JP/agents-template.ts
  • src/core/templates/i18n/ja-JP/agents-root-stub.ts
  • src/core/templates/i18n/zh-CN/agents-root-stub.ts
  • src/core/templates/i18n/zh-CN/agents-template.ts
  • src/core/templates/i18n/ar-SA/agents-root-stub.ts
  • src/core/templates/i18n/fr-FR/agents-root-stub.ts
  • src/core/templates/i18n/fr-FR/agents-template.ts
  • openspec/specs/cli-init/spec.md
  • src/core/update.ts
📚 Learning: 2025-10-21T03:05:07.856Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T03:05:07.856Z
Learning: Always open @/openspec/AGENTS.md when the request introduces new capabilities, breaking changes, architecture shifts, or major performance/security work

Applied to files:

  • src/core/templates/i18n/ja-JP/agents-template.ts
  • src/core/templates/i18n/ja-JP/agents-root-stub.ts
  • openspec/changes/add-multilingual-support/specs/cli-init/spec.md
  • src/core/templates/i18n/zh-CN/agents-root-stub.ts
  • src/core/templates/i18n/zh-CN/agents-template.ts
  • src/core/templates/i18n/ar-SA/agents-root-stub.ts
  • src/core/templates/i18n/fr-FR/agents-root-stub.ts
  • src/core/templates/i18n/fr-FR/agents-template.ts
  • openspec/specs/cli-init/spec.md
  • src/core/update.ts
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/changes/*/{proposal.md,tasks.md,design.md,specs/**/spec.md} : Scaffold each change with proposal.md, tasks.md, optional design.md, and delta spec files under openspec/changes/<change-id>/specs/<capability>/spec.md

Applied to files:

  • src/core/templates/i18n/ja-JP/agents-template.ts
  • openspec/changes/add-multilingual-support/proposal.md
  • openspec/changes/add-multilingual-support/tasks.md
  • src/core/templates/i18n/ar-SA/agents-template.ts
  • openspec/changes/add-multilingual-support/specs/cli-init/spec.md
  • src/core/templates/i18n/ja-JP/slash-command-templates.ts
  • src/core/templates/i18n/zh-CN/agents-template.ts
  • src/core/templates/i18n/fr-FR/slash-command-templates.ts
  • src/core/templates/i18n/zh-CN/slash-command-templates.ts
  • src/core/templates/i18n/fr-FR/agents-template.ts
  • src/core/templates/i18n/ar-SA/slash-command-templates.ts
  • openspec/specs/cli-init/spec.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/project.md : Document project conventions in openspec/project.md and review it before starting work

Applied to files:

  • src/core/templates/i18n/ja-JP/agents-template.ts
  • src/core/templates/i18n/ar-SA/agents-template.ts
  • src/core/templates/i18n/zh-CN/agents-template.ts
  • src/core/templates/i18n/fr-FR/agents-template.ts
  • openspec/specs/cli-init/spec.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/changes/archive/** : Archive completed changes under openspec/changes/archive/YYYY-MM-DD-<name>/ and run 'openspec validate --strict' post-archive; update specs/ if capabilities changed

Applied to files:

  • src/core/templates/i18n/ja-JP/agents-template.ts
  • src/core/templates/i18n/fr-FR/agents-template.ts
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Validate proposals and specs with 'openspec validate <item> --strict' and fix all issues before sharing

Applied to files:

  • src/core/templates/i18n/ja-JP/agents-template.ts
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/{specs/**/spec.md,changes/*/specs/**/spec.md} : Under ADDED, introduce new capabilities as standalone requirements rather than altering existing ones

Applied to files:

  • openspec/changes/add-multilingual-support/proposal.md
  • openspec/changes/add-multilingual-support/tasks.md
  • openspec/changes/add-multilingual-support/specs/cli-init/spec.md
  • openspec/specs/cli-init/spec.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/changes/*/tasks.md : Track implementation steps in tasks.md and mark each completed item with '- [x]' once finished

Applied to files:

  • openspec/changes/add-multilingual-support/tasks.md
📚 Learning: 2025-10-21T03:05:07.856Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T03:05:07.856Z
Learning: Always open @/openspec/AGENTS.md when the request mentions planning or proposals (e.g., proposal, spec, change, plan)

Applied to files:

  • src/core/templates/i18n/ja-JP/agents-root-stub.ts
  • src/core/templates/i18n/zh-CN/agents-root-stub.ts
  • src/core/templates/i18n/zh-CN/agents-template.ts
  • src/core/templates/i18n/ar-SA/agents-root-stub.ts
  • src/core/templates/i18n/fr-FR/agents-root-stub.ts
  • openspec/specs/cli-init/spec.md
📚 Learning: 2025-10-21T03:05:07.856Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T03:05:07.856Z
Learning: Always open @/openspec/AGENTS.md when the request is ambiguous and the authoritative spec is needed before coding

Applied to files:

  • src/core/templates/i18n/ja-JP/agents-root-stub.ts
  • src/core/templates/i18n/ar-SA/agents-template.ts
  • src/core/templates/i18n/zh-CN/agents-root-stub.ts
  • src/core/templates/i18n/zh-CN/agents-template.ts
  • src/core/templates/i18n/ar-SA/agents-root-stub.ts
  • src/core/templates/i18n/fr-FR/agents-root-stub.ts
  • src/core/templates/i18n/fr-FR/agents-template.ts
  • openspec/specs/cli-init/spec.md
  • src/core/update.ts
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/changes/*/specs/**/spec.md : Use ADDED, MODIFIED, REMOVED, or RENAMED sections when authoring deltas; place changed requirements under the correct operation header

Applied to files:

  • openspec/changes/add-multilingual-support/specs/cli-init/spec.md
  • openspec/specs/cli-init/spec.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/{specs/**/spec.md,changes/*/specs/**/spec.md} : Every requirement must include at least one scenario, formatted exactly with a '#### Scenario: <name>' header (no bullets or bold)

Applied to files:

  • openspec/changes/add-multilingual-support/specs/cli-init/spec.md
  • openspec/specs/cli-init/spec.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/changes/*/specs/**/spec.md : For MODIFIED requirements, paste the full existing requirement block (header through scenarios) and ensure the header text matches exactly (whitespace-insensitive)

Applied to files:

  • openspec/changes/add-multilingual-support/specs/cli-init/spec.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/{specs/**/spec.md,changes/*/specs/**/spec.md} : Write requirements using SHALL/MUST for normative wording

Applied to files:

  • openspec/changes/add-multilingual-support/specs/cli-init/spec.md
  • openspec/specs/cli-init/spec.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/specs/**/spec.md : Keep current, deployed specs in openspec/specs/<capability>/spec.md (one focused capability per directory)

Applied to files:

  • openspec/specs/cli-init/spec.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Prefer modifying existing specs over creating duplicates; if multiple capabilities are affected, create one delta spec.md per capability

Applied to files:

  • openspec/specs/cli-init/spec.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/specs/*/ : Name capabilities with clear, single-purpose verb-noun directories (e.g., user-auth, payment-capture) and split if the description needs 'AND'

Applied to files:

  • openspec/specs/cli-init/spec.md
🧬 Code graph analysis (30)
src/core/configurators/qwen.ts (1)
src/core/templates/index.ts (1)
  • TemplateManager (38-161)
src/core/templates/i18n/ja-JP/agents-template.ts (3)
src/core/templates/i18n/ar-SA/agents-template.ts (1)
  • agentsTemplate (1-457)
src/core/templates/i18n/fr-FR/agents-template.ts (1)
  • agentsTemplate (1-457)
src/core/templates/i18n/zh-CN/agents-template.ts (1)
  • agentsTemplate (1-457)
src/core/configurators/cline.ts (1)
src/core/templates/index.ts (1)
  • TemplateManager (38-161)
src/core/templates/i18n/fr-FR/project-template.ts (4)
src/core/templates/i18n/ar-SA/project-template.ts (1)
  • projectTemplate (3-33)
src/core/templates/i18n/ja-JP/project-template.ts (1)
  • projectTemplate (3-33)
src/core/templates/i18n/zh-CN/project-template.ts (1)
  • projectTemplate (3-33)
src/core/templates/project-template.ts (2)
  • context (8-38)
  • ProjectContext (1-6)
src/core/templates/i18n/ja-JP/agents-root-stub.ts (4)
src/core/templates/i18n/ar-SA/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
src/core/templates/i18n/fr-FR/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
src/core/templates/i18n/zh-CN/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
test/core/update.test.ts (6)
  • rootAgentsPath (1367-1390)
  • codeBuddyPath (788-827)
  • proposalPath (301-338)
  • clinePath (251-287)
  • proposalPath (111-150)
  • costrictPath (944-983)
src/core/configurators/claude.ts (1)
src/core/templates/index.ts (1)
  • TemplateManager (38-161)
src/core/templates/i18n/ar-SA/agents-template.ts (1)
src/core/templates/i18n/fr-FR/agents-template.ts (1)
  • agentsTemplate (1-457)
src/core/config.ts (1)
test/core/update.test.ts (2)
  • configurators (1321-1338)
  • codeBuddyApply (829-864)
src/core/templates/i18n/zh-CN/agents-root-stub.ts (3)
src/core/templates/i18n/ar-SA/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
src/core/templates/i18n/fr-FR/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
src/core/templates/i18n/ja-JP/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
src/core/templates/i18n/ja-JP/slash-command-templates.ts (5)
src/core/templates/i18n/ar-SA/slash-command-templates.ts (2)
  • slashCommandBodies (50-54)
  • getSlashCommandBody (56-58)
src/core/templates/i18n/fr-FR/slash-command-templates.ts (2)
  • slashCommandBodies (50-54)
  • getSlashCommandBody (56-58)
src/core/templates/i18n/zh-CN/slash-command-templates.ts (2)
  • slashCommandBodies (50-54)
  • getSlashCommandBody (56-58)
src/core/templates/index.ts (2)
  • SlashCommandId (164-164)
  • getSlashCommandBody (151-160)
src/core/templates/slash-command-templates.ts (1)
  • getSlashCommandBody (56-58)
src/core/configurators/codebuddy.ts (1)
src/core/templates/index.ts (1)
  • TemplateManager (38-161)
src/core/templates/i18n/zh-CN/agents-template.ts (4)
src/core/templates/i18n/ar-SA/agents-template.ts (1)
  • agentsTemplate (1-457)
src/core/templates/i18n/fr-FR/agents-template.ts (1)
  • agentsTemplate (1-457)
src/core/templates/i18n/ja-JP/agents-template.ts (1)
  • agentsTemplate (1-457)
test/core/update.test.ts (7)
  • rootAgentsPath (1367-1390)
  • codeBuddyPath (788-827)
  • proposalPath (301-338)
  • clinePath (251-287)
  • proposalPath (111-150)
  • costrictPath (944-983)
  • applyPath (152-191)
src/core/templates/i18n/ar-SA/agents-root-stub.ts (3)
src/core/templates/i18n/fr-FR/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
src/core/templates/i18n/ja-JP/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
src/core/templates/i18n/zh-CN/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
src/core/templates/i18n/fr-FR/slash-command-templates.ts (2)
src/core/templates/i18n/ar-SA/slash-command-templates.ts (2)
  • slashCommandBodies (50-54)
  • getSlashCommandBody (56-58)
src/core/templates/index.ts (2)
  • SlashCommandId (164-164)
  • getSlashCommandBody (151-160)
src/core/templates/i18n/fr-FR/agents-root-stub.ts (3)
src/core/templates/i18n/ar-SA/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
src/core/templates/i18n/ja-JP/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
src/core/templates/i18n/zh-CN/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
src/core/configurators/qoder.ts (1)
src/core/templates/index.ts (1)
  • TemplateManager (38-161)
src/core/configurators/costrict.ts (1)
src/core/templates/index.ts (1)
  • TemplateManager (38-161)
src/core/templates/i18n/zh-CN/slash-command-templates.ts (4)
src/core/templates/i18n/ar-SA/slash-command-templates.ts (2)
  • slashCommandBodies (50-54)
  • getSlashCommandBody (56-58)
src/core/templates/i18n/fr-FR/slash-command-templates.ts (2)
  • slashCommandBodies (50-54)
  • getSlashCommandBody (56-58)
src/core/templates/i18n/ja-JP/slash-command-templates.ts (2)
  • slashCommandBodies (50-54)
  • getSlashCommandBody (56-58)
src/core/templates/index.ts (2)
  • SlashCommandId (164-164)
  • getSlashCommandBody (151-160)
src/core/templates/i18n/fr-FR/agents-template.ts (4)
src/core/templates/i18n/ar-SA/agents-template.ts (1)
  • agentsTemplate (1-457)
src/core/templates/i18n/ja-JP/agents-template.ts (1)
  • agentsTemplate (1-457)
src/core/templates/i18n/zh-CN/agents-template.ts (1)
  • agentsTemplate (1-457)
test/core/update.test.ts (3)
  • rootAgentsPath (1367-1390)
  • proposalPath (111-150)
  • proposalPath (301-338)
src/core/configurators/agents.ts (2)
src/core/templates/index.ts (1)
  • TemplateManager (38-161)
test/core/update.test.ts (2)
  • configurators (1321-1338)
  • codeBuddyPath (788-827)
src/core/templates/i18n/ar-SA/slash-command-templates.ts (3)
src/core/templates/i18n/fr-FR/slash-command-templates.ts (2)
  • slashCommandBodies (50-54)
  • getSlashCommandBody (56-58)
src/core/templates/index.ts (2)
  • SlashCommandId (164-164)
  • getSlashCommandBody (151-160)
src/core/templates/slash-command-templates.ts (1)
  • getSlashCommandBody (56-58)
src/core/i18n/index.ts (1)
src/core/config.ts (2)
  • DEFAULT_LANGUAGE (27-27)
  • SUPPORTED_LANGUAGES (19-25)
test/core/init.test.ts (2)
src/core/init.ts (1)
  • InitCommand (381-1076)
src/utils/file-system.ts (1)
  • fileExists (76-86)
src/core/templates/i18n/ja-JP/project-template.ts (4)
src/core/templates/i18n/ar-SA/project-template.ts (1)
  • projectTemplate (3-33)
src/core/templates/i18n/fr-FR/project-template.ts (1)
  • projectTemplate (3-33)
src/core/templates/i18n/zh-CN/project-template.ts (1)
  • projectTemplate (3-33)
src/core/templates/project-template.ts (2)
  • context (8-38)
  • ProjectContext (1-6)
src/core/templates/i18n/ar-SA/project-template.ts (5)
src/core/templates/i18n/fr-FR/project-template.ts (1)
  • projectTemplate (3-33)
src/core/templates/i18n/ja-JP/project-template.ts (1)
  • projectTemplate (3-33)
src/core/templates/i18n/zh-CN/project-template.ts (1)
  • projectTemplate (3-33)
src/core/templates/index.ts (1)
  • ProjectContext (163-163)
src/core/templates/project-template.ts (2)
  • context (8-38)
  • ProjectContext (1-6)
src/core/templates/index.ts (9)
src/core/templates/project-template.ts (1)
  • ProjectContext (1-6)
src/core/templates/i18n/ar-SA/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
src/core/templates/i18n/fr-FR/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
src/core/templates/i18n/ja-JP/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
src/core/templates/i18n/zh-CN/agents-root-stub.ts (1)
  • agentsRootStubTemplate (1-16)
src/core/templates/costrict-template.ts (1)
  • agentsRootStubTemplate (1-1)
src/core/templates/cline-template.ts (1)
  • agentsRootStubTemplate (1-1)
src/core/templates/claude-template.ts (1)
  • agentsRootStubTemplate (1-1)
src/core/templates/slash-command-templates.ts (1)
  • SlashCommandId (1-1)
src/core/configurators/slash/base.ts (4)
src/core/templates/index.ts (2)
  • SlashCommandId (164-164)
  • TemplateManager (38-161)
src/core/templates/slash-command-templates.ts (1)
  • SlashCommandId (1-1)
src/core/configurators/slash/opencode.ts (2)
  • OpenCodeSlashCommandConfigurator (41-86)
  • updateExisting (59-66)
src/core/configurators/slash/factory.ts (1)
  • FactorySlashCommandConfigurator (25-41)
src/core/templates/i18n/zh-CN/project-template.ts (4)
src/core/templates/i18n/ar-SA/project-template.ts (1)
  • projectTemplate (3-33)
src/core/templates/i18n/fr-FR/project-template.ts (1)
  • projectTemplate (3-33)
src/core/templates/i18n/ja-JP/project-template.ts (1)
  • projectTemplate (3-33)
src/core/templates/project-template.ts (2)
  • context (8-38)
  • ProjectContext (1-6)
src/core/update.ts (3)
src/core/config.ts (2)
  • CONFIG_FILE_NAME (29-29)
  • DEFAULT_LANGUAGE (27-27)
src/utils/file-system.ts (1)
  • FileSystemUtils (44-205)
src/core/templates/index.ts (1)
  • TemplateManager (38-161)
src/core/init.ts (3)
src/core/config.ts (4)
  • DEFAULT_LANGUAGE (27-27)
  • OpenSpecConfig (8-11)
  • SUPPORTED_LANGUAGES (19-25)
  • CONFIG_FILE_NAME (29-29)
src/utils/file-system.ts (1)
  • FileSystemUtils (44-205)
src/core/templates/index.ts (1)
  • TemplateManager (38-161)
🪛 markdownlint-cli2 (0.18.1)
openspec/changes/add-multilingual-support/specs/cli-init/spec.md

99-99: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (28)
src/core/templates/i18n/zh-CN/agents-root-stub.ts (1)

1-17: LGTM! Chinese template is well-structured.

The template follows the established pattern for multilingual support, with clear instructions for AI assistants. The structure is consistent with other language templates (fr-FR, ja-JP, ar-SA).

src/core/templates/i18n/fr-FR/agents-root-stub.ts (1)

1-17: LGTM! French template is well-structured.

The template follows the established pattern for multilingual support, with clear instructions for AI assistants. The structure is consistent with other language templates.

src/core/configurators/codebuddy.ts (1)

12-14: LGTM! Language parameter correctly integrated.

The addition of the optional language parameter with a sensible default and proper pass-through to TemplateManager.getClaudeTemplate(language) enables multilingual support while maintaining backward compatibility.

src/core/configurators/costrict.ts (1)

12-14: LGTM! Language parameter correctly integrated.

The addition of the optional language parameter with a sensible default and proper pass-through to TemplateManager.getCostrictTemplate(language) enables multilingual support while maintaining backward compatibility.

src/core/templates/i18n/ja-JP/agents-root-stub.ts (1)

1-17: LGTM! Japanese template is well-structured.

The template follows the established pattern for multilingual support, with clear instructions for AI assistants. The structure is consistent with other language templates.

src/cli/index.ts (1)

44-68: LGTM! Language option correctly integrated into CLI.

The --language option is properly defined with a clear description that lists supported languages. The option is correctly threaded through to the InitCommand constructor, enabling users to specify their preferred language for generated content.

src/core/configurators/cline.ts (1)

12-14: LGTM! Language parameter correctly integrated.

The addition of the optional language parameter with a sensible default and proper pass-through to TemplateManager.getClineTemplate(language) enables multilingual support while maintaining backward compatibility.

src/core/configurators/claude.ts (1)

12-15: Localized stub selection wired through

Passing the language into TemplateManager.getClaudeTemplate ensures the CLAUDE.md stub matches the project locale—nice and tidy.

src/core/configurators/qwen.ts (1)

36-39: Language-aware agents template

Good call forwarding the chosen locale so the Qwen config renders the right root stub without extra plumbing.

src/core/configurators/base.ts (1)

5-5: Interface broadened sensibly

Making language optional at the interface level keeps legacy callers working while enabling localized configurators.

openspec/changes/add-multilingual-support/tasks.md (1)

1-29: Checklist tracks delivery

All shipped milestones are marked complete and the optional doc follow-up stays open—plan-to-actual is clear.

openspec/changes/add-multilingual-support/proposal.md (1)

1-28: Proposal captures scope

The write-up cleanly enumerates why/what, including affected specs and modules, keeping the change set well-scoped.

src/core/configurators/agents.ts (1)

12-15: Agents standard respects locale

Propagating the language into the standard AGENTS configurator keeps root instructions consistent with init choices.

src/core/update.ts (1)

3-90: Update flow honors stored language

Reading the persisted locale, regenerating AGENTS.md via TemplateManager, and passing language into each configurator ties the update path into the multilingual story nicely.

src/utils/file-system.ts (1)

188-204: JSON helpers integrate cleanly

Appreciate the consistent null-on-missing semantics and reuse of existing file utilities—this slots right into the config flow without surprises.

src/core/templates/i18n/ar-SA/agents-root-stub.ts (1)

1-16: Arabic stub mirrors the canonical guidance

The translation keeps the structure and managed-block reminder intact, so the update flow will stay stable across locales.

src/core/templates/i18n/ja-JP/slash-command-templates.ts (1)

1-58: JP slash command bodies stay aligned with base semantics

Great to see the guardrails/steps/references pattern preserved verbatim—this keeps downstream tooling behavior consistent in Japanese.

src/core/templates/i18n/ja-JP/project-template.ts (1)

1-33: Project template localization looks solid

The placeholders and interpolation logic match the baseline template, so we get parity while delivering native language context.

src/core/templates/i18n/ja-JP/agents-template.ts (1)

1-457: Comprehensive JP agents guide

This keeps all procedural details, CLI snippets, and formatting instructions synchronized with the source material while reading naturally in Japanese—nicely done.

src/core/templates/i18n/fr-FR/slash-command-templates.ts (1)

1-59: LGTM! French slash command templates are well-structured.

The file follows the established pattern for localized slash command templates, with proper structure matching other language implementations (ar-SA, ja-JP, zh-CN). The exports align with the TemplateManager's language-aware routing.

src/core/templates/i18n/ar-SA/project-template.ts (1)

1-34: LGTM! Arabic project template follows the established pattern.

The template properly mirrors the structure of other language-specific project templates (fr-FR, ja-JP, zh-CN), with correct interpolation of ProjectContext fields and localized fallback text. The Arabic (RTL) content is well-formatted.

src/core/templates/i18n/zh-CN/agents-template.ts (1)

1-458: LGTM! Comprehensive Chinese AGENTS.md template.

The template provides a complete Chinese translation of the OpenSpec instructions while properly preserving:

  • CLI command syntax (e.g., openspec list, openspec validate)
  • File paths and technical identifiers
  • Markdown formatting and code block structure

The structure aligns with other language-specific agents templates (ar-SA, fr-FR, ja-JP), ensuring consistency across the multilingual template system.

src/core/templates/i18n/ar-SA/slash-command-templates.ts (1)

1-59: LGTM! Arabic slash command templates are correctly structured.

The file follows the established pattern for localized slash command templates with proper RTL Arabic text. The structure matches fr-FR, ja-JP, and zh-CN implementations, ensuring consistent integration with TemplateManager's language-aware routing.

test/core/init.test.ts (1)

1251-1351: Excellent test coverage for multilingual support!

The test suite comprehensively validates:

  • Config file creation and language persistence (zh-CN test)
  • Template content generation in all supported languages (zh-CN, fr-FR, ja-JP, ar-SA)
  • Default language fallback to en-US
  • Language preservation in extend mode

The tests properly verify both the configuration layer and the actual template rendering, ensuring end-to-end functionality of the multilingual feature.

src/core/config.ts (1)

8-30: Clean and well-structured language configuration additions.

The changes properly extend the configuration layer with:

  • Optional language field on OpenSpecConfig for flexibility
  • Well-defined LanguageOption interface with code, name, and native name
  • SUPPORTED_LANGUAGES constant providing a clear source of truth
  • DEFAULT_LANGUAGE and CONFIG_FILE_NAME constants for consistency

The public API additions integrate seamlessly with the existing configuration structure and provide a solid foundation for the multilingual feature.

src/core/templates/i18n/zh-CN/slash-command-templates.ts (1)

1-59: LGTM! Chinese slash command templates are correctly implemented.

The file follows the established pattern for localized slash command templates, with structure matching fr-FR, ja-JP, and ar-SA implementations. The exports properly integrate with TemplateManager's language-aware template routing (TemplateManager.getSlashCommandBody).

src/core/configurators/slash/base.ts (2)

25-50: Language parameter properly threaded through generateAll.

The method correctly:

  • Accepts an optional language parameter with 'en-US' default for backward compatibility
  • Passes the language to getBody(target.id, language) for each slash command target
  • Maintains the existing file creation/update logic

51-64: Language parameter properly threaded through updateExisting.

The method correctly:

  • Accepts an optional language parameter with 'en-US' default
  • Passes the language to getBody(target.id, language) when updating existing files

eust-w pushed a commit to eust-w/OpenSpec-Chinese that referenced this pull request Nov 13, 2025
   - Fix code block language tag in spec (markdownlint MD040)
   - Fix extend mode language selection to prompt user with stored language as default
   - Add tests for extend mode language change scenarios

   Addresses CodeRabbit feedback on PR Fission-AI#300
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3b2df3 and dc1655f.

📒 Files selected for processing (2)
  • src/core/init.ts (11 hunks)
  • test/core/init.test.ts (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
test/core/init.test.ts (2)
src/core/init.ts (1)
  • InitCommand (381-1086)
src/utils/file-system.ts (1)
  • fileExists (76-86)
src/core/init.ts (5)
src/core/config.ts (4)
  • DEFAULT_LANGUAGE (27-27)
  • OpenSpecConfig (8-11)
  • SUPPORTED_LANGUAGES (19-25)
  • CONFIG_FILE_NAME (29-29)
src/utils/file-system.ts (1)
  • FileSystemUtils (44-205)
src/core/templates/index.ts (1)
  • TemplateManager (38-161)
src/core/configurators/registry.ts (1)
  • ToolRegistry (10-46)
src/core/configurators/slash/registry.ts (1)
  • SlashCommandRegistry (19-69)

       - Fix code block language tag in spec (markdownlint MD040)
       - Fix extend mode language selection to prompt user with stored language as default
       - Add tests for extend mode language change scenarios

       Addresses CodeRabbit feedback on PR Fission-AI#300
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dc1655f and 1dc9430.

📒 Files selected for processing (2)
  • src/core/init.ts (11 hunks)
  • test/core/init.test.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/core/init.test.ts
🧰 Additional context used
🧬 Code graph analysis (1)
src/core/init.ts (3)
src/core/config.ts (4)
  • DEFAULT_LANGUAGE (27-27)
  • OpenSpecConfig (8-11)
  • SUPPORTED_LANGUAGES (19-25)
  • CONFIG_FILE_NAME (29-29)
src/utils/file-system.ts (1)
  • FileSystemUtils (44-205)
src/core/templates/index.ts (1)
  • TemplateManager (38-161)
🔇 Additional comments (3)
src/core/init.ts (3)

509-530: Extend mode language prompt implemented correctly.

This implementation successfully addresses the past review concern by allowing users to change their language preference in extend mode. The flow properly:

  • Checks for non-interactive --language flag first
  • Reads existing language from config as the default
  • Prompts interactively with that default, allowing users to change it

532-572: Language validation and prompting logic is robust.

Both methods are well-implemented:

  • resolveLanguageArg provides clear validation with helpful error messages listing available languages
  • promptForLanguage accepts a default parameter as suggested in past reviews, enabling pre-selection of existing language in extend mode
  • Native language names in the prompt improve UX

574-589: Config file I/O properly typed with Partial.

The type signatures correctly use Partial<OpenSpecConfig> for persisted configs, addressing the previous review concern about type mismatches. The merge logic in saveConfigFile properly preserves existing fields when updating language.

@eust-w
Copy link
Author

eust-w commented Nov 14, 2025

@TabishB PTAL😊

@chenmaolin88
Copy link

please merge this pr,really need multilingual support....

chenmaolin88 added a commit to chenmaolin88/OpenSpec that referenced this pull request Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add Comprehensive Multilingual Support for OpenSpec Artifacts (i18n)

2 participants