Skip to content

Commit 6368c31

Browse files
herbertrothclaude
andcommitted
Add project configuration and documentation
- Add CLAUDE.md with project guidelines and commands - Add Claude agents configuration directory - Update Claude command files with project-specific instructions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 2ce20af commit 6368c31

File tree

4 files changed

+130
-0
lines changed

4 files changed

+130
-0
lines changed

.claude/agents/code-reviewer.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: code-reviewer
3+
description: Use this agent when you need comprehensive code review and quality assurance analysis. Examples: After implementing a new feature or function, when refactoring existing code, before merging pull requests, when debugging performance issues, or when ensuring code meets project standards. Example usage: User writes a new authentication function and says 'I just implemented user login functionality, can you review it?' - the assistant should use the code-reviewer agent to analyze the code for security vulnerabilities, best practices, and maintainability.
4+
model: sonnet
5+
color: green
6+
---
7+
8+
You are an expert software engineer specializing in code review and quality assurance. Your primary role is to analyze code for adherence to best practices, maintainability, performance, security, and project-specific standards.
9+
10+
When reviewing code, you will:
11+
12+
**Analysis Framework:**
13+
1. **Functionality**: Verify the code works as intended and handles edge cases appropriately
14+
2. **Security**: Identify potential vulnerabilities, input validation issues, and security anti-patterns
15+
3. **Performance**: Assess algorithmic efficiency, resource usage, and potential bottlenecks
16+
4. **Maintainability**: Evaluate code clarity, documentation, naming conventions, and structural organization
17+
5. **Best Practices**: Check adherence to language-specific conventions and industry standards
18+
6. **Project Standards**: Ensure consistency with existing codebase patterns and established guidelines
19+
20+
**Review Process:**
21+
- Begin with a brief summary of what the code does
22+
- Identify strengths and positive aspects first
23+
- Highlight critical issues (security, bugs) with HIGH priority
24+
- Note performance concerns with MEDIUM priority
25+
- Suggest style and maintainability improvements with LOW priority
26+
- Provide specific, actionable recommendations with code examples when helpful
27+
- Consider the broader context and impact on the overall system
28+
29+
**Output Structure:**
30+
- **Summary**: Brief overview of the code's purpose and overall assessment
31+
- **Critical Issues**: Security vulnerabilities, bugs, or breaking changes
32+
- **Performance Concerns**: Efficiency improvements and optimization opportunities
33+
- **Code Quality**: Maintainability, readability, and best practice adherence
34+
- **Recommendations**: Specific, prioritized suggestions for improvement
35+
36+
Always be constructive and educational in your feedback. When suggesting changes, explain the reasoning behind your recommendations. If the code is well-written, acknowledge this and highlight what makes it effective.

.claude/commands/create-new.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Please create new Contract for $ARGUMENTS.
2+
3+
Follow these steps:
4+
5+
1. Create new Contract Interfaces (`src/Contract/*/`): Public API interfaces for $ARGUMENTS
6+
2. Create new Contract Implementations (`src/Contract/*/`): Wrap static calls for $ARGUMENTS
7+
3. Create new Bundle Interfaces (`src/*/`): Internal interfaces extending contracts for $ARGUMENTS
8+
4. Create new Bundle Implementations (`src/*/`): Final implementations marked `@internal` for $ARGUMENTS
9+
10+
Remember to use the `src/Contract` directory for public API interfaces and the `src` directory for internal bundle implementations.
11+
Remember to create tests for the new contract and bundle implementations.
12+
Remember to use the same naming conventions as existing contracts and bundles.
13+
Remember to use the same namespace structure as in the wrapped class.
14+
- E.g Class to wrap: Pimcore\Model\Document\Hardlink\Service.php
15+
- Contract Interface: `src/Contract/Models/Document/Hardlink/ServiceResolverContractInterface.php`
16+
- Contract Implementation: `src/Contract/Models/Document/Hardlink/ServiceResolverContract.php`
17+
- Bundle Interface: `src/Models/Document/Hardlink/ServiceResolverInterface.php`
18+
- Bundle Implementation: `src/Models/Document/Hardlink/ServiceResolver.php`
19+
- Unit Test: `tests/Unit/Models/Document/Hardlink/ServiceResolverTest.php`
20+
- E.g Class to wrap: Pimcore\Model\Document\Hardlink\Wrapper\Email.php
21+
- Contract Interface: `src/Contract/Models/Document/Hardlink/Wrapper/EmailResolverContractInterface.php`
22+
- Contract Implementation: `src/Contract/Models/Document/Hardlink/Wrapper/EmailResolverContract.php`
23+
- Bundle Interface: `src/Models/Document/Hardlink/Wrapper/EmailResolverInterface.php`
24+
- Bundle Implementation: `src/Models/Document/Hardlink/Wrapper/EmailResolver.php`
25+
- Unit Test: `tests/Unit/Models/Document/Hardlink/Wrapper/EmailResolverTest.php`
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Please check local changes for new line:
2+
3+
Follow these steps:
4+
5+
1. Use `git diff` to check the current state of the repository
6+
3. Ignore changes in the `vendor` directory.
7+
2. Check if every php file ends with a new line and ad if not
8+

CLAUDE.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Common Development Commands
6+
7+
### Testing
8+
- Run all tests: `vendor/bin/codecept run`
9+
- Run unit tests only: `vendor/bin/codecept run Unit`
10+
- Run tests with coverage: `vendor/bin/codecept run --coverage`
11+
12+
### Code Quality
13+
- Run PHPStan static analysis: `vendor/bin/phpstan analyse`
14+
- Check PHPStan configuration in `phpstan.neon` (level 6)
15+
16+
### Installation
17+
- Install dependencies: `composer install`
18+
- Install with dev dependencies: `composer install --dev`
19+
20+
## Architecture Overview
21+
22+
This is a Pimcore bundle that wraps static method calls in service-oriented architecture. The bundle follows a consistent 4-layer pattern:
23+
24+
### Core Architecture Pattern
25+
1. **Contract Interfaces** (`src/Contract/*/`): Public API interfaces (e.g., `DbResolverContractInterface`)
26+
2. **Contract Implementations** (`src/Contract/*/`): Wrap static calls (e.g., `DbResolverContract`)
27+
3. **Bundle Interfaces** (`src/*/`): Internal interfaces extending contracts (e.g., `DbResolverInterface`)
28+
4. **Bundle Implementations** (`src/*/`): Final implementations marked `@internal` (e.g., `DbResolver`)
29+
30+
### Key Components
31+
- **Resolver Services**: Transform static calls into injectable services for better testability
32+
- **Proxy Services**: Handle dynamic method interception (deprecated functionality)
33+
- **DI Container**: Auto-configured services via `config/services.yaml`
34+
35+
### Directory Structure
36+
- `src/Contract/`: Public API contracts for third-party developers
37+
- `src/Db/`, `src/Lib/`, `src/Models/`: Bundle-specific implementations (internal use)
38+
- `src/Proxy/`: Legacy proxy functionality (deprecated)
39+
- `tests/Unit/`: Comprehensive unit test coverage
40+
41+
## Development Guidelines
42+
43+
### Adding New Resolvers
44+
1. Create contract interface in `src/Contract/[Category]/`
45+
2. Implement contract wrapping static calls
46+
3. Create bundle-specific interface extending contract
47+
4. Create final implementation marked `@internal`
48+
49+
### Service Registration
50+
Services are auto-registered via PSR-4 in `config/services.yaml`. Manual registration only needed for interface bindings.
51+
52+
### Testing Strategy
53+
- All resolvers have corresponding unit tests in `tests/Unit/`
54+
- Tests use Codeception framework
55+
- Coverage reports enabled in `codeception.dist.yml`
56+
57+
## Important Notes
58+
- Contract interfaces are public API for third-party developers
59+
- Bundle-specific interfaces marked `@internal` are for Pimcore internal use only
60+
- Bundle provides migration path from static methods to dependency injection
61+
- PHPStan baseline exists (`phpstan-baseline.neon`) for existing code

0 commit comments

Comments
 (0)