Opinionated AI agent orchestration framework for Gemini CLI and Antigravity
Project description
Gemstack
Opinionated AI agent orchestration framework for Gemini CLI and Antigravity.
Gemstack gives your Gemini-powered agents architectural memory, topology-aware guardrails, and a 5-step lifecycle that forces them to verify their own work against your terminal โ not just hallucinate a solution and tell you it's done.
Built for Gemini CLI and Google Antigravity. Also works with Cursor, Claude Desktop, and Cline via MCP.
The Problem
Every AI coding tool on the market today โ Cursor, Copilot, Aider, Cline โ is bottom-up. You highlight a file, say "write this function," and the agent does its best. Here's what goes wrong at scale:
- ๐ง Architecture amnesia โ The agent forgets your tech stack, reinvents design patterns, and introduces conflicting libraries across sessions.
- ๐ Silent rewrites โ It overwrites perfectly good files to suit new logic, mutating critical path variables without testing.
- โ Self-reported success โ It tells you "Done!" but never actually ran the test suite. You discover failures 3 commits later.
- ๐ญ One-size-fits-all prompting โ A React SPA and a Go microservice get the same generic instructions. No guardrails for your specific topology.
The Solution
Gemstack is top-down. It acts as the orchestrator above your editor, purpose-built for Gemini CLI and Google Antigravity โ Google's agentic AI coding platforms. Gemstack gives your Gemini agent the exact context, constraints, and verification loops it needs to produce production-quality code.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ GEMSTACK โ
โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ Context โ โ Topology โ โ Phase โ โ Autonomous โ โ
โ โ Compiler โโโถโ Guardrails โโโถโ Router โโโถโ Executor โ โ
โ โโโโโโฌโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโฌโโโโโโโ โ
โ โ โ โ
โ .agent/ files Terminal verification โ
โ (ARCHITECTURE, STYLE, (Exit Code 0 or retry) โ
โ TESTING, STATUS) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ โ
Gemini CLI Antigravity Cursor / Claude / Cline
(native) (native) (via MCP Server)
Gemstack's workflows install as slash commands (/architect, /step1-spec, /step3-build, etc.) directly into Gemini CLI and Antigravity. When you type /step3-build in a new Antigravity conversation, the full compiled context โ roles, phases, topology guardrails, and your project's .agent/ files โ is loaded automatically. For other AI IDEs, the built-in MCP server provides the same capabilities.
Key Features
๐๏ธ Architectural Memory via .agent/ Files
Define your entire project context once โ tech stack, API contracts, database schemas, coding style, test strategy, and anti-patterns โ in 5 structured markdown files. Every AI agent reads these before touching your code. No more repeating yourself across sessions.
gemstack init --ai # AI analyzes your codebase and auto-populates .agent/
๐ The 5-Step Verified Lifecycle
Every feature flows through Spec โ Trap โ Build โ Audit โ Ship, with each step running in a fresh context window. The Auditor can't be influenced by the Builder's justifications. Tests are written before code. This is how you crush hallucination.
Step 1: Spec โ Define the feature, lock API contracts (Product Visionary + Architect)
Step 2: Trap โ Write the failing test suite + task plan (SDET + Planner)
Step 3: Build โ Implement until Exit Code 0 (Principal Engineer)
Step 4: Audit โ Fresh-eyes security & logic review (Security Engineer)
Step 5: Ship โ Integrate, merge, deploy, archive (DevOps Engineer)
๐ Topology-Aware Guardrails
Instead of generic prompts, Gemstack loads domain-specific guardrails based on your project's detected topology. A Next.js app with a Go backend gets different rules than a Python ML pipeline.
| Topology | Example Guardrails |
|---|---|
| Backend | Deterministic test discipline, anti-mocking rules, N+1 query detection |
| Frontend | Component state coverage matrix (empty/loading/success/error), hydration safety |
| ML/AI | Evaluation-Driven Development, cost circuit breakers, prompt versioning |
| Infrastructure | YAML validation, no-auto-apply policy, configuration drift detection |
| Library/SDK | API surface snapshot diffing, semver enforcement, backward compatibility |
๐ค Autonomous Execution with gemstack run
Go beyond copy-pasting prompts. Gemstack compiles your full project context, calls Gemini, writes the results to disk, and tracks costs โ all in a single command:
gemstack run step1-spec --feature "Add user notifications" # Define the spec
gemstack run step3-build --feature "Add user notifications" # Build until tests pass
gemstack run step4-audit --feature "Add user notifications" # Fresh-context audit
Each execution includes: per-project lockfile (prevents concurrent corruption), cost tracking with configurable circuit breakers, path traversal prevention on AI-generated file writes, and structured result summaries.
๐ Native IDE Integration via MCP
Gemstack exposes your .agent/ context to any MCP-compatible agent (Cursor, Claude Desktop, Gemini CLI, Cline) as a Model Context Protocol server โ with read-only resources, actionable tools, and reusable prompt templates:
gemstack mcp serve # Start stdio server
gemstack mcp register --cursor --claude-desktop # Auto-register with your IDEs
Exposed MCP tools: gemstack_status, gemstack_route, gemstack_compile, gemstack_check, gemstack_diff, gemstack_run, gemstack_costs
๐งฉ Extensible Plugin System
Add custom topologies, roles, validation checks, or intercept compilation events with the stable pluggy-based plugin API (backward-compatible through the 1.x series):
from gemstack.plugins.hooks import hookimpl
class MobilePlugin:
@hookimpl
def gemstack_register_topologies(self):
return [{"name": "mobile", "description": "iOS/Android", "content": "..."}]
@hookimpl
def gemstack_post_init(self, project_root, profile):
(project_root / ".agent" / "MOBILE.md").write_text("# Mobile Context")
๐ Context Drift Detection
Catch when your codebase drifts from what's documented. Gemstack compares your actual dependencies, environment variables, and file references against your .agent/ context:
gemstack diff # Detect new deps, removed env vars, stale file refs
gemstack check # Validate .agent/ directory integrity
๐ 28 CLI Commands Across 7 Categories
| Category | Commands | Purpose |
|---|---|---|
| Setup | init, install, uninstall, doctor, config |
Project bootstrapping, CLI registration, environment validation |
| Workflow | status, route, start, phase, run |
Lifecycle management, autonomous execution |
| Context | compile, diff, export, snapshot, migrate |
Prompt compilation, drift detection, format exports |
| Analysis | check, compare, replay, matrix |
Validation, benchmarking, retrospectives, cross-project dashboards |
| Tooling | mcp, hook, worktree, ci, scaffold |
MCP server, git hooks, parallel worktrees, CI generation |
| ML/AI | prompt, eval |
Prompt template versioning, evaluation runner with holdout boundary |
| DX | tail, teach |
Live TUI dashboard, interactive tutorial |
Quickstart
# 1. Install (with AI bootstrapping + MCP server support)
pipx install "gemstack[ai,mcp]"
# 2. Initialize your project (AI auto-detects stack, topology, and commands)
cd your-project/
gemstack init --ai
# 3. See your current lifecycle state
gemstack status
# 4. Get the recommended next action
gemstack route
# 5. Start a new feature lifecycle
gemstack start "Add user search"
# 6. Execute Step 1 autonomously via Gemini
gemstack run step1-spec --feature "Add user search"
Alternative Install Methods
uv tool install "gemstack[all]" # uv (fastest)
pip install "gemstack[all]" # Standard pip
pipx install gemstack # Minimal (no AI, no MCP)
How It Works: The Context Compiler
The Context Compiler is the engine that makes Gemstack work. When you run a workflow step, it performs JIT (Just-In-Time) prompt assembly:
- Parses the workflow โ Extracts required roles and phases from the step definition
- Loads role definitions โ Bundles expert personas (Architect, SDET, Security Engineer, etc.)
- Loads phase instructions โ Attaches phase-specific behavioral rules (Ideate, Design, Build, etc.)
- Applies topology guardrails โ Detects your project topology from
ARCHITECTURE.mdand injects domain-specific constraints - Compiles
.agent/context โ Reads your project's architecture, style, testing, and status files - Includes relevant source files โ Pulls in files referenced in
STATUS.md - Fires plugin hooks โ Lets plugins modify sections before/after compilation
- Applies token budgeting โ Truncates lowest-priority sections first if you exceed your context window
gemstack compile step3-build # View the full compiled prompt
gemstack compile step3-build --max-tokens 100000 # With token limits
Compatibility
| Supported | |
|---|---|
| Python | 3.10, 3.11, 3.12, 3.13 |
| OS | macOS, Linux, Windows (WSL) |
| AI Backend | Google Gemini (via google-genai) |
| MCP Transport | stdio, SSE |
| Project Languages | TypeScript/JavaScript, Python, Go, Rust (auto-detected) |
| Package Managers | npm, pnpm, yarn, bun, pip, uv, poetry, cargo, go mod |
Documentation
| ๐ Getting Started | Installation, initialization, and your first workflow |
โ๏ธ The .agent/ Context System |
How the 5 context files drive AI behavior |
| ๐ The 5-Step Lifecycle | Spec โ Trap โ Build โ Audit โ Ship in depth |
| ๐ Topology-Aware Guardrails | Domain-specific guardrails for every project type |
| ๐ง The Context Compiler | How JIT prompt assembly works |
| ๐ค Autonomous Execution | Deep dive on gemstack run โ the autonomous executor |
| ๐ Drift Detection | Catch when code and docs get out of sync |
| ๐ MCP Server & IDE Integration | Connecting Gemstack to Cursor, Claude, and Cline |
| ๐งฉ Building Custom Plugins | Extending Gemstack with custom topologies, roles, and hooks |
| ๐ง Full CLI Reference | All 28 commands with usage and examples |
| ๐ ๏ธ Configuration & Integrations | Global config, API keys, and Gemini CLI integration |
| ๐ Example Walkthroughs | End-to-end lifecycle examples for 6 project types |
Project Links
| ๐ Changelog | ๐ค Contributing |
| ๐ Security Policy | ๐ Code of Conduct |
| ๐ Report a Bug | ๐ก Request a Feature |
| โ๏ธ License โ Apache 2.0 | ๐ Run gemstack teach for an interactive tutorial |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gemstack-1.1.2.tar.gz.
File metadata
- Download URL: gemstack-1.1.2.tar.gz
- Upload date:
- Size: 722.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99e189b75ea4db38fecb51316b58f54d6cfb7b30a623942ba189d53db4f4398f
|
|
| MD5 |
31bf90392627431c027e1ab67eba0bc2
|
|
| BLAKE2b-256 |
5c58bbae29a5a66b4409eeec87a5be670b772c47ed14cd1892bcfc8b8260898d
|
Provenance
The following attestation bundles were made for gemstack-1.1.2.tar.gz:
Publisher:
publish.yml on arvarik/gemstack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gemstack-1.1.2.tar.gz -
Subject digest:
99e189b75ea4db38fecb51316b58f54d6cfb7b30a623942ba189d53db4f4398f - Sigstore transparency entry: 1375773276
- Sigstore integration time:
-
Permalink:
arvarik/gemstack@a60864a1406d60c98e9944650905592acc881f6e -
Branch / Tag:
refs/tags/v1.1.2 - Owner: https://github.com/arvarik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a60864a1406d60c98e9944650905592acc881f6e -
Trigger Event:
push
-
Statement type:
File details
Details for the file gemstack-1.1.2-py3-none-any.whl.
File metadata
- Download URL: gemstack-1.1.2-py3-none-any.whl
- Upload date:
- Size: 222.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b5b9695373cf288b0d618e84e73c12dc9f0952802326cd2e1ef8e00787d272b
|
|
| MD5 |
09a324ea8ca415956aa0cbee2de0ccbb
|
|
| BLAKE2b-256 |
86e9e8c0b070e687471b4a9dc6fb38200ebac009fa9a7510bf97a18b94f20d64
|
Provenance
The following attestation bundles were made for gemstack-1.1.2-py3-none-any.whl:
Publisher:
publish.yml on arvarik/gemstack
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gemstack-1.1.2-py3-none-any.whl -
Subject digest:
5b5b9695373cf288b0d618e84e73c12dc9f0952802326cd2e1ef8e00787d272b - Sigstore transparency entry: 1375773337
- Sigstore integration time:
-
Permalink:
arvarik/gemstack@a60864a1406d60c98e9944650905592acc881f6e -
Branch / Tag:
refs/tags/v1.1.2 - Owner: https://github.com/arvarik
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a60864a1406d60c98e9944650905592acc881f6e -
Trigger Event:
push
-
Statement type: