Skip to content

feat: spec-dc writes the spec in the request's language - #14

Merged
danielhenriquemarinho merged 3 commits into
mainfrom
feat/spec-output-language
Jul 20, 2026
Merged

feat: spec-dc writes the spec in the request's language#14
danielhenriquemarinho merged 3 commits into
mainfrom
feat/spec-output-language

Conversation

@danielhenriquemarinho

@danielhenriquemarinho danielhenriquemarinho commented Jul 17, 2026

Copy link
Copy Markdown
Member

What

/spec-dc now writes the spec artifact in the same language the user used to describe the feature — a Portuguese request produces a Portuguese spec, an English request an English spec. Ambiguous → repo's primary language, then English.

Only the spec is localized (as discussed). /plan-dc and /execute-dc stay English — the spec is the artifact that matters for human review.

Why this approach

The spec command is a static markdown prompt with no notion of locale, and there are two copies (the repo's own .claude/commands/ and the distributed templates/). Hardcoding Portuguese would ship Portuguese to every install of the toolkit. "Follow the request's language" is instead zero-config, globally correct (no language forced on any template user), and naturally gives the team Portuguese specs.

Changes

  • spec-dc.md → new "Output language" subsection: write the spec in the request's language; prose only — the seven section headings and the filename slug stay ASCII structural anchors /plan-dc relies on to locate content.
  • Reviewer prompt: notes the spec may not be in English, so the dual-reviewer loop never flags language as a defect.
  • templates/AGENTS.md → Workflows note: carries the same rule to the harnesses that have no per-repo command file and run workflows from the ## Workflows section (Gemini, Cursor, Codex), for cross-harness parity.
  • Applied to both the repo command and the distributed template copy (kept byte-identical).
  • ADR-020 History updated (v1.2).

How it reaches users

  • Templates are fetched from main at runtime, so this is live on merge.
  • Claude: spec-dc.md is already in the update.sh managed set → existing projects get it via dotcontext update (diff + prompt); new installs via dotcontext init. No src/ change needed; the dotcontext binary stays in sync (CI sync gate passes).
  • opencode/Copilot: command files are emitted create-only, so existing installs of those harnesses won't auto-receive the change on update (re-init or manual edit); new installs get it.
  • Gemini/Cursor/Codex: covered by the AGENTS.md note above (seed/create-only → new installs via init; existing user-owned AGENTS.md untouched, per ADR-020).
  • A release (patch bump + CHANGELOG) will be cut after merge to close the version-hygiene loop, even though the managed/seed lists didn't change.

Out of scope

Localizing plan/execute; config/locale machinery. A separate analysis of mattpocock/skills surfaced a skill-authoring quality rubric worth considering later — intentionally not in this PR.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Updated specification-generation workflow guidance so the spec’s prose is written in the same language as the original feature request, with fallback to the repository’s primary language, then English if unclear.
    • Clarified that structural section headings and the spec filename slug remain fixed ASCII anchors for consistent planning/execution.
    • Updated reviewer instructions to treat non-English output as acceptable, while verifying the spec language matches the request (or the documented fallback) and flagging mismatches.

The /spec-dc output was always English. Make the spec artifact follow the
language the user used to describe the feature (Portuguese request → Portuguese
spec), so the human-reviewed artifact reads in the team's language — with zero
config, correct for every install (no language is forced on template users).

- Prose only: the seven section headings and the filename slug stay ASCII
  structural anchors that /plan-dc relies on to locate content.
- Reviewer prompt notes the spec may not be in English, so language is never
  flagged as a defect.
- /plan-dc and /execute-dc are unchanged (English) — the spec is what matters
  for human review.
- Applied to both the repo's own command and the distributed template copy.
- ADR-020 History updated (v1.2).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f09031e6-11de-4f81-a1aa-3a97be9f01e8

📥 Commits

Reviewing files that changed from the base of the PR and between bf5db56 and b8b8b15.

📒 Files selected for processing (3)
  • .claude/commands/spec-dc.md
  • templates/.claude/commands/spec-dc.md
  • templates/AGENTS.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • templates/AGENTS.md
  • .claude/commands/spec-dc.md
  • templates/.claude/commands/spec-dc.md

Walkthrough

The /spec-dc workflow now writes specification prose in the original request language with defined fallbacks, while retaining fixed ASCII structural anchors and language-independent reviewer evaluation.

Changes

Specification localization

Layer / File(s) Summary
Specification language and structural anchors
.claude/commands/spec-dc.md, templates/.claude/commands/spec-dc.md, .context/decisions/020-spec-plan-execute-workflow.md, templates/AGENTS.md
/spec-dc writes prose in the request language with defined fallbacks while preserving fixed headings and ASCII kebab-case filename slugs for downstream steps.
Language-independent reviewer evaluation
.claude/commands/spec-dc.md, templates/.claude/commands/spec-dc.md
Phase 3 reviewers evaluate specification content regardless of its language and flag mismatches with the request or fallback language.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: spec-dc now writes the spec in the request's language.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/spec-output-language

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/commands/spec-dc.md:
- Around line 189-190: Update the reviewer guidance at
.claude/commands/spec-dc.md lines 189-190 to allow specs in the original
request’s language while still requiring verification against the requested or
documented fallback language; apply the identical synchronized correction at
templates/.claude/commands/spec-dc.md lines 189-190.
- Around line 78-88: Define a deterministic language-selection rule in the
“Output language” guidance, explicitly specifying how to resolve multilingual
feature descriptions, clarifying Q&A, and conflicting repository-language
sources before applying the fallback for ambiguous input. Apply the identical
rule at .claude/commands/spec-dc.md:78-88 and
templates/.claude/commands/spec-dc.md:78-88, while preserving the fixed headings
and ASCII slug requirements.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 423353ce-7b3a-4cd8-9758-1ce8994983f0

📥 Commits

Reviewing files that changed from the base of the PR and between f797af9 and 215089b.

📒 Files selected for processing (3)
  • .claude/commands/spec-dc.md
  • .context/decisions/020-spec-plan-execute-workflow.md
  • templates/.claude/commands/spec-dc.md

Comment thread .claude/commands/spec-dc.md
Comment thread .claude/commands/spec-dc.md Outdated
The output-language rule lived only in the spec-dc command body, so it reached
Claude/opencode/Copilot but not the harnesses that run workflows from the
AGENTS.md `## Workflows` section (Gemini, Cursor, Codex). Add a note there so
those harnesses also write the spec in the request's language.

Seed file (create-only), so this reaches new installs via `init`; existing
projects keep their user-owned AGENTS.md untouched, per ADR-020.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@templates/AGENTS.md`:
- Around line 117-121: Update the language guidance in the spec-dc instructions
to explicitly require the seven section headings to remain exactly as written in
the template, while keeping the filename slug as an ASCII structural anchor;
preserve the existing language behavior for spec prose and the English-only
requirements for plan-dc and execute-dc.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 72a390da-98d2-4618-8abd-bcf827f10ddb

📥 Commits

Reviewing files that changed from the base of the PR and between 215089b and bf5db56.

📒 Files selected for processing (1)
  • templates/AGENTS.md

Comment thread templates/AGENTS.md Outdated
- spec-dc: make output-language selection deterministic (explicit precedence:
  $ARGUMENTS description → clarifying Q&A → repo primary language → English)
- spec-dc: reviewer now verifies the spec's language matches the request (or the
  documented fallback) instead of ignoring language entirely — a non-English
  spec is not a defect, but the wrong language is
- AGENTS.md: require the seven section headings "exactly as written in the
  template" (only the slug is ASCII), matching the spec-dc contract plan-dc relies on

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@danielhenriquemarinho
danielhenriquemarinho merged commit e419059 into main Jul 20, 2026
2 checks passed
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.

1 participant