CommunityEscrita e Ediçãogithub.com

hibeekaey/agent-sync

Synchronize your AI coding agents' memory so you can stop in one agent and pick up in another

O que é agent-sync?

agent-sync is a Claude Code agent skill that synchronize your AI coding agents' memory so you can stop in one agent and pick up in another.

Funciona comClaude CodeCodex CLI~CursorGemini CLI
npx skills add hibeekaey/agent-sync

Installed? Explore more Escrita e Edição skills: steipete/notion, affaan-m/seo, affaan-m/brand-voice · View all 6 →

Perguntar na sua IA favorita

Abre um novo chat com esta habilidade de agente já pré-carregada.

Documentação

Coordinating work across coding agents

You are the coordinator: you own the task definition, review every deliverable, and decide what happens next. Every other agent is a worker: it receives a spec, produces an artifact, and stops. There is no cross-vendor message bus, so coordination is turn-based and file-mediated:

you write task.md -> worker runs headlessly -> worker writes result.md ->
you read, verify, decide the next turn

If agent-sync is installed, run agent sync before delegating so every worker starts with the same synthesized memory you have.

1. Write the task directory

task/
  task.md      # the spec (see contract below)
  ...inputs... # everything the worker needs; workers get no other context
  result.md    # the worker writes this; its existence signals completion

task.md is a contractor brief and must contain:

  • the goal, in one paragraph;
  • the exact deliverable (a file, named);
  • a checkable definition of done;
  • the instruction to stop after writing the deliverable;
  • the lock or worktree rules from section 2 when the worker will edit a shared tree.

2. Choose the sharing mode BEFORE invoking anyone

Rule zero: two agents must never mutate the same working tree at the same time.

SituationMode
Worker only reads (review, analysis, second opinion)Same dir, no lock
Alternating edits on one treeSame dir + mkdir lock
Parallel attempts or parallel file-touching subtasksOne git worktree per worker
Two agents editing one tree concurrentlyNever; restructure

Same-dir lock (mkdir is atomic; put these instructions in task.md too):

until mkdir .agent-lock 2>/dev/null; do sleep 1; done   # acquire
echo "$(whoami):$$" > .agent-lock/owner
# ... work ...
rm -rf .agent-lock                                       # release

Never auto-expire a lock by age: a slow worker looks identical to a dead one. Verify the worker process is dead before clearing a stale lock.

Worktree mode: git worktree add ../task-<worker> -b agent/<worker> per worker, workers never push and never touch each other's trees, the main checkout stays read-only, and you (the coordinator) do all merging as the one serialized step.

3. Invoke the worker headlessly

WorkerCommand
Claude Codeclaude -p "Read task.md in this directory and complete it."
Codex CLIcodex exec --skip-git-repo-check --sandbox workspace-write "Read task.md in this directory and complete it." </dev/null
Gemini CLIgemini -p "Read task.md in this directory and complete it."

Rules that were learned the hard way:

  • Run the worker from inside the task directory and scope its write access to it.
  • Close stdin (</dev/null) for any backgrounded worker or it may hang waiting for input.
  • Codex refuses untrusted non-git directories without --skip-git-repo-check.

4. Verify, then decide

  • The worker's word is not the deliverable. Read result.md and check it against the definition of done; for code, run the tests yourself.
  • A missing or wrong deliverable gets a new turn with a sharper spec, not a retry of the same one.
  • You stay responsible for everything you accept: review a worker's diff as you would a human contractor's PR.

Boundaries

  • Never give a worker credentials, deploy rights, or access to real audiences; workers produce artifacts, the coordinator (with the user) ships them.
  • Never run this protocol to parallelize edits inside one tree without locks or worktrees, even for "quick" tasks.
  • The user decides which agent plays coordinator; do not hand off coordination to a worker.

Habilidades Relacionadas

steipete/notion

Notion CLI/API for pages, Markdown content, data sources, files, comments, search, Workers, and raw API calls.

community

affaan-m/seo

Audit, plan, and implement SEO improvements across technical SEO, on-page optimization, structured data, Core Web Vitals, and content strategy. Use when the user wants better search visibility, SEO remediation, schema markup, sitemap/robots work, or keyword mapping.

community

affaan-m/brand-voice

Build a source-derived writing style profile from real posts, essays, launch notes, docs, or site copy, then reuse that profile across content, outreach, and social workflows. Use when the user wants voice consistency without generic AI writing tropes.

community

affaan-m/crosspost

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

community

affaan-m/x-api

X/Twitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.

community

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

community