Logo Php Modern Standards

Php Modern Standards

Cộng đồng
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.

Tổng quan

Nhà phát hànhpeterbamuhigire
Kho mãchwezi-dev-engine
Tên kỹ năngphp-modern-standards
Sao
29
Bản fork
6
Tệp đi kèm
26
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 26 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được peterbamuhigire công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Php Modern Standards trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/languages/php-modern-standards
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân 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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Php Modern Standards trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Php Modern Standards ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Php Modern Standards với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Php Modern Standards làm được gì?

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.

Vì sao nên dùng Php Modern Standards trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Php Modern Standards là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Php Modern Standards trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/peterbamuhigire/chwezi-dev-engine/tree/main/skills/languages/php-modern-standards. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Php Modern Standards?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Php Modern Standards với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Php Modern Standards với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Php Modern Standards có miễn phí không?

Có. Kỹ năng này được peterbamuhigire phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇