Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

code-organization

БесплатноБез исполняемых скриптовНе проверен

Enforce code organization principles - "Directory X contains ONLY class type X", DDD naming patterns, PHP best practices, type safety, SOLID principles, and…

VilnaCRM-Orgот VilnaCRM-Org★ 16 звёзд на GitHub22 установки в других каталогах

Об этом скилле

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 patterns
    • Augmenter/ — not a well-known pattern
    • Helper/, Util/, Manager/ — vague catch-all anti-patterns
    • Service/ — 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
Полный SKILL.md на GitHub

Установить code-organization в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/organization-fixes.mdreference/troubleshooting.md

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), без исполняемых скриптов.

Похожие скиллы

Сравнить code-organization с