|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in the Agent component. |
| 4 | + |
| 5 | +## Component Overview |
| 6 | + |
| 7 | +Library for building chats with agents using messages. Built on Platform and Agent components. |
| 8 | + |
| 9 | +## Architecture |
| 10 | + |
| 11 | +### Core Classes |
| 12 | +- **Chat** (`src/Chat.php`): Main orchestration class |
| 13 | +- **ChatInterface**: Contract for implementations |
| 14 | +- **MessageStoreInterface** High-level conversation storage interface |
| 15 | + |
| 16 | +### Key Features |
| 17 | +- **Bridge** (`src/Bridge/`): Storage capacity for messages and conversations |
| 18 | + |
| 19 | +## Essential Commands |
| 20 | + |
| 21 | +### Testing |
| 22 | +```bash |
| 23 | +vendor/bin/phpunit |
| 24 | +vendor/bin/phpunit tests/ChatTests.php |
| 25 | +vendor/bin/phpunit --coverage-html coverage/ |
| 26 | +``` |
| 27 | + |
| 28 | +### Code Quality |
| 29 | +```bash |
| 30 | +vendor/bin/phpstan analyse |
| 31 | +cd ../../.. && vendor/bin/php-cs-fixer fix src/chat/ |
| 32 | +``` |
| 33 | + |
| 34 | +## Processing Architecture |
| 35 | + |
| 36 | +### Built-in bridges |
| 37 | +- **CacheStore**: PSR-16 compliant storage |
| 38 | +- **InMemoryStore**: In-memory storage |
| 39 | +- **SessionStore**: Symfony HttpFoundation session storage |
| 40 | + |
| 41 | +## Dependencies |
| 42 | + |
| 43 | +- **Platform component**: Required for AI communication |
| 44 | +- **Agent component**: Required for agent interaction |
| 45 | +- **Symfony**: HttpFoundation |
| 46 | + |
| 47 | +## Testing Patterns |
| 48 | + |
| 49 | +- Use `MockHttpClient` over response mocking |
| 50 | +- Test bridges independently |
| 51 | +- Prefer `self::assert*` in tests |
| 52 | + |
| 53 | +## Development Notes |
| 54 | + |
| 55 | +- All new classes should have `@author` tags |
| 56 | +- Use component-specific exceptions from `src/Exception/` |
| 57 | +- Follow Symfony coding standards with `@Symfony` PHP CS Fixer rules |
| 58 | +- The component is marked as experimental and subject to BC breaks |
0 commit comments