説明
以下はプラグイン作者による原文です。
Guster
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.
It is the control plane for agent context. A Guster Hub is the optional data plane: the local repository that holds the project register, knowledge, tools and reports. The plugin does not replace the hub; it discovers it, validates it, and helps keep it coherent.
Prior art
The ideas are borrowed with credit; the implementation is guster's own.
- Cline Memory Bank — inspired the layered responsibilities of the files (project register, knowledge, state) and the banking rhythm of refreshing them per working session; both banks are plain markdown.
- Claude Code memory tool — inspired the one-fact-per-file note shape and front-matter metadata; guster's note headers spell the keys
name,description,type. - Letta (MemGPT) — inspired the label/limit abstraction of memory blocks behind guster's resident budgets.
- Mem0 — inspired the decide-first stance (ADD/UPDATE/DELETE/NOOP, soft invalidation by marking instead of deleting) behind plan/apply/waiver; a waiver greens the gate, not the score.
- Zep/Graphiti — inspired the dual-timeline fact model (
valid_at/invalid_at);superseded_byis its one-file simplification. - The framing vocabulary — structured note-taking (agentic memory), 'just in time' context, context rot, compaction — is inspired by Anthropic's "Effective context engineering for AI agents" (2025-09-29).
What it does
- Discovers Git roots,
AGENTS.md/CLAUDE.md,.agents/directories, skills, tools, knowledge, state, evidence and credential locations. - 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.
- Scores context health with seven dimensions and a CHI dashboard.
- Plans structural changes as reviewable JSON plans.
- Applies only with
--yes, backing up every touched path and rolling back automatically when an operation fails. - Initializes a standard
.agents/layout for a new project or a new machine. - Scaffolds a lite Guster Hub when the user does not have a data plane yet.
Quick start
cd <checkout>
./bin/guster init --yes
./bin/guster hub init --path <hub> --yes
./bin/guster scan
./bin/guster doctor
./bin/guster score
guster check runs the scan → doctor → score (with trend) pass as one command
when you want the whole picture at once.
The CLI is Python 3.9+ and has no third-party Python dependencies.
Install a stable command on your PATH:
ln -s "$(pwd)/bin/guster" ~/.local/bin/guster
Commands
| Command | Purpose |
|---|---|
guster status | Show plugin version, registry and health summary |
guster scan | Discover context assets and write registry.json |
guster doctor | Run policy checks and write findings.json |
guster score | Compute metrics and CHI; append metrics.jsonl. --fail-under N turns it into a gate (exit 2) |
guster check | scan + doctor + score --trend in one pass; exit code carries the doctor semantics |
guster zones list/add/remove | Manage the machine zones in config.json |
guster plan findings | Turn findings into a review checklist |
guster plan move | Plan a move with backup (no pointer is written) |
guster apply <plan> | Dry-run by default; --yes writes with backup |
guster init | Initialize the state home or a project; --root <dir> adds a workspace root to an existing config |
guster hub init | Create a lite Hub and attach it to the local config |
guster hub attach | Attach an existing Hub without copying its content |
guster hub status | Show the Hub manifest and contract checks |
guster hub validate | Validate the lite Hub contract |
guster export | Export a redacted Markdown/JSON report |
guster credentials | List registered credentials by scope (company / personal) |
Configuration: roots and zones
~/.agents/guster/config.json declares where your context lives:
{
"version": 1,
"roots": ["/home/me/Projects"],
"zones": [{ "path": "/home/me/tools" }],
"scan_max_depth": 5
}
roots— the workspace roots scanned for git repositories. Must be a list of existing absolute paths; a bare string, an empty list, a relative path or a missing directory fails loud instead of being reinterpreted.guster init --root <dir>on an initialized machine adds the directory to this list (deduplicated by resolved path, so~/codeand its absolute spelling are one root); the other keys and the spelling of existing roots are untouched.hub— the attached Guster Hub path (written byhub init/hub attach).scan_max_depth— how deep under each root the scanner walks looking for git repositories (default 5). Raise it for deeply nested layouts, lower it to speed up huge trees.zones— tool areas that are not repositories: a tools directory you want governed without pretending each tool is a project. A zone is scanned light-style: itsAGENTS.md/README.mdentry docs join the pointer and freshness checks, its.envfiles and variants (.env.local,.env.production, ...;example/sample/template/distplaceholders excepted) join the secret scan, and.agents/slot compliance never applies. An entry is{path}only; extra keys a legacy config may still carry (e.g. a retiredprofile) are tolerated and ignored.
Manage zones with the zones subcommand (list, add <dir>,
remove <dir>); it writes config.json and applies the same validation.
First run without a config: guster probes the conventional directories
~/Projects, ~/code, ~/dev and ~/src. Hits are scanned with an
"Unconfigured" banner telling you to run guster init to pin them; if none
exists the command fails loud (exit 1) pointing at
guster init --root <path>. Guster never silently scans your home directory.
Lite Hub
The plugin can create a deliberately small data plane:
Guster/
├── AGENTS.md
├── README.md
├── hub.yaml
├── knowledge/
│ ├── README.md
│ └── general/
│ ├── start-here.md
│ └── knowledge-v1-skeleton.txt
├── projects/
├── register/
│ └── projects.yaml
└── tools/
└── README.md
tools/ is present as an index and contract, with no tool preinstalled. handoff/ and reports/ are optional and are not created by the lite scaffold. The scanner skips missing optional directories.
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.
The core roots are declared at creation time:
guster hub init --path <hub> --knowledge notes --projects work --tools scripts --yes
Under hub.yaml schema 2 the layout is declarative: knowledge and projects must be declared under paths — a missing declaration fails loud — while every other section (such as tools) is optional. Relative declarations stay inside the Hub; any section may instead be declared external (absolute or ~/). Declarations are recorded in hub.yaml under paths and can be changed later.
Scanning follows the directories that exist, not a mode: there is no profile concept in hub.yaml (a leftover key from an older version is ignored, as are unknown top-level manifest keys). Knowledge subzones are discovered, not enumerated — every first-level directory under the knowledge root (general/, projects/, machines/, ...) is scanned and index-checked. A hub is also scanned across the configured project state root, register/, handoff/, reports/, output/, .agents/plans/ and strategy.md whenever those exist; other hub directories are not scanned. A repository checked out inside a hub section is a project, not hub content: the walk stops at its git root, so audit it by adding its parent directory as a root (guster init --root <dir>). 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.
Health model
CHI = 0.20 SSR + 0.15 RBR + 0.15 PCR + 0.15 ICR
+ 0.15 FRS + 0.10 PHR + 0.10 SIR
- SSR single-source rate
- RBR resident budget ratio
- PCR placement compliance rate: share of
.agents/dirs with all six standard slots, a non-empty index and no unknown top-level entry. The denominator is.agents/dirs only — a repository that never adopted the layout is not scored, and a directory that holds other scanned projects (a workspace or group root) is not a project. The report prints the failure breakdown, so a low number says why instead of just being low. - ICR index coverage rate
- FRS state freshness rate: share of state documents under the hub's
project root (
projects/),register/,handoff/and.agents/plans/that were verified within the 90-day SLA. The denominator is those prefixes only — a hubreports/file or a machine-level note is not state. The date comes from a declared key —verified_at(canonical), the Chinese最后更新family or the EnglishLast updated:/updated:— in the first 40 lines, or a date that opens the filename (2026-11-05-…,20261105-…); without one, the ladder falls back to the owning repository's last git commit, then to file mtime (labeled as such in the raw column). A date buried in prose or a ticket number inside the name is not a freshness claim. - PHR pointer health rate
- SIR secret isolation rate: credential files plus literal tokens in host configuration. Guster does not scan arbitrary file content for token shapes — that is the release gate's job; SIR only claims what it actually looked at.
Critical findings do not rescale CHI: they make doctor exit 3 (any high
finding exits 2), and the score stays the weighted sum above. Treat the exit code
as the gate and CHI as the trend.
A dimension with no evidence is reported as n/a and dropped from the weighted
sum instead of scoring 1.0: an empty denominator means "not measured", not
"perfect". When every dimension of a scope is empty, CHI itself is n/a, and
the score headline says what it measured — n/a / 100 (5/7 dims scored).
Metric definitions and targets live in
skills/guster/reference/metrics.md.
Context format spec
The metrics are static — filename stems, content hashes, path resolution, git
dates — so they only see documents that keep the format contract. The contract
is written down and versioned: skills/guster/reference/spec.md
(spec_version 2, rules CTX-01..11 — CTX-09 structured note header,
CTX-10 register/v1 project register, CTX-11 opt-in knowledge/v1
structured knowledge contract — markdownlint-style stable IDs). It follows
open conventions instead of inventing new ones: the open AGENTS.md format
(agents.md) for instruction files — discovery is nested
and nearest-wins, the same discipline as CTX-01 (a nested AGENTS.md narrows
the parent, never contradicts it), and a host that only reads CLAUDE.md is
served with ln -s AGENTS.md CLAUDE.md — llms.txt-shaped link indexes
(llmstxt.org), YAML front-matter for note headers (the
de-facto standard Jekyll, Hugo and Gray Matter share), and stable rule IDs
like markdownlint.
A document that ignores the contract is not scored lower — it is invisible: a
naked path in prose never reaches the pointer check, a date written as "last
week" falls back to git, an index without filenames counts as missing. Since
0.7.0 the naked-pointer finding closes that gap from the other side: file
paths left outside a link or code span in an instruction or index document are
reported, so the unwritable form is also the flagged form.
Schema contracts
The two machine-readable formats carry JSON Schema (draft 2020-12) contracts, derived from the code that reads and writes them:
-
schemas/hub.schema.json—hub.yaml. The scaffolded manifest ships with a yaml-language-server modeline on its first line, so the VS Code YAML extension (or any editor speaking yaml-language-server) validateshub.yamlwith zero configuration:# yaml-language-server: $schema=https://raw.githubusercontent.com/Lumos-789/guster/main/schemas/hub.schema.json -
schemas/plan.schema.json— the plan JSON thatplanwrites andapplyexecutes. An agent hand-writing a batch plan has the exact field contract to check against before theapplydry-run.
Scopes
| Level | Command | Scored dimensions |
|---|---|---|
| machine | guster doctor | SSR RBR PCR ICR FRS PHR SIR |
| hub | guster doctor --scope hub | SSR ICR FRS PHR |
| group | guster doctor --root A --root B | SSR PCR ICR FRS PHR |
| project | guster doctor --root <repo> | SSR PCR ICR FRS PHR |
Scoped runs write to ~/.agents/guster/scoped/<hash>/.
Every scoped run applies one boundary to both sides of the report: an artifact
counts toward a denominator only when a finding about it could also appear in
that scope. project and group runs therefore drop hub knowledge, hub state
documents and the machine-level local wiki from ICR/FRS/PHR unless they live
under one of the given roots; the report table shows exactly the dimensions that
enter CHI and omits the others. A dimension with
no in-scope artifacts stays vacuous (0/0 in the raw column, n/a score) instead
of borrowing health from out-of-scope files. This changes CHI for project and
group scopes; hub health keeps being reported by --scope hub and the
machine-wide run. Because empty dimensions are dropped and the weights are
renormalized over what remains, CHI is not comparable across scopes with
different coverage.
Credential registry
Guster reads ~/.agents/credentials/registry.md and checks it against every credential file it finds:
secret-undeclared- a credential file is not registered.secret-missing- a registered location no longer exists.git-unavailable- a repository could not be queried, so tracked state and commit dates are unknown. SIR counts those credentials as unverified rather than clean.
secret-undeclared and secret-missing apply only when the registry exists
and parses at least one row: with ~/.agents/credentials/registry.md missing,
both checks stay off — guster credentials printing registry: (missing)
means exactly that. Create the table (header row plus one row, like the
copyable example below) to enable them.
The registry holds scope (company / personal), site, account, kind, location and variable names.
It never holds values. guster credentials prints the split. A copyable row
(column order is fixed — see the format spec; the first six columns are
required, keys/used_by/status are optional):
| ID | scope | site | account | kind | locations | keys | used_by | status |
|---|---|---|---|---|---|---|---|---|
| example-host | personal | example.com | me@example.com | token | `~/.agents/credentials/example-host.env` | `EXAMPLE_HOST_TOKEN` | my-cli | active |
The eight planes
- Truth — code, tests, build and runtime config.
- Instruction —
AGENTS.mdand policies. - Capability — skills, tools, MCP, plugins, scripts.
- Knowledge — durable principles, methods, business semantics, pitfalls.
- State — the project register, handoffs, environment and port registries.
- Evidence — reports, screenshots, videos, test output.
- Runtime — sessions, caches, logs, temp files, browser profiles.
- Secret — passwords, tokens, keys, cookies; references only.
Safety
- Read-only on your workspace by default.
apply --yes,init --yes(including the config write that adds a root),hub init --yes,hub attachandzones add/zones removeare the only commands that change workspace files or Guster config on their own;exportalways writes one report file —<state-dir>/context-health.mdby default, or the path you name with--out.--format jsonwrites only the.jsonreport (no Markdown). - Guster keeps five files under its state directory (
~/.agents/guster/, orscoped/<hash>/):config.json(roots/zones/hub, written byinit,hub init/attachandzones),registry.json, which every scanning command rewrites (statusincluded, when no registry exists yet),findings.jsonfromdoctor,metrics.jsonlfromscore, and the transient.lockthat serializes concurrent runs.--no-writesuppresses the state writes ofscan,doctor,scoreandcheckonly. (plans/andbackups/are directories, not files.) - Credential values are never persisted or printed; scans keep only paths and redacted shapes.
- No automatic
git add,commit,pushor deploy. - Tracked files you do not own or have no authority over — a shared or employer repository usually qualifies — are not ordinary migration targets.
- Plans are written to
~/.agents/guster/plans/.applycopies every touched path under~/.agents/guster/backups/<plan-id>/before changing it, and rolls back automatically when an operation fails; if the rollback itself fails, the error names that backup directory and you restore by copying the pre-change copies back. Only the newest 10 plan backup directories are kept.
Exit codes
| Code | Meaning |
|---|---|
0 | success — clean run, or findings no worse than medium |
1 | tool/config error: malformed or unreadable plan, an apply that failed mid-operation and was rolled back, missing workspace root, invalid config.json (non-list roots, a bad root/zone/hub path, empty roots, no scan candidates — run guster init); hub status also returns 1 when the attached hub fails its checks |
2 | doctor/check found high (but no critical) findings; score --fail-under below target or CHI not computable; hub validate failed the lite contract |
3 | doctor/check found critical findings |
4 | apply, init or hub init refused the plan at preflight — nothing was touched (missing move source, existing destination, invalid hub init target; an init --project target that only fails mid-apply exits 1 after rollback) |
The same table ships in the guster skill so agents and humans read one
contract. Treat the exit code as the gate and CHI as the trend.
Plugin hosts
| Host | Manifest |
|---|---|
| Codex | .codex-plugin/plugin.json |
| ZCode | .zcode-plugin/plugin.json |
| DSH | package.json + cordis.patch.yml |
All three point at skills/ (the guster and guster-hub skills). Keep their versions synchronized.
# DSH bundle
sole plugin add /path/to/guster
Extra skill roots
By default guster scans ~/.agents/skills, ~/.codex/skills, ~/.dsh/skills and
~/.claude/skills (user-level roots only — project-local .agents/skills/
directories are not part of the skill scan). Additional hosts stay local and are
injected without changing the published source:
export GUSTER_EXTRA_SKILL_ROOTS="name=/path/to/skills:other=/another/path"
Project layout
skills/guster/ agent-facing skill
skills/guster-hub/ hub bootstrap and validation skill
src/guster/ Python CLI and policy engine
bin/guster executable wrapper
templates/hub/ lite Hub scaffold (the only shipped template set)
schemas/ JSON Schema contracts for hub.yaml and plan JSON
tests/ fixture and plugin tests
Test
python3 -m unittest discover -s tests -v
node --test tests/test_plugin.mjs
License
MIT © Lumos-789
バージョン履歴
- 0.9.72026/11/29 · 318 KB