원클릭으로
x4-guide
根据当前 change 或用户描述,按 behavior/anchor/index/functions 结构增量维护 guide 文档与模块子文档(empire/logic-flow/ship),保持行为、UI 锚点、函数映射与导航索引同步。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
根据当前 change 或用户描述,按 behavior/anchor/index/functions 结构增量维护 guide 文档与模块子文档(empire/logic-flow/ship),保持行为、UI 锚点、函数映射与导航索引同步。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | x4-guide |
| description | 根据当前 change 或用户描述,按 behavior/anchor/index/functions 结构增量维护 guide 文档与模块子文档(empire/logic-flow/ship),保持行为、UI 锚点、函数映射与导航索引同步。 |
在 X4 项目中,guide/ 文档用于描述:
behavior: 系统行为(用户如何触发、系统如何响应)anchor: UI 锚点(测试/定位所需的稳定入口)index: 可选导航索引文档(用于目录映射与树形结构)functions: 函数名到实现位置/状态的映射(各目录可选)该 skill 的目标是 增量更新,不是全量重写。
/x4:guideguide/**data-testid),在 anchor.md 写明 待实现,不要编造已存在选择器。guide/behavior.mdguide/anchor.mdguide/index.mdguide/empire/*guide/logic-flow/*guide/ship/*index.md 为可选文档:仅在需要目录映射或树形导航时维护“业务目标到目录映射 + 目录树”。behavior.md / anchor.md 不承担跨层目录导航;跨层路由统一通过 index.md 链式维护。.xxx 表示 class 选择器(用于页面区域可见性断言)。[data-testid='xxx'] 表示 testid 属性选择器(用于稳定交互定位,优先级高于 class)。enable / disable / expected 条件必须来自页面可达信息(DOM 属性、可见性、可交互状态、可读取文案等)。疑问: / pending-question:),等待确认后再固化。index.md(如 guide/empire/index.md)时,必须循环更新其上层目录树:guide/index.mdpending 章节规则(MANDATORY):anchor.md 必须包含 ## Pending 章节;functions.md 若存在,也必须包含 ## Pending 章节。pending: []。functions.md 可在函数条目使用 pending:true,并在 pending: 列表重复该函数名。functions.md 作用域与查找规则(MANDATORY):functions.md 在任意目录均为可选(如 guide/functions.md、guide/ship/functions.md、guide/ship/workbench/functions.md)。behavior.md 中引用 fn 时,按“就近优先”解析:
functions.mdfunctions.mdguide/functions.mdpending 或 疑问,禁止假设实现位置。anchor 中函数调用参数规则(MANDATORY):anchor.md 中的函数调用统一使用 args 数组,不使用对象键值参数。args 每一项必须说明页面来源(如 selector + attr/text/value)。pending:true,并加入 ## Pending 名单。pending 名单仅保存参数名或函数名引用,保持最简。preset 模板规则(MANDATORY):behavior.md 增加 ## Preset 章节。behavior 条目通过 preset_ref 引用预设数据,不直接内联大段实例数据。preset 必须使用变量化占位(如 $ship_id、$slot_plan、$input.ship_id),禁止写死具体业务 ID(如 ship_ter_m_corvette_01_a)。fn + args(数组)+ chain(如 nth(0))。args 中参数无法从页面读取但有固定来源,使用 preset/固定来源描述;仅在来源不确定时写 pending。guide 文件现状。expected 字段(action 行为必填),用于描述该 behavior 执行后的结果preset_ref 与 fn/args/chain 字段anchor_idtype(tab/button/panel/input/...)data-testid,其次 role+name)args 数组声明参数来源;页面不可达参数进入 pendingindex.md(固定两章):
子目录树形结构index.md 第一章格式:
guide.<domain> -> <folder>(如 guide.logic-flow -> logic-flow)index.md 第二章格式:
.,不写 guide/ 前缀behavior 条目中的 index 字段遵循强制规则(有且仅有):index.md 且条目需要该层目录解析时,必须提供 index 字段。index.md 时,禁止提供 index 字段。index.md,且 behavior.md / anchor.md 出现重复目录映射内容,优先删重复并保留 index.md。behavior 文档使用单章结构,不再拆分“总览/详细”两章。behavior 分四类:action 行为、zone 引用、switch 状态切换、select 列表选择。enable / disable 为通用标签,可附加在任意 behavior 类型上,用于表达启用条件。enable 表示“满足条件时可执行/可见”;disable 表示“不满足条件时不可执行/不可见”。action 字段;不可操作对象必须使用 zone 字段。zone 条目使用 zone 字段表达。zone 用于对子目录区块的引用,推荐字段:zone,index 按需提供。zone 条目不引用具体文件名;具体文件解析统一交给对应层级的 index.md。switch 用于描述互斥状态之间的切换关系(如 selector <-> workbench)。switch 推荐字段:switch、from、to、trigger、expected(状态变化结果)。select 用于描述“从候选列表中选择一个值”。select 推荐字段:select、source、value、expected。action 推荐补充 data 字段:
data.control: 控件类型(如 select)data.options_ref: 选项来源引用(如 guide.language.options),选项明细可放在下层文档index 用于目录引用;是否提供取决于是否需要同级 index.md 解析。action、switch、select 条目必须包含 expected 字段,且语义应可被测试断言;zone 条目可不写 expected。guide/anchor.md 第一章与 guide/behavior.md 一一对应(同顺序、同数量)。guide/anchor.md 第一章每条格式固定为:<behavior_id> -> 点击 <locator>,断言 <assert_locator>。<locator> 优先使用 data-testid;<assert_locator> 可使用 data-testid 或 .class。guide/behavior.mdguide/anchor.mdguide/index.mdguide/functions.md(可选;子目录同名文件也可选)guide/empire/behavior.mdguide/empire/anchor.mdguide/logic-flow/behavior.mdguide/logic-flow/anchor.mdguide/ship/behavior.mdguide/ship/anchor.md完成后必须给出:
guide 文件。待实现 锚点,明确列出,方便后续补代码或补测试。Use when x4-e2e-test-doc-details needs fixture patch rules or helper guidance for X4 E2E test data.
Use when refining X4 `e2e_tests.md` into detailed E2E task, fixture, and implementation knowledge documents before Playwright implementation.
Use when creating or updating only the high-level X4 E2E test plan `e2e_tests.md` before detail expansion.
Review X4 E2E test documentation draft and gate x4-e2e-test-doc completion. Must run in a dedicated isolated subagent. Trigger with /x4:e2e-test-doc-viewer <change-name>.
Implement Playwright E2E tests for X4 changes from `e2e_test_tasks.md` and validate task-to-test mapping. Trigger with /x4:e2e-test-impl <change-name>.
Run change-scoped X4 Playwright E2E tests and validate implementation coverage against `e2e_test_tasks.md`. Trigger with /x4:e2e-test-run <change-name>.