bug-impact-analyzer

分析缺陷修复的影响范围。确定受影响的代码位置、相关依赖项、调用者与被调用者,并评估变更可能引入的副作用范围。

仓库最近推送
GitHub Stars
109
Forks
26
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "bug-impact-analyzer":https://skillpi.com/zh/skills/deepskill-77980ca990985ff6a186ac7da637fb4881e3090fb3fc7c76f7fd3121568a9bd7。安装前核对上游来源和版本:https://github.com/dykyi-roman/awesome-claude-code。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

分析缺陷修复的影响范围。确定受影响的代码位置、相关依赖项、调用者与被调用者,并评估变更可能引入的副作用范围。

0 下载

介绍来源: third_party · dykyi-roman · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
软件、账号及付费要求
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: bug-impact-analyzer
description: Analyzes bug fix blast radius. Determines affected code, dependencies, callers/callees, and potential side effects of changes.

Bug Impact Analyzer

Systematic analysis of how a bug fix will affect the codebase.

Blast Radius Concept

Every code change has a "blast radius" - the scope of code that could be affected.

                    ┌─────────────────┐
                    │   Direct Fix    │ ← Minimal blast radius
                    │  (1 method)     │
                    └────────┬────────┘
                             │
              ┌──────────────┼──────────────┐
              ▼              ▼              ▼
        ┌─────────┐    ┌─────────┐    ┌─────────┐
        │ Caller 1│    │ Caller 2│    │ Caller 3│ ← Medium blast radius
        └────┬────┘    └────┬────┘    └────┬────┘
             │              │              │
    ┌────────┴────────┬─────┴─────┬────────┴────────┐
    ▼                 ▼           ▼                 ▼
┌───────┐        ┌───────┐   ┌───────┐        ┌───────┐
│Public │        │ Event │   │ Test  │        │  API  │ ← Large blast radius
│  API  │        │Handler│   │ Suite │        │Client │
└───────┘        └───────┘   └───────┘        └───────┘

Analysis Dimensions

1. Direct Callers Analysis

Find all code that directly calls the changed method.

# Find callers of a method
grep -rn "->methodName(" src/
grep -rn "::methodName(" src/

# Find callers in tests
grep -rn "->methodName(" tests/

Impact Questions:

  • Will callers still work with the fix?
  • Do callers expect the old behavior?
  • Are there callers in external packages?

2. Callees Analysis (Dependencies)

Find all code that the changed method calls.

// Example: Method being fixed
public function calculateTotal(array $items): Money
{
    // Callees:
    $sum = Money::zero($this->currency);           // 1. Money::zero()
    foreach ($items as $item) {
        $price = $item->getPrice();                // 2. Item::getPrice()
        $quantity = $item->getQuantity();          // 3. Item::getQuantity()
        $sum = $sum->add($price->multiply($quantity)); // 4. Money::add(), Money::multiply()
    }
    return $sum;
}

Impact Questions:

  • Does the fix change how callees are used?
  • Are new callees introduced?
  • Could new callees throw exceptions?

3. Data Flow Analysis

Trace how data flows through the system.

Input Data Flow:
Request → DTO → Command → Entity → Repository → Database
                  ↓
              Validation
                  ↓
              [BUG HERE] - invalid data passed forward

Fix Impact:
- Validation added at Command level
- All downstream code now receives valid data
- Callers must handle ValidationException

4. Event/Message Impact

Check if the change affects published events or messages.

// If the buggy method publishes events:
class OrderService
{
    public function completeOrder(Order $order): void
    {
        // BUG FIX HERE
        $order->complete();

        // EVENT PUBLISHED - fix might change event data
        $this->eventBus->publish(new OrderCompleted($order));
    }
}

Impact Questions:

  • Does the fix change event payload?
  • Are there subscribers depending on old data?
  • Are events used for external integration?

5. API Contract Analysis

Check if the change affects public APIs.

Change Type API Impact Severity
Return type change Breaking High
New exception type Breaking High
New required parameter Breaking High
New optional parameter Compatible Low
Different return value (same type) Semantic breaking Medium
Performance change SLA impact Medium

6. Database Impact

Check if the fix affects database state.

// Fix that changes data format
// BEFORE: stored as "2024-01-15"
// AFTER: stored as "2024-01-15T00:00:00Z"

// Impact:
// - Existing data incompatible
// - Need migration
// - Other services reading same data affected

Impact Questions:

  • Does fix change data format?
  • Is migration needed?
  • Are other services affected?

Impact Assessment Matrix

Severity Levels

Level Description Action Required
Low Internal implementation only Fix and test
Medium Affects callers within same bounded context Verify all callers
High Affects public API or other contexts Coordinate with stakeholders
Critical Affects external integrations Version API, migration plan

Assessment Checklist

## Impact Assessment: [Bug ID]

### Direct Impact (Low)
- [ ] Method signature unchanged
- [ ] Return type unchanged
- [ ] Exceptions unchanged
- [ ] Side effects unchanged

### Caller Impact (Medium)
- [ ] All callers identified: [count]
- [ ] Callers tested: [count]
- [ ] No behavioral changes for callers

### Cross-Context Impact (High)
- [ ] Events payload unchanged
- [ ] Messages format unchanged
- [ ] Shared database schema unchanged

### External Impact (Critical)
- [ ] Public API unchanged
- [ ] SDK compatibility maintained
- [ ] Documentation update not needed

### Overall Blast Radius: [Low/Medium/High/Critical]

Dependency Graph Building

Step 1: Identify Changed Code

// File: src/Domain/Order/OrderService.php
// Method: calculateTotal()
// Line: 45-60

Step 2: Find Direct Dependents

# Classes that use OrderService
grep -rn "OrderService" src/ --include="*.php"

# Results:
# src/Application/UseCase/CreateOrderUseCase.php:15
# src/Application/UseCase/UpdateOrderUseCase.php:18
# src/Presentation/Api/OrderController.php:22

Step 3: Build Dependency Tree

OrderService::calculateTotal()
├── CreateOrderUseCase (calls calculateTotal)
│   ├── OrderController::create() (calls UseCase)
│   │   └── POST /api/orders (HTTP endpoint)
│   └── CreateOrderFromCartHandler (event handler)
│       └── CartCheckoutCompleted (event trigger)
│
├── UpdateOrderUseCase (calls calculateTotal)
│   ├── OrderController::update() (calls UseCase)
│   │   └── PUT /api/orders/{id} (HTTP endpoint)
│   └── AddItemToOrderHandler (command handler)
│
└── OrderTotalRecalculationJob (calls calculateTotal)
    └── Scheduler (cron trigger)

Step 4: Assess Each Branch

Dependent Risk Needs Testing Notes
CreateOrderUseCase Medium Yes Core flow
UpdateOrderUseCase Medium Yes Core flow
OrderController::create Low Covered Via UseCase test
OrderController::update Low Covered Via UseCase test
CreateOrderFromCartHandler High Yes Async, hard to debug
OrderTotalRecalculationJob High Yes Background job

Side Effects Mapping

Intentional Side Effects

class OrderService
{
    public function completeOrder(Order $order): void
    {
        $order->complete();                        // State change
        $this->repository->save($order);           // Database write
        $this->eventBus->publish($event);          // Event published
        $this->metrics->increment('orders.completed'); // Metrics
        $this->logger->info('Order completed');    // Logging
    }
}

Side Effect Impact Table

Side Effect Preserved After Fix? Impact if Changed
Entity state change Must preserve Breaks domain logic
Database write Must preserve Data inconsistency
Event publish Check payload Downstream handlers affected
Metrics Should preserve Dashboard/alerts affected
Logging Can change Low impact

Test Coverage Analysis

Finding Existing Tests

# Tests for the class being fixed
grep -rn "OrderService" tests/ --include="*.php"

# Tests that might break
grep -rn "calculateTotal" tests/ --include="*.php"

Coverage Gaps

## Test Coverage for OrderService::calculateTotal()

### Existing Tests
- [x] OrderServiceTest::testCalculateTotalWithItems
- [x] OrderServiceTest::testCalculateTotalEmpty
- [ ] Missing: testCalculateTotalWithNullItem ← Bug case

### Integration Tests
- [x] CreateOrderUseCaseTest
- [ ] Missing: UpdateOrderUseCaseTest

### E2E Tests
- [x] POST /api/orders
- [ ] Missing: PUT /api/orders/{id}

Quick Impact Commands

# Find all files that import/use the changed class
grep -rln "use.*OrderService" src/

# Find all method calls
grep -rn "->calculateTotal(" src/ tests/

# Find event subscribers
grep -rn "OrderCompleted" src/

# Find API routes using the controller
grep -rn "OrderController" routes/

# Count affected files
grep -rln "OrderService" src/ | wc -l

Impact Report Template

# Impact Analysis Report

## Bug: [ID/Description]
## Fix Location: [File:Line]

## Blast Radius Summary

| Dimension | Count | Risk |
|-----------|-------|------|
| Direct Callers | X | Low/Med/High |
| Event Handlers | X | Low/Med/High |
| API Endpoints | X | Low/Med/High |
| Database Tables | X | Low/Med/High |
| External Services | X | Low/Med/High |

## Detailed Impact

### Callers Affected
1. [Caller 1] - [Impact description]
2. [Caller 2] - [Impact description]

### Events Affected
1. [Event 1] - [Payload change?]

### APIs Affected
1. [Endpoint 1] - [Response change?]

## Testing Requirements
- [ ] Unit test for fix
- [ ] Integration tests for callers
- [ ] E2E tests for APIs
- [ ] Manual testing for [scenarios]

## Rollout Recommendation
- [ ] Safe for immediate deployment
- [ ] Requires staged rollout
- [ ] Requires feature flag
- [ ] Requires coordination with [teams]

当前收录版本

0.0.1

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值95/100

亮点

  • 提供系统化的缺陷修复影响范围分析框架
  • 涵盖直接调用者、依赖项、数据流、事件、API合约、数据库等多个分析维度
  • 包含实用的命令行工具和代码示例,可直接应用于实际开发场景
触发精准90/100

亮点

  • 触发描述准确反映了Skill的核心功能
  • description与skill_body内容高度一致,边界清晰
结构规范95/100

亮点

  • 文档结构完整,包含概念介绍、分析维度、评估矩阵、依赖图构建等多个章节
  • 提供了具体的代码示例、命令行工具和模板
  • frontmatter完整,格式规范
执行可靠90/100

亮点

  • 提供了具体的grep命令和PHP代码示例
  • 覆盖了主要的影响分析场景和异常情况
  • 包含测试覆盖分析和部署建议
证据可验 (前四项均值)93/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

翻译待完成,请参阅来源文档。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。