Overview
The gk convert command bridges different AI provider ecosystems by translating agent definitions, skills, and configurations between formats. Whether you're migrating from Claude Code to GemKit, experimenting with dual-provider setups, or sharing agents across teams using different tools, this command handles the format translation automatically while preserving agent personality, instructions, and capabilities.
Supported Conversions
Provider Matrix
| Source Format | Target Format | Status | Notes |
|---|
| Claude agents (.claude/) | Gemini agents (.gemini/) | ā
Supported | Full translation |
| Claude skills | Gemini extensions | ā
Supported | Tool mapping included |
| Gemini agents | Claude agents | ā
Supported | Reverse conversion |
| Gemini extensions | Claude skills | ā
Supported | Reverse conversion |
| OpenAI Assistants | Gemini agents | š§ Planned | Coming soon |
| Custom JSON | Gemini agents | š§ Planned | Coming soon |
Basic Usage
Convert Claude Agent to Gemini
gk convert claude-agent <source-path> --output <destination-path>
Example:
gk convert claude-agent .claude/agents/code-reviewer --output .gemini/agents/
What it translates:
- Agent personality and role from Claude format to Gemini format
- System instructions and constraints
- Tool permissions and capabilities
- Model configuration (maps to equivalent Gemini models)
- Output format specifications
Convert Claude Skill to Gemini Extension
gk convert claude-skill <source-path> --output <destination-path>
Example:
gk convert claude-skill .claude/extensions/research --output .gemini/extensions/
Convert Gemini Agent to Claude
gk convert gemini-agent <source-path> --output <destination-path>
Example:
gk convert gemini-agent .gemini/agents/tester --output .claude/agents/
Options
--output / -o
Specify the destination directory for converted files.
gk convert claude-agent ./claude/agents/reviewer --output ./.gemini/agents/
Default behavior: If not specified, creates output in current directory.
--overwrite / --force
Replace existing files at the destination without prompting.
gk convert claude-agent .claude/agents/reviewer \
--output .gemini/agents/ \
--overwrite
Safety note: Use with caution. Without this flag, the command prompts for confirmation if files already exist.
--dry-run
Preview the conversion without writing any files.
gk convert claude-agent .claude/agents/reviewer \
--output .gemini/agents/ \
--dry-run
Output:
Dry Run - No files will be written
Source: .claude/agents/reviewer/CLAUDE.md
Target: .gemini/agents/reviewer/agent.md
Changes to be made:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā Translate frontmatter format
ā Convert system prompt structure
ā Map Claude tools to Gemini tools
ā Update model reference: claude-3-opus ā gemini-2.5-pro
ā Preserve agent personality and instructions
Files that would be created:
- .gemini/agents/reviewer/agent.md (2.1 KB)
- .gemini/agents/reviewer/config.json (456 bytes)
--map-model
Specify custom model mapping between providers.
gk convert claude-agent .claude/agents/reviewer \
--output .gemini/agents/ \
--map-model "claude-3-opus=gemini-2.5-pro"
Default mappings:
| Claude Model | Gemini Equivalent | Use Case |
|---|
| claude-3-haiku | gemini-2.0-flash | Fast, cost-effective |
| claude-3-sonnet | gemini-2.0-pro | Balanced performance |
| claude-3-opus | gemini-2.5-pro | Complex reasoning |
| claude-3.5-sonnet | gemini-2.0-pro | General use |
Keep comment blocks from source format in converted files.
gk convert claude-agent .claude/agents/reviewer \
--output .gemini/agents/ \
--preserve-comments
Useful for maintaining team documentation and context within agent definitions.
Practical Examples
Example 1: Complete Claude to Gemini Migration
cp -r .claude .claude.backup
for agent in .claude/agents/*; do
agent_name=$(basename "$agent")
gk convert claude-agent "$agent" --output .gemini/agents/
echo "ā Converted $agent_name"
done
for skill in .claude/extensions/*; do
skill_name=$(basename "$skill")
gk convert claude-skill "$skill" --output .gemini/extensions/
echo "ā Converted $skill_name"
done
gk agent list
gk agent spawn --agent code-reviewer --prompt "Review this code"
Example 2: Dual-Provider Setup (Claude + Gemini)
gk convert claude-agent .claude/agents/researcher \
--output .gemini/agents/
gk agent spawn --cli gemini --agent researcher --prompt "Research AI"
gk agent spawn --cli claude --agent researcher --prompt "Research AI"
Example 3: Sharing Agents Across Teams
gk convert gemini-agent .gemini/agents/api-designer \
--output ./shared/claude-agents/
tar -czf api-designer-agent.tar.gz ./shared/claude-agents/api-designer/
Example 4: Safe Conversion with Verification
gk convert claude-agent .claude/agents/security-reviewer \
--output .gemini/agents/ \
--dry-run
gk convert claude-agent .claude/agents/security-reviewer \
--output .gemini/agents/
gk agent info security-reviewer
gk agent spawn --agent security-reviewer --prompt "Review for vulnerabilities"
Example 5: Custom Model Mapping for Cost Optimization
gk convert claude-agent .claude/agents/code-executor \
--output .gemini/agents/ \
--map-model "claude-3-opus=gemini-2.0-pro"
gk tokens summary --model gemini-2.0-pro
Conversion Details
Agent Translation
Claude format (CLAUDE.md):
---
name: code-reviewer
model: claude-3-opus
---
# System
You are a code reviewer focused on quality and security.
# Instructions
- Review code for bugs and vulnerabilities
- Check for code style violations
- Suggest improvements
# Output Format
Provide reviews in markdown format with severity levels.
Converted Gemini format (agent.md):
---
name: code-reviewer
description: Code reviewer focused on quality and security
model: gemini-2.5-pro
---
# Role
You are a code reviewer focused on quality and security.
# Instructions
- Review code for bugs and vulnerabilities
- Check for code style violations
- Suggest improvements
# Output Format
Provide reviews in markdown format with severity levels.
Skill Translation
Claude skill format:
---
name: prisma-helper
description: Prisma ORM expertise
---
# Tools and Knowledge
## Database Schema Design
[content...]
## Query Optimization
[content...]
Converted Gemini extension format:
---
name: prisma-helper
description: Prisma ORM expertise
keywords: [prisma, database, orm, postgresql]
---
# Knowledge
## Database Schema Design
[content...]
## Query Optimization
[content...]
# Guidelines
[Converted from original instructions...]
GemKit automatically maps provider-specific tools:
| Claude Tool | Gemini Tool | Notes |
|---|
read_file | Read | File reading |
write_file | Write | File writing |
edit_file | Edit | File editing |
bash | Bash | Command execution |
search | Grep | Code search |
list_files | Glob | File listing |
web_search | WebSearch | Internet search |
Advanced Usage
Batch Conversion Script
#!/bin/bash
echo "Starting batch conversion from Claude to Gemini..."
mkdir -p .gemini/agents .gemini/extensions
echo "Converting agents..."
for agent in .claude/agents/*/; do
if [ -d "$agent" ]; then
agent_name=$(basename "$agent")
echo " Converting agent: $agent_name"
gk convert claude-agent "$agent" --output .gemini/agents/ --overwrite
fi
done
echo "Converting skills..."
for skill in .claude/extensions/*/; do
if [ -d "$skill" ]; then
skill_name=$(basename "$skill")
echo " Converting skill: $skill_name"
gk convert claude-skill "$skill" --output .gemini/extensions/ --overwrite
fi
done
echo "ā Batch conversion complete!"
echo "Verify with: gk agent list"
Conversion Validation Script
#!/bin/bash
echo "Validating converted agents..."
agents=$(gk agent list --json | jq -r '.[].name')
for agent in $agents; do
echo "Testing agent: $agent"
gk agent spawn --agent "$agent" \
--prompt "Introduce yourself briefly" \
> "validation-$agent.log" 2>&1
if [ $? -eq 0 ]; then
echo " ā $agent works correctly"
else
echo " ā $agent failed, check validation-$agent.log"
fi
done
echo "Validation complete!"
Migration Guide: Claude to GemKit
Full Migration Process
1. Preparation
cp -r .claude .claude.backup
tar -czf claude-backup-$(date +%Y%m%d).tar.gz .claude/
2. Conversion
gk init
gk convert claude-agent .claude/agents/ --output .gemini/agents/
gk convert claude-skill .claude/extensions/ --output .gemini/extensions/
3. Configuration Update
gk config set defaultAgent code-executor
gk config set defaultModel gemini-2.0-flash
4. Testing
gk agent list
gk agent spawn --agent researcher --prompt "Test prompt"
gk agent spawn --agent code-executor --prompt "Test prompt"
gk agent spawn --agent tester --prompt "Test prompt"
5. Workflow Migration
gk new plan feature-development
6. Cleanup (Optional)
Best Practices
- Always backup first - Create copies before converting
- Use dry-run - Preview conversions before committing
- Test thoroughly - Verify converted agents work as expected
- Customize models - Use
--map-model for cost optimization
- Version control - Commit conversions to track changes
- Document mappings - Keep notes on custom configurations
- Gradual migration - Convert and test one agent at a time
Troubleshooting
"Source agent not found"
- Verify the source path exists
- Check for correct directory structure (should contain CLAUDE.md or agent.md)
"Conversion failed: unsupported format"
- Ensure source files use standard Claude or Gemini format
- Check for syntax errors in source files
- Use
--preserve-comments if custom formatting exists
"Model mapping not found"
- Specify custom mapping with
--map-model
- Check supported model list in documentation
"Converted agent behaves differently"
- Review generated files manually
- Some provider-specific features may not translate perfectly
- Adjust prompt engineering for Gemini's style
- Consider dual-provider testing to compare