plugins/github-copilot-modernization/skills/dependency-map/SKILL.md
Generate dependency map diagram from project build files
npx skillsauth add microsoft/github-copilot-modernization dependency-mapInstall 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 project build and package files to generate a visual map of all external dependencies grouped by functional category. Save to .github/modernize/assessment/engines/facts/dependency-map.md.
This skill focuses exclusively on declared external dependencies (libraries, frameworks, packages). For internal application structure and component relationships, see the architecture-diagram skill.
workspace-path (optional): Path to the project to analyze (defaults to current directory)Mermaid is unforgiving: one illegal character anywhere in the block crashes the whole diagram with Syntax error in text, not just the offending line. Stay strictly inside this subset:
Chart kind. flowchart LR only.
Subgraph form. Always subgraph <AlphaNumId>["display label"] (id matches [A-Za-z][A-Za-z0-9_]*, no spaces, no punctuation). NEVER use the anonymous form subgraph "label" — it crashes whenever the label contains (, ), /, -, etc.
Node form. Use Id["label"] for libraries; pick one shape per node — do not stack brackets.
Arrow form. Solid -->, dotted -.-> for transitive/indirect. Arrow labels MUST be double-quoted: -->|"persistence"|. Never bare -->|persistence|.
No line breaks in labels. The escape \n was removed in modern Mermaid and is the #1 cause of failures. Keep labels on one line (e.g., "Spring Boot 2.7.18" not "Spring Boot\n2.7.18").
Banned characters inside any label or subgraph title. Use the ASCII replacement:
| Banned | Why it breaks | Replacement |
|---|---|---|
| \n (literal two chars) | escape removed | drop, or <br/> |
| — (em-dash, U+2014) | parser treats as edge | - (ASCII hyphen) |
| – (en-dash, U+2013) | parser treats as edge | - |
| { } | opens an entity block | drop braces |
| " inside a label | closes the label early | ' (single quote) |
| \| inside a label | breaks edge-label parser | rephrase |
| @ # $ % & | unsafe | rephrase or drop |
| ( ) outside ["..."] | unbalanced parens crash | only inside the quoted label |
| smart quotes " " ' ' | not ASCII | regular " and ' |
Unique node IDs across the whole diagram. No two nodes/subgraphs may share an id.
subgraph must be closed by a matching end on its own line.
Immediately before writing the ```mermaid opening fence, emit this exact one-line HTML comment in the markdown (it does not render — it is for your own visible attestation):
<!-- mermaid-checked: no \n, no em-dash/en-dash, no {} in labels, subgraphs are id["label"], arrows are -->|"label"|, all subgraphs closed by end, ids unique -->
If you cannot truthfully emit that comment, fix the diagram first.
Analyze build files and produce the complete ## Dependencies section in one pass:
Analysis — examine only build and package management files (do NOT scan source code — that is the architecture-diagram skill's job):
For each dependency extract:
Also detect:
Categorize dependencies into functional groups:
| Category | Examples | |----------|----------| | Web Frameworks | Spring Web, ASP.NET Core MVC, JAX-RS | | Database / ORM | Hibernate, Entity Framework, JDBC drivers | | Messaging | Kafka client, RabbitMQ, Azure Service Bus | | Caching | Redis, EhCache, MemoryCache | | Logging | SLF4J, Log4j, Serilog, NLog | | Security | Spring Security, Microsoft.Identity, OAuth libs | | Observability | Micrometer, OpenTelemetry, Application Insights | | Utilities | Guava, Apache Commons, Lombok, AutoMapper |
Rules:
Diagram — Mermaid flowchart LR (re-read the Safety Constraints above before writing):
subgraph per functional category, using the subgraph Id["display label"] formLib["Library Name 1.2.3"] (single line, no \n)Reference example (this block satisfies every Safety Constraint — match its shape):
<!-- mermaid-checked: no \n, no em-dash/en-dash, no {} in labels, subgraphs are id["label"], arrows are -->|"label"|, all subgraphs closed by end, ids unique -->flowchart LR
App["MyApplication"]
subgraph Web["Web Frameworks"]
SpringMVC["Spring MVC 5.3.x"]
Thymeleaf["Thymeleaf 3.0"]
end
subgraph DB["Database / ORM"]
Hibernate["Hibernate 5.6"]
PgDriver["PostgreSQL Driver 42.6"]
end
subgraph Messaging["Messaging"]
Kafka["Kafka Client 3.4"]
end
subgraph Cache["Caching"]
Redis["Jedis 4.3"]
end
subgraph Log["Logging"]
SLF4J["SLF4J 1.7"]
Logback["Logback 1.2"]
end
subgraph Sec["Security"]
SpringSec["Spring Security 5.7"]
end
subgraph Util["Utilities"]
Lombok["Lombok 1.18"]
Jackson["Jackson 2.14"]
end
App -->|"web"| Web
App -->|"persistence"| DB
App -->|"messaging"| Messaging
App -->|"caching"| Cache
App -->|"logging"| Log
App -->|"security"| Sec
App -->|"utilities"| Util
SLF4J -.->|"implementation"| Logback
Textual explanations (write immediately after the diagram):
Collect all test-scoped dependencies (excluded from the main diagram) and produce the complete ## Test Dependencies section:
Save to .github/modernize/assessment/engines/facts/dependency-map.md with this exact structure:
# Dependency Map
A brief introduction (1-2 sentences) stating project name and total dependency count.
## Dependencies
< Mermaid flowchart LR here >
### Dependency Summary
[Table: Category | Count | Key Libraries | Notes]
### Version & Compatibility Risks
[Short paragraph on outdated or end-of-life dependencies]
### Notable Observations
[2-4 bullet points on noteworthy findings]
## Test Dependencies
[Table: Framework | Version | Notes]
Total test-scope dependencies: N
[1-2 sentences on test infrastructure observations, or "No test dependencies detected."]
Utils["12 utility libraries"]) and only show individually the top dependencies by importanceEach row below is something the model actually produced that crashed the diagram. Use the ✅ form.
| ❌ Past mistake | ✅ Safe form | Why the ❌ crashed |
|---|---|---|
| subgraph "Database / ORM" | subgraph DB["Database / ORM"] | Anonymous subgraph + / in title |
| Spring["Spring Boot\n2.5.12"] | Spring["Spring Boot 2.5.12"] | Literal \n |
| App -->\|persistence\| DB | App -->\|"persistence"\| DB | Bare arrow label |
| Lib["Spring Boot — 2.5"] | Lib["Spring Boot - 2.5"] | em-dash inside label |
| Lib["foo {bar}"] | Lib["foo bar"] | {} inside label |
> ERROR: Unsupported project type. This skill supports Java, .NET, JavaScript, and TypeScript projects only.> ERROR: No recognized build files found at workspace-path. Verify the path is correct.Note["Some dependencies could not be fully resolved"]<!-- mermaid-checked: ... --> attestation comment.github/modernize/assessment/engines/facts/dependency-map.mddevelopment
Scan dependency manifests against known CVEs and remediate by upgrading vulnerable dependencies to patched versions, then rebuild and re-scan to confirm. Self-contained scan→fix→verify loop for any project with a dependency manifest. Use when: a cve-remediation task is dispatched; dependency set changed (version bump, new framework); assessment flagged vulnerable or EOL dependencies; or user asked to "fix CVEs", "patch vulnerabilities", or "dependency security". Triggers: "cve", "remediate cve", "fix cves", "patch vulnerable dependencies", "vulnerability scanning", "dependency security", "vulnerable dependencies", "security advisories", "npm audit", "pnpm audit", "maven audit", "gradle audit", "dependency scan", "vulnerability remediation". NOT for: security audit of auth/input/secrets/OWASP code paths (use security-review).
documentation
Generate data architecture and persistence layer documentation with data model diagram
documentation
Generate core business workflow documentation with sequence diagram
data-ai
Generate architecture diagram with component relationship details from project analysis