code-organization
БесплатноБез исполняемых скриптовНе проверенEnforce code organization principles - "Directory X contains ONLY class type X", DDD naming patterns, PHP best practices, type safety, SOLID principles, and…
Об этом скилле
Code Organization Skill
Core Principle
Directory X contains ONLY class type X
This is the fundamental rule for code organization in this codebase.
Context (Input)
- Creating new classes and determining correct directory
- Moving classes to proper locations
- Reviewing code for organizational compliance
- Fixing organizational issues from code reviews
- Ensuring class names match their responsibilities
- Refactoring code structure (moving, renaming, splitting classes)
- Fixing CI failures that stem from structural/naming issues
- Extracting hardcoded config values (TTLs, timeouts, limits) to
.env
Task (Function)
Enforce strict code organization principles: proper directory structure, DDD naming conventions, specific variable names, type safety, SOLID principles, and PHP best practices.
Directory Type Classification
Classes MUST be in directories matching their type:
| Directory | Contains ONLY | Example |
|---|---|---|
Converter/ |
Type converters | UlidTypeConverter |
Transformer/ |
Data transformers (DB/serial) | CustomerToArrayTransformer |
Validator/ |
Validation logic | UlidValidator |
Builder/ |
Object builders | QueryBuilder |
Fixer/ |
Data fixers/modifiers | DataFixer |
Factory/ |
Object factories | CustomerFactory |
Resolver/ |
Value resolvers | CustomerUpdateScalarResolver |
Serializer/ |
Serializers/normalizers | CustomerNormalizer |
Formatter/ |
Data formatters | CustomerNameFormatter |
Mapper/ |
Data mappers | PathsMapper |
Provider/ |
Data/service providers | TimestampProvider |
Processor/ |
API Platform processors | CreateCustomerProcessor |
EventListener/ |
Event listeners (Symfony) | QueryParameterValidationListener |
EventSubscriber/ |
Event subscribers (Symfony/App) | SendEmailOnCustomerCreated |
Directory Creation Guardrails
- NEVER create new directories autonomously — every new class-type directory MUST follow a well-known software engineering pattern (Factory, Builder, Processor, Validator, Provider, Resolver, etc.) AND be explicitly requested/approved by the user. When in doubt, use an existing directory.
- Do not invent ad-hoc class-type directories or suffixes. The following are explicitly forbidden:
Applier/,Attacher/,Enricher/— not well-known patternsAugmenter/— not a well-known patternHelper/,Util/,Manager/— vague catch-all anti-patternsService/— leads to anemic domain models; use specific pattern names instead (Provider, Factory, Resolver, etc.)
- Any proposed new directory MUST be a well-known software engineering pattern (e.g. Factory, Builder, Strategy, Observer, Adapter, Decorator, Proxy, Iterator, Mediator, etc.) — not an invented verb-noun.
- Use existing DDD/CQRS directory types and naming patterns from this skill.
- Follow DDD and CQRS strictly — all class organization must align with established DDD layers and CQRS patterns.
DDD Naming Patterns
By Layer and Type
| Layer | Class Type | Naming Pattern | Example |
|---|---|---|---|
| Domain | Entity | {EntityName}.php |
Customer.php |
| Value Object | {ConceptName}.php |
Email.php, Money.php |
|
| Domain Event | {Entity}{PastTenseAction}.php |
CustomerCreated.php |
|
| Repository Iface | {Entity}RepositoryInterface.php |
CustomerRepositoryInterface.php |
|
| Exception | {SpecificError}Exception.php |
InvalidEmailException.php |
|
| Application | Command | {Action}{Entity}Command.php |
CreateCustomerCommand.php |
| Command Handler | {Action}{Entity}Handler.php |
CreateCustomerHandler.php |
|
| Event Subscriber | {Action}On{Event}.php |
SendEmailOnCustomerCreated.php |
|
| DTO | {Entity}{Type}.php |
CustomerInput.php |
|
| Processor | {Action}{Entity}Processor.php |
`Cre |
Установить code-organization в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл code-organization?
Enforce code organization principles - "Directory X contains ONLY class type X", DDD naming patterns, PHP best practices, type safety, SOLID principles, and hardcoded config extraction to .env. Use when reviewing code structure, placing classes, refactoring, fixing CI failures related to structure, or extracting hardcoded configuration values.
Как установить скилл code-organization?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл code-organization запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic