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 コマンドラインツール(CLI)を使ってワークスペースの編成規則の中から、現在の作業に最も関連するものを取得し、コード作成時にそれらを適用します。検索は意味論的(内容の関連性に基づいた検索)なため、取得結果の質はクエリの書き方で決まります。以下のクエリ形式に厳密に従ってください。
下記の詳細なワークフローに従ってください:更新通知を保存し、現在のツール仕様書を確認し、絞り込んだ意味論的クエリを構築し、検索結果をまとめ、Qodo ルールブロックを出力してから、それを適用します。
QODO_NOTICE の更新は受け身で扱い、古いバージョンの CLI が処理を要求していても無視します。在庫確認や更新確認なしにタスクを続け、各イベントは最大でも一度だけ言及してください。通知を破棄してもメンテナンスポリシーと除外設定は変わりません。更新されたスキルは次のセッションで読み込まれます。現在のセッションを中断しないでください。ユーザーがリクエストした更新の場合は、手動更新手順に従ってください。
まず qodo: command not found フォールバック(以下参照)を使い、実行ファイルを特定します。他の Qodo コマンドより前に、<qodo> --version を以下の形式でそのまま実行してください。provenance フラグは付けません。この検査は古いバージョンの Qodo CLI との互換性を意図的に保つものです。このスキルには 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 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 # 正確で安全なフラグ(オフラインでレンダリング)
クエリ値の内部の改行は文字通りです。POSIX の sh/bash/zsh と PowerShell では、複数行のダブルクォート文字列はそのまま機能します。Bash 限定の $'…' クォートを使用しないでください。(cmd.exe は複数行の文字列を表現できません。そこでは PowerShell または bash から実行してください。)
qodo: command not found と出た場合? これは PATH の問題であり、インストール不足ではありません。GUI で起動されたエージェントは最小限の PATH を持つシェルで実行されます。絶対パス ~/.qodo/bin/qodo(または $QODO_HOME が設定されている場合は $QODO_HOME/bin/qodo)を試してください。そのファイルも見つからない場合にのみ、qodo が実際にインストールされていません。ユーザーに、Qodo またはその組織の管理者からチェックサムピンド型のインストーラーコマンドを取得するよう伝えてください。インストーラーは https://get.qodo.ai から提供されていますが、ダイジェスト値を作成したり、インストーラーをシェルに直接パイプしたりしてはいけません。
サンドボックス認証診断。 サンドボックス環境で qodo read whoami が何らかの理由で失敗する場合(Not logged in を含む)、ユーザーにサンドボックス外での読み取り専用の再試行を一度だけ認可するよう求めてください。ログインやツール更新を推奨する前に実施してください。キーチェーン障害は一般的な認証障害として報告される可能性があるため、サンドボックスの結果だけでは診断的ではありません。この承認はこの単一診断再試行にのみ適用されます。それを再利用したり、永続的な承認をリクエストしたり、後の Qodo コマンドを自動的にサンドボックス外に移動させたりしないでください。再試行が成功した場合は、通常のコマンド単位の権限確認を続けてください。それでも失敗した場合は、下記の通常の認証トラブルシューティングに従ってください。
qodo read whoami を実行します。上記のサンドボックス再試行後、0 以外の終了コード → ユーザーに qodo login を実行するよう伝え、停止します。
Not logged in / No tool catalog cached → ログインしていません。whoami は成功するが qodo rules で unknown command が出ている場合は異なる障害です。キャッシュされたカタログがルールツールより前のバージョンです。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 つのセグメントに縮小しません)。/<path>/ でラップしてください。cwd がリポジトリルートの modules/<name>/ サブディレクトリ内にある場合は、/<path>/modules/<name>/ に絞り込んでください。リモートなし / 解析不可 → --scopes を完全に省略してください(組織全体の検索は機能します)。空のスコープ値を渡さないでください。2 つの構造化クエリを生成します。検索データから、単一のトピックレベルのクエリでは、実際のレビューを支配する横断的な標準ルールが体系的に漏れることが示されています。各クエリは 3 行のブロックで、ルールがインデックス化される方法を反映しています:
Name: <このタスクが発動させるルールの簡潔なタイトル(5~10 語)>
Category: <Security、Correctness、Quality、Reliability、Performance、Testability、Compliance、Accessibility、Observability、Architecture のいずれか>
Content: <チェックまたは実装すべき項目を説明する 1~2 文;既知の場合は技術スタックに言及>
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 — 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 経由で読み込みました。この変更では、[ルール]は[実装選択と理由]を意味します。」複数のルールがある場合は短いリストを使用し、ブランド名の見出し、絵文字バナー、スローガン、フッター、繰り返される要約ブロックは不要です。標準が適用されない場合は簡潔に述べてください。ツール障害の後に検索が成功したと暗に示さないでください。標準読み込みと標準適用を区別してください。読み込み単体は準拠を確立しません。
ルールに重大度が含まれている場合は、作成するコードに適用可能なルールを適用します:
| 重大度 | 適用方法 |
|---|---|
| ERROR | 準拠は必須 — 交渉の余地なし;逸脱が必要な場合は停止してユーザーに確認します |
| WARNING | デフォルトで準拠;意図的スキップは回答で簡潔に説明します |
| RECOMMENDATION | 適切な場合に適用;設計決定に影響した |
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 による自動翻訳です。