educlopez/mallard/lando-setup

Claude Code and agent skill by educlopez/mallard

Trust tier 3
  • community
  • ext:[{"type":"config","description":"Configuration overrides"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Sets up a PrestaShop 8/9 project locally with Lando, or refreshes its database from the server. Full setup configures Lando, syncs app/config, picks a free port, imports the DB and fixes shop URLs; DB refresh mode only re-dumps and re-imports the database. Use when the user says "monta el proyecto", "setup lando", "prepara en local", "levanta el lando de X", "configura X en local", "actualízame la DB", "refresca la DB de X", "bájame la DB de X", "sync DB", or "quiero la DB actualizada de X".

Install

npx vskill@latest install educlopez/mallard/lando-setup

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as educlopez/mallard/lando-setup.

lando-setup

Trigger

Full setup (project not yet configured locally): "monta el proyecto", "setup lando", "prepara en local", "levanta el lando de X", "configura X en local" → Run all steps in order.

DB refresh only (Lando already running, just need fresh DB): "actualízame la DB", "refresca la DB de X", "bájame la DB de X", "sync DB", "quiero la DB actualizada de X" → Skip to DB Refresh Mode below.

⚠️ Invoke this skill WITHOUT arguments

The nginx template in Step 9 is full of $1…$8 capture references. When this skill is invoked with an args string, the harness expands those as positional parameters — the image rewrite rules arrive mangled ($1 becomes the first word of your args, $5 becomes a URL, etc.) and any vhost written from them will 404 every product image.

Invoke as /lando-setup with no args and state the project, server and options in the conversation instead. If you already invoked it with args, do NOT copy the rewrite rules from the loaded skill text — read SKILL.md from disk, or copy an existing working .lando/nginx-site.conf from another PS9 project.

Placeholders

  • {workspace} — the directory under ~/developer/ where your projects live (e.g. your company or team name). Set it once; every path below uses ~/developer/{workspace}/{project-name}/.
  • {ssh_key} — the SSH private key configured for the servers (e.g. id_rsa_company). Used explicitly on every SSH/rsync command.

Context

  • Projects live at ~/developer/{workspace}/{project-name}/
  • SSH hosts in ~/.ssh/config follow pattern: {alias}-prod, {alias}-pre
  • All projects are PrestaShop 8 or 9
  • DB credentials in app/config/parameters.php (on the SERVER)
  • Existing port range in use: 33290–33409 (pick next free one)

SSH Authentication

SSH Keys
  • ~/.ssh/{ssh_key} — your primary company key (RSA). Replace {ssh_key} with your configured key name (e.g. id_rsa_company).
  • ~/.ssh/{ssh_key_ed25519} — Ed25519, your company SSH key — modern alternative.

Always use -i ~/.ssh/{ssh_key} explicitly on all SSH/rsync commands to avoid key ambiguity.

Auth modes

Key-based (most projects): Your company public key is on the server. No password needed.

Password-based (some projects): Key not on server. Use sshpass via stdin to avoid password in process list:

bash
export SSHPASS='{password}'
sshpass -e ssh -i ~/.ssh/{ssh_key} {user}@{ip} "command"
sshpass -e ssh -i ~/.ssh/{ssh_key} {user}@{ip} "mysqldump ..." > /tmp/dump.sql
unset SSHPASS

Install if missing: brew install sshpass Never put the password directly in the command string — use -e (reads from $SSHPASS env var) instead of -p.

Jump host / double hop (some internal servers): the target is only reachable through a bastion, AND the key that authenticates the second hop lives on the bastion, not on the Mac. ProxyJump does NOT work here — it forwards the connection, not the bastion's keys. Detect it: ssh -J {bastion} {user}@{target} "echo OK" fails with Permission denied (publickey) while ssh {bastion} "ssh {user}@{target} 'echo OK'" succeeds.

Two ways forward — ask the user which one, never assume:

  • Append their public key to {user}@{target}:~/.ssh/authorized_keys (via the bastion), then

ProxyJump works and rsync/mysqldump run directly. Modifies the target server.

  • Keep everything nested — no server change. Works fine, just more verbose:
bash
# remote command
ssh {bastion} "ssh {user}@{target} 'command'"
# DB dump
ssh {bastion} "ssh {user}@{target} 'mysqldump --no-tablespaces --single-transaction {DB_NAME}'" > dump.sql
# directory transfer — tar over pipe, no staging on the bastion's disk (rsync can't traverse two hops)
ssh {bastion} "ssh {user}@{target} 'cd {REMOTE_ROOT} && tar czf - {dir}'" | tar xzf -

When nested, substitute this pattern for every rsync/ssh command in Steps 3–7 below.

Adding new host to ~/.ssh/config (do this when user gives raw user@IP):

Host {alias}-{env}
HostName {IP}
User {user}
IdentityFile ~/.ssh/{ssh_key}

Ask user if they want to save it for future use. If yes, append to ~/.ssh/config.

Step 1 — Confirm inputs

Ask user (if not already provided):

  • Project folder name (e.g. ps8-pincolor)
  • SSH connection: existing alias OR user@IP
  • Environment: prod or pre — ALWAYS ask, never assume
  • Auth method: key (default) or password? If password, ask for it now (will store in env var, not shell string).
  • Web server: nginx (lemp) or Apache (lamp)?
  • Default: nginx for PS9 on Ploi servers; Apache for PS8 or legacy setups.
  • If unsure: check server — Ploi = nginx, cPanel/Plesk = Apache.

Derive:

  • PROJECT_DIR=~/developer/{workspace}/{project-name}
  • SSH_TARGET={alias}-{env} or {user}@{ip}
  • LANDO_NAME={project-name} (same as folder)
  • LOCAL_URL={lando-name}.lndo.site
  • LANDO_RECIPE=lemp (nginx) or lamp (Apache)

Test SSH connectivity before proceeding:

bash
ssh -i ~/.ssh/{ssh_key} -o ConnectTimeout=5 -o BatchMode=yes {SSH_TARGET} "echo OK" 2>&1

If output is not OK, stop and diagnose auth failure with user before continuing.

Step 2 — Detect PrestaShop version

bash
grep -A2 '"prestashop/prestashop"' ~/developer/{workspace}/{project-name}/composer.json

Or check:

bash
grep "_PS_VERSION_" ~/developer/{workspace}/{project-name}/config/defines.inc.php 2>/dev/null | head -1
  • Version 8.x → PS8, PHP 8.1
  • Version 9.x → PS9, PHP 8.3

If version is not clearly readable from files, ask user: "¿PS8 o PS9?" — do not guess from folder name.

Step 3 — Find remote webroot

bash
ssh -i ~/.ssh/{ssh_key} {SSH_TARGET} "find /var/www -name 'parameters.php' -path '*/app/config/*' 2>/dev/null"

If multiple results appear, show them to user and ask which is the correct one. Derive REMOTE_ROOT by stripping /app/config/parameters.php from the chosen path. Example: /var/www/html/app/config/parameters.php → REMOTE_ROOT=/var/www/html

Step 4 — Sync missing files from server

These files/folders are NOT in git and must be copied from the server via rsync.

4a — vendor/ (root, required)
bash
rsync -avz --progress -e "ssh -i ~/.ssh/{ssh_key}" \
{SSH_TARGET}:{REMOTE_ROOT}/vendor/ ~/developer/{workspace}/{project}/vendor/
4b — translations/ (required for PS9)

Without this folder, PS9 throws DirectoryNotFoundException on boot.

bash
rsync -avz --progress -e "ssh -i ~/.ssh/{ssh_key}" \
{SSH_TARGET}:{REMOTE_ROOT}/translations/ ~/developer/{workspace}/{project}/translations/
4b-bis — .env, localization/, mails/ (required for PS9)

Also missing from git and easy to overlook:

  • .env — without it bin/console dies with

Symfony\Component\Dotenv\Exception\PathException: Unable to read the "/app/.env" environment file, so Step 14 (cache clear) can never run.

  • localization/ — LocalizationWarmer warns file_get_contents(/app/localization/default.xml): Failed to open stream.
  • mails/ — transactional email templates.
bash
rsync -avz --progress -e "ssh -i ~/.ssh/{ssh_key}" \
{SSH_TARGET}:{REMOTE_ROOT}/.env ~/developer/{workspace}/{project}/.env
rsync -avz --progress -e "ssh -i ~/.ssh/{ssh_key}" \
{SSH_TARGET}:{REMOTE_ROOT}/localization/ ~/developer/{workspace}/{project}/localization/
rsync -avz --progress -e "ssh -i ~/.ssh/{ssh_key}" \
{SSH_TARGET}:{REMOTE_ROOT}/mails/ ~/developer/{workspace}/{project}/mails/
4c — app/config/ files (required)

If ~/developer/{workspace}/{project}/app/config/parameters.php already exists locally, warn user:

"app/config/ exists locally. Sync from server will overwrite parameters.php. Continue? (y/n)"
bash
rsync -avz --progress -e "ssh -i ~/.ssh/{ssh_key}" \
{SSH_TARGET}:{REMOTE_ROOT}/app/config/ ~/developer/{workspace}/{project}/app/config/
4d — modules/ (required)

Sync the full modules directory. Modules not in git (theme modules, standard PS modules) won't exist locally otherwise.

bash
rsync -avz --progress -e "ssh -i ~/.ssh/{ssh_key}" \
{SSH_TARGET}:{REMOTE_ROOT}/modules/ ~/developer/{workspace}/{project}/modules/

This is simpler and safer than syncing individual vendor/ subdirs — covers theme modules (e.g. Panda) and any PS module not committed to git.

4e — img/ folder (OPTIONAL — ask user first)

The img/ folder can be several GB. Ask user:

"¿Descargo la carpeta img/ del servidor o usamos placeholder de imágenes? (recomendado: placeholder)"
  • If placeholder → trigger lando-img-placeholder skill after setup (it handles both lamp and lemp automatically)
  • If download → rsync -avz --progress -e "ssh -i ~/.ssh/{ssh_key}" {SSH_TARGET}:{REMOTE_ROOT}/img/ ~/developer/{workspace}/{project}/img/

Note for nginx (lemp) projects: placeholder rules are built into .lando/nginx-site.conf — no separate Apache file needed. The lando-img-placeholder skill detects the recipe and acts accordingly.

Regardless of choice (placeholder or download), always create required subdirs:

bash
mkdir -p ~/developer/{workspace}/{project}/img/{c,p,m,st,cms,l,tmp,os,s,co,su}

Without these, ps_mainmenu crashes calling scandir('/app/img/c/') on boot.

Step 5 — Update parameters.php with Lando credentials

After syncing app/config/ from server, parameters.php points to the remote DB → instant 500. Update it with local Lando values.

Capture the remote credentials FIRST — the sed below destroys them, and Step 6/7 need them to dump the server DB:

bash
cp ~/developer/{workspace}/{project}/app/config/parameters.php /tmp/parameters.remote.php
grep -E "database_(name|user|password|prefix)" /tmp/parameters.remote.php

The DB name/user/password is the RECIPE NAME, not always `lamp`: recipe lamp → lamp, recipe lemp → `lemp`. Getting this wrong gives ERROR 1049 (42000): Unknown database 'lamp' and a 500 that looks like a broken install. Set RECIPE to whatever you chose in Step 1:

bash
RECIPE=lemp # or lamp
sed -i '' \
-e "s/'database_host' => '[^']*'/'database_host' => 'database'/" \
-e "s/'database_name' => '[^']*'/'database_name' => '${RECIPE}'/" \
-e "s/'database_user' => '[^']*'/'database_user' => '${RECIPE}'/" \
-e "s/'database_password' => '[^']*'/'database_password' => '${RECIPE}'/" \
-e "s/'mailer_host' => '[^']*'/'mailer_host' => 'sendmailhog'/" \
~/developer/{workspace}/{project}/app/config/parameters.php

Lando DB credentials: host=database, name/user/password = recipe name, mailer=sendmailhog. Verify the file was updated correctly before proceeding. Confirm against the running container:

bash
cd ~/developer/{workspace}/{project} && lando ssh -s database -c "mysql -uroot -e 'SHOW DATABASES'"

Step 6 — Get remote DB credentials

Read the pre-rewrite backup saved in Step 5 — the live app/config/parameters.php now holds the Lando credentials, not the server's:

bash
grep -E "database_(name|user|password|prefix)" /tmp/parameters.remote.php

Extract:

  • database_name → DB_NAME
  • database_user → DB_USER
  • database_password → DB_PASS
  • database_prefix → DB_PREFIX (default ps_ but MUST read actual value)

Step 7 — Dump DB from server

Key-based:

bash
ssh -i ~/.ssh/{ssh_key} {SSH_TARGET} \
"mysqldump -h 127.0.0.1 -u'${DB_USER}' -p'${DB_PASS}' '${DB_NAME}'" > ~/developer/{workspace}/{project-name}/dump.sql

Password-based (SSH password):

bash
export SSHPASS='{ssh_password}'
sshpass -e ssh -i ~/.ssh/{ssh_key} {user}@{ip} \
"mysqldump -h 127.0.0.1 -u'${DB_USER}' -p'${DB_PASS}' '${DB_NAME}'" > ~/developer/{workspace}/{project-name}/dump.sql
unset SSHPASS

Verify dump:

bash
wc -c ~/developer/{workspace}/{project-name}/dump.sql

If file is under 100KB, likely failed or empty — check for errors before continuing.

7b — Match the local DB engine to the server's

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
3
7-day trend score
7

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Extension points

  • configConfiguration overrides

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/educlopez/mallard/lando-setup/badge)](https://verified-skill.com/skills/educlopez/mallard/lando-setup)

Something wrong with this skill or its page? Tell us.