Syncs project configuration (skills, instructions, hooks) between Claude Code, Kimi CLI, and Codex CLI. Detects installed tools, shows current state, and offers selective sync actions.
Sync project configuration between Claude Code, Kimi CLI, and Codex CLI.
Run this after /initialize-project or anytime you want to ensure all installed AI CLI tools have matching skills, project instructions, and hooks.
BOOTSTRAP_DIR=$(cat ~/.claude/.bootstrap-dir 2>/dev/null)
if [ -z "$BOOTSTRAP_DIR" ]; then
echo "Error: Maggy not installed. Run install.sh first."
exit 1
fi
DETECTED=$("$BOOTSTRAP_DIR/scripts/detect-agents.sh" 2>/dev/null || echo "claude")
echo "Detected AI CLI tools: $DETECTED"
Check what exists for each tool and present a status table:
echo "=== Current State ==="
# Claude
echo "Claude Code:"
[ -d ".claude/skills" ] && echo " Skills: .claude/skills/ ($(ls -d .claude/skills/*/ 2>/dev/null | wc -l | tr -d ' ') skills)" || echo " Skills: NOT SET UP"
[ -f "CLAUDE.md" ] && echo " Instructions: CLAUDE.md" || echo " Instructions: NOT SET UP"
[ -f ".claude/settings.json" ] && echo " Hooks: .claude/settings.json" || echo " Hooks: NOT SET UP"
# Kimi
echo "Kimi CLI:"
[ -d ".kimi/skills" ] && echo " Skills: .kimi/skills/ ($(ls -d .kimi/skills/*/ 2>/dev/null | wc -l | tr -d ' ') skills)" || echo " Skills: NOT SET UP"
echo " Instructions: (Kimi uses skills directly, no project file needed)"
[ -f ".kimi/config.toml" ] && echo " Hooks: .kimi/config.toml" || echo " Hooks: NOT SET UP"
# Codex
echo "Codex CLI:"
[ -d ".codex/skills" ] && echo " Skills: .codex/skills/ ($(ls -d .codex/skills/*/ 2>/dev/null | wc -l | tr -d ' ') skills)" || echo " Skills: NOT SET UP"
[ -f "AGENTS.md" ] && echo " Instructions: AGENTS.md" || echo " Instructions: NOT SET UP"
[ -f ".codex/config.toml" ] && echo " Hooks: .codex/config.toml" || echo " Hooks: NOT SET UP"
Present the status table to the user, then ask what they want to do.
Ask the user which actions to perform:
Current state shown above. What would you like to sync?
- Sync all - Copy skills + generate instructions + hooks for all detected tools
- Skills only - Copy .claude/skills/ to .kimi/skills/ and .codex/skills/
- Generate AGENTS.md - Create Codex project instructions from CLAUDE.md
- Generate config.toml - Create Kimi/Codex hooks from settings.json
- Show diff - Show what differs between tool configs
# Source of truth is .claude/skills/
if [ -d ".claude/skills" ]; then
# Sync to Kimi
if echo "$DETECTED" | grep -q "kimi"; then
rm -rf .kimi/skills
mkdir -p .kimi/skills
cp -r .claude/skills/*/ .kimi/skills/ 2>/dev/null || true
echo "Synced skills to .kimi/skills/"
fi
# Sync to Codex
if echo "$DETECTED" | grep -q "codex"; then
rm -rf .codex/skills
mkdir -p .codex/skills
cp -r .claude/skills/*/ .codex/skills/ 2>/dev/null || true
echo "Synced skills to .codex/skills/"
fi
# Sync to generic .agents/ (works for any tool)
rm -rf .agents/skills
mkdir -p .agents/skills
cp -r .claude/skills/*/ .agents/skills/ 2>/dev/null || true
echo "Synced skills to .agents/skills/ (generic)"
else
echo "No .claude/skills/ found. Run /initialize-project first."
fi
If CLAUDE.md exists, generate AGENTS.md by:
.claude/skills/ paths with .agents/skills/ pathsImportant: AGENTS.md should reference .agents/skills/ (generic path) since Codex reads from .codex/skills/ and .agents/skills/. The .agents/skills/ path is the cross-compatible choice.
If CLAUDE.md does not exist, copy from the bootstrap template:
cp "$BOOTSTRAP_DIR/templates/AGENTS.md" ./AGENTS.md
echo "Created AGENTS.md from template (customize for your project)"
# For Kimi
if echo "$DETECTED" | grep -q "kimi"; then
mkdir -p .kimi
cp "$BOOTSTRAP_DIR/templates/config.toml" .kimi/config.toml
echo "Created .kimi/config.toml with hooks"
fi
# For Codex
if echo "$DETECTED" | grep -q "codex"; then
mkdir -p .codex
cp "$BOOTSTRAP_DIR/templates/config.toml" .codex/config.toml
echo "Created .codex/config.toml with hooks"
fi
Sync complete!
Skills synced:
.claude/skills/ -> .kimi/skills/ (N skills)
.claude/skills/ -> .codex/skills/ (N skills)
.claude/skills/ -> .agents/skills/ (N skills, generic)
Project instructions:
CLAUDE.md (Claude Code)
AGENTS.md (Codex CLI)
Hooks config:
.claude/settings.json (Claude Code)
.kimi/config.toml (Kimi CLI)
.codex/config.toml (Codex CLI)
You can now run any of these in this project:
claude # Claude Code
kimi # Kimi CLI
codex # Codex CLI
Ensure cross-tool directories are properly handled in .gitignore:
# Add to .gitignore if not present
for entry in ".kimi/" ".codex/" ".agents/"; do
if ! grep -qF "$entry" .gitignore 2>/dev/null; then
echo "$entry" >> .gitignore
fi
done
Note: Unlike .claude/ which is typically committed, .kimi/ and .codex/ project dirs should generally be gitignored since they're derived from .claude/skills/. The /sync-agents command regenerates them.
AGENTS.md should be committed (it's the Codex equivalent of CLAUDE.md).
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
/alinaqi-claude-bootstrap:sync-agentsfrom alinaqi-claude-bootstrap
Claude never picks this command on its own
Its frontmatter has no description. Without a description, Claude Code leaves it out of the list Claude chooses from. Typing /alinaqi-claude-bootstrap:sync-agents still runs it.
alinaqi-claude-bootstrap@cascade-code-languages-misc-2 is listed by joshuarweaver/cascade-code-languages-misc-2 — review the source before installing
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-2 --plugin alinaqi-claude-bootstrap25 commands in this plugin
/analyze-repoAnalyze RepositoryAnalyze an existing repository's structure, conventions, and guardrails./analyze-workspace/analyze-workspace> Full dynamic analysis of workspace topology, dependencies, and contracts./build-in-publicBuild-in-Public CommandsBuild-in-Public — generate posts from your engineering work, anonymize, and schedule via Buffer/check-contributorsCheck ContributorsChecks who's working on the project and optionally converts to a multi-person project with team state management./icpg-bootstrap/icpg-bootstrap — Bootstrap from Git HistoryInfer ReasonNodes from existing git commit history. One-time setup for existing codebases./icpg-drift/icpg-drift — Show All DriftRun a full drift scan and display all unresolved drift events, grouped by dimension and sorted by severity.Other plugins' commands for the same job