Skip to content

fix(tickets): transliterate Cyrillic and Greek in leaf file names - #3173

Open
Arrisio wants to merge 1 commit into
bmad-code-org:devfrom
Arrisio:fix/ticket-slug-transliteration
Open

Arrisio wants to merge 1 commit into
bmad-code-org:devfrom
Arrisio:fix/ticket-slug-transliteration

Conversation

@Arrisio

@Arrisio Arrisio commented Nov 5, 2026

Copy link
Copy Markdown

What

title_slug in bmad-agent-po/scripts/tickets.py now transliterates Cyrillic and Greek letters and a few Latin ones that NFKD leaves whole (ß, ø, ł, æ, …), instead of dropping them.

Why

Follow-up to #2976 / #2986, which made accented Latin letters work. A title with no Latin letters gave the slug untitled, so pull named every story story-untitled-<id>.md (and the plans -plan.md the same way) in a project written in Russian, Ukrainian or Greek. A title with a few Latin words kept only those words: "Скан камерой Android" became story-android.

How

  • A small table of letter=latin pairs, applied before the existing NFKD step; accents still come off through NFKD, and Greek letters it exposes go back through the table.
  • A script with no table (CJK, Arabic, …) is still dropped, so a title made only of it is still untitled.
  • Latin-only titles slug as before ("Café menu" → cafe-menu).

Testing

New test pulls five titles (Russian, Greek, Polish/German, Ukrainian, Japanese) and checks the file names. The pre-commit hooks and pytest steps of tools/quality.py pass; the docs-site lint step was not run (no npm here), and no docs changed.

🤖 Generated with Claude Code

A title without Latin letters gave the slug 'untitled', so every
story in a Russian-language project got 'story-untitled'.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 5, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The ticket title slugger now transliterates selected Cyrillic, Greek, and Latin characters before generating ASCII filenames. Tests cover five non-ASCII titles, including a Japanese title that produces story-untitled.md.

Changes: Ticket filename generation

Layer / File(s) Summary
Transliteration and slug validation
skills/bmad-agent-po/scripts/tickets.py, skills/bmad-agent-po/scripts/tests/test_tickets.py
title_slug applies explicit character mappings, then NFKD decomposition, ASCII filtering, and hyphen normalization. It retains the 60-character limit and untitled fallback. The new test checks filenames for five non-ASCII titles.

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

Change: Bug fix

Suggested reviewers: bmadcode

Merge Risk: Minimal · up to d51fb

No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title identifies the main change: transliteration of Cyrillic and Greek in filenames.
Description check Passed The description covers the transliteration change and its tests.
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 a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7687d07 and d51fb69.

Files selected for processing: 2

  • skills/bmad-agent-po/scripts/tests/test_tickets.py
  • skills/bmad-agent-po/scripts/tickets.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@greptile-apps

greptile-apps Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change reaches the ticket-pull naming workflow and its default plan paths.

The PR appears safe to merge, with two non-blocking file-name conversion issues.

Findings

  1. P2 Latin letters disappear ▶
  2. P2 Identical titles get different names ▶
Fix with agent prompt
### Issue 1
skills/bmad-agent-po/scripts/tickets.py:1124-1125
Moving `.lower()` before NFKD drops uppercase letters that NFKD exposes. For example, `𝐀PI` previously produced `api` but now produces `pi`; `№ 1` changes from `no-1` to `o-1`. These valid titles lose letters in their file names. Lowercase the normalized result before applying the final pattern, and add a test for compatibility characters.

### Issue 2
skills/bmad-agent-po/scripts/tickets.py:1119-1123
The new mappings miss Cyrillic letters stored as a base letter plus a combining mark. For example, composed `Ёлка` produces `yolka`, but the same visible title written as `Е\u0308лка` produces `elka`. The same problem affects `й` and `ї`. Normalize the whole title to NFC before looking up individual letters, and test both forms.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds Cyrillic, Greek, and selected Latin mappings to title_slug.

  • Pulled ticket filenames now retain Latin spellings for more title scripts.

Reviews (1) · Last reviewed commit: "fix(tickets): transliterate Cyrillic and..." · Reviewed by Greptile

Comment on lines +1124 to +1125
ascii_title = "".join(letters).encode("ascii", "ignore").decode("ascii")
return re.sub(r"[^a-z0-9]+", "-", ascii_title).strip("-")[:60].rstrip("-") or "untitled"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Latin letters disappear

Moving .lower() before NFKD drops uppercase letters that NFKD exposes. For example, 𝐀PI previously produced api but now produces pi; № 1 changes from no-1 to o-1. These valid titles lose letters in their file names. Lowercase the normalized result before applying the final pattern, and add a test for compatibility characters.

Prompt To Fix With AI
This is a comment left during a code review.
Path: skills/bmad-agent-po/scripts/tickets.py
Line: 1124-1125

Comment:
**Latin letters disappear**

Moving `.lower()` before NFKD drops uppercase letters that NFKD exposes. For example, `𝐀PI` previously produced `api` but now produces `pi`; `№ 1` changes from `no-1` to `o-1`. These valid titles lose letters in their file names. Lowercase the normalized result before applying the final pattern, and add a test for compatibility characters.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +1119 to +1123
for c in title.lower():
if c in _TRANSLIT:
letters.append(_TRANSLIT[c])
else: # accents come off through NFKD; a base letter it exposes may still need the table (Greek tonos)
letters.extend(_TRANSLIT.get(d, d) for d in unicodedata.normalize("NFKD", c))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Identical titles get different names

The new mappings miss Cyrillic letters stored as a base letter plus a combining mark. For example, composed Ёлка produces yolka, but the same visible title written as Е\u0308лка produces elka. The same problem affects й and ї. Normalize the whole title to NFC before looking up individual letters, and test both forms.

Prompt To Fix With AI
This is a comment left during a code review.
Path: skills/bmad-agent-po/scripts/tickets.py
Line: 1119-1123

Comment:
**Identical titles get different names**

The new mappings miss Cyrillic letters stored as a base letter plus a combining mark. For example, composed `Ёлка` produces `yolka`, but the same visible title written as `Е\u0308лка` produces `elka`. The same problem affects `й` and `ї`. Normalize the whole title to NFC before looking up individual letters, and test both forms.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

This branch has not been deployed

No deployments
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