Skip to content

Commit 2f4d11b

Browse files
committed
Add AGENTS.md
Generated by OpenCode with claude-sonnet-4.5
1 parent 9160034 commit 2f4d11b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

AGENTS.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Agent Guidelines for graphql-laravel
2+
3+
## Commands
4+
- Run all tests: `composer tests` or `vendor/bin/phpunit`
5+
- Run single test: `vendor/bin/phpunit --filter TestClassName::testMethodName` or `vendor/bin/phpunit tests/Unit/GraphQLTest.php`
6+
- Lint/check style: `composer lint`
7+
- Fix code style: `composer fix-style`
8+
- Static analysis: `composer phpstan`
9+
- Update PHPStan baseline: `composer phpstan-baseline`
10+
11+
## Code Style
12+
- PHP 8.2+, strict types required: `declare(strict_types = 1);` at file top (note spaces around `=`)
13+
- Namespace declaration on same line as declare: `declare(strict_types = 1);` then `namespace Foo\Bar;`
14+
- Use strict PHPDoc types: `@var array<string,mixed>`, `@var list<object>`, `@param array<string,Schema> $schemas`
15+
- Import all classes at top; no inline `\Fully\Qualified\Names` in code
16+
- Use strict type hints on all methods: `public function schema(?string $schemaName = null): Schema`
17+
- PHPStan level 8 with strict rules; check baseline file for known issues
18+
- Follow PSR-12 via php-cs-fixer with mfn/php-cs-fixer-config ruleset
19+
- Properties: declare types explicitly with `@var` docblocks when needed for arrays/collections
20+
- Tests: namespace `Rebing\GraphQL\Tests\Unit` or `Rebing\GraphQL\Tests\Database`, extend `TestCase`, use PHPUnit attributes like `#[DoesNotPerformAssertions]`
21+
- Error handling: use custom exceptions in `Rebing\GraphQL\Exception\` namespace, extend appropriate base classes
22+
- Use Laravel contracts/interfaces where available: `Illuminate\Contracts\Config\Repository` not `Config` class

0 commit comments

Comments
 (0)