Agent Skillsamaar-mc/wit › coordinate

coordinate

GitHub

用于多AI代理协作场景下的代码编辑协调,通过声明意图、获取语义锁及检查冲突来防止合并冲突。

skills/coordinate/SKILL.md amaar-mc/wit

Trigger Scenarios

多个AI代理同时编辑同一代码库 准备修改代码文件前

Install

npx skills add amaar-mc/wit --skill coordinate -g -y
More Options

Use without installing

npx skills use amaar-mc/wit@coordinate

指定 Agent (Claude Code)

npx skills add amaar-mc/wit --skill coordinate -a claude-code -g -y

安装 repo 全部 skill

npx skills add amaar-mc/wit --all -g -y

预览 repo 内 skill

npx skills add amaar-mc/wit --list

SKILL.md

Frontmatter
{
    "name": "coordinate",
    "description": "Coordinate with other AI agents before editing code. Declares intents, acquires semantic locks, and checks for conflicts to prevent merge conflicts in multi-agent workflows."
}

You are working in a repository where Wit may be used for multi-agent coordination. Other AI agents may be working on this codebase simultaneously. Follow this protocol to prevent merge conflicts.

On session start

  1. Check if Wit is initialized:
    test -d .wit && echo "wit:active" || echo "wit:inactive"
    
  2. If active: run wit status to see what other agents are doing.
  3. If inactive: check if the wit command exists:
    command -v wit >/dev/null 2>&1 && echo "wit:installed" || echo "wit:not-installed"
    
    • If installed but not initialized: run wit init to start coordination.
    • If not installed: skip all coordination. Wit is not available in this environment.

Before editing any file

  1. Declare your intent — announce what you plan to work on:

    wit declare --description "Brief description of planned work" --files src/path/to/file.ts
    

    Check the response for conflicts. If hasConflicts is true, read the conflict items — another agent may be working in the same area. Adjust your approach if needed.

  2. Lock specific symbols you plan to modify (functions, classes, types):

    wit lock --symbol "src/path/to/file.ts:functionName"
    

    If you get a LOCK_CONFLICT, another agent is actively editing that symbol. Work on a different part of the code instead.

  3. Check coordination state at any time:

    wit status
    

    This shows all active intents, locks, and contracts across all agents.

After finishing your work

  1. Release your locks:
    wit release --symbol "src/path/to/file.ts:functionName"
    

Rules

  • Always declare intent BEFORE editing files, not after.
  • Lock at the symbol level (function, class, type), not the file level.
  • If you receive a conflict warning, do NOT ignore it — adjust your plan to avoid the conflicting region.
  • If wit commands fail with connection errors, the daemon may not be running. Run wit init to restart it.
  • Locks auto-expire after 30 minutes. Release them early when you finish.
  • The --json flag on any command gives machine-readable output.

When to skip coordination entirely

  • If wit is not installed (command -v wit fails), skip all coordination silently.
  • For read-only operations (viewing files, running tests, reading docs), no coordination is needed.

Version History

  • ef5102c Current 2026-07-25 07:24

Metadata

Files
0
Version
ef5102c
Hash
c3f6c1bc
Indexed
2026-07-25 07:24

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-22 00:55
浙ICP备14020137号-1 $mapa de visitantes$