rugged-gemini: Skill for Claude Code

.gemini/skills/php-idioms/SKILL.md

php-idioms is a skill for Claude Code, Gemini CLI from irahardianto/rugged-gemini. It costs 0 tokens per session (806 once invoked), scanned A, a copy of php-idioms, MIT.

A style and design guide for writing modern PHP 8.x code with strict types, immutable objects, enums, and standard interfaces.

In plain words
What is it for?
It is for choosing PHP language patterns, handling domain errors, defining typed data objects, and following PSR conventions.
Why use it?
It helps make PHP code safer, clearer, and easier to test and maintain across frameworks.

Skill for Claude CodeGemini CLI

Written for Claude Code and Gemini CLI: paths in frontmatter, but also installed under .gemini/. Also seen: mentions Gemini CLI.

This is irahardianto/rugged-gemini's own configuration. It tells Claude Code and Gemini CLI how to work on rugged-gemini itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything rugged-gemini configures →

Reuse

Borrowing it

Nothing to install: this file belongs to irahardianto/rugged-gemini. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/irahardianto/rugged-gemini/main/.gemini/skills/php-idioms/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/irahardianto/rugged-gemini

Made for: Claude Code, Gemini CLI.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for php-idioms

README.md
[![agentmods](https://agentmods.dev/badge/skills/irahardianto/rugged-gemini/php-idioms/github.svg)](https://agentmods.dev/skills/irahardianto/rugged-gemini/php-idioms)
Your own site
<a href="https://agentmods.dev/skills/irahardianto/rugged-gemini/php-idioms"><img src="https://agentmods.dev/badge/skills/irahardianto/rugged-gemini/php-idioms/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for php-idioms

Your own site · 80×15
<a href="https://agentmods.dev/skills/irahardianto/rugged-gemini/php-idioms"><img src="https://agentmods.dev/badge/skills/irahardianto/rugged-gemini/php-idioms.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 806 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 89% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00806
Opus 5 $0.00000 $0.00403
Sonnet 5 $0.00000 $0.00161
Haiku 4.5 $0.00000 $0.00081

Measured 5d ago against content hash 42f3c7e092dc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

php-idioms scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

89% identical to php-idioms — 8 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.gemini/skills/php-idioms/SKILL.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PHP Idioms and Patterns

Modern PHP (8.x) rewards type safety, immutability, and framework-agnostic design. Lean into typed properties, enums, and readonly classes. Idiomatic PHP = strict types, PSR-compliant, well-tested.

Scope: PHP coding idioms. Test naming: GEMINI.md § Testing Strategy. Logging: @.gemini/skills/logging-and-observability-principles/SKILL.md.

Modern PHP Features (8.x)

  1. declare(strict_types=1) — always, every file.

  2. Enums for domain constants:

    enum Priority: string {
        case Low = 'low';
        case Medium = 'medium';
        case High = 'high';
    }
    
  3. Readonly classes for immutable DTOs:

    readonly class CreateTaskRequest {
        public function __construct(
            public string $title,
            public Priority $priority,
        ) {}
    }
    
  4. Named arguments for clarity:

    $task = new Task(title: 'Deploy fix', priority: Priority::High);
    
  5. Match expressions over switch:

    $score = match($priority) {
        Priority::Low => 1,
        Priority::Medium => 5,
        Priority::High => 10,
    };
    

Error Handling

  1. Domain exception hierarchies:

    abstract class DomainException extends \RuntimeException {}
    
    class NotFoundException extends DomainException {
        public function __construct(
            public readonly string $resource,
            public readonly string $resourceId,
        ) {
            parent::__construct("{$resource} '{$resourceId}' not found");
        }
    }
    
  2. Never catch (\Exception) without re-throw or specific handling.

  3. Type-safe return types — never mixed without justification.

Interfaces and DI

  1. Define interface where consumed, implement where provided:
    // In task feature
    interface TaskStorage {
        public function getById(string $id): Task;
        public function save(Task $task): void;
    }
    
    // Constructor injection
    class TaskService {
        public function __construct(
            private readonly TaskStorage $storage,
        ) {}
    }
    

Read the full file on GitHub · 121 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 121 lines · 0 tokens per session scan A 42f3c7e092dc

Subscribe to this mod's changes

php-idioms is a skill published in the GitHub repository irahardianto/rugged-gemini (5 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 806 tokens. A static security scan graded it A with 0 findings. It is 89% identical to php-idioms, differing in 8 lines, and is treated as a copy.