diff --git a/src/Tempest/Framework/Installers/AGENTS.md b/src/Tempest/Framework/Installers/AGENTS.md new file mode 100644 index 000000000..a2ae33a60 --- /dev/null +++ b/src/Tempest/Framework/Installers/AGENTS.md @@ -0,0 +1,9 @@ +## General + +- All documentation for Tempest can be found in vendor/tempest/framework/docs +- Use `php tempest make:` commands to create framework-specific classes. + +## Frontend + +- Use TailwindCSS +- Use Tempest view components where it makes sense \ No newline at end of file diff --git a/src/Tempest/Framework/Installers/FrameworkInstaller.php b/src/Tempest/Framework/Installers/FrameworkInstaller.php index 48edc7328..82e8e7011 100644 --- a/src/Tempest/Framework/Installers/FrameworkInstaller.php +++ b/src/Tempest/Framework/Installers/FrameworkInstaller.php @@ -44,6 +44,19 @@ public function install(): void }, ); + $this->publish( + source: __DIR__ . '/AGENTS.md', + destination: root_path('AGENTS.md'), + callback: function (string $_, string $destination): void { + $claude = root_path('CLAUDE.md'); + + if (PHP_OS_FAMILY !== 'Windows') { + // @phpstan-ignore-next-line + exec("ln -s {$destination} {$claude}"); + } + }, + ); + $this->updateComposer(); $this->console->call('discovery:generate'); diff --git a/tests/Integration/Core/FrameworkInstallerTest.php b/tests/Integration/Core/FrameworkInstallerTest.php index 1ea18b813..397a03365 100644 --- a/tests/Integration/Core/FrameworkInstallerTest.php +++ b/tests/Integration/Core/FrameworkInstallerTest.php @@ -56,10 +56,20 @@ public function test_it_can_force_install(): void path: '.env', content: file_get_contents(__DIR__ . '/../../../.env.example'), ) + ->assertFileExists( + path: 'AGENTS.md', + content: file_get_contents(__DIR__ . '/../../../src/Tempest/Framework/Installers/AGENTS.md'), + ) ->assertCommandExecuted('composer up'); if (PHP_OS_FAMILY !== 'Windows') { $this->assertTrue(is_executable($this->installer->path('tempest'))); + + $this->installer + ->assertFileExists( + path: 'CLAUDE.md', + content: file_get_contents(__DIR__ . '/../../../src/Tempest/Framework/Installers/AGENTS.md'), + ); } }