Invoke before configuring Nette DI - services, .neon files, autowiring.
View on GitHubnette/claude-code
nette
January 20, 2026
Select agents to install to:
npx add-skill https://github.com/nette/claude-code/blob/main/plugins/nette/skills/nette-configuration/SKILL.md -a claude-code --skill nette-configurationInstallation paths:
.claude/skills/nette-configuration/## Nette DI & Services Guidelines
- **Primary services:** `services.neon` - all service definitions
- **Framework config:** `common.neon` - parameters, extensions, framework settings, application-wide configuration
- **Project scaling:** Create additional files for larger projects (`api.neon`, `tasks.neon`)
- **Environment-specific settings:** `env.local.neon` for development environment, `env.prod.neon` for production environment
### When to Add Sections
- **Start minimal** - Add only what you immediately need
- **Add incrementally** - Include sections as features are implemented
- **Environment-specific** - Override in local/production configs as needed
### Service Definition Syntax
Use `-` for services that don't need references:
```neon
services:
- App\Model\BlogFacade
- App\Model\CustomerService
- App\Presentation\Accessory\TemplateFilters
```
Give names **only when needed for `@serviceName` references** elsewhere in NEON:
```neon
services:
# Named because referenced as @pohoda
pohoda:
create: Nette\Database\Connection('odbc:Driver={...}')
autowired: false
# Using the reference
- App\Model\PohodaImporter(pohoda: @pohoda)
```
Nette DI **automatically autowires all dependencies by type**. When manually specifying parameters, use **named parameters** if not the first parameter:
```neon
services:
# Good - first parameter, clear order
- App\Model\ImageService(%rootDir%/storage)
# Good - named parameter when mixing with autowiring
- App\Model\CustomerService(ip: %ip%)
- App\Model\BlogFacade(blogPath: %blog%)
```
#### Factory Method Services
```neon
services:
- App\Core\RouterFactory::createRouter
- Symfony\Component\HttpClient\HttpClient::create()
```
#### Complex Service Configuration
```neon
services:
- App\Model\MailImporter(
DG\Imap\Mailbox(
mailbox: '{imap.gmail.com:993/ssl}'
username: 'vi....com'
password: 'nrllp...'
)
debugMode: %debugMode%
)
```
#### Setup Methods
```neon
services:
database:
create: PDO(