interfaces-and-autowiring — скилл для Claude Code: обзор и запуск
Скилл interfaces-and-autowiring настраивает внедрение зависимостей в проектах на Symfony: привязывает интерфейсы, расставляет атрибуты #[Target], #[Autowire] и декорирует сервисы без правок контейнера вручную.
MIT ★ 234 обновлён 2026-10-05
npx skills add dev-toolings/superpowers-symfony --skill interfaces-and-autowiring -a claude-codeЧто делает interfaces-and-autowiring
Скилл направляет Claude Code при проектировании архитектуры на Symfony DI. Агент учится выделять узкие интерфейсы под конкретные задачи, связывать альтернативные реализации через именованные псевдонимы и атрибут #[Target], а также собирать коллекции тегированных сервисов через #[AutowireIterator]. Для чтения кодовой базы скилл использует инструменты Read, Glob и Grep.
Все зависимости оформляются через конструктор со свойствами private readonly. Скилл прямо запрещает внедрение через сеттеры и прямое обращение к сервисному контейнеру, требуя делать сервисы final и расширять логику через #[AsDecorator]. Итоговую конфигурацию обязательно сверяют через консольную команду debug:autowiring.
Какие задачи решает
- развязать сервисы от конкретных классов для удобной подмены в тестах
- выбрать нужную реализацию интерфейса с помощью атрибута
#[Target] - навесить логирование или кеширование через декоратор
#[AsDecorator] - внедрить скалярные параметры или тегированную коллекцию сервисов
- устранить ошибки автовайринга при неоднозначном типе зависимости
Примеры запросов агенту
- Помоги развязать OrderProcessor от конкретного класса базы и настрой автовайринг через интерфейс.
- У нас две реализации MailerInterface: свяжи нужную для UserNotifier через атрибут #[Target].
- Добавь кеширование для CatalogRepository через #[AsDecorator] без изменения исходного класса.
Как установить interfaces-and-autowiring
1Через Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill interfaces-and-autowiring -a claude-code2Вручную: положить файлы
~/.claude/skills/interfaces-and-autowiring/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/interfaces-and-autowiring/
1Через Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill interfaces-and-autowiring -a codex2Вручную: положить файлы
.agents/skills/interfaces-and-autowiring/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill interfaces-and-autowiring -a cursor2Вручную: положить файлы
.cursor/skills/interfaces-and-autowiring/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install dev-toolings/superpowers-symfony content/skills/interfaces-and-autowiring2Вручную: положить файлы
.github/skills/interfaces-and-autowiring/SKILL.md1Через Skills CLI (Vercel)
npx skills add dev-toolings/superpowers-symfony --skill interfaces-and-autowiring -a gemini-cli2Командой платформы
gemini skills install https://github.com/dev-toolings/superpowers-symfony --path content/skills/interfaces-and-autowiringВручную: положить файлы
.devin/skills/interfaces-and-autowiring/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы об interfaces-and-autowiring
Как установить interfaces-and-autowiring в Claude Code?
Выполните команду npx skills add dev-toolings/superpowers-symfony --skill interfaces-and-autowiring -a claude-code. Также файл скилла можно положить напрямую в ~/.claude/skills/interfaces-and-autowiring/SKILL.md.
Что делает скилл interfaces-and-autowiring?
Он задаёт правила внедрения зависимостей Symfony: настраивает конструкторы private readonly, декорирование через #[AsDecorator] и выбор реализаций атрибутами вместо ручной правки YAML-конфигов.
Как скилл проверяет корректность автовайринга?
Регламент скилла требует валидировать результат выводом консольной команды debug:autowiring для всех затронутых типов.
Исходный текст
SKILL.md · MIT
--- name: interfaces-and-autowiring description: "Master Symfony Dependency Injection with autowiring, #[Target] interface binding, decoration, and tagged services" capabilities: [read, search] tags: [architecture] # projected by `bun run build` — do not edit by hand allowed-tools: - Read - Glob - Grep --- # Interfaces And Autowiring (Symfony) ## Use when - A service depends on a concrete class and must be swappable or replaced in tests. - Several implementations of one interface exist and the right one must be injected. - Adding cross-cutting behavior (logging, caching, retries) around an existing service. - Injecting scalars, parameters, env vars, or every service carrying a tag. - Autowiring fails with "cannot autowire" or an ambiguous type. ## Default workflow 1. Extract a focused interface for what the consumer actually needs. 2. Let autowiring bind it when there is a single implementation. 3. With several implementations, pick one per consumer through a named alias and `#[Target]`. 4. Add behavior around a service with `#[AsDecorator]` instead of editing or extending it. 5. Inject scalars with `#[Autowire]` and tagged collections with `#[AutowireIterator]`. 6. Confirm the result with `debug:autowiring` for each type involved. ## Guardrails - Constructor injection with `private readonly` dependencies; no setter injection, no container access. - Keep interfaces small: one consumer need per interface. - Make services `final` by default and decorate them rather than extend them. - Use lazy services or service closures only for expensive dependencies that some paths skip. ## Progressive disclosure - Use this file for execution posture and risk controls. - Open references when deep implementation details are needed. ## Output contract - Interfaces and the bindings or aliases that select each implementation. - Decorators or tagged collections, with their priority. - The `debug:autowiring` output for the types involved. ## References - `reference.md`
© dev-toolings · MIT · dev-toolings/superpowers-symfony