Skip to content

About

Govern your software stack and licences from a Git catalogue (Backstage format), drawn as a metro map.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

162 Commits

Folders and files

Repository files navigation

stackledger

Govern your software stack and licences, drawn as a metro map.

by Bruno Souza

OpenSpec License: Apache-2.0

stackledger is a small, local-first tool for people and small companies who want to know what software they run, who owns it, which licences they pay for and when those renew. You describe your software in YAML files kept in Git, in the Backstage format. stackledger checks them and turns them into a static website you host behind your own sign-in. On a Mac it can also record what is installed and compare it with the catalogue, without changing either: you or your agent then update the catalogue through a reviewed pull request.

A fictitious company's software as a metro map

Generated by stackledger map from the fictitious Northwind catalogue, dated 2027-06-01.

Contents

Status

Early development; the latest release on npm is @brunosouzas/stackledger 0.11.0. The catalogue format, the validate, map, build and report commands, the mcp server, Mac discovery (stackledger discover and stackledger drift), the agent skills check and map (stackledger skills validate and stackledger skills map) and the Skills section of the site (stackledger build --skills) work from npm or from source (see Usage). The order of the rest is in the roadmap.

For a separate catalogue repository, copy the pipeline template. Set up protected hosting before the first deploy. The fictitious Northwind catalogue and its skill set run as a demo of the corporate mode, Software and Skills, at https://stackledger-demo.pages.dev/; it is protected by Cloudflare Access and only the owner can sign in, so for you it shows the sign-in page, which is the point. The release guide covers npm publication, provenance and the SBOM.

Features

What it does:

  • A metro map of your software. Each line is a journey, such as "ship a feature" or "send an invoice", and each station is a piece of software. Interchanges are the tools several journeys depend on. Stations stay where you put them, so the map does not reshuffle when the catalogue changes.
  • A software list with one page per item. Owner, lifecycle, licence, the journeys it serves, a diagram of what it depends on and what depends on it, and what breaks if you remove it.
  • Licence reports. Renewals, cost per month and year for each currency by owner, payer and zone, and items nobody owns, with a calendar file of renewal dates.
  • Drift on a Mac. What is installed but not declared, and what is declared but missing.
  • One private site. Everything in the catalogue on one site behind sign-in, for the people who may see all of it, costs and renewal dates included. (The staff view that hid them is deprecated.)
  • An MCP server, so your AI agent can query and check the catalogue.
  • Your agent skills on the same site. Skills, playbooks and agents with their declared relations, rules and a skills metro map whose lines are your journeys (kinds of work) and whose zones are your plugin marketplaces.

How it works

How stackledger works: the catalogue in a private Git repository, GitHub Actions validates and builds it with stackledger from npm, and publishes the static site to Cloudflare Pages behind Cloudflare Access; discovery stays on your Mac

The diagram as Mermaid, and the one private site: docs/how-it-works.md.

  1. The catalogue lives in its own repository, private when it holds real data. stackledger never holds your data. A company that already uses Backstage can point it at the same files. Why: ADR 2.
  2. Lines are journeys, not categories. A journey has an order; a category does not. Categories become zones. Why: ADR 3.
  3. The map engine is our own, and station positions are data. Existing engines reshuffled the whole map after a small change. Why: ADR 4.
  4. The website is static. No server, no database, nothing to patch. Why: ADR 5.
  5. It is written in TypeScript, so the same map engine runs at build time and in the browser. Why: ADR 9.
  6. Agent skills are a second ledger in the same tool. The skills, agents, playbooks and rules your AI agents use are read from their own folders, never copied into YAML. stackledger skills validate checks them, stackledger skills map draws them in the skills repository, and since 0.3.0 the site has a Skills section next to Software; linking each skill to the software it needs is planned. Why: ADR 10.
  7. Skills from plugin marketplaces; the skills map shows journeys. A Claude Code plugin marketplace is read as one set, items named plugin:skill, and the skills map draws journeys as lines and marketplaces as zones (ADR 11); projects that declare journeys are planned, and ADR 12 adds several named maps. Those are not built; see the roadmap.
  8. It looks like brunosouzas.com, with an identity of its own. The map, the diagrams, the favicon and the site's colours come from @brunosouzas/signwright, a dependency of the published package; stackledger keeps the layout and writes every piece through its own SVG writer. On top of the family it has its own accent (a blue), its wordmark (the site title in Source Serif 4 italic), its mark (a blue s with the parent's moon, the brunosouzas family mark) and the parent brand's endorsement in the footer. The fonts are the site's: Source Sans 3, Source Serif 4 and Source Code Pro, shipped in the package and delivered by Astro's Fonts API, so no font is fetched from another site. See the map and the site.

The context, the main flows and the module map are in the architecture.

How it works, end to end draws the publication path (a push to main of the private catalogue repository, GitHub Actions, Cloudflare Pages behind Cloudflare Access) and explains the one private site.

Security

A software catalogue maps its owner's attack surface: which VPN, which secret store, which versions. stackledger is designed around that:

  • No sign-in code in the tool. The site sits behind an identity-aware proxy that uses your existing accounts (Google Workspace, Microsoft 365). ADR 6
  • One private site. The site shows everything, licences and costs included, so it is served only behind sign-in, with one access rule on the whole address for the people who may see it all (ADR 13, which supersedes ADR 7). The staff view, which hid the costs, stays in the code but is deprecated: nothing builds or serves it. Older /full/... addresses redirect to the root.
  • No secrets in the catalogue. validate rejects fields named like secrets, private keys and card numbers, and never repeats the value in its message.
  • Nothing leaves your machine. No telemetry, no analytics, no third-party scripts; discovery only reads and never uses sudo.
  • Read access to the catalogue repository equals the site. Everyone who may open the site sees all of the catalogue.

To report a vulnerability, see SECURITY.md.

Using it with AI agents

stackledger does not call any AI model. Instead, a read-only MCP server lets the agent you already use (Claude Code, Codex, Hermes or any MCP client) ask questions such as "what depends on this app?", "what breaks if I remove it?" or "what renews this month?", and validate the YAML it writes. With --view staff it serves only what the staff view shows, and offers no renewals or validation. Why: ADR 8.

  • docs/mcp.md: the tools, the views, and configuration for Claude Code, Codex and Hermes.
  • skills/stackledger/SKILL.md: an agent skill for maintaining a catalogue (add an item, link a licence, add a line, place a station, run validate).

Usage

Use npm with Node.js 22.12 or later. The package is @brunosouzas/stackledger from 0.4.1, the same code as 0.4.0; versions up to 0.4.0 were published as stackledger, now deprecated, and the command is stackledger in both. Version 0.8.0 moves the maps, the diagrams and the site to the identity v2 of @brunosouzas/design-system 0.8.1: Source Sans 3, Source Serif 4 and Source Code Pro through Astro's Fonts API (each site gains _astro/fonts.css; the security policy does not change), stackledger's own accent, the outline frame without shadow, the wordmark, the parent brand's endorsement and a new home banner; the catalogue format and the commands do not change. 0.7.0 makes discovery show what a launchd job runs (the script of an interpreter job) and the helpers apps declare in their bundles (login items, agents and daemons); a snapshot it writes is not read by drift 0.6.0. 0.6.0 adds the city backdrop of the software map (spec.map.backdrop, stackledger map --backdrop); 0.5.1 never shows a map larger than it is drawn; 0.5.0 draws the maps, the diagrams and the site with @brunosouzas/design-system (home banner, link icons, round bends); 0.4.0 added the home page (the map moves to /map/, the default title becomes stackledger, spec.site.home), whole station names on both maps and rule counts on the skills map, and skips hidden folders in a catalogue; 0.3.0 added the Skills section of stackledger build (--skills, spec.skills.folders, stackledger-skills.yaml); 0.2.0 added the agent skills commands (skills validate, .stackledgerignore, skills map); 0.1.0 has the catalogue commands only.

npx @brunosouzas/stackledger@0.11.0 --help
npx @brunosouzas/stackledger@0.11.0 validate /path/to/catalogue

To run it from source (for development, or a change not yet on npm):

npm ci
npm run build
node dist/cli.js validate /path/to/catalogue
node dist/cli.js validate /path/to/catalogue --json
node dist/cli.js mcp /path/to/catalogue
node dist/cli.js map examples/northwind --date 2027-06-01 > map.svg
node dist/cli.js build examples/northwind --out ./public --date 2027-06-01
node dist/cli.js build examples/northwind --out ./public --date 2027-06-01 --skills examples/northwind-skills
node dist/cli.js report examples/northwind --date 2027-06-01 --format csv > licences.csv
node dist/cli.js discover
node dist/cli.js drift examples/northwind --snapshot examples/northwind-machine/snapshot.json
node dist/cli.js skills validate /path/to/skills
cd /path/to/skills && node /path/to/stackledger/dist/cli.js skills map . --out docs/skills-map
Command Does Status
stackledger validate [folder] Checks a catalogue and reports each problem with file, line and field. Exit 0: no errors (warnings allowed); 1: catalogue errors; 2: usage or folder problem Available (npm 0.8.0, source)
stackledger mcp <folder> [--view full|staff] Serves the catalogue read-only to AI agents over MCP on stdio; see docs/mcp.md. Exit 2: usage or folder problem Available (npm 0.8.0, source)
stackledger map <folder> [--view full|staff] [--theme light|dark] [--backdrop neutral|london] [--date YYYY-MM-DD] Draws a self-contained SVG on stdout; diagnostics and suggestions on stderr. Exit 0 even with catalogue errors; 2 for usage/folder problems. See docs/map.md Available (npm 0.8.0, source)
stackledger build <folder> --out <dir> [--date YYYY-MM-DD] [--skills <folder>]... Builds one static site at the root of <dir>, with renewals.ics, _headers, robots.txt and _redirects (which sends the old /full/... addresses to the root), replacing an earlier build atomically; with a skill set, the site gets the Skills section (Skills on the site); report on stderr. Exit 0 even with catalogue or skill-set errors; 1: internal failure, a broken Settings that sets spec.skills, a skills folder with nothing in it or two items with one page name (the earlier build is left as it was); 2: usage or folder problem. See docs/site.md Available (npm 0.8.0, source)
stackledger report <folder> [--date YYYY-MM-DD] [--days N] [--format text|json|csv|ics] Prints the licence report of the full view on stdout: renewals in the next --days (default 90), recurring cost per currency by owner, payer and zone, one-off and planned costs, incomplete licences; or the renewal calendar. Exit 0 even with catalogue errors; 1: the report could not be computed or written; 2: usage or folder problem. See docs/reports.md Available (npm 0.8.0, source)
stackledger discover Reads what this Mac has installed (Homebrew, App Store, applications, launchd and the helpers apps declare, mise, npm, pipx), with every program in the macOS sandbox, and writes ~/.stackledger/<machine>/snapshot.json; one summary line per source on stdout. Exit 0 also with skipped sources; 1: not macOS, no sandbox or the file could not be written safely; 2: usage problem. See docs/discovery.md Available (npm 0.8.0, source)
stackledger drift <folder> [--snapshot <file>] [--format text|json] [--scaffold <dir>] Compares the snapshot with the catalogue through stackledger/<source> annotations: what is not declared (with the annotation to add), what is missing, what could not be checked, and dependsOn relations to confirm; --scaffold writes draft component files into a new folder outside the catalogue. Exit 0 even with catalogue errors; 1: internal or write failure; 2: usage, folder or snapshot problem. See docs/discovery.md Available (npm 0.8.0, source)
stackledger skills validate [folder...] [--map <file>] [--json] Checks agent skills, playbooks, agents and rules read from the given folders (default: the current folder) as one set, and reports each problem with file, line and field. --map also checks a skills map file kept in the catalogue. Exit 0: no errors (warnings allowed); 1: errors; 2: usage or folder problem. See docs/skills.md Available (npm 0.8.0; --map in source until the next release)
stackledger skills map [folder...] --out <folder> [--check] Writes Markdown pages with Mermaid diagrams of the set's declared relations into <folder>: an index and one page per skill, playbook and agent, byte for byte the same on every machine; --check writes nothing and lists what is out of date. Exit 0: written (also with errors in the set) or up to date; 1: out of date with --check, nothing found in a given folder, the folder changed during the run or a write failed; 2: usage or folder problem. See docs/skills.md Available (npm 0.8.0, source)

validate, mcp, map, report, drift and skills validate only read files (drift --scaffold writes only inside the new folder it names); build and skills map write only inside their output folder; discover writes only its snapshot file. None of them makes network calls or sends telemetry, and none edits the catalogue. The text output and error messages of validate, report, discover, drift and skills validate carry no control characters from file names, options, catalogue or snapshot text, and their JSON output writes U+007F to U+009F as \u escapes; build and mcp keep their own rules, described in their documents.

The website

stackledger build makes one static site from one catalogue, with every field: costs, renewal dates, payers, seats, password-manager references and notes. It has a Software division (the map at /map/, list, journeys and reports) and, when given a skill set, a Skills division. The site title (stackledger unless spec.site.title sets one) opens a home page at / with a card per division and, if you list them in spec.site.home.links, your own links. Serve it only behind sign-in, for people who may see all of it, publishing every file of the output folder except its .stackledger-build marker; spec.map.backdrop: london (from 0.6.0) draws the software map over central London from OpenStreetMap data, with the credit in the map and under it on the map page (the map). docs/site.md explains the pages, the hosting and the security rules. Screenshots from the fictitious Northwind catalogue, dated 2027-06-01:

Home page with the banner, the Software and Skills cards and the configured links Map page with the metro map, line buttons and map symbols
Home: the site title opens it; counts, links to each division and your own links from spec.site.home Map (/map/): zoom, pan, zone filter; the line buttons highlight a journey
The same map page in the dark theme
Dark theme, remembered across pages
Software list with search and filters Component page for GitHub with its licence and neighbourhood diagram
Software: every component and licence, with search and filters Component: licence, journeys, what it depends on and what depends on it, removal impact
Licence page with cost and renewal
Licence: cost, renewal, payer and seats
Journeys list with each line's badge and stop count Journey page with its stops on a strip and the interchanges
Journeys Journey: stops in order, with the other lines at each interchange
Reports page with the recurring cost per currency and the renewals
Reports: renewals, cost per month and year per currency and group, and the calendar file

Skills on the site

Give stackledger build a skill set and the site gets a Skills division next to Software: a list of every skill, playbook and agent, a skills metro map, one page per item with a diagram of its declared relations, and an index of every rule.

There are two ways to say where the skills are, and the option always wins:

  • --skills <folder>, repeatable: --skills ../kit --skills ~/.claude/skills. Paths are taken as you type them, from the current folder. When the command has at least one --skills, the setting below is ignored completely, not even checked.
  • spec.skills.folders in the catalogue's Settings (in stackledger.yaml), used when there is no --skills. Each path is relative to the catalogue folder, not to where you run the command, so the same catalogue works on a laptop and in a pipeline. Absolute paths, ~ and drive letters are refused: they would tie the catalogue to one machine. .. is fine.
apiVersion: stackledger/v1alpha1
kind: Settings
metadata:
  name: settings
spec:
  skills:
    folders: [../ai-kit]

On a laptop, with the catalogue and the skills repository side by side:

npx @brunosouzas/stackledger build ./catalogue --out ./public              # reads ./ai-kit, from spec.skills.folders
npx @brunosouzas/stackledger build ./catalogue --out ./public --skills ~/.claude/skills   # this folder instead

In a pipeline, check out the skills repository next to the catalogue (so ../ai-kit exists), or pass --skills with the path the checkout used. Pin one stackledger version everywhere, 0.3.0 or later: 0.2.0 reads spec.skills as an error. If the Settings has an error and sets spec.skills, the build stops with exit 1 and changes nothing published, rather than publish a site without its Skills section; fix it, or pass --skills.

The skills map is drawn from stackledger-skills.yaml: Line and MapLayout documents, as in the catalogue. A line is a journey, a kind of work you write by hand ("ship a change"), with stops such as skill:writing:draft or agent:reviewer; a zone is a marketplace (or loose, for skills from none, or still a playbook). A skill that two journeys share is an interchange. Keep the file in the catalogue and name it in the Settings, spec.skills.map: stackledger-skills.yaml, or put it at the top of a skills folder, as before; see examples/northwind-journeys/. The format, the CI recipe and what each page shows: docs/skills.md.

Catalogue format

A catalogue is a folder of YAML files: Backstage Component documents for software, Resource documents with spec.type: licence for licences, plus Line journeys, one MapLayout with station positions and zones, and an optional Settings document for the site's title, home page, colours and map. The format reference describes every field, how references work, which problems are warnings, and how to share the folder with a Backstage instance. Keep real data in its own private repository; this example is fictitious. Save it as catalogue.yaml in an empty folder and run validate on that folder:

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: editor
spec:
  type: tool
  lifecycle: active
  owner: user:alex
  dependsOn: [resource:licence-editor]
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: forge
spec:
  type: service
  lifecycle: active
  owner: group:delivery
---
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
  name: licence-editor
spec:
  type: licence
  owner: user:alex
  licence:
    vendor: Northwind Studio
    status: active
    cycle: yearly
    cost: 120
    currency: GBP
    renewsOn: 2027-06-30
    vaultItem: Northwind Editor subscription
---
apiVersion: stackledger/v1alpha1
kind: Line
metadata:
  name: ship
spec:
  color: '#4466FF'
  stops: [component:editor, component:forge]
---
apiVersion: stackledger/v1alpha1
kind: MapLayout
metadata:
  name: northwind
spec:
  stations:
    component:editor: [0, 0]
    component:forge: [2, 0]

Agent skills

stackledger skills validate checks agent skills (folders with a SKILL.md, in the Agent Skills format), playbooks, agents (agents/*.md, the Claude Code subagent format) and rules.md files as one set: duplicate names, a playbook naming a skill that does not exist, a rule ID defined twice, departures from the specification, and private keys or card numbers. Relations are declared inside the specification's metadata field, so SKILL.md stays valid for every tool:

metadata:
  stackledger-kind: playbook
  stackledger-skills: writer editor
  stackledger-agents: reviewer

stackledger-kind is skill (the default) or playbook; the other two keys hold names separated by spaces. Give the folders one agent loads together, and check each tool folder on its own. A .stackledgerignore file at the top of a given folder skips templates, examples and test fixtures with .gitignore patterns, and the output counts and lists what it skipped. stackledger skills map writes the set's declared relations as Markdown pages with Mermaid diagrams into the repository, for offline reading and pull-request diffs, and --check fails a pipeline when they are out of date. The format, every check, the map and a CI example: docs/skills.md. With --skills or spec.skills.folders, stackledger build also publishes the set on the site (Skills on the site).

Pointed at a Claude Code plugin marketplace root (a folder with .claude-plugin/marketplace.json), it reads every local plugin's skills and agents as one set, with items named plugin:name; remote plugins are skipped with a warning and nothing is fetched. See Plugin marketplaces and examples/northwind-marketplace/.

How this project is built

stackledger follows spec-driven development:

Contributing

Issues and pull requests are welcome. For a change in behaviour, open an issue first so we can agree on the scenario before the code. Use only fictitious data in issues, examples and tests: never paste a real catalogue. Agents working in this repository start from AGENTS.md.

License

Apache-2.0 © 2026 Bruno Souza

The london map backdrop bundles map data © OpenStreetMap contributors, available under the Open Database License (ODbL) (dist/map/backdrops/london.js, made from scripts/backdrops/london-extract.json). The share-alike terms of the ODbL apply to that data only, not to the rest of stackledger.

About

Govern your software stack and licences from a Git catalogue (Backstage format), drawn as a metro map.

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages