A Laravel package for installing Agent OS and related code quality tools into Laravel applications.
This package is designed to be used during the initial setup of Agent OS in Laravel projects.
- PHP 8.2+
- Laravel 11.0+
- Composer 2.0+
- PHP 8.4+
- Laravel 12.0+
The installer will set up the following tools and configurations:
- PestPHP - Modern testing framework (minimum: Pest 3.0)
- Laravel Pint - Code formatting and style fixing
- PHPStan/Larastan - Static analysis (minimum: level 5, recommended: level 6)
- Rector - Automated code refactoring with Laravel rules
- Tighten Duster - Unified code quality command (runs Pint, TLINT, and more)
- Laravel Debugbar - Development debugging tool
- Laravel IDE Helper - IDE autocompletion for Laravel
The installer adds standardized Composer scripts to your composer.json:
composer test- Run tests with config clearingcomposer test-parallel- Run tests in parallelcomposer lint- Fix code style with Dustercomposer rector- Run Rector refactoringcomposer stan- Run PHPStan static analysiscomposer ready- Run full quality check (rector, lint, stan, test)composer report- Run quality check with non-blocking failurescomposer coverage- Generate test coverage reportcomposer coverage-html- Generate HTML coverage reportcomposer types- Check type coverage
Note: If existing scripts conflict with these definitions, you'll be prompted to confirm overwriting them. These scripts are required for Agent OS commands to function properly.
- Agent OS - AI-assisted development framework from Builder Methods
We install our own opinionated fork of Agent OS, which includes a Laravel profile. This fork is available on GitHub. If you already have Agent OS installed, we will simply copy our Laravel profile into your existing Agent OS installation. If you already have a profile called Laravel, we will assume you have things set up the way you want them and completely skip the Agent OS installation portion of this.
The reason that we install all of those code quality tools is that in our Laravel profile, the instructions mention things like composer report and composer ready, which are scripts that run all this tooling to ensure that everything is truly up to our specifications.
This package includes a web viewer for browsing Agent OS documentation directly in your Laravel application. The viewer provides a GitHub-style interface for viewing your product documentation, specs, and other Agent OS files.
- GitHub-Flavored Markdown Rendering - Full GFM support with syntax highlighting
- Dark Mode Support - Automatic theme switching based on system preference
- Product Documentation View - Concatenated view of
.agent-os/product/folder - Spec Viewer - Unified view of specs with automatic concatenation of spec.md, sub-specs, and tasks
- Smart Internal Links -
@.agent-os/...references automatically convert to anchor links for same-page navigation - Sidebar Navigation - Browse all specs, product docs, and README
- Access Control - Configurable middleware with gate support
The viewer can be configured via config/agent-os-installer.php:
'viewer' => [
'enabled' => env('AGENT_OS_VIEWER_ENABLED', true),
'route_prefix' => env('AGENT_OS_ROUTE_PREFIX', 'agent-os'),
'middleware' => ['web'],
'gate' => null, // Optional gate name for authorization
'paths' => [], // Additional documentation paths to include
'default_view' => 'product', // 'product' or 'readme'
],AGENT_OS_VIEWER_ENABLED- Enable/disable the viewer (default:true)AGENT_OS_ROUTE_PREFIX- Route prefix for the viewer (default:agent-os)
By default, the viewer is accessible in local environments and requires authentication in production. You can customize this by:
- Custom Gate: Set a gate name in the config:
'viewer' => [
'gate' => 'view-agent-os-docs',
],Then define the gate in your AuthServiceProvider:
Gate::define('view-agent-os-docs', function ($user) {
return $user->is_admin;
});- Custom Middleware: Add your own middleware to the config:
'viewer' => [
'middleware' => ['web', 'auth', 'can:view-docs'],
],Once installed, visit /agent-os (or your configured route prefix) in your browser to view the documentation.
The viewer supports Agent OS reference links using the @ prefix:
See @.agent-os/product/mission.md for more details.
Review @.agent-os/specs/2025-11-01-my-spec/sub-specs/technical-spec.md
Check @.agent-os/specs/2025-11-01-my-spec/tasks.md for task listWithin the same spec, these automatically become anchor links for smooth in-page navigation.
MIT