ln-010-dev-environment-setup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Paths: File paths (
shared/
,
references/
,
../ln-*
) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.
路径说明: 文件路径(
shared/
references/
../ln-*
)均相对于技能仓库根目录。如果在当前工作目录找不到,请定位到当前SKILL.md文件所在目录,向上返回一级即为仓库根目录。

Dev Environment Setup

开发环境搭建

Type: L2 Domain Coordinator Category: 0XX Shared
Runtime-backed coordinator for environment setup. The runtime is the execution SSOT. Worker outputs are standalone summaries, not chat prose.
类型: L2 域协调器 分类: 0XX 共享类
基于运行时的环境搭建协调器,运行时是执行的唯一真实源(SSOT)。工作器输出为独立摘要,而非对话式文本。

MANDATORY READ

必读内容

Load these before execution:
  • shared/references/coordinator_runtime_contract.md
  • shared/references/environment_setup_runtime_contract.md
  • shared/references/coordinator_summary_contract.md
  • shared/references/environment_state_contract.md
  • shared/references/environment_state_schema.json
  • shared/references/tools_config_guide.md
执行前请加载以下文件:
  • shared/references/coordinator_runtime_contract.md
  • shared/references/environment_setup_runtime_contract.md
  • shared/references/coordinator_summary_contract.md
  • shared/references/environment_state_contract.md
  • shared/references/environment_state_schema.json
  • shared/references/tools_config_guide.md

When to Use

使用场景

  • First-time environment setup
  • Agent/MCP drift after installs or updates
  • Config sync drift across Claude, Gemini, Codex
  • Instruction file audit or repair
  • 首次环境搭建
  • 安装或更新后出现Agent/MCP漂移
  • Claude、Gemini、Codex之间的配置同步漂移
  • 指令文件审计或修复

Inputs

输入参数

ParameterRequiredDefaultDescription
targets
No
both
gemini
,
codex
, or
both
dry_run
No
false
Plan without mutating
参数是否必填默认值描述
targets
both
gemini
codex
both
dry_run
false
仅输出执行计划,不实际修改配置

Runtime

运行时

Runtime family:
environment-setup-runtime
Identifier:
  • targets-{normalizedTargets}
Phases:
  1. PHASE_0_CONFIG
  2. PHASE_1_ASSESS
  3. PHASE_2_DISPATCH_PLAN
  4. PHASE_3_WORKER_EXECUTION
  5. PHASE_4_VERIFY
  6. PHASE_5_WRITE_ENV_STATE
  7. PHASE_6_SELF_CHECK
Terminal phases:
  • DONE
  • PAUSED
运行时族:
environment-setup-runtime
标识符:
  • targets-{normalizedTargets}
执行阶段:
  1. PHASE_0_CONFIG 配置阶段
  2. PHASE_1_ASSESS 评估阶段
  3. PHASE_2_DISPATCH_PLAN 调度计划阶段
  4. PHASE_3_WORKER_EXECUTION 工作器执行阶段
  5. PHASE_4_VERIFY 验证阶段
  6. PHASE_5_WRITE_ENV_STATE 写入环境状态阶段
  7. PHASE_6_SELF_CHECK 自检阶段
终止阶段:
  • DONE 已完成
  • PAUSED 已暂停

Phase Map

阶段详情

Phase 1: Assess

阶段1:评估

Collect one environment snapshot:
  • agent availability and versions
  • MCP registration/connection state
  • hook state
  • config sync state
  • instruction file state
  • disabled flags from
    .hex-skills/environment_state.json
    if present
Checkpoint payload:
  • assess_summary
采集一份环境快照,包含以下内容:
  • Agent可用性与版本
  • MCP注册/连接状态
  • hook状态
  • 配置同步状态
  • 指令文件状态
  • 若存在
    .hex-skills/environment_state.json
    ,读取其中的禁用标记
检查点负载:
  • assess_summary 评估摘要

Phase 2: Dispatch Plan

阶段2:调度计划

Build selective dispatch plan. Only invoke workers that have work.
Workers:
  • ln-011-agent-installer
  • ln-012-mcp-configurator
  • ln-013-config-syncer
  • ln-014-agent-instructions-manager
Checkpoint payload:
  • dispatch_plan
构建定向调度计划,仅调用有任务需要执行的工作器。
工作器列表:
  • ln-011-agent-installer
  • ln-012-mcp-configurator
  • ln-013-config-syncer
  • ln-014-agent-instructions-manager
检查点负载:
  • dispatch_plan 调度计划

Phase 3: Worker Execution

阶段3:工作器执行

Invoke only selected workers. Do not re-probe the whole environment between worker calls.
Each worker:
  • remains standalone-capable
  • may receive
    summaryArtifactPath
  • must return the same structured summary even without artifact writing
Expected summary kinds:
  • env-agent-install
  • env-mcp-config
  • env-config-sync
  • env-instructions
Record summaries with runtime
record-worker
.
仅调用选中的工作器,工作器调用间隔无需重新探测全量环境。
每个工作器:
  • 保持独立运行能力
  • 可接收
    summaryArtifactPath
    参数
  • 即使不写入产物,也必须返回相同结构的摘要
预期摘要类型:
  • env-agent-install
  • env-mcp-config
  • env-config-sync
  • env-instructions
通过运行时
record-worker
接口记录摘要。

Phase 4: Verify

阶段4:验证

Run targeted verification against the post-worker state:
  • health checks
  • hook status
  • sync status
  • instruction file quality
  • runtime dependency status (ripgrep, optional language servers)
Checkpoint payload:
  • verification_summary
针对工作器执行后的状态执行定向验证:
  • 健康检查
  • hook状态
  • 同步状态
  • 指令文件质量
  • 运行时依赖状态(ripgrep、可选的语言服务器)
检查点负载:
  • verification_summary 验证摘要

Phase 5: Write Environment State

阶段5:写入环境状态

Write final durable state to:
  • .hex-skills/environment_state.json
Rules:
  • runtime state is not environment state
  • workers never write
    .hex-skills/environment_state.json
  • validate output against shared schema before persisting
Checkpoint payload:
  • env_state_written
  • final_result
将最终持久化状态写入以下路径:
  • .hex-skills/environment_state.json
规则:
  • 运行时状态不属于环境状态
  • 工作器永远不得写入
    .hex-skills/environment_state.json
  • 持久化前需对照共享Schema验证输出内容
检查点负载:
  • env_state_written 环境状态已写入
  • final_result 最终结果

Phase 6: Self-Check

阶段6:自检

Confirm:
  • every required phase checkpoint exists
  • dispatched worker summaries were recorded
  • final state file was written unless
    dry_run
Checkpoint payload:
  • pass
  • final_result
确认以下内容:
  • 所有必填阶段的检查点均存在
  • 调度的工作器摘要均已记录
  • 若非
    dry_run
    模式,最终状态文件已写入
检查点负载:
  • pass 检查通过
  • final_result 最终结果

Output Policy

输出规则

Runtime artifacts:
  • .hex-skills/runtime-artifacts/runs/{run_id}/{summary_kind}/{identifier}.json
Durable environment output:
  • .hex-skills/environment_state.json
Do not mix these layers.
运行时产物路径:
  • .hex-skills/runtime-artifacts/runs/{run_id}/{summary_kind}/{identifier}.json
持久化环境输出路径:
  • .hex-skills/environment_state.json
请勿混合这两层输出。

Worker Invocation (MANDATORY)

工作器调用规则(强制要求)

PhaseWorkerContext
3
ln-011-agent-installer
Install or update CLI agents
3
ln-012-mcp-configurator
Configure MCP servers, hooks, and permissions
3
ln-013-config-syncer
Sync config to Gemini and Codex
3
ln-014-agent-instructions-manager
Create and audit instruction files
text
Skill(skill: "ln-011-agent-installer", args: "{targets} {dry_run}")
Skill(skill: "ln-012-mcp-configurator", args: "{dry_run}")
Skill(skill: "ln-013-config-syncer", args: "{targets} {dry_run}")
Skill(skill: "ln-014-agent-instructions-manager", args: "{dry_run}")
阶段工作器上下文
3
ln-011-agent-installer
安装或更新CLI Agent
3
ln-012-mcp-configurator
配置MCP服务器、hook与权限
3
ln-013-config-syncer
同步配置到Gemini和Codex
3
ln-014-agent-instructions-manager
创建并审计指令文件
text
Skill(skill: "ln-011-agent-installer", args: "{targets} {dry_run}")
Skill(skill: "ln-012-mcp-configurator", args: "{dry_run}")
Skill(skill: "ln-013-config-syncer", args: "{targets} {dry_run}")
Skill(skill: "ln-014-agent-instructions-manager", args: "{dry_run}")

TodoWrite format (mandatory)

待办写入格式(强制要求)

text
- Phase 1: Assess (pending)
- Phase 2: Build dispatch plan (pending)
- Phase 3: Run selected workers (pending)
- Phase 4: Verify final state (pending)
- Phase 5: Write environment_state.json (pending)
- Phase 6: Self-check (pending)
text
- Phase 1: Assess (pending)
- Phase 2: Build dispatch plan (pending)
- Phase 3: Run selected workers (pending)
- Phase 4: Verify final state (pending)
- Phase 5: Write environment_state.json (pending)
- Phase 6: Self-check (pending)

Critical Rules

关键规则

  • Runtime state is the execution SSOT.
  • Do not rely on chat memory for resume or recovery.
  • Do not run non-selected workers.
  • Do not repeat full-environment discovery after every worker.
  • .hex-skills/environment_state.json
    is written only in Phase 5.
  • dry_run
    may end with
    final_result=DRY_RUN_PLAN
    and skip final state write.
  • 运行时状态是执行的唯一真实源(SSOT)
  • 不要依赖对话记忆进行任务恢复或续跑
  • 不要运行未被选中的工作器
  • 不要在每个工作器执行后重复全量环境探测
  • .hex-skills/environment_state.json
    仅可在阶段5写入
  • dry_run
    模式下最终结果会返回
    DRY_RUN_PLAN
    ,跳过最终状态写入

Definition of Done

完成定义

  • Runtime started with identifier-scoped manifest and state
  • Assessment snapshot recorded
  • Dispatch plan checkpointed
  • Worker summaries recorded through machine-readable contract
  • Verification summary checkpointed
  • .hex-skills/environment_state.json
    validated and written, or explicit
    DRY_RUN_PLAN
  • Self-check passed
  • 运行时已使用标识符范围的清单和状态启动
  • 评估快照已记录
  • 调度计划已存入检查点
  • 工作器摘要已通过机器可读协议记录
  • 验证摘要已存入检查点
  • .hex-skills/environment_state.json
    已验证并写入,或显式返回
    DRY_RUN_PLAN
  • 自检通过

Meta-Analysis

元分析

MANDATORY READ: Load
shared/references/meta_analysis_protocol.md
Skill type:
domain-coordinator
. Run after all phases complete. Output to chat using the protocol format.

Version: 5.0.0 Last Updated: 2026-03-24
必读: 加载
shared/references/meta_analysis_protocol.md
技能类型:
domain-coordinator
。所有阶段完成后运行,按照协议格式输出到对话中。

版本: 5.0.0 最后更新: 2026-03-24