Communityコーディング&開発github.com

umairmsm/wp-build

wp-site-kit WordPressビルドのステージ3 - ローカルDDEVサイト、コア必須プラグイン(モジュール)、プレゼンテーション専用子テーマとスキン、コンテンツモデル(カスタム投稿タイプ、メタ、WP_Query、レンダリング関数)、リードを保存して転送する問い合わせパイプライン。wp-site-kitサイトで機能、テンプレート、コンテンツタイプ、フォーム、プラグインモジュールを構築・変更するときに使用します。

wp-build とは?

このスキルは、wp-site-kitプロジェクトにおけるWordPressサイト構築プロセスの第3ステージです。主な目的は、ローカルDDEV環境でサイトを稼働させ、コアプラグインを通じて実際のコンテンツアイテムをレンダリングし、問い合わせデータを保存・転送・削除するパイプラインを構築することです。開発者はこのスキルに従って、ローカル環境のセットアップ確認、サンプルコンテンツタイプのリネーム、カスタムフィールドの登録、データファイルからWP-CLIスクリプトによる投稿生成、テンプレートからコア機能の呼び出し、問い合わせモジュールの実装、ポリシーテキストの一元管理、新しいモジュールの追加などを行います。各ステップには明確なゲート条件が設けられており、サイトが本番環境と誤認されるのを防ぎ、構造テストとPHPコードスタイルチェックをパスすることが求められます。このスキルはClaude Codeやその他の開発エージェントがwp-site-kitベースのサイトを構築・拡張する際に使用し、ベストプラクティスに沿った堅牢なWordPress開発を支援します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/umairmsm/wp-site-kit/tree/HEAD/skills/wp-build

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

ステージ3: ビルド

目標: サイトがローカルで動作する。実際のアイテムがコア機能を通じてレンダリングされる。問い合わせが保存、転送、そしてパージされる。構造テストが全てパスする。

最初に読むもの: プロジェクトの AGENTS.md、次に references/architecture.md。

手順

  1. ローカルサイト。 プロジェクトの README.md、「初回起動」セクションに従う。その後確認: ddev wp eval 'echo wp_get_environment_type();' が local と出力される必要がある。 出力されない場合は references/local-env.md を参照。local と出力されるまで、サイトは本番環境と認識されるため、インデックスされたり実際の顧客にメールを送信したりする可能性がある。
  2. サンプルコンテンツタイプのリネーム。 コンテンツが存在する前に行う。<prefix>_offer をビジネス用語(ツアー、サービス、コース)に変更する: modules/content.php 内の投稿タイプ、リライトスラッグ、ラベル、さらに関数名(_get_offers、_render_offer_card)、parts/offer-card.php ファイル、テスト。投稿タイプ名は20文字制限がある。
  3. コンテンツのモデリング。 概要に必要なすべてのフィールドを見つける。各フィールドをサニタイズコールバックと認証コールバック付きの投稿メタとして登録する。価格はメタ内の数値。0は「要問い合わせ」を意味し、「無料」ではない。編集者がよりリッチなフィールド画面を必要とする場合は、その上にACF(無料版)を追加するが、値はコア機能を通じてのみ読み取る。
  4. データファイル → ジェネレーター(所有者が多数のアイテムを提供する場合):
    • docs/data/<type>/ にアイテムごとに1つのMarkdownまたはJSONファイルを保持する。
    • それらのファイルから投稿を作成または更新する冪等なWP-CLIスクリプトを作成する。
    • --dry-run オプションを付ける。
    • ddev wp eval-file - < scripts/<name>.php で実行する。 ファイルがレビュー可能な真実であり、DBはそのコピーである。
  5. テンプレートはセクションごとに1つのコア関数を呼び出す。
    • レイアウトはテーマに存在する: テンプレート、parts/、スキンオーバーライド。
    • データ、クエリ、価格、ポリシー文、フォームはコアから取得する。
    • 各呼び出しを function_exists() でガードし、プラグインがない場合にテンプレートが致命的エラーを起こさないようにする。
  6. 問い合わせ。 パイプラインを modules/enquiry.php に保持する(references/forms-and-leads.md)。
    • フィールドを3か所で同時に追加する: フォーム、ハンドラー、詳細ボックス。
    • 受信ボックスと送信者を wp-config.php の定数に設定し、コード内には決して記述しない。
  7. ポリシーテキスト(利用規約、デポジット、キャンセル): コアに1つの関数として配置する(例: <prefix>_policy( 'cancellation' ))。テンプレートはその関数を出力し、テンプレートがポリシー文をハードコードするとテストが失敗する。
  8. 新しいモジュール? modules/ に1ファイル、ブートストラップに1行の require_once を追加し、同じコミットで tests/structure/core.spec.ts を更新する。
  9. チェックとコミット。
    • npm run test:structure と npm run lint:php(エラー0)を実行する。
    • wp-rules-reviewer エージェントに差分をレビューしてもらう。
    • コミットする(Conventional Commits)。

ゲート(SITE_STATUS.md でチェック)

  • wp_get_environment_type() = local
  • コアプラグインと子テーマが有効、スキンが読み込まれている
  • 実際のアイテムがコア機能を通じてレンダリングされている、カード、価格、スラッグがハードコードされていない
  • 問い合わせ: 保存 → メール送信 → 再試行 → パージ、Mailpitでエンドツーエンドテスト済み
  • 構造テストがパス、PHPCSエラー0

禁止事項

  • ビジネスロジック、WP_Query、価格、pll_* 呼び出し、ポリシーテキストをテーマに記述すること。
  • wp_unslash + サニタイズ関数なしで生の $_POST や $_GET を使用すること、esc_* なしで出力すること。
  • サードパーティのAPIキーやエンドポイントをHTMLやJSに記述すること。サーバーから転送すること。
  • 生の wp option update でプラグインモジュールを切り替えること。プラグイン独自のUIまたはCLIを使用し、影響を受けるすべてのページを再確認すること。
  • プリフィックスなしの関数、オプション、フック、メタキー、nonce。

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

umairmsm/wp-content

Stage 4 of a wp-site-kit WordPress build - real copy and photos. Content truth (facts only from the owner), AI drafts and owner approval, claims audits, banned words and fake proof, legal pages, the photo pipeline (dedupe, real-only, EXIF strip, WebP sizes, alt text, AI image register), and recorded content changes. Use for "write the copy", "add photos", "the owner sent new photos", "check for duplicates", "update prices or text on the live site", "legal pages".

umairmsm/wp-design

Stage 2 of a wp-site-kit WordPress build - design direction, a static HTML/CSS prototype with design tokens, owner sign-off with screenshots, self-hosted fonts, and porting the approved look into a swappable WordPress skin. Use for "design the site", "new look", "redesign", "change colours or fonts", "make a new skin", "port the prototype to WordPress".

umairmsm/wp-kickoff

Stage 1 of a wp-site-kit WordPress build. Use when starting a new WordPress website or taking over or rebuilding an existing one - discovery brief, stack decision, creating the project with bin/wp-site-new, locked decisions, private repo and credentials inventory. Triggers - "new WordPress site", "start a client website", "rebuild this site", "take over this WordPress site".

umairmsm/wp-operate

Stage 8 of a wp-site-kit WordPress build and everything after launch - backups with an off-machine copy, restore drills, the disaster-recovery runbook, credentials inventory, update policy, alerts, and working from more than one machine (bridge file, workstation doctor, encrypted state bundle, rescuing unpushed work). Use for "backup", "restore", "move to a new machine/server", "update plugins", "what if the server dies", "work from the cloud box", "set up a second machine".

umairmsm/wp-seo

Stage 5 of a wp-site-kit WordPress build - titles and descriptions, canonical URLs, one schema owner and JSON-LD, sitemaps, robots.txt and llms.txt, AI crawler access, redirects (301 vs 302), legacy URL maps, Search Console, and adding languages one pilot at a time with Polylang (hreflang, .po/.mo strings, native review). Use for "SEO", "schema", "redirect", "old URLs", "translate the site", "add French/Spanish", "hreflang", "canonical".

umairmsm/wp-ship

Stage 7 of a wp-site-kit WordPress build - staging behind Cloudflare Access, server hardening, safe deploys from a commit (scripts/deploy-safe.sh), database content changes, the launch audit, DNS cutover without breaking a running business, and the first week after launch. Use for "deploy", "set up staging", "go live", "launch", "cutover", "move DNS", "harden the server".

umairmsm/wp-site

Start here for any WordPress website built with wp-site-kit, from an empty folder to a live site. Use when someone says "build a WordPress site", "new website for a client", "where are we on the site", "what is next before launch", or asks to continue a site project. Finds the current stage from SITE_STATUS.md, applies the hard rules, and hands over to the right stage skill.

関連スキル