Php Best Practices
HoangNguyen0403/agent-skills-standard
Write PHP following PSR coding standards, SOLID principles, and code-quality guidelines.
SOLID principles knowledge base for PHP 8.4 projects. An agent skill from dykyi-roman/awesome-claude-code.
$ npx skills add dykyi-roman/awesome-claude-code --skill solid-knowledge -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install dykyi-roman/awesome-claude-code solid-knowledge --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/solid-knowledge .claude/skills/solid-knowledge && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "solid-knowledge" agent skill from https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/solid-knowledge into .claude/skills/solid-knowledge/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "solid-knowledge", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/solid-knowledgeType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add dykyi-roman/awesome-claude-code --skill solid-knowledge -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install dykyi-roman/awesome-claude-code solid-knowledge --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/solid-knowledge .agents/skills/solid-knowledge && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "solid-knowledge" agent skill from https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/solid-knowledge into .agents/skills/solid-knowledge/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "solid-knowledge", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add dykyi-roman/awesome-claude-code --skill solid-knowledge -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install dykyi-roman/awesome-claude-code solid-knowledge --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/solid-knowledge .cursor/skills/solid-knowledge && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "solid-knowledge" agent skill from https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/solid-knowledge into .cursor/skills/solid-knowledge/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "solid-knowledge", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/dykyi-roman/awesome-claude-code.git --path skills/solid-knowledge--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add dykyi-roman/awesome-claude-code --skill solid-knowledge -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install dykyi-roman/awesome-claude-code solid-knowledge --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/solid-knowledge .gemini/skills/solid-knowledge && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "solid-knowledge" agent skill from https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/solid-knowledge into .gemini/skills/solid-knowledge/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "solid-knowledge", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install dykyi-roman/awesome-claude-code solid-knowledgeInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add dykyi-roman/awesome-claude-code --skill solid-knowledge -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/solid-knowledge .github/skills/solid-knowledge && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "solid-knowledge" agent skill from https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/solid-knowledge into .github/skills/solid-knowledge/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "solid-knowledge", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add dykyi-roman/awesome-claude-code --skill solid-knowledge -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install dykyi-roman/awesome-claude-code solid-knowledge --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/solid-knowledge .opencode/skills/solid-knowledge && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "solid-knowledge" agent skill from https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/solid-knowledge into .opencode/skills/solid-knowledge/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "solid-knowledge", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
solid-knowledgeSOLID principles knowledge base for PHP 8.4 projects. An agent skill from dykyi-roman/awesome-claude-code.
Solid Knowledge is an agent skill from dykyi-roman/awesome-claude-code. SOLID principles knowledge base for PHP 8.4 projects. Provides quick reference for SRP, OCP, LSP, ISP, DIP with detection patterns, PHP examples, and antipattern identification. Use for architecture audits and code quality reviews.
Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including reference files and assets (for example `assets/report-template.md`, `references/antipatterns.md` and `references/dip-patterns.md`).
It sits in Development, covering Design patterns, Knowledge bases and Code quality. It works with PHP. The repository describes itself as: PHP Architecture Toolkit for Claude Code (DDD, CQRS, Event Sourcing, Hexagonal, Clean Architecture, SOLID, GRASP, PSR, Design Patterns, Testing, Documentation, Code Review). The licence is MIT.
Read from SKILL.md and the folder at commit 7e1fea8. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are bash and php).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Solid Knowledge loads about 2.4k tokens when it runs, and up to ~17k if it reads all its reference files. Until then it costs about 62 tokens; SKILL.md has 357 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from dykyi-roman/awesome-claude-code at commit 7e1fea8, republished under its MIT licence (© dykyi-roman). 357 words, ~2,382 tokens.
.claude/skills/solid-knowledge/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.SOLID is a set of five design principles for writing maintainable, extensible software.
| Principle | Name | Core Idea |
|---|---|---|
| S | Single Responsibility | One class = one reason to change |
| O | Open/Closed | Open for extension, closed for modification |
| L | Liskov Substitution | Subtypes must be substitutable for base types |
| I | Interface Segregation | Many specific interfaces > one general |
| D | Dependency Inversion | Depend on abstractions, not concretions |
# God classes (>500 lines)
find . -name "*.php" -exec wc -l {} \; | awk '$1 > 500 {print}'
# Classes with "And" in name
grep -rn "class.*And[A-Z]" --include="*.php"
# Classes with >7 dependencies
grep -rn "public function __construct" --include="*.php" -A 20 | grep -E "private|readonly" | wc -l
# Multiple responsibility indicators
grep -rn "class.*Manager\|class.*Handler\|class.*Processor" --include="*.php"Signs of SRP Violation:
# Switch on type
grep -rn "switch.*instanceof\|switch.*::class" --include="*.php"
# Type checking conditionals
grep -rn "if.*instanceof\|elseif.*instanceof" --include="*.php"
# Hardcoded type maps
grep -rn "\[.*::class.*=>" --include="*.php"Signs of OCP Violation:
# Exception in overridden methods
grep -rn "throw.*NotImplemented\|throw.*NotSupported" --include="*.php"
# Empty overrides
grep -rn "public function.*\{[\s]*\}" --include="*.php"
# Type checks in child classes
grep -rn "if.*parent::" --include="*.php"Signs of LSP Violation:
# Large interfaces (>5 methods)
grep -rn "interface\s" --include="*.php" -A 30 | grep -c "public function"
# Empty interface implementations
grep -rn "// TODO\|// not implemented\|// unused" --include="*.php"Signs of ISP Violation:
# Direct instantiation in constructors
grep -rn "new\s\+[A-Z]" --include="*.php" | grep -v "Exception\|DateTime\|stdClass"
# Static method calls
grep -rn "::[a-z].*(" --include="*.php" | grep -v "self::\|static::\|parent::"
# Concrete class type hints (not interfaces)
grep -rn "function.*([A-Z][a-z]*[A-Z]" --include="*.php"Signs of DIP Violation:
new ConcreteClass() inside methods<?php
declare(strict_types=1);
// BAD: Multiple responsibilities
final class UserService
{
public function register(UserData $data): User { /* ... */ }
public function sendEmail(User $user): void { /* ... */ }
public function generateReport(User $user): Report { /* ... */ }
}
// GOOD: Single responsibility each
final readonly class RegisterUserHandler
{
public function __construct(
private UserRepository $users,
private EventDispatcher $events,
) {}
public function __invoke(RegisterUserCommand $command): UserId
{
$user = User::register($command->email, $command->password);
$this->users->save($user);
$this->events->dispatch($user->releaseEvents());
return $user->id;
}
}<?php
declare(strict_types=1);
// BAD: Modification required for new types
final class PaymentProcessor
{
public function process(Payment $payment): void
{
match ($payment->type) {
'card' => $this->processCard($payment),
'paypal' => $this->processPaypal($payment),
// Must modify for new payment types
};
}
}
// GOOD: Extension without modification
interface PaymentGateway
{
public function supports(Payment $payment): bool;
public function process(Payment $payment): PaymentResult;
}
final readonly class PaymentProcessor
{
/** @param iterable<PaymentGateway> $gateways */
public function __construct(
private iterable $gateways,
) {}
public function process(Payment $payment): PaymentResult
{
foreach ($this->gateways as $gateway) {
if ($gateway->supports($payment)) {
return $gateway->process($payment);
}
}
throw new UnsupportedPaymentException($payment->type);
}
}<?php
declare(strict_types=1);
// BAD: Violates substitutability
abstract class Bird
{
abstract public function fly(): void;
}
final class Penguin extends Bird
{
public function fly(): void
{
throw new CannotFlyException(); // LSP violation!
}
}
// GOOD: Proper abstraction hierarchy
interface Bird
{
public function move(): void;
}
interface FlyingBird extends Bird
{
public function fly(): void;
}
final readonly class Penguin implements Bird
{
public function move(): void
{
$this->swim();
}
private function swim(): void { /* ... */ }
}
final readonly class Eagle implements FlyingBird
{
public function move(): void
{
$this->fly();
}
public function fly(): void { /* ... */ }
}<?php
declare(strict_types=1);
// BAD: Fat interface
interface UserRepository
{
public function find(UserId $id): ?User;
public function findByEmail(Email $email): ?User;
public function save(User $user): void;
public function delete(User $user): void;
public function findAll(): array;
public function count(): int;
public function export(): string;
public function import(string $data): void;
}
// GOOD: Segregated interfaces
interface UserReader
{
public function find(UserId $id): ?User;
public function findByEmail(Email $email): ?User;
}
interface UserWriter
{
public function save(User $user): void;
public function delete(User $user): void;
}
interface UserExporter
{
public function export(): string;
public function import(string $data): void;
}
// Compose as needed
interface UserRepository extends UserReader, UserWriter {}<?php
declare(strict_types=1);
// BAD: Depends on concretions
final class OrderService
{
public function process(Order $order): void
{
$mailer = new SmtpMailer(); // Concrete dependency
$logger = Logger::getInstance(); // Static dependency
$validator = new OrderValidator(); // Hidden dependency
// ...
}
}
// GOOD: Depends on abstractions
final readonly class OrderService
{
public function __construct(
private OrderRepository $orders,
private Mailer $mailer,
private LoggerInterface $logger,
private OrderValidator $validator,
) {}
public function process(Order $order): void
{
$this->validator->validate($order);
$this->orders->save($order);
$this->mailer->send(new OrderConfirmation($order));
$this->logger->info('Order processed', ['id' => $order->id->value]);
}
}| SOLID | DDD Application |
|---|---|
| SRP | Aggregates have single consistency boundary |
| OCP | Domain Events enable extension without modification |
| LSP | Value Objects are substitutable (same type = same behavior) |
| ISP | Repository interfaces segregated (Reader/Writer) |
| DIP | Domain depends on Repository interfaces, not implementations |
| Layer | SOLID Focus |
|---|---|
| Domain | SRP (Entities), LSP (Value Objects), ISP (Repository interfaces) |
| Application | SRP (Use Cases), DIP (Port interfaces) |
| Infrastructure | OCP (Adapters), DIP (Implements ports) |
| Presentation | SRP (Controllers), ISP (API contracts) |
| Level | Description | Example |
|---|---|---|
| CRITICAL | Fundamental violation affecting entire system | God class, no DI |
| WARNING | Localized violation, should be fixed | instanceof chains |
| INFO | Minor issue, consider refactoring | Interface with 6 methods |
See detailed documentation in references/:
srp-patterns.md - Single Responsibility patternsocp-patterns.md - Open/Closed patternslsp-patterns.md - Liskov Substitution patternsisp-patterns.md - Interface Segregation patternsdip-patterns.md - Dependency Inversion patternsantipatterns.md - Common SOLID violationsSee assets/report-template.md for audit report format.
© dykyi-roman, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 7 other files (references, assets) in skills/solid-knowledge of dykyi-roman/awesome-claude-code.
Open the folder on GitHubat commit 7e1fea8
Solid Knowledge next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Solid Knowledge this skilldykyi-roman/awesome-claude-code | 103 | — | ~2.4k | Automated safety check: Pass | MIT | |
| Php Best PracticesHoangNguyen0403/agent-skills-standard | 571 | — | ~638 | Automated safety check: Pass | MIT | |
| WooCommerce Code Reviewwoocommerce/woocommerce | 11k | 3 repos | ~1.1k | Automated safety check: Pass | Custom licence | |
| Skill Doli Code ReviewDolibarr/dolibarr | 7.7k | 1 repos | ~1.1k | Automated safety check: Pass | MIT | |
| Coding Best PracticesKartikLabhshetwar/better-shot | 2.4k | 2 repos | ~1.8k | Automated safety check: Pass | Custom licence | |
| Solidramziddin/solid-skills | 606 | — | ~2.7k | Automated safety check: Pass | None |
HoangNguyen0403/agent-skills-standard
Write PHP following PSR coding standards, SOLID principles, and code-quality guidelines.
woocommerce/woocommerce
Reviews WooCommerce code changes against the project's standards, flagging backend PHP architecture, naming, documentation, data integrity and testing violations.
Dolibarr/dolibarr
Reviews Dolibarr PHP code for compliance with coding standards and security best practices, and fixes identified issues.
KartikLabhshetwar/better-shot
Reviews macOS Swift 6+ code for modern idioms, SOLID principles, SwiftData patterns, and concurrency best practices.
ramziddin/solid-skills
A skill your agent uses when writing code, implementing features, refactoring, planning architecture, designing systems, reviewing code, or debugging.
Automattic/wordpress-activitypub
PHP coding standards and WordPress patterns for ActivityPub plugin.
dykyi-roman/awesome-claude-code
GRASP principles knowledge base for PHP 8.4 projects. An agent skill from dykyi-roman/awesome-claude-code.
dykyi-roman/awesome-claude-code
PSR-4 autoloading standard knowledge base for PHP 8.4 projects.
dykyi-roman/awesome-claude-code
PSR-1 and PSR-12 coding standards knowledge base for PHP 8.4 projects.
dykyi-roman/awesome-claude-code
PHP Standards Recommendations (PSR) overview knowledge base.
dykyi-roman/awesome-claude-code
Comprehensive knowledge base for Claude Code formats, patterns, and configuration.
dykyi-roman/awesome-claude-code
Action-Domain-Responder pattern knowledge base. An agent skill from dykyi-roman/awesome-claude-code.
Works with
Categories
SOLID principles knowledge base for PHP 8.4 projects. An agent skill from dykyi-roman/awesome-claude-code. Solid Knowledge is an agent skill from dykyi-roman/awesome-claude-code.4 projects.
Solid Knowledge fits situations like: architecture audits and code quality reviews; tasks that involve Design patterns; tasks that involve Knowledge bases.
Run `npx skills add dykyi-roman/awesome-claude-code --skill solid-knowledge -a claude-code`. Or copy the skill folder (skills/solid-knowledge in dykyi-roman/awesome-claude-code) into .claude/skills/solid-knowledge in your project. Claude Code loads it when a task matches its description.
Run `npx skills add dykyi-roman/awesome-claude-code --skill solid-knowledge -a codex`. Or copy the skill folder (skills/solid-knowledge in dykyi-roman/awesome-claude-code) into .agents/skills/solid-knowledge in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dykyi-roman/awesome-claude-code --skill solid-knowledge -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/solid-knowledge, .gemini/skills/solid-knowledge, .github/skills/solid-knowledge and .opencode/skills/solid-knowledge in your project.
SKILL.md names no scripts, command-line tools or credentials: Solid Knowledge is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Solid Knowledge is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 14k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Solid Knowledge: Php Best Practices (HoangNguyen0403/agent-skills-standard, 571 stars), WooCommerce Code Review (woocommerce/woocommerce, 11k stars), Skill Doli Code Review (Dolibarr/dolibarr, 7.7k stars) and Coding Best Practices (KartikLabhshetwar/better-shot, 2.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
dykyi-roman (a GitHub user) maintains it in dykyi-roman/awesome-claude-code, which has 103 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on August 16, 2026.
Source: dykyi-roman/awesome-claude-code on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.