spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

Add support for Brazilian Portuguese (pt-br) and multi-language specification generation

Open saitodisse opened this issue 1 year ago • 9 comments

Context and Motivation

The Spec Kit is an excellent tool for generating project specifications. To further enhance its utility for global teams and the open-source community, we should consider adding comprehensive support for multiple languages.

The current limitation to primarily English can be a barrier for international teams. The ability to generate and maintain consistent specifications across different languages would be a significant improvement, fostering better communication and collaboration in a multilingual environment.

Proposal

I propose an enhancement to allow the Spec Kit to generate and manage specifications in multiple languages. This could be implemented through a language parameter, such as /specify --lang [ISO-code], which would enable the tool to:

Generate specifications, plans, and tasks in a variety of languages (e.g., German, Spanish, French, Japanese, Brazilian Portuguese, etc.).

Maintain consistency and coherence between versions. For instance, a specification generated in English should have an accurate and structurally consistent counterpart in another language.

Support a clear and scalable localization process, allowing the community to contribute translations for new languages easily.

This enhancement would position the Spec Kit as a truly global tool, making it more accessible and practical for a broader range of projects and teams.

saitodisse avatar Sep 09 '25 15:09 saitodisse

Please excuse my ignorance. I have never interacted with LLMs or agents in a language apart from English. Have you noticed a performance difference between interacting with an LLM in English vs another language? I assume there are no issues if variables/classes, etc., are written in another language, but I am curious how well it works with comments/prompts.

peterHoburg avatar Sep 09 '25 18:09 peterHoburg

Hey, thanks for the question @peterHoburg! It's an important one.

My experience has been that there is a slight performance difference. While LLMs are trained on a massive multilingual dataset and can communicate in many languages, the core thought processes often rely on English. This means when I'm interacting in Portuguese, for example, there's an internal translation step that can cause a slight drop in speed and nuance compared to a direct English-to-English conversation.

That said, for the end user, this small performance hit is worth it. Being able to read and interact in your native language makes a huge difference in clarity and understanding. It's much easier to grasp complex topics when you don't have to mentally translate.

That's why I think it would be so great to see models that are truly "multi-native"—that can work entirely in another language without that internal translation. It would make the experience much smoother and more powerful for everyone.

saitodisse avatar Sep 09 '25 20:09 saitodisse

Not sure if I understood the problem, but if you provide the description in portuguese and asks it to follow-up in portuguese, does that work? I use Claude Code and one thing I'm doing here after the spec file is created is to tell it to come up with an interactive questionary for each [NEEDS CLARIFICATION] point and by asking to do it in portuguese, it works easily. Example:

Prompt

> read the services/maverick/specs/001-implement-the-domain/spec.md and come with interactive question to me about each of the [NEEDS CLARIFICATION] items. Lets talk in portuguese.

Response

⏺ I'll read the spec file and identify all the [NEEDS CLARIFICATION] items to discuss with you in Portuguese.

⏺ Read(services/maverick/specs/001-implement-the-domain/spec.md)
  ⎿  Read 149 lines (ctrl+r to expand)
  ⎿  services/maverick/CLAUDE.md

⏺ Ótimo! Vou criar uma lista de tarefas para organizar nossa discussão sobre os pontos que precisam de esclarecimento na especificação.

⏺ Perfeito! Identifiquei todos os pontos marcados com [NEEDS CLARIFICATION] na especificação. Vamos conversar sobre cada um deles de forma
  interativa. Vou começar com o primeiro item:

⏺ 🎯 Vamos esclarecer os pontos da especificação!

  1️⃣ Requisitos de Performance (linha 84)

  A especificação menciona que o sistema deve fornecer respostas dentro de um tempo não especificado.

  Pergunta para você:
  - Qual seria o tempo de resposta aceitável para o chat?
  - Você pensou em algo como:
    - Ultra-rápido: < 1 segundo (estilo ChatGPT)
    - Rápido: 1-3 segundos
    - Moderado: 3-5 segundos
    - Tolerável: 5-10 segundos
  - Esse tempo seria apenas para gerar a resposta ou inclui todo o processamento (buscar dados, contexto, etc.)?
  - Existe alguma diferença de expectativa dependendo do tipo de pergunta? Por exemplo:
    - Perguntas simples (saudação, FAQ) = resposta mais rápida
    - Análises complexas (insights de dados) = pode demorar mais

  Me conta o que você tem em mente para esse requisito de performance! 🚀

I know this is not a one-size-fits-all solution, but I guess this could address what you are looking for? Maybe the localization feature is just putting somehow this language preference as a instruction to the prompt?

tiagostutz avatar Sep 10 '25 16:09 tiagostutz

The problem is that the generated files are multilingual: the parts from the template are in English and the generated parts are in the native language (for example Portuguese). That looks silly and makes it hard to read/modify. Ability to have translated templates (with the fallback to English of course) would be a great addition.

anadale avatar Sep 10 '25 19:09 anadale

I see, that makes perfect sense. Thank you for the clarification! ✅

This makes me think that a "post-processor" (or "plugin") system could be a really flexible solution. We could register processors for spec, plan, and task to handle things like this.

For instance, translation could be a simple .md file in a post-processors/spec folder. We could even chain them with shell scripts to do other things, like scan for policy violations or generate diagrams. ✨

The execution could follow the filename order: 1-translate.md 2-policy-scan.sh 3-generate-diagram.sh

Just an idea, but it feels like a neat and yet easy way to let users extend the tool.

Let me know what you guys think 🤔

tiagostutz avatar Sep 10 '25 19:09 tiagostutz

I think the post-processor idea is very interesting. Would your idea be something that's done in real-time by the LLM? It's a very clever approach.

Another way to handle this would be to have entire specifications and instructions in separate language folders. I think the big challenge with that approach would be keeping all the different language versions updated based on the English one.

saitodisse avatar Sep 10 '25 21:09 saitodisse

Yes, exactly. Just after the step is concluded - like the planning - the post-processors will be executed in the same session/command line, being one of them simply "translate all the md files under specs/002-quality-score-refactor/*.md to pt-br under the folder pt-br. Recreate the files if they already exist to keep it in sync with the last version of the original md files"

Just did it manually here to simulate and worked well... the post-processors would be a simple and extensible way to achieve that and it would address this challenge of keeping different language versions updated because it keeps the md files in the root - as originally created by spec-kit - and you would have one post-processor per language you want to translate to. Like:

post-processors/
├── 1-translate_pt-br.md
├── 2-translate_es.md
└── 3-translate_de.md

So, that could be something interesting. Worth mentioning that you can achieve that already by creating a custom command with this instruction that you run manually after the spec-kit finishes its job...

tiagostutz avatar Sep 11 '25 17:09 tiagostutz

This issue has been automatically marked as stale because it has not had any activity for 150 days. It will be closed in 30 days if no further activity occurs.

github-actions[bot] avatar Feb 12 '26 00:02 github-actions[bot]

This issue has been automatically closed due to inactivity (180 days total). If you believe this issue is still relevant, please reopen it or create a new issue.

github-actions[bot] avatar Apr 03 '26 14:04 github-actions[bot]