Specifying constraints

From jpcaparas/superpowers-laravel · View interactive version

Specifying constraints is an AI agent skill from the GitHub repository jpcaparas/superpowers-laravel. Define clear constraints—performance, security, testing, architecture, dependencies—so AI generates code that meets your project standards

How to use this skill

Skill file

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:

Database Performance

"Query orders with performance constraints:

Security Constraints

Vague

"Make it secure"

Specific

"Implement user profile update with security requirements:

API Security

"Secure the payment API:

Testing Constraints

Vague

"Add tests"

Specific

"Test the order processing feature:

Test Requirements

"Testing requirements for authentication:

Architectural Constraints

Patterns to Follow

"Implement payment processing following our architecture:

Patterns to Avoid

"Implement user management with these constraints:

Dependency Constraints

Version Requirements

"Add image processing feature:

Package Selection

"Choose a package for PDF generation:

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:

Clear constraints = code that fits your project.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.