Skip to content

donaldfilimon/abi / .agents/skills/sync-clis

sync-clis

Verified

Synchronize the explicitly cataloged portable skills and runtime-native task-agent and command adapters across Grok, Claude, Codex, OpenCode, ABI, shared agents, Cursor, Factory, CoreAI, and Gemini. Use for /sync-clis, cross-CLI skill drift, agent adapter drift, or OpenCode command repair.

FileKindSize
SKILL.mdskill md7.4 KB
launch.shexecutablescript3.3 KB
#!/usr/bin/env bash
# sync-clis: sync canonical skills from .agents/skills/ to in-repo CLI skill
# dirs. Idempotent. Copies SKILL.md plus references/ and examples/ when present.
# Does not copy .sh launchers. Distinct from ~/.grok/scripts/sync-clis.py.
#
# Usage:
#   .agents/skills/sync-clis/launch.sh              # sync all targets
#   .agents/skills/sync-clis/launch.sh --dry-run    # preview only
#
# Targets (if present): .claude/skills/, .grok/
set -euo pipefail

SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
REPO_ROOT=$(cd -- "$SCRIPT_DIR/../../.." && pwd)

DRY_RUN=0
for a in "$@"; do
    case "$a" in
        --dry-run) DRY_RUN=1 ;;
        --help) echo "Usage: $(basename "$0") [--dry-run]"; exit 0 ;;
        *) echo "unknown flag: $a" >&2; exit 2 ;;
    esac
done

CANONICAL="$REPO_ROOT/.agents/skills"
TARGETS=()
[ -d "$REPO_ROOT/.claude/skills" ] && TARGETS+=("$REPO_ROOT/.claude/skills")
[ -d "$REPO_ROOT/.grok" ]         && TARGETS+=("$REPO_ROOT/.grok")

say() { printf '\n=== %s ===\n' "$*"; }

# Print would-msg under --dry-run; otherwise run the command and print done-msg.
run_or_echo() {
    local would_msg="$1" done_msg="$2"
    shift 2
    if [ "$DRY_RUN" -eq 1 ]; then
        echo "  $would_msg"
    else
        "$@"
        echo "  $done_msg"
    fi
}

sync_skills() {
    local src="$1" dst="$2"
    local label="$3"

    # Skip universal skills listed below; sync the rest (create target dirs if missing).
    for skill_dir in "$src"/*/; do
        local skill_name
        skill_name=$(basename "$skill_dir")

        case "$skill_name" in
            abi-doc-claims-sync|abi-goal-orchestrator|check-work|code-review|create-skill|docx|help|imagine|pptx|sl|sync-clis|xlsx)
                continue
                ;;
        esac

        if [ ! -d "$dst/$skill_name" ]; then
            run_or_echo "would create: $label/$skill_name/" "created: $label/$skill_name/" \
                mkdir -p "$dst/$skill_name"
        fi

        # Sync SKILL.md (text content only, not the .sh scripts).
        # Rewrite "Base directory for this skill:" to the target path (not canonical).
        if [ -f "$src/$skill_name/SKILL.md" ]; then
            if [ "$DRY_RUN" -eq 1 ]; then
                echo "  would sync: $label/$skill_name/SKILL.md"
            else
                sed "s|^Base directory for this skill: .*\$|Base directory for this skill: $dst/$skill_name|" \
                    "$src/$skill_name/SKILL.md" > "$dst/$skill_name/SKILL.md"
                echo "  synced: $label/$skill_name/SKILL.md"
            fi
        fi
        # Companion docs skills may load; non-destructive (overwrite/add, no delete)
        for sub in references examples; do
            if [ -d "$src/$skill_name/$sub" ]; then
                if [ "$DRY_RUN" -eq 1 ]; then
                    echo "  would sync: $label/$skill_name/$sub/"
                else
                    mkdir -p "$dst/$skill_name/$sub"
                    cp -R "$src/$skill_name/$sub/." "$dst/$skill_name/$sub/"
                    echo "  synced: $label/$skill_name/$sub/"
                fi
            fi
        done
    done
}

say "sync-clis: canonical=$CANONICAL"
echo "targets: ${TARGETS[*]:-none}"
echo ""

for t in "${TARGETS[@]}"; do
    label=$(basename "$(dirname "$t")")
    sync_skills "$CANONICAL" "$t" "$label"
done

say "done"
echo "Synced canonical skills to ${#TARGETS[@]} target(s)."
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall