by study8677
πͺ The ultimate starter kit for AI IDEs, Claude codeοΌcodex, and other agentic coding environments.
# Add to your Claude Code skills
git clone https://github.com/study8677/antigravity-workspace-templateag-refresh builds a knowledge base. ag-ask answers questions. Any LLM, any IDE.
Language: English | δΈζ | EspaΓ±ol
An AI Agent's capability ceiling = the quality of context it can read.
The engine is the core: ag-refresh deploys a multi-agent cluster that autonomously reads your code β each module gets its own Agent that generates a knowledge doc. ag-ask routes questions to the right Agent, grounded in real code with file paths and line numbers.
Instead of handing Claude Code / Codex a repo-wide grep and making it hunt on its own, give it a ChatGPT for your repository.
Tested on OpenClaw (12K files, 348K stars) with MiniMax2.7 β module Q&A scored 10/10, 111 modules self-learned in 43 minutes. See full eval below.
No comments yet. Be the first to share your thoughts!
Traditional approach: Antigravity approach:
CLAUDE.md = 5000 lines of docs Claude Code calls ask_project("how does auth work?")
Agent reads it all, forgets most Router β ModuleAgent reads actual source, returns exact answer
Hallucination rate stays high Grounded in real code, file paths, and git history
| Problem | Without Antigravity | With Antigravity |
|:--------|:-------------------|:-----------------|
| Agent forgets coding style | Repeats the same corrections | Reads .antigravity/conventions.md β gets it right the first time |
| Onboarding a new codebase | Agent guesses at architecture | ag-refresh β ModuleAgents self-learn each module |
| Switching between IDEs | Different rules everywhere | One .antigravity/ folder β every IDE reads it |
| Asking "how does X work?" | Agent reads random files | ask_project MCP β Router routes to the responsible ModuleAgent |
Architecture is files + a live Q&A engine, not plugins. Portable across any IDE, any LLM, zero vendor lock-in.
Option A β Engine: multi-agent Q&A on your codebase (recommended)
# 1. Install engine + CLI
pip install "git+https://github.com/study8677/antigravity-workspace-template.git#subdirectory=cli"
pip install "git+https://github.com/study8677/antigravity-workspace-template.git#subdirectory=engine"
# 2. Configure .env with any OpenAI-compatible API key
cd my-project
cat > .env <<EOF
OPENAI_BASE_URL=https://your-endpoint/v1
OPENAI_API_KEY=your-key
OPENAI_MODEL=your-model
AG_ASK_TIMEOUT_SECONDS=120
EOF
# 3. Build knowledge base (ModuleAgents self-learn each module)
ag-refresh --workspace .
# 4. Ask anything
ag-ask "How does auth work in this project?"
# 5. (Optional) Register as MCP server for Claude Code
claude mcp add antigravity ag-mcp -- --workspace $(pwd)
Option B β Context files only (any IDE, no LLM needed)
pip install git+https://github.com/study8677/antigravity-workspace-template.git#subdirectory=cli
ag init my-project && cd my-project
# IDE entry files bootstrap into AGENTS.md; dynamic knowledge is in .antigravity/
ag init Inject context files into any project (--force to overwrite)
β
βΌ
.antigravity/ Shared knowledge base β every IDE reads from here
β
ββββΊ ag-refresh Dynamic multi-agent self-learning β module knowledge docs + structure map
ββββΊ ag-ask Router β ModuleAgent Q&A with live code evidence
ββββΊ ag-mcp MCP server β Claude Code calls directly
Dynamic Multi-Agent Cluster β During ag-refresh, the engine uses smart functional grouping: files are grouped by import relationships (from the knowledge graph), directory co-location, and filename prefixes. Source code is pre-loaded directly into agent context (no tool calls needed), and build artifacts are automatically filtered out. Each sub-agent analyzes ~30K tokens of focused, functionally related code in a single LLM call and outputs structured JSON claims with source evidence (file paths + line ranges). A RegistryAgent then summarizes all modules into a semantic registry. During ag-ask, Router reads the registry to understand what each module is responsible for and routes questions to the right ModuleAgent β when structured facts are available, claims are verified against live source before answering. Powered by OpenAI Agent SDK + LiteLLM. Multi-language: Python, TypeScript/JavaScript, Go, Rust, Java, Kotlin, Swift, C/C++, C#.
GitAgent β A dedicated agent for analyzing git history β understands who changed what and why.
GitNexus Enhancement (optional) β Install GitNexus to auto-unlock semantic search, call graphs, and impact analysis for every ModuleAgent.
| Command | What it does | LLM needed? |
|:--------|:-------------|:-----------:|
| ag init <dir> | Inject cognitive architecture templates | No |
| ag init <dir> --force | Re-inject, overwriting existing files | No |
| ag refresh --workspace <dir> | CLI convenience wrapper around the knowledge-hub refresh pipeline | Yes |
| ag ask "question" --workspace <dir> | CLI convenience wrapper around the routed project Q&A flow | Yes |
| ag-refresh | Multi-agent self-learning of codebase, generates module knowledge docs + conventions.md + structure.md | Yes |
| ag-ask "question" | Router β ModuleAgent/GitAgent routed Q&A | Yes |
| ag-mcp --workspace <dir> | Start MCP server β exposes ask_project + refresh_project to Claude Code | Yes |
| ag report "message" | Log a finding to .antigravity/memory/ | No |
| ag log-decision "what" "why" | Log an architectural decision | No |
ag ask / ag refresh are available when both cli/ and engine/ are installed. ag-ask / ag-refresh are the engine-only entrypoints.
antigravity-workspace-template/
βββ cli/ # ag CLI β lightweight, pip-installable
β βββ templates/ # .cursorrules, CLAUDE.md, .antigravity/, ...
βββ engine/ # Multi-agent engine + Knowledge Hub
βββ antigravity_engine/
βββ _cli_entry.py # ag-ask / ag-refresh / ag-mcp + python -m dispatch
βββ config.py # Pydantic configuration
βββ hub/ # β
Core: multi-agent cluster
β βββ agents.py # Router + ModuleAgent + GitAgent
β βββ contracts.py # Pydantic models: claims, evidence, refresh status
β βββ ask_pipeline.py # structured-facts + legacy-swarm ask
β βββ refresh_pipeline.py # evidence-driven refresh orchestration
β βββ ask_tools.py
β βββ scanner.py # multi-language project scanning
β βββ module_grouping.py # smart functional file grouping
β βββ structure.py
β βββ knowledge_graph.py
β βββ retrieval_graph.py
β βββ mcp_server.py
βββ mcp_client.py # MCP consumer (connects external tools)
βββ memory.py # Persistent interaction memory
βββ tools/ # MCP query tools + extensions
βββ skills/ # Skill loader
βββ sandbox/ # Code execution (local / microsandbox)
CLI (pip install .../cli) β Zero LLM deps. Injects templates, logs reports & decisions offline.
Engine (pip install .../engine) β Multi-agent runtime. Powers ag-ask, ag-refresh, ag-mcp. Supports Gemini, OpenAI, Ollama, or any OpenAI-compatible API.
New skill packaging updates:
engine/antigravity_engine/skills/graph-retrieval/ β graph-oriented retrieval tools for structure and call-path reasoning.engine/antigravity_engine/skills/knowledge-layer/ β project knowledge-layer tools for semantic context consolidation.# Install both for full experience
pip install "git+https://...#subdirectory=cli"
pip install "git+https://...#subdirectory=engine"
For local work on this repository itself:
python3 -m venv venv
source venv/bin/activate
pip install -e ./cli -e './engine[dev]'
pytest engine/tests cli/tests
ag init β Inject context filesag init my-project
# Already initialized? Use --force to overwrite:
ag init my-project --force
Creates AGENTS.md (authoritative behavior rules), IDE bootstrap files (.cursorrules,