petrvs-repository-pattern
OfficialShip clean, testable backend repositories
Software Engineering#integration testing#repository pattern#phpstan#dto#pest#laravel eloquent#service provider bindings
Authorgestaogovbr
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill solves inconsistent and tightly-coupled backend repository implementations by providing a practical, repeatable repository pattern for the Petrvs-PGD codebase.
Core Features & Use Cases
- Repository design guidance: Create expressive repository contracts, decide what belongs in repositories vs services, and keep read/write behavior coherent in Eloquent repositories.
- Laravel/Petrvs implementation flow: Generate new repositories with the intended artisan command, register bindings in the RepositoryServiceProvider, and use DTOs for composed return data.
- Quality safeguards: Add integration-tenant focused tests and run Pest and PHPStan on the modified repository/provider paths.
- Decision rules and pitfalls: Avoid injecting repositories directly into controllers except in a narrow read-only case, and avoid large associative arrays when domain shapes are stable.
Quick Start
Ask an AI to refactor your Petrvs backend repository by proposing a repository contract, the Eloquent read/write repository implementation using DTOs, the RepositoryServiceProvider bindings, and the integration-tenant tests to validate the behavior.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: petrvs-repository-pattern Download link: https://github.com/gestaogovbr/pgd-petrvs-publico/archive/main.zip#petrvs-repository-pattern Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.