wp-guard
できること
このエージェントは、WordPressのプラグイン、テーマ、ブロックのコードを、セキュリティ、翻訳対応、パフォーマンス、APIの正しい使い方の観点からチェックします。AIが生成したコードで起こりがちな問題を未然に防ぐのに役立ちます。
使う場面
- ✓AIエージェントがWordPressのコードを生成または変更した後。
- ✓新しいWordPressプラグインやテーマを公開する前。
- ✓既存のコードを確認して、セキュリティや翻訳上の問題を見つけたいとき。
スキルのリンク
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/wp-guard/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このWordPressプラグインのコードを確認して、安全に動作し、翻訳に対応できているか調べてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、コードに既知の脆弱性がないかを分析します。たとえば、セキュリティ保護の不足、翻訳されるべき英語の文字列の直接記述、不適切なデータベースクエリなどが対象です。見つかった問題について、修正案も提案します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
⚠️ AUTHORIZED USE ONLY This skill is for educational purposes or authorized security assessments only. You must have explicit, written permission from the system owner before using this tool. Misuse of this tool is illegal and strictly prohibited.
Mandatory confirmation gate Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:
- Ask the user to state the exact target URL, IP, account, or resource.
- Ask the user to confirm written authorization and the permitted scope.
- Show the exact command(s) and explain their expected effect.
- Wait for explicit confirmation in the current conversation.
Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.
WP Guard
[!WARNING] Authorized Use Only. Review only WordPress code and environments the user owns or is explicitly authorized to assess. Keep checks non-destructive and inside the approved scope.
You are reviewing generated or changed WordPress code before it ships. Apply the rules below as a guard pass after the first implementation pass. Be a sharp reviewer, not a pedantic one: flag what creates vulnerabilities, breaks translations, or melts servers — ignore cosmetic preferences WPCS tooling already handles.
These rules exist because AI agents produce WordPress code with systematic failures: raw echo of request data, AJAX handlers with neither nonce nor capability check, SQL built by string interpolation, English hardcoded into user-facing strings, posts_per_page => -1 on sites with a million posts, and hand-rolled replacements for APIs core already ships. Each one looks fine in a demo and fails in production.
When to Use
Use this skill when reviewing generated or changed WordPress code — plugins, themes, and blocks — before it ships. Activate it reactively after an agent writes, edits, or reviews code touching WordPress APIs: hooks, custom post types, REST endpoints, database queries, and block editor integrations.
How to use this skill
Guard-pass mode (recommended): after WordPress code has been generated or edited, apply the rules to the diff or target files, then run the self-check before delivery. Fix violations before showing the user.
Live mode (explicit): when the user invokes this skill before writing WordPress code, apply the same rules while writing, then run the self-check before delivery.
Review mode (the user asks you to review, audit, or rate WordPress code): walk references/review-checklist.md against the target files and produce a structured findings report. Do not edit code in review mode unless asked.
Pair this skill with clean-code-guard when both are installed: clean-code-guard owns generic code quality; wp-guard owns the WordPress layer.
Adapt to the project first
- Read the project's agent instructions (CLAUDE.md, AGENTS.md),
phpcs.xml/WPCS config, andcomposer.json. Project conventions win on conflict. - Identify the established prefix (functions, options, meta keys, handles) and the minimum supported WP/PHP versions. Match both.
- Detect context: WooCommerce APIs in play → apply woo-guard alongside this skill when it is installed; otherwise apply WooCommerce's HPOS, CRUD, and checkout rules from its developer documentation. Multilingual site (WPML/Polylang/multisite) → i18n rules are blocking, not advisory.
- Read one neighboring file before writing. Mirror its error handling, hook registration style, and escaping habits — unless they violate the security rules below, which are non-negotiable.
The Rules
Security — must fix, no exceptions
- Escape late, escape everything. Every variable crossing into HTML output goes through the context-correct function:
esc_html(),esc_attr(),esc_url(), orwp_kses()/wp_kses_post()for rich content. Data passed to inline JS goes throughwp_json_encode()+wp_add_inline_script()—esc_js()is legacy, for single-quoted strings in inline attributes only. Escaping happens at output, not at storage.echo $anything;without anesc_*wrapper fails review.
…
よくある質問
このツールを使うのに許可が必要なのはなぜですか?
このツールは強力で、脆弱性の発見に使えます。法的・倫理的な問題を避けるため、自分が所有している、または明示的にテストの許可を得ているシステムにのみ使うことが大切です。
「ノンス」と「権限チェック」とは何ですか?
どちらもWordPressのセキュリティ機能です。「ノンス」は、リクエストが意図したユーザーから送られたもので、改ざんされていないことを確認する仕組みです。「権限チェック」は、そのユーザーに要求された操作を実行する権限があるかどうかを確認します。
データを「エスケープ」や「サニタイズ」するとはどういう意味ですか?
「サニタイズ」は、入力されたデータから危険または不正な文字を取り除いて整えることです。「エスケープ」は、データを出力する前に整形し、HTMLやJavaScriptなどの悪意あるコードとして解釈されないようにすることです。
詳細
作者による元の説明
Review generated or changed WordPress plugins, themes, and blocks for security, internationalization, performance, and API correctness.
人気
- GitHubのスター
- 48k
- ランキング
- #6205
- ライセンス
- MIT
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
00-andruia-consultant
48kエージェントがAIプロジェクトの立ち上げや改善を支援します。コードを分析し、ツールを提案し、スペイン語で行動計画を作成します。
007
48kエージェントがセキュリティ監査と脅威モデリングを行えるようにします。攻撃や脆弱性からプロジェクトを守るのに役立ちます。
10-andruia-skill-smith
48kエージェントがAIツールの作成や改善を支援します。ツールの動作を定義し、ドキュメントを書き、構造を検証します。
20-andruia-niche-intelligence
48kエージェントが特定の業界に関する要約を作成できるようにします。信頼できる情報源を使って、プロジェクトの背景、ルール、利用パターン、リスクを把握するのに役立ちます。
似ているスキル
test-driven-development
311k機能や修正を作る前に、まず失敗するテストを書き、それが失敗するのを確認してから、合格させる最小のコードを書くようエージェントに教えます。
verification-before-completion
311kタスク、修正、ビルドが完了した、または合格したと主張する前に、実際のチェックを実行し、その出力を読むようエージェントに教えます。
migrate-to-shoehorn
310kテストファイル内の危険な型キャストを、shoehornライブラリに置き換え、テストが部分的なデータを使いつつ型チェックを通るようにします。