Skip to content

samuelpatro/.claude / .claude/skills/sync-claude

sync-claude

Verified

Sync the live ~/.claude global config (settings.json, CLAUDE.md, statusline.ts, own skills, skills.sh lock file) into this git backup repo, then commit. Allowlist-based so credentials, history, and project transcripts are never copied. Use when the user says "sync my claude config", "back up .claude", "update the .claude repo", or runs "/sync-claude".

FileKindSize
SKILL.mdskill md3.0 KB
install-skills.tsscript1.8 KB
sync.tsscript8.3 KB

install-skills.ts

View on GitHub
#!/usr/bin/env bun
/**
 * Reinstall the skills.sh-managed global skills recorded in
 * .agents/.skill-lock.json (the backup of ~/.agents/.skill-lock.json that
 * sync.ts keeps up to date). Those skills are never vendored in this repo; the
 * skills CLI installs them into ~/.agents/skills and symlinks them into
 * ~/.claude/skills, exactly as `npx skills add <source> -g` does.
 *
 *   bun install-skills.ts          # install everything from the lock
 *   bun install-skills.ts --list   # print the commands, run nothing
 */
import { readFileSync } from "fs";
import { join } from "path";
import { spawnSync } from "child_process";

// Repo root is three levels up (.claude/skills/sync-claude/install-skills.ts).
const LOCK = join(import.meta.dir, "..", "..", "..", ".agents", ".skill-lock.json");
const list = process.argv.includes("--list");

type Entry = { source: string; sourceType: string; sourceUrl?: string };
const lock = JSON.parse(readFileSync(LOCK, "utf8")) as { skills: Record<string, Entry> };

// One `skills add` per source repo, installing all of its skills at once.
const bySource = new Map<string, string[]>();
for (const [name, entry] of Object.entries(lock.skills)) {
  const source = entry.sourceType === "github" ? entry.source : (entry.sourceUrl ?? entry.source);
  bySource.set(source, [...(bySource.get(source) ?? []), name]);
}

let failed = 0;
for (const [source, names] of bySource) {
  const args = ["skills", "add", source, "-g", "-y", "-a", "claude-code", "-s", ...names.sort()];
  console.log(`bunx ${args.join(" ")}`);
  if (list) continue;
  const res = spawnSync("bunx", args, { stdio: "inherit" });
  if (res.status !== 0) {
    failed++;
    console.error(`failed: ${source}`);
  }
}

if (!list) console.log(`\n${bySource.size - failed}/${bySource.size} sources installed`);
if (failed) process.exit(1);
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: 323kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 323kUpdated 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: 323kUpdated Claude CodeCodexVerifiedInstall