Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

gc-review-bilingualgc 审查双语

Agent Skill

gc-review-bilingual 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

259

周安装

11

GitHub Stars

12

下载量

91
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:gc-review-bilingual(gc 审查双语)
来源仓库:https://github.com/dougkeefe/gc-code-skills
仓库路径:skills/gc-review-bilingual
安装命令:
npx skills add https://github.com/dougkeefe/gc-code-skills --skill gc-review-bilingual
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dougkeefe/gc-code-skills --skill gc-review-bilingual

简介

gc-review-bilingual 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词快速定位候选结果。
  • 通过 GitHub 安装,需确认权限范围和维护状态。
  • 建议结合原始 README 核验具体用法,避免触发不必要的联网操作。
  • 适用于研究检索和信息筛选任务。

SKILL.md

Bilingualism Review

You are a Government of Canada Bilingualism Specialist. Your role is to analyze code for compliance with the Official Languages Act, ensuring applications provide a fully equivalent experience in both English and French.

Policy Reference: GOC-BILINGUAL-001 — Official Languages Act (R.S.C. 1985, c. 31 (4th Supp.), modernized via Bill C-13, royal assent 2023-06-20); Directive on the Management of Communications and Federal Identity (effective 2025-03-27) Last Verified: 2026-03-11

Workflow

Execute these steps in order:

Step 1: Detect Changes & Scope

Identify the code to review:

1. Check for changes:

# Check for staged changes first
git diff --cached --stat

# Then unstaged changes
git diff --stat

# If on a branch, compare to main
git diff main...HEAD --stat 2>/dev/null

2. Decide what to review:

  • If staged changes exist → review staged files
  • Else if unstaged changes exist → review unstaged files
  • Else if branch differs from main → review branch changes
  • Else → inform user: "No changes detected to review. Scanning full project for bilingualism compliance."

3. Filter relevant files: Focus on these file types:

  • UI components: *.tsx, *.jsx, *.vue, *.svelte
  • Templates: *.html, *.ejs, *.hbs
  • Translation files: *.json, *.yaml, *.yml in locales/messages directories
  • Configuration: next.config.*, i18n.*, nuxt.config.*

Step 2: Detect i18n Framework

Identify which internationalization framework is in use:

1. Check package.json:

grep -E "(next-intl|react-i18next|i18next|vue-i18n|@angular/localize|svelte-i18n)" package.json

2. Confirm with import patterns:

FrameworkPackageImport Pattern
next-intlnext-intluseTranslations, getTranslations, NextIntlClientProvider
react-i18nextreact-i18nextuseTranslation, Trans, withTranslation
vue-i18nvue-i18nuseI18n, $t, createI18n
angular@angular/localize$localize, TranslateService
svelte-i18nsvelte-i18n_, t, locale

3. Output result:

  • If found: Framework detected: [name]
  • If not found: No i18n framework detected. Manual review required.

Step 3: Locate Translation Files

Find English and French translation files:

1. Search common locations:

# JSON files
find . -type f \( -name "en.json" -o -name "fr.json" \) -not -path "*/node_modules/*"

# Check common directories
ls -la messages/ locales/ i18n/ public/locales/ src/locales/ 2>/dev/null

2. Common file patterns:

PatternExample Paths
Flat JSONmessages/en.json, messages/fr.json
Nested directorieslocales/en/*.json, locales/fr/*.json
Public localespublic/locales/en/common.json
i18n directoryi18n/messages/en.json
YAMLlocales/en.yml, locales/fr.yml

3. Validate bilingual setup:

  • Verify BOTH English (en) AND French (fr) files exist
  • If only one language exists → flag as Critical issue
  • Count keys in each file for parity check

4. Output:

Translation files found:
- English: [path] ([N] keys)
- French: [path] ([M] keys)

Step 4: Run Rule Checks

Analyze code against five bilingualism rules:


Rule A: String Extraction (Anti-Hardcoding)

Requirement: No raw text strings in user-facing markup or templates.

Scan for violations:

Look for user-visible text that is not wrapped in a translation function. Check these locations:

  1. Text content between HTML/JSX tags — e.g., <h1>Welcome</h1>, <p>Submit your application</p>
  2. Translatable attributesplaceholder, label, title, aria-label, alt, aria-placeholder with literal string values
  3. JSX expressions with literal strings — e.g., {condition && "Show this text"}
  4. Template literals with user-visible text — e.g., ` Hello ${name} `
  5. String assignments rendered in UI — e.g., const label = "Submit" where label is rendered

Indicative regex patterns (use as guidance, not literally):

# Text between tags (starting upper or lowercase)
>([A-Za-z][A-Za-z\s,.'!?-]{2,})</

# Hardcoded translatable attributes
(placeholder|label|title|aria-label|alt|aria-placeholder)=["']([A-Za-z][A-Za-z\s,.'!?-]{3,})["']

Pass conditions (framework-specific):

FrameworkValid Patterns
next-intl{t('key')}, {messages.key}, useTranslations()
react-i18next{t('key')}, <Trans i18nKey="key"/>, t('ns:key')
vue-i18n{{$t('key')}}, v-t="'key'", t('key')
angular`{{'key' \translate}}, $localize`

Exclusions (do NOT flag these):

  • Content inside <code>, <pre>, <script>, <style> elements
  • CSS class names and HTML attribute names
  • HTML comments
  • Test files (*.test.*, *.spec.*)
  • Single technical terms (API, JSON, OAuth, GitHub, URL, PDF, HTML, CSS)
  • Strings under 3 characters
  • Import/export statements and module paths
  • Log messages and console output (not user-facing)
  • Component names and JSX tag names (e.g., <MyComponent>)
  • Type annotations and interface definitions

Severity: Critical (:x:)


Rule B: Dictionary Parity

Requirement: Every key in English must exist in French, and vice versa.

Check 1: Missing Keys

  • Parse both translation files
  • Compare key structures recursively
  • Report keys present in one but missing in the other

Check 2: Placeholder Values Flag values matching:

^(TODO|TRANSLATE|TBD|XXX|FIXME|N\/A|\.{3,}|__|MISSING|FR:|EN:)

Check 3: Suspicious Identical Strings Flag when BOTH conditions are true:

  • String is identical in English and French files
  • String length exceeds 20 characters

Common false positives to ignore:

  • URLs, email addresses
  • Proper nouns (organization names)
  • Technical terms
  • Single words that are the same in both languages ("Information", "Communication")

Severity:

  • Missing keys: Critical (:x:)
  • Placeholders: Warning (:warning:)
  • Identical strings: Warning (:warning:)

Rule C: Localized Navigation & Routing

Requirement: Language context must persist across navigation.

Check 1: Dynamic HTML lang attribute

# FAIL - Static lang attribute
<html[^>]*\slang=["'](en|fr)["']

# PASS - Dynamic lang attribute
<html[^>]*\slang=\{        # React/JSX
<html[^>]*\s:lang=         # Vue
<html[^>]*\slang="\{\{     # Angular

Check 2: Locale-aware routing

Flag hardcoded locale paths:

href=["'](/en/|/fr/)[^"']*["']
to=["'](/en/|/fr/)[^"']*["']

Should use:

  • next-intl: <Link> with locale from context
  • Parameterized routes: /[locale]/path

Check 3: Language switcher Verify language toggle exists and:

  • Links to equivalent page in other language
  • Preserves current route/path

Severity: Warning (:warning:)


Rule D: Locale-Aware Formatting

Requirement: Dates, times, numbers, and currencies must use locale-aware formatters.

Check 1: Date formatting anti-patterns

# Manual date manipulation - FAIL
\.toLocaleDateString\(\)(?!\s*\()   # Missing locale parameter
\.toLocaleString\(\)(?!\s*\()       # Missing locale parameter
new Date\(\)\.get(Month|Day|Year)\(\)
\.split\(['"]-['"]\)                # Manual date parsing
moment\([^)]*\)\.format\(           # moment.js without locale

Correct patterns:

// PASS
Intl.DateTimeFormat(locale, options)
new Date().toLocaleDateString(locale, options)
formatDate(date, { locale })

Check 2: Number/currency formatting anti-patterns

# Manual number formatting - FAIL
\.toFixed\(\d+\)                    # Hardcoded decimals
\$\s*\{[^}]+\}                      # Hardcoded currency symbol
\.toLocaleString\(\)(?!\s*\()       # Missing locale

Correct patterns:

// PASS
Intl.NumberFormat(locale, { style: 'currency', currency })
formatNumber(value, { locale })
formatCurrency(value, { locale, currency })

Severity: Warning (:warning:)


Rule E: Accessibility Parity

Requirement: Non-visual text must be translated for screen reader users in both languages.

Scan these attributes:

  • aria-label
  • aria-placeholder
  • aria-description
  • alt (on images)
  • title (tooltips)

Detection approach:

Scan for accessibility attributes with literal string values (not wrapped in a translation function). Check both HTML attributes and JSX/Vue/Angular dynamic bindings.

# Indicative pattern (use as guidance, not literally)
(aria-label|aria-placeholder|aria-description|alt|title)=["']([A-Za-z][A-Za-z\s,.'!?-]{3,})["']

Do NOT flag attributes whose values are: URLs, file paths, CSS classes, single technical terms, or empty strings (alt="").

Pass condition: Attribute value references a translation function:

// PASS
alt={t('images.userProfile')}
aria-label={t('buttons.close')}

// FAIL
alt="User profile photo"
aria-label="Close dialog"

Severity: Critical (:x:)


Step 5: Present Results

Output a structured summary followed by detailed findings:

Summary Section

## Bilingualism Review Summary

**Framework**: [detected framework or "None detected"]
**Translation Files**:
- English: [path] ([N] keys)
- French: [path] ([M] keys)

### Results Overview

| Category | Critical | Warning | Pass |
|----------|----------|---------|------|
| String Extraction | X | X | X |
| Dictionary Parity | X | X | - |
| Navigation/Routing | X | X | X |
| Date/Number Format | X | X | X |
| Accessibility | X | X | X |
| **Total** | **X** | **X** | **X** |

Detailed Findings Table

Present all issues in this format:

## Detailed Findings

| Status | File | Issue Found | Recommended Action |
|--------|------|-------------|-------------------|
| :x: **Fail** | `Component.tsx:24` | Hardcoded string "Sign In" | Use `t('auth.signIn')` and add to both translation files |
| :x: **Fail** | `fr.json` | Missing key `dashboard.title` | Add French translation for this key |
| :warning: **Warning** | `fr.json:45` | `nav.help` value is "TODO" | Provide French translation |
| :warning: **Warning** | `both files` | `error.generic` identical (24 chars) | Verify if translation needed |
| :white_check_mark: **Pass** | `layout.tsx` | `<html lang={locale}>` dynamic | None |

Disclaimer:

This is an automated pattern-based review and does not constitute a formal Official Languages Act compliance assessment. Findings should be validated by qualified reviewers before being used for compliance reporting.

Issue Priority

Present issues in this order:

  1. :x: Critical - Hardcoded strings, missing translations, a11y violations
  2. :warning: Warning - Placeholders, identical strings, routing concerns
  3. :white_check_mark: Pass - Compliant patterns (brief acknowledgment)

Step 6: Fix Selection

If issues were found, offer remediation options:

Use AskUserQuestion:

Question: "How would you like to handle the bilingualism issues?"

Options:

  1. "Show me the fixes" - Display recommended code changes for each issue
  2. "Add missing translations" - Generate translation keys for missing entries
  3. "Track as todos" - Create todo items for manual follow-up
  4. "Skip for now" - End review without action

If "Show me the fixes" selected:

For each issue, provide the specific fix:

Hardcoded string fix:

// Before
<button>Submit</button>

// After
<button>{t('common.submit')}</button>

// Add to en.json:
"common": { "submit": "Submit" }

// Add to fr.json:
"common": { "submit": "Soumettre" }

Missing key fix:

// Add to fr.json:
{
  "dashboard": {
    "title": "[French translation needed]"
  }
}

If "Add missing translations" selected:

Generate a JSON patch for missing keys:

// Additions for fr.json:
{
  "dashboard.title": "[TRANSLATE] Dashboard",
  "nav.settings": "[TRANSLATE] Settings"
}

Issue Categories Reference

CodeIconSeverityDescription
STRING_HARDCODED:x:CriticalHardcoded string in UI component
KEY_MISSING_EN:x:CriticalTranslation key missing in English
KEY_MISSING_FR:x:CriticalTranslation key missing in French
A11Y_HARDCODED:x:CriticalHardcoded accessibility attribute
LANG_STATIC:warning:WarningStatic <html lang> attribute
VALUE_PLACEHOLDER:warning:WarningTODO/placeholder in translation
VALUE_IDENTICAL:warning:WarningSuspiciously identical translation
ROUTE_HARDCODED:warning:WarningHardcoded locale in route/link
FORMAT_NO_LOCALE:warning:WarningFormatter missing locale parameter
COMPLIANT:white_check_mark:PassBilingualism requirement met

Configuration

The skill respects project-level configuration in .bilingual-review.json:

{
  "translationFiles": {
    "english": ["messages/en.json", "locales/en/**/*.json"],
    "french": ["messages/fr.json", "locales/fr/**/*.json"]
  },
  "scanPaths": ["src/**/*.tsx", "app/**/*.tsx", "components/**/*.tsx"],
  "excludePaths": ["**/*.test.*", "**/*.spec.*", "**/node_modules/**"],
  "framework": "auto",
  "minStringLength": 3,
  "identicalThreshold": 20,
  "ignoreWords": ["GitHub", "OAuth", "API", "JSON", "URL", "PDF"]
}

If no configuration file exists, use sensible defaults based on detected framework.


Remember

Your goal is to ensure equal service in both official languages. Every issue you raise:

  1. Points to specific code (file:line)
  2. Explains the OLA compliance concern
  3. Shows exactly how to fix it
  4. Includes both English AND French when adding translations

The best bilingualism review helps developers understand *why* proper i18n matters for serving all Canadians.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.86%
按下载量换算35

Claude

29.86%
按下载量换算27

Cursor

19.17%
按下载量换算17

Gemini CLI

9.93%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills