Getting Started
Install
bash
npm install -g @collivity/aglangbash
npx @collivity/aglang add .bash
npm install github:collivity/aglangRequirements:
- Node.js ≥ 18 — nodejs.org
- A git repository
The solver ships via the
z3-solvernpm package (WebAssembly) — no system install needed.
Quick setup — one command
bash
aglc add /path/to/your/project --name MyAppThat's it. This single command:
- Scans your project (C#, Python, TypeScript, Go, Rust, Swift, JVM — all supported)
- Generates
architecture.ag— a starter spec with discovered components and routes - Compiles it to
architecture.o - Installs a git pre-commit hook — every commit is now checked
- Emits
skill.jsonso AI agents understand your architectural rules
Add your first rule
Open the generated architecture.ag and add an invariant block:
ag
invariant NoDirectDBAccess {
deny flow PublicAPI -> Database
}Then recompile:
bash
aglc compile architecture.agFrom now on, any commit that creates a direct path from PublicAPI to Database is blocked with a precise error message and proof details.
How it works
Your codebase Your .ag spec
│ │
▼ ▼
[Git Diff Extractor] + [Architecture Compiler]
│ │
└──────────── Z3 Solver ────────┘
│
UNSAT → commit passes ✓
SAT → commit rejected with proof ✗- You write an
architecture.agfile describing components and invariants aglc compiletranslates it to SMT-LIB and emitsarchitecture.o- A pre-commit hook runs Z3 against every staged diff — violations are blocked before they land
Designed for AI Agents
AI coding agents (Copilot, Claude, Cursor, etc.) can operate autonomously for long stretches. aglang acts as guardrails — mathematical constraints the agent cannot violate even if it hallucinates an architecture change.
aglc addgenerates a starter spec, installs the hook, and emitsskill.jsonin one command- Agents read
AGENTS.md(generated byaglc emit-context) to understand boundaries before they start - Every commit attempt is checked — human or agent alike
See the AI Agents guide for the full integration workflow.