AgentSkillsCN

impact-analysis

能够有条不紊地分析代码库或基础设施变更所可能引发的波及范围。 适用于新增功能开发、代码重构、基础设施变更、数据库迁移以及其他各类修改操作前的评估。 触发条件:“影响分析”、“变更范围”、“波及半径”、“风险分析”

SKILL.md
--- frontmatter
name: impact-analysis
description: |
  Skill for systematically analyzing the blast radius of changes in a codebase or infrastructure.
  Used before adding new features, refactoring, infra changes, DB migrations, and other modifications.
  Triggers: "impact analysis", "change scope", "blast radius", "risk analysis"

Impact Analysis

Goal

Identify the blast radius and potential risks before making changes. Analyze to the level where "how far does this affect?" can be answered quantitatively.

Instructions

Step 1: Identify Change Targets

List the files/resources that directly require modification from the change request.

  • Code changes: Scan related modules, services, endpoints, DB schemas
  • Infrastructure changes: Identify target resources (K8s, DB, network, storage, etc.)
  • Output: List of files/resources to be changed

Step 2: Dependency Tracing (Blast Radius)

Trace the scope that may be affected but is not a direct change target.

Code changes:

  • What other modules import/call this module?
  • Where are the changed interfaces/DTOs used?
  • What are the related test files?
  • Are configuration files (config, env) affected?

Infrastructure changes:

  • What services/applications depend on this resource?
  • Are network paths (DNS, LB, firewall) affected?
  • Does this propagate to other environments (dev/stage/prod)?

Step 3: Breaking Change Assessment

Determine whether changes are breaking based on the criteria below.

Change TypeBreaking?Example
API signature change⚠️ PossibleParameter add/remove, response structure change
DB schema change⚠️ PossibleColumn drop, NOT NULL added, type change
Config value change⚠️ PossibleEnv variable rename, default value change
Internal refactoring✅ SafeFunction split, private rename, logic improvement
New file/endpoint addition✅ SafeAddition only, no existing code modification

Step 4: Risk Summary

Summarize findings in the format below.

code
📋 Impact Analysis Report

Change targets: N files/resources
Blast radius: M files/services (including dependencies)

⚠️ Breaking Changes:
  - [Location] Change description → Affected areas

🔍 Caution:
  - [Risk level: High/Med/Low] Description

✅ Safe Areas:
  - Summary of unaffected areas

Constraints

  • When change target files can be directly accessed, always read and analyze the code
  • Do not make assumptions like "it's probably fine" — state uncertainties explicitly
  • Always notify the user when breaking changes are found