agentleFS
conorbronsdonconorbronsdon/agent-workspace/skills/reconcile/SKILL.md

reconcile

Skill2 starsChanged 5 months agoMITView on GitHub

Tripwire check for multi-session drift. Scans state files, recent commits, and file conflicts caused by parallel agent sessions. Run after parallel work or when something feels off.

11 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 11 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When multiple agent sessions run in parallel (especially with worktrees), files drift out of sync.

    line 8
  2. Very specific:

    Read the optional workspace.yaml at the project root for where state lives.

    line 16
  3. Distinctive:

    After merging worktree branches back to the default branch

    line 22
  4. Distinctive:

    When something "feels off" after parallel work

    line 23
  5. Distinctive:

    After a crash where multiple sessions were open

    line 24
  6. Distinctive:

    If the project has single-source-of-truth rules (facts that should live in exactly one file):

    line 77
  7. Distinctive:

    Check that cross-references point to files that still exist

    line 83
  8. Distinctive:

    Remove duplicate entries (keep the more detailed one)

    line 112
  9. Distinctive:

    Update timestamps to match actual last-edit dates

    line 113
  10. Distinctive:

    Prefer evidence of intent over recency: When two versions conflict, look at which change the surrounding work depends on (commit messages, …

    line 119
  11. Distinctive:

    Use recency only as a tie-breaker when intent is unreadable.

    line 122
  12. Distinctive:

    Preserve intent: Don't auto-resolve — different sessions may have had different goals.

    line 123

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/reconcile — Multi-Session Drift Check

When multiple agent sessions run in parallel (especially with worktrees), files drift out of sync. This skill scans for inconsistencies and proposes fixes.

Invocation: deliberately model-invocable — the scan is read-only and auto-triggering on a drift smell is the point. Anything that changes files is proposed, never applied.

Configuration

Read the optional workspace.yaml at the project root for where state lives. Below, <state_dir> and <task_file> are its resolved values; defaults are state/ and TODO.md. Full reference: docs/state-model.md.

When to Use

  • After merging worktree branches back to the default branch
  • When something "feels off" after parallel work
  • After a crash where multiple sessions were open
  • As a periodic sanity check during heavy parallel workflows

Instructions

0. Detect the default branch

git rev-parse --git-dir >/dev/null 2>&1 || { echo "not a git repository — nothing to reconcile"; exit 0; }
DEFAULT=$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|^origin/||')
DEFAULT=${DEFAULT:-$(git remote show origin 2>/dev/null | sed -n 's/.*HEAD branch: //p')}
DEFAULT=${DEFAULT:-main}   # no remote configured — fall back and say so in the report

1. Scan recent commit history across all branches

git log --all --oneline --since="24 hours ago" --graph

Look for:

  • Multiple branches touching the same files
  • Commits on branches that haven't been merged
  • Conflicting changes (same file modified differently on different branches)

2. Check for file-level conflicts

For each file modified on multiple branches, diff the versions:

git diff "$DEFAULT"..<branch> -- <file>

Flag files where:

  • Both branches modified the same lines (merge conflict risk)
  • One branch deleted what another modified
  • Timestamps or "Last Updated" fields diverged

3. Check state file consistency

For the project's state files under <state_dir> (priorities, decision log, session logs) and any task file (<task_file>), check:

  • Duplicate entries: same task or decision logged twice from different sessions
  • Contradictory state: one session marked something complete, another added it as in-progress
  • Timestamp drift: Last Updated dates that don't match the most recent actual edit (see the chain protocol in docs/state-model.md — a stacked or spliced Last Updated line is itself a drift signal)
  • Orphaned references: sections referencing things removed in another session

4. Check for SSOT violations

If the project has single-source-of-truth rules (facts that should live in exactly one file):

  • Scan for duplicated facts across files
  • Flag any case where the same information appears in multiple locations with different values
  • Check that cross-references point to files that still exist

5. Report

RECONCILE — [DATE]

BRANCHES CHECKED:
- [branch list with last commit date]

FILE CONFLICTS:
- [file] — modified on [branch1] and [branch2] — [conflict type]

STATE DRIFT:
- [issue description]

SSOT VIOLATIONS:
- [duplicated fact] — found in [file1] and [file2]

PROPOSED FIXES:
1. [fix description]

OVERALL: [CLEAN / N issues found]

6. Apply fixes (with approval only)

Present each fix individually. Wait for approval before applying. Common fixes:

  • Merge the newer version of a conflicting file
  • Remove duplicate entries (keep the more detailed one)
  • Update timestamps to match actual last-edit dates
  • Resolve SSOT violations by keeping the canonical source and updating references

Design Principles

  • Read-only by default. Report, wait for approval.
  • Prefer evidence of intent over recency. When two versions conflict, look at which change the surrounding work depends on (commit messages, linked edits, whether other files reference the new value). A stale session can easily produce the newer timestamp. Use recency only as a tie-breaker when intent is unreadable.
  • Preserve intent. Don't auto-resolve — different sessions may have had different goals.
  • Fast. Git commands and file reads only. Under 30 seconds for a full scan.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.