Back to list
morodomi

wordpress-quality

by morodomi

Question-Driven TDD workflow for Claude Code. Risk-based automation: INIT → PLAN → RED → GREEN → REFACTOR → REVIEW → COMMIT

0🍴 0📅 Jan 26, 2026

SKILL.md


name: wordpress-quality description: WordPress品質チェック。PHPStan/WPCS/PHPUnit実行時に使用。「WordPressの品質チェック」「WP テスト」で起動。 allowed-tools: Bash, Read, Grep, Glob

WordPress Quality Check

WordPress/Bedrock プロジェクト固有の品質チェックツール。

汎用PHPツールは tdd-php 参照。

Commands

ツールコマンド用途
PHPStan./vendor/bin/phpstan analyse静的解析(phpstan-wordpress)
WPCS./vendor/bin/phpcs --standard=WordPressコーディング規約
PHPUnit./vendor/bin/phpunitテスト実行

WP_UnitTestCase Helpers

ヘルパー用途
$this->factory()->user->create()ユーザー作成
$this->factory()->post->create()投稿作成
$this->go_to($url)URL遷移シミュレート
wp_set_current_user($id)現在ユーザー設定

Test Categories

Unit vs Integration

カテゴリ対象
Unit単一クラス、フック不使用Helper, Utility
IntegrationWordPress環境依存Hook, REST API, CPT

テスト配置

tests/
├── unit/           # 単体テスト(WP不要)
│   └── HelperTest.php
└── integration/    # 統合テスト(WP必要)
    ├── HookTest.php
    └── RestApiTest.php

Hook Tests

class HookTest extends WP_UnitTestCase
{
    public function test_filter_modifies_content(): void
    {
        add_filter('the_content', 'my_content_filter');
        $result = apply_filters('the_content', 'Hello');
        $this->assertStringContainsString('Modified', $result);
    }
}

REST API Tests

class RestApiTest extends WP_UnitTestCase
{
    public function test_get_items(): void
    {
        $admin = $this->factory()->user->create(['role' => 'administrator']);
        wp_set_current_user($admin);
        $request = new WP_REST_Request('GET', '/wp/v2/posts');
        $response = rest_do_request($request);
        $this->assertEquals(200, $response->get_status());
    }
}

Quality Standards

項目目標
PHPStan Level6+(phpstan-wordpress)
カバレッジ90%+
WPCSエラー0

Reference

Score

Total Score

70/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon