agentleFS
ddtcorexddtcorex/maestro-skills/skills/govard-symfony/SKILL.md

govard-symfony

Skill4 starsChanged 3 months agoMITView on GitHub

This skill should be used when the user asks to "clear Symfony cache", "run bin/console commands", "run doctrine migrations", "debug Symfony routes", "run Symfony CLI", "govard symfony", "symfony cache:clear", "lint Symfony project", "audit Symfony", "govard audit", "deploy Symfony", or "govard deploy". Provides Symfony-specific Govard shortcuts. DEPENDENT on govard-toolbox for base commands.

  • Reads credentials
  • Deletes or force-pushes
  • Installs packages

The file

Files
SKILL.md

Govard Symfony Commands

Symfony-specific shortcuts and commands for Govard environments.

Related Skills

REQUIRED BACKGROUND: Load govard-toolbox first — this skill only covers Symfony-specific shortcuts layered on top of Govard's base environment commands (govard up, govard sh, govard db, remote sync, Xdebug setup).

Docker requirement: stack commands here (govard up/down/sh, govard db, govard tool ...) need Docker. On a host without it they exit 3 with CAPABILITY_MISSING; govard audit run --checks integrity still works and covers manifest/lock and Magento module/DI checks without a container.

For generic PHP (strict_types/PSR-12/PHPStan/Security) see php-dev-core.

Symfony CLI

Symfony console is bin/console inside the PHP container. Govard exposes it as govard tool symfony:

# Run any bin/console command
govard tool symfony cache:clear
govard tool symfony debug:router
govard tool symfony make:controller BlogController

# Alternative: open shell and run natively
govard sh
bin/console cache:clear

Audit

For generic PHP (strict_types/PSR-12/PHPStan/Security) see php-dev-core. For 4-framework matrix and govard audit run --checks lint --lint-provider govard --mode project --format json see govard-toolbox ## Audit.

Cache Management

# Clear cache (no warmup)
govard tool symfony cache:clear --no-warmup

# Warmup after clear
govard tool symfony cache:warmup

# Clear + warmup in one step (default)
govard tool symfony cache:clear

# Pool-specific clear (if using cache pools)
govard tool symfony cache:pool:clear cache.app

Govard's stack.php_version (default 8.2 for the Symfony 7 skeleton; Symfony 8 requires 8.4) determines the PHP runtime; govard config get stack.php_version shows the active version. Verified 2026-08-28 on fresh symfony/skeleton 7.4.17 (govard-test-symfony, PHP 8.2.33, MariaDB 10.11) — bootstrap warns Cannot use symfony/skeleton v8.1.99 as it requires php >=8.4.

Routing & Debug

# List all routes
govard tool symfony debug:router

# Single route
govard tool symfony debug:router app_home

# Container services
govard tool symfony debug:container
govard tool symfony debug:container --parameters

# Environment info
govard tool symfony debug:config framework

Doctrine ORM

Prerequisite: the fresh symfony/skeleton ships without Doctrine. Install first: govard tool composer require symfony/orm-pack

# Migrations — always dry-run first on a fresh DB
govard tool symfony doctrine:migrations:migrate --dry-run
govard tool symfony doctrine:migrations:migrate --no-interaction

# Migration status
govard tool symfony doctrine:migrations:status

# Create migration from entity diff
govard tool symfony doctrine:migrations:diff

# Schema validation
govard tool symfony doctrine:schema:validate

# Fixtures (dev only)
govard tool symfony doctrine:fixtures:load --append

# Direct SQL via Govard DB layer (respects table_prefix if set)
govard db query "SELECT * FROM migration_versions LIMIT 5"

On a fresh Govard Symfony install the DB is empty — migrate --dry-run is safe after symfony/orm-pack; real migrate requires govard env up and a reachable DATABASE_URL. Verified 2026-08-28: fresh skeleton without orm-pack returns There are no commands defined in the "doctrine:migrations" namespace.

Assets

# Install bundle assets
govard tool symfony assets:install

# Webpack Encore (if used)
govard tool npm install
govard tool npm run dev
govard tool npm run build

# Clear Encore cache
rm -rf node_modules/.vite

Symfony has no Govard frontend_sync watcher (unlike Hyvä/Luma). Use govard tool npm run watch for live builds.

Environment (.env)

Govard injects DATABASE_URL, MAILER_DSN, and APP_ENV via .env.local (Symfony dotenv, not container env). Check current values:

govard config get stack.php_version
govard config get stack.db_version
cat .env.local
# or inside container
govard tool symfony debug:container --env-vars | grep -E 'APP_ENV|DATABASE_URL|MAILER_DSN'
  • APP_ENV defaults to dev locally; Govard does not overwrite a committed .env.
  • DATABASE_URL is auto-wired to the Govard MariaDB service (mariadb 11.4 default). Override via .govard.yml stack.db_version or GOVARD_ENV layer if needed.
  • MAILER_DSN points to Mailpit (mail:1025) — see govard open mail (https://mail.govard.test).

For env-specific overrides use GOVARD_ENV=staging govard env up (loads .govard.staging.yml).

Deployment

Symfony ships a deploy recipe. Its point is undoing Composer's auto-scripts, which run cache:clear and assets:install in the wrong place — both belong on the target, not on whichever machine ran composer install.

govard deploy plan production          # the resolved pipeline — no connection, no Docker
govard deploy check production         # preflight over ssh
govard deploy production --yes
StepCommand on the target
build:vendorscomposer install … --no-scripts
build:assetsbin/console assets:install public --symlink --relative — marked needs the application, so the target runs it even in artifact mode
build:frontendfrontend_command inside each frontend_dir
db:migratedoctrine:migrations:migrate --env=<symfony_env> --no-interaction --allow-no-migration
app:cache:flushcache:clear --no-warmup then cache:warmup, both --env=<symfony_env>
app:workers:pausewith worker_control: true: messenger:stop-workers --env=<symfony_env>
maintenance:enable / disableempty — Symfony has no core mechanism, so both are reported as skipped
db:backupnone — --db-backup fails naming the reason
  • .env.local is a shared file, var/log a shared directory; var/cache is deliberately not shared — the compiled container belongs to one release and one environment. sync_paths is vendor and public/bundles.
  • symfony_env (default prod) sets --env for every console command and is not validated — a typo builds the wrong cache directory, and --allow-no-migration is there because an empty migrations/ directory is a healthy project.
  • There is no maintenance window. db:migrate runs against a live site; a project that needs a window anchors two deploy.hooks on maintenance:enable / maintenance:disable.
  • Sandbox: default-mysql-client, extensions intl mysql mbstring xml curl zip, services mariadb + redis-server.

Deploy preflight where provided: a native deploy-plan tool prints this pipeline without connecting; a native deploy-check runs the preflight. Running it stays in the terminal. Otherwise: govard deploy plan / govard deploy check.

Reference: https://govard.ddtcorex.com/workflows/deployment#laravel-symfony-and-wordpress · worked config: https://govard.ddtcorex.com/workflows/deploy-case-studies#case-10-symfony.

Common Workflows

After Pulling Code

govard tool composer install
govard tool symfony doctrine:migrations:migrate --no-interaction
govard tool symfony cache:clear

Debugging Routes

govard tool symfony debug:router | grep api
govard tool symfony debug:router app_blog_show --show-controllers

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.