Repository navigation
Conversation
…d pending queue
Implement [AGY1]: auto-detect Antigravity camelCase hook payloads in entity.HookInput, chdir to workspacePaths[0] and reset rc before state.Initialized(), emit Antigravity JSON protocol responses (injectSteps, decision allow/deny, {}), and bridge PreToolUse/PostToolUse nudges into .context/state/agy-pending-<sessionID>.txt for flushing on PostInvocation/PreInvocation.
Spec: specs/agy-integration.md
Signed-off-by: Ersan Bilik <ersanbilik@gmail.com>
Implement [AGY2]: ship embedded native Antigravity plugin at internal/assets/agy (plugin.json, hooks.json, mcp_config.json, rules/AGENTS.md, assets/logo.svg, and 50 ctx-* skills), add hack/sync-agy-skills.sh with 24,000-byte SKILL.md body splitting into references/details.md, and enforce hook/skill parity tests. Spec: specs/agy-integration.md Signed-off-by: Ersan Bilik <ersanbilik@gmail.com>
Implement [AGY3]: add ctx setup agy [--write] (alias antigravity) deploying .agents/hooks.json, ~/.gemini/config/mcp_config.json, AGENTS.md, and .agents/skills/ with global ctx@local-plugins short-circuit detection, register agy in steering.SyncTool (ConsumesDirectly), and document Antigravity setup and integration. Spec: specs/agy-integration.md Signed-off-by: Ersan Bilik <ersanbilik@gmail.com>
…anner Implement [AGY4]: add Agy session parser in internal/journal/parser/agy.go reading ~/.gemini/antigravity-cli/brain/<id>/.system_generated/logs/transcript.jsonl and resolving session CWD via history.jsonl, and extend ScanTranscriptForTokens to sum input_tokens + cache_read_tokens on PLANNER_RESPONSE steps. Spec: specs/agy-integration.md Signed-off-by: Ersan Bilik <ersanbilik@gmail.com>
bilersan
requested review from
CoderMungan,
hamzaerbay,
josealekhine and
parlakisik
as code owners
November 7, 2026 00:30
…g.json When agy plugin disable ctx is executed, Antigravity records plugins.ctx.enabled=false in ~/.gemini/config/config.json while keeping plugins/ctx/plugin.json on disk. Check config.json in PluginEnabled so Detect() accurately transitions to StatePluginInstalledNotEnabled. Spec: specs/agy-integration.md Signed-off-by: Ersan Bilik <ersanbilik@gmail.com>
…sign findings Check deferred file.Close() returns in hook tests, reuse claude.FieldInputTokens in session_token.go to avoid gosec G101 false positive, avoid err variable shadowing in agy_test.go and deploy_test.go, drop unused id assignment in parser/agy_test.go, and deduplicate pending nudges in DrainPendingAgy. Spec: specs/agy-integration.md Signed-off-by: Ersan Bilik <ersanbilik@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #204
Adds first-class Google Antigravity (
agyCLI and Antigravity IDE) integration toctxas a peer to Claude Code, Codex, OpenCode, and Pi across four cohesive layers (AGY1–AGY4):Unified Hook Protocol in
ctx system([AGY1]):camelCasestdin hook payloads (conversationId,workspacePaths,transcriptPath,modelName,lastUserInput,toolCall,error) inentity.HookInputwhile preserving 100% backward compatibility with Claude Code (snake_case).workspacePaths[0](includingfile://URIs) and executesos.Chdir(ws)+rc.Reset()insession.ReadInputbeforestate.Initialized()orrc.RC()runs so global/plugin hooks locate the workspace's.context/and.ctxrc.{"decision":"allow"|"deny"},{"injectSteps":[...]},{}).PreToolUse/PostToolUsenudges (qa-reminder,specs-nudge,post-commit,check-task-completion) into.context/state/agy-pending-<sessionID>.txtviaQueuePendingAgyand flushes them as{"injectSteps":[...]}on the nextPostInvocation(heartbeat) orPreInvocation(check-context-size) viaFlushAgySteps.ScanTranscriptForTokensto suminput_tokens + cache_read_tokensonPLANNER_RESPONSElines when scanning Antigravitytranscript.jsonlfiles.Embedded Antigravity Plugin Root & Skill Sync (
[AGY2]):internal/assets/agy/(plugin.json,hooks.json,mcp_config.json,rules/AGENTS.md,assets/logo.svg, and 50skills/ctx-*/SKILL.md) embedded into thectxbinary.hack/sync-agy-skills.shandmake sync-agy-skillsto mirrorinternal/assets/claude/skills/and automatically split anySKILL.mdbody exceeding Antigravity's 24,000-byte limit (ctx-kb-ingest,ctx-architecture) intoSKILL.md+references/details.md.agy plugin validate internal/assets/agy --strict --json("findings": []).Project-Local Setup Deployer (
ctx setup agy [--write]) ([AGY3]):internal/agy/(Detect,PluginEnabled,MergeHooks,MergeMCP,SyncSkills) andinternal/cli/setup/core/agy/(Deploy,Preview)..agents/hooks.json,~/.gemini/config/mcp_config.json,AGENTS.md, and.agents/skills/, and short-circuits project-local hook/skill deployment when the globalctx@local-pluginsplugin is enabled in~/.gemini/antigravity-cli/settings.jsonto prevent duplicate hook execution.agyinsteering.SyncTool(ConsumesDirectlypolite skip forAGENTS.md),.ctxrcJSON schema, and CLI documentation (docs/cli/setup.md,docs/operations/integrations.md).Session Transcript Parser (
ctx journal import) ([AGY4]):internal/journal/parser/agy.go(AgyimplementingSession) and registers~/.gemini/antigravity-cli/braininDefaultSessionDirs().transcript.jsonl(USER_INPUTandPLANNER_RESPONSEsteps, stripping<USER_REQUEST>,<ADDITIONAL_METADATA>, and<SYSTEM_MESSAGE>wrappers, extracting thinking, tool calls, and token usage) while skippingtranscript_full.jsonlduplicates.CWDvia~/.gemini/antigravity-cli/history.jsonland documents Antigravity indocs/cli/journal.md.Verification
agy plugin validate internal/assets/agy --strict --json->"findings": [](50 skills, 1 hook config, 1 MCP server, 1 rule)go test ./internal/agy/... ./internal/cli/setup/core/agy/... ./internal/cli/system/... ./internal/assets ./internal/assets/read/skill/... ./internal/journal/parser/... ./internal/steering/... ./internal/entity/... ./internal/write/setup/... ./internal/compliance -run "TestShippedHooks|TestEveryDocPage|TestAgy"go test ./internal/audit -run "TestNoMixedVisibility|TestNoMagicStrings|TestNoDeadExports|TestDescKeyYAMLLinkage|TestTypeFileConvention|TestDocComments"