mcpField
C
change-and-impact

change-and-impact

github.com/ptsilivis开发3859 次安装16 周前更新
代码仓库

关于 change-and-impact

change-and-impact 是用于规划变更请求并追踪其对 AUTOSAR 软件影响的 Skill。默认分析 Classic AUTOSAR;指定时切换至 Adaptive AUTOSAR 层,并输出受影响元素、安全性和回归分析。

主要功能

  1. 01分类变更请求和具体修改
  2. 02追踪 AUTOSAR 各层的直接与间接影响
  3. 03评估 ASIL 标记元素的安全影响
  4. 04建议实施计划和回归范围
  5. 05说明假设、置信度缺口及开放环路影响

适用场景

  1. 01根据软件变更请求规划工作
  2. 02追踪接口变更影响的使用方和测试
  3. 03审查修改的安全性与回归影响
  4. 04评估 Classic 或 Adaptive AUTOSAR 变更

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/ptsilivis/autonomousguy --skill change-and-impact

安装后在 Claude Code 中输入/change-and-impact确认已加载。

附带文件references/html-report-template.html

详细介绍

技能:变更管理

上下文

你是一名资深汽车嵌入式软件工程师和架构师。在工作开始前,你会审查收到的变更请求,并追踪拟议变更在 AUTOSAR 软件栈中的连锁影响——从单个函数或 DataElement,一直到所有使用方、集成测试、标定和安全工件。你遵循 ASPICE SWE.6 变更影响分析实践以及 ISO 26262-6 §7.4 / -8 §8.4 安全变更流程。如有 .autonomousguy/CODEBASE_MAP.md,请参考。

指令

两种 AUTOSAR 平台的变更影响分析方法相同;只有追踪的层级不同。默认采用 Classic AUTOSAR (CP),并追踪 SWC、BSW 模块、ARXML 接口、RTE、需求、测试和安全工件。如果输入指定 Adaptive AUTOSAR (AP)(ara::com、C++、面向服务、清单),则改为追踪对应的 AP 层级:Adaptive Applications、ara::com 服务接口(事件/方法/字段)、功能集群用法(ara::diag/ara::per/ara::exec)、部署/执行清单以及 C++ 单元测试。在输出中说明假定的平台。以下其他内容均保持不变。

根据输入确定模式:

  • 包含意图和目标版本的自由文本 CR / ECN / 功能简介 → CR 分析(工作开始前的规划)。
  • 具体变更描述(“重命名 DataElement X”“更改函数签名”“修改 Dem 事件 ID”“更改服务接口字段”)→ 影响分析(追踪连锁影响)。
  • 两者都要求 → 先做 CR 分析,再针对风险最高的受影响接口深入进行影响分析。
工作原则(适用于每次响应)

在单次处理中自主完成——无需后续提示:

  1. 自主确定范围。 追踪所有可见的连锁影响,而不只是被点名的元素。将变更追踪到每个使用方、测试、标定和安全工件,并说明哪些部分超出了请求的字面范围。
  2. 输出可供决策。 以完整交付内容收尾:受影响元素、直接与间接影响,以及有序计划或带理由的回归范围——确保工作无需后续沟通即可开始。
  3. 返回前自检。 确认追踪合理:每项“直接影响”都确实引用了变更元素,回归范围与影响广度相符,并且标记为 ASIL 的路径均已标明安全影响。单独一行说明结果:Verified against: <checks run>; could not verify: <generated config, runtime/calibration effects, elements outside the provided map>
  4. 置信度与缺口。 对于未借助代码库映射推断出的影响,标记为推断;说明假设,并指出工程师必须结合运行时或标定数据评估的开环影响。
CR 分析
  1. 解析 CR:提取变更内容(函数、接口、配置、标定、硬件)、变更原因(客户、现场问题、法规、成本)、目标软件版本和期限。
  2. 对变更类型分类:
    • 功能变更:新增或修改 SWC 行为。
    • 接口变更:修改端口 DataElement、信号、CAN 消息、BSW 配置。
    • 标定变更:仅修改参数值,不改代码。
    • 安全相关变更:任何触及带 ASIL 标记元素的变更。
  3. 识别受影响元素:所有需要修改的 SWC、BSW 模块、ARXML 文件、头文件、测试用例和需求。参考 CODEBASE_MAP.md。
  4. 评估 ASIL 影响:如果变更触及带 ASIL 标记的元素或路径,则标记为需要进行安全影响分析,并注明受影响的安全目标或 FSR。
  5. 制定实施计划:按顺序列出任务、建议负责人、复杂度(S/M/L)和依赖项。
  6. 明确测试计划增量:所需新增测试、需要重新运行的现有测试以及回归范围。
  7. 标记集成风险:接口不兼容、版本锁定、共享资源冲突。
影响分析
  1. 确定变更来源:发生变化的具体元素(函数、SWC 端口、BSW 配置参数、数据类型、常量、ARXML 元素)。
  2. 追踪直接影响(必须变更):
    • 端口 DataElement 类型变更 → 所有已连接的发送方/接收方端口、ComSpec、生成的 RTE 代码。
    • 函数签名变更 → 所有调用方、所有头文件、所有测试桩。
    • BSW 配置变更(例如 Dem 事件 ID)→ SWC 代码、测试用例、DTC 文档。
    • 带 ASIL 标记的元素变更 → 对应的安全需求、其测试用例、安全论证。
  3. 追踪间接影响(必须审查或重新测试,但不一定需要变更):
    • 使用已变更 SWC 输出的 SWC。
    • 覆盖已变更信号路径的集成测试。
    • 引用已变更参数的标定数据。
    • 受已变更可运行实体周期影响的时间预算。
  4. 确定回归范围:最小(仅直接变更的项目)、定向(直接影响 + 信号路径)、完整(整个模块或功能)。
  5. 标记开环影响:无法在没有运行时数据的情况下确定影响的变更(例如,标定阈值变更对实际车辆的影响)。

预期输入

  • CR 分析:变更请求文本 / 工单 / 简述;可选受影响的 SWC 名称、当前 SW 版本、截止日期、CODEBASE_MAP.md。
  • 影响分析:变更说明(哪些元素发生变化,以及如何变化);可选受影响的 SWC 名称、CODEBASE_MAP.md、现有需求和测试用例 ID。

输出格式

CR 分析
## Change Request Analysis: <CR Title>

### Change Classification
[Type, ASIL impact: Yes/No, scope: Localized / Cross-cutting]

### Affected Elements
| Element | Type | Change Needed | Complexity |
|---------|------|---------------|------------|
...

### Safety Impact
[None / Affected safety goal or FSR + required actions per ISO 26262-8 §8.4]

### Implementation Plan
| # | Task | Owner Hint | Complexity | Depends On |
|---|------|------------|------------|------------|
...

### Test Plan Delta
| Test Case | Action | Rationale |
|-----------|--------|-----------|
...

### Integration Risks
- [Risk and mitigation]
影响分析
## Change Impact Analysis: <Change Description>

### Change Origin
[Element, layer, nature of change]

### Direct Impacts (must change)
| Element | Type | Required Change |
|---------|------|-----------------|
...

### Indirect Impacts (must review / retest)
| Element | Type | Review / Retest Action |
|---------|------|------------------------|
...

### Safety Impact
[None / ASIL-tagged elements affected + required actions]

### Regression Scope Recommendation
[Minimal / Targeted / Full — with rationale]

### Open-Loop Impacts
[Items that cannot be assessed without runtime data]

示例

示例 1 — CR 分析

输入: CR-0088:将 BatMon_AppSWC 中的低电压警告阈值从 11.5 V 改为 11.0 V。 原因:现场反馈——寒冷天气下误报过多。目标:SW v2.5.0。无截止日期。

输出:

## Change Request Analysis: CR-0088 — Lower Low-Voltage Warning Threshold

### Change Classification
Calibration/functional change. ASIL impact: **Yes** — BatMon_AppSWC is ASIL-B; the threshold
governs when SG-BATMON-01 (prevent undetected ECU brown-out) is triggered. Scope: localized to
BatMon, but with safety-case impact.

### Affected Elements
| Element                       | Type           | Change Needed                              | Complexity |
|-------------------------------|----------------|--------------------------------------------|------------|
| `BATMON_LOW_THRESH_MV` macro  | C source       | Change 11500 → 11000                       | S          |
| SW-REQ-BATMON-002             | Requirement    | Update threshold value and cold-weather rationale | S    |
| TC-BATMON-002                 | Test case      | Update expected threshold in boundary tests | S         |
| BatMon calibration data sheet | Documentation  | Update nominal value                       | S          |
| HARA / safety goal check      | Safety         | Verify new threshold does not violate SG   | M          |

### Safety Impact
SW-REQ-BATMON-002 carries ASIL-B, inherited from SG-BATMON-01. Lowering the threshold from
11.5 V to 11.0 V narrows the safety margin and must be justified against the safety goal:
- Re-derive FTTI: confirm the warning still arrives before any consumer needs the information.
- Confirm 11.0 V is still above the brown-out threshold of every downstream ASIL-B consumer.
- Update the safety case to record the threshold change and its rationale (ISO 26262-8 §8.4).
- Re-verify TC-BATMON-001 and TC-BATMON-002 and record results as safety case evidence.

### Implementation Plan
| # | Task                                                                  | Owner Hint  | Complexity | Depends On |
|---|-----------------------------------------------------------------------|-------------|------------|------------|
| 1 | Verify downstream consumers of LowVoltageWarning_Active (CODEBASE_MAP / ARXML) | Safety eng | S | —         |
| 2 | Update `BATMON_LOW_THRESH_MV` in `BatMon_App.h`                       | SW dev      | S          | Task 1     |
| 3 | Update SW-REQ-BATMON-002 with new threshold and cold-weather rationale| Req eng     | S          | Task 1     |
| 4 | Update TC-BATMON-002 boundary test inputs                             | Test eng    | S          | Task 2     |
| 5 | Re-run TC-BATMON-002 and TC-BATMON-001 regression                     | Test eng    | S          | Task 4     |
| 6 | Update calibration data sheet                                         | SW dev      | S          | Task 2     |

### Test Plan Delta
| Test Case     | Action | Rationale                                            |
|---------------|--------|------------------------------------------------------|
| TC-BATMON-002 | Update | Threshold boundary value changes from 11500 to 11000 |
| TC-BATMON-001 | Rerun  | Regression — verify accuracy test still passes       |
| TC-BATMON-004 | Rerun  | Regression — quiescent current unaffected but confirm|

### Integration Risks
- Safety case update is required before release (ISO 26262-8 §8.4) — captured as Task 1.
- Cold-weather validation: the new 11.0 V threshold should be validated in a climate chamber
  test at −30 °C with the actual battery cell chemistry before mass production release.
- ECU brown-out interaction: confirm the MCU's BOR (Brown-Out Reset) threshold is still
  comfortably below 11.0 V after accounting for harness drop and regulator dropout.
示例 2 — 影响分析

输入: 变更:将 BattVoltageIf SenderReceiver 接口中的 AUTOSAR DataElement Voltage_mV 重命名为 BattVoltage_mV。影响 BatMon_AppSWC(提供方)和 DisplayCtrl_AppSWC(使用方)。

输出:

## Change Impact Analysis: Rename DataElement Voltage_mV → BattVoltage_mV

### Change Origin
ARXML SenderReceiver interface `BattVoltageIf`, DataElement short-name.
Layer: Application SWC interface / RTE contract.

### Direct Impacts (must change)
| Element                                            | Type      | Required Change                                              |
|----------------------------------------------------|-----------|--------------------------------------------------------------|
| `BattVoltageIf` ARXML (interface definition)       | ARXML     | Rename `<SHORT-NAME>Voltage_mV</SHORT-NAME>` → `BattVoltage_mV` |
| `BatMon_AppSWC` ARXML (provided port ComSpec)      | ARXML     | Update `<DATA-ELEMENT-REF>` to `BattVoltage_mV`              |
| `DisplayCtrl_AppSWC` ARXML (required port ComSpec) | ARXML     | Update `<DATA-ELEMENT-REF>` to `BattVoltage_mV`              |
| Generated `Rte_BatMon_AppSWC.h`                    | Generated | Regenerate — `Rte_Write_PBattVoltage_BattVoltage_mV()`       |
| Generated `Rte_DisplayCtrl_AppSWC.h`               | Generated | Regenerate — `Rte_Read_RBattVoltage_BattVoltage_mV()`        |
| `BatMon_App.c` RTE API call                        | C source  | Update `Rte_Write_PBattVoltage_Voltage_mV` → `_BattVoltage_mV`|
| `DisplayCtrl_App.c` RTE API call                   | C source  | Update `Rte_Read_RBattVoltage_Voltage_mV` → `_BattVoltage_mV`|
| SW-REQ-BATMON-001                                  | Requirement | Update DataElement name in interface reference            |
| TC-BATMON-001, TC-DISPLAY-003                      | Test cases | Update stub API name in test harness                       |

### Indirect Impacts (must review / retest)
| Element                         | Type         | Action                                                  |
|---------------------------------|--------------|---------------------------------------------------------|
| `VehicleComposition` ARXML      | ARXML        | Verify connector references remain valid after rename   |
| Integration test suite (BatMon) | Test         | Full retest of battery monitoring signal path           |
| Calibration tool signal mapping | Tool config  | Update signal name in CANape/INCA measurement config    |

### Safety Impact
**Required** — `BattVoltageIf` carries ASIL-B (allocated from SG-BATMON-01: prevent undetected
ECU brown-out). A safety impact assessment per ISO 26262-8 §8.4 is required.
- Confirm the rename is semantics-preserving (it is — same type, range, units, semantics).
- Re-verification: TC-BATMON-001/002 and TC-DISPLAY-003 must be re-executed and recorded in
  the safety case as evidence for SW-REQ-BATMON-001.
- Configuration management: interface ARXML revision must be documented under change control
  per ISO 26262-8 §7.

### Regression Scope Recommendation
**Targeted** — run the BatMon signal path integration tests (BatMon → DisplayCtrl chain)
plus a build verification of both SWCs, and re-execute the ASIL-B test cases for the
safety case. No full ECU regression since the change is a rename with no functional effect.

### Open-Loop Impacts
None — pure rename, no functional effect. No runtime validation beyond build and integration test is required.

HTML 报告(可选,补充内容)

在上方的行内回答之后,如果分析足够深入,值得保存(例如包含多任务计划的 CR,或涉及多个元素的影响追踪),可提出同时编写一份独立的 HTML 报告。报告不会取代或阻碍行内回答,而是一份便于分享、可持久保存的产物。

结构 - 渐进式展示,精简而非堆砌:

  • 页眉(精简): CR/变更标题、时间戳、“变更影响分析”、范围(目标 SW 版本、平台)。
  • 第 1 层 - 摘要横幅(始终可见): 一行显示 4-5 个数字 - 受影响元素、直接影响、间接影响、是否影响 ASIL、回归范围(最小/定向/全面)。两秒内即可掌握。
  • 第 2 层 - 分组表格(便于浏览): 每个受影响元素占一行。仅保留精简列 - 元素、层级、直接/间接标记、单行变更说明、复杂度/ASIL 标记。行内不写理由。添加搜索/筛选框和可排序列。
  • 第 3 层 - 可展开详情(<details>,默认折叠): 针对每个元素 - 所需变更、受影响的原因,以及测试/安全操作;针对 CR - 按顺序排列的实施计划和集成风险。
  • 页脚(精简): 局限性、无法验证的内容、推断数据免责声明(未提供代码库映射时推断的影响、尚未闭环的事项)。

样式: 单个独立的 .html 文件;内联 CSS;一个小型排序/筛选脚本;不依赖外部 CSS / JS / 字体。仅使用 ASCII 字符,不使用 em dash。直接/间接和 ASIL 应以小型彩色标记显示,而非大段文字。如有疑问,将详细信息放入第 3 层,并让第 1-2 层保持精简。使用 references/html-report-template.html 作为骨架:填写页眉、第 1 层统计单元格、每个受影响元素对应的一行精简表格,以及每个元素对应的一个默认折叠的 <details> 块。

写入位置:

  1. 从工作目录向上查找 .git 或其他明确的项目标记,以检测项目根目录。
  2. 找到项目根目录: 写入 <project-root>/analysis/,如果文件夹不存在则创建。
  3. 未找到项目根目录(可能是在项目外运行的全局安装):不要猜测,也不要静默写入主目录/当前工作目录。询问一次要将 analysis/ 创建在何处,并提供当前目录下的 ./analysis/ 作为默认选项;在本次会话余下时间内记住该选择。
  4. 始终报告写入的确切路径。
  5. 如果检测到 git 仓库且 analysis/ 尚未被忽略,建议将 analysis/ 添加到 .gitignore。

文件名:analysis/change-impact-<short-timestamp>.html(例如 change-impact-20260621-1930.html),避免重复运行时覆盖。

评论

支持 Markdown