Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Model: 2 release PR
Integration branch: `main`
Deliver and verify: a merge into `main` publishes nothing; release-please keeps the release pull request, Bruno merges it, and `release.yml` publishes after he approves the `npm` environment (`docs/release.md`); verify with `npm view @brunosouzas/stackledger version`

Implemented: the catalogue format and `stackledger validate` (`catalogue-model`), the SVG map engine and `stackledger map` (`metro-map-engine`), the read-only MCP server with the `full` and `staff` views (`mcp-server`), `stackledger build` with the static `full` and `staff` sites (`catalogue-site`), the licence report: `stackledger report`, the Reports page and `renewals.ics` of the `full` site (`licence-reports`), and Mac discovery: `stackledger discover`, `stackledger drift` with `--scaffold` and the `stackledger/<source>` annotations (`mac-discovery`), and `stackledger skills validate`, which reads and checks a set of agent skills, playbooks, agents and rules (`skills-source`, code in `src/skills/`), skipping what a `.stackledgerignore` file at the top of a given folder lists (`skills-ignore`, `src/skills/ignore.ts`), and `stackledger skills map`, which writes Markdown pages with Mermaid diagrams of the set's declared relations into a folder it owns, with `--check` for pipelines (`skills-mermaid`, `src/skills/graph.ts`, `mermaid.ts`, `map-command.ts`), and the Skills section of `stackledger build` with `--skills` and `spec.skills.folders`: the skills map file `stackledger-skills.yaml` (`src/skills/lines.ts`), the skills metro map with playbook zones (`src/skills/metro.ts`), the relation diagram (`src/map/relations.ts`), the page data (`src/site/skills-data.ts`, `skills-build.ts`) and the Astro pages under `site/src/pages/{skills,skill-map,rules,playbooks,agents}/` (`skills-site`), and reading Claude Code plugin marketplaces: a given folder with `.claude-plugin/marketplace.json` is read through its plugins, items are named `plugin:name`, plain names resolve by plugin first, remote plugins are skipped with a warning (`skills-marketplaces`, `src/skills/marketplace.ts`, `resolve.ts`, `examples/northwind-marketplace/`), and station labels that wrap instead of being cut, with the rule count on skills stations (`station-labels-and-rules`, `src/map/labels.ts`, `layout.ts`), and the home page at `/` with the map at `/map/`, the default title `stackledger` and `spec.site.home` (`site-home`, `site/src/pages/index.astro`, `src/site/relative.ts` for the home links' exemption), and the city backdrop of the software map: `spec.map.backdrop` and `stackledger map --backdrop`, `neutral` or `london`, its OpenStreetMap credit in the SVG and under the site's map frame (`map-backgrounds`, `src/map/backdrops/` generated by `scripts/backdrops/`, `src/map/svg.ts`, colours from the design system's `backdrop` tokens in `src/map/themes.ts`). The publishable npm package, owner-approved release workflow, catalogue repository pipeline template and protected hosting recipes (`catalogue-deployment`) are implemented. Released on npm: 0.1.0 to 0.4.0 as `stackledger` (deprecated), 0.4.1 as `@brunosouzas/stackledger` (the same code under the npm organisation's scope; the command stays `stackledger`), 0.5.0, with the identity of `@brunosouzas/design-system`, since renamed `@brunosouzas/signwright` (`design-system-identity`, `home-banner`, `design-system-pieces`, `round-bends`), 0.5.1, with maps never shown larger than drawn (`map-scale`) and the design system 0.4.0, 0.6.0, with the city backdrop of the software map (`map-backgrounds`) and the design system 0.5.3, and 0.7.0, with the script of interpreter jobs (`launchd-script`) and the helpers apps declare (`app-helpers`), and 0.8.0, with the identity v2 on design system 0.8.1 (`identity-v2`).; the fictitious demo is rebuilt by hand following `docs/demo.md`. Where the identity v2 lives: Source fonts through Astro's Fonts API with the local provider (`src/site/build.ts`), its build-time font server bound to loopback (`src/site/loopback.ts`), the font CSS moved into `_astro/fonts.css` before the scan (`moveFontCss` in `src/site/relative.ts`), stackledger's accent, the outline frame, the map's `color.state.*` colours and quoted `font.sans` stack (`src/map/themes.ts`, `src/map/xml.ts`), the wordmark, the footer endorsement and the redrawn art (`scripts/site-art.mjs`). The rest of the roadmap is not implemented: say so instead of describing files that do not exist.
Implemented: the catalogue format and `stackledger validate` (`catalogue-model`), the SVG map engine and `stackledger map` (`metro-map-engine`), the read-only MCP server with the `full` and `staff` views (`mcp-server`), `stackledger build` with the static `full` and `staff` sites (`catalogue-site`), the licence report: `stackledger report`, the Reports page and `renewals.ics` of the `full` site (`licence-reports`), and Mac discovery: `stackledger discover`, `stackledger drift` with `--scaffold` and the `stackledger/<source>` annotations (`mac-discovery`), and `stackledger skills validate`, which reads and checks a set of agent skills, playbooks, agents and rules (`skills-source`, code in `src/skills/`), skipping what a `.stackledgerignore` file at the top of a given folder lists (`skills-ignore`, `src/skills/ignore.ts`), and `stackledger skills map`, which writes Markdown pages with Mermaid diagrams of the set's declared relations into a folder it owns, with `--check` for pipelines (`skills-mermaid`, `src/skills/graph.ts`, `mermaid.ts`, `map-command.ts`), and the Skills section of `stackledger build` with `--skills` and `spec.skills.folders`: the skills map file `stackledger-skills.yaml` (`src/skills/lines.ts`), the skills metro map (`src/skills/metro.ts`), the relation diagram (`src/map/relations.ts`), the page data (`src/site/skills-data.ts`, `skills-build.ts`) and the Astro pages under `site/src/pages/{skills,skill-map,rules,playbooks,agents}/` (`skills-site`), and reading Claude Code plugin marketplaces: a given folder with `.claude-plugin/marketplace.json` is read through its plugins, items are named `plugin:name`, plain names resolve by plugin first, remote plugins are skipped with a warning (`skills-marketplaces`, `src/skills/marketplace.ts`, `resolve.ts`, `examples/northwind-marketplace/`), and journeys as the lines of the skills map with marketplaces (or `loose`, or playbooks) as zones, qualified stops, and the skills map file named by `spec.skills.map` or `skills validate --map` (`skill-journeys`, `src/skills/lines.ts` zones, `metro.ts`, `examples/northwind-journeys/`), and station labels that wrap instead of being cut, with the rule count on skills stations (`station-labels-and-rules`, `src/map/labels.ts`, `layout.ts`), and the home page at `/` with the map at `/map/`, the default title `stackledger` and `spec.site.home` (`site-home`, `site/src/pages/index.astro`, `src/site/relative.ts` for the home links' exemption), and the city backdrop of the software map: `spec.map.backdrop` and `stackledger map --backdrop`, `neutral` or `london`, its OpenStreetMap credit in the SVG and under the site's map frame (`map-backgrounds`, `src/map/backdrops/` generated by `scripts/backdrops/`, `src/map/svg.ts`, colours from the design system's `backdrop` tokens in `src/map/themes.ts`). The publishable npm package, owner-approved release workflow, catalogue repository pipeline template and protected hosting recipes (`catalogue-deployment`) are implemented. Released on npm: 0.1.0 to 0.4.0 as `stackledger` (deprecated), 0.4.1 as `@brunosouzas/stackledger` (the same code under the npm organisation's scope; the command stays `stackledger`), 0.5.0, with the identity of `@brunosouzas/design-system`, since renamed `@brunosouzas/signwright` (`design-system-identity`, `home-banner`, `design-system-pieces`, `round-bends`), 0.5.1, with maps never shown larger than drawn (`map-scale`) and the design system 0.4.0, 0.6.0, with the city backdrop of the software map (`map-backgrounds`) and the design system 0.5.3, and 0.7.0, with the script of interpreter jobs (`launchd-script`) and the helpers apps declare (`app-helpers`), and 0.8.0, with the identity v2 on design system 0.8.1 (`identity-v2`).; the fictitious demo is rebuilt by hand following `docs/demo.md`. Where the identity v2 lives: Source fonts through Astro's Fonts API with the local provider (`src/site/build.ts`), its build-time font server bound to loopback (`src/site/loopback.ts`), the font CSS moved into `_astro/fonts.css` before the scan (`moveFontCss` in `src/site/relative.ts`), stackledger's accent, the outline frame, the map's `color.state.*` colours and quoted `font.sans` stack (`src/map/themes.ts`, `src/map/xml.ts`), the wordmark, the footer endorsement and the redrawn art (`scripts/site-art.mjs`). The rest of the roadmap is not implemented: say so instead of describing files that do not exist.

Layout: `src/` the CLI and its modules (`src/map/` map engine and diagrams, `src/site/` site data, build, publication, `src/discovery/` the Mac sources, sandboxed runner and snapshot); `site/` the Astro project shipped in the package and copied into the build's staging folder; `test/unit`, `test/integration` (vitest) and `test/browser` (Playwright); `examples/northwind/` the fictitious example catalogue and `examples/northwind-machine/` its fictitious Mac snapshot, `examples/northwind-skills/` a fictitious skill set with a skills map file and `examples/northwind-marketplace/` a fictitious plugin marketplace.
Layout: `src/` the CLI and its modules (`src/map/` map engine and diagrams, `src/site/` site data, build, publication, `src/discovery/` the Mac sources, sandboxed runner and snapshot); `site/` the Astro project shipped in the package and copied into the build's staging folder; `test/unit`, `test/integration` (vitest) and `test/browser` (Playwright); `examples/northwind/` the fictitious example catalogue and `examples/northwind-machine/` its fictitious Mac snapshot, `examples/northwind-skills/` a fictitious skill set with a skills map file and `examples/northwind-journeys/` a fictitious setup of three marketplaces, a loose skill and a catalogue with journeys, `examples/northwind-marketplace/` a fictitious plugin marketplace.

- Build: `npm run build`
- Test: `npm test` (vitest; build first for CLI integration tests)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ What it does:
- **Drift on a Mac.** What is installed but not declared, and what is declared but missing.
- **Two views.** A `full` view for owners and finance, and a `staff` view without costs or renewal dates.
- **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 zones are your playbooks.
- **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

Expand All @@ -62,7 +62,7 @@ The diagram as Mermaid, and the personal and corporate modes: [docs/how-it-works
4. **The website is static.** No server, no database, nothing to patch. Why: [ADR 5](docs/adr/0005-static-site-no-server.md).
5. **It is written in TypeScript**, so the same map engine runs at build time and in the browser. Why: [ADR 9](docs/adr/0009-typescript-end-to-end.md).
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](docs/adr/0010-agent-skills-are-a-second-ledger-read-from-their-folders.md).
7. **Skills from plugin marketplaces; journeys and several maps are planned.** A Claude Code plugin marketplace is read as one set, items named `plugin:skill` ([ADR 11](docs/adr/0011-skills-are-read-from-plugin-marketplaces.md)); skills map lines that are journeys are planned, and [ADR 12](docs/adr/0012-several-named-maps-and-stations-of-any-kind.md) adds several named maps. Those are not built; see the [roadmap](docs/roadmap.md#v21-one-site-marketplaces-journeys-and-named-maps).
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](docs/adr/0011-skills-are-read-from-plugin-marketplaces.md)); projects that declare journeys are planned, and [ADR 12](docs/adr/0012-several-named-maps-and-stations-of-any-kind.md) adds several named maps. Those are not built; see the [roadmap](docs/roadmap.md#v21-one-site-marketplaces-journeys-and-named-maps).
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`](https://www.npmjs.com/package/@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](docs/map.md#routes-and-themes) and [the site](docs/site.md).

The context, the main flows and the module map are in [the architecture](docs/architecture.md).
Expand Down Expand Up @@ -126,7 +126,7 @@ cd /path/to/skills && node /path/to/stackledger/dist/cli.js skills map . --out d
| `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](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](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](docs/discovery.md) | Available (npm 0.8.0, source) |
| `stackledger skills validate [folder...] [--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. Exit 0: no errors (warnings allowed); 1: errors; 2: usage or folder problem. See [docs/skills.md](docs/skills.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](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](docs/skills.md#map-in-the-repository) | 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.
Expand Down Expand Up @@ -178,7 +178,7 @@ npx @brunosouzas/stackledger build ./catalogue --out ./public --skills ~/.claude

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` at the top of a skills folder: `Line` and `MapLayout` documents, as in the catalogue, with stops such as `skill:writer`, `playbook:release` and `agent:reviewer`. Playbooks can be zones; a skill in two playbooks sits in both zones, so place the shared skills between the playbooks and the zones overlap there cleanly. The format, the CI recipe and what each page shows: [docs/skills.md](docs/skills.md#skills-on-the-site).
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/`](examples/northwind-journeys/). The format, the CI recipe and what each page shows: [docs/skills.md](docs/skills.md#skills-on-the-site).

## Catalogue format

Expand Down
Loading
Loading