Add real-time GitHub sync to installers and sync script
Interactive installer (interactive-install-claude.sh): - Add fetch_latest_agents() function to check GitHub for updates - Clone latest agents from contains-studio/agents before installing - Update local agents directory with upstream changes - Gracefully fallback to local agents if GitHub fetch fails - Call fetch_latest_agents() before install_agents() in main flow Sync script (sync-agents.sh): - Add REPO_AGENTS_DIR environment variable support - Automatically update repository agents directory when syncing - Keep installer agents in sync with Claude Code agents This ensures users always get the latest agents from upstream GitHub while maintaining customizations in the local repository.
This commit is contained in:
@@ -137,6 +137,25 @@ sync_agents() {
|
||||
# Summary
|
||||
local total_changes=$((${#new_agents[@]} + ${#updated_agents[@]}))
|
||||
log "INFO" "Sync complete: ${#new_agents[@]} new, ${#updated_agents[@]} updated, ${#custom_agents[@]} preserved"
|
||||
|
||||
# If REPO_AGENTS_DIR is set, also update repository agents
|
||||
if [[ -n "${REPO_AGENTS_DIR:-}" && -d "$REPO_AGENTS_DIR" ]]; then
|
||||
print_msg "$BLUE" "📦 Updating repository agents directory..."
|
||||
|
||||
for category in engineering marketing product studio-operations project-management testing design bonus; do
|
||||
if [ -d "$AGENTS_DIR/$category" ]; then
|
||||
mkdir -p "$REPO_AGENTS_DIR/$category"
|
||||
cp -f "$AGENTS_DIR/$category"/*.md "$REPO_AGENTS_DIR/$category/" 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -f "$AGENTS_DIR/README.md" ]; then
|
||||
cp -f "$AGENTS_DIR/README.md" "$REPO_AGENTS_DIR/README.md" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
print_msg "$GREEN" "✓ Repository agents updated"
|
||||
log "INFO" "Repository agents updated at $REPO_AGENTS_DIR"
|
||||
fi
|
||||
}
|
||||
|
||||
# Commit to git
|
||||
|
||||
Reference in New Issue
Block a user