sync-gbrain

Synchronizes repository code with gbrain and refreshes agent search guidance in CLAUDE.md.

Updated Jun 22, 2026
One-click install
npx skills add https://github.com/aicodepro/ai-agent-nexi --skill sync-gbrain-aicodepro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sync-gbrain
Source: https://github.com/aicodepro/ai-agent-nexi/tree/main/agent/skills/gstack/sync-gbrain
Command: npx skills add https://github.com/aicodepro/ai-agent-nexi --skill sync-gbrain-aicodepro

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code search indexes and agent routing guidance drift out of date as a repository changes, causing semantic search tools like gbrain to miss symbols and agents to give stale answers. This Skill re-indexes the repo into gbrain and refreshes the search guidance section in CLAUDE.md so code lookup stays accurate. ## Core Features & Use Cases - GBrain Re-indexing: Wraps the gstack-gbrain-sync orchestrator to probe, register the native code surface, run capability checks, and emit a verdict block; the run is idempotent and re-runnable. - CLAUDE.md Guidance Refresh: Updates the GBrain Search Guidance section so agents know when to prefer gbrain search/query over Grep and when to use code-def, code-refs, and code-callers. - Session & Config Preamble: Detects session kind (interactive, headless, spawned, Conductor), handles telemetry/proactive/routing one-time prompts, and reports artifacts sync mode. - Use Case: After a large refactor, an agent's semantic search stops finding new functions. Invoke this Skill to re-index the worktree, pin it via .gbrain-source, and restore accurate symbol-aware code lookup. ## Quick Start Ask the agent to sync gbrain and re-index this repository so code search finds the latest changes.

Frequently Asked Questions about sync-gbrain

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I re-index a repository for gbrain semantic code search?

Invoke the sync-gbrain skill, which wraps the gstack-gbrain-sync orchestrator to probe the repo, register the native code surface, and refresh the index. The run is idempotent, so it is safe to re-run after large changes.

Why is gbrain search not finding new code in my repo?

The index is stale or the worktree is not pinned. Run sync-gbrain with the full option to re-index, and ensure a .gbrain-source pin exists at the git toplevel so queries are scoped to the current worktree.

When should I use gbrain search instead of Grep?

Use gbrain search and query for semantic questions about the codebase, and gbrain code-def, code-refs, and code-callers for symbol-aware lookup. Fall back to Grep for literal string matching or when the worktree is not yet indexed.

Does sync-gbrain work in headless or CI sessions?

Yes. The preamble detects the session kind (interactive, headless, spawned, or Conductor) and adapts: headless runs block instead of prompting, and spawned sessions auto-choose recommended options without interactive questions.

What are the limitations of the sync-gbrain skill?

It requires the gstack toolchain installed under the skills directory, a working gbrain CLI, and a git repository. In remote-MCP mode, local artifacts sync is a no-op because the brain server pulls from GitHub or GitLab on its own cadence.