dependency-cruiser
AGENTS.md7.4k starsChanged 4 years agoMITView on GitHub
Meant for both humans and agents. Respond terse like smart caveman. All technical substance stay. Only fluff die. Rules: - Provide concise responses without unnecessary elaboration - Focus on code solutions rather than lengthy explanations - Use bullet points for multi-part information when appropriate - Avoid repetition of information already visible in the code - Drop: articles (a/an/the), filler (just/really/basically), pleasantries, hedging - Fragments OK. Short synonyms. Technical terms exact. Code unchanged. - Pattern: [thing] [action] [reason]. [next step]. -…
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about sverweij/dependency-cruiser
- @nick-tune.me“Dependency cruiser is nice. An elegant way to express and enforce architectural constraints. …”Bluesky · Jan 28, 2026 · 8 likes
- pahen/madge“Feature: Interactive graph [as html page]”GitHub · Nov 12, 2022 · 5 reactions
- webpack/enhanced-resolve“Filesystem cache is never cleared based on duration when running completely synchronously”GitHub · Jul 9, 2020 · 4 reactions
- Ilenburg1993/chatgpt-docker-puppeteer“deps(deps-dev): bump dependency-cruiser from 16.10.4 to 17.3.8”GitHub · Feb 16, 2026 · 3 reactions
- @nicoespeon.com“Good luck! If it doesn't work, maybe dependency-cruiser can help. I switch between them depending on the …”Bluesky · May 29, 2025 · 3 likes
The biggest 5 of 59 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 59
Talked about on GitHub, Stack Overflow, Bluesky and Hacker News (59 times).
On GitHub · 50
- Nov 12, 2022Feature: Interactive graph [as html page] — pahen/madge5 reactions
- Jul 9, 2020Filesystem cache is never cleared based on duration when running completely synchronously — webpack/enhanced-resolve4 reactions · 9 comments
- Feb 16, 2026deps(deps-dev): bump dependency-cruiser from 16.10.4 to 17.3.8 — Ilenburg1993/chatgpt-docker-puppeteer3 reactions · 3 comments
- Oct 5, 2026Catch the old CopilotKit server runtime in the quick CopilotKit audit — amoai-tech/mdeai2 reactions · 10 comments
- Mar 30, 2026deps(deps-dev): bump dependency-cruiser from 16.10.4 to 17.3.9 — Ilenburg1993/chatgpt-docker-puppeteer2 reactions · 36 comments
45 more on GitHub
- Nov 12, 2026build(deps): bump the npm-dependencies group across 1 directory with 12 updates — jonathanong/agent-blackboard1 reaction · 1 comment
- Nov 9, 2026chore(deps-dev): bump the dev-dependencies group across 1 directory with 13 updates — AutoDevJapan/FourBrosMahjong1 reaction
- Nov 9, 2026chore(deps-dev): bump the lint-toolchain group across 4 directories with 9 updates — mento-protocol/monitoring-monorepo1 reaction · 6 comments
- Nov 6, 2026build(deps-dev): bump the dev-dependencies group across 1 directory with 14 updates — AutoDevJapan/FourBrosMahjong1 reaction · 1 comment
- Nov 5, 2026build(deps): bump the npm-dependencies group across 1 directory with 10 updates — jonathanong/agent-blackboard1 reaction · 3 comments
- Nov 5, 2026chore(deps-dev): bump dependency-cruiser from 18.7.1 to 18.7.2 — vouchington/vouchington-platform1 reaction · 2 comments
- Nov 4, 2026chore(deps-dev): bump dependency-cruiser from 18.7.0 to 18.7.1 — vouchington/vouchington-platform1 reaction · 2 comments
- Oct 28, 2026chore(deps-dev): bump dependency-cruiser from 18.6.0 to 18.7.0 — vouchington/vouchington-tooling1 reaction · 2 comments
- Oct 28, 2026chore(deps-dev): bump the lint-toolchain group across 4 directories with 11 updates — mento-protocol/monitoring-monorepo1 reaction · 4 comments
- Oct 26, 2026chore(deps-dev): bump the npm-development group across 1 directory with 13 updates — jonathanong/auto-harness1 reaction · 1 comment
- Oct 26, 2026P0.09 Update the dependency-cruiser version — Undefined6799/unset1 reaction · 1 comment
- Oct 23, 2026chore(deps-dev): bump dependency-cruiser from 18.6.0 to 18.7.0 — vouchington/vouchington-platform1 reaction · 2 comments
- Oct 22, 2026build(deps): bump the npm-dependencies group with 11 updates — jonathanong/agent-blackboard1 reaction · 2 comments
- Oct 20, 2026chore(deps-dev): bump dependency-cruiser from 18.5.0 to 18.6.0 — vouchington/vouchington-tooling1 reaction · 2 comments
- Oct 19, 2026Bump the "dependencies" group with 2 updates across multiple ecosystems — tutors-sdk/tutors-mono-repo1 reaction · 2 comments
- Oct 17, 2026chore(deps-dev): bump the npm-development group across 1 directory with 12 updates — jonathanong/auto-harness1 reaction · 1 comment
- Oct 15, 2026P1.25o Own the island runtime's new paths — Undefined6799/unset1 reaction · 1 comment
- Oct 14, 2026P1.33i Let the preflight import shared/host-pin — Undefined6799/unset1 reaction · 1 comment
- Oct 14, 2026chore(deps-dev): bump dependency-cruiser from 18.5.0 to 18.6.0 — vouchington/vouchington-platform1 reaction · 2 comments
- Oct 5, 2026build(deps-dev): bump dependency-cruiser from 18.4.0 to 18.5.0 — tutors-sdk/tutors-mono-repo1 reaction · 6 comments
- Oct 3, 2026Bump the npm-development group across 1 directory with 3 updates — shamailsik-prog/copilot-hack1 reaction
- Sep 26, 2026Bump the npm-development group across 1 directory with 2 updates — shamailsik-prog/copilot-hack1 reaction · 1 comment
- Sep 23, 2026chore(deps-dev): bump dependency-cruiser from 18.0.0 to 18.4.0 — AutoDevJapan/PassShare1 reaction · 3 comments
- Sep 21, 2026chore(deps-dev): bump dependency-cruiser from 18.2.0 to 18.3.0 — vouchington/vouchington-tooling1 reaction · 3 comments
- Sep 21, 2026chore(deps-dev): bump the npm-development group with 10 updates — jonathanong/auto-harness1 reaction
- Sep 21, 2026build(deps-dev): bump the dev-dependencies group across 1 directory with 8 updates — AutoDevJapan/FourBrosMahjong1 reaction · 2 comments
- Sep 19, 2026Bump dependency-cruiser from 18.2.0 to 18.3.1 in /possible-solution/client in the npm-development group — shamailsik-prog/copilot-hack1 reaction · 1 comment
- Aug 24, 2026chore(deps-dev): bump dependency-cruiser from 16.10.4 to 18.2.0 — jonathanong/auto-harness1 reaction · 1 comment
- Aug 17, 2026⬆️ deps: bump the minor-and-patch group with 3 updates — mattyan1053/valence1 reaction · 2 comments
- Aug 10, 2026deps(deps-dev): bump dependency-cruiser from 18.1.0 to 18.1.1 — oscharko-dev/Keiko1 reaction · 6 comments
- Aug 6, 2026deps(deps-dev): bump the development-dependencies group across 1 directory with 4 updates — flyingrobots/wesley1 reaction · 1 comment
- Jul 20, 2026build(deps-dev): bump the routine-major group with 3 updates — zaks-io/splitch1 reaction · 2 comments
- Jul 13, 2026deps(deps-dev): bump the development-dependencies group across 1 directory with 3 updates — flyingrobots/wesley1 reaction · 1 comment
- Jul 13, 2026build(deps-dev): bump dependency-cruiser from 17.4.3 to 18.1.0 — zaks-io/splitch1 reaction · 2 comments
- Jun 29, 2026deps(deps-dev): bump dependency-cruiser from 17.4.3 to 18.0.0 in /extensions/openburnbar — Imagine-That-Ai/BurnBar1 reaction · 5 comments
- Jun 15, 2026deps(deps-dev): bump the development-dependencies group across 1 directory with 7 updates — flyingrobots/wesley1 reaction · 2 comments
- Jun 15, 2026deps(deps-dev): bump the development-dependencies group across 1 directory with 8 updates — flyingrobots/wesley1 reaction · 2 comments
- Jun 9, 2026deps(deps-dev): bump the development-dependencies group across 1 directory with 6 updates — flyingrobots/wesley1 reaction · 2 comments
- Jun 2, 2026deps(deps-dev): bump the development-dependencies group across 1 directory with 5 updates — flyingrobots/wesley1 reaction · 2 comments
- May 30, 2026build(deps-dev): bump the npm-dev-non-breaking group with 3 updates — Larrybin/aooi1 reaction
- May 23, 2026build(deps-dev): bump the npm-dev-non-breaking group with 7 updates — Larrybin/aooi1 reaction
- Feb 25, 2026build(deps-dev): bump dependency-cruiser from 17.3.7 to 17.3.8 — Miyamura80/Tauri-Template1 reaction · 2 comments
- Feb 15, 2026build(deps-dev): bump dependency-cruiser from 17.3.4 to 17.3.8 — joelklabo/markdowntown1 reaction
- Jan 23, 2024add dependency validation to CI — rilldata/rill1 reaction
- Nov 11, 2026Feature: Baseline known violations so only new ones fail — RichCorbett/coherence0 reactions
On Stack Overflow · 5
- Mar 8, 2020How to enforce dependency rules in javascript/typescript/webpack3 votes
- Feb 19, 2020npm install global vs local installing different things1 vote · 1 answer
- Nov 22, 2022How to create a dependency graph of components in Ember?0 votes
- Mar 10, 2019It there any way to automatically visualizate JavaScript code tree?0 votes
- Feb 25, 2019How to filter the modules included in JetBrains "module dependency diagram"?0 votes · 1 answer
On Bluesky · 3
- Jan 28, 2026Dependency cruiser is nice. An elegant way to express and enforce architectural constraints. github.com/sverweij/dep... — @nick-tune.me8 likes and reposts
- May 29, 2025Good luck! If it doesn't work, maybe dependency-cruiser can help. I switch between them depending on the projects and how it goes… — @nicoespeon.com3 likes and reposts · 1 reply
- Feb 2, 2025モジュールに対して制約を書きたい 1. このモジュールは import * できるできない 2. このモジュールは X から import できるできない 3. このモジュールは Y を import できるできない 4.… — @azu.bsky.social3 likes and reposts · 1 reply
On Hacker News · 1
- Nov 6, 2019Dependency-cruiser: Validate and visualize JavaScript dependencies1 point
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
35 rules. About 1 is common, 20 are distinctive, and 14 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈20
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 7
before proposing/ committing code node --run=check:full MUST ALWAYS pass without errors.
- Very specific: line 9
if there's a need to run targeted tests e.g.
- Distinctive: line 18
Use bullet points for multi-part information when appropriate
- Distinctive: line 19
Avoid repetition of information already visible in the code
- Distinctive: line 27
Stop: "stop caveman" or "normal mode"
- Very specific: line 35
Use ECMAScript Modules (ESM) with .mjs file extensions for new code
- Very specific: line 36
Use CommonJS with .cjs for backward compatibility when needed
- Very specific: line 38
Use the # import alias for internal modules (e.g., import xyz from "#config-utl/extract-depcruise-config.mjs")
- Very specific: line 44
Test files have the same name as the file they test with a .spec.mjs extension
- Very specific: line 56
Prefer const over let
- Distinctive: line 57
Use ES6+ features (arrow functions, destructuring)
- Distinctive: line 63
Use JSDoc for public functions, classes, and methods
- Distinctive: line 65
Use TypeScript-style type annotations
- Very specific: line 66
Use @typedef for complex types
- Very specific: line 86
Use Node.js built-in assert/strict library for assertions (import { deepEqual, ok } from "node:assert/strict")
- Distinctive: line 88
Use meaningful test descriptions that explain what's being tested
- Very specific: line 89
When appropriate, use beforeEach/afterEach hooks for setup and teardown
- Distinctive: line 90
Test both success and error cases
- Very specific: line 91
Start the title of the _describe_ grouping unit tests with [U] , that of integration tests with [I] and that of end-to-end tests with [E]
- Distinctive: line 118
Prefer try/catch blocks for error handling, especially with async operations
- Distinctive: line 120
Use descriptive error messages that help pinpoint the issue
- Distinctive: line 121
Use appropriate error types when throwing
- Distinctive: line 127
Import types from type definition files where needed
- Distinctive: line 128
Use TypeScript annotations in JSDoc comments where appropriate
- Distinctive: line 132
Import statements should be ordered:
- Distinctive: line 136
Use named imports where appropriate
- Distinctive: line 137
Use async import() for dynamic imports
- Distinctive: line 141
Write pure functions where possible
- Distinctive: line 143
Use early returns to reduce nesting
- Distinctive: line 146
Write defensive code that handles edge cases gracefully
- Very specific: line 151
ALWAYS postfix commit messages with [AI].
- Common: line 152
ALWAYS include user prompt in the commit body in markdown code block.
- Very specific: line 156
If the user asks you to open a GitHub PR.
- Distinctive: line 157
ALWAYS follow the instructions in the Invariants sections above.
- Very specific: line 166
Always prefix shell commands with rtk:
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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
Instructions for contributing code to dependency-cruiser
Meant for both humans and agents.
Invariants
- before proposing/ committing code
node --run=check:fullMUST ALWAYS pass without errors. - fix formatting issues with
node --run=format - if there's a need to run targeted tests e.g. in a fix-verify loop use
node --run=test -- -f "title of the test"
Communication Style
Respond terse like smart caveman. All technical substance stay. Only fluff die.
Rules:
- Provide concise responses without unnecessary elaboration
- Focus on code solutions rather than lengthy explanations
- Use bullet points for multi-part information when appropriate
- Avoid repetition of information already visible in the code
- Drop: articles (a/an/the), filler (just/really/basically), pleasantries, hedging
- Fragments OK. Short synonyms. Technical terms exact. Code unchanged.
- Pattern: [thing] [action] [reason]. [next step].
- Not: "Sure! I'd be happy to help you with that."
- Yes: "Bug in auth middleware. Fix:"
Switch level: /caveman lite|full|ultra Stop: "stop caveman" or "normal mode"
Auto-Clarity: drop caveman for security warnings, irreversible actions, user confused. Resume after.
Boundaries: code/commits/PRs written normal.
Module System
- Use ECMAScript Modules (ESM) with
.mjsfile extensions for new code - Use CommonJS with
.cjsfor backward compatibility when needed - Include explicit file extensions in imports (
.mjsor.cjs) - Use the
#import alias for internal modules (e.g.,import xyz from "#config-utl/extract-depcruise-config.mjs")
File Organization
- Source code is located in
/srcdirectory, organized in feature-specific subdirectories - Tests are in
/testdirectory, mirroring the structure of/src - Test files have the same name as the file they test with a
.spec.mjsextension
Code Style & Formatting
Naming & Coding Conventions
- Variables/functions: camelCase
- Classes: PascalCase
- Parameters: prefix with
p(e.g.,pOptions) - Local variables: prefix with
l(e.g.,lVersion) - Constants: UPPER_SNAKE_CASE
- Boolean functions: use
is/hasprefixes - Prefer
constoverlet - Use ES6+ features (arrow functions, destructuring)
Documentation
JSDoc
- Use JSDoc for public functions, classes, and methods
- Include
@param,@returns, and@throwstags - Use TypeScript-style type annotations
- Use
@typedeffor complex types
Example:
/**
* Function description
*
* @param {string} pModuleName - Description of parameter
* @param {object} [pOptions] - Options object (square brackets denote optional)
* @param {string} [pOptions.semanticVersion] - A semantic version range
* @returns {Promise<NodeModule|false>} - Description of return value
* @throws {Error} - When something goes wrong
*/Testing
Mocha Testing Framework
- Tests use Mocha (note the
describe,it,beforeEach,afterEachsyntax) - Use Node.js built-in
assert/strictlibrary for assertions (import { deepEqual, ok } from "node:assert/strict") - Group related tests in
describeblocks - Use meaningful test descriptions that explain what's being tested
- When appropriate, use
beforeEach/afterEachhooks for setup and teardown - Test both success and error cases
- Start the title of the describe grouping unit tests with
[U], that of integration tests with[I]and that of end-to-end tests with[E]
Example test structure:
import { deepEqual, ok } from "node:assert/strict";
import functionToTest from "#path/to/function.mjs";
describe("[I] module/functionToTest", () => {
it("should handle normal case", () => {
const result = functionToTest(input);
deepEqual(result, expectedOutput);
});
it("throws when given invalid input", () => {
let error = null;
try {
functionToTest(invalidInput);
} catch (pError) {
error = pError;
}
ok(error instanceof Error);
});
});Error Handling
- Prefer try/catch blocks for error handling, especially with async operations
- Return
falseor null for expected failure conditions instead of throwing (seetryImportpattern) - Use descriptive error messages that help pinpoint the issue
- Use appropriate error types when throwing
Types
- The project uses JSDoc comments with TypeScript-style types
- Type definitions are stored in the
/typesdirectory with.d.mtsextensions - Import types from type definition files where needed
- Use TypeScript annotations in JSDoc comments where appropriate
Dependencies and Imports
- Import statements should be ordered:
- Node.js built-in modules (prefixed with
node:) - External dependencies
- Internal modules (using the
#alias)
- Node.js built-in modules (prefixed with
- Use named imports where appropriate
- Use async import() for dynamic imports
Best Practices
- Write pure functions where possible
- Avoid side effects
- Use early returns to reduce nesting
- Apply the single responsibility principle
- Be mindful of performance, especially for operations that may run on large dependency trees
- Write defensive code that handles edge cases gracefully
- For optional features/dependencies, use the
tryImportpattern to check availability
Git
- ALWAYS postfix commit messages with
[AI]. - ALWAYS include user prompt in the commit body in markdown code block. NEVER include secrets, PII, or proprietary prompt content.
GitHub PR
- If the user asks you to open a GitHub PR; ALWAYS add the phrase "I am an AI. Barada nikto." to the
## AI disclosurePR description section and
ALWAYS follow the instructions in the Invariants sections above.
<!-- rtk-instructions v2 -->RTK — Token-Optimized CLI
rtk is a CLI proxy that filters and compresses command outputs, saving 60-90% tokens.
Rule
Always prefix shell commands with rtk:
# Instead of: Use:
git status rtk git status
git log -10 rtk git log -10
cargo test rtk cargo test
docker ps rtk docker ps
kubectl get pods rtk kubectl get podsMeta commands (use directly)
rtk gain # Token savings dashboard
rtk gain --history # Per-command savings history
rtk discover # Find missed rtk opportunities
rtk proxy <cmd> # Run raw (no filtering) but track usage<!-- /rtk-instructions -->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.

