Skip to content
Agentmart
Submit a tool

laravel:specifying-constraints

Define clear constraints—performance, security, testing, architecture, dependencies—so AI generates code that meets your project standards

Skill by jpcaparas

IndexedMIT★ 157
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/jpcaparas-laravel-specifying-constraints

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Define clear constraints—performance, security, testing, architecture, dependencies—so AI generates code that meets your project standards

Use cases: testing, security

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/laravel-specifying-constraints

What's inside

Skill name
laravel:specifying-constraints
Description
Define clear constraints—performance, security, testing, architecture, dependencies—so AI generates code that meets your project standards
License
MIT
Instructions
160 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • name: only lowercase letters, digits and single hyphens allowed
  • name: "laravel:specifying-constraints" does not match folder "specifying-constraints"

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Specifying 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_address` in 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:sanctum` middleware
- Validate API tokens have `process-payments` ability
- 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 `RefreshDatabase` trait
- No external API calls in tests (use mocks)"

## Architectural Constraints

### Patterns to Follow
"Implement payment processing following our architecture:
- Use repository pattern: `PaymentRepository` for data access
- Use service layer: `PaymentService` for 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-dompdf` or `spatie/laravel-pdf`"

## Constraint Templates

From jpcaparas/superpowers-laravel, MIT.

More from jpcaparas/superpowers-laravel

Signals

Stars
157
Forks
3
Open issues
0
Last commit (this folder)
Jul 2, 2026 (4 months ago)
Last release
Nov 4, 2025 (11 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from jpcaparas

Cite this page

laravel:specifying-constraints skill. Agent Mart. https://agentmart.dev/skills/jpcaparas-laravel-specifying-constraints (last updated 2026-10-24)