From 3afd97b4aaccec0cbce1890a378619095e9f1cdf Mon Sep 17 00:00:00 2001 From: Nguyen Thanh Dat Date: Tue, 25 Aug 2026 17:39:43 +0700 Subject: [PATCH 1/4] fix(docs): stop translated agent docs from contradicting the shipped agent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `scripts/ci/validate-agents.js` reads only `agents/`, so the translated copies under `docs//agents/` were never validated against the agent they describe — and drifted. Two kinds of drift, both machine-checkable and both wrong in the same direction (the translations were made from an older revision and never re-synced): - **Model tier, 39 files.** Every one names a costlier tier than ships: haiku -> sonnet, sonnet -> opus. `security-reviewer` reads `opus` in ja-JP and zh-TW; it ships `sonnet`. - **Tool set, 15 files.** `security-reviewer` and `database-reviewer` list `Write` and `Edit` in **all seven locales** — both agents ship read-only (`Read, Grep, Glob, Bash`). `seo-specialist` in zh-CN adds a `Bash` the canonical agent does not have. Documenting a reviewer as able to write is the kind of inaccuracy someone auditing what these agents can touch would act on. Sync `model` and the `tools` set to canonical, preserving each locale's existing list style so the diff is only the values that were wrong. The `["a", "b"]` vs `a, b` formatting difference is left alone: it is consistent per locale and carries no meaning. Add `tests/ci/locale-agent-frontmatter.test.js` so this cannot drift back. `tools` is compared as a set, not a string, so the style difference stays legal; prose is not compared at all. The last case pins the specific failure: a canonical read-only agent may never be documented with Write or Edit. `.kiro/agents/` is deliberately excluded — it uses a different schema (`allowedTools: [read, shell]`, no `model`), not a translation of this one. --- docs/es/agents/chief-of-staff.md | 2 +- docs/es/agents/database-reviewer.md | 2 +- docs/es/agents/docs-lookup.md | 2 +- docs/es/agents/security-reviewer.md | 2 +- docs/ja-JP/agents/build-error-resolver.md | 2 +- docs/ja-JP/agents/chief-of-staff.md | 2 +- docs/ja-JP/agents/code-reviewer.md | 2 +- docs/ja-JP/agents/comment-analyzer.md | 2 +- docs/ja-JP/agents/conversation-analyzer.md | 2 +- docs/ja-JP/agents/database-reviewer.md | 4 +- docs/ja-JP/agents/doc-updater.md | 2 +- docs/ja-JP/agents/docs-lookup.md | 2 +- docs/ja-JP/agents/e2e-runner.md | 2 +- docs/ja-JP/agents/gan-evaluator.md | 2 +- docs/ja-JP/agents/gan-generator.md | 2 +- docs/ja-JP/agents/gan-planner.md | 2 +- docs/ja-JP/agents/go-build-resolver.md | 2 +- docs/ja-JP/agents/go-reviewer.md | 2 +- docs/ja-JP/agents/opensource-forker.md | 2 +- docs/ja-JP/agents/opensource-packager.md | 2 +- docs/ja-JP/agents/python-reviewer.md | 2 +- docs/ja-JP/agents/refactor-cleaner.md | 2 +- docs/ja-JP/agents/security-reviewer.md | 4 +- docs/ja-JP/agents/tdd-guide.md | 2 +- docs/ko-KR/agents/database-reviewer.md | 2 +- docs/ko-KR/agents/security-reviewer.md | 2 +- docs/pt-BR/agents/database-reviewer.md | 2 +- docs/pt-BR/agents/security-reviewer.md | 2 +- docs/tr/agents/chief-of-staff.md | 2 +- docs/tr/agents/database-reviewer.md | 2 +- docs/tr/agents/docs-lookup.md | 2 +- docs/tr/agents/security-reviewer.md | 2 +- docs/zh-CN/agents/chief-of-staff.md | 2 +- docs/zh-CN/agents/comment-analyzer.md | 2 +- docs/zh-CN/agents/conversation-analyzer.md | 2 +- docs/zh-CN/agents/database-reviewer.md | 2 +- docs/zh-CN/agents/docs-lookup.md | 2 +- docs/zh-CN/agents/gan-evaluator.md | 2 +- docs/zh-CN/agents/gan-generator.md | 2 +- docs/zh-CN/agents/gan-planner.md | 2 +- docs/zh-CN/agents/opensource-forker.md | 2 +- docs/zh-CN/agents/opensource-packager.md | 2 +- docs/zh-CN/agents/security-reviewer.md | 2 +- docs/zh-CN/agents/seo-specialist.md | 2 +- docs/zh-TW/agents/build-error-resolver.md | 2 +- docs/zh-TW/agents/code-reviewer.md | 2 +- docs/zh-TW/agents/database-reviewer.md | 4 +- docs/zh-TW/agents/doc-updater.md | 2 +- docs/zh-TW/agents/e2e-runner.md | 2 +- docs/zh-TW/agents/go-build-resolver.md | 2 +- docs/zh-TW/agents/go-reviewer.md | 2 +- docs/zh-TW/agents/refactor-cleaner.md | 2 +- docs/zh-TW/agents/security-reviewer.md | 4 +- docs/zh-TW/agents/tdd-guide.md | 2 +- tests/ci/locale-agent-frontmatter.test.js | 187 +++++++++++++++++++++ 55 files changed, 245 insertions(+), 58 deletions(-) create mode 100644 tests/ci/locale-agent-frontmatter.test.js diff --git a/docs/es/agents/chief-of-staff.md b/docs/es/agents/chief-of-staff.md index 6963978c2..1e12ac3e4 100644 --- a/docs/es/agents/chief-of-staff.md +++ b/docs/es/agents/chief-of-staff.md @@ -2,7 +2,7 @@ name: chief-of-staff description: Jefe de comunicaciones personal que gestiona el correo electrónico, Slack, LINE y Messenger. Clasifica mensajes en 4 niveles (skip/info_only/meeting_info/action_required), genera borradores de respuesta y refuerza el seguimiento post-envío mediante hooks. Usar para gestionar flujos de trabajo de comunicación multi-canal. tools: ["Read", "Grep", "Glob", "Bash", "Edit", "Write"] -model: opus +model: sonnet --- ## Línea de Base de Defensa de Prompts diff --git a/docs/es/agents/database-reviewer.md b/docs/es/agents/database-reviewer.md index 808b4d706..02ec9bce7 100644 --- a/docs/es/agents/database-reviewer.md +++ b/docs/es/agents/database-reviewer.md @@ -1,7 +1,7 @@ --- name: database-reviewer description: Especialista en bases de datos PostgreSQL para optimización de consultas, diseño de esquemas, seguridad y rendimiento. Usar PROACTIVAMENTE al escribir SQL, crear migraciones, diseñar esquemas o solucionar problemas de rendimiento de base de datos. Incorpora mejores prácticas de Supabase. -tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] +tools: ["Read", "Grep", "Glob", "Bash"] model: sonnet --- diff --git a/docs/es/agents/docs-lookup.md b/docs/es/agents/docs-lookup.md index 7a8625278..8625de573 100644 --- a/docs/es/agents/docs-lookup.md +++ b/docs/es/agents/docs-lookup.md @@ -2,7 +2,7 @@ name: docs-lookup description: Cuando el usuario pregunta cómo usar una biblioteca, framework o API, o necesita ejemplos de código actualizados, usar Context7 MCP para obtener documentación actual y devolver respuestas con ejemplos. Invocar para preguntas sobre docs/API/configuración. tools: ["Read", "Grep", "mcp__context7__resolve-library-id", "mcp__context7__query-docs"] -model: sonnet +model: haiku --- ## Línea de Base de Defensa de Prompts diff --git a/docs/es/agents/security-reviewer.md b/docs/es/agents/security-reviewer.md index 13a893a8d..cb99eb30d 100644 --- a/docs/es/agents/security-reviewer.md +++ b/docs/es/agents/security-reviewer.md @@ -1,7 +1,7 @@ --- name: security-reviewer description: Especialista en detección y remediación de vulnerabilidades de seguridad. Usar PROACTIVAMENTE después de escribir código que maneja entrada de usuarios, autenticación, endpoints de API o datos sensibles. Detecta secretos, SSRF, inyección, criptografía insegura y vulnerabilidades del OWASP Top 10. -tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] +tools: ["Read", "Grep", "Glob", "Bash"] model: sonnet --- diff --git a/docs/ja-JP/agents/build-error-resolver.md b/docs/ja-JP/agents/build-error-resolver.md index 6362ac24a..5eda1ba50 100644 --- a/docs/ja-JP/agents/build-error-resolver.md +++ b/docs/ja-JP/agents/build-error-resolver.md @@ -2,7 +2,7 @@ name: build-error-resolver description: ビルドおよびTypeScriptエラー解決のスペシャリスト。ビルドが失敗した際やタイプエラーが発生した際に積極的に使用してください。最小限の差分でビルド/タイプエラーのみを修正し、アーキテクチャの変更は行いません。ビルドを迅速に成功させることに焦点を当てます。 tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +model: sonnet --- # ビルドエラーリゾルバー diff --git a/docs/ja-JP/agents/chief-of-staff.md b/docs/ja-JP/agents/chief-of-staff.md index d62cc0be0..13ad1f21c 100644 --- a/docs/ja-JP/agents/chief-of-staff.md +++ b/docs/ja-JP/agents/chief-of-staff.md @@ -2,7 +2,7 @@ name: chief-of-staff description: メール、Slack、LINE、Messengerをトリアージするパーソナルコミュニケーションチーフオブスタッフ。メッセージを4つのティア(skip/info_only/meeting_info/action_required)に分類し、返信ドラフトを生成し、送信後のフォロースルーをフックで強制します。マルチチャネルコミュニケーションワークフローの管理時に使用します。 tools: ["Read", "Grep", "Glob", "Bash", "Edit", "Write"] -model: opus +model: sonnet --- ## プロンプト防御ベースライン diff --git a/docs/ja-JP/agents/code-reviewer.md b/docs/ja-JP/agents/code-reviewer.md index b5c5c5d72..bf26d6a5a 100644 --- a/docs/ja-JP/agents/code-reviewer.md +++ b/docs/ja-JP/agents/code-reviewer.md @@ -2,7 +2,7 @@ name: code-reviewer description: 専門コードレビュースペシャリスト。品質、セキュリティ、保守性のためにコードを積極的にレビューします。コードの記述または変更直後に使用してください。すべてのコード変更に対して必須です。 tools: ["Read", "Grep", "Glob", "Bash"] -model: opus +model: sonnet --- あなたはコード品質とセキュリティの高い基準を確保するシニアコードレビュアーです。 diff --git a/docs/ja-JP/agents/comment-analyzer.md b/docs/ja-JP/agents/comment-analyzer.md index 1db18900e..63255e383 100644 --- a/docs/ja-JP/agents/comment-analyzer.md +++ b/docs/ja-JP/agents/comment-analyzer.md @@ -1,7 +1,7 @@ --- name: comment-analyzer description: コードコメントの正確性、完全性、保守性、コメント劣化リスクを分析します。 -model: sonnet +model: haiku tools: [Read, Grep, Glob] --- diff --git a/docs/ja-JP/agents/conversation-analyzer.md b/docs/ja-JP/agents/conversation-analyzer.md index bc8ddb8e0..26e31f7ca 100644 --- a/docs/ja-JP/agents/conversation-analyzer.md +++ b/docs/ja-JP/agents/conversation-analyzer.md @@ -1,7 +1,7 @@ --- name: conversation-analyzer description: 会話のトランスクリプトを分析し、フックで防止すべき動作を見つけるためにこのエージェントを使用します。引数なしの/hookifyでトリガーされます。 -model: sonnet +model: haiku tools: [Read, Grep] --- diff --git a/docs/ja-JP/agents/database-reviewer.md b/docs/ja-JP/agents/database-reviewer.md index 30d814b82..f76e50e95 100644 --- a/docs/ja-JP/agents/database-reviewer.md +++ b/docs/ja-JP/agents/database-reviewer.md @@ -1,8 +1,8 @@ --- name: database-reviewer description: クエリ最適化、スキーマ設計、セキュリティ、パフォーマンスのためのPostgreSQLデータベーススペシャリスト。SQL作成、マイグレーション作成、スキーマ設計、データベースパフォーマンスのトラブルシューティング時に積極的に使用してください。Supabaseのベストプラクティスを組み込んでいます。 -tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +tools: ["Read", "Grep", "Glob", "Bash"] +model: sonnet --- # データベースレビューアー diff --git a/docs/ja-JP/agents/doc-updater.md b/docs/ja-JP/agents/doc-updater.md index c54876458..adf807954 100644 --- a/docs/ja-JP/agents/doc-updater.md +++ b/docs/ja-JP/agents/doc-updater.md @@ -2,7 +2,7 @@ name: doc-updater description: ドキュメントとコードマップのスペシャリスト。コードマップとドキュメントの更新に積極的に使用してください。/update-codemapsと/update-docsを実行し、docs/CODEMAPS/*を生成し、READMEとガイドを更新します。 tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +model: haiku --- # ドキュメント & コードマップスペシャリスト diff --git a/docs/ja-JP/agents/docs-lookup.md b/docs/ja-JP/agents/docs-lookup.md index e18c0e55a..721baf95c 100644 --- a/docs/ja-JP/agents/docs-lookup.md +++ b/docs/ja-JP/agents/docs-lookup.md @@ -2,7 +2,7 @@ name: docs-lookup description: ユーザーがライブラリ、フレームワーク、APIの使い方を質問したり、最新のコード例が必要な場合に、Context7 MCPを使用して最新のドキュメントを取得し、例付きの回答を返します。ドキュメント/API/セットアップの質問時に呼び出します。 tools: ["Read", "Grep", "mcp__context7__resolve-library-id", "mcp__context7__query-docs"] -model: sonnet +model: haiku --- ## プロンプト防御ベースライン diff --git a/docs/ja-JP/agents/e2e-runner.md b/docs/ja-JP/agents/e2e-runner.md index e6eb35f87..03cc2890c 100644 --- a/docs/ja-JP/agents/e2e-runner.md +++ b/docs/ja-JP/agents/e2e-runner.md @@ -2,7 +2,7 @@ name: e2e-runner description: Vercel Agent Browser(推奨)とPlaywrightフォールバックを使用するエンドツーエンドテストスペシャリスト。E2Eテストの生成、メンテナンス、実行に積極的に使用してください。テストジャーニーの管理、不安定なテストの隔離、アーティファクト(スクリーンショット、ビデオ、トレース)のアップロード、重要なユーザーフローの動作確認を行います。 tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +model: sonnet --- # E2Eテストランナー diff --git a/docs/ja-JP/agents/gan-evaluator.md b/docs/ja-JP/agents/gan-evaluator.md index 8e2e1b8b6..64d944e6f 100644 --- a/docs/ja-JP/agents/gan-evaluator.md +++ b/docs/ja-JP/agents/gan-evaluator.md @@ -2,7 +2,7 @@ name: gan-evaluator description: "GANハーネス — エバリュエーターエージェント。Playwrightを使用してライブ実行中のアプリケーションをテストし、ルーブリックに対してスコアリングし、ジェネレーターに実行可能なフィードバックを提供します。" tools: ["Read", "Write", "Bash", "Grep", "Glob"] -model: opus +model: sonnet color: red --- diff --git a/docs/ja-JP/agents/gan-generator.md b/docs/ja-JP/agents/gan-generator.md index f31d4c02c..9a3862608 100644 --- a/docs/ja-JP/agents/gan-generator.md +++ b/docs/ja-JP/agents/gan-generator.md @@ -2,7 +2,7 @@ name: gan-generator description: "GANハーネス — ジェネレーターエージェント。仕様に従って機能を実装し、エバリュエーターのフィードバックを読み、品質閾値を満たすまでイテレーションします。" tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +model: sonnet color: green --- diff --git a/docs/ja-JP/agents/gan-planner.md b/docs/ja-JP/agents/gan-planner.md index 084bb60b4..acf2752d2 100644 --- a/docs/ja-JP/agents/gan-planner.md +++ b/docs/ja-JP/agents/gan-planner.md @@ -2,7 +2,7 @@ name: gan-planner description: "GANハーネス — プランナーエージェント。1行のプロンプトを、機能、スプリント、評価基準、デザイン方向を含む完全な製品仕様に展開します。" tools: ["Read", "Write", "Grep", "Glob"] -model: opus +model: sonnet color: purple --- diff --git a/docs/ja-JP/agents/go-build-resolver.md b/docs/ja-JP/agents/go-build-resolver.md index 4f360fce3..64f2f7df5 100644 --- a/docs/ja-JP/agents/go-build-resolver.md +++ b/docs/ja-JP/agents/go-build-resolver.md @@ -2,7 +2,7 @@ name: go-build-resolver description: Goビルド、vet、コンパイルエラー解決スペシャリスト。最小限の変更でビルドエラー、go vet問題、リンターの警告を修正します。Goビルドが失敗したときに使用してください。 tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +model: sonnet --- # Goビルドエラーリゾルバー diff --git a/docs/ja-JP/agents/go-reviewer.md b/docs/ja-JP/agents/go-reviewer.md index abab6fe57..0dd66d876 100644 --- a/docs/ja-JP/agents/go-reviewer.md +++ b/docs/ja-JP/agents/go-reviewer.md @@ -4,7 +4,7 @@ description: 慣用的なGo、並行処理パターン、エラー処理、パ コード変更に使用してください。Goプロジェクトに必須です。 tools: ["Read", "Grep", "Glob", "Bash"] -model: opus +model: sonnet --- あなたは慣用的なGoとベストプラクティスの高い基準を確保するシニアGoコードレビュアーです。 diff --git a/docs/ja-JP/agents/opensource-forker.md b/docs/ja-JP/agents/opensource-forker.md index c1c21dd9a..30a81d7ae 100644 --- a/docs/ja-JP/agents/opensource-forker.md +++ b/docs/ja-JP/agents/opensource-forker.md @@ -2,7 +2,7 @@ name: opensource-forker description: あらゆるプロジェクトをオープンソース化のためにフォークします。ファイルのコピー、シークレットと認証情報の除去(20以上のパターン)、内部参照のプレースホルダー置換、.env.exampleの生成、git履歴のクリーンアップを行います。opensource-pipelineスキルの第1ステージです。 tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: sonnet +model: haiku --- ## プロンプト防御ベースライン diff --git a/docs/ja-JP/agents/opensource-packager.md b/docs/ja-JP/agents/opensource-packager.md index 6916ed6c8..916147b04 100644 --- a/docs/ja-JP/agents/opensource-packager.md +++ b/docs/ja-JP/agents/opensource-packager.md @@ -2,7 +2,7 @@ name: opensource-packager description: サニタイズ済みプロジェクトの完全なオープンソースパッケージングを生成します。CLAUDE.md、setup.sh、README.md、LICENSE、CONTRIBUTING.md、GitHubイシューテンプレートを作成します。あらゆるリポジトリをClaude Codeですぐに使えるようにします。opensource-pipelineスキルの第3ステージです。 tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: sonnet +model: haiku --- ## プロンプト防御ベースライン diff --git a/docs/ja-JP/agents/python-reviewer.md b/docs/ja-JP/agents/python-reviewer.md index 06059fea3..a8ffe16db 100644 --- a/docs/ja-JP/agents/python-reviewer.md +++ b/docs/ja-JP/agents/python-reviewer.md @@ -2,7 +2,7 @@ name: python-reviewer description: PEP 8準拠、Pythonイディオム、型ヒント、セキュリティ、パフォーマンスを専門とする専門Pythonコードレビュアー。すべてのPythonコード変更に使用してください。Pythonプロジェクトに必須です。 tools: ["Read", "Grep", "Glob", "Bash"] -model: opus +model: sonnet --- あなたはPythonicコードとベストプラクティスの高い基準を確保するシニアPythonコードレビュアーです。 diff --git a/docs/ja-JP/agents/refactor-cleaner.md b/docs/ja-JP/agents/refactor-cleaner.md index e378ba949..a6757490d 100644 --- a/docs/ja-JP/agents/refactor-cleaner.md +++ b/docs/ja-JP/agents/refactor-cleaner.md @@ -2,7 +2,7 @@ name: refactor-cleaner description: デッドコードクリーンアップと統合スペシャリスト。未使用コード、重複の削除、リファクタリングに積極的に使用してください。分析ツール(knip、depcheck、ts-prune)を実行してデッドコードを特定し、安全に削除します。 tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +model: sonnet --- # リファクタ&デッドコードクリーナー diff --git a/docs/ja-JP/agents/security-reviewer.md b/docs/ja-JP/agents/security-reviewer.md index a9367460d..d2285a3e3 100644 --- a/docs/ja-JP/agents/security-reviewer.md +++ b/docs/ja-JP/agents/security-reviewer.md @@ -1,8 +1,8 @@ --- name: security-reviewer description: セキュリティ脆弱性検出および修復のスペシャリスト。ユーザー入力、認証、APIエンドポイント、機密データを扱うコードを書いた後に積極的に使用してください。シークレット、SSRF、インジェクション、安全でない暗号、OWASP Top 10の脆弱性を検出します。 -tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +tools: ["Read", "Grep", "Glob", "Bash"] +model: sonnet --- # セキュリティレビューアー diff --git a/docs/ja-JP/agents/tdd-guide.md b/docs/ja-JP/agents/tdd-guide.md index 7726ce367..79bac72df 100644 --- a/docs/ja-JP/agents/tdd-guide.md +++ b/docs/ja-JP/agents/tdd-guide.md @@ -2,7 +2,7 @@ name: tdd-guide description: テスト駆動開発スペシャリストで、テストファースト方法論を強制します。新しい機能の記述、バグの修正、コードのリファクタリング時に積極的に使用してください。80%以上のテストカバレッジを確保します。 tools: ["Read", "Write", "Edit", "Bash", "Grep"] -model: opus +model: sonnet --- あなたはテスト駆動開発(TDD)スペシャリストで、すべてのコードがテストファーストの方法論で包括的なカバレッジをもって開発されることを確保します。 diff --git a/docs/ko-KR/agents/database-reviewer.md b/docs/ko-KR/agents/database-reviewer.md index a5023cbd1..bac391711 100644 --- a/docs/ko-KR/agents/database-reviewer.md +++ b/docs/ko-KR/agents/database-reviewer.md @@ -1,7 +1,7 @@ --- name: database-reviewer description: PostgreSQL 데이터베이스 전문가. 쿼리 최적화, 스키마 설계, 보안, 성능을 다룹니다. SQL 작성, 마이그레이션 생성, 스키마 설계, 데이터베이스 성능 트러블슈팅 시 사용하세요. Supabase 모범 사례를 포함합니다. -tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] +tools: ["Read", "Grep", "Glob", "Bash"] model: sonnet --- diff --git a/docs/ko-KR/agents/security-reviewer.md b/docs/ko-KR/agents/security-reviewer.md index 49dcff92e..5370ae126 100644 --- a/docs/ko-KR/agents/security-reviewer.md +++ b/docs/ko-KR/agents/security-reviewer.md @@ -1,7 +1,7 @@ --- name: security-reviewer description: 보안 취약점 감지 및 수정 전문가. 사용자 입력 처리, 인증, API 엔드포인트, 민감한 데이터를 다루는 코드 작성 후 사용하세요. 시크릿, SSRF, 인젝션, 안전하지 않은 암호화, OWASP Top 10 취약점을 플래그합니다. -tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] +tools: ["Read", "Grep", "Glob", "Bash"] model: sonnet --- diff --git a/docs/pt-BR/agents/database-reviewer.md b/docs/pt-BR/agents/database-reviewer.md index 31b05e0a0..c88abe9eb 100644 --- a/docs/pt-BR/agents/database-reviewer.md +++ b/docs/pt-BR/agents/database-reviewer.md @@ -1,7 +1,7 @@ --- name: database-reviewer description: Especialista em banco de dados PostgreSQL para otimização de queries, design de schema, segurança e performance. Use PROATIVAMENTE ao escrever SQL, criar migrações, projetar schemas ou solucionar problemas de performance. Incorpora boas práticas do Supabase. -tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] +tools: ["Read", "Grep", "Glob", "Bash"] model: sonnet --- diff --git a/docs/pt-BR/agents/security-reviewer.md b/docs/pt-BR/agents/security-reviewer.md index 54e456753..3355ff84c 100644 --- a/docs/pt-BR/agents/security-reviewer.md +++ b/docs/pt-BR/agents/security-reviewer.md @@ -1,7 +1,7 @@ --- name: security-reviewer description: Especialista em detecção e remediação de vulnerabilidades de segurança. Use PROATIVAMENTE após escrever código que trata input de usuário, autenticação, endpoints de API ou dados sensíveis. Sinaliza segredos, SSRF, injection, criptografia insegura e vulnerabilidades OWASP Top 10. -tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] +tools: ["Read", "Grep", "Glob", "Bash"] model: sonnet --- diff --git a/docs/tr/agents/chief-of-staff.md b/docs/tr/agents/chief-of-staff.md index f7924608f..d41816d58 100644 --- a/docs/tr/agents/chief-of-staff.md +++ b/docs/tr/agents/chief-of-staff.md @@ -2,7 +2,7 @@ name: chief-of-staff description: Personal communication chief of staff that triages email, Slack, LINE, and Messenger. Classifies messages into 4 tiers (skip/info_only/meeting_info/action_required), generates draft replies, and enforces post-send follow-through via hooks. Use when managing multi-channel communication workflows. tools: ["Read", "Grep", "Glob", "Bash", "Edit", "Write"] -model: opus +model: sonnet --- Tüm iletişim kanallarını — e-posta, Slack, LINE, Messenger ve takvim — birleşik bir triyaj hattı üzerinden yöneten kişisel bir başkan yardımcısısınız. diff --git a/docs/tr/agents/database-reviewer.md b/docs/tr/agents/database-reviewer.md index c1cc651b9..cae06aa28 100644 --- a/docs/tr/agents/database-reviewer.md +++ b/docs/tr/agents/database-reviewer.md @@ -1,7 +1,7 @@ --- name: database-reviewer description: PostgreSQL database specialist for query optimization, schema design, security, and performance. Use PROACTIVELY when writing SQL, creating migrations, designing schemas, or troubleshooting database performance. Incorporates Supabase best practices. -tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] +tools: ["Read", "Grep", "Glob", "Bash"] model: sonnet --- diff --git a/docs/tr/agents/docs-lookup.md b/docs/tr/agents/docs-lookup.md index 942d97091..9e2afc1a6 100644 --- a/docs/tr/agents/docs-lookup.md +++ b/docs/tr/agents/docs-lookup.md @@ -2,7 +2,7 @@ name: docs-lookup description: Kullanıcı bir kütüphaneyi, framework'ü veya API'yi nasıl kullanacağını sorduğunda veya güncel kod örneklerine ihtiyaç duyduğunda, güncel dokümantasyon getirmek ve örneklerle cevaplar döndürmek için Context7 MCP kullanın. Docs/API/kurulum soruları için çağrılır. tools: ["Read", "Grep", "mcp__context7__resolve-library-id", "mcp__context7__query-docs"] -model: sonnet +model: haiku --- Bir dokümantasyon specialistisiniz. Kütüphaneler, framework'ler ve API'ler hakkındaki soruları Context7 MCP (resolve-library-id ve query-docs) aracılığıyla getirilen güncel dokümantasyonu kullanarak cevaplarsınız, eğitim verilerini değil. diff --git a/docs/tr/agents/security-reviewer.md b/docs/tr/agents/security-reviewer.md index 8beb9e1c4..dd9d415f5 100644 --- a/docs/tr/agents/security-reviewer.md +++ b/docs/tr/agents/security-reviewer.md @@ -1,7 +1,7 @@ --- name: security-reviewer description: Güvenlik açığı tespit ve düzeltme specialisti. Kullanıcı girdisi, kimlik doğrulama, API endpoint'leri veya hassas veri işleyen kod yazdıktan sonra PROAKTİF olarak kullanın. Secret'ları, SSRF, injection, güvensiz kriptografiyi ve OWASP Top 10 güvenlik açıklarını işaretler. -tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] +tools: ["Read", "Grep", "Glob", "Bash"] model: sonnet --- diff --git a/docs/zh-CN/agents/chief-of-staff.md b/docs/zh-CN/agents/chief-of-staff.md index 157c84fb1..733f97545 100644 --- a/docs/zh-CN/agents/chief-of-staff.md +++ b/docs/zh-CN/agents/chief-of-staff.md @@ -2,7 +2,7 @@ name: chief-of-staff description: 个人通讯首席参谋,负责筛选电子邮件、Slack、LINE和Messenger中的消息。将消息分为4个等级(跳过/仅信息/会议信息/需要行动),生成草稿回复,并通过钩子强制执行发送后的跟进。适用于管理多渠道通讯工作流程时。 tools: ["Read", "Grep", "Glob", "Bash", "Edit", "Write"] -model: opus +model: sonnet --- 你是一位个人幕僚长,通过一个统一的分类处理管道管理所有通信渠道——电子邮件、Slack、LINE、Messenger 和日历。 diff --git a/docs/zh-CN/agents/comment-analyzer.md b/docs/zh-CN/agents/comment-analyzer.md index ba1dff182..b2b1e68b5 100644 --- a/docs/zh-CN/agents/comment-analyzer.md +++ b/docs/zh-CN/agents/comment-analyzer.md @@ -1,7 +1,7 @@ --- name: comment-analyzer description: 分析代码注释的准确性、完整性、可维护性和注释腐烂风险。 -model: sonnet +model: haiku tools: [Read, Grep, Glob] --- diff --git a/docs/zh-CN/agents/conversation-analyzer.md b/docs/zh-CN/agents/conversation-analyzer.md index a91ed543f..e54a87d53 100644 --- a/docs/zh-CN/agents/conversation-analyzer.md +++ b/docs/zh-CN/agents/conversation-analyzer.md @@ -1,7 +1,7 @@ --- name: conversation-analyzer description: 使用此代理分析对话记录,以找到值得通过钩子预防的行为。由不带参数的 /hookify 触发。 -model: sonnet +model: haiku tools: [Read, Grep] --- diff --git a/docs/zh-CN/agents/database-reviewer.md b/docs/zh-CN/agents/database-reviewer.md index f7a4dd6a0..d4d8fcd33 100644 --- a/docs/zh-CN/agents/database-reviewer.md +++ b/docs/zh-CN/agents/database-reviewer.md @@ -1,7 +1,7 @@ --- name: database-reviewer description: PostgreSQL 数据库专家,专注于查询优化、模式设计、安全性和性能。在编写 SQL、创建迁移、设计模式或排查数据库性能问题时,请主动使用。融合了 Supabase 最佳实践。 -tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] +tools: ["Read", "Grep", "Glob", "Bash"] model: sonnet --- diff --git a/docs/zh-CN/agents/docs-lookup.md b/docs/zh-CN/agents/docs-lookup.md index 2a6188dbf..bb98cfa0b 100644 --- a/docs/zh-CN/agents/docs-lookup.md +++ b/docs/zh-CN/agents/docs-lookup.md @@ -2,7 +2,7 @@ name: docs-lookup description: 当用户询问如何使用库、框架或API,或需要最新的代码示例时,使用Context7 MCP获取当前文档,并返回带有示例的答案。针对文档/API/设置问题调用。 tools: ["Read", "Grep", "mcp__context7__resolve-library-id", "mcp__context7__query-docs"] -model: sonnet +model: haiku --- 你是一名文档专家。你使用通过 Context7 MCP(resolve-library-id 和 query-docs)获取的当前文档来回答关于库、框架和 API 的问题,而不是使用训练数据。 diff --git a/docs/zh-CN/agents/gan-evaluator.md b/docs/zh-CN/agents/gan-evaluator.md index b48f4fe57..53d5977b2 100644 --- a/docs/zh-CN/agents/gan-evaluator.md +++ b/docs/zh-CN/agents/gan-evaluator.md @@ -2,7 +2,7 @@ name: gan-evaluator description: "GAN Harness — Evaluator agent. Tests the live running application via Playwright, scores against rubric, and provides actionable feedback to the Generator." tools: ["Read", "Write", "Bash", "Grep", "Glob"] -model: opus +model: sonnet color: red --- diff --git a/docs/zh-CN/agents/gan-generator.md b/docs/zh-CN/agents/gan-generator.md index 63d99d7f8..d1e8367b7 100644 --- a/docs/zh-CN/agents/gan-generator.md +++ b/docs/zh-CN/agents/gan-generator.md @@ -2,7 +2,7 @@ name: gan-generator description: "GAN Harness — Generator agent. Implements features according to the spec, reads evaluator feedback, and iterates until quality threshold is met." tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +model: sonnet color: green --- diff --git a/docs/zh-CN/agents/gan-planner.md b/docs/zh-CN/agents/gan-planner.md index f08c015fc..ceb3dbe1b 100644 --- a/docs/zh-CN/agents/gan-planner.md +++ b/docs/zh-CN/agents/gan-planner.md @@ -2,7 +2,7 @@ name: gan-planner description: "GAN Harness — Planner agent. Expands a one-line prompt into a full product specification with features, sprints, evaluation criteria, and design direction." tools: ["Read", "Write", "Grep", "Glob"] -model: opus +model: sonnet color: purple --- diff --git a/docs/zh-CN/agents/opensource-forker.md b/docs/zh-CN/agents/opensource-forker.md index c8f3e1fca..122ed9a76 100644 --- a/docs/zh-CN/agents/opensource-forker.md +++ b/docs/zh-CN/agents/opensource-forker.md @@ -2,7 +2,7 @@ name: opensource-forker description: 分叉任何项目以进行开源。复制文件,剥离机密和凭据(20多种模式),用占位符替换内部引用,生成.env.example,并清理git历史。这是opensource-pipeline技能的第一阶段。 tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: sonnet +model: haiku --- # 开源分叉工具 diff --git a/docs/zh-CN/agents/opensource-packager.md b/docs/zh-CN/agents/opensource-packager.md index 480247b33..c3b091774 100644 --- a/docs/zh-CN/agents/opensource-packager.md +++ b/docs/zh-CN/agents/opensource-packager.md @@ -2,7 +2,7 @@ name: opensource-packager description: 为经过清理的项目生成完整的开源打包文件。生成 CLAUDE.md、setup.sh、README.md、LICENSE、CONTRIBUTING.md 和 GitHub 问题模板。使任何仓库都能立即与 Claude Code 配合使用。这是 opensource-pipeline 技能的第三阶段。 tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: sonnet +model: haiku --- # 开源打包工具 diff --git a/docs/zh-CN/agents/security-reviewer.md b/docs/zh-CN/agents/security-reviewer.md index f2067a56c..75f0bdd6d 100644 --- a/docs/zh-CN/agents/security-reviewer.md +++ b/docs/zh-CN/agents/security-reviewer.md @@ -1,7 +1,7 @@ --- name: security-reviewer description: 安全漏洞检测与修复专家。在编写处理用户输入、身份验证、API端点或敏感数据的代码后主动使用。标记密钥、SSRF、注入、不安全的加密以及OWASP Top 10漏洞。 -tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] +tools: ["Read", "Grep", "Glob", "Bash"] model: sonnet --- diff --git a/docs/zh-CN/agents/seo-specialist.md b/docs/zh-CN/agents/seo-specialist.md index e1625f769..9b220ebb8 100644 --- a/docs/zh-CN/agents/seo-specialist.md +++ b/docs/zh-CN/agents/seo-specialist.md @@ -1,7 +1,7 @@ --- name: seo-specialist description: SEO专家,负责技术SEO审计、页面优化、结构化数据、核心网页指标以及内容/关键词映射。用于网站审计、元标签审查、架构标记、站点地图和robots问题以及SEO修复计划。 -tools: ["Read", "Grep", "Glob", "Bash", "WebSearch", "WebFetch"] +tools: ["Read", "Grep", "Glob", "WebSearch", "WebFetch"] model: sonnet --- diff --git a/docs/zh-TW/agents/build-error-resolver.md b/docs/zh-TW/agents/build-error-resolver.md index 412479019..9aca9d21f 100644 --- a/docs/zh-TW/agents/build-error-resolver.md +++ b/docs/zh-TW/agents/build-error-resolver.md @@ -2,7 +2,7 @@ name: build-error-resolver description: Build and TypeScript error resolution specialist. Use PROACTIVELY when build fails or type errors occur. Fixes build/type errors only with minimal diffs, no architectural edits. Focuses on getting the build green quickly. tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +model: sonnet --- # 建置錯誤解決專家 diff --git a/docs/zh-TW/agents/code-reviewer.md b/docs/zh-TW/agents/code-reviewer.md index 2a732d0d8..fa8aaeb10 100644 --- a/docs/zh-TW/agents/code-reviewer.md +++ b/docs/zh-TW/agents/code-reviewer.md @@ -2,7 +2,7 @@ name: code-reviewer description: Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code. MUST BE USED for all code changes. tools: ["Read", "Grep", "Glob", "Bash"] -model: opus +model: sonnet --- 您是一位資深程式碼審查員,確保程式碼品質和安全性的高標準。 diff --git a/docs/zh-TW/agents/database-reviewer.md b/docs/zh-TW/agents/database-reviewer.md index 1e8c2ad71..8e8e8a734 100644 --- a/docs/zh-TW/agents/database-reviewer.md +++ b/docs/zh-TW/agents/database-reviewer.md @@ -1,8 +1,8 @@ --- name: database-reviewer description: PostgreSQL database specialist for query optimization, schema design, security, and performance. Use PROACTIVELY when writing SQL, creating migrations, designing schemas, or troubleshooting database performance. Incorporates Supabase best practices. -tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +tools: ["Read", "Grep", "Glob", "Bash"] +model: sonnet --- # 資料庫審查員 diff --git a/docs/zh-TW/agents/doc-updater.md b/docs/zh-TW/agents/doc-updater.md index c2df8b51a..13c4054ed 100644 --- a/docs/zh-TW/agents/doc-updater.md +++ b/docs/zh-TW/agents/doc-updater.md @@ -2,7 +2,7 @@ name: doc-updater description: Documentation and codemap specialist. Use PROACTIVELY for updating codemaps and documentation. Runs /update-codemaps and /update-docs, generates docs/CODEMAPS/*, updates READMEs and guides. tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +model: haiku --- # 文件與程式碼地圖專家 diff --git a/docs/zh-TW/agents/e2e-runner.md b/docs/zh-TW/agents/e2e-runner.md index a88b0c1e3..037889b1f 100644 --- a/docs/zh-TW/agents/e2e-runner.md +++ b/docs/zh-TW/agents/e2e-runner.md @@ -2,7 +2,7 @@ name: e2e-runner description: End-to-end testing specialist using Vercel Agent Browser (preferred) with Playwright fallback. Use PROACTIVELY for generating, maintaining, and running E2E tests. Manages test journeys, quarantines flaky tests, uploads artifacts (screenshots, videos, traces), and ensures critical user flows work. tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +model: sonnet --- # E2E 測試執行器 diff --git a/docs/zh-TW/agents/go-build-resolver.md b/docs/zh-TW/agents/go-build-resolver.md index 217b7bdcc..91361d6c8 100644 --- a/docs/zh-TW/agents/go-build-resolver.md +++ b/docs/zh-TW/agents/go-build-resolver.md @@ -2,7 +2,7 @@ name: go-build-resolver description: Go build, vet, and compilation error resolution specialist. Fixes build errors, go vet issues, and linter warnings with minimal changes. Use when Go builds fail. tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +model: sonnet --- # Go 建置錯誤解決專家 diff --git a/docs/zh-TW/agents/go-reviewer.md b/docs/zh-TW/agents/go-reviewer.md index b6a96b880..2e0af2d4a 100644 --- a/docs/zh-TW/agents/go-reviewer.md +++ b/docs/zh-TW/agents/go-reviewer.md @@ -2,7 +2,7 @@ name: go-reviewer description: Expert Go code reviewer specializing in idiomatic Go, concurrency patterns, error handling, and performance. Use for all Go code changes. MUST BE USED for Go projects. tools: ["Read", "Grep", "Glob", "Bash"] -model: opus +model: sonnet --- 您是一位資深 Go 程式碼審查員,確保慣用 Go 和最佳實務的高標準。 diff --git a/docs/zh-TW/agents/refactor-cleaner.md b/docs/zh-TW/agents/refactor-cleaner.md index b5f3a9154..02f5c0255 100644 --- a/docs/zh-TW/agents/refactor-cleaner.md +++ b/docs/zh-TW/agents/refactor-cleaner.md @@ -2,7 +2,7 @@ name: refactor-cleaner description: Dead code cleanup and consolidation specialist. Use PROACTIVELY for removing unused code, duplicates, and refactoring. Runs analysis tools (knip, depcheck, ts-prune) to identify dead code and safely removes it. tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +model: sonnet --- # 重構與無用程式碼清理專家 diff --git a/docs/zh-TW/agents/security-reviewer.md b/docs/zh-TW/agents/security-reviewer.md index 4acd77f6c..0b6255d44 100644 --- a/docs/zh-TW/agents/security-reviewer.md +++ b/docs/zh-TW/agents/security-reviewer.md @@ -1,8 +1,8 @@ --- name: security-reviewer description: Security vulnerability detection and remediation specialist. Use PROACTIVELY after writing code that handles user input, authentication, API endpoints, or sensitive data. Flags secrets, SSRF, injection, unsafe crypto, and OWASP Top 10 vulnerabilities. -tools: ["Read", "Write", "Edit", "Bash", "Grep", "Glob"] -model: opus +tools: ["Read", "Grep", "Glob", "Bash"] +model: sonnet --- # 安全性審查員 diff --git a/docs/zh-TW/agents/tdd-guide.md b/docs/zh-TW/agents/tdd-guide.md index 256c2e3fc..3dbac8bfa 100644 --- a/docs/zh-TW/agents/tdd-guide.md +++ b/docs/zh-TW/agents/tdd-guide.md @@ -2,7 +2,7 @@ name: tdd-guide description: Test-Driven Development specialist enforcing write-tests-first methodology. Use PROACTIVELY when writing new features, fixing bugs, or refactoring code. Ensures 80%+ test coverage. tools: ["Read", "Write", "Edit", "Bash", "Grep"] -model: opus +model: sonnet --- 您是一位 TDD(測試驅動開發)專家,確保所有程式碼都以測試先行的方式開發,並具有全面的覆蓋率。 diff --git a/tests/ci/locale-agent-frontmatter.test.js b/tests/ci/locale-agent-frontmatter.test.js new file mode 100644 index 000000000..b2b888577 --- /dev/null +++ b/tests/ci/locale-agent-frontmatter.test.js @@ -0,0 +1,187 @@ +#!/usr/bin/env node +/** + * The translated agent docs under docs//agents/ must not contradict the + * agent that actually ships in agents/. + * + * scripts/ci/validate-agents.js only reads agents/, so the locale copies were + * unvalidated and drifted: 39 of them named a costlier model tier than + * canonical, and 15 listed a different tool set — including every locale copy + * of security-reviewer and database-reviewer, which advertised Write and Edit + * for agents that ship read-only. + * + * Only the machine-readable frontmatter is compared. Prose is translated and + * the list style differs per locale on purpose, so `tools` is compared as a + * SET, not as a string. + */ + +'use strict'; + +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); + +const REPO_ROOT = path.join(__dirname, '..', '..'); +const AGENTS_DIR = path.join(REPO_ROOT, 'agents'); +const DOCS_DIR = path.join(REPO_ROOT, 'docs'); + +function frontmatter(filePath) { + const text = fs.readFileSync(filePath, 'utf8'); + const match = /^---\r?\n([\s\S]*?)\r?\n---/.exec(text); + if (!match) return null; + const fields = {}; + for (const line of match[1].split(/\r?\n/)) { + const kv = /^([A-Za-z_-]+):[ \t]*(.*)$/.exec(line); + if (kv) fields[kv[1]] = kv[2].trim(); + } + return fields; +} + +function toolSet(raw) { + if (raw === undefined) return null; + const inner = raw.trim().replace(/^\[/, '').replace(/\]$/, ''); + return new Set( + inner + .split(',') + .map(entry => entry.trim().replace(/^["']|["']$/g, '')) + .filter(Boolean) + ); +} + +function sameSet(a, b) { + if (a === null || b === null) return a === b; + return a.size === b.size && [...a].every(item => b.has(item)); +} + +function localeAgentDirs() { + if (!fs.existsSync(DOCS_DIR)) return []; + return fs + .readdirSync(DOCS_DIR, { withFileTypes: true }) + .filter(entry => entry.isDirectory()) + .map(entry => path.join(DOCS_DIR, entry.name, 'agents')) + .filter(dir => fs.existsSync(dir)); +} + +function runTest(name, fn) { + try { + fn(); + console.log(` ✓ ${name}`); + return true; + } catch (error) { + console.log(` ✗ ${name}`); + console.error(` ${error.message}`); + return false; + } +} + +function main() { + console.log('\n=== Testing locale agent frontmatter against canonical ===\n'); + + const canonical = new Map(); + for (const file of fs.readdirSync(AGENTS_DIR).filter(f => f.endsWith('.md'))) { + const fields = frontmatter(path.join(AGENTS_DIR, file)); + if (fields) canonical.set(file, fields); + } + + const localeFiles = []; + for (const dir of localeAgentDirs()) { + for (const file of fs.readdirSync(dir).filter(f => f.endsWith('.md'))) { + if (canonical.has(file)) { + localeFiles.push({ file, filePath: path.join(dir, file) }); + } + } + } + + const rel = filePath => path.relative(REPO_ROOT, filePath).split(path.sep).join('/'); + + const tests = [ + ['there are locale agent docs to check', () => { + assert.ok(canonical.size > 0, 'no canonical agents found'); + assert.ok(localeFiles.length > 0, 'no locale agent docs found'); + }], + + ['every locale agent doc has parseable frontmatter', () => { + const bad = localeFiles + .filter(({ filePath }) => frontmatter(filePath) === null) + .map(({ filePath }) => rel(filePath)); + assert.deepStrictEqual(bad, [], `missing frontmatter:\n ${bad.join('\n ')}`); + }], + + ['locale agent docs name the same agent as canonical', () => { + const drift = []; + for (const { file, filePath } of localeFiles) { + const fields = frontmatter(filePath); + if (!fields) continue; + if (fields.name !== canonical.get(file).name) { + drift.push(`${rel(filePath)}: ${fields.name} != ${canonical.get(file).name}`); + } + } + assert.deepStrictEqual(drift, [], `name drift:\n ${drift.join('\n ')}`); + }], + + ['locale agent docs declare the canonical model tier', () => { + const drift = []; + for (const { file, filePath } of localeFiles) { + const fields = frontmatter(filePath); + if (!fields) continue; + const want = canonical.get(file).model; + if (want !== undefined && fields.model !== undefined && fields.model !== want) { + drift.push(`${rel(filePath)}: ${fields.model} != ${want}`); + } + } + assert.deepStrictEqual( + drift, + [], + `model drift (locale doc promises a different tier than ships):\n ${drift.join('\n ')}` + ); + }], + + ['locale agent docs declare the canonical tool set', () => { + const drift = []; + for (const { file, filePath } of localeFiles) { + const fields = frontmatter(filePath); + if (!fields) continue; + const want = toolSet(canonical.get(file).tools); + const have = toolSet(fields.tools); + if (want === null || have === null) continue; + if (!sameSet(want, have)) { + drift.push(`${rel(filePath)}: [${[...have]}] != [${[...want]}]`); + } + } + assert.deepStrictEqual( + drift, + [], + `tool drift (locale doc grants tools the agent does not have):\n ${drift.join('\n ')}` + ); + }], + + ['a read-only reviewer is never documented with Write or Edit', () => { + // The specific failure this file was written for: every locale copy of + // security-reviewer and database-reviewer advertised Write and Edit. + const offenders = []; + for (const { file, filePath } of localeFiles) { + const want = toolSet(canonical.get(file).tools); + if (want === null || want.has('Write') || want.has('Edit')) continue; + const fields = frontmatter(filePath); + const have = toolSet(fields && fields.tools); + if (have && (have.has('Write') || have.has('Edit'))) { + offenders.push(rel(filePath)); + } + } + assert.deepStrictEqual(offenders, [], `read-only agents documented as writable:\n ${offenders.join('\n ')}`); + }], + ]; + + let passed = 0; + let failed = 0; + for (const [name, fn] of tests) { + if (runTest(name, fn)) passed += 1; + else failed += 1; + } + + console.log(`\n Checked ${localeFiles.length} locale docs against ${canonical.size} agents`); + console.log(` Passed: ${passed}`); + console.log(` Failed: ${failed}`); + if (failed > 0) process.exit(1); +} + +main(); From 4f18d1eb87b745c3e617445293089b207e143f8b Mon Sep 17 00:00:00 2001 From: Nguyen Thanh Dat Date: Tue, 25 Aug 2026 18:04:38 +0700 Subject: [PATCH 2/4] test(locale-agents): fail on a locale doc whose agent no longer exists Review feedback on #2879: a locale file with no counterpart in `agents/` was skipped, so every other case here silently passed over it. Retiring an agent would leave its seven translations behind with nothing to compare against and nothing to report it. Collect those files while building the list and assert the collection is empty. Zero today across 199 locale docs, so this changes no current result; planting one orphan takes the file to `Passed: 6, Failed: 1` and exit 1. --- tests/ci/locale-agent-frontmatter.test.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tests/ci/locale-agent-frontmatter.test.js b/tests/ci/locale-agent-frontmatter.test.js index b2b888577..26dc92228 100644 --- a/tests/ci/locale-agent-frontmatter.test.js +++ b/tests/ci/locale-agent-frontmatter.test.js @@ -82,23 +82,34 @@ function main() { if (fields) canonical.set(file, fields); } + const rel = filePath => path.relative(REPO_ROOT, filePath).split(path.sep).join('/'); + const localeFiles = []; + const orphans = []; for (const dir of localeAgentDirs()) { for (const file of fs.readdirSync(dir).filter(f => f.endsWith('.md'))) { - if (canonical.has(file)) { - localeFiles.push({ file, filePath: path.join(dir, file) }); - } + const filePath = path.join(dir, file); + if (canonical.has(file)) localeFiles.push({ file, filePath }); + else orphans.push(rel(filePath)); } } - const rel = filePath => path.relative(REPO_ROOT, filePath).split(path.sep).join('/'); - const tests = [ ['there are locale agent docs to check', () => { assert.ok(canonical.size > 0, 'no canonical agents found'); assert.ok(localeFiles.length > 0, 'no locale agent docs found'); }], + ['no locale agent doc outlives the agent it documents', () => { + // Without this, retiring an agent leaves its translations behind and every + // other case here silently skips them — they have nothing to compare to. + assert.deepStrictEqual( + orphans, + [], + `locale docs with no agent in agents/:\n ${orphans.join('\n ')}` + ); + }], + ['every locale agent doc has parseable frontmatter', () => { const bad = localeFiles .filter(({ filePath }) => frontmatter(filePath) === null) From 5f79c39687c535f370dfa894b0bc714dce285df8 Mon Sep 17 00:00:00 2001 From: Nguyen Thanh Dat Date: Tue, 25 Aug 2026 18:34:12 +0700 Subject: [PATCH 3/4] test(locale-agents): derive the file lists instead of accumulating them Review feedback on #2879, citing rules/common/coding-style.md ("Immutability (CRITICAL): ALWAYS create new objects, NEVER mutate existing ones"). Build one list of locale entries, then derive the matched and orphaned sets from it with filter/map, and build the canonical Map the same way. Behaviour is unchanged and both mutations still fail: reintroducing the drift in one locale file gives `Passed: 4, Failed: 3`, an orphan gives `Passed: 6, Failed: 1`, both exit 1. --- tests/ci/locale-agent-frontmatter.test.js | 31 +++++++++++++---------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/tests/ci/locale-agent-frontmatter.test.js b/tests/ci/locale-agent-frontmatter.test.js index 26dc92228..454e1e002 100644 --- a/tests/ci/locale-agent-frontmatter.test.js +++ b/tests/ci/locale-agent-frontmatter.test.js @@ -76,23 +76,26 @@ function runTest(name, fn) { function main() { console.log('\n=== Testing locale agent frontmatter against canonical ===\n'); - const canonical = new Map(); - for (const file of fs.readdirSync(AGENTS_DIR).filter(f => f.endsWith('.md'))) { - const fields = frontmatter(path.join(AGENTS_DIR, file)); - if (fields) canonical.set(file, fields); - } + const canonical = new Map( + fs + .readdirSync(AGENTS_DIR) + .filter(file => file.endsWith('.md')) + .map(file => [file, frontmatter(path.join(AGENTS_DIR, file))]) + .filter(([, fields]) => fields !== null) + ); const rel = filePath => path.relative(REPO_ROOT, filePath).split(path.sep).join('/'); - const localeFiles = []; - const orphans = []; - for (const dir of localeAgentDirs()) { - for (const file of fs.readdirSync(dir).filter(f => f.endsWith('.md'))) { - const filePath = path.join(dir, file); - if (canonical.has(file)) localeFiles.push({ file, filePath }); - else orphans.push(rel(filePath)); - } - } + const localeEntries = localeAgentDirs().flatMap(dir => + fs + .readdirSync(dir) + .filter(file => file.endsWith('.md')) + .map(file => ({ file, filePath: path.join(dir, file) })) + ); + const localeFiles = localeEntries.filter(({ file }) => canonical.has(file)); + const orphans = localeEntries + .filter(({ file }) => !canonical.has(file)) + .map(({ filePath }) => rel(filePath)); const tests = [ ['there are locale agent docs to check', () => { From 787154775e5c1cf387116d36138bc83bf36ffd9d Mon Sep 17 00:00:00 2001 From: Nguyen Thanh Dat Date: Tue, 25 Aug 2026 18:35:26 +0700 Subject: [PATCH 4/4] test(locale-agents): set process.exitCode so the summary always flushes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review feedback on #2879. stdout is async when it is a pipe, which is exactly how tests/run-all.js runs these files, and process.exit() does not wait for pending writes — so exiting that way can drop the Passed:/Failed: lines the aggregator totals, defeating the point of printing them. The sibling tests/ci/ito-*-skill.test.js files already use process.exitCode. Still exits 1 on drift and 0 when clean. --- tests/ci/locale-agent-frontmatter.test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/ci/locale-agent-frontmatter.test.js b/tests/ci/locale-agent-frontmatter.test.js index 454e1e002..83ba42ec3 100644 --- a/tests/ci/locale-agent-frontmatter.test.js +++ b/tests/ci/locale-agent-frontmatter.test.js @@ -195,7 +195,10 @@ function main() { console.log(`\n Checked ${localeFiles.length} locale docs against ${canonical.size} agents`); console.log(` Passed: ${passed}`); console.log(` Failed: ${failed}`); - if (failed > 0) process.exit(1); + // exitCode, not exit(1): stdout is async when it is a pipe, which is how + // tests/run-all.js runs this, and process.exit() does not wait for pending + // writes — it could drop the two lines above, which the aggregator totals. + if (failed > 0) process.exitCode = 1; } main();