Tutorials
Hands-on guides for every AGS surface you will call from code, hooks, CLI, or MCP — install and host wiring, the commit loop, structure graphs, delivery, token intelligence, ops, and licensing. Work a track in order; each page shows imports, tools, config, and what success looks like.
51 tutorials across 10 tracks.
Setup & host
Install the package, mount MCP, and wire hooks so agents can call AGS.
- Install the AGS SDK Add @tmrxjd/agent-governance-system, configure GitHub Packages auth, and verify subpath imports.
- Mount PluginHost and merge MCP tools Create PluginHost, merge create*Tools factories, and expose governance MCP tools to the IDE.
- Install git and IDE enforcement hooks Wire commit-msg validation and beforeShellExecution denials so raw git commit cannot bypass MCP.
- Explore the governance TOC Call governance_toc to inventory graphs, probes, DiffRules, scopes, and MCP tool names.
Commit loop
CAP, staging, enforcement, confidence, and legal agent commits.
- Commit Authorization Protocol (CAP) Read/set CAP with commit_authorize: off, on, or close-only.
- Agent commit message schema Author status/<status>(<scope>) messages with required trailers; validate via commit-msg.
- Atomic commits with commit_checkpoint Create CAP-gated checkpoints through MCP with dryRun, files list, and commit_close for milestones.
- Staging Engine — one Commit-Scope per commit Classify diffs, enforce one staging category, split/stash mixed indexes.
- Enforcement sessions Begin sessions, record MCP tools, pass enforcement_check before checkpoints.
- Confidence Engine Evaluate, raise, and enforce confidence until ok before mutating commits.
- First governed commit end-to-end Full path: CAP on → classify → enforce → confidence → commit_checkpoint.
Structure graphs
Schema, pointer, and semantic graphs that keep meaning and paths aligned.
- Schema Engine Scan, get, validate, diff, and enforce the Schema graph before adding MCP tools or DiffRules.
- Pointer Engine Map repo paths to homes and catch documentation/structure drift with pointer_enforce.
- Semantic Engine Enforce meaning constraints — e.g. done requires user_approved — via semantic_enforce.
Quality gates
Testing plans, performance budgets, and Sentinel halt/remediate.
Singularity & lists
Canonical SoT, ordered arrays, and dependency integrity.
- Canonicalization Engine Declare one SoT per concept in .ags/canonical.yml; detect and plan fixes for mirror drift.
- Data Array Engine Govern ordered, deduped arrays with array_enforce and array_plan_normalize.
- Dependency Engine Validate dependency graphs for cycles and compatibility; enforce and plan fixes.
Versioning & delivery
Semver bumps, environment ladders, promotion, release, health, rollback.
- Versioning Engine Map Commit-Scopes to semver bumps via .ags/versioning.yml and version_plan_bump / version_enforce.
- Deployment Engine Define environment ladders, required checks/tests, and enforce deploy order.
- Promotion Engine Gate promotions across environments with promote_plan / promote_enforce.
- Release Engine Plan and enforce release artifacts, tags, and notes against .ags/release.yml.
- Health Engine Define health checks and run health_check / health_enforce before promotion.
- Rollback Engine Plan and enforce rollbacks with version tracking when health or promotion fails.
Token intelligence
Efficiency, impact, and optimization — spend less, prove outcomes.
- Efficiency Engine — token budgets and loops Track tokens, predict waste, block loops with efficiency_enforce profiles.
- Impact Engine — prove growth Run impact snapshots, scores, stress, and reports to prove the agent is getting smarter.
- Optimization Engine Enforce MCP/cost and performance optimization policies with optimize_* tools.
Ops & trust
Policy, observability, artifacts, registry, identity, access, security.
- Policy Engine Browse and enforce .ags/policy.yml registries that bind engines to required files.
- Observability Engine Enforce log/metric/anomaly policies with observe_* tools.
- Artifact Engine Validate release/build artifact structure with artifact_enforce.
- Registry Engine Govern private package registry publish flows with registry_enforce.
- Integrity Engine Checksum and tamper detection via integrity_enforce.
- Identity Engine Map agents, users, and environments in the identity graph; enforce identity_policy.
- Access Engine Permission matrices and access gating with access_enforce.
- Security Engine Secret scanning and secure deploy cues via security_enforce.
- Agent Surface Engine Constrain which MCP tools/paths agents may use with surface_enforce.
Supporting engines
Persistence, tracking, builder, coordination, formatting, drift, gates, doctor.
- Persistence Engine Scan and enforce persistence contracts so durable state stays on canonical paths.
- Tracking Engine Track work items / ledger alignment with tracking_enforce.
- Familiarity / style Engine Enforce house style with style_scan / style_enforce so agents match repo conventions.
- Builder Engine Scan builder graphs and create/enforce build plans with builder_* tools.
- Coordination Engine Plan multi-domain work with coord_plan / coord_run / coord_enforce.
- Formatting Engine Scan, diff, apply, and enforce formatting contracts with format_* tools.
- Drift Engine Detect cross-artifact drift with drift_scan / drift_check / drift_enforce.
- Gates API Run DiffRules via runGates / PluginHost gates for path classification and mutation holds.
- Governance LSP helpers Use gov_lsp_diagnostics and gov_lsp_hover for in-editor governance feedback.
- Governance Doctor Run doctor reports over PluginHost probes to classify healthy / degraded / broken.
- Commit graph sidecar Load and validate the commit graph that links agent SHAs, scopes, and edges.
Licensing
Dual-license sidecars and product tier entitlements.