--- name: dependency-analysis description: This skill should be used when the user asks about a file's dependencies, "what does X import", "what depends on X", "show me the dependency graph", "are there circular dependencies", or wants to map imports/dependents before working on a file. --- # Dependency Analysis Analyze dependencies for a file using the Constellation `code_intel` tool (from the `constellation` MCP server). If the user hasn't named a file, ask which file to analyze. ## Dependencies (what the file imports) Call the `code_intel` tool with this code, substituting the file path the user named: ```javascript const [deps, circles] = await Promise.all([ api.getDependencies({ filePath: "src/path/to/file.ts", depth: 2, includePackages: true }), api.findCircularDependencies({ filePath: "src/path/to/file.ts" }) ]); return { dependencies: deps, circularDependencies: circles }; ``` Present: 1. **Summary**: Count of internal vs external dependencies 2. **Internal Dependencies**: Each file and what symbols are imported from it 3. **External Packages**: List of packages used 4. **Circular Dependencies**: If any cycles detected, show severity and the cycle path ## Dependents (what imports the file) When the user asks the reverse question ("what depends on X", "what uses this file"): ```javascript const result = await api.getDependents({ filePath: "src/path/to/file.ts", depth: 2 }); return result; ``` Present: 1. **Summary**: How many files depend on this one 2. **Dependents**: Each file and what it imports from this file 3. **Note**: Suggest reviewing these files if planning changes Highlight any circular dependencies as potential issues to address. **If error**, explain the error and provide guidance from the error response. The `constellation-troubleshooting` skill covers error codes in depth.