deploy
Skill6 starsChanged 28 days agoMITView on GitHub
Coordinate the Magento deploy sequence safely. Validate before, execute in order, smoke test after, and roll back on any failure. - Never deploy without validation. Pre-flight checks must pass before any state-modifying command runs. See references/pre-flight-checks.md. - Atomic by failure class. A failure in setup:upgrade halts the sequence; the skill does not attempt later steps in the chain. - Rollback by recipe. Each step that can fail has an explicit rollback recipe — see references/rollback-recipes.md. - One environment at a…
- Sends data out
We split this skill into the rules it gives an agent
10 rules. 0 are common, 4 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 135 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 34
Reports are written before state changes commit: If the skill crashes mid-deploy, the report folder shows where it stopped.
- Very specific: line 36
Output budget: Follow context/references/output-budget.md — targeted reads, summary-first test/lint output, long logs to files.
- Very specific: line 48
Run without modifying state.
- Distinctive: line 71
Default plan (local/staging):
- Very specific: line 100
Run each command in order via ${CLAUDE_SKILL_DIR}/scripts/execute-plan.sh or by direct shell:
- Distinctive: line 105
Update the in-progress report file after every step so a crash leaves an auditable partial state.
- Very specific: line 144
Run smoke tests appropriate to the modules deployed.
- Very specific: line 168
Write to {output_root}/deployments/{YYYY-MM-DD-HHMMSS}-{env}.md AND the JSON sibling, where {output_root} is the --docs-root value when the …
- Very specific: line 221
Implementation note for
--validate-only: when this flag is set, the skill MUST exit after writing the validation report. - Distinctive: line 254
Never proceeds to production without explicit interactive confirmation.
“Common” is measured: kept by at least 6 in 10 of the 135 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Magento 2 Deploy
Coordinate the Magento deploy sequence safely. Validate before, execute in order, smoke test after, and roll back on any failure.
Core Rules
- Never deploy without validation. Pre-flight checks must pass before any
state-modifying command runs. See
references/pre-flight-checks.md. - Atomic by failure class. A failure in
setup:upgradehalts the sequence; the skill does not attempt later steps in the chain. - Rollback by recipe. Each step that can fail has an explicit rollback recipe — see
references/rollback-recipes.md. - One environment at a time. Multi-env deploys are sequential
(local → staging → production), gated on explicit user approval between environments.
See
references/multi-env-protocol.md. - Production gating. Deploys to production require: an explicit
--env=productionflag AND an interactive confirmation.--auto --env=productionis rejected unless--i-know-what-im-doingis also passed. - Snapshot before high-risk steps. Offer a snapshot (
--snapshot) before any production deploy. The snapshot capturesgenerated/,var/, optionallyvendor/. - Reports are written before state changes commit. If the skill crashes mid-deploy, the report folder shows where it stopped.
- Output budget. Follow
context/references/output-budget.md— targeted reads, summary-first test/lint output, long logs to files.
Workflow
Phase 0 — Context Resolution
Invoke context. Capture runner, magento_cli, composer. If magento_cli
is null, the deploy cannot proceed — abort with "no Magento CLI available; deploy
requires bin/magento."
Phase 1 — Pre-flight Validation
Run without modifying state. See references/pre-flight-checks.md for the full
catalogue. Required by default:
| Check | Command | When required |
| Module files exist | registration.php in the module's dir — app/code, else the vendor/ or dev-packages/ package that declares it | All deploys |
| Composer validate | composer validate --no-check-publish per module composer.json | All deploys |
| PHPCS Magento2 | {runner} vendor/bin/phpcs --standard=Magento2 {modules} | If --strict |
| PHPStan level 8 | {runner} vendor/bin/phpstan analyse --level=8 {modules} | If --strict |
| Unit tests | {runner} vendor/bin/phpunit {modules}/Test/Unit | All deploys |
| Disk space | df -h $(pwd) | All deploys (warn at < 1GB) |
| Git working tree clean | git status --porcelain | Production only |
| No pending DB declarations | {magento_cli} setup:db:status | All deploys |
| Composer install dry-run | composer install --no-dev --dry-run | Production only |
Any required check failing aborts the deploy with a clear report. Run via
${CLAUDE_SKILL_DIR}/scripts/preflight.sh.
Phase 2 — Plan
Build the deploy plan as an ordered list of commands. Use the template matching the
target environment from references/deploy-plan-templates.md.
Default plan (local/staging):
1. {magento_cli} module:status {modules} # Verify state
2. {magento_cli} module:enable {modules}
3. {magento_cli} setup:upgrade
4. For each persistence module: setup:db-declaration:generate-whitelist --module-name=X
5. {magento_cli} cache:flush
6. {magento_cli} indexer:status # Report invalid indexersProduction plan additionally includes (in order):
1. maintenance:enable
... (steps from default)
5b. {magento_cli} setup:di:compile
5c. {magento_cli} setup:static-content:deploy -f
6. {magento_cli} cache:flush
7. {magento_cli} indexer:reindex # invalid indexers only
8. {magento_cli} queue:consumers:start # new consumers only
9. maintenance:disablePresent the plan. Wait for explicit "proceed" unless --auto is set (and --env is
not production).
Phase 3 — Execute
Run each command in order via ${CLAUDE_SKILL_DIR}/scripts/execute-plan.sh or by direct shell:
- Capture exit code, stdout, stderr per command.
- Exit code != 0: STOP. Invoke rollback (Phase 4).
- Exit code 0 with warnings on stderr: log them, continue.
- Update the in-progress report file after every step so a crash leaves an auditable partial state.
Phase 4 — Rollback Recipes (per failed step)
Triggered only on failure during Phase 3. See references/rollback-recipes.md for the
authoritative table.
| Failed step | Rollback recipe |
module:enable | module:disable {modules} |
setup:upgrade | Restore the DB dump (see below), git revert <deploy commit>, then re-run setup:upgrade |
setup:di:compile | Restore generated/ from snapshot (if --snapshot was set) |
setup:static-content:deploy | Re-run from previous version's git ref |
cache:flush | Idempotent — no rollback needed |
indexer:reindex | Mark indexers invalid; re-run after the underlying issue is fixed |
queue:consumers:start | queue:consumers:stop {consumer}; clear bad messages |
setup:upgrade rollback is lossy without a DB backup. Reverting code and re-running
setup:upgrade does NOT undo schema or data changes already applied:
- Applied data patches are recorded in
patch_listand will be neither re-applied nor reverted bysetup:upgrade(unless they implementPatchRevertableInterfaceand the module is uninstalled). - Declarative-schema column/table drops are destructive — the data is gone and cannot be recovered from code.
To roll the database back you need a dump taken before the deploy: run the snapshot with
--include-db (writes db-{ts}.sql.gz) and restore it before re-running setup:upgrade:
gunzip < db-{ts}.sql.gz | MYSQL_PWD=<pass> mysql -h <host> -P <port> -u <user> <dbname>Rollback is best-effort. Report exactly what was rolled back and what wasn't, with file paths and commands for manual completion.
Phase 5 — Smoke Tests
Run smoke tests appropriate to the modules deployed. See references/smoke-tests.md.
| Surface | Smoke |
| Any | {magento_cli} module:status shows all expected modules enabled |
| Any | {magento_cli} setup:db:status shows "Magento Database is up to date" |
service_contracts + rest_api | curl -s {host}/rest/V1/{vendor}/{route}/ returns 200/401 (not 500) |
graphql | curl -s -X POST {host}/graphql -d '{"query":"{__schema{queryType{name}}}"}' returns 200 |
admin_ui | curl -s {host}/<frontName>/ returns 302 (login redirect) — frontName from ADMIN_PATH, else app/etc/env.php; a 404 on a guessed /admin/ is skipped, not failed |
frontend_ui | curl -s {host}/{vendor_lower}_{module_lower}/{route}/ returns expected status |
cron | crontab installed (crontab -l | grep cron:run) + cron_schedule has recent rows (no cron:status command exists) |
queue | {magento_cli} queue:consumers:list shows new consumers registered |
| Any | no var/report/** file and no module-attributed ERROR+ var/log/*.log entry since the deploy started — two of Magento's three error sinks never write to exception.log |
A smoke failure does NOT trigger rollback (the deploy completed) but is reported as a
"needs investigation" finding. Run via ${CLAUDE_SKILL_DIR}/scripts/smoke.sh, passing
SINCE_TS (the Phase 3 start timestamp), MAGENTO_ROOT, MODULES and BASE_URL — without
SINCE_TS the error-signal scan silently widens to a 15-minute window. MAGENTO_ROOT is also
where the admin frontName is read from; pass ADMIN_PATH when it is not there. HTTPS certificates
are verified except on localhost, *.localhost, *.test and loopback hosts, or when
SMOKE_CURL_INSECURE=1.
Phase 6 — Report
Write to {output_root}/deployments/{YYYY-MM-DD-HHMMSS}-{env}.md AND the JSON sibling,
where {output_root} is the --docs-root value when the caller passed one, else
{ctx.docs_root} (see "Output Root" below). Use templates/report.md. Sections:
- Modules deployed (table with version, status)
- Environment
- Pre-flight results
- Plan executed (with timing per step)
- Per-step results (exit code, stdout digest, stderr digest)
- Smoke test results
- Failures + rollbacks (if any)
- Total time + bytes shifted
- Skill versions
Reference Files
references/pre-flight-checks.md— full pre-flight check catalogue.references/deploy-plan-templates.md— per-environment plan templates.references/rollback-recipes.md— per-step rollback procedures.references/smoke-tests.md— surface-driven smoke test catalogue.references/multi-env-protocol.md— local → staging → production gating.references/maintenance-mode.md— when to enable/disable maintenance mode.
Templates
templates/report.md— deploy report template (Markdown).templates/plan.md— pre-execution plan template (printed for user approval).
Scripts
${CLAUDE_SKILL_DIR}/scripts/preflight.sh— run pre-flight checks; emit JSON pass/fail summary.${CLAUDE_SKILL_DIR}/scripts/execute-plan.sh— execute a plan file step-by-step, log per-step results.${CLAUDE_SKILL_DIR}/scripts/smoke.sh— run smoke tests for given module list.${CLAUDE_SKILL_DIR}/scripts/snapshot.sh— create a pre-deploy snapshot ofgenerated/,var/, optionallyvendor/(--include-vendor) and the database (--include-db, required for a non-lossysetup:upgraderollback).
Inputs
/deploy [--env=local|staging|production] [--strict] [--auto] [--snapshot] [--full] [--validate-only] [--docs-root=<path>] <Vendor>_<Module>...| Flag | Default | Meaning |
--env | local | Target environment. production requires interactive confirm. |
--strict | off | Require PHPCS + PHPStan to pass in pre-flight. |
--auto | off | Skip approval gate before Phase 3. Rejected on production unless --i-know-what-im-doing. |
--snapshot | off (local/staging) / prompted (prod) | Snapshot before deploy for rollback. |
--full | off (local/staging) / on (prod) | Run optional steps (maintenance, static-deploy, di:compile). |
--validate-only | off | Run only Phase 0 (context) + Phase 1 (pre-flight) + Phase 2 (plan). Skip Phase 3 onwards. Exit 0 if all required checks pass, 1 otherwise. Safe for release / CI gating. |
--i-know-what-im-doing | off | Required for --auto --env=production combination. |
--docs-root=<path> | unset | Output-root override; see "Output Root" below. |
Implementation note for --validate-only: when this flag is set, the skill MUST exit after writing the validation
report. No setup:upgrade, no cache flush, no static-content:deploy, no maintenance toggling. The validation report
follows the same {output_root}/deployments/{timestamp}-{env}.{md,json} layout but with "mode": "validate-only" in the JSON
and a Validation only — no deploy executed banner in the markdown.
Outputs
{output_root}/deployments/{timestamp}-{env}.md # Markdown report
{output_root}/deployments/{timestamp}-{env}.json # Machine-readable for CI
{output_root}/deployments/{timestamp}-{env}.snapshot.tar.gz # Optional snapshot for rollback{output_root} (.docs by default, {ctx.docs_root}) is anchored at the project root,
never under {ctx.magento_root}, app/code, or a module dir. See the Artifact location
rule in context/SKILL.md.
Output root (--docs-root)
This skill has an inline emitter (no build-findings.sh): the pre-flight, execute-plan,
smoke, and snapshot scripts already take their output path from caller-supplied
OUTPUT_FILE/OUTPUT_DIR env vars or arguments, so no script changes were needed. The
skill itself accepts --docs-root=<path> (see
context/references/artifact-layout.md) and, when set, writes the Markdown +
JSON report and invokes snapshot.sh <path>/deployments (the script's output dir is a
positional argument, not an env var) so all deploy artifacts land under
<path>/deployments/; otherwise they default to {ctx.docs_root}/deployments/.
Orchestrators such as feature pass this to collect a run's
artifacts under one folder.
Acceptance Criteria
- Aborts on any required pre-flight failure with a clear list of failed checks.
- Never proceeds to production without explicit interactive confirmation.
- Rollback restores the prior known-good state for any failure during
module:enable,setup:upgrade, orsetup:di:compile. - Smoke tests run for every applicable surface.
- Report contains enough information to re-deploy or roll back without consulting the skill again.
Notes on Safety
- Default-deny on destructive steps. Production deploys require both a flag and an interactive confirm.
- No flag combination silently does dangerous things.
--auto --env=productionrejected unless--i-know-what-im-doingis also set. - Reports are written before state changes commit. If the skill crashes mid-deploy, the report folder shows where it stopped.
- Snapshots are opt-in but offered every time on production. The first prompt in production deploys asks "snapshot before deploy? (y/n)".
Related Skills
| Caller | Use |
feature | Phase 5 D1 task |
fix | Phase 6 (optional) |
upgrade | After upgrade is patched |
release | Phase 2 (validate only — --strict pre-flight) |
| Direct user | /deploy --env=staging Acme_ModuleA Acme_ModuleB |
Other versions151 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 151
- ok-oldking/ok-wuthering-waves★ 7.8ksame name
- memovai/mimiclaw★ 5.8ksame name
- microsoft/skills★ 3.2ksame name
- microsoft/agent-skills★ 3.1ksame name
- jhd3197/ServerKit★ 1.8ksame name
- microsoft/azure-skills★ 1.6ksame name
- pedrohcgs/claude-code-my-workflow★ 1.6ksame name
- microsoft/power-platform-skills★ 1.1ksame name
- awslabs/agent-plugins★ 918same name
- jazzyalex/agent-sessions★ 916same name
141 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use pm-discovery, qa-phase and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ww-w-aiSkillpm-discovery
PM Agent Team - Automated product discovery, strategy, and PRD generation. Runs PM analysis workflow to produce comprehensive PRD before PDCA Plan phase.
Also in 3 projects that use this
ww-w-aiSkillqa-phase
Run QA tests at various levels (L1-L5) for features under PDCA management. Integrates with MCP tools to execute structured test plans.
Also in 3 projects that use this
- +10 more from ww-w-ai
In this repository35 other files it gives its agents.
- a11y-auditSkill
- admin-formSkill
- admin-listingSkill
- auditSkill
- breeze-adaptSkill
- breeze-compatSkill
- breeze-themeSkill
- cli-commandSkill
- contextSkill
- data-migrationSkill
- debugSkill
- docsSkill
- eav-attributeSkill
- extension-pointSkill
- featureSkill
- fixSkill
- frontendSkill
- graphqlSkill
- i18nSkill
- indexerSkill
- lintSkill
- marketplaceSkill
- message-queueSkill
- module-createSkill
- perf-auditSkill
- releaseSkill
- remediateSkill
- reviewSkill
- securitySkill
- system-configSkill
- test-generateSkill
- triageSkill
- upgradeSkill
- webapiSkill
- widgetSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

