.claude/skills/impact-analysis/SKILL.md
Impact analysis for understanding how code changes affect the system. Covers git diff analysis, entity mapping, flow identification, and regression suggestions. Use this skill when analyzing branches, planning testing, or understanding change scope.
npx skillsauth add NextSpark-js/nextspark impact-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyze the potential impact of code changes on the system.
Impact analysis identifies what parts of the system may be affected by a code change. Think of it like a domino effect - pushing one domino (making a change) may cause others to fall.
┌─────────────────────────────────────────────────────────────┐
│ 1. Git Diff │
│ ↓ │
│ Gets list of modified files │
│ │
│ 2. Classification │
│ ↓ │
│ Groups by type: API, UI, DB, Tests │
│ │
│ 3. Entity Mapping │
│ ↓ │
│ Relates files to system entities │
│ │
│ 4. Flow Lookup │
│ ↓ │
│ Queries registries for related flows │
│ │
│ 5. Suggestions │
│ ↓ │
│ Generates list of potentially affected areas │
└─────────────────────────────────────────────────────────────┘
| Capability | Example | |------------|---------| | Modified files | "5 files changed in /products" | | Direct dependencies | "Orders depends on Products" | | Existing tests | "3 tests cover this area" | | Documented flows | "Checkout flow uses this component" | | Entity relationships | "FK relationship to customers" |
| Limitation | Reason | |------------|--------| | Business impact | Doesn't know business rules | | Real severity | Cannot prioritize by criticality | | Undocumented dependencies | Only sees what's in code | | Complex side effects | Doesn't execute the code | | Runtime behavior | Static analysis only |
## Impact Analysis: feature/new-pricing
### Files Modified (23 files)
| Type | Count | Key Files |
|------|-------|-----------|
| API | 5 | orders/service.ts, payments/route.ts |
| UI | 12 | CheckoutForm.tsx, OrderSummary.tsx |
| DB | 2 | 001_add_payment_status.sql |
| Tests | 4 | checkout.cy.ts |
### Entities Affected
- **products**: API and UI modifications
- **orders**: Potentially affected (FK relationship)
- **payments**: New functionality
### Flows Potentially Impacted
- Complete checkout flow
- Order confirmation flow
- Payment processing flow
### Regression Suggestions
| Confidence | Area | Reason |
|------------|------|--------|
| High | Product CRUD | Direct changes |
| Medium | Order totals | Uses pricing |
| Low | Sales reports | May reference products |
### Related Tests
- checkout.cy.ts (@uat, @flow-checkout)
- orders.cy.ts (@api, @entity-orders)
- payments.cy.ts (@api)
| Level | Meaning | Recommendation | |-------|---------|----------------| | High | Direct dependency found | Test this area | | Medium | Indirect dependency | Consider testing | | Low | Possible relationship | Evaluate with context |
Technical analysis should be complemented with:
# Get diff from main
git diff main...feature/checkout-v2 --name-only
# Classify files
# API: src/app/api/**
# UI: src/components/**, src/app/(routes)/**
# DB: migrations/**
# Tests: cypress/**, __tests__/**
// File path patterns to entities
const entityPatterns = {
'entities/products': 'products',
'entities/orders': 'orders',
'api/v1/products': 'products',
'components/Product': 'products',
}
// Query FLOW_REGISTRY for flows using affected entities
const affectedFlows = Object.entries(FLOW_REGISTRY)
.filter(([_, flow]) =>
flow.entities.some(e => affectedEntities.includes(e))
)
| Command | Description |
|---------|-------------|
| /impact:analyze [branch] | Analyze branch impact |
| /impact:regression [feature] | Identify regression areas |
The analysis is an assistance tool. YOU decide what to test and with what priority.
development
Zod validation patterns for this Next.js application. Covers schema definition, API validation, form integration, error formatting, and type inference. Use this skill when implementing validation for APIs, forms, or entity schemas.
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
testing
Test coverage metrics and registry system for this Next.js application. Covers FEATURE_REGISTRY, FLOW_REGISTRY, TAGS_REGISTRY, and coverage metrics interpretation. Use this skill when evaluating test coverage, identifying gaps, or planning testing priorities.
development
TanStack Query (React Query) patterns for data fetching in this Next.js application. Covers useQuery, useMutation, optimistic updates, cache invalidation, and anti-patterns. Use this skill when implementing data fetching or state management with server data.