Skip to content

GoBeyondYang/skills

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License Claude Code Skill

business-conflict-analyzer

A Claude Code skill that detects breaking changes before they hit production.
Parses git diff, maps business impact across your codebase, and blocks risky commits.


The problem

You delete a field from a DTO. Tests pass. CR passes. Then OrderService and CustomerService both crash at runtime because they were calling getMobile() on the old struct.

This skill exists to make that scenario impossible.


How it works

git diff → diff_analyzer.py (parse changes by language)
         → impact_mapper.py (find references, map layers, match patterns)
         → report_generator.py (bilingual report + dependency graph)

Three Python scripts, piped together. Each step is independent, testable, and deterministic — same diff, same output, every time.

Per-language parsing

Language Detects
Java class, interface, enum, method, field, annotation
Python class, function, decorator, property
TypeScript interface, type, class, enum, method, property
Go struct, interface, func, field
Vue (SFC) props, emits, ref/reactive, template bindings
JSP taglib, include, useBean, EL expressions
SQL DDL statements
YAML / Properties / XML key-level add/delete

Architecture layer mapping

100+ filename patterns → business layer (API, data, business logic, frontend, config, etc.). A controller-named file is automatically tagged as "API layer (external interface contract)".

Reference search

Tries system grep first (fast), falls back to Python os.walk (compatible with Windows cmd/PowerShell). Results cached per symbol to avoid redundant scans.

Historical co-change analysis

For P0 changes, runs git log -S <symbol> --since=6.months.ago to surface files that historically changed together with the modified symbol.


Example output

Impact dependency graph

The generated conflict-report.md contains a Mermaid dependency graph, per-file impact table, and risk assessment. Internal symbols are language-agnostic; output is translated to business language:

field_del:mobile  →  "Field 'mobile' removed" / "删除字段:mobile"
java:+1/-2        →  "Java interface changed: +1/-2 declarations"

A real report excerpt — showing how a DTO field rename ripples across a multi-language codebase:

### Change Details

| Risk | Type | File | Business Impact |
|:---:|:----:|------|----------------|
| 🔴 P0 | 🔴 Data layer | UserDTO.java | User API will no longer return mobile, replaced by phone |
| 🔴 P0 | 🟡 API layer | OrderController.java | Path changed — all callers get 404 |
| 🟡 P1 | 🟡 Config  | order.yml | Timeout/retry keys removed → defaults apply |

### Reference Analysis (Multi-language)

| Impact | Lang | File | Reference |
|--------|:----:|------|-----------|
| 🔴 Compile failure | Java  | PaymentService.java | `user.getMobile()` |
| 🔴 Runtime error   | Python| payment_service.py  | `user['mobile']` |
| 🔴 Compile failure | Go    | user_handler.go     | `user.Mobile` |
| 🔴 Compile failure | TS    | notification.module | `userDTO.mobile` |
| 🟡 Field migration | Vue   | UserProfile.vue     | expects `user.mobile` |

The full report is bilingual (en/zh) — same data, both languages.


When the skill triggers

Claude automatically runs this skill when it detects changes to:

  • DTO/VO field add/delete/rename
  • Interface/RPC/Feign method signature changes
  • Database DDL (ALTER TABLE, DROP COLUMN, MODIFY COLUMN)
  • Message/event schema changes
  • Configuration property add/delete
  • Enum value add/deprecate
  • Frontend component props/emits changes
  • JSP taglib/include changes
  • API endpoint/route path, method, or parameter changes

No need to ask Claude to "run impact analysis" — it knows when to do it.


Commit Guard (physical safety net)

A PreToolUse hook that runs analysis before every git commit:

  • P0 breaking changes → commit blocked, report printed, choose: Accept / Reject / Revise
  • No P0 → commit proceeds
  • Analysis crashes → commit allowed (fail-open)

Quick start

# Register the skill
claude add skill https://github.com/GoBeyondYang/skills/raw/main/skills/business-conflict-analyzer/SKILL.md

# (Optional) install commit guard
bash ~/.claude/skills/business-conflict-analyzer/scripts/install_hook.sh

The fetch field in SKILL.md auto-downloads all Python scripts on first run — no git clone needed.


License

Apache 2.0

About

Claude Code Skill for breaking change detection — analyze git diff, map business impact, detect API/field/schema incompatibilities, block risky commits. Supports Java, Python, TypeScript, Go, Vue, JSP with bilingual (en/zh) reports.

Topics

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors