codependix-export
Original:🇺🇸 English
Translated
Run a codependix dependency graph export or boundary check, choose between --check boundaries, --check reports, and --write, point a run at a workspace root or a configuration file, or read a Mermaid block or JSON graph it produced. Use when running codependix or npx codependix, when a run exits 0 having written nothing, when --check is refused for carrying no value, when looking for a flag that selects one graph type, when wiring codependix into a CI step, or when reading an exported Nx Neighborhood, NestJS module graph, or file-level import graph. Covers the command-line host directly, without assuming any task runner.
7installs
Sourceorganizzolini/codebase
Added on
NPX Install
npx skill4agent add organizzolini/codebase codependix-exportTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Running a codependix export
Codependix reads what each project in an Nx workspace depends on and renders it
four ways — the Nx project graph, a NestJS project's module graph, a TypeScript
project's file-level import graph, and a Python project's — then delivers each
one to whichever destinations the configuration names for that project: a JSON
file, a Markdown anchor block spliced into an existing file, or both.
The configuration decides everything
There is no flag that selects a graph type, and no per-graph-type
subcommand. Which graphs run, for which projects, and where each export
lands is entirely a function of . Looking for
, , or is looking for something that does not
exist.
codependix.config.ts--nestjs--imports--only nxThe corollary is the failure mode worth learning first:
A workspace with no configuration file resolves every graph type for every project toand produces nothing. The run succeeds, exits 0, logs that every configured export is current, and writes no files — because nothing was configured. That is correct behavior, not a bug.target: "none"
So a that wrote nothing is a configuration question, never a
debugging one. Before looking for a defect, confirm in this order:
--write- A configuration file was actually found — an absent one is legal and
silent, while a path that was named explicitly and does not exist fails loudly.
--config - The graph types you expected carry a other than
target, which is what every unset target defaults to."none" - The projects you expected match the configured globs and no
includeglob.excludedefaults to nothing, so a configuration that never names one selects no project at all — the run warns, and still exits zero.include
The skill covers all three.
codependix-configureOne --write
, and two things --check
can gate
--write--check--check| Mode | Meaning |
|---|---|
| Fails on an edge or a cycle breaking a declared rule. Reads no destination and writes nothing |
| Fails on a configured destination no longer holding what a fresh run would write |
| Writes every configured export |
The two names exist because the findings belong on opposite sides of
a pull request. A broken boundary is caused by the branch and fixed by the
branch, so it gates every branch. A stale export moves with the workspace it
describes, so gating it on a branch fails every branch that changed a project
graph rather than anything the branch did. is deliberately spelled
the same as callidescope's and codometer's, because it is the same finding.
--checkreportsCombinations:
- is legal — a boundary has no destination to be stale.
--write --check boundaries - is refused — an export cannot be stale in the run that just wrote it.
--write --check reports - A bare , or one whose value is only commas, is refused. Read as "gate nothing" it would be a gate that cannot fail. If a run is rejected with
--check, the fix is to name the set, not to drop the flag.--check needs a value - Naming neither nor
--checkis asked which was meant, as a three-item menu. No mode is ever inferred and no default write happens.--write
An agent should always name the mode explicitly. There is no flag that
suppresses the prompt, because an agent's run has no terminal to draw it on:
that run fails immediately, naming the flag it wanted. Reading that failure as
a broken tool is the mistake to avoid — it is a missing flag, and the fix is
to add or .
--check <set>--writeTwo options qualify whichever mode was picked:
| Option | Meaning |
|---|---|
| Path to a |
| Workspace root whose Nx project graph this run reads. Defaults to the working directory |
bash
codependix map --write
codependix map --check boundaries --directory . --config configuration/codependix.config.ts
codependix map --check reports --directory . --config configuration/codependix.config.tsCodependix reads the Nx project graph
This is the trait that separates it from measurement tools that walk a
directory. Nx resolves the project graph itself, from the process working
directory — no flag points at it. What names is the workspace
root every project's path is resolved against, and the directory the
configuration search starts from.
--directorySo is not a subtree to scan, and pointing it at a single project's
folder does not export that project alone. It makes every project's root
resolve underneath that folder, and the exports land in the wrong place — or
fail on a readme that is not there — while the graph itself is unaffected.
--directoryRun codependix from the workspace root, pass , and select
projects through the configuration's / globs, or through
/, rather than through the directory.
--directory .includeexclude--projects--tagsGraphing a workspace the process is not standing in
A configuration may name a file to read instead of resolving
one:
projectGraphts
{ projectGraph: "artifacts/graph.json" }It is a path, relative to the workspace root, to the JSON that
emits. That is the only way to graph a workspace
the process is not inside — a job that checked out one repository and graphs
another, or a run with no Nx workspace under it at all. The path resolves
against the same root every export path does, and a supplied graph's node roots
are workspace-relative and resolve underneath it too.
nx graph --file=graph.jsonIt is a configuration field rather than a flag: what graph a run reads is a
property of the workspace being described, and pinning it once is what a job
graphing a fixed checkout wants.
A supplied graph is trusted, not validated. Nx wrote it, so its contents
are taken as given; only a file that is not a project graph at all is refused,
by name, rather than crashing later with nothing pointing at the file. A stale
or hand-edited graph will produce a diagram that is wrong rather than one that
fails.
Two things still need real files on disk regardless, so a supplied graph does
not make a whole run workspace-free: the level boots each container,
and the level builds a real . The level reads only
the graph.
nestjsimportsts.ProgramnxFour graph types, plus the workspace
Each is keyed by name in the configuration:
| Key | What it exports | Which projects appear |
|---|---|---|
| A project's one-hop Neighborhood — what it depends on, and what depends on it | Every project the Nx graph knows, except the workspace root itself |
| A project's NestJS module import graph | Only projects tagged |
| A project's own file-level TypeScript import graph | Every project carrying its own |
| The Python equivalent, parsed from | Only projects tagged |
The whole-workspace Nx graph is configured separately, under .
It is exported once for the repository rather than once per project, has no
per-project override, and is unaffected by /. Its node set is
what / narrow — see below.
workspace.nxincludeexclude--projects--tagsParticipation is per graph type and is not one rule. A project a given
graph type does not apply to simply never appears in that type's results, which
is why configuring a graph type for every project costs nothing: a project with
no NestJS container is absent from the NestJS pass rather than failing it.
--projects
and --tags
select projects from the command line
--projects--tagsBoth take a comma-separated list, and both do two things at once:
bash
codependix map --write --projects widgets,tools/reporting
codependix map --write --tags framework:nestjs,language:pythonThey widen what gets exported. A project participates when anything
claims it — an glob, a glob, or a tag. The
flags add to what the configuration already selected rather than replacing it,
so on a workspace whose is exports
exactly what it did before. still wins over all three: a flag that
could resurrect an excluded project would make advisory.
include--projects--tags--projects widgetsinclude["**"]excludeexclude--projectsinclude--projects packages/*--projects codependix-*--tagsThey narrow what gets drawn and judged. Naming a selection also narrows the
whole-workspace graph's node set and every level judges to
the selected projects. Naming neither selects everything, which is why the
default behavior of both is unchanged.
--check boundaries⚠️ A narrowed gate sees fewer edges.is the branch gate, so a CI job that passes--check boundariesor--projectsis asking for a smaller check than a whole-workspace run, and a green result means less. Use them to narrow a local run; leave them off in CI unless narrowing is the point.--tags
includeexcludeTwo flags rather than Nx's own spelling, deliberately:
each shows up in under its own name. Do not "fix" the divergence.
--projects=tag:foo--helpWhat the run reports
Every pass is attempted regardless of whether an earlier one failed, and one
project's failure is isolated to that project — a missing README, or a NestJS
project that fails to boot its container, is collected as a failure while every
other project still runs. either fully succeeds or names exactly
which projects failed.
--writeThree findings are reported separately, and any one of them fails the run:
- Failures — projects that raised before their exports could be resolved, or whose graph could not be built to judge.
- Stale exports — under , configured exports that disagree with a freshly built graph.
--check reports - Boundary violations — under , edges and cycles breaking a declared rule. Each names its level, its scope, the rule, both endpoints, and whatever the rule says about why it exists. They go to the console and the exit code and nowhere else: a list of things currently wrong is not a document worth publishing.
--check boundaries
A project resolving to is left out of the results entirely
rather than reported as up to date, so an exit code depends only on exports
codependix was actually configured to produce. A run reporting
projects is telling you it was configured to produce nothing.
target: "none"--check0Reading an export
A Markdown destination writes a Mermaid diagram. In anchor mode the diagram is
spliced between two HTML comment markers naming the anchor:
markdown
<!-- codependix:start name="codependix-nx-projects" -->
```mermaid
graph LR
widgets["widgets"]
logger["logger"]
widgets --> logger
classDef subject fill:#7c3aed,color:#fff,stroke:#4c1d95,stroke-width:2px
class widgets subject
```
<!-- codependix:end name="codependix-nx-projects" -->The highlighted node is the project the Neighborhood is centered on.
Node identifiers are sanitized from names and paths, so read the quoted label
rather than the identifier.
subjectA JSON destination writes the graph's own shape — an Nx Neighborhood carries
, , , and ; an import graph
carries , , , and ; a NestJS
module graph adds for the global modules whose edges were
deliberately left out of the diagram.
dependenciesdependentsedgesprojectNamefileNamesedgesisolatedFileNamesprojectNameambientModuleNamesFor using a committed graph to answer a question about the codebase — what
depends on this, what a rename would touch, whether an import cycle is real —
reach for the skill.
codependix-navigateNever hand-edit inside the markers
The next replaces an anchor block wholesale. A diagram edited by hand
is a diff that silently disappears on the following run, and reviewers see a
change that reverts itself for no visible reason.
--writeRe-running is the entire fix for a stale . It
is never the fix for a failure — that is a real edge in
real code, and writing an export does not remove it. Reach for the
skill for either one, and for to
read or change the rules themselves.
--write--check reports--check boundariescodependix-triagecodependix-configure