Ohos req feature to ir

From openharmonyinsight/openharmony-skills · View interactive version

Ohos req feature to ir is an AI agent skill from the GitHub repository openharmonyinsight/openharmony-skills. Use when an OHOS Feature has completed the Phase 0 Review Ready Gate and an Initial Requirement baseline is needed before proposal creation or cross-repository requirement splitting. Activation keywords: "IR.md baseline", "AC reference inheritance", "rr_id", "extension dimension confirmation". Do NO

How to use this skill

Skill file

OHOS Feature 转 IR

Announce at start: "我正在使用 ohos-req-feature-to-ir skill 生成 IR.md。"

定位

IR.md 通过 RR_MCP 写入 OHOS 电子流系统需求描述字段,是 Phase 0 唯一推送到电子流的产物。AC 编号跨 04-feature.md → IR.md → proposal → SR 全链路引用,重编号会断链追溯矩阵。维度确认在 IR 阶段统一完成后,下游 proposal/SR 继承结论(PIR #152 P0),不再逐条交互。

适用边界

输入与前置

仅在 Gate=Not Ready 时拒绝生成。Gate=Conditional Ready 时允许生成,但必须把条件项(conditions)、Owner、关闭动作和关闭时点写入 IR,生成 status: Conditional 的 IR。Conditional Ready 不是失败状态,不得误判为拒绝。

IR.md 引用 01-04 的结论而非重复内容,AC 直接引用 04-feature.md 的编号(见 NEVER §1)。

模板说明

IR 与 Proposal 的边界判定

IR 是平台级系统需求,Proposal 是仓库级实现方案。判定内容归属:

| 内容 | 归属 IR | 归属 Proposal | 判定依据 |

|------|---------|--------------|---------|

| 接口责任方与方向 | ✅ | ❌ | 系统级架构决策 |

| 验收标准(AC) | ✅ | ❌ | 可观察的平台行为 |

| 具体类/方法签名 | ❌ | ✅ | 实现细节 |

| 数据结构定义 | ❌ | ✅ | 代码级设计 |

| 跨仓通信协议 | ✅ | ❌ | 平台级契约 |

| 单仓内部重构 | ❌ | ✅ | 实现选择 |

Before writing an IR section, ask yourself: "Is this a platform-level system requirement, or a repository-level implementation detail?"

Before generating IR, ask yourself...

流程

  1. 读取 reference/IR.md 和 01-04。
  2. 从 04-feature.md frontmatter 继承 rr_id 到 IR.md frontmatter,并填写 §0 需求追踪表(RR单号、Feature ID、IR ID)。
  3. §1 需求价值:从 Feature 提取核心需求、范围和非目标。
  4. §2 详细描述:从 Feature 提取场景分析(场景编号、触发条件、用户操作、预期结果、当前问题)。
  5. §3 验收目标:AC 直接引用 04-feature.md 的编号(见 NEVER §1)。
  6. §4 验收平台:明确 OS版本/设备/API Level。
  7. §5-§13 平台级评估各项:适用产品差异/OS规格/性能功耗/UX/资料变更/API/依赖子系统/Sample。
  8. ⭐ 扩展维度确认(安全与权限/性能与功耗/兼容性/API/IPC/构建组件)生成后,必须暂停并向用户逐条确认。操作步骤:

维度确认唯一交互点:IR 是 Phase 0 全流程中维度确认的唯一逐条交互点。安全/性能/兼容/API/IPC/构建等维度在 feasibility、feature 阶段如有初步判断,可在 IR 确认时引用但不重新交互。下游产物(proposal、SR)继承 IR 的维度确认结论,不再向用户逐条重新确认。仅当 proposal 范围超出 IR 覆盖范围时,才对新增维度补充确认。

  1. Proposal拆解和跨仓依赖作为附件或 IR 末尾补充章节,不按仓复制多份 IR。
  2. 对没有可靠基线的指标标记"待采集"或"暂不设指标",禁止补造数值。
  3. 保存到 {docs_dir}/IR.md。

扩展维度优先级

安全与权限 > 性能与功耗 > 兼容性 > API > IPC > 构建组件

安全与权限和性能与功耗为 P0(必须确认),兼容性和 API 为 P1,IPC 和构建组件为 P2。

输出要求

自检

NEVER

输出

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.