petrvs-backend-laravel

Guide Laravel backend changes with tenant-aware Pest and PHPStan verification.

19|14|Updated Aug 6, 2024
One-click install
npx skills add https://github.com/gestaogovbr/pgd-petrvs-publico --skill petrvs-backend-laravel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: petrvs-backend-laravel
Source: https://github.com/gestaogovbr/pgd-petrvs-publico/tree/main/.agents/skills/petrvs-backend-laravel
Command: npx skills add https://github.com/gestaogovbr/pgd-petrvs-publico --skill petrvs-backend-laravel

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps teams implement, refactor, debug, and review a Petrvs backend built with Laravel by providing consistent, tenant-aware development and verification guardrails.

Core Features & Use Cases

  • Backend-focused workflow: Guides how to inspect affected code, choose the right reference (commands, testing, repository pattern, PHPStan, SIAPE), and keep changes aligned with existing Laravel architecture.
  • Separation of responsibilities: Keeps controllers focused on request/response while moving business logic to Services and collaborators, using contracts, DTOs, validators, jobs, policies, resources, and repositories where the codebase already follows those patterns.
  • Tenant and security safety: Preserves tenant context and log/audit behavior, and flags sensitive areas such as authorization, tenant isolation, CPF/personal data handling, SIAPE payloads, SQL usage, mass assignment, and downloads.
  • Correct verification loop: Encourages adding/adjusting Pest tests (with clear suite choice) and running PHPStan on the altered paths to confirm correctness.

Quick Start

Use this skill to guide a backend Laravel change by first reading AGENTS.md files, inspecting the targeted code, choosing the most relevant references, then updating Services/repositories/DTOs with tenant-aware behavior and verifying the result with the narrower Pest suite and a PHPStan run on the modified paths.

Frequently Asked Questions about petrvs-backend-laravel

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely refactor a Laravel backend to preserve tenant-aware behavior?

Safely refactoring a Laravel backend requires keeping controllers focused on request/response while moving business logic to Services and DTOs, preserving tenant context, and verifying changes with targeted Pest tests and PHPStan on modified paths.

What is the correct separation of responsibilities when implementing Laravel backend features?

The correct separation keeps Laravel controllers handling request/response logic, while Services, repositories, contracts, DTOs, validators, jobs, and policies manage domain logic where the codebase already follows those patterns.

How do I run Pest tests and PHPStan verification after a Laravel backend refactor?

Run Pest tests and PHPStan verification by choosing the narrowest relevant Pest suite for your altered paths and executing PHPStan directly on those modified files to confirm correctness inside the petrvs_php container.

Does this Laravel workflow support SIAPE integration and sensitive data handling?

This Laravel workflow supports SIAPE integration by flagging sensitive areas like authorization, tenant isolation, CPF/personal data handling, SIAPE payloads, SQL usage, mass assignment, and downloads to maintain strict security focus.

Can I use the repository pattern with Laravel Models and Jobs in this backend workflow?

You can use the repository pattern with Laravel Models and Jobs by inspecting existing code, choosing the right reference, and updating repositories and collaborators to align with the established architecture and tenant-aware behavior.

What should I check before modifying Laravel Controllers and Services to avoid breaking tenant isolation?

Before modifying Laravel Controllers and Services, inspect affected code, read AGENTS.md files, and verify that tenant context, log/audit behavior, and security boundaries are preserved to avoid breaking tenant isolation.