hyva-exec-shell-cmd
Detects Magento environment (Warden, DDEV, etc.) and wraps shell commands.
Install
mkdir -p .claude/skills/hyva-exec-shell-cmd && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18152" && unzip -o skill.zip -d .claude/skills/hyva-exec-shell-cmd && rm skill.zipInstalls to .claude/skills/hyva-exec-shell-cmd
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Utility skill to detect Magento development environment and determine command wrapper. This skill should be used by other skills that need to execute shell commands in the Magento environment. It detects Warden, docker-magento, DDEV, and local environments and provides the appropriate command wrapper.Key capabilities
- →Detect Magento development environment (Warden, docker-magento, DDEV, local)
- →Provide command wrapper for detected environment
- →Execute shell commands in the correct Magento context
- →Stream scripts into interpreters over stdin for containerized environments
- →Identify commands that do not require wrapping
- →Integrate with other skills for command execution
How it works
The skill detects the Magento development environment and provides the appropriate command wrapper. It then applies this wrapper to execute shell commands, ensuring they run in the correct context.
Inputs & outputs
When to use hyva-exec-shell-cmd
- →Execute Magento shell commands
- →Normalize environment commands
- →Magento container interaction
About this skill
Execute Shell Commands in Magento Environment
This utility skill detects the Magento development environment and provides the appropriate command wrapper for executing shell commands.
Usage
Other skills should reference this skill when they need to execute commands in the Magento environment. The detected wrapper ensures commands run in the correct context (container or local).
Step 1: Detect Environment
Important: Execute this script from the Magento project root directory, or provide the path as an argument.
Run this detection once at the start of any skill that needs to execute shell commands:
<skill_path>/scripts/detect_env.sh [magento_root_path]
Where <skill_path> is the directory containing this SKILL.md file (e.g., .claude/skills/hyva-exec-shell-cmd).
The optional magento_root_path argument specifies the Magento installation directory. If omitted, the script uses the current working directory.
Output: warden, docker-magento, ddev, or local
Step 2: Apply Command Wrapper
Based on detected environment, wrap commands as follows:
| Environment | Command Wrapper | Description |
|---|---|---|
| Warden | warden env exec -T php-fpm bash -c "<command>" | Docker environment managed by Warden |
| docker-magento | bin/clinotty bash -c "<command>" | Mark Shust's docker-magento setup |
| DDEV | ddev exec <command> | DDEV containerized environment |
| Local | Run <command> directly | Native environment without containers |
Examples
Single command
# Warden
warden env exec -T php-fpm bash -c "bin/magento cache:clean"
# docker-magento
bin/clinotty bash -c "bin/magento cache:clean"
# DDEV
ddev exec bin/magento cache:clean
# Local
bin/magento cache:clean
Command with directory change
# Warden
warden env exec -T php-fpm bash -c "cd vendor/hyva-themes/magento2-default-theme/web/tailwind && npm run build"
# docker-magento
bin/clinotty bash -c "cd vendor/hyva-themes/magento2-default-theme/web/tailwind && npm run build"
# DDEV
ddev exec bash -c "vendor/hyva-themes/magento2-default-theme/web/tailwind && npm run build"
# Local
cd vendor/hyva-themes/magento2-default-theme/web/tailwind && npm run build
Commands That Do NOT Require Wrapping
Some commands run on the host system and should NOT be wrapped:
composercommands (runs on host, not in container)gitcommands- File operations on the host filesystem (
ls,find,cpfor files accessible from host) wardenCLI commandsddevCLI commands
Integration Pattern
Skills that need to execute commands should:
- Reference this skill: "Use the
hyva-exec-shell-cmdskill to determine the command wrapper" - Detect environment once using Step 1
- Store the wrapper pattern for use throughout the skill
- Apply the wrapper to all container commands per Step 2
Running a Bundled Skill Script Inside the Environment
Some skills ship a helper script (e.g. a PHP script under scripts/) that must run
through a PHP/Node interpreter. On a hardened host there is no local interpreter, and
a skill installed at user level (~/.../skills/...) is not inside the project, so the
container can't see it. Do not copy the script into the project tree: how files
reach the container differs across environments (bind mounts, Mutagen, named volumes)
and some paths are not synced at all (e.g. Warden serves var/, generated/,
pub/static, pub/media from separate volumes, so a host-written file there never
appears in the container).
Instead, stream the script into the interpreter over stdin — this is independent of the mount/sync strategy, needs no temp file, and needs no cleanup:
-
Detect the environment (Step 1) and resolve the wrapper (Step 2).
-
Containerized env — pipe the script to
php /dev/stdinthrough the wrapper (use the non-TTY-Texec so stdin is forwarded).<skill_path>is the directory containing the calling skill's SKILL.md:# Warden cat "<skill_path>/scripts/<script>.php" | warden env exec -T php-fpm bash -c "php /dev/stdin [args]" # docker-magento cat "<skill_path>/scripts/<script>.php" | bin/clinotty bash -c "php /dev/stdin [args]" # DDEV cat "<skill_path>/scripts/<script>.php" | ddev exec bash -c "php /dev/stdin [args]"The script runs with the container's working directory at the project root, so a script that locates the project via
getcwd()works unchanged. Capture stdout for the result.Script constraints for this method: the script must not also read from stdin (stdin carries the script itself), and must not rely on
__FILE__/__DIR__(it is/dev/stdin) — locate project files viagetcwd()instead. -
localenv: the host has no interpreter (removed during hardening). Do not attempt to run the script directly — report that a containerized dev environment (or a local interpreter) is required for this step.
When not to use it
- →When executing commands that run on the host system (e.g., `composer`, `git`)
- →When running scripts that read from stdin or rely on `__FILE__`/`__DIR__` in containerized environments
- →When a local interpreter is required in a hardened host environment
Limitations
- →Some commands run on the host system and should NOT be wrapped
- →Scripts streamed to interpreters must not read from stdin
- →Scripts must not rely on `__FILE__`/`__DIR__` when streamed
How it compares
This skill abstracts away environment-specific command execution details, allowing other skills to run Magento commands consistently across different development setups (Warden, docker-magento, DDEV, local).
Compared to similar skills
hyva-exec-shell-cmd side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| hyva-exec-shell-cmd (this skill) | 0 | 1mo | Review | Intermediate |
| wp-testing-core | 6 | 8mo | Review | Intermediate |
| write-script-php | 1 | 3mo | No flags | Intermediate |
| browserstack-tester | 1 | 6mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
wp-testing-core
mikkelkrogsholm
Core WordPress testing procedures and patterns for browser-based plugin testing. Use when testing WordPress plugins, logging into WordPress admin, verifying plugin activation, or navigating WordPress UI.
write-script-php
windmill-labs
MUST use when writing PHP scripts.
browserstack-tester
mikopbx
Тестирование веб-интерфейса MikoPBX через BrowserStack. Запуск PHPUnit тестов с Selenium WebDriver в облачных браузерах. Использовать для автоматизированного тестирования админ-панели, проверки форм, навигации и интерактивных элементов.
import
JaguarJack
Generate Excel import class for CatchAdmin module.
controller
JaguarJack
Generate CRUD controller for CatchAdmin module.
plugin-hook
myadmin-plugins
Adds a new event hook to src/Plugin.php — registers in getHooks() and creates the static GenericEvent handler. Use when user says 'add hook', 'handle event', 'new plugin event', or adds a lifecycle action (activate/deactivate/change IP/reactivate). Do NOT use for modifying existing handlers or addin