Back to Browse

Wingbox MCP Server

Developer ToolsLow Risk10.0MCP RegistryLocal
Free

Server data from the Official MCP Registry

Local code graph: what a change breaks, who uses a symbol, architecture layers. No model.

About

Local code graph: what a change breaks, who uses a symbol, architecture layers. No model.

Security Report

10.0
Low Risk10.0Low Risk

Valid MCP server (1 strong, 2 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry.

5 files analyzed · 1 issue found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

HTTP Network Access

Connects to external APIs or services over the internet.

env_vars

Check that this permission is expected for this type of plugin.

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "wingbox": {
      "command": "uvx",
      "args": [
        "wingbox==0.19.2"
      ]
    }
  }
}

Some servers take additional arguments. See the repository for details.

Documentation

View on GitHub

From the project's GitHub README.

Wingbox: a map of your codebase for AI coding agents

Wingbox: the code graph of a repository drawn as the structure of an aircraft wing, with the blast radius of one change highlighted

Give your coding agent a map of your codebase. 2-4x cheaper, no missed files.

Up to 5x faster, up to 8.8x fewer tokens, up to $484 saved per 1,000 questions, no missed files.

Your agent sees every file a change touches before it edits, so it no longer forgets a fix. 2-4x cheaper per answer than its own search or another code-graph tool: benchmarks.

Wingbox builds a local code graph (a code knowledge graph made by static parsing, with no model) of your repository so that AI coding agents and developers can see dependencies, call flows, architecture boundaries and the blast radius of a change before editing code. It works as an agent skill in Claude Code, Codex, Gemini CLI, Cursor and GitHub Copilot, as an MCP server for any MCP client, and from the command line. It supports Python, TypeScript, Rust, C, C++, C#, Java, Go, Ruby, Rails, PHP, Laravel (Blade, Livewire), Dart, Flutter, Free Pascal, and Lazarus.

Runs fully locally: no network access, no model, no telemetry. It can be used inside a security perimeter and on a machine with no internet.

macOS, Linux and Windows: on Windows it runs natively, from PowerShell, cmd or Git Bash, with no WSL.

Website: wingbox.dev: benchmarks with charts, a sample report and the live map.

Install: pipx install wingbox && wingbox install | PyPI: the command, then the skill, an always-on block and a search hook for every coding assistant on the machine. Then type /wingbox in your agent.

The graph keeps itself fresh: in Claude Code a hook marks every edited file, and the next search patches only those files into the graph (about a second on a 1,200-file project); changes made by git or an editor are found too. See Keeping the graph fresh.

Skill only: npx skills add aileron-tech/wingbox | skills.sh

Release notes: Changelog · What is next: Roadmap

Note: Wingbox was formerly published as codespaces. The skill, the scripts and the generated files were renamed on 2026-11-15; see the Changelog for the old and new names.

Understand a large codebase before you change it. Wingbox is an architecture-aware code search and impact analysis tool for Python, TypeScript, TSX, Rust, C, C++, C#, Java, Go, Ruby, Ruby on Rails, PHP, Laravel, Blade, Livewire, Dart, Flutter, Free Pascal, and Lazarus repositories. It helps developers and AI coding agents find the right module, trace dependencies, measure change impact, and read only the source files that matter.

Use it for codebase architecture discovery, dependency graph search, blast-radius analysis, call-flow tracing, monorepo navigation, and safer AI-assisted coding.

Everything runs on your machine. The code graph is built by deterministic static parsing: no LLM call, no vector database, and no network access to build or query it. Wingbox does not embed your code.

INSTALL AND RUN

pipx install wingbox && wingbox install
wingbox build .

The first line installs the command and sets up your coding assistants: it lists what it adds, lets you untick items, and writes only your own settings in your home folder. The second maps the repository you are in into its .wingbox/ folder. Then ask your agent, or run wingbox impact path/to/file.

The one install brings the parsers of every supported language: there is nothing to add per language.

With Homebrew, on macOS or Linux: brew install aileron-tech/wingbox/wingbox && wingbox install (tap).

No terminal? Install with a click

  • Claude Desktop: download the extension, open the file, press Install, choose your project folder and switch it on. Wingbox builds the map the first time you ask.
  • Codex app: Settings > Plugins > Add > Add a marketplace, paste aileron-tech/wingbox as the source, then press + next to Wingbox under Personal.

Both start Wingbox with uv, which has to be on the machine.

Runs fully locally, inside your security perimeter

Wingbox is safe to run on code that must not leave the company:

  • No network. Building and querying the graph open no network connection. Run it with the network switched off to see for yourself: docker run --rm --network none -v "$PWD":/repo wingbox (PowerShell: docker run --rm --network none -v "${PWD}:/repo" wingbox). The one command that reaches the network is wingbox update, which runs your package installer (pipx, uv or pip) when you ask it to. The one build option that can is --lsp, off by default: see "never run" below. Wingbox listens on no port either. Serving the MCP server to another machine is a separate package, wingbox-http, that you install and start yourself; it only answers the requests that reach it and opens no connection of its own.
  • No model, no account, no key, no telemetry. Nothing is sent to a model or to a service, and nothing is collected about its use.
  • Your code is read, never run. Wingbox parses source files with its own parsers and calls git for the ignore rules, the state of the work tree and a diff; it does not execute the code, the tests or the build of the repository. Every git call on a repository switches off the programs that its own Git configuration can name (core.fsmonitor, hooks, filter, diff and signature programs, Git inside a submodule, a fetch of missing objects). One option is the exception: wingbox build --lsp, off by default, starts the language servers that are installed on the machine (rust-analyzer, gopls, jdtls, csharp-ls, typescript-language-server, pyright-langserver, clangd, ruby-lsp, intelephense, dart language-server), and what such a server does is its own: it can run the build of the project (Cargo build scripts and procedural macros, a Gradle or Maven import) and fetch dependencies from a package registry. Leave --lsp off for code you do not trust and where nothing may leave the machine.
  • The results stay in one folder of the repository, .wingbox/: the graph index.sexp, REPORT.md and map.html. The map is one HTML file that loads nothing from outside and opens offline.
  • Works on a machine with no internet. Fetch the package and its pinned dependencies once (pip download wingbox -d wheels), carry the folder inside, and install with pip install --no-index --find-links wheels wingbox.
  • Deterministic and open. The same code gives the same graph; the source is MIT licensed and small enough to review.

Where Wingbox writes. Nothing else on the machine is changed:

CommandWrites to
wingbox build (and the refresh after a change)the repository's .wingbox/
wingbox init (project setup)the project's .wingbox/ and .gitignore
wingbox install (your assistants)the assistants' files and ~/.wingbox/, plus Git's global excludes file with --global-gitignore

Three tests of the repository keep this true: the package imports no module that opens network connections, the map page loads no outside resource, and the write-scope test checks the project and home paths each command may change.

See it in action

Once the graph is built, an agent asks what a change breaks before it edits anything. Real output on the server of immich (commit e5d6eb7, 707 modules):

$ wingbox impact src/dtos/asset.dto.ts 2 --human
Impact of changing src/dtos/asset.dto.ts
  direct dependents   10
  within 2 hops       30

Depth 1
  src/controllers/asset-media.controller.ts   imports it
  src/controllers/asset.controller.ts         imports it
  src/controllers/shared-link.controller.ts   imports it
  src/controllers/user-admin.controller.ts    imports it
  src/dtos/asset-media.dto.ts                 imports it
  src/services/asset-media.service.ts         imports it
  src/services/asset.service.ts               imports it
  src/services/asset.service.spec.ts          imports it
  src/services/shared-link.service.ts         imports it
  src/services/user-admin.service.ts          imports it

Depth 2
  src/controllers/index.ts                                 through src/controllers/asset-media.controller.ts (or 3 other files): imports it
  src/controllers/asset-media.controller.spec.ts           through src/controllers/asset-media.controller.ts (or 1 other file): imports it
  src/controllers/asset.controller.spec.ts                 through src/controllers/asset.controller.ts (or 1 other file): imports it
  ...

Every row says why the file is listed: the import, and below depth 1 the file it is reached through. For Rust the row also names the items (uses HarEntry by name after use super::*``). The answer is 30 files in about 880 tokens, and it is exact: a TypeScript import resolver written separately from Wingbox finds the same 3,795 dependencies between the 707 modules, none extra and none missing.

--human asks for this text. Without an option the same answer is printed as S-expressions, the compact form an agent reads, and --json gives it to a script; wingbox impact a.ts b.ts 2 answers for several files in one call.

wingbox build also writes .wingbox/map.html (wingbox open shows it). Its layers view stacks the architecture in 3D; click a file and its blast radius lights up across the layers:

One DTO changes: 30 files within two hopsThe base service changes: 281 of 707 modules
The Wingbox map of the immich server in the layers view, turning slowly, with the 30 modules reached by a change to src/dtos/asset.dto.ts highlightedLayers view of the Wingbox map with src/services/base.service.ts selected: 65 direct dependents, 281 modules within two hops

Benchmarks with charts, a sample report and the live map: wingbox.dev.

What can Wingbox answer?

  • Where is authentication, billing, upload, or another feature implemented?
  • Which modules depend on this service, class, function, or type?
  • Where exactly is this function, class or constant used, line by line?
  • What could break if I change this file?
  • Which two or three files should I read before fixing a bug?
  • How does a request or data value move through the system?
  • Does this dependency cross an architecture boundary?
  • Which Rails models, services, jobs, mailers, concerns, and specs are affected?
  • Can you draw a call-flow, data-flow, or sequence diagram from the code?

Instead of searching a repository one text match at a time, Wingbox turns code into a queryable code graph of modules, entities, imports, references, call relationships, architecture layers, and infrastructure connections.

What is a code graph?

A code graph describes a codebase as facts instead of text. Modules, classes, functions and types are nodes; imports, references, data flows, calls and architecture layers are edges. Wingbox writes the graph to .wingbox/index.sexp as plain S-expression facts, so the bundled query tool and ordinary text search can both read it.

What is blast radius analysis?

The blast radius of a change is everything that depends, directly or transitively, on the code you are about to edit. Wingbox computes it from the reverse dependencies in the code graph. impact path/to/file prints the dependents by depth and the files to read first; rdeps and boundary give the same facts as a tree and as a change boundary.

$ wingbox impact scripts/lang/treesitter.py
(impact scripts/lang/treesitter.py :direct 13 :total 25
 (1 scripts/lang/csharp/parser.py
    scripts/lang/csharp/validation.py
    scripts/lang/dart/parser.py
    ...
    scripts/lang/typescript/validation.py)
 (2
  (:through scripts/lang/csharp/parser.py
   scripts/lang/csharp/__init__.py
   scripts/lang/csharp/imports.py)
  (:through scripts/lang/dart/parser.py
   scripts/lang/dart/__init__.py)
  ...)
 (read-first scripts/lang/treesitter.py scripts/lang/csharp/parser.py ...))

$ wingbox impact scripts/lang/treesitter.py --human
Impact of changing scripts/lang/treesitter.py
  direct dependents   13
  within 2 hops       25

Depth 1
  scripts/lang/csharp/parser.py           imports it
  scripts/lang/csharp/validation.py       imports it
  scripts/lang/dart/parser.py             imports it
...

Depth 2
  scripts/lang/csharp/__init__.py     through scripts/lang/csharp/parser.py: imports it
...

The default form is S-expressions, for agents: the asked file once, the rows grouped by depth and by the file they are reached through, each with the reason it is listed. --human prints the same answer as text for people and --json as one JSON object for code.

Measured: 100 questions, with and without Wingbox

One hundred "which files depend on this file" questions, drawn at random with a fixed seed in five public repositories (TypeScript, Rust, Python):

  • wingbox impact <file> 2 --all names the complete list of dependent files, with nothing outside it, in 100 of 100 questions (95 % interval 96 to 100 %). The lists hold 1 to 503 files.
  • Claude Code answers 55 of the questions with its built-in search only, and again with the wingbox command added:
SetupComplete answersTokens per answerCost per answer
With Wingbox55 of 5567,5790.110 USD
Built-in search only48 of 5598,8000.179 USD

Cost -38 % (95 % interval -49 % to -25 %), tokens -32 % (-47 % to -12 %), on claude-opus-5-5 with Wingbox 0.10.0 (2026-11-18). Tokens fall on the two Rust repositories (agent-browser -67 %, claudes-c-compiler -32 %) and are higher on the other three (chrome-devtools-mcp +13 %, immich +26 %, FastAPI +43 %).

  • Checked against every import statement of seven corpora (3,795 dependencies in the largest), the graph has no wrong dependency and one missing: an import of a vendored bundle, which Wingbox leaves out of the graph.

The reference lists come from resolvers that share no code with Wingbox. The scripts, the lists and every result file are in benchmarks/impact, with what the benchmark does not show. Dockerfile.benchmark runs the tests that need no model in a clean container and compares every result with the committed one:

docker build -f Dockerfile.benchmark -t wingbox-benchmark .
docker run --rm wingbox-benchmark

Wingbox, Graphify, CodeGraph and OntoIndex on the same tests

Graphify builds a knowledge graph of a codebase, documents and images for coding agents; CodeGraph and OntoIndex index code for agents. Wingbox is narrower: a deterministic graph of the code alone, built without a model, and exact lists of what depends on a file. The four ran on the same public repositories, questions, reference lists and scoring (Wingbox 0.10.0, the FastAPI row with Wingbox 0.9.1; Graphify 0.9.110, CodeGraph 1.6.2, OntoIndex 3.1.9; no model inside any of the tools):

TestWingboxGraphifyCodeGraphOntoIndex
Exact list of dependent files, five questions5 of 51 of 51 of 51 of 5
File dependencies of FastAPI against its 1,802 import pairs, wrong / missing0 / 019 / 17106 / 2522 / 118
Tokens a coding agent spends per answer (built-in search alone: 254,967)66,628314,516297,215362,509
Cost per answer in that test, USD (built-in search alone: 0.357)0.1210.3950.3540.402
Answer quality in that test, F1 (built-in search alone: 0.989)1.0000.9840.9840.984

Building the graph of FastAPI on a hosted runner takes Wingbox 2.2 s and Graphify 17.9 s (measured with Wingbox 0.2.0; not measured for the other two).

What the others do better: CodeGraph's answers are the shortest where it answers (1,000 tokens against 1,454 for Wingbox on the same three questions), and per its documentation it covers more languages (Swift, Kotlin, C, C++, Lua and others); per its documentation Graphify also maps documents, PDFs, images and videos. graphify affected follows calls and references as well as imports, so it answers a wider question than "who imports this file"; the report gives its figures restricted to imports too. The scripts, the reference lists, every result file and the token formula Graphify publishes are in benchmarks/graphify.

Find usages: 100 questions, three tools

"I will change exported symbol S of file X. Where is S used?" One hundred questions on five public repositories in TypeScript, Rust and Python. Every answer is checked against the language tooling (the TypeScript language service, pyright, rust-analyzer) and the use sites against a SCIP index (Wingbox 0.5.1, CodeGraph 1.6.2, Graphify 0.9.110):

ToolExact list of filesUse sites found
wingbox usages100 of 1001,660 of 1,660
codegraph callers79 of 100680 of 1,660
graphify affected --depth 176 of 100 (91 answered)604 of 1,660

CodeGraph keeps one entry per calling function and kind of use, which is why it lists fewer sites; Graphify has no command that lists the uses of a symbol, and affected is the nearest one. The questions, the reference lists and the scripts are in benchmarks/usages.

Wingbox on Theory of Code Space

Theory of Code Space (ToCS) generates Python codebases with a known architecture and scores a map of their dependencies by edge type, with its own metric. Its agents explore with a budget of 20 actions; Wingbox reads every file, with no model, which is closest to the paper's condition where a model is given every file at once. On the paper's three medium codebases:

MapDep F1IMPORTSCALLS_APIREGISTRY_WIRESDATA_FLOWS_TO
Wingbox, this version0.953150 of 15019 of 3919 of 1916 of 16
Wingbox 0.2.40.802150 of 1500 of 390 of 190 of 16

No edge outside the ground truth on these three. The CALLS_API left are calls between files that also import each other, where the ground truth counts a call of an API but not of a helper; Wingbox leaves that judgement to a model. The scripts, the maps sent to the metric, eight more generated codebases and the plan for a model that starts from the Wingbox map are in benchmarks/tocs.

Quick start for AI coding agents

Install the command and let it set up every coding assistant on the machine (see Install into your coding assistants):

pipx install wingbox
wingbox install

In the agent, /wingbox builds the graph and summarizes the report, /wingbox path/to/file shows what a change to that file breaks. Or ask a natural question:

Use the Wingbox skill before reading source.
Find where file uploads are handled, analyze that module, show its dependencies
and blast radius, then list only the boundary files needed for the change.

To install the skill alone, without the command's block and hook:

npx skills add aileron-tech/wingbox

MCP clients use wingbox mcp: see Use from an MCP client.

Install as a plugin

This repository is also a plugin marketplace for Claude Code and Codex. The plugin, in plugins/wingbox, bundles the wingbox skill and the MCP server wingbox mcp, and in Claude Code the search hook that wingbox install adds. Use either the plugin or wingbox install, not both (wingbox uninstall removes what install added).

Claude Code:

/plugin marketplace add aileron-tech/wingbox
/plugin install wingbox@aileron-tech

From a shell, in one line: claude plugin install wingbox --marketplace aileron-tech/wingbox (or claude plugin marketplace add aileron-tech/wingbox, then claude plugin install wingbox@aileron-tech). The skill is /wingbox:wingbox. The Claude Code plugin needs uv: its MCP server and hooks run uvx --from git+https://github.com/aileron-tech/wingbox@<commit> wingbox, pinned to the commit of the latest release tag, which uv fetches on first use. Claude Code starts uvx directly, with no shell, so the plugin works the same on macOS, Linux and Windows, with or without Git for Windows. The hooks run uvx --offline: they never download, and while uv is missing or has not fetched Wingbox yet they fail without blocking the search or the edit ("onFailure": "continue").

Codex:

codex plugin marketplace add aileron-tech/wingbox
codex plugin add wingbox@aileron-tech

The Codex plugin runs wingbox from your PATH, so install the command first with pipx install wingbox. Codex lists the skill as wingbox:wingbox.

The plugin folder holds a copy of SKILL.md and references/, and the version of pyproject.toml; python3 tools/sync_plugin.py refreshes them and the tests fail while they differ.

Claude Desktop

Wingbox is also a Claude Desktop extension. Download wingbox-<version>.mcpb from the assets of the latest release and install it: double-click the file, drag it into the Claude Desktop window, or choose Settings > Extensions > Advanced settings > Install Extension... and select it. In the extension settings, choose the repository Wingbox maps.

The first use builds the code graph of that repository (the .wingbox/ folder in it). A tool call waits up to 45 seconds for that first build; on a large repository it answers that the build is still running, and the next call a minute later answers from the graph. Later answers bring the graph up to date with the files you change.

The extension holds no Python packages: it is an MCP Bundle of the server type uv, which pins this release of wingbox from PyPI. The MCPB specification says the host installs Python and the dependencies with uv, so that nothing needs to be installed first; Wingbox's parsers ship as binary wheels for macOS, Windows and Linux, so no compiler is needed. If your Claude Desktop reports that it cannot start the server, install uv and restart it. The first start downloads the package from PyPI; after that the server opens no network connection. python3 tools/build_mcpb.py builds the file from a checkout.

Quick start from the command line

Install the wingbox command (Python 3.11 or newer, macOS, Linux or Windows):

pipx install wingbox

Or with Homebrew, on macOS or Linux (upgrade with brew upgrade wingbox):

brew install aileron-tech/wingbox/wingbox

Or run it without installing:

uvx wingbox --help

Build the code graph of a project, then ask what a change will break:

cd /path/to/project
wingbox init                 # optional: state the architecture of each part
wingbox build .
wingbox impact path/to/file.py
wingbox usages path/to/file.py::create_order
wingbox quick "file upload"

Several files in one call, from a script: wingbox impact a.py b.py 2 --json prints one object with the state of the graph and one answer per file.

answer = json.loads(subprocess.run(["wingbox", "impact", *files, "2", "--json"], capture_output=True, text=True).stdout)
if answer["graph"]["stale"] == 0:                      # the graph misses no changed file
    for item in answer["impact"]:                       # one per file, in the order asked
        print(item["file"], [row["file"] for row in item.get("rows", [])])

Without --json the same call prints (graph :built 2026-01-31T09:15:00Z :files 359 :stale 0) and then one (impact <file> ...) form per file; a name that matches nothing gives (error no-match <file> ...) in its place, a file of the repository that is not in the graph (error not-in-graph <file> :reason ...) (What the graph does not cover), and the other files are still answered.

Four options narrow or widen what impact answers:

  • wingbox impact <file> ... --only tests keeps the dependents that are test files: the tests to run for the change. :direct and :total count them and the form says :only tests. In a repository whose CMake files state build targets and tests, two more facts follow: (affected-targets <file> <target> ...), the targets that compile the file or one of its listed dependents, and (affected-tests <file> <test> ...), the names to give to ctest -R (targets and tests in JSON); (unread-targets <file> <target> ...) names the targets whose source list was not all read; see C and C++ dependency search.

  • wingbox impact --diff [ref] answers for every file a diff changes (ref defaults to HEAD: the changes of the working tree) and adds one (changed <file>::<name> :line N :used-by (<file> ...)) fact per changed function with the other files that use it. For a C or C++ function the files that use it through the declaration in its header are included. Lines that were only removed count for the definition that holds the line above them. A file the diff deletes and the path a renamed file had are no longer in the graph, so the files that depended on them cannot be listed: each is named by (changed-file <path> :status deleted :dependents unknown) or (changed-file <old path> :status renamed :to <new path> :dependents unknown) (changed_files in JSON), and the new path of a rename gets its answer. (impact-diff-empty <ref>) is printed only when Git reports no change below the graph root. Both options go together: wingbox impact --diff --only tests, where each changed function also names the CMake targets and tests of the files that use it; a function that no test file uses directly and N other files do use says :other-users N after its empty :used-by ().

  • wingbox impact <file> ... --summary answers in a few lines where the complete list has hundreds: the number of dependents at each depth and of each kind (made from the file or started by it, test files, entry points, which nothing else depends on, and the others), the eight folders with the most of them, twenty files to look at first, and the command that prints the complete list. It goes with --only tests, --diff, --json and --human:

    (impact-summary core/base.py :direct 39 :total 40 :depth 2
     (depths 39 1)
     (kinds :generated 1 :tests 6 :entry-points 3 :other 30)
     (folders (services 30) (tests 6) (. 2) (core 1) (jobs 1))
     (first core/table.py run_export.py run_report.py tests/test_part0.py ... :more 20)
     (full "wingbox impact core/base.py 2"))
    
  • A C or C++ source file is answered through its header, see C and C++ dependency search.

wingbox usages lists every place that uses one symbol, through re-exports and aliases, grouped by file, with the line, the column and the kind of use:

$ wingbox usages app/models.py::Invoice
(usages Invoice cls :at app/models.py:1 :uses 7 :files 2
 (app/__init__.py re-export 1:21)
 (app/billing.py import 1:17 2:24 extends 4:13 type 7:13 7:25 call 8:11))

$ wingbox usages app/models.py::Invoice --human
Usages of Invoice (class, app/models.py:1)
  7 uses in 2 files

app/__init__.py
  1:21   re-export
app/billing.py
  1:17   import
  2:24   import
  4:13   extends
  7:13   type
  7:25   type
  8:11   call

The symbol is Name, <file>::Name or <file>::Class.method; a name defined in several files lists the candidates. Kinds: import, re-export, call, type, extends (extends or implements), reference. For a method, calls whose receiver type is not in sight are listed as unresolved-call, never guessed. The answer is complete; the text of --human lists at most 200 uses unless --all, and --json prints one row per use. The build records which files use each definition, without the positions. In a repository of up to 300 files the first usages after a build reads the positions of every file and keeps them. In a larger one it reads the positions from the files that hold the name (a few seconds where the build takes a minute) and answers; it also starts one process that reads the positions of every file (about as long as a build) and keeps them, so the next calls answer at once. A file that uses the symbol under another name (an alias, a re-export) does not hold the name: such an answer lists it without a position and says :incomplete positions-pending. WINGBOX_POSITIONS_FILL=0 leaves that process out: every usages then reads the files that hold its name; =1 takes that way in a small repository too. Python, TypeScript, JavaScript, Rust, C and C++ have use positions; in other languages usages names the files that reference the symbol.

Architecture commands, with examples from immich (server)

Version 0.6.0 judges the architecture of each part of a repository by a style from a library of styles (or by the rules the project declares itself) and keeps it through the coding agent. One example of each command, run on the server folder of immich:

$ wingbox init                      # the style of each part, written to .wingbox/config.yaml
.  nestjs (NestJS)   1.00   container
  *.repository.ts 60  *.service.ts 57  *.dto.ts 53  *.controller.ts 48

$ wingbox align --human             # gaps against the style
.  nestjs: 371 of 475 files placed, 1132 of 1132 dependencies follow the rules

$ wingbox place "a client for the payment API" --human
src/repositories/  infra layer of nestjs
  because: placement: database access, client of another system

$ wingbox learn --agent             # the task for the coding agent: folders the style cannot place
Part .: closest style nestjs 1.00 (runner-up layered 1.00). Layers:

$ wingbox advice --human            # open recommendations; accept or reject them by id
f7c97b6d2342  missing-folder  src/<feature>

$ wingbox compare --human           # the parts of a monorepo side by side
.    typescript  nestjs  api domain infra service shared

$ wingbox boundaries all            # layer rules, then what each layer may do
(capability-violation src/services/shared-link.service.ts :capability db-client :layer service :allowed (infra module) :line 2 :evidence "import { PostgresError } from 'postgres';" ...)
(pattern-violation src/services/api.service.ts :pattern service-builds-http-response :line 99 ...)
(capability-summary :violations 15 :known 0 :candidates 0 :patterns 2 :checked 707)

On immich the capability rules find 15 files that do what their layer may not (database client types in DTOs and services, query-builder helpers in utils/) and 2 services that write the HTTP response themselves.

Without a layer style: wingbox cycles

The layer rules need a style, and a repository that fits none (an engine, a compiler, embedded code, a monorepo with its own folders) answers style none and "not checked". wingbox cycles reads the import graph alone and needs no style and no configuration:

(cycle 1 :files 3 shop/cart.py shop/order.py store/catalog.py)
(hub hub.py :dependents 12 :dependencies 12)
(folder-cycle shop store :forward 1 :back 1)
(folder-order (shop store) (core) (user) (.) (leaf))
(cycles-summary :cycles 1 :files-in-cycles 3 :hubs 1 :folder-cycles 1 :files 34)
  • cycle: a group of files that depend on each other through imports or includes (two files that import each other, or a longer ring), the largest first. An import the compiler erases (import type) is not counted.
  • hub: a file that at least ten files depend on and that depends on at least ten: a change of it reaches far, and it is changed often because it knows much.
  • folder-cycle: two top-level folders with dependencies in both directions, with the number of file pairs each way. The smaller number is usually the direction to remove.
  • folder-order: the top-level folders from those that depend on others to those the others depend on; folders that depend on each other stand in one group. It is the order a layer rule would have to respect.

wingbox cycles <folder> answers for the files below a folder, with its subfolders as the folders (wingbox cycles engine/src). --json prints the same facts.

Layers from the folders: wingbox init --from-folders

To have that order checked from now on, let Wingbox write it as the layers of the part:

$ wingbox init --from-folders .
Layers of . from its folders, lowest first: core, store, shop, app
  4 folders, 9 source files. A file may depend on its own layer and on the layers below it.
Imports that go upward under this order (1):
  store -> shop: 1
Written: .wingbox/config.yaml (part .: style declared, order). Reorder the entries by hand where the order is wrong.
Next: wingbox build .   then   wingbox boundaries   (the upward imports are its violations);
      wingbox align --learn   accepts the ones of today into .wingbox/baseline.sexp, so that only new ones are reported.

The argument is the part: . for the repository, or a folder (wingbox init --from-folders engine/src), which becomes a part of its own. Every folder of the part with source files is one layer; a folder stands below the folders that depend on it, and folders that depend on each other are ordered so that few imports go upward. Test files are in no layer. What is written is plain to read and to change:

parts:
  .:
    level: container
    style: declared
    order:   # lowest first: a file may depend on its own layer and on the layers below it
      - core: [core]
      - store: [store]
      - shop: [shop]
      - app: [app]

Move a folder to another entry, put two folders into one layer (- sales: [shop, app]) or reorder the entries, then build again. A layer name is one word of letters, digits, _, . and -, and a folder has one layer; the build stops, with the line, on a key it does not know, on a key or a part folder written twice and on a file it cannot read. From then on wingbox boundaries, the report, wingbox place and the pull request check treat the part like any part with a style: an import of a higher layer is a violation, and the ones accepted with wingbox align --learn are counted as known. A part that has layer rules already is kept unless --force. It needs a built graph, and works for every language of the graph, C and C++ included.

The architecture of each part: wingbox init

wingbox init [PATH] [--force] [--sexp] [--details] splits the repository into parts and judges the architecture style of each, then writes .wingbox/config.yaml and adds /.wingbox/ to the project's .gitignore (a file that already has a rule about .wingbox is left as it is):

$ wingbox init
platform/backend   declared by platform/backend/layers.mjs (22 layers, read)   container
  also declared: platform/backend/.dependency-cruiser.mjs (not read: it states no layer order)
  known exceptions: platform/backend/layers.known-upward-imports.json (112 entries)
platform/frontend  route-tree (Vercel)   1.00   container
  app/ 828  components/ 574  page.tsx 135  ui/ 70
  target: 5 of 5 folders present
  advice: 2 to move, 59 to fix
  - move platform/frontend/src/app/llm/model-pools/_parts/pool-providers.tsx from the feature layer to ui ...
crates/engine      Rust crate, no layer style   -   component

wrote .wingbox/config.yaml
next: wingbox learn settles the open points (run by a coding agent it is the agent's task, asking you when the code does not tell; in a terminal it asks you), then wingbox build

Documentation truncated — see the full README on GitHub.

Reviews

No reviews yet

Be the first to review this server!