agentleFS
sverweijsverweij/dependency-cruiser/AGENTS.md

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

Week of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projects
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about sverweij/dependency-cruiser

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

45 more on GitHub
  • 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
  1. Very specific:

    before proposing/ committing code node --run=check:full MUST ALWAYS pass without errors.

    line 7
  2. Very specific:

    if there's a need to run targeted tests e.g.

    line 9
  3. Distinctive:

    Use bullet points for multi-part information when appropriate

    line 18
  4. Distinctive:

    Avoid repetition of information already visible in the code

    line 19
  5. Distinctive:

    Stop: "stop caveman" or "normal mode"

    line 27
  6. Very specific:

    Use ECMAScript Modules (ESM) with .mjs file extensions for new code

    line 35
  7. Very specific:

    Use CommonJS with .cjs for backward compatibility when needed

    line 36
  8. Very specific:

    Use the # import alias for internal modules (e.g., import xyz from "#config-utl/extract-depcruise-config.mjs")

    line 38
  9. Very specific:

    Test files have the same name as the file they test with a .spec.mjs extension

    line 44
  10. Very specific:

    Prefer const over let

    line 56
  11. Distinctive:

    Use ES6+ features (arrow functions, destructuring)

    line 57
  12. Distinctive:

    Use JSDoc for public functions, classes, and methods

    line 63
  13. Distinctive:

    Use TypeScript-style type annotations

    line 65
  14. Very specific:

    Use @typedef for complex types

    line 66
  15. Very specific:

    Use Node.js built-in assert/strict library for assertions (import { deepEqual, ok } from "node:assert/strict")

    line 86
  16. Distinctive:

    Use meaningful test descriptions that explain what's being tested

    line 88
  17. Very specific:

    When appropriate, use beforeEach/afterEach hooks for setup and teardown

    line 89
  18. Distinctive:

    Test both success and error cases

    line 90
  19. Very specific:

    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]

    line 91
  20. Distinctive:

    Prefer try/catch blocks for error handling, especially with async operations

    line 118
  21. Distinctive:

    Use descriptive error messages that help pinpoint the issue

    line 120
  22. Distinctive:

    Use appropriate error types when throwing

    line 121
  23. Distinctive:

    Import types from type definition files where needed

    line 127
  24. Distinctive:

    Use TypeScript annotations in JSDoc comments where appropriate

    line 128
  25. Distinctive:

    Import statements should be ordered:

    line 132
  26. Distinctive:

    Use named imports where appropriate

    line 136
  27. Distinctive:

    Use async import() for dynamic imports

    line 137
  28. Distinctive:

    Write pure functions where possible

    line 141
  29. Distinctive:

    Use early returns to reduce nesting

    line 143
  30. Distinctive:

    Write defensive code that handles edge cases gracefully

    line 146
  31. Very specific:

    ALWAYS postfix commit messages with [AI].

    line 151
  32. Common:

    ALWAYS include user prompt in the commit body in markdown code block.

    line 152
  33. Very specific:

    If the user asks you to open a GitHub PR.

    line 156
  34. Distinctive:

    ALWAYS follow the instructions in the Invariants sections above.

    line 157
  35. Very specific:

    Always prefix shell commands with rtk:

    line 166

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Instructions for contributing code to dependency-cruiser

Meant for both humans and agents.

Invariants

  • before proposing/ committing code node --run=check:full MUST 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 .mjs file extensions for new code
  • Use CommonJS with .cjs for backward compatibility when needed
  • Include explicit file extensions in imports (.mjs or .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 /src directory, organized in feature-specific subdirectories
  • Tests are in /test directory, mirroring the structure of /src
  • Test files have the same name as the file they test with a .spec.mjs extension

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/has prefixes
  • Prefer const over let
  • Use ES6+ features (arrow functions, destructuring)

Documentation

JSDoc

  • Use JSDoc for public functions, classes, and methods
  • Include @param, @returns, and @throws tags
  • Use TypeScript-style type annotations
  • Use @typedef for 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, afterEach syntax)
  • Use Node.js built-in assert/strict library for assertions (import { deepEqual, ok } from "node:assert/strict")
  • Group related tests in describe blocks
  • Use meaningful test descriptions that explain what's being tested
  • When appropriate, use beforeEach/afterEach hooks 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 false or null for expected failure conditions instead of throwing (see tryImport pattern)
  • 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 /types directory with .d.mts extensions
  • Import types from type definition files where needed
  • Use TypeScript annotations in JSDoc comments where appropriate

Dependencies and Imports

  • Import statements should be ordered:
    1. Node.js built-in modules (prefixed with node:)
    2. External dependencies
    3. Internal modules (using the # alias)
  • 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 tryImport pattern 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 disclosure PR 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 pods

Meta 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 -->

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.