dependency-analyzer
Skill22 starsChanged 10 days agoMITView on GitHub
Detect new imports in uncommitted changes and flag cross-layer coupling (types ← core ← extensions ← apps). Use when adding a cross-package import, before /openai-reviewer, or on "what does this depend on" / "did I introduce coupling". Read-only.
In this repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docsSkill
- handoffSkill
- openai-reviewerSkill
- plugin-homeSkill
- schema-validatorSkill
- security-auditSkill
- session-auditSkill
- test-validatorSkill
- claude-codeSkill
- codexSkill
- opencodeSkill
- chartsSkill
- export-csvSkill
- export-excelSkill
- make-chartSkill
- make-html-reportSkill
- make-pdfSkill
- a2a-communicateSkill
- a2a-handle-inboundSkill
- codebase-inspectionSkill
- ethos-skill-authoringSkill
- native-mcpSkill
- github-authSkill
- github-code-reviewSkill
- github-issuesSkill
- github-pr-workflowSkill
- github-repo-managementSkill
- birth-ritualSkill
- get-to-know-youSkill
- xurlSkill
- arxivSkill
- grounded-citationsSkill
- research-paper-writingSkill
- reddit-researchSkill
- code-reviewSkill
- coding-agentSkill
- planSkill
- requesting-code-reviewSkill
- spikeSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- tddSkill
- writing-plansSkill
- no-ai-slopSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
No arguments — analyses uncommitted + staged changes against HEAD.
- Very specific: line 60
Before invoking /openai-reviewer on a non-trivial diff — a clean dependency report makes the review focused on logic, not coupling concerns.
- Distinctive: line 61
When the user asks "what does this depend on now", "did I introduce coupling", "any new imports".
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Dependency Analyzer
Greps git diff for new import lines, classifies the importer and the imported module by layer, and flags any cross-layer import that violates the project's dependency direction.
The layer rule
From ARCHITECTURE.md:
types ← core ← extensions ← appsAnyone can import from @ethosagent/types (zero-dep contracts). Nothing should import upward — core does not import extensions, extensions do not import apps. Imports across siblings at the same layer (e.g. extension A → extension B) are also a smell — extensions should compose via the contracts in types, not depend on each other.
Usage
.agents/skills/dependency-analyzer/scripts/dep-analyzeNo arguments — analyses uncommitted + staged changes against HEAD.
Output shape
{
"new_imports": [
{
"file": "packages/core/src/agent-loop.ts",
"importer_layer": "core",
"module": "@ethosagent/llm-anthropic",
"module_layer": "extensions"
}
],
"violations": [
{
"file": "packages/core/src/agent-loop.ts",
"importer_layer": "core",
"module": "@ethosagent/llm-anthropic",
"module_layer": "extensions",
"rule": "core must not import from extensions"
}
],
"verdict": "violations_found"
}verdict is "clean", "violations_found", or "unchanged" (no new imports).
When to use
- Adding a workspace dependency, especially one that crosses layers.
- Adding any
importfrom a different package than the one you're editing. - Before invoking
/openai-revieweron a non-trivial diff — a clean dependency report makes the review focused on logic, not coupling concerns. - When the user asks "what does this depend on now", "did I introduce coupling", "any new imports".
When NOT to use
- For checking type-level imports (
import type { ... }) only — those don't create runtime coupling, the script still flags them but treat as informational. - As a substitute for the constitution validator in
pnpm check— that runs against more than just imports.
Acting on violations
Per CLAUDE.md Rule 7: if the violation is intentional (e.g. wiring layer pulling extensions to compose them), open a constitutional amendment per ARCHITECTURE.md §VI. Otherwise refactor — pull the shared piece into @ethosagent/types or invert the dependency.
Read-only
Reads git diff and the filesystem only. Does not modify code.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

