跳到主内容
智客 ZICQ

技能库 智客分类:运维与云 hyva-exec-shell-cmd

Hyva Exec Shell Cmd

用于检测马根托开发环境并确定指令包的实用技能. 这种技能应当被其他需要在马根托环境中执行 shell 命令的技能所使用. 它检测出典狱长,多克-马根托,DDEV,以及本地环境,并提供了适当的指令包装.

1164 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

用于检测马根托开发环境并确定指令包的实用技能. 这种技能应当被其他需要在马根托环境中执行 shell 命令的技能所使用. 它检测出典狱长,多克-马根托,DDEV,以及本地环境,并提供了适当的指令包装.

何时用

官方 description 未单独写出 Use when。按规范,代理会在用户任务与这段 description 的关键词匹配时激活本技能。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Execute Shell Commands in Magento Environment、Usage、Step 1: Detect Environment、Step 2: Apply Command Wrapper、Examples、Single command。 其中含规范建议的小节:分步指令、输入输出示例。

文件分析

文件分析:除 SKILL.md 外,正文引用了 scripts/detect_env.sh,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

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.

Execute Shell Commands in Magento EnvironmentUsageStep 1: Detect EnvironmentStep 2: Apply Command WrapperExamplesSingle commandWardendocker-magentoDDEVLocalCommand with directory changeWarden

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
hyva-exec-shell-cmd
description
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.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 1
  • scripts/detect_env.sh

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「hyva-exec-shell-cmd」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-a7bbc9957cbad483-Hyva-Exec-Shell-Cmd.html
请存为 .cursor/skills/hyva-exec-shell-cmd/SKILL.md 或 .claude/skills/hyva-exec-shell-cmd/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/hyva-themes/hyva-ai-tools 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/hyva-themes/hyva-ai-tools' --list

npx skills add 'https://github.com/hyva-themes/hyva-ai-tools' --skill 'hyva-exec-shell-cmd'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: hyva-exec-shell-cmd description: 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. --- # 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: ```bash /scripts/detect_env.sh [magento_root_path] ``` Where `` 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 ""` | Docker environment managed by Warden | | docker-magento | `bin/clinotty bash -c ""` | Mark Shust's docker-magento setup | | DDEV | `ddev exec ` | DDEV containerized environment | | Local | Run `` directly | Native environment without containers | ## Examples ### Single command ```bash # 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 ```bash # 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: - `composer` commands (runs on host, not in container) - `git` commands - File operations on the host filesystem (`ls`, `find`, `cp` for files accessible from host) - `warden` CLI commands - `ddev` CLI commands ## Integration Pattern Skills that need to execute commands should: 1. Reference this skill: "Use the `hyva-exec-shell-cmd` skill to determine the command wrapper" 2. Detect environment once using Step 1 3. Store the wrapper pattern for use throughout the skill 4. 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: 1. Detect the environment (Step 1) and resolve the wrapper (Step 2). 2. **Containerized env** — pipe the script to `php /dev/stdin` through the wrapper (use the non-TTY `-T` exec so stdin is forwarded). `` is the directory containing the calling skill's SKILL.md: ```bash # Warden cat "/scripts/

相关技能

运维与云

Docker Essentials

用于容器管理,图像操作,调试的基本道克命令和工作流程.

运维与云

Find Skills

从开放的代理技能生态系统中发现并安装技能. 使用时:(1)用户问"我如何做X",X可能拥有现有技能,(2)用户说"为X找到技能"或"是否为X有技能",(3)用户问"你能否做X",X是专门能力,(4)用户想扩展代理能力,(5)用户想搜索工具,模板,或工作流程,(6)用户提到他们希望…

运维与云

Azure Diagnostics

Azure上使用AppLens,AzureMonitor,资源健康,安全分型的调试Azure生产问题. 当:调试生产问题,故障解答应用服务,应用服务高CPU,应用服务部署失败,故障解答容器应用,故障解答功能,故障解答AKS,VM RDP,Linux SSH,VM黑屏幕,无法连接到…

运维与云

Azure Prepare

准备 azd 用于部署的Azure项目:为Azure开发者CLI(azd)工作流程生成azure.yaml,基础设施(Bicep/Terraform)和多克文件. 仅当用户明确想要使用 azd 作为部署工具时使用, 或项目已经有一个 azure 。 雅姆尔文件。 不使用: 非az…