Qodoから現在のコーディング作業に最も関連するコーディング規則を読み込みます。Qodoの CLI(コマンドラインツール)が提供する規則検索機能を使って、タスクから構造化された意味的な検索条件を生成し、ワークスペース内で関連性の高い規則を抽出してランク付けし、コード作成時に適用します。 **次のような場合に使用:** - ユーザーがコードの作成、編集、リファクタリング(既存コードの整理・改善)、またはレビューを依頼したとき - 実装計画の開始段階 - 「ルールを取得」「Qodoルールを読み込む」「コーディング規則を取得」「関連する規則」「規則を検索」などのコマンドが入力されたとき ※ この会話内で規則が既に読み込まれている場合はスキップされます。
Load the coding rules from Qodo most relevant to the current coding task, using the qodo CLI's managed rules search — generate structured semantic queries from the assignment, retrieve the workspace's matching rules ranked by relevance, and apply them while writing the code. Use when the user asks to write, edit, refactor, or review code, when starting implementation planning, or on "get rules", "load qodo rules", "fetch coding rules", "relevant rules", "search rules"; skip if rules are already loaded in this conversation.
qodo コマンドラインツールを使用して、目前のタスクに最も関連する自分たちのチーム内のコード規則を取得し、その規則を適用しながらコードを作成します。取得は意味的(検索意図を理解した検索)な方式です。返ってくるルールの質は、クエリの書き方で決まるため、以下のクエリ形式を厳密に守ってください。
以下の詳細なワークフローに従ってください。アップデート通知を保持し、現在のツール契約を確認し、焦点を絞ったクエリを構築し、検索結果をまとめ、Qodo ルールブロックを表示してから適用します。
Qodo コマンドは標準エラー出力に QODO_NOTICE <json> を出力して成功することがあります。code が qodo_skill_update_available の場合、コマンドの結果を保持して現在のタスクを完了します。その後、通知の steps に従ってください。まず読み取り専用のインベントリ(現状把握)を実施し、インストール済みの Qodo パッケージとスコープを解決し、ライフサイクルオーナー(パッケージの管理者)が指定するアップデートコマンドまたはUI操作を表示し、変更前に一度だけユーザーに確認します。ユーザーが拒否した場合、現在のバージョンを使用可能な状態に保ちます。
異なるライフサイクルオーナーを呼び出したり、プレースホルダを推測したり、オプションパッケージを暗黙的にインストールしてはいけません。承認されたアップデートの後、通知に記載されたホストの再起動をユーザーに要請します。現在のセッションはまだ古いスキルが読み込まれたままかもしれません。
まず、下記の「qodo: command not found フォールバック」を使用して実行ファイルを解決します。その他の Qodo コマンドを実行する前に、示された通り 余分なオプションなしで <qodo> --version を実行してください。
この余分なオプションのない確認コマンドは、意図的に古い 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.2 --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 # 正確で安全なフラグ(オフライン動作)
クエリの値内の改行はリテラル(実際の改行)です。POSIX sh/bash/zsh と PowerShell では、ダブルクォートで囲んだ複数行文字列がそのまま動作します。Bash 専用の $'…' クォートは使用しないでください。(cmd.exe は複数行文字列を表現できません。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 の読み取り専用再実行の承認を求めてから、ログイン推奨またはツール更新を勧めてください。キーチェーン障害は汎用の認証障害として報告される可能性があるため、サンドボックス内の結果だけでは診断は不十分です。その承認はこの単一の診断再実行にのみ適用されます。これを再利用したり、永続的な承認を要求したり、後の Qodo コマンドを自動的にサンドボックス外に移してはいけません。再実行が成功すれば、通常のコマンドごとの権限確認を続行します。それでも失敗した場合、通常の認証トラブルシューティングに従ってください。
qodo read whoami を実行します。適用可能な場合は上記のサンドボックス再実行後に、ゼロ以外の終了コードが返された → ユーザーに qodo login 実行を指示して停止します。
「ログインしていません」/「ツールカタログがキャッシュされていません」 → ログイン状態ではありません。whoami が成功しているのに qodo rules で「不明なコマンド」エラーが出ている → キャッシュされたカタログが 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 セグメントに縮約しないこと)。/<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: コード品質と標準準拠 / 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 Rules Loaded
ロード済みルール: **<N>** 件(タスクへの関連性でランク付け)
- **<名前>** [<SEVERITY がある場合は SEVERITY>]: <内容>
...
---
(空の結果:「このタスクに関連するルールが見つかりません。ルール制約なしで進みます。」)その後、返された全ルールをあなたが作成するコードに適用します。ルールに重大度がある場合:
| 重大度 | 適用方針 |
|---|---|
| ERROR | 準拠必須 — 譲歩不可。逸脱が必須の場合は停止してユーザーに確認 |
| WARNING | デフォルトで準拠。意図的なスキップがあれば回答で簡潔に説明 |
| **RECOMMENDATION |
Use the qodo CLI 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.
Follow the detailed workflow below: preserve update notices, verify the current tool contract, build focused semantic queries, merge ranked results, print the Qodo rules block, then apply it.
A Qodo command can emit QODO_NOTICE <json> to stderr while still succeeding. When
code is qodo_skill_update_available, keep the command's result and finish the current
task. Then follow the notice's steps: do read-only inventory first, resolve the installed
Qodo package and scope, show the exact lifecycle-owner update command or UI action, and ask
once before any mutation. If the user declines, keep the current version usable.
Never invoke a different lifecycle owner, guess a placeholder, or install an optional package implicitly. After an approved update, ask for the host restart named by the notice; the current session may still have the old skill loaded.
First 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 0.1.0-next.37 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.2 --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 and in PowerShell. Don't use Bash-only $'…'
quoting. (cmd.exe can't express multi-line strings — run the command from PowerShell or
bash there.)
qodo: command not found? That's PATH, not a missing install: GUI-launched agents run
shells with a minimal PATH. Retry with the absolute path ~/.qodo/bin/qodo (or
$QODO_HOME/bin/qodo if set) and keep using it. Only if that file is missing too is qodo
actually not installed; tell the user to obtain a checksum-pinned installer command from
Qodo or their organization's administrator. Installers are served from https://get.qodo.ai,
but never invent a digest or pipe an installer directly into a shell.
Sandbox auth diagnostic. In a sandboxed environment, if qodo read whoami fails for any reason
(including Not logged in), ask the user to approve one exact read-only retry of qodo read whoami
outside the sandbox before recommending login or refreshing tools. Keychain failures can be
reported as generic auth failures, so the sandboxed result alone is not diagnostic. That approval
applies only to this single diagnostic retry: do not reuse it, request persistent approval, or move
later Qodo commands outside the sandbox automatically. If the retry succeeds, continue with normal
per-command permission checks. If it still fails, follow the normal auth troubleshooting below.
qodo read whoami. After the sandbox retry above when applicable, a non-zero exit →
tell the user to run qodo login, then stop.
Not logged in / No tool catalog cached → not logged in. An unknown command on
qodo rules while whoami SUCCEEDS is a different failure: the cached catalog predates
the rules tool — run qodo tools --refresh and retry; only ask for qodo login when
whoami itself fails.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.Run qodo read rules search once per query (in parallel when you can), each with
--top-k 20 and --json. Add --scopes "$SCOPE" only when detection produced a scope:
# 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
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.
Print the loaded rules before writing code:
# 📋 Qodo Rules Loaded
Rules loaded: **<N>** (ranked by relevance to your task)
- **<name>** [<SEVERITY if present>]: <content>
...
---
(Empty result: "No relevant rules found for this task. Proceeding without rule constraints.") Then apply every returned rule 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 the code is written, report which rules were applied and which WARNING rules were skipped and why. If none applied, say "No Qodo rules were applicable to this code change."
Use --json, the exact scopes relevant to the task, and the current CLI-provided rules schema.
Stamp the skill/version/distribution provenance on the first Qodo call. This optional skill is
never installed or updated implicitly with the default Qodo 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 による自動翻訳です。