
Symfony:config Env Parameters Skill
- 438 installs
- 190 repo stars
- Updated August 6, 2026
- makfly/superpowers-symfony
symfony:config-env-parameters is a Claude Code skill that guides Symfony developers through .env files, parameters, secrets vault, and environment-specific configuration when binding services, DSNs, and feature flags acr
About
symfony:config-env-parameters is a Symfony Superpowers skill from makfly/superpowers-symfony that manages Symfony configuration with .env files, parameters, secrets vault, and environment-specific settings. The skill follows a checkpoint workflow: map current boundaries and coupling points, propose the smallest coherent config change, execute with validation at each stage, and document tradeoffs plus follow-up backlog items. It opens reference.md for deep guidance on Symfony's six-file .env hierarchy (.env, .env.local, .env.test, .env.test.local, .env.prod, .env.prod.local), DATABASE_URL and MAILER_DSN patterns, feature flags, and secrets handling. Developers reach for symfony:config-env-parameters when wiring new integrations, fixing environment mismatches, or hardening secrets across Symfony 7 projects inside the 44-skill superpowers-symfony plugin bundle.
- .env parameter binding
- secrets and DSN setup
- env-specific config
- service parameter injection
- Symfony config hygiene
Symfony:Config Env Parameters by the numbers
- 438 all-time installs (skills.sh)
- Ranked #17 of 68 PHP & Laravel skills by installs in the Skillselion catalog
- Data as of Aug 11, 2026 (Skillselion catalog sync)
npx skills add https://github.com/makfly/superpowers-symfony --skill symfonyconfig-env-parametersAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 438 |
|---|---|
| repo stars | ★ 190 |
| Last updated | August 6, 2026 |
| Repository | makfly/superpowers-symfony ↗ |
How do you manage Symfony env vars across environments?
Configure Symfony env vars, parameters, and secrets binding across dev, staging, and prod when wiring services, DSNs, and feature flags correctly.
Who is it for?
Symfony developers wiring DATABASE_URL, MAILER_DSN, API keys, and feature flags across multiple deployment environments.
Skip if: Developers not using Symfony or teams that only need one-off Docker Compose edits without Symfony parameter binding.
When should I use this skill?
A Symfony project needs .env, parameters, or secrets configured or debugged across dev, staging, and production.
What you get
Updated .env hierarchy, parameters.yaml bindings, secrets vault entries, and a checkpoint validation log with residual risks.
- Updated .env files
- parameters.yaml bindings
- Checkpoint validation log
By the numbers
- Documents a 6-file Symfony .env hierarchy with defined override order
- Part of the superpowers-symfony bundle containing 44 Symfony expert skills
Files
Config Env Parameters (Symfony)
Use when
- Refining architecture/workflows/context handling in Symfony projects.
- Planning and executing medium/complex changes safely.
Default workflow
1. Establish current boundaries, constraints, and coupling points. 2. Propose smallest coherent architectural adjustment. 3. Execute in checkpoints with validation at each stage. 4. Summarize tradeoffs and follow-up backlog.
Guardrails
- Use existing project patterns by default.
- Avoid broad refactors without explicit need.
- Keep decision log clear and auditable.
Progressive disclosure
- Use this file for execution posture and risk controls.
- Open references when deep implementation details are needed.
Output contract
- Architecture/workflow changes.
- Checkpoint validation outcomes.
- Residual risks and next steps.
References
reference.mddocs/complexity-tiers.md
Reference
Configuration and Environment Management
Environment Files
File Hierarchy
.env # Default values (committed)
.env.local # Local overrides (not committed)
.env.test # Test environment defaults
.env.test.local # Local test overrides (not committed)
.env.prod # Production defaults
.env.prod.local # Production local overridesLoading Order
1. .env
2. .env.local (not in test)
3. .env.{APP_ENV}
4. .env.{APP_ENV}.localLater files override earlier ones.
.env Syntax
# .env
# App configuration
APP_ENV=dev
APP_DEBUG=true
APP_SECRET=change-this-in-production
# Database
DATABASE_URL="postgresql://user:pass@localhost:5432/myapp?serverVersion=15"
# Mailer
MAILER_DSN=smtp://localhost:1025
# Third-party APIs
STRIPE_API_KEY=sk_test_xxx
AWS_ACCESS_KEY_ID=xxx
AWS_SECRET_ACCESS_KEY=xxx
# Feature flags
FEATURE_NEW_CHECKOUT=falseType Casting
# Boolean
FEATURE_ENABLED=true # string "true"
# In PHP, compare as string or cast
$enabled = $_ENV['FEATURE_ENABLED'] === 'true';
# Or use filter_var
$enabled = filter_var($_ENV['FEATURE_ENABLED'], FILTER_VALIDATE_BOOLEAN);Parameters
Define in services.yaml
# config/services.yaml
parameters:
app.admin_email: 'admin@example.com'
app.items_per_page: 20
app.supported_locales: ['en', 'fr', 'de']
# Using environment variables
app.database_url: '%env(DATABASE_URL)%'
app.stripe_key: '%env(STRIPE_API_KEY)%'
# Type casting
app.port: '%env(int:APP_PORT)%'
app.debug: '%env(bool:APP_DEBUG)%'
app.hosts: '%env(json:ALLOWED_HOSTS)%'Environment Variable Processors
parameters:
# Cast to int
port: '%env(int:PORT)%'
# Cast to bool
debug: '%env(bool:DEBUG)%'
# Cast to float
rate: '%env(float:TAX_RATE)%'
# Parse JSON
config: '%env(json:CONFIG_JSON)%'
# Parse CSV
hosts: '%env(csv:ALLOWED_HOSTS)%'
# Base64 decode
secret: '%env(base64:ENCODED_SECRET)%'
# Read from file
cert: '%env(file:SSL_CERT_PATH)%'
# Resolve env var name from another env var
dsn: '%env(resolve:DATABASE_DSN)%'
# Default value
port: '%env(default:3000:PORT)%'
# Chained processors
config: '%env(json:file:CONFIG_PATH)%'Use in Services
<?php
class PaginationService
{
public function __construct(
#[Autowire('%app.items_per_page%')]
private int $itemsPerPage,
) {}
}
// Or bind in services.yaml
services:
_defaults:
bind:
$adminEmail: '%app.admin_email%'
$itemsPerPage: '%app.items_per_page%'Secrets
Creating Secrets
# Generate keys (once per environment)
php bin/console secrets:generate-keys
# Add a secret
php bin/console secrets:set DATABASE_PASSWORD
# For production
php bin/console secrets:set DATABASE_PASSWORD --env=prod
# From file
php bin/console secrets:set SSL_CERT < cert.pemSecrets Storage
config/secrets/
├── dev/
│ ├── dev.encrypt.public.php # Public key (committed)
│ └── dev.decrypt.private.php # Private key (not committed)
└── prod/
├── prod.encrypt.public.php
├── prod.DATABASE_PASSWORD.28a3f.php # Encrypted secret
└── prod.decrypt.private.php # Deploy securelyUsing Secrets
# Secrets are accessed like env vars
parameters:
database_password: '%env(DATABASE_PASSWORD)%'
doctrine:
dbal:
password: '%env(DATABASE_PASSWORD)%'List Secrets
php bin/console secrets:list
php bin/console secrets:list --reveal # Show valuesEnvironment-Specific Config
Config Files
config/
├── packages/
│ ├── framework.yaml # All environments
│ ├── doctrine.yaml
│ ├── dev/
│ │ └── web_profiler.yaml # Dev only
│ ├── prod/
│ │ └── doctrine.yaml # Prod overrides
│ └── test/
│ └── framework.yaml # Test overridesWhen Blocks
# config/packages/framework.yaml
when@dev:
framework:
profiler:
collect: true
when@prod:
framework:
profiler:
collect: false
when@test:
framework:
test: trueFeature Flags
# config/services.yaml
parameters:
feature.new_checkout: '%env(bool:FEATURE_NEW_CHECKOUT)%'
feature.dark_mode: '%env(bool:FEATURE_DARK_MODE)%'<?php
class CheckoutController
{
public function __construct(
#[Autowire('%feature.new_checkout%')]
private bool $newCheckoutEnabled,
) {}
public function checkout(): Response
{
if ($this->newCheckoutEnabled) {
return $this->newCheckoutFlow();
}
return $this->legacyCheckoutFlow();
}
}Best Practices
.env.local for Local Development
# .env.local (not committed)
DATABASE_URL="postgresql://dev:dev@localhost:5432/myapp_dev"
MAILER_DSN=smtp://localhost:1025Production Environment Variables
# Set via server/container environment, not files
export APP_ENV=prod
export APP_SECRET=your-production-secret
export DATABASE_URL="postgresql://prod:xxx@db.server:5432/myapp"Validation in Services
class StripeService
{
public function __construct(
#[Autowire('%env(STRIPE_API_KEY)%')]
private string $apiKey,
) {
if (empty($this->apiKey)) {
throw new \RuntimeException('STRIPE_API_KEY is required');
}
}
}Don't Commit Sensitive Data
# .gitignore
.env.local
.env.*.local
config/secrets/*/decrypt.private.phpAssets — AssetMapper (best practice)
The recommended way to ship frontend assets is AssetMapper (no Node bundler, uses native ESM + importmaps). It is the default in modern Symfony.
composer require symfony/asset-mapper
php bin/console importmap:require bootstrap # add a JS package
php bin/console importmap:audit # security audit of pinned packages
php bin/console asset-map:compile # build for production deploy# config/packages/asset_mapper.yaml
framework:
asset_mapper:
paths:
- assets/{# templates/base.html.twig #}
{{ importmap('app') }}Refreshable Env Vars (8.1+ — verify)
For long-running workers, inject an env var as a \Closure so it re-reads the value between runs instead of freezing it at boot:
use Symfony\Component\DependencyInjection\Attribute\Autowire;
public function __construct(
#[Autowire(env: 'FEATURE_FLAGS')] private \Closure $featureFlags, // ($this->featureFlags)()
) {}YAML equivalent: !env_closure '%env(FEATURE_FLAGS)%'.
Debug Configuration
# Show all parameters
php bin/console debug:container --parameters
# Show environment variables
php bin/console debug:container --env-vars
# Show secrets
php bin/console secrets:list --revealSkill Operating Checklist
Design checklist
- Confirm operation boundaries and invariants first.
- Minimize scope while preserving contract correctness.
- Test both happy path and negative path behavior.
Validation commands
- rg --files
- composer validate
- ./vendor/bin/phpstan analyse
Failure modes to test
- Invalid payload or forbidden actor.
- Boundary values / not-found cases.
- Retry or partial-failure behavior for async flows.
Related skills
How it compares
Pick symfony:config-env-parameters over generic env-var skills when you need Symfony-specific parameters.yaml, secrets vault, and multi-environment .env hierarchy—not just dotenv parsing.
FAQ
What Symfony env files does symfony:config-env-parameters cover?
symfony:config-env-parameters documents Symfony's six-file .env hierarchy: .env, .env.local, .env.test, .env.test.local, .env.prod, and .env.prod.local. Later files override earlier ones, with .env.local skipped in test environments.
When should I invoke symfony:config-env-parameters?
Invoke symfony:config-env-parameters when wiring DATABASE_URL, MAILER_DSN, Stripe keys, AWS credentials, or feature flags across Symfony dev, staging, and production. The skill proposes minimal config changes with checkpoint validation.