laravelspecifying-constraints
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "laravelspecifying-constraints" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-67cf49377b2eef3d6f63c8ad3d66c2ca30d85953c6037a418a37511f33213cb1. Verify the upstream source and version against https://github.com/jpcaparas/superpowers-laravel before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
github.com
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Specify clear constraints for AI-generated code—covering performance, security, testing, architecture, and dependencies—to ensure compliance with project standards.
Introduction source: third_party · jpcaparas · 0.0.1 Reference
SkillPi interpretation
- Tasks
- Define clear constraints—performance, security, testing, architecture, dependencies—so AI generates code that meets your project standards
- Software, accounts and paid services
- "Testing requirements for authentication: Test successful login with valid credentials Test failed login with invalid credentials Test rate limiting (max 5 attempts per minute) Test token expiration after 24 hours Test logout invalidates token Use `RefreshDatabase` trait No external API calls in tests (use mocks)"
- Limits and differences
- Constraints guide the AI toward solutions that fit your project. Without them, you get generic code that may not meet your requirements.
- Testing
- Not tested
Browse files
Frontmatter
name: laravel:specifying-constraints
description: Define clear constraints—performance, security, testing, architecture, dependencies—so AI generates code that meets your project standardsSpecifying Constraints
Constraints guide the AI toward solutions that fit your project. Without them, you get generic code that may not meet your requirements.
Performance Constraints
Vague
"Make it fast"
Specific
"Optimize product search:
- Response time < 200ms for 95th percentile
- Support 1000 concurrent users
- Cache results for 5 minutes using Redis
- Use database indexes on
name,category_id,published_at - Paginate results, max 50 per page
- Avoid N+1 queries with eager loading"
Database Performance
"Query orders with performance constraints:
- Use
select()to load only needed columns - Eager load
items,customer,shipping_addressin one query - Add composite index on
(user_id, created_at, status) - Use
chunk()for batch processing > 1000 records - Set query timeout to 5 seconds"
Security Constraints
Vague
"Make it secure"
Specific
"Implement user profile update with security requirements:
- Authorize using
ProfilePolicy@update - Validate all inputs in
ProfileUpdateRequest - Sanitize HTML in bio field (strip scripts, allow basic formatting)
- Rate limit to 10 requests per minute per user
- Hash passwords with bcrypt (cost factor 12)
- Log all profile changes for audit trail
- Prevent mass assignment vulnerabilities with
$fillable"
API Security
"Secure the payment API:
- Require
auth:sanctummiddleware - Validate API tokens have
process-paymentsability - Use HTTPS only (enforce in middleware)
- Validate webhook signatures from payment provider
- Store sensitive data encrypted in database
- Never log credit card numbers or tokens
- Return generic error messages (don't leak system details)"
Testing Constraints
Vague
"Add tests"
Specific
"Test the order processing feature:
- Feature test for complete order flow (create → process → confirm)
- Unit tests for OrderService methods
- Test validation failures (invalid payment, insufficient inventory)
- Test edge cases (zero quantity, negative prices)
- Mock external payment gateway
- Use factories for test data
- Aim for 80% code coverage on business logic
- Tests must run in < 30 seconds"
Test Requirements
"Testing requirements for authentication:
- Test successful login with valid credentials
- Test failed login with invalid credentials
- Test rate limiting (max 5 attempts per minute)
- Test token expiration after 24 hours
- Test logout invalidates token
- Use
RefreshDatabasetrait - No external API calls in tests (use mocks)"
Architectural Constraints
Patterns to Follow
"Implement payment processing following our architecture:
- Use repository pattern:
PaymentRepositoryfor data access - Use service layer:
PaymentServicefor business logic - Use jobs for async work:
ProcessPaymentJob - Use events:
PaymentProcessed,PaymentFailed - Controllers orchestrate only, no business logic
- Keep cyclomatic complexity < 7 per method
- Follow SOLID principles"
Patterns to Avoid
"Implement user management with these constraints:
- Don't use static methods or facades in business logic
- Don't put business logic in controllers or models
- Don't use global state or singletons
- Don't mix concerns (separate validation, business logic, persistence)
- Don't use raw SQL queries (use Eloquent or Query Builder)
- Don't bypass authorization checks"
Dependency Constraints
Version Requirements
"Add image processing feature:
- Use
intervention/image^3.0 (Laravel 13.x compatible) - Requires PHP 8.2+
- Requires GD or Imagick extension
- Compatible with our existing
spatie/laravel-medialibrary^11.0 - No conflicts with current dependencies"
Package Selection
"Choose a package for PDF generation:
- Must support Laravel 13.x
- Must handle UTF-8 and special characters
- Should support headers/footers
- Prefer actively maintained (updated in last 6 months)
- Check compatibility with our PHP 8.2 requirement
- Consider:
barryvdh/laravel-dompdforspatie/laravel-pdf"
Constraint Templates
Performance Template
- Response time: < X ms
- Throughput: Y requests/second
- Cache strategy: Redis, TTL Z minutes
- Database: indexes on [columns], eager load [relationships]
- Pagination: max X per page
Security Template
- Authentication: [Sanctum/Passport/Session]
- Authorization: [Policy/Gate]
- Validation: [Form Request class]
- Rate limiting: X requests per Y minutes
- Data protection: [encryption/hashing requirements]
- Audit logging: [what to log]
Testing Template
- Coverage: X% on business logic
- Test types: [feature/unit/integration]
- Mocking: [external services to mock]
- Factories: [models to factory]
- Performance: tests complete in < X seconds
- Edge cases: [specific scenarios to test]
Quick Reference
Specify constraints clearly:
- Performance - Response times, throughput, caching, indexes
- Security - Auth, validation, rate limiting, data protection
- Testing - Coverage, test types, mocking, edge cases
- Architecture - Patterns to follow/avoid, complexity limits
- Dependencies - Versions, compatibility, package requirements
Clear constraints = code that fits your project.
Version history
-
v0.1.5
GitHub ↗
Original release notes
# Laravel Superpowers — Release Notes ## v0.1.5 (2025-11-11) Added five new best practice skills based on recommendations from https://saasykit.com/blog/laravel-best-practices to provide comprehensive coverage of Laravel development patterns. ### Added (Skills) - **Routes Best Practices** (`routes-best-practices`) - Keep routes clean and focused on mapping requests to controllers, avoiding business logic in route files - **Data Chunking for Large Datasets** (`data-chunking-large-datasets`) - Handle large datasets efficiently with `chunk()`, `chunkById()`, `lazy()`, and `cursor()` methods - **Internationalization and Translation** (`internationalization-and-translation`) - Build with i18n in mind from day one using Laravel's translation helpers - **Constants and Configuration** (`constants-and-configuration`) - Replace hardcoded values with constants, enums, and configuration for better maintainability - **Documentation Best Practices** (`documentation-best-practices`) - Write meaningful documentation that explains "why" not "what", focusing on complex business logic ### Notes These additions complement the existing comprehensive skill set by filling gaps identified from the SaaSykit Laravel best practices guide. All new skills include extensive examples, anti-patterns, and real-world use cases.
-
v0.1.4
GitHub ↗
Original release notes
# Laravel Superpowers — Release Notes ## v0.1.4 (2025-11-04) Monorepo-aware SessionStart with multi-app detection, per-app version reporting, and scoped Sail guidance. ### Monorepo Support - Recursively discovers Laravel apps by locating `artisan` anywhere in the repo (ignores heavy/irrelevant folders like `vendor/`, `node_modules/`, `storage/`, VCS/IDE folders). - Supports multiple Laravel apps in a single repository. The hook lists all detected apps with: - Relative path - Laravel version (from `composer.lock` via `jq` when available, with fallback to `composer.json` constraint or a portable parser) - Sail availability, and whether containers appear to be running - Determines the “active” app based on the current working directory; if only one app exists, it becomes active automatically. - Emits Sail guidance and interactive safety for the active app only, to avoid cross-app confusion. ### Testing - Extended `scripts/test_session_start.sh` to cover: - Non-Laravel repo bailout - Single app (no Sail) - Sail present but containers stopped (interactive safety messaging) - Sail present with containers running - Monorepo with two nested apps on different Laravel versions - Monorepo where hook runs inside a nested app (active app semantics) - CI workflow `.github/workflows/test-session-start.yml` continues to run this script; no changes required beyond the added scenarios. ### Notes - If `jq` is unavailable, the hook falls back to a portable parser for version detection; output may show version constraints or `unknown` in minimal setups.
-
v0.1.3
GitHub ↗
Original release notes
# Laravel Superpowers — Release Notes ## v0.1.2 (2025-11-04) Docs sweep across Laravel 11.x and 12.x, with new skills matching the intersection of stable patterns. Also consolidated duplicates and kept commands thin. ### Added (Skills) - Form Requests & Validation (`laravel:form-requests`) - Policies & Authorization (`laravel:policies-and-authorization`) - Eloquent Relationships & Loading (`laravel:eloquent-relationships`) - Transactions & Consistency (`laravel:transactions-and-consistency`) - HTTP Client Resilience (`laravel:http-client-resilience`) - Task Scheduling (`laravel:task-scheduling`) - API Resources & Pagination (`laravel:api-resources-and-pagination`) - Blade Components & Layouts (`laravel:blade-components-and-layouts`) - Filesystem Uploads & URLs (`laravel:filesystem-uploads`) - Rate Limiting & Throttle (`laravel:rate-limiting`) - Exception Handling & Logging (`laravel:exception-handling-and-logging`) Matching command wrappers were added under `commands/` using the existing convention. ### Changed - Unified caching guidance into `laravel:performance-caching` (added tags, locks, invalidation best‑practices). Removed the duplicate cache strategies skill/command. - De‑duplicated Eloquent guidance: relationships skill now references `laravel:performance-eager-loading` for N+1 detection/measurement. ### Removed - Subagents that duplicated skills (Form Request Builder, Policy Planner, Transaction Auditor, API Resource Designer). The repo keeps subagents minimal; the controller cleaner remains. - Redundant Sail prompt skill (covered by runner selection and integration docs). ### Docs - Summary of 11.x/12.x intersection captured within the new skills themselves.
-
v0.1.2
GitHub ↗
Original release notes
# Laravel Superpowers — Release Notes ## v0.1.1 (2025-11-04) Smarter Laravel detection, Sail via binary presence, and safer command guidance. ### Detection & Safety - SessionStart now bails out cleanly for non‑Laravel repos (no output), ensuring the plugin does NOT activate outside Laravel projects. - Sail is detected by executable presence only: `vendor/bin/sail` (or a top‑level `./sail` helper). We no longer parse `composer.json` or rely on `jq` for Sail checks. - Determines whether containers are running via `docker compose ps` / `docker-compose ps` (unchanged). - Injects guidance to prefer Sail commands when Sail is available; clearly maps Sail vs host command pairs (artisan/composer/php/node/db). - Interactive safety: when Sail is available but containers are not running, the assistant must ask whether to start containers (`sail up -d`) or proceed using host tools—no host PHP/Composer/DB/Node commands should run until the user chooses. ### Docs & Screenshots - README now includes screenshots of SessionStart with and without Sail. ### Docs & Skills Cleanup - Replaced hardcoded Sail-only lines with Sail/non‑Sail pairs: - `skills/migrations-and-factories/SKILL.md` - `skills/queues-and-horizon/SKILL.md` - `skills/daily-workflow/SKILL.md` - `skills/quality-checks/SKILL.md` - Ensured quality/static analysis and frontend checks include host equivalents. ### New Skill - [Removed] Previously documented interactive Sail prompt skill. Interactive safety is still enforced by the assistant when Sail is declared but containers are not running. ### Reference - Common Sail commands supported: `sail up|stop|restart|ps`, `sail artisan …`, `sail php …`, `sail composer …`, `sail node|npm|npx|pnpm|pnpx|yarn|bun|bunx …`, `sail mysql|mariadb|psql|mongodb|redis|valkey`, `sail test|phpunit|pest|pint|dusk`.
-
v0.1.0
GitHub ↗
Original release notes
## v0.1.0 (2025-11-03) First public release of Laravel Superpowers — a Laravel‑focused skills library for Claude Code. It brings proven workflows (TDD, debugging, planning) together with Laravel‑aware guidance that stays platform‑agnostic (works with or without Sail). ### Highlights - Plugin identity and marketplace metadata for the Laravel fork - Renamed plugin to `superpowers-laravel` and pointed metadata to `jpcaparas/superpowers-laravel` - Added local marketplace entry to simplify install during development - Laravel‑aware SessionStart - Startup hook auto‑detects Laravel projects (via `artisan` or `composer.json` with `laravel/framework`) - Injects a concise “Using Superpowers in Laravel Projects” introduction when Laravel is detected - New Laravel skills (all Sail/non‑Sail compatible) - Onboarding & Runner (using‑laravel‑superpowers, runner‑selection) - Development & Testing (tdd‑with‑pest, migrations‑and‑factories) - Quality & Operations (quality‑checks, queues‑and‑horizon) - Architecture & Complexity (ports‑and‑adapters, template‑method‑and‑plugins, complexity‑guardrails) - Optional skills (scaffolding for growing teams) - Nova resource patterns; Horizon dashboards/metrics; E2E Playwright patterns - API surface evolution; Config/Env storage strategy - Key commands (plugin‑namespaced) - `/superpowers-laravel:brainstorm`, `/superpowers-laravel:write-plan`, `/superpowers-laravel:execute-plan` - `/superpowers-laravel:laravel-check`, `/superpowers-laravel:laravel-tdd` - Documentation - Updated README for Laravel‑first usage (now includes repo logo) - Added Related Tools note for Laravel Boost (complementary if installed) - New integration guide: `docs/laravel/INTEGRATION.md` - New installation notes (version‑agnostic): `docs/laravel/INSTALLATION-NOTES.md` ### Files - Hook: `hooks/session-start.sh` (Laravel detection + onboarding) - Skills live under `skills/`; commands under `commands/` - Docs: `docs/laravel/INTEGRATION.md`, `docs/laravel/INSTALLATION-NOTES.md` ### New skills inspired by Clean Coders Guide - Controller cleanup; performance (eager loading, select columns, caching); dependency trimming - Helpers; interfaces + DI; strategy; controller testing ### Commands - Examples provided for core flows and a few advanced skills; run `/help` to see everything available in your environment. ### Maintenance - Moved Laravel skills from `skills/laravel/**` to first‑party `skills/**` - Removed empty directories after consolidation - Cleaned references in README and docs to reflect new locations and command namespace - Added CI validation for skills structure and plugin conventions: `.github/workflows/validate-skills.yml` ### Notes - All skills intentionally include Sail/non‑Sail command pairs to avoid platform lock‑in. - Insights is treated as optional; Pint and static analysis (PHPStan/Psalm) are encouraged as baselines.
Current listing version
0.0.1
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供了 Laravel 开发中关于性能、安全、测试、架构和依赖项约束条件的详细指导
- 具有明确的实用价值,适用于 Laravel 开发者群体
Highlights
- description 字段清晰描述了 Skill 的功能
- 触发词完整且边界清晰,覆盖多种变体
Highlights
- 文档结构清晰,包含多个章节和示例
- frontmatter 完整,单文件未超过 500 行
Highlights
- 文档内容可靠,提供了具体的约束条件和示例
- 未发现执行漏洞
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 75, 76
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
"Testing requirements for authentication: Test successful login with valid credentials Test failed login with invalid credentials Test rate limiting (max 5 attempts per minute) Test token expiration after 24 hours Test logout invalidates token Use `RefreshDatabase` trait No external API calls in tests (use mocks)"
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.