|
| 1 | +# Guster |
| 2 | + |
| 3 | +Guster is a distributable agent plugin that audits and evolves the context of a whole machine: projects, instruction files, skills, tools, knowledge, project state, evidence and credential references. It can also scaffold a lightweight Hub for durable knowledge and project state. |
| 4 | + |
| 5 | +It is the **control plane** for agent context. A Guster Hub is the optional **data plane**: the local repository that holds project cards, knowledge, tools and reports. The plugin does not replace the hub; it discovers it, validates it, and helps keep it coherent. |
| 6 | + |
| 7 | +## What it does |
| 8 | + |
| 9 | +- **Discovers** Git roots, `AGENTS.md` / `CLAUDE.md`, `.agents/` directories, skills, tools, knowledge, state, evidence and credential locations. |
| 10 | +- **Diagnoses** resident budgets, skill metadata budgets, copy drift, duplicate canonical sources, orphan knowledge, broken pointers, misplaced task folders, stale state, inline tokens and credentials outside the canonical root. |
| 11 | +- **Scores** context health with seven dimensions and a CHI dashboard. |
| 12 | +- **Plans** structural changes as reviewable JSON plans. |
| 13 | +- **Applies** only with `--yes`, with a backup and rollback path. |
| 14 | +- **Initializes** a standard `.agents/` layout for a new project or a new machine. |
| 15 | +- **Scaffolds** a lite Guster Hub when the user does not have a data plane yet. |
| 16 | + |
| 17 | +## Quick start |
| 18 | + |
| 19 | +```bash |
| 20 | +cd <checkout> |
| 21 | +./bin/guster init --home --yes |
| 22 | +./bin/guster hub init --path <hub> --yes |
| 23 | +./bin/guster scan |
| 24 | +./bin/guster doctor |
| 25 | +./bin/guster score --write |
| 26 | +``` |
| 27 | + |
| 28 | +The CLI is Python 3.9+ and has no third-party Python dependencies. |
| 29 | + |
| 30 | +Install a stable command on your `PATH`: |
| 31 | + |
| 32 | +```bash |
| 33 | +ln -s "$(pwd)/bin/guster" ~/.local/bin/guster |
| 34 | +``` |
| 35 | + |
| 36 | +## Commands |
| 37 | + |
| 38 | +| Command | Purpose | |
| 39 | +|---|---| |
| 40 | +| `guster status` | Show plugin version, registry and health summary | |
| 41 | +| `guster scan` | Discover context assets and write `registry.json` | |
| 42 | +| `guster doctor` | Run policy checks and write `findings.json` | |
| 43 | +| `guster score` | Compute metrics and CHI; append `metrics.jsonl` | |
| 44 | +| `guster plan findings` | Turn findings into a review checklist | |
| 45 | +| `guster plan move` | Plan a move with backup and pointer | |
| 46 | +| `guster plan init` | Plan a standard `.agents/` layout | |
| 47 | +| `guster apply <plan>` | Dry-run by default; `--yes` writes with backup | |
| 48 | +| `guster init` | Initialize the state home or a project | |
| 49 | +| `guster hub init` | Create a lite Hub and attach it to the local config | |
| 50 | +| `guster hub attach` | Attach an existing Hub without copying its content | |
| 51 | +| `guster hub status` | Show the Hub manifest and contract checks | |
| 52 | +| `guster hub validate` | Validate the lite Hub contract | |
| 53 | +| `guster link` | Check context pointers | |
| 54 | +| `guster export` | Export a redacted Markdown/JSON report | |
| 55 | +| `guster credentials` | List registered credentials by scope (company / personal) | |
| 56 | +| `guster upgrade` | Check Codex/ZCode/package manifest versions | |
| 57 | + |
| 58 | +## Lite Hub |
| 59 | + |
| 60 | +The plugin can create a deliberately small data plane: |
| 61 | + |
| 62 | +```text |
| 63 | +Guster/ |
| 64 | +├── AGENTS.md |
| 65 | +├── README.md |
| 66 | +├── hub.yaml |
| 67 | +├── knowledge/ |
| 68 | +│ ├── README.md |
| 69 | +│ └── general/start-here.md |
| 70 | +├── projects/ |
| 71 | +│ └── _registry.md |
| 72 | +└── tools/ |
| 73 | + └── README.md |
| 74 | +``` |
| 75 | + |
| 76 | +`tools/` is present as an index and contract, with no tool preinstalled. `handoff/` and `reports/` are optional and are not created by the lite profile. The scanner skips missing optional directories. |
| 77 | + |
| 78 | +`guster hub init` refuses a non-empty target, writes a reviewable plan, and attaches the new Hub to `~/.agents/guster/config.json`. Use `guster hub attach --path <hub>` for an existing Hub. |
| 79 | + |
| 80 | +The three core roots can be chosen at creation time: |
| 81 | + |
| 82 | +```bash |
| 83 | +guster hub init --path <hub> --knowledge notes --projects work --tools scripts --yes |
| 84 | +``` |
| 85 | + |
| 86 | +They are recorded in `hub.yaml` under `paths` and can be changed later. Paths must be relative to the Hub and must stay inside it. |
| 87 | + |
| 88 | +A full Hub uses `profile: full` and is scanned across knowledge, projects, handoff, reports, `Human Output`, provision, tools, manuals, cron tasks, OpenSpec changes, archive and `strategy.md`. Generated or runtime areas such as `out/`, `.manual-site/`, `.playwright-mcp/` and `.codegraph/` are not treated as knowledge sources. `--scope hub` is Hub-only; local wiki and machine-level secrets belong to the machine scope. |
| 89 | + |
| 90 | +## Health model |
| 91 | + |
| 92 | +```text |
| 93 | +CHI = 0.20 SSR + 0.15 RBR + 0.15 PCR + 0.15 ICR |
| 94 | + + 0.15 FRS + 0.10 PHR + 0.10 SIR |
| 95 | +``` |
| 96 | + |
| 97 | +- **SSR** single-source rate |
| 98 | +- **RBR** resident budget ratio |
| 99 | +- **PCR** placement compliance rate |
| 100 | +- **ICR** index coverage rate |
| 101 | +- **FRS** state freshness rate |
| 102 | +- **PHR** pointer health rate |
| 103 | +- **SIR** secret isolation rate |
| 104 | + |
| 105 | +Red-line failures override the score: credential in git, broken resident pointer, duplicate canonical source, resident hard-cap breach, or a governance entry pointing at an archived asset. |
| 106 | + |
| 107 | +## Scopes |
| 108 | + |
| 109 | +| Level | Command | Scored dimensions | |
| 110 | +|---|---|---| |
| 111 | +| machine | `guster doctor` | SSR RBR PCR ICR FRS PHR SIR | |
| 112 | +| hub | `guster doctor --scope hub` | SSR ICR FRS PHR | |
| 113 | +| group | `guster doctor --root A --root B` | SSR PCR ICR FRS PHR | |
| 114 | +| project | `guster doctor --root <repo>` | SSR PCR ICR FRS PHR | |
| 115 | + |
| 116 | +Scoped runs write to `~/.agents/guster/scoped/<hash>/`. |
| 117 | + |
| 118 | +Every scoped run applies one boundary to both sides of the report: an artifact |
| 119 | +counts toward a denominator only when a finding about it could also appear in |
| 120 | +that scope. `project` and `group` runs therefore drop hub knowledge, hub state |
| 121 | +documents and the machine-level local wiki from ICR/FRS/PHR unless they live |
| 122 | +under one of the given roots; the report table shows exactly the dimensions that |
| 123 | +enter CHI, and any extra value is labeled `Not counted in CHI`. A dimension with |
| 124 | +no in-scope artifacts stays vacuous (`0/0` in the raw column, score 1.0) instead |
| 125 | +of borrowing health from out-of-scope files. This changes CHI for `project` and |
| 126 | +`group` scopes; hub health keeps being reported by `--scope hub` and the |
| 127 | +machine-wide run. |
| 128 | + |
| 129 | +## Credential registry |
| 130 | + |
| 131 | +Guster reads `~/.agents/credentials/registry.md` and checks it against every credential file it finds: |
| 132 | + |
| 133 | +- `secret-undeclared` - a credential file is not registered. |
| 134 | +- `secret-missing` - a registered location no longer exists. |
| 135 | + |
| 136 | +The registry holds scope (`company` / `personal`), site, account, kind, location and variable names. |
| 137 | +It never holds values. `guster credentials` prints the split. |
| 138 | + |
| 139 | +## The eight planes |
| 140 | + |
| 141 | +1. **Truth** — code, tests, build and runtime config. |
| 142 | +2. **Instruction** — `AGENTS.md` and policies. |
| 143 | +3. **Capability** — skills, tools, MCP, plugins, scripts. |
| 144 | +4. **Knowledge** — durable principles, methods, business semantics, pitfalls. |
| 145 | +5. **State** — project cards, handoffs, environment and port registries. |
| 146 | +6. **Evidence** — reports, screenshots, videos, test output. |
| 147 | +7. **Runtime** — sessions, caches, logs, temp files, browser profiles. |
| 148 | +8. **Secret** — passwords, tokens, keys, cookies; references only. |
| 149 | + |
| 150 | +## Safety |
| 151 | + |
| 152 | +- Read-only by default. `apply`, `init --yes`, `hub init --yes` and `hub attach` are the only writers. |
| 153 | +- Credential values are never persisted or printed; scans keep only paths and redacted shapes. |
| 154 | +- No automatic `git add`, `commit`, `push` or deploy. |
| 155 | +- Company/public repository tracked files are not ordinary migration targets. |
| 156 | +- Plans are written to `~/.agents/guster/plans/`; backups to `~/.agents/guster/backups/`. |
| 157 | + |
| 158 | +## Plugin hosts |
| 159 | + |
| 160 | +| Host | Manifest | |
| 161 | +|---|---| |
| 162 | +| Codex | `.codex-plugin/plugin.json` | |
| 163 | +| ZCode | `.zcode-plugin/plugin.json` | |
| 164 | +| DSH | `package.json` + `cordis.patch.yml` | |
| 165 | + |
| 166 | +All three point at `skills/` (the `guster` and `guster-hub` skills). Keep their versions synchronized. |
| 167 | + |
| 168 | +```bash |
| 169 | +# DSH bundle |
| 170 | +dsh plugin add /path/to/guster |
| 171 | +``` |
| 172 | + |
| 173 | +### Extra skill roots |
| 174 | + |
| 175 | +By default guster scans `~/.agents/skills`, `~/.codex/skills`, `~/.dsh/skills` and |
| 176 | +`~/.claude/skills`. Additional hosts stay local and are injected without changing |
| 177 | +the published source: |
| 178 | + |
| 179 | +```bash |
| 180 | +export GUSTER_EXTRA_SKILL_ROOTS="name=/path/to/skills:other=/another/path" |
| 181 | +``` |
| 182 | + |
| 183 | +## Project layout |
| 184 | + |
| 185 | +```text |
| 186 | +skills/guster/ agent-facing skill |
| 187 | +skills/guster-hub/ hub bootstrap and validation skill |
| 188 | +src/guster/ Python CLI and policy engine |
| 189 | +bin/guster executable wrapper |
| 190 | +templates/hub/ lite Hub scaffold (the only shipped template set) |
| 191 | +tests/ fixture and plugin tests |
| 192 | +``` |
| 193 | + |
| 194 | +## Test |
| 195 | + |
| 196 | +```bash |
| 197 | +python3 -m unittest discover -s tests -v |
| 198 | +node --test tests/test_plugin.mjs |
| 199 | +``` |
| 200 | + |
| 201 | +## License |
| 202 | + |
| 203 | +MIT © Lumos-789 |
0 commit comments