magus v0.4.3 is out. See what's new
¶ View generated markdown
6 min read

magus-upstream-docs

Short form: 2923 bytes, 43% smaller than the full form's 5144.

Traverse magus's own documentation to answer a "how does magus do X / what does Y mean / where is Z documented" question, instead of guessing an answer or a URL. Use when you need authoritative magus behavior (a CLI flag, a spell op, a diagnostic code, a config key, a stdlib module) and the workspace graph cannot give it, or when the docs and your magus binary disagree. Do NOT use for facts about THIS workspace (use magus-query) or to run work (use magus-run).

Install it, rather than copying from this page:

magus agent install .claude/skills   # writes both forms below

An installed copy carries a provenance stamp, so magus doctor can tell you when a magus upgrade has made it stale. Text copied from this page carries none.

What an installed copy carries

magus agent install writes this frontmatter above the body. magus doctor reads it to report whether your installed skills are current.

field value
license GPL-3.0-or-later
compatibility any-agent
source magus
agent-skill-version 147
knowledge-schema-version 24
skill-content 15bfde926cf3
skill-variant full

The skill-content digest covers this skill alone, and both forms below report it: they go stale together, never one silently, and a change to another skill does not move it.

The two forms

Both are hand-authored from one source body. The short form is the always-loaded primary - the enumeration dropped, the judgment kept, for the most capable readers rather than the least. The full form is its <name>-full twin, loaded by name when a reader wants the rationale. The bar above shows how much shorter the primary is; switch between them here to see exactly what it gave up. See Skills for how to choose.

magus agent install --tar | tar -xO -f - magus-upstream-docs/SKILL.md
# magus docs

One official docs site.
Use for magus-domain fact workspace graph cannot give: docs are source of truth for magus behavior.
Docs lookup whose answer is all you need -> `magus-scout` agent, where harness installed one; otherwise worker on host's cheapest model.

Two places serve same pages:
- magus repo (`magusfile.buzz` at root, `docs/` tree): query section (next), or read `docs/<name>.md` when you know page.
- Published: `https://eli.gladman.cc/magus/`; every page also raw Markdown at `<page-url>index.md`.

## In workspace: ask graph for passage

Every Markdown heading is `docsection` node -> "where is this explained" is query, not scan:

```sh
magus query kind=docsection "cache key"
```

Result id: `<path>#<anchor>`. Each result: read that section, not whole file.
Index route below: PUBLISHED site only, which has no graph.

## Fast path: index, do not guess URLs

Two files at docs root:
- `llms.txt`: one titled link per page to raw Markdown (`<url>index.md`), one-line description. Read FIRST, then fetch page's `index.md`.
- `search-index.json`: array of `{url, title, text, tags, description}`, one record per page. Search when you do not know page name.

## URL scheme

Extensionless directory URLs; append `index.md` for raw source.
- `go` spell: `/spells/go/` -> `/spells/go/index.md`
- `magus run` command: `/manpage/magus-run/` -> `/manpage/magus-run/index.md`
- diagnostic MGS2001: `/codes/sandbox/MGS2001/` -> `.../MGS2001/index.md`

## Where things live

Each stable ID maps to fixed section:
- CLI command / flag: `/manpage/magus-<cmd>/`
- spell and ops: `/spells/<name>/`
- diagnostic `MGSxxxx`: `/codes/` (grouped by family)
- stdlib module (fs, os, http, ...): `/buzz/modules/<name>/`
- core concept (targets, cache, charms, sandbox, affected, ...): `/<concept>/`
- install / download: `/download/` and children
- whole map: `/documentation/`

## Traversing

Every page, three axes:
- Breadcrumb (up): trail back to `/documentation/`.
- "In this section" (siblings, children): other pages under section landing.
- Prev / next (pager): adjacent pages in section.

Land via `llms.txt`, then sweep siblings via "In this section".

## Published site follows main, not your build

Site and source links (`/blob/main/`) render from main; binary may be older.
When they disagree -> trust binary output, like `magus <command> -h`.
Linked file as your build has it: replace `blob/main` with `blob/<commit>`; commit from `magus version -o json`.
Find symbol by name; line numbers move.
If docs and behavior still disagree after that, and you have reproduction -> magus-upstream-source skill traces code at your build.

## In magus repo

`docs/` Markdown: source of truth.
`docs/gen/`: generated; never edit; change source, regenerate.
MAGUS.md: routing index for HUMAN readers; do not answer from it: true only as of last regeneration.
`magus query "kind=doc"` lists every page from graph.
magus agent install --tar | tar -xO -f - magus-upstream-docs-full/SKILL.md
# Navigating the magus docs

magus ships one official documentation site. It is a static site, so its
structure is fixed and machine-readable: this skill teaches HOW to move through
it; the pages themselves carry the WHAT. Use it for a magus-domain fact the
workspace graph cannot give: the docs are the source of truth for
magus's own behavior, so read them rather than guessing.

Send a docs lookup whose answer is all you need to the `magus-scout` agent, where your
harness installed one. Otherwise use a worker on your host's cheapest model.

Two places serve the same pages:

- In the magus repo (a `magusfile.buzz` at the root, a `docs/` tree): query the section
  (next), or read `docs/<name>.md` when you know the page. This is where
  the skill is dogfooded, so prefer it here.
- Published: `https://eli.gladman.cc/magus/`. Every page is also raw Markdown at
  `<page-url>index.md`.

## Contents

- In a magus workspace, ask the graph for the passage
- Fast path: start from the index, do not guess URLs
- URL scheme
- Where things live (stable IDs route straight to a page)
- Traversing within the docs
- The published site follows main, not your build
- In the magus repo

## In a magus workspace, ask the graph for the passage

Every Markdown heading is a `docsection` node, so "where is this explained" is a
query, not a scan:

```sh
magus query kind=docsection "cache key"
```

Each result's id is `<path>#<anchor>`. Read that section, not the whole file.
`project=<p>` scopes it, and `magus explain "docsection:<path>#<anchor>"` walks the
page's outline from there. The index route below is for the PUBLISHED site,
which has no graph.

## Fast path: start from the index, do not guess URLs

Two files at the docs root turn "find the page" into a lookup:

- `llms.txt`: one titled link per page to its raw Markdown (`<url>index.md`), with a
  one-line description. Read it FIRST, then fetch the page's `index.md`.
- `search-index.json`: an array of `{url, title, text, tags, description}`, one
  record per page. Grep it for a keyword when you do not know the page name.

WRONG: guess `https://.../go-spell` or grep the open web.
CORRECT: read `llms.txt` (or `docs/` locally), find the entry, fetch its Markdown.

## URL scheme

Pages use extensionless directory URLs; append `index.md` for the raw source.

| You have                     | Page URL             | Raw Markdown                |
| ---------------------------- | -------------------- | --------------------------- |
| the `go` spell               | `/spells/go/`        | `/spells/go/index.md`       |
| the `magus run` command      | `/manpage/magus-run/`| `/manpage/magus-run/index.md`|
| diagnostic MGS2001           | `/codes/sandbox/MGS2001/` | `.../MGS2001/index.md` |

## Where things live (stable IDs route straight to a page)

Each stable ID maps to a fixed section, so you jump without searching:

| Looking for                        | Go to                        |
| ---------------------------------- | ---------------------------- |
| a CLI command / flag               | `/manpage/magus-<cmd>/`      |
| a spell and its ops                | `/spells/<name>/`            |
| a diagnostic `MGSxxxx`             | `/codes/` (grouped by family)|
| a stdlib module (fs, os, http, ...)| `/buzz/modules/<name>/`      |
| a core concept (targets, cache, charms, sandbox, affected, ...) | `/<concept>/` |
| install / download                 | `/download/` and its children|
| the whole map                      | `/documentation/`            |

## Traversing within the docs

Every page has three axes, so from one page you can reach its whole area:

- Breadcrumb (up): the trail back to `/documentation/`.
- "In this section" (siblings + children): the other pages under this section's
  landing. A `page_type: overview` page IS a section landing.
- Prev / next (pager): the adjacent pages in the section.

So: land via `llms.txt`, read the page, then use "In this section" to sweep its
siblings; do not re-search for each one.

## The published site follows main, not your build

The site and its source links (`/blob/main/`) are rendered from main. The binary
you run may be older: a flag, an op or a diagnostic can differ between a page
and your build. When they disagree, trust what the binary prints, such as
`magus <command> -h`.

To read a linked file as your build has it, replace `blob/main` with
`blob/<commit>`. Take the commit from `magus version -o json`. Find the symbol by
name: line numbers move between versions, so the link's anchor points at main's line.

If the docs and the behavior still disagree after that, and you have a
reproduction, the magus-upstream-source skill traces the code at your build.

## In the magus repo

`docs/` Markdown is the source of truth; `docs/gen/` is generated (never edit it;
change the source and regenerate). MAGUS.md is a routing index for HUMAN readers;
do not answer from it: it is true only as of the
last regeneration, and every fact in it has a live command. The knowledge graph
carries every page as a `doc` node, so `magus query "kind=doc"` (see the
magus-query skill) lists them from the graph.
generatedinternal/agent/skills/magus-upstream-docs/SKILL.mdagentsskillsmagus-upstream-docs
Last updated (61fd39a7)
Earlier changes on this page (7)

Full history ↗ · Blame source ↗

Glossary

Workspace

The magus root directory that owns a set of projects and shared config; the unit magus operates over. Workspace in full.

Project

A directory magus recognizes as a unit of work (it has a magusfile); the unit of caching, scheduling, and dependency tracking. Project in full.

Magusfile

The magusfile.buzz that declares a project's targets (as export funs) and binds its spells. Magusfile in full.

Target

A named operation (build, test, ...) you invoke with magus run <target>; it may compose a spell's tool-native operations and depend on other targets. Target in full.

Op

A single tool-native command a target composes (long form: operation); the middle of the work hierarchy (Spell to Op to Target). Op in full.

Spell

A language/runtime adapter (e.g. go, md) that maps generic targets onto a toolchain's real commands. Spell in full.

Charm

An execution modifier attached with : (lint:rw) that changes how a target runs, not which one; the built-in rw flips a check-only target to mutate in place, and ci always strips it. Charm in full.

Module

A magus stdlib namespace a magusfile imports for host capabilities: filesystem, exec, vcs, and more. Module in full.

Buzz

The language magusfiles are written in (the .buzz engine). Buzz in full.

Cache

The content-addressed store magus consults before running a target, so unchanged work is skipped. Cache in full.

Affected

The set of projects touched by a change; magus affected <target> runs a target only over them. Affected in full.

Sandbox

The restricted filesystem and environment a target runs in, so builds stay reproducible and side-effect-free. Sandbox in full.

CI

An ordinary target you compose yourself with ctx.needs; magus does not hardcode its stages. It is the anchor magus affected ci keys off, and ci strips the rw charm. CI in full.

Trace

OpenTelemetry's name for one whole magus invocation; every target it runs is a span beneath it. Trace in full.

Knowledge graph

The queryable graph of a workspace's spells, targets, docs, and code relationships; query it with magus query/explain/path. Knowledge graph in full.

MAGUS.md

The committed routing index at a workspace root, regenerated from the knowledge graph: it lists every node and points at the exact query for a given question, so it is the entry point an agent reads first. MAGUS.md in full.

Diagnostic code

A stable MGSxxxx identifier attached to a magus warning or error, so it can be referenced and looked up; some are guardrails (see wards), others hard errors. Diagnostic code in full.

Agent

A model working through an agent host such as Claude Code, Codex, Cursor or OpenCode. magus treats an agent as one more caller of its CLI, MCP tools and console, held to the same checks as a person. Agent in full.

Harness

The deterministic scaffolding around the work on a change, for a person or an agent: compiler errors, formatters, linters, checks, gates, leases and hooks, placed at points a person chose. Around an agent's loop, magus supplies one and keeps it outside. Harness in full.

Skill

A packaged set of instructions an agent host loads when a task matches its description: a directory holding a SKILL.md. magus ships its magus-* skills in the binary and writes them with magus agent install. Skill in full.

Run

One target executing under one magus invocation, such as magus run test web or magus affected ci. A run keeps its captured output behind an output reference. Every magus run is a run whether or not any job asked for it; see Job for how the two relate. Run in full.

Pane

A split within a tab. Splitting divides the focused pane along its longer side, so the same action tiles side-by-side on a desktop and stacks on a phone; a tab with no split is a single pane. Drag the divider to re-weight the split. Pane in full.

Conventions

Placeholders

Angle brackets mark a value you replace with your own; never type the brackets:

magus run <target>
magus completion <shell>    # e.g. bash, zsh, fish

<target>, <path>, <shell>, <name> and the like are stand-ins, not literal text.