Skip to content

feat: builtin skills seed engine + Vietnamese (vi-VN) locale - #635

Open
ngav1491 wants to merge 2 commits into
DEEIX-AI:devfrom
ngav1491:feat/vi-vn-i18n-and-builtin-skills
Open

feat: builtin skills seed engine + Vietnamese (vi-VN) locale#635
ngav1491 wants to merge 2 commits into
DEEIX-AI:devfrom
ngav1491:feat/vi-vn-i18n-and-builtin-skills

Conversation

@ngav1491

Copy link
Copy Markdown

Summary

Two features shipped together after a full codebase review (2026-08-23):

1. feat(skills): seed 10 builtin skills with idempotent sync engine

The Skills system previously shipped empty — no built-in skills, admin-only creation via API. This PR adds:

  • Seed engine (backend/internal/application/skill/seed.go):
    • Embeds seeddata/*.md with YAML frontmatter (name/title/description/sort)
    • Validates limits: title ≤ 64 chars, description ≤ 256, body ≤ 10,000 runes
    • Idempotent on restart: missing → create; untouched record (created_by == 0 && updated_by == 0) → re-sync content on upgrade; admin-modified → never overwritten
  • Wired in backend/internal/app/app.go right after skill service init
  • 10 bundled skills: diagram-svg, mermaid-diagram, html-artifact, svg-icon, chart-svg, report-writing, polish-writing, translate, code-review, slide-outline — authored for DEEIX's render stack (SVG block preview, native mermaid, sandboxed HTML artifacts)
  • Users see them immediately via @mention thanks to the existing scope=builtin filter
  • Tests: go test ./internal/application/skill/... PASS

2. feat(i18n): add Vietnamese (vi-VN) locale

Complete third locale alongside en-US / zh-CN:

  • 27/27 message files translated to frontend/i18n/messages/vi-VN/ (~4,600 strings; largest: chat.json 831, settings.json 487, admin-models.json 460). Brand names, {placeholder} tokens and ICU plural structures kept byte-identical with en-US sources — verified programmatically (key structure + placeholder + ICU skeleton checks)
  • i18n/config.ts: vi-VN added to APP_LOCALES + labels; normalizeAppLocale / resolveBrowserLocale map vi*
  • i18n/messages.ts: dedicated async loader
  • i18n/resolve-error-message.ts: Vietnamese error catalog, fallback string, request/settings field labels, validation rules and dependency messages
  • date-fns vi locale for admin-date-time-picker and admin-date-range-filter calendars
  • Backend: application/auth/service.go normalizeLocale whitelist accepts vi / vi-VN

Verification

Check Result
pnpm typecheck ✅ PASS
biome lint . ✅ PASS (588 files)
next build (production) ✅ PASS
go build ./... ✅ PASS
go test ./internal/application/auth/... ✅ PASS
go test ./internal/application/skill/... ✅ PASS

Notes / known gaps (pre-existing, not addressed here)

  • Backend email templates remain zh-CN only (auth/registration.go)
  • Findings from the review that motivated follow-ups (breaker classifier dead branch F1, idleTimeoutReader data race F2, xAI video poll timeout F3, dangling openai_video_generations protocol F4) are tracked separately and intentionally excluded from this PR to keep it reviewable.

Add EnsureBuiltinSeeds() to the skill service and wire it at app startup
so every deployment ships a usable set of built-in skills out of the box.

Seed engine (backend/internal/application/skill/seed.go):
- Embeds seeddata/*.md (frontmatter: name/title/description/sort)
- Validates limits: title <= 64 chars, description <= 256,
  body <= 10,000 runes
- Idempotent on restart:
  - missing record -> create
  - untouched record (created_by == 0 && updated_by == 0) ->
    re-sync content on upgrade
  - admin-modified record -> never overwritten
- Wired in backend/internal/app/app.go right after skill service init

Bundled skills (10): diagram-svg, mermaid-diagram, html-artifact,
svg-icon, chart-svg, report-writing, polish-writing, translate,
code-review, slide-outline - authored for DEEIX render stack
(SVG block preview, native mermaid, sandboxed HTML artifacts).

Tests: go test ./internal/application/skill/... PASS
@ngav1491
ngav1491 force-pushed the feat/vi-vn-i18n-and-builtin-skills branch from b5739c0 to 9ca51d6 Compare August 23, 2026 08:02
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