gemini-workspace-bridge
Central authority for Claude-Gemini shared workspace architecture. Defines directory structure, artifact exchange, and file naming conventions. Use when setting up dual-CLI workflows, deciding where to store AI artifacts, or managing cross-CLI file exchange.
What this skill does
# Gemini Workspace Bridge
## Documentation Delegation
> **Documentation Source:** For authoritative workspace patterns and current conventions, query `gemini-cli-docs` skill.
> This skill provides integration guidance; `gemini-cli-docs` provides official Gemini CLI documentation.
## Overview
This skill defines the hybrid workspace architecture for Claude Code and Gemini CLI collaboration. It establishes conventions for file storage, artifact exchange, and cross-CLI communication.
## When to Use This Skill
**Keywords:** workspace structure, artifact storage, cross-cli, shared files, gemini artifacts, claude artifacts, file locations, where to store
**Use this skill when:**
- Setting up a project for dual-CLI workflow
- Deciding where to store AI-generated artifacts
- Understanding the hybrid tracked/gitignored strategy
- Managing cross-CLI file exchange
## Core Architecture
### Hybrid Approach
The workspace uses a **hybrid strategy**:
- **Tracked files**: Memory files, valuable artifacts (plans, reports)
- **Gitignored temp**: Session state, caches, transient outputs
### Directory Structure
```text
project-root/
├── CLAUDE.md # Source of truth (tracked)
├── GEMINI.md # Points to CLAUDE.md + overrides (tracked)
│
├── .claude/
│ ├── settings.json # Claude Code configuration
│ └── temp/ # (gitignored) Session artifacts
│ └── gemini-results/ # Parsed Gemini outputs
│
├── .gemini/
│ ├── settings.json # Gemini CLI configuration
│ └── temp/ # (gitignored) Gemini session state
│
└── docs/ # (tracked) Persistent AI artifacts
└── ai-artifacts/ # Version-controlled reports
├── explorations/ # Codebase exploration reports
└── plans/ # Implementation plans
```
## Artifact Location Guide
### Decision Tree
```text
Is this artifact valuable long-term?
├── YES: Should others see it in git history?
│ ├── YES → docs/ai-artifacts/
│ └── NO → .claude/temp/ or .gemini/temp/
└── NO: Is it session-specific?
├── YES → .claude/temp/ or .gemini/temp/
└── NO → Consider not storing it
```
### Location Matrix
| Artifact Type | Location | Tracked? | Rationale |
| --- | --- | --- | --- |
| Memory/context | `CLAUDE.md`, `GEMINI.md` | Yes | Core project knowledge |
| Implementation plans | `docs/ai-artifacts/plans/` | Yes | Want to see evolution |
| Exploration reports | `docs/ai-artifacts/explorations/` | Yes | Reference material |
| Session results | `.claude/temp/gemini-results/` | No | Transient |
| Second opinions | `.claude/temp/gemini-results/` | No | Transient |
| Checkpoints | `~/.gemini/history/<hash>/` | No | System-managed |
| Sync state | `.claude/temp/sync-state.json` | No | Internal tracking |
## Gitignore Recommendations
Add to project `.gitignore`:
```gitignore
# AI session artifacts (transient)
.claude/temp/
.gemini/temp/
# System-managed
.gemini/history/
# Keep these tracked:
# CLAUDE.md
# GEMINI.md
# docs/ai-artifacts/
```
## File Naming Conventions
### Timestamped Artifacts
Format: `{type}-{scope}-{timestamp}.md`
```bash
# Exploration reports
exploration-architecture-2025-11-30T12-00-00Z.md
exploration-dependencies-2025-11-30T14-30-00Z.md
# Implementation plans
plan-add-auth-2025-11-30T12-00-00Z.md
plan-refactor-db-2025-11-30T14-30-00Z.md
```
### Session Results
Format: `{operation}-{timestamp}.{json|md}`
```bash
# Raw Gemini results
query-2025-11-30T12-00-00Z.json
analysis-2025-11-30T12-00-00Z.json
# Processed results
analysis-summary-2025-11-30T12-00-00Z.md
```
## Workspace Initialization
### Initialize for Dual-CLI
```bash
# Create directory structure
mkdir -p .claude/temp/gemini-results
mkdir -p .gemini/temp
mkdir -p docs/ai-artifacts/explorations
mkdir -p docs/ai-artifacts/plans
# Create GEMINI.md if not exists
if [ ! -f "GEMINI.md" ]; then
cat > GEMINI.md << 'EOF'
# GEMINI.md
@CLAUDE.md
## Gemini-Specific Overrides
You are Gemini CLI. You have access to:
- Large context window (exceeds typical LLM limits)
- Interactive PTY shell (vim, git rebase -i)
- Checkpointing with instant rollback
- Policy engine for tool control
When working with this codebase, prioritize bulk analysis
and exploration tasks that benefit from your large context.
EOF
fi
# Update .gitignore
grep -q ".claude/temp/" .gitignore 2>/dev/null || echo ".claude/temp/" >> .gitignore
grep -q ".gemini/temp/" .gitignore 2>/dev/null || echo ".gemini/temp/" >> .gitignore
```
## Artifact Exchange Patterns
### Pattern 1: Claude → Gemini (Context Handoff)
```bash
# Claude prepares context
cat CLAUDE.md relevant-files/* > .claude/temp/context-bundle.txt
# Gemini consumes
cat .claude/temp/context-bundle.txt | gemini "Analyze this context"
```
### Pattern 2: Gemini → Claude (Result Consumption)
```bash
# Gemini produces result
gemini "Explore architecture" --output-format json > .claude/temp/gemini-results/exploration.json
# Claude parses result
cat .claude/temp/gemini-results/exploration.json | jq -r '.response'
```
### Pattern 3: Persistent Artifacts
```bash
# For valuable artifacts that should be tracked
result=$(gemini "Create implementation plan" --output-format json)
echo "$result" | jq -r '.response' > docs/ai-artifacts/plans/plan-feature-$(date -u +%Y-%m-%dT%H-%M-%SZ).md
```
## Cleanup Strategies
### Automatic Cleanup (Session-based)
```bash
# Clean artifacts older than 7 days
find .claude/temp/gemini-results -type f -mtime +7 -delete
find .gemini/temp -type f -mtime +7 -delete
```
### Manual Cleanup
```bash
# Clear all session artifacts
rm -rf .claude/temp/*
rm -rf .gemini/temp/*
```
### Selective Cleanup
```bash
# Keep recent, delete old
find .claude/temp/gemini-results -name "*.json" -mtime +3 -delete
```
## Best Practices
### 1. Single Source of Truth
- `CLAUDE.md` is the authoritative memory file
- `GEMINI.md` imports from `CLAUDE.md` and adds overrides
- Don't duplicate information
### 2. Artifact Lifecycle
- Start in temp directories
- Promote valuable artifacts to `docs/ai-artifacts/`
- Clean up regularly
### 3. Clear Naming
- Use descriptive prefixes (exploration-, plan-, analysis-)
- Include timestamps for ordering
- Use ISO 8601 format (sortable)
### 4. Gitignore Discipline
- Temp directories should always be gitignored
- Memory files should always be tracked
- `docs/ai-artifacts/` should be tracked
## Related Skills
- `gemini-memory-sync` - CLAUDE.md ↔ GEMINI.md synchronization
- `gemini-exploration-patterns` - Exploration output standards
- `gemini-context-bridge` - Legacy context sharing patterns
## Related Commands
- `/sync-context` - Synchronize memory files
- `/gemini-explore` - Generates exploration reports
- `/gemini-plan` - Generates implementation plans
## Test Scenarios
### Scenario 1: Workspace Setup
**Query**: "How do I set up a project for Claude and Gemini collaboration?"
**Expected Behavior**:
- Skill activates on "workspace structure" or "cross-cli"
- Provides directory structure and initialization script
**Success Criteria**: User receives complete workspace setup workflow
### Scenario 2: Artifact Location
**Query**: "Where should I store Gemini exploration results?"
**Expected Behavior**:
- Skill activates on "artifact storage" or "where to store"
- Provides location matrix (tracked vs gitignored)
**Success Criteria**: User receives clear guidance on temp vs persistent storage
### Scenario 3: Cross-CLI Exchange
**Query**: "How do I pass context from Claude to Gemini?"
**Expected Behavior**:
- Skill activates on "artifact exchange" or "shared files"
- Provides context handoff pattern
**Success Criteria**: User receives file-based exchange workflow
## Version History
- v1.1.0 (2025-12-01): Added MANDATORY section, Test Scenarios, Version History
- v1.0.0 (2025-11-25): Initial release
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.