ln-011-agent-installer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePaths: File paths (,shared/) are relative to skills repo root. Locate this SKILL.md directory and go up one level for repo root.references/
路径说明: 文件路径(、shared/)是相对于技能仓库根目录的。找到此SKILL.md所在目录,向上一级即为仓库根目录。references/
Agent Installer
Agent 安装器
Type: L3 Worker
Category: 0XX Shared
Installs or updates CLI agents via npm and Claude CLI. Single pass per agent: install then immediately verify.
类型: L3 Worker
分类: 0XX Shared
通过npm和Claude CLI安装或更新CLI Agent。每个Agent单次执行:安装后立即验证。
Input / Output
输入/输出
| Direction | Content |
|---|---|
| Input | OS info, |
| Output | Per-agent status: |
| 方向 | 内容 |
|---|---|
| 输入 | 操作系统信息、各Agent的 |
| 输出 | 各Agent状态: |
Agent Registry
Agent 注册表
| Agent | Install Command | Health Check |
|---|---|---|
| Codex | | |
| Gemini | | |
| Claude | | |
| Agent | 安装命令 | 健康检查 |
|---|---|---|
| Codex | | |
| Gemini | | |
| Claude | | |
Workflow
工作流程
For each agent: Install → Verify → RecordFor each agent: Install → Verify → RecordPhase 1: Install & Verify
阶段1:安装与验证
For each agent in registry, apply first matching rule:
| Condition | Action | Report |
|---|---|---|
| SKIP | "disabled by user" |
| Show planned command | "dry run" |
| npm agent | | version or error |
| Claude | | version or error |
Single pass: install and verify happen atomically per agent. No separate scan phase — the install result IS the state.
Error handling:
| Error | Detection | Response |
|---|---|---|
| npm not in PATH | | FAIL gracefully, report "npm not found in PATH" |
| Permission denied | stderr contains "EACCES" | FAIL, suggest |
| Network error | stderr contains "ETIMEDOUT" or "ENETUNREACH" | FAIL, report "network error" |
| Unknown error | Any other non-zero exit | FAIL, include stderr |
Output table:
Agent Installation:
| Agent | Action | Version | Status |
|--------|-----------|----------|--------|
| Codex | installed | 0.1.2503 | ok |
| Gemini | skipped | - | disabled by user |
| Claude | updated | 1.0.30 | ok |对于注册表中的每个Agent,应用第一个匹配的规则:
| 条件 | 操作 | 报告 |
|---|---|---|
| 跳过 | "用户已禁用" |
| 显示计划执行的命令 | "模拟运行" |
| npm Agent | 执行 | 版本信息或错误信息 |
| Claude | 执行 | 版本信息或错误信息 |
单次执行: 每个Agent的安装和验证是原子性操作。没有单独的扫描阶段——安装结果即为当前状态。
错误处理:
| 错误 | 检测方式 | 响应 |
|---|---|---|
| npm不在PATH中 | | 优雅失败,报告"npm未在PATH中找到" |
| 权限不足 | 标准错误输出包含"EACCES" | 失败,建议使用 |
| 网络错误 | 标准错误输出包含"ETIMEDOUT"或"ENETUNREACH" | 失败,报告"网络错误" |
| 未知错误 | 其他非零退出码 | 失败,包含标准错误输出内容 |
输出表格:
Agent Installation:
| Agent | Action | Version | Status |
|--------|-----------|----------|--------|
| Codex | installed | 0.1.2503 | ok |
| Gemini | skipped | - | disabled by user |
| Claude | updated | 1.0.30 | ok |Critical Rules
核心规则
- Never modify flags. Respect them, never change them
disabled - Fail gracefully. One agent failure does not block others
- Global install only. Always (CLI tools must be in PATH)
npm install -g - No side effects. Only npm global packages touched. No config files modified
- Idempotent. Safe to run multiple times
- 绝不修改标志:严格遵守,绝不更改
disabled - 优雅失败:单个Agent失败不影响其他Agent执行
- 仅全局安装:始终使用(CLI工具必须在PATH中)
npm install -g - 无副作用:仅修改npm全局包,不修改任何配置文件
- 幂等性:可安全多次运行
Anti-Patterns
反模式
| DON'T | DO |
|---|---|
| Separate check/install/verify phases | Single pass: install then verify |
| Retry failed installs automatically | One attempt, report failure |
Use | Suggest |
Install agents marked | Skip with clear report |
| 禁止操作 | 正确操作 |
|---|---|
| 将检查/安装/验证阶段分开执行 | 单次执行:安装后立即验证 |
| 自动重试失败的安装 | 仅尝试一次,报告失败 |
使用 | 遇到权限问题时建议使用 |
安装标记为 | 跳过并给出明确报告 |
Definition of Done
完成标准
- All agents processed in single pass (install + verify)
- Disabled agents skipped with report
- Version verified immediately after each install
- Status table displayed
Version: 1.1.0
Last Updated: 2026-03-23
- 所有Agent均以单次执行(安装+验证)处理完成
- 已禁用的Agent被跳过并生成报告
- 每个Agent安装后立即验证版本
- 显示状态表格
版本: 1.1.0
最后更新时间: 2026-03-23