

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# Intervention Image Agent Guide23This document provides a guide for software engineering agents working on the Intervention Image codebase.45## 1. Project Overview67Intervention Image is a PHP image manipulation library. It provides an expressive, fluent interface to create, edit, and compose images. The library supports both the GD library and Imagick as underlying drivers.89The source code is located in the `src` directory, and the project follows the PSR-4 autoloading standard.1011## 2. Development Environment1213The project uses Composer to manage dependencies. These dependencies are installed automatically when using the Docker development environment.1415## 3. Build, Lint, and Test Commands1617The following commands are used to ensure code quality and correctness.1819### 3.1. Testing (PHPUnit)2021The project uses PHPUnit for unit and feature testing.2223- **Run all tests:**24```bash25 docker compose run --rm tests26```2728- **Run a single test file:**29 To run a specific test file, provide the path to the file.30```bash31 docker compose run --rm tests tests/Unit/ImageManagerTest.php32```3334- **Run a single test method:**35 Use the `--filter` option to run a specific test method by its name.36```bash37 docker compose run --rm tests tests/Unit/ImageManagerTest.php --filter testMethodName38```3940- **Check test coverage:**41```bash42 docker compose run --rm coverage43```4445### 3.2. Static Analysis (PHPStan)4647PHPStan is used for static analysis to find potential bugs.4849- **Run static analysis:**50```bash51 docker compose run --rm analysis52```5354### 3.3. Coding Standards (PHP CodeSniffer)5556The project adheres to the PSR-12 coding standard with additional rules. PHP CodeSniffer is used to enforce these standards.5758- **Check for coding standard violations:**59```bash60 docker compose run --rm standards61```6263## 4. Code Style and Conventions6465Consistency is key. Adhere to the following guidelines when writing code.6667### 4.1. Formatting6869- **PSR-12:** The primary coding standard is PSR-12.70- **Indentation:** Use 4 spaces for indentation, not tabs.71- **Line Endings:** Use Unix-style line endings (LF).72- **Strict Types:** All PHP files must start with `declare(strict_types=1);`.73- **Class Structure:** Follow the ordering defined in `phpcs.xml.dist`:74 1. `uses`75 2. `enum cases`76 3. `constants`77 4. `static properties`78 5. `properties`79 6. `constructor`80 7. `static constructors`81 8. `methods`82 9. `magic methods`8384### 4.2. Naming Conventions8586- **Classes:** `PascalCase`.87- **Methods:** `camelCase`.88- **Variables:** `camelCase`.89- **Constants:** `UPPER_CASE` with underscore separators.90- **File Names:** File names must match the class name they contain (e.g., `MyClass.php` for `class MyClass`).9192### 4.3. Imports9394- **One class per `use` statement:** Do not group multiple classes in a single `use` statement.95- **No leading backslash:** `use` statements must not start with a backslash.96- **Order:** `use` statements should be ordered alphabetically. Unused imports must be removed.9798### 4.4. Types and Type Hinting99100- **Strict Typing:** All code should be strictly typed.101- **Parameter Types:** All method parameters must have a type hint.102- **Return Types:** All methods must have a return type hint.103- **Property Types:** All class properties must have a type hint.104- **Nullable Types:** Use nullable types (`?TypeName`) when a `null` value is explicitly allowed.105106### 4.5. Error Handling107108- Exceptions should be used for error handling.109- When catching exceptions, be as specific as possible. Avoid catching generic `\Exception` or `\Throwable`.110- Exception messages should be clear and descriptive.111112### 4.6. PHPDoc (DocBlocks)113114- PHPDoc blocks are required for all classes, properties, and methods.115- Follow the annotation order defined in `phpcs.xml.dist`.116- Use DocBlocks to provide context and explain complex logic. Do not restate the obvious from the code signature.117118## 5. Branching and Commits119120- **Branching:** Create new branches from the `develop` branch. Name branches descriptively (e.g., `feature/new-filter`, `bugfix/fix-resize-issue`).121- **Commits:** Write clear and concise commit messages. The first line should be a short summary (max 50 chars). A more detailed explanation can follow after a blank line. Always write the message in imperative and do NOT use any useless prefixes like "chore" or other.122- **Pull Requests:** Target the `develop` branch for all pull requests. Ensure all checks (tests, linting, analysis) are passing before submitting.123
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| rails/railsAGENTS.md · 59k | AGENTS.md | teststylearchgit+4 | 100/100 | 14 days ago | |
| vllm-project/vllmAGENTS.md · 88k | AGENTS.md | setuptestlint-formatstyle+5 | 100/100 | 14 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| elastic/elasticsearchx-pack/plugin/inference/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+3 | 100/100 | 14 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 14 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 200k | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| aaif-goose/gooseAGENTS.md · 53k | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 8 days ago | |
| wpscanteam/wpscanAGENTS.md · 9.7k | AGENTS.md | setupbuildteststyle+6 | 100/100 | 13 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/intervention-image-agents)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.