Php Modern Standardsのロゴ

Php Modern Standards

コミュニティ
peterbamuhigire
php-modern-standards

Use when writing or reviewing PHP 8+ applications, object-oriented domain code, Laravel services, PSR-compliant packages, secure request handling, tests, or performance-sensitive PHP.

概要

公開者peterbamuhigire
リポジトリchwezi-dev-engine
スキル名php-modern-standards
スター
29
フォーク
6
同梱ファイル
26
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 26個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    peterbamuhigireがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Php Modern Standards」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/languages/php-modern-standards
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/peterbamuhigire/chwezi-dev-engine.git /tmp/chwezi-dev-engine
mkdir -p .claude/skills
cp -r /tmp/chwezi-dev-engine/skills/languages/php-modern-standards .claude/skills/php-modern-standards
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでPhp Modern Standardsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にPhp Modern Standardsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Php Modern Standardsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

PHP Modern Standards

Acknowledgement: Shared by Peter Bamuhigire, techguypeter.com, +256 784 464178.

Use When

  • Modern PHP development standards for maintainable, testable, object-oriented code. Use when writing PHP 8+ applications, implementing OOP patterns, ensuring security, following PSR standards, optimizing performance, or building Laravel...

Workflow

  • For long-lived PHP application work, load references/world-class-php-oop-clean-architecture.md before designing controllers, services, repositories, or domain objects.
  • For containerized PHP work, pair with docker-development.
  • Pin a supported PHP branch before choosing language features. Check https://www.php.net/supported-versions.php at execution time; record the access date and branch support state rather than relying on a copied lifecycle table.
  • For a minor-branch upgrade, assess the application's PHP and extension constraints, run every intervening migration guide, validate the locked dependencies under the actual target runtime, and test the application before production cutover. Follow references/php-runtime-upgrades.md.

Evidence Produced

CategoryArtifactFormatExample
CorrectnessPHP test planMarkdown doc per skill-composition-standards/references/test-plan-template.md covering unit, integration, and contract testsdocs/php/test-plan-checkout.md
OperabilityPHP-FPM operations noteMarkdown doc covering opcache, request lifecycle, and OPcache reset proceduredocs/php/fpm-ops-note.md

References

  • Use the references/ directory for deep detail after reading the core workflow below.
  • Use the examples/ directory for concrete patterns when implementation shape matters.
  • Use references/php-runtime-upgrades.md for a staged PHP 8.5 compatibility and release procedure.

Production-grade PHP patterns for maintainable, testable, secure, high-performance applications.

Core Principle: Write type-safe, secure, performant PHP code following PSR standards with modern PHP 8+ features.

References:

  • references/performance-efficiency.md — generators, OPcache, profiling, Fibers deep dive

  • references/code-quality-tooling.md — PHPStan, Pint config, CI/CD patterns

  • references/rate-limiting.md — rate limiting patterns

  • references/message-queues.md — queue patterns

  • references/cache-invalidation.md — cache invalidation patterns

  • references/resilience-patterns.md — circuit breakers, retries

  • references/restful-api-patterns.md — cURL client, Attribute routing, JWT, API versioning, testing

  • references/database-orm-patterns.md — PDO, QueryBuilder, Active Record Model, soft delete, ORM concepts

  • references/attack-prevention.md — SQL injection, XSS, CSRF, CSP, brute force, least privilege

  • references/world-class-php-oop-clean-architecture.md — PHP 8 OOP, SOLID, clean architecture, repositories, adapters, and framework-independent domain rules

  • references/source-register-dev-engine.md — book sources (titles only) used for this development-engine upgrade

  • references/php-security.md - absorbed PHP-specific security hardening, sessions, validation, crypto, upload, and deployment guidance

  • references/php-vs-nextjs.md - absorbed PHP vs Next.js architecture decision guidance

  • references/javascript-php-integration.md - absorbed integration patterns for PHP-rendered pages and JavaScript modules Examples: examples/modern-php-patterns.php, examples/laravel-patterns.php Security: Load references/php-security.md for comprehensive security patterns.

  • Use for PHP 8+, OOP, security, testing, performance, and Laravel; do not use for legacy PHP below 7.4 or WordPress-specific work.


File Structure

php
<?php

declare(strict_types=1);

namespace App\Domain\User;

use App\Domain\Shared\ValueObject;

final readonly class User
{
    public function __construct(
        private int $id,
        private string $email,
    ) {
    }
}

Rules: Always declare(strict_types=1), one class per file, namespace = directory, import all dependencies.

Cross-Platform File Naming (MANDATORY)

Code runs on Windows (dev), Ubuntu (staging), and Debian (production). Linux is case-sensitive:

  • Class files: PascalCase matching class name (StaffService.php)
  • Config dirs: lowercase (src/config/, src/lang/)
  • Module dirs: PascalCase matching namespace (src/HR/Services/)
  • require/include: Must match EXACT case on disk
  • Paths: Use / (forward slash). Never hardcode C:\. Use sys_get_temp_dir() for temp files.

Additional Guidance

Extended guidance for php-modern-standards was moved to references/skill-deep-dive.md to keep this entrypoint compact and fast to load.

PHP DevOps Runtime Discipline

When PHP work affects deployment, Docker, or production operations, pair this skill with docker-development and deployment-release-engineering, then apply the PHP delivery notes in ../deployment-release-engineering/references/devops-book-patterns.md:

  • keep Composer lockfiles and dependency installation reproducible;
  • run static analysis, coding standards, and tests in CI before packaging;
  • manage .env and secrets outside version control;
  • document PHP-FPM pool settings, OPcache reset or warm-up, queue worker restart, cache clear/warm, and file-permission steps;
  • include database migration order, backup, verification queries, and rollback or compensating actions;
  • verify server updates, unattended security updates, web server config, and backup/restore for uploaded files.

Use that deep dive for:

  • Type System
  • Modern Features
  • Performance
  • SOLID Principles
  • Control Flow
  • Security (Essentials)
  • Testing
  • Laravel Conventions
  • Code Quality Tooling
  • PSR Standards
  • Anti-Patterns
  • Checklist

Decision Rules

ConditionAction
Boundary accepts external dataValidate into typed input before domain logic
Framework convention is secure and testablePrefer it over a custom abstraction
Change affects persistence or queuesDefine transaction, retry, and idempotency behaviour

Degraded Mode

Fallback: without execution, provide exact Composer, static-analysis, and test commands. Do not assume framework support without dependency metadata.

Domain Anti-Patterns

  • Concatenating user input into SQL.
  • Hiding domain behaviour in controllers.
  • Catching Throwable without recovery policy.
  • Adding mutable service-locator dependencies.
  • Claiming compatibility without checking Composer constraints.

Inputs

ArtefactRequired?Purpose
PHP version, framework, code, and repository standardsyesApply compatible typing, security, and tooling rules

Outputs

  • Produce PHP code or findings with static-analysis, test, security, and compatibility evidence.

Capability contract

Read/search and local static checks are allowed. Dependency changes, migrations, deployment, and production execution require explicit task authority.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Php Modern Standards」では何ができますか?

Use when writing or reviewing PHP 8+ applications, object-oriented domain code, Laravel services, PSR-compliant packages, secure request handling, tests, or performance-sensitive PHP.

TypingMindでPhp Modern Standardsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Php Modern Standardsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにPhp Modern Standardsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/languages/php-modern-standardsを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Php Modern Standardsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Php Modern Standardsで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもPhp Modern Standardsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Php Modern Standards」は無料ですか?

はい。peterbamuhigireがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇