This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Laravel package called statamic-context-cli that provides LLM context generation capabilities for Statamic CMS. The package follows Laravel package conventions and uses the Spatie package tools structure.
The goal of this package is to create a CLI tool that enables Claude Code to search through relevant context for Statamic development, including:
- Searching through Statamic documentation
- Providing contextual information for Statamic development tasks
- Enabling more informed assistance with Statamic-specific development questions
composer test- Run all tests using Pest- Use
vendor/bin/testbenchinstead ofartisan- this is a package
composer format- Format code (runs Rector and Pint)composer types- Run type checking with memory limit
composer prepare- Discover packages for testbenchphp artisan vendor:publish --tag="statamic-context-cli-config"- Publish configphp artisan vendor:publish --tag="statamic-context-cli-migrations"- Publish migrationsphp artisan vendor:publish --tag="statamic-context-cli-views"- Publish views
php artisan statamic-context-cli- Run the main package commandphp artisan statamic-context:docs:search- Search Statamic documentationphp artisan statamic-context:docs:update- Update documentation from GitHubphp artisan statamic-context:docs:rebuild-index- Rebuild search index for better performance
- Main Class:
StatamicContext\StatamicContext\StatamicContext- Empty core class (to be implemented) - Service Provider:
StatamicContextServiceProvider- Registers package components - Command:
StatamicContextCommand- Artisan command interface - Facade:
StatamicContext- Laravel facade for easy access
All classes use the namespace StatamicContext\StatamicContext\
- PHP 8.4+ required
- Laravel 10.0+ / 11.0+ / 12.0+ support
- Uses Spatie Laravel Package Tools for structure
- Testing with Pest framework
- Code quality tools: PHPStan, Rector, Pint
- Config file:
config/statamic-context-cli.php(currently empty) - Database migrations available
- Views can be published
The package uses Pest for testing with Orchestra Testbench:
- Base test class:
StatamicContext\StatamicContext\Tests\TestCase - Factory namespace:
StatamicContext\StatamicContext\Database\Factories\ - Test database configured for SQLite testing
- Uses
declare(strict_types=1)in all PHP files - Follows PSR-4 autoloading
- Uses PHP 8.4+ features including the
#[Override]attribute - Minimum stability: dev with prefer-stable
- After implementing new features or fixes, run:
composer formatto format codecomposer typesto ensure type safetycomposer testto run all tests