Skip to content

aglangArchitecture Guardrails for Coding Agents

Give agents a live interface to your architecture rules, so they can validate work in progress while coding and still get solver-backed enforcement before commits land.

aglang architecture pipeline diagram

Install

Install the CLI and the packaged agent skill:

bash
npm install -g @collivity/aglang
aglc install-agent-skill

Then bootstrap a project:

bash
aglc add /path/to/your/project

aglc add creates the starter architecture spec, compiled artifact, git hook, and project-specific agent manifest. Full getting-started guide →


How agents should use aglang

The packaged skill gives agents generic aglang behavior; the project repo supplies its own rules through AGENTS.md, skill.json, and architecture.o.

  1. Read AGENTS.md before coding.
  2. Validate focused edits with aglc check-file --arch architecture.o --file <path> --json.
  3. Validate the whole guarded project before finishing with aglc check --arch architecture.o --project . --all --json.
  4. Ask before creating, editing, regenerating, or compiling .ag architecture specs or generated architecture artifacts.
  5. Use planning/design sessions for architecture authoring, where engineers can review intended spec changes.

How it works — at a glance

aglang is a dual-compiler system exposed as an agent workflow. Your .ag spec compiles to SMT-LIB math formulas; during coding or commit checks, a second compiler extracts what changed code actually does and feeds it to the solver:

Your .ag spec                 Your codebase (file or project)
      │                                    │
      ▼                                    ▼
[aglc compile]              [AST extractors — 8 languages]
      │                                    │
      ▼                                    ▼
 architecture.o              FlowFact[]  (what code talks to what)
(SMT constraints)                         │
      │                                   │
      └────────────── solver-backed check ────────┘

                    SAT → pass ✓  │  UNSAT → reject with proof ✗

Agents use the same interface while code is still in progress; pre-commit hooks and CI use it as the final enforcement point. The solver is deterministic math — no LLM guesses. Full pipeline walkthrough →

Released under the Apache-2.0 License.