Download the PHP package mrkoopie/laravel-ai-harness without Composer

On this page you can find all versions of the php package mrkoopie/laravel-ai-harness. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-ai-harness

Laravel AI Harness

Laravel AI Harness installs and refreshes the files that make AI agents useful in a Laravel project: agent instructions, MCP configuration, local runtime helpers, worktree setup hooks, and repeatable quality guidance.

The package is intentionally conservative. Human-editable files receive managed blocks, generated scripts/config files are package-owned, and optional workspace features such as Herd linking, Docker database bootstrap files, and Polyscope metadata are opt-in.

Requirements

Installation

The install command writes the initial harness files and adds this guarded command to Composer post-install-cmd and post-update-cmd:

After the first install, Composer refreshes managed harness files on every composer install and composer update. The guard lets production composer install --no-dev skip the harness when the package is installed as a development dependency.

Where To Configure Everything

Most teams configure the harness in four places:

Publish the config file with Laravel's vendor publishing workflow:

The config file controls default features, project naming, generated database names, PHP version hints, and the default worktree base ref. One-off features can also be selected per run:

When ai-harness:install is run with --with=* flags, those flags are preserved in the Composer hook.

Defaults

These features are enabled by default:

Feature Default What It Does
Base guidance Always on Writes managed blocks to AGENTS.md, CLAUDE.md, and .gitignore; writes shared MCP config to .ai/mcp/mcp.json; writes the runtime helper to .dev/bin/ai-harness.
Codex AI_HARNESS_CODEX=true Writes a managed block to .codex/config.toml and writes .codex/environments/environment.toml, .codex/hooks.json, and .codex/scripts/local-environment.sh. When the generated Codex local environment is selected for a worktree, setup copies .env.example to .env, configures a per-worktree APP_URL, app database, and companion testing database, runs composer install when vendor/ is missing, generates APP_KEY when needed, runs app and testing migrations, writes an ignored generated PHPUnit config for the testing database, and runs ai-harness:doctor. Cleanup removes the generated PHPUnit config, restores legacy managed PHPUnit patches when present, and removes isolated app/testing databases when they are owned by the worktree. The generated SessionStart hook is a fallback that provisions Codex-managed worktrees only after the project hook is trusted.
Claude AI_HARNESS_CLAUDE=true Writes .claude/settings.json plus .claude/scripts/worktree-up.sh and .claude/scripts/worktree-down.sh. Claude EnterWorktree, ExitWorktree, and worktree SessionStart hooks delegate to the same generated local-environment script used by Codex. Main-checkout session starts are guarded and only run the doctor check. Claude-local harness skill files are written when skills are enabled.
Skills AI_HARNESS_SKILLS=true Writes local skill documentation to .agents/skills/laravel-ai-harness/SKILL.md and .claude/skills/laravel-ai-harness/SKILL.md.

These features are disabled by default:

Feature Default What It Does When Enabled
Herd workspace automation AI_HARNESS_HERD=false Generated Codex and Claude worktree setup links and secures the worktree in Laravel Herd with a deterministic site name, sets APP_URL to the HTTPS Herd site, provisions isolated app/testing databases, and cleanup removes those owned databases and unlinks the site. The runtime helper can still use herd php artisan as a fallback even when this automation is disabled.
Docker database bootstrap AI_HARNESS_DOCKER=false Writes docker/mysql/init/10-create-testing-database.sh for creating the testing database with the configured charset and collation.
Polyscope AI_HARNESS_POLYSCOPE=false Writes polyscope.json workspace metadata.

Configuration Reference

Generated project metadata is derived from existing harness context before falling back to the directory name. Pin it when the generated names should not change across machines or worktree paths:

AI_HARNESS_WORKTREE_BASE_REF defaults to an available origin/main ref. If that ref is absent, it uses the repository's origin/HEAD target, falling back to the literal origin/main ref when no remote metadata exists.

Commands

ai-harness:install writes the harness and patches Composer scripts.

ai-harness:update refreshes package-managed files and blocks.

ai-harness:doctor checks whether the selected harness surface exists and prints the registered agent/runtime drivers.

All commands accept --path=/path/to/project for validation apps, tests, or non-standard project roots.

Development Workflow

For a Laravel application using this package:

  1. Install the package with Composer and run php artisan ai-harness:install.
  2. Publish config/ai-harness.php if the team wants committed defaults.
  3. Put local overrides in .env.
  4. Keep custom instructions outside the <!-- ai-harness:start --> / <!-- ai-harness:end --> blocks.
  5. Commit the generated harness files before creating Codex or Claude worktrees. Git worktrees are created from a commit, so an uncommitted package install in the main checkout will not exist in new worktrees.
  6. Run php artisan ai-harness:doctor after changing feature flags.
  7. Let Composer refresh managed files during composer install and composer update, or run php artisan ai-harness:update manually after package upgrades.

For Codex App worktrees, choose the generated local environment named <app name> Codex worktree in the new thread view. Codex runs .codex/environments/environment.toml as the worktree setup/cleanup environment. If you rely on .codex/hooks.json instead, review and trust the project hook first; Codex skips untrusted project command hooks. The hook is guarded so it only runs full setup under $CODEX_HOME/worktrees/* and does not provision the source checkout. Codex local-environment selection and project-hook trust are user/app security state; the package cannot preselect or trust them from committed project files.

For Claude Code worktrees, the generated .claude/settings.json hooks call .claude/scripts/worktree-up.sh after EnterWorktree, call .claude/scripts/worktree-down.sh before ExitWorktree removal, and retry setup once on worktree SessionStart if the provision marker is missing.

For package development in this repository:

PHPStan uses Larastan. Run it through composer analyse, which passes --memory-limit=1G for Laravel package analysis.

The GitHub Actions workflow runs Pest against Laravel 11, 12, and 13 dependency lines, includes PHP 8.5 coverage on the latest Laravel line, then runs Composer validation, Pint, and PHPStan in a separate quality job.

Laravel Sail Compatibility

The generated .dev/bin/ai-harness helper detects Sail first. When ./vendor/bin/sail exists and the Sail app service is running in Docker Compose (APP_SERVICE, or laravel.test by default), harness commands execute through Sail:

That command resolves to:

If the Sail app service is not running, the helper falls back to herd php artisan when Herd exists, then to plain php artisan.

Sail projects do not need a special install path:

The package does not rewrite compose.yaml. If you enable the Docker database bootstrap file with --with=docker, mount or copy docker/mysql/init/10-create-testing-database.sh into your Sail MySQL service only if your project wants MySQL to create the testing database during container startup.

Worktree Automation

Herd workspace automation is opt-in:

The worktree setup entrypoint is .codex/scripts/local-environment.sh. Codex calls it through .codex/environments/environment.toml when the generated local environment is selected. Claude calls it through .claude/scripts/worktree-up.sh and .claude/scripts/worktree-down.sh.

With Herd enabled, setup links and secures the worktree using a deterministic name based on the worktree directory, its parent directory, and a checksum of the full worktree path. Setup also sets APP_URL to https://<site>.test, configures an isolated app database, creates a companion testing database, runs app and testing migrations, and runs the harness doctor check. The testing database name is written to .env as AI_HARNESS_TEST_DB_DATABASE, and setup writes .ai-harness.phpunit.xml, an ignored generated copy of phpunit.xml beside the project config where PHPUnit receives DB_CONNECTION, DB_DATABASE, and an empty DB_URL with force="true". The .dev/bin/ai-harness test helper automatically passes that repo-relative generated config unless the caller provides --configuration. Cleanup removes the generated config, restores older managed phpunit.xml backups when present, removes both isolated databases when they match the generated worktree names, and unlinks the same Herd site. This keeps temporary worktrees addressable in Herd without leaving stale Herd links, databases, or commit noise after teardown.

For SQLite projects, the isolated app and testing databases are generated files under database/. For MySQL or MariaDB projects, the setup hook creates generated database names using the configured database base name plus the worktree checksum, and cleanup drops only those generated database names.

The runtime helper can still use Herd for Artisan commands without enabling workspace automation:

When the Sail app service is not running and Herd is installed, this resolves to:

Generated Files

Default files:

Optional files:

Laravel Boost

This package ships Laravel Boost resources for package discovery:

After installing Laravel Boost, run php artisan boost:install or php artisan boost:update --discover and select mrkoopie/laravel-ai-harness when Boost asks for third-party guidelines or skills.

Boost and AI Harness own different generated regions. Boost refreshes its <laravel-boost-guidelines> block, while AI Harness refreshes its own <!-- ai-harness:start --> blocks and generated harness files.

Documentation


All versions of laravel-ai-harness with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/console Version ^11.0|^12.0|^13.0
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
spatie/laravel-package-tools Version ^1.92
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mrkoopie/laravel-ai-harness contains the following files

Loading the files please wait ...