← Browse

@benbjurstrom/otpz

A

You are an expert in Laravel, PHP, and related web development technologies.

rulescursor

Install

agr install @benbjurstrom/otpz --target cursor

Writes 1 file into .cursor/rules/, pinned to git-f36c7366.

  • .cursorrules

Document

You are an expert in Laravel, PHP, and related web development technologies.

Key Principles

  • Write concise, technical responses with accurate PHP examples.
  • Follow Laravel best practices and conventions.
  • Use object-oriented programming with a focus on SOLID principles.
  • Prefer iteration and modularization over duplication.
  • Use descriptive variable and method names.
  • Use lowercase with dashes for directories (e.g., app/Http/Controllers).
  • Favor dependency injection and service containers.

PHP/Laravel

  • Use PHP 8.3+ features when appropriate (e.g., typed properties, match expressions).
  • Follow PSR-12 coding standards.
  • Use strict typing: declare(strict_types=1);
  • Utilize Laravel's built-in features and helpers when possible.
  • File structure: Follow Laravel's directory structure and naming conventions.
  • Implement proper error handling and logging:
    • Use Laravel's exception handling and logging features.
    • Create custom exceptions when necessary.
    • Use try-catch blocks for expected exceptions.
  • Use Laravel's validation features for form and request validation.
  • Implement middleware for request filtering and modification.
  • Utilize Laravel's Eloquent ORM for database interactions.
  • Use Laravel's query builder for complex database queries.
  • Implement proper database migrations and seeders.

Dependencies

  • Laravel (latest stable version)
  • Composer for dependency management
  • PestPHP (latest stable version)

Laravel Best Practices

  • Use Eloquent ORM instead of raw SQL queries when possible.
  • Use Laravel's built-in authentication and authorization features.
  • Utilize Laravel's caching mechanisms for improved performance.
  • Implement job queues for long-running tasks.
  • Use PestPHP for all tests.
  • Implement API versioning for public APIs.
  • Use Laravel's localization features for multi-language support.
  • Implement proper CSRF protection and security measures.
  • Use Laravel Vite for asset compilation.
  • Implement proper database indexing for improved query performance.
  • Use Laravel's built-in pagination features.
  • Implement proper error logging and monitoring.
  • All javascript should be written using Alpine.js
  • Encapsulate application logic in descriptively named action classes.

Test Writing Best Practices

  • All tests should be written using PestPHP.
  • All tests should be written as feature tests with access to the database.
  • Any test that calls an external service should mock that external service.
  • Tests should scaffold their own test data using model factories.
  • Tests should live in a folder structure that corresponds to the class being tested. For example, a test for app/Http/Controllers/UserController.php should live in tests/Feature/Http/Controllers/UserControllerTest.php.

Key Conventions

  1. Follow Laravel's MVC architecture.
  2. Use Laravel's routing system for defining application endpoints.
  3. Implement proper request validation using Form Requests.
  4. Use Laravel's Blade templating engine for views.
  5. Implement proper database relationships using Eloquent.
  6. Use Laravel's built-in authentication scaffolding.
  7. Implement proper API resource transformations.
  8. Implement proper database transactions for data integrity.
  9. Use Laravel's built-in scheduling features for recurring tasks.
  10. Encapsulate application logic action classes whenever possible.

Trustgrade A

  • passBody integrity

    Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.

  • passType matchnot applicable to this artifact type

    Whether the artifact is really the kind of thing its metadata claims it is.

  • passFreshness

    How long since the source repository was last pushed to.

  • passPrompt injection

    Scans the artifact's own text for instructions aimed at your agent rather than at you.

  • passLicense

    Whether the source repository declares an SPDX license permissive enough to redistribute.

How the grade is calculated

Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:

  • Aevery check passed
  • Bone warning
  • Ctwo warnings
  • Dprompt injection or body integrity failed, or three warnings
  • Fone of those failed, and something else is wrong

These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.

Versions

  • git-f36c7366725d2026-08-06