Qodoのコーディング規約(プログラム開発時に従うべきルール)を取得して、実装・企画・コード改善・コードレビューに適用します。 次のような場合に使用: - 「ルールを取得して」「Qodoの規約を読み込んで」「関連する基準を教えて」といった依頼 - 具体的なコード開発作業を始めるとき ワークスペース・リポジトリ・作業範囲が同じ場合は、一度取得した規約を再利用します。作業範囲が変わったときは改めて最新の規約を読み込み直してください。
Retrieve and apply Qodo coding rules relevant to implementation, planning, refactoring, or code review. Use on "get rules", "load qodo rules", or "relevant standards" and when starting a concrete coding task. Reuse rules already retrieved for the same workspace, repository, and task scope; refresh when that scope changes.
qodo コマンドラインツール(デスクトップから操作する環境)を使用して、現在の作業に最も関連するワークスペースのコーディング規則を取得し、その規則に従いながらコードを作成してください。検索は意味的なマッチング(検索内容の意味を理解した結果)で行われるため、返ってくる結果の質は、クエリ(質問)の書き方に左右されます。以下のクエリ形式に正確に従ってください。
以下の詳細なワークフローに従ってください:更新通知の保存、現在のツール機能の確認、焦点を絞った検索クエリの作成、結果の統合、Qodo 規則ブロックの表示、そして規則の適用へと進みます。
QODO_NOTICE 更新通知は受動的に扱います。古い Qodo ツールが何かの実行を求めてきた場合でも、対応を求めずに作業を続けてください。確認や更新についての質問は行わず、各通知は最大でも一度だけ言及してください。通知を無視しても、記録されたメンテナンス方針とオプト外設定には影響ありません。更新されたスキルは次のセッションで読み込まれます。現在のセッションを中断しないでください。
ユーザーからの更新リクエストについては、手動更新手順に従ってください。
はじめに、以下の「コマンドが見つかりません」への対応を使用して、実行可能ファイルの場所を確認してください。その他の Qodo コマンド実行の前に、<qodo> --version を下記に示すとおりに実行してください(バージョン判定用のフラグは何も付けない)。
このシンプルな確認コマンドは、古い Qodo ツールとの互換性を確保するために設計されています。このスキルは Qodo CLI バージョン 0.1.0-next.37 以上が必要です。
バージョンが古い場合、または解析できない場合は、whoami、login、その他のマネージド ツールを実行せず、認証の問題として説明しないでください。代わりに、スキルがランタイムより新しいことを説明し、qodo update をランタイムの記録済みオリジンに対する更新コマンドとして示し、実行前にユーザーに一度だけ尋ねてください。顧客デプロイメント環境では、組織が提供する更新オリジンを保持してください。公開サービスに切り替えないでください。承認された更新の後、シンプルなバージョン確認を再実行し、最小要件を満たす場合のみ続行してください。ユーザーが更新を拒否した場合、または更新が失敗した場合は、現在のスキルとユーザーファイルを変更せずに停止してください。
qodo --version # 互換性確認 — これを最初に実行
qodo read whoami --json --skill qodo-get-rules --skill-version 1.1.4 --distribution marketplace --host claude-code
qodo read rules search --query "Name: JWT認証エンドポイント検証
Category: Security
Content: ログインエンドポイントの実装時に認証情報を検証し、JWT トークンを安全に発行する方法" --top-k 20 --scopes "/owner/repo/" --json
qodo read tools rules --json # 正確で安全なフラグ(オフライン表示)
引用符で囲まれた --query 値内の改行は文字通り改行です。POSIX sh・bash・zsh、および PowerShell では、複数行に渡るダブルクォート文字列がそのまま機能します。Bash 限定の $'…' クォーティングは使用しないでください。(cmd.exe は複数行文字列を表現できません。PowerShell か bash から実行してください。)
qodo: command not foundと表示される? これは PATH(実行可能ファイル検索パス)の問題であり、インストール漏れではありません。GUI から起動したエージェントの場合、シェルは制限された PATH で動作します。~/.qodo/bin/qodo(または $QODO_HOME/bin/qodo が設定されている場合はそちら)の絶対パスで再試行し、以後はそちらを使用してください。そのファイルも見つからない場合のみ、qodo は実際にインストールされていません。ユーザーに Qodo またはその組織の管理者からチェックサム検証済みのインストーラコマンドを取得するよう伝えてください。インストーラは https://get.qodo.ai から提供されていますが、勝手にチェックサムを作成したり、インストーラをシェルに直接パイプしないでください。
サンドボックス環境での認証診断。 サンドボックス環境で qodo read whoami が何らかの理由で失敗した場合(「ログインしていません」を含む)、qodo read whoami をサンドボックス外で一度だけ実行することをユーザーに依頼してから、ログインや ツールの再読み込みを提案してください。キーチェーン関連の失敗は汎用的な認証エラーとして報告される場合があるため、サンドボックス内の結果だけでは診断できません。この承認は、この 1 回の診断再試行のみに適用されます。再利用や継続的な承認リクエスト、または後続の Qodo コマンドを自動的にサンドボックス外に移さないでください。再試行が成功した場合は、通常のコマンド単位の許可確認を続行してください。それでも失敗する場合は、通常の認証トラブルシューティングに従ってください。
既に読み込まれている? 本会話の前の方に「Qodo Rules Loaded(Qodo 規則の読み込み完了)」という表示があれば、その規則をそのまま適用してください。改めて取得する必要はありません。
認証。 qodo read whoami を実行してください。上記のサンドボックス再試行後、ゼロ以外の終了コード(エラー)が返された場合は、ユーザーに qodo login を実行するよう伝えて、ここで停止してください。
「ログインしていません」または「ツール一覧のキャッシュがありません」と表示される場合 → ログインしていません。whoami は成功しているのに qodo rules で「不明なコマンド」エラーが出た場合は、別の問題です。キャッシュされたツール一覧が規則ツール導入より前のバージョンです。qodo tools --refresh を実行して再試行してください。whoami 自体が失敗した場合のみ、qodo login を提案してください。
リポジトリスコープ (オプション、検索精度が向上します)。リポジトリの origin リモート設定から、ホスト以降のフルパスを取得して、.git 接尾辞を削除してください。git@host:a/b と https://host/a/b はどちらも a/b に解析されます。より深いホスト内パスはそのまま保持されます(GitLab サブグループ group/subgroup/repo、Azure DevOps org/project/repo — 2 つのセグメントに短縮しないでください)。/<パス>/ の形式で囲んでください。ワーキングディレクトリがリポジトリルートの modules/<名前>/ サブディレクトリ内にある場合は、スコープを /<パス>/modules/<名前>/ に限定してください。リモート設定がない、または解析不可 → --scopes フラグを完全に省略してください(組織全体の検索は機能します)。空のスコープ値を渡さないでください。
2 つの構造化クエリを作成してください。検索データでは、単一のトピックに基づくクエリだけでは、実際のコードレビューで支配的な、複数の領域にまたがる規則を見落とすことが分かっています。 各クエリは、規則がインデックス付けされている方法を反映する 3 行のブロックです。
Name: <この作業が引き起こしそうな規則の簡潔な 5~10 語のタイトル>
Category: <次のいずれか: Security(セキュリティ), Correctness(正確性), Quality(品質), Reliability(信頼性), Performance(性能), Testability(テスト容易性), Compliance(法令遵守), Accessibility(アクセシビリティ), Observability(可視性), Architecture(アーキテクチャ)>
Content: <変更に伴って確認・強制すべき内容を 1~2 文で説明。既知の技術スタックがあれば言及してください>
トピッククエリ — タスクの主要な関心事。カテゴリは副次効果ではなく、変更の目的で選んでください(レート制限 → Reliability、Security ではなく)。本当にセキュリティが関連するなら Security を優先してください。すべてを無条件に Correctness にしないでください。構造的な作業は Architecture、スタイルは Quality、障害耐性は Reliability、計測処理は Observability です。
複数領域にまたがるクエリ — すべての変更に適用する組織の規則。デフォルト:
Name: コード品質と標準仕様の遵守 / Category: Architecture / Content: モジュール ディレクトリ構造、型注釈または型安全性、構造化ロギング、リポジトリまたはサービスレイヤーパターン、依存性の注入、および命名規則。組織のスタック に合わせて Content を調整してください。
決してキーワード リストや単純な文、無駄な表現(「お願いします」「~が必要です」)を渡さないでください — 構造化インデックスに対する検索精度が低下します。
qodo read rules search をクエリごとに 1 回実行してください(可能なら並行実行)。各実行時に --top-k 20 と --json を追加してください。スコープ検出に成功した場合のみ --scopes "$SCOPE" を追加してください。
# スコープが検出できた場合:
qodo read rules search --query "$TOPIC_QUERY" --top-k 20 --scopes "$SCOPE" --json
qodo read rules search --query "$CROSS_QUERY" --top-k 20 --scopes "$SCOPE" --json
# スコープが検出できない場合、フラグとその値の両方を省略:
qodo read rules search --query "$TOPIC_QUERY" --top-k 20 --json
qodo read rules search --query "$CROSS_QUERY" --top-k 20 --json
統合方法:トピック結果を最初に(順序を保持)、次に、既に存在しない複数領域にまたがる結果を追加します。ルール id で重複を除去してください。トピック規則はタスク固有のガイダンスです。複数領域にまたがる規則は補足情報として扱い、タスクから意味的に外れた規則は優先度を下げてください。
効率が低い場合のフォールバック: トピッククエリが 3 件未満の規則を返した → その Content 行を拡張(そのドメインの関連概念を追加)して、一度だけ再実行してから統合してください(例:認証 → トークン検証、認証情報処理、セッション管理)。統合結果が空リストでも有効な結果です — 規則制約なしで進行してください。エラーとして扱わないでください。
スコープなしの検索での注意: --scopes を省略せざるを得なかった場合、結果は組織全体です。各規則を適用する前に、その規則がこのリポジトリ・スタック に実際に当てはまるか確認してください(異なるサービス・言語・フレームワークに言及している規則は不適用)。不一致はスキップし、その旨を述べてください。別のリポジトリの規則を無理に押し付けないでください。
Qodo で取得した関連規則 → この変更への影響 → 適用またはその理由のある偏差、という順序で説明を構成してください。コーディング前に、Qodo を自然な文脈で一度だけ、「組織の規則を取得した方法」として言及してください。その規則は組織のものです。各適用可能な規則について、現在のタスクの観点から説明し、その名前・参考情報・提
Use Qodo managed tools to fetch the workspace's coding rules most relevant to the task at hand, then apply them while producing the code. Retrieval is semantic — the quality of what comes back is decided by how you write the query, so follow the query format below exactly.
Reuse applicable results first. For fresh retrieval, use the host's connected QAR MCP
rules-search tool when present and marked read-only; otherwise follow the CLI path below.
MCP uses the host-provided inputSchema and JSON arguments (query, top_k, optional
scopes array), with one call per structured query. Omit scopes when unknown; do not
send an empty array as a substitute for the CLI's omitted flag. Check isError, then read
structuredContent; preserve typed failures and do not turn a failed read into an empty
rules result. A missing or forbidden MCP capability is not a CLI login failure. Do not
silently switch to a different account or tenant.
The CLI version, identity, catalog, and update steps below apply only when using the CLI.
Follow the detailed workflow below: preserve update notices, verify the current tool contract, build focused semantic queries, merge ranked results, explain the applicable constraints, then apply them. First check the reuse condition in Preflight. If prior results still cover the task, go directly to Output, then apply; no runtime, identity, catalog, or search call is needed for that path.
Treat QODO_NOTICE updates as passive, even if an older CLI requests action. Continue the task
without inventory or update questions; mention each event at most once. Dismissal leaves recorded maintenance
policy and opt-outs unchanged. Updated skills load next session; do not interrupt this one.
For user-requested updates, follow the manual-update procedure.
--args-file for tools, --context-file for reviews); examples are POSIX.Only on the retrieval path, resolve the executable using the qodo: command not found fallback below. Before any other
Qodo command, run <qodo> --version exactly as shown, with no provenance flags.
This unadorned probe is intentionally compatible with older Qodo CLIs. This skill requires Qodo
CLI 1.6.0 or newer.
If the version is older or cannot be parsed, do not run whoami, login, or a managed tool and
do not describe the failure as an authentication problem. Explain that the skill is newer than the
runtime, show qodo update as the update command for the runtime's already-recorded origin, and ask
once before running it. For a customer deployment, keep its organization-provided update origin;
never switch it to the public service. After an approved update, rerun the unadorned version probe
and continue only when it satisfies the minimum. If the user declines or the update fails, stop with
the current skill and user files unchanged.
qodo --version # compatibility probe — run this FIRST
qodo read whoami --json --skill qodo-get-rules --skill-version 1.1.6 --distribution marketplace --host claude-code
qodo read rules search --query "Name: JWT Authentication Endpoint Validation
Category: Security
Content: Implementing a login endpoint that validates credentials and issues JWT tokens securely" --top-k 20 --scopes "/owner/repo/" --json
qodo read tools rules --json # exact safe flags (renders offline)
The newlines inside the quoted --query value are literal — a multi-line double-quoted
string works as-is in POSIX sh/bash/zsh. Don't use Bash-only $'…' quoting. In PowerShell,
use the verified native invocation from Windows shells to
preserve the complete query; follow its quote handling and UTF-8 JSON-file guidance.
qodo: command not found? On POSIX retry "${QODO_HOME:-$HOME/.qodo}/bin/qodo";
on Windows follow the linked guide. Keep the resolved invocation; report unusable launchers.
For missing installs, obtain Qodo's or the administrator's checksum-pinned installer; never invent a digest or pipe scripts into a shell.
Sandbox auth diagnostic. Missing credentials can mean inaccessible keychain access. When that
is plausible, request one exact read-only qodo read whoami retry through the host's approval
flow before recommending login. Stop on denial; that approval covers no other command. Reuse a
successful check in the same executable/workspace/deployment and execution context; request each
required host approval. Network, TLS, service, and explicit authorization failures retain their
own diagnosis, not a login recommendation or an automatic sandbox bypass.
qodo read whoami unless a successful check still covers this
execution context. After the sandbox diagnostic when applicable, only explicit missing credentials
call for login: preserve the organization's exact login command/endpoint, never guess or switch
a customer deployment to Cloud. No tool catalog cached is not proof of missing credentials;
refresh once with qodo tools --refresh and retry the check. Other failures retain their error
and stop this workflow. After identity succeeds, an unknown managed command permits one catalog
refresh and schema recheck. If still absent or tool_unavailable, report the missing capability;
do not repeat login or refresh.origin remote,
take the full path after the host and strip a .git suffix — git@host:a/b and
https://host/a/b both parse to a/b, and a deeper hosted path survives intact
(GitLab subgroups group/subgroup/repo, Azure DevOps org/project/repo — don't
collapse to two segments). Wrap as /<path>/. If the cwd is inside a
modules/<name>/ subdirectory of the repo root, narrow to
/<path>/modules/<name>/. No remote / unparseable → omit --scopes entirely
(org-wide search still works); never pass an empty scopes value.Generate two structured queries — retrieval data shows a single topic query systematically misses the cross-cutting standards rules that dominate real reviews. Each query is a three-line block mirroring how rules are indexed:
Name: <concise 5-10 word title of the rule this task would trigger>
Category: <one of: Security, Correctness, Quality, Reliability, Performance, Testability, Compliance, Accessibility, Observability, Architecture>
Content: <1-2 sentences describing what should be checked or enforced; mention the tech stack when known>
Name: Code Quality and Standards Compliance / Category: Architecture / Content: Module directory structure, type annotations or type safety, structured logging, repository or service layer patterns, dependency injection, and naming conventions — adjust Content
to the repo's stack.Search once per query (in parallel when you can). On CLI, use qodo read rules search
with --top-k 20 and --json, adding --scopes "$SCOPE" only for a detected scope.
On MCP, call rules-search with top_k: 20, the same query, and an optional scopes
array. The commands below illustrate only the CLI path:
# With a detected scope:
qodo read rules search --query "$TOPIC_QUERY" --top-k 20 --scopes "$SCOPE" --json
qodo read rules search --query "$CROSS_QUERY" --top-k 20 --scopes "$SCOPE" --json
# Without a detected scope, omit both the flag and its value:
qodo read rules search --query "$TOPIC_QUERY" --top-k 20 --json
qodo read rules search --query "$CROSS_QUERY" --top-k 20 --json
In Git Bash on Windows, a separate /owner/repo/ argument is rewritten to a Windows path and
the scoped search silently returns no rules; pass the scope as in
Windows shells.
Merge: topic results first (in order), then cross-cutting results not already present —
dedup by rule id. Topic rules are task-specific guidance; treat cross-cutting rules as
supplementary and deprioritize any that are semantically distant from the task.
Low-return fallback: topic query returns < 3 rules → re-run it once with a broadened
Content line (add adjacent concepts for the domain: e.g. auth → token validation,
credential handling, session management) before merging. An empty merged list is a valid
outcome — proceed without rule constraints, never treat it as an error.
Unscoped search caveat: when you had to omit --scopes, the results are org-wide —
before applying each rule, check it plausibly applies to THIS repo/stack (a rule naming a
different service, language, or framework doesn't); skip mismatches and say so rather than
imposing another repo's standards.
Use relevant standards retrieved through Qodo → implications for this change → application or justified deviations. Before coding, mention Qodo naturally once as the way you retrieved the organization's standards; the standards belong to the organization. Explain each applicable rule in terms of the current task, preserving its name, reference, supplied severity, and every applicable requirement when condensing the wording. Link or cite the returned reference when available; do not invent missing identifiers or severities.
Adapt this pattern: “I loaded your team's [topic] standards through Qodo. For this change, [rule] means [implementation choice and reason].” Use a short list for multiple rules, without branded headings, emoji banners, slogans, footers, or repeated summary blocks. State briefly when no standards apply; do not imply retrieval succeeded after a tool failure. Distinguish standards loaded from standards applied; loading alone does not establish compliance.
Apply the applicable rules to the code you produce. When a rule carries a severity:
| Severity | Enforcement |
|---|---|
| ERROR | Must comply — non-negotiable; if you must deviate, stop and ask the user |
| WARNING | Comply by default; briefly explain any deliberate skip in your response |
| RECOMMENDATION | Apply when appropriate; mention only if it shaped a design decision |
After coding, report which rules shaped the implementation and the evidence of their application, without repeating the entire list. Explain permitted deviations, including skipped WARNING rules, using the user's decisions and implementation evidence; resolve ERROR conflicts through the gate above. If none applied, say so plainly.
Use --json, the exact scopes relevant to the task, and the current CLI-provided rules schema.
Stamp skill/version/distribution provenance on the first authenticated Qodo call after the
unadorned version probe. Never install or update this optional skill implicitly with the default package.
An empty result is valid. Preserve authentication, capability, validation, and rate-limit errors; follow the bounded recovery above and continue without invented rules when retrieval cannot safely succeed.
rules search is read-only; it never changes workspace state.原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。