2026-01-28 14:14:53 +00:00
# CLAUDE.md
2026-01-26 23:25:24 +00:00
2026-01-28 14:14:53 +00:00
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
2026-01-26 23:25:24 +00:00
2026-01-28 14:14:53 +00:00
## Package Overview
2026-01-26 23:25:24 +00:00
2026-01-28 14:14:53 +00:00
`host-uk/core-uptelligence` - A Laravel module for upstream vendor tracking and dependency intelligence. Tracks software vendors (licensed, OSS, plugins), analyses version diffs with AI, generates upgrade todos, and dispatches digest notifications.
**Namespace:** `Core\Mod\Uptelligence\`
2026-01-26 23:25:24 +00:00
## Commands
```bash
2026-01-28 14:14:53 +00:00
composer run lint # Format with Pint
composer run test # Run all tests with Pest
./vendor/bin/pest --filter="test name" # Run single test
./vendor/bin/pint --dirty # Format only changed files
2026-01-26 23:25:24 +00:00
```
2026-01-28 14:14:53 +00:00
**Artisan commands** (when installed in a host application):
```bash
php artisan upstream:check # Check vendors for updates
php artisan upstream:analyze # Analyse version diffs
php artisan upstream:issues # Generate issues from todos
php artisan upstream:check-updates # Check external registries
php artisan upstream:send-digests # Send digest emails
2026-01-26 23:25:24 +00:00
```
2026-01-28 14:14:53 +00:00
## Architecture
This is a **standalone Laravel package** (not an application). It registers as a service provider via `Boot.php` .
### Key Components
| Layer | Location | Purpose |
|-------|----------|---------|
| Boot | `Boot.php` | Service provider, event listeners, rate limiters |
| Models | `Models/` | Eloquent: Vendor, VersionRelease, UpstreamTodo, Asset, etc. |
| Services | `Services/` | Business logic: AI analysis, diff generation, webhooks |
| Commands | `Console/` | Artisan commands for CLI operations |
| Admin UI | `View/Modal/Admin/` | Livewire modals for admin panel |
| API | `Controllers/Api/` | Webhook receiver endpoints |
### Service Layer
2026-01-26 23:25:24 +00:00
2026-01-28 14:14:53 +00:00
Services are registered as singletons in `Boot.php` :
- `VendorStorageService` - File storage (local/S3)
- `VendorUpdateCheckerService` - Registry polling (Packagist, npm)
- `DiffAnalyzerService` - Version diff generation
- `AIAnalyzerService` - Anthropic/OpenAI code analysis
- `IssueGeneratorService` - GitHub/Gitea issue creation
- `UptelligenceDigestService` - Email digests
- `WebhookReceiverService` - Inbound webhook processing
### Event Registration
```php
public static array $listens = [
AdminPanelBooting::class => 'onAdminPanel',
ApiRoutesRegistering::class => 'onApiRoutes',
ConsoleBooting::class => 'onConsole',
];
```
2026-01-26 23:25:24 +00:00
## Conventions
2026-01-28 14:14:53 +00:00
- **UK English** - colour, organisation, analyse (not American spellings)
- **Strict types** - `declare(strict_types=1);` in every PHP file
- **Full type hints** - Parameters and return types required
- **PSR-12** - Laravel Pint for formatting
- **Pest** - Not PHPUnit directly
- **Livewire + Flux Pro** - Admin UI components
2026-01-26 23:25:24 +00:00
2026-01-28 14:14:53 +00:00
## Testing
2026-01-26 23:25:24 +00:00
2026-01-28 14:14:53 +00:00
Tests live in `tests/` . The package uses Orchestra Testbench for Laravel testing in isolation.
```bash
composer run test # All tests
./vendor/bin/pest tests/Unit/ # Unit tests only
./vendor/bin/pest tests/Feature/ # Feature tests only
./vendor/bin/pest --filter="VendorTest" # Specific test class
```
## License
2026-01-26 23:25:24 +00:00
2026-01-28 14:14:53 +00:00
EUPL-1.2 (copyleft for the `Core\` namespace)