How this skill is triggered — by the user, by Claude, or both
Slash command
/ccmagic:analyze-impactsonnetThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Analyze the blast radius and dependencies for a specific file, feature, or set of changes. Helps understand what might break before making changes.
Analyze the blast radius and dependencies for a specific file, feature, or set of changes. Helps understand what might break before making changes.
$ARGUMENTS
If no argument provided, analyze currently staged or uncommitted changes.
Determine what to analyze:
git ls-files and grep to find files matching that name in their path or contents, then analyze the most relevant set.git diff --name-only (uncommitted changes).Use the Task tool to launch multiple Explore agents simultaneously:
# Send a SINGLE message with THREE parallel Task calls:
Task 1: {
subagent_type: "Explore",
prompt: "Find all files that IMPORT or DEPEND ON [target files].
Trace the dependency graph outward. List all affected files."
}
Task 2: {
subagent_type: "Explore",
prompt: "Find all files that [target files] IMPORT or DEPEND ON.
Trace the dependency graph inward. Identify core dependencies."
}
Task 3: {
subagent_type: "Explore",
prompt: "Find all TESTS that cover [target files].
Identify test files, test functions, and coverage areas."
}
If mcp__pal__analyze is available:
mcp__pal__analyze with:
analysis_type: "architecture"
relevant_files: [target files and dependencies]
step: "Analyze impact and blast radius of changes to these files"
# Impact Analysis Report
**Target**: [file/feature being analyzed]
**Generated**: [timestamp]
## Summary
- **Direct Dependencies**: X files depend on this
- **Indirect Dependencies**: Y files affected transitively
- **Test Coverage**: Z test files cover this code
- **Risk Level**: [Low/Medium/High/Critical]
## Dependency Graph
### Files That Import This (Dependents)
Files that will break if this file's exports change:
| File | Import Type | Risk |
|------|-------------|------|
| `src/components/UserProfile.tsx` | Named import: `useAuth` | High |
| `src/pages/Login.tsx` | Default import | Medium |
### Files This Imports (Dependencies)
Files that this code relies on:
| File | Import Type | Stability |
|------|-------------|-----------|
| `src/utils/api.ts` | Named import | Stable |
| `src/types/user.ts` | Type import | Stable |
## Test Coverage
### Direct Tests
Tests that specifically test this file:
- `tests/auth/useAuth.test.ts` - 15 test cases
- `tests/integration/auth.test.ts` - 8 test cases
### Indirect Tests
Tests that exercise this code through other paths:
- `tests/e2e/login.test.ts` - Uses auth flow
### Coverage Gaps
Areas with insufficient test coverage:
- Error handling in `refreshToken()`
- Edge case: expired session
## Breaking Change Analysis
### Public API Surface
Exports that other files depend on:
```typescript
export function useAuth(): AuthContext // 12 dependents
export type AuthState = {...} // 8 dependents
export const AUTH_EVENTS = {...} // 3 dependents
These modifications are unlikely to break dependents:
These modifications may break dependents:
npm test -- --grep "auth"context/knowledge/ARCHITECTURE.mdcontext/knowledge/CONVENTIONS.mdcontext/knowledge/STACK.md
## Quick Analysis Mode
For quick checks, run a simplified analysis:
```bash
# Find direct imports (grep-based, fast)
grep -r "from.*[target-file]" --include="*.ts" --include="*.tsx" --include="*.js"
# Find test files
find . -name "*.test.*" -o -name "*.spec.*" | xargs grep -l "[target-name]"
# Analyze a specific file
/ccmagic:analyze-impact src/auth/useAuth.ts
# Analyze a feature
/ccmagic:analyze-impact authentication
# Analyze current changes
/ccmagic:analyze-impact
Begin analysis immediately. Use parallel Explore agents for efficiency. Focus on actionable insights that help developers understand change risk before modifying code.
npx claudepluginhub devondragon/ccmagic --plugin ccmagicCreates bite-sized, testable implementation plans from specs or requirements, with file structure and task decomposition. Activates before coding multi-step tasks.