---
name: commit-dag-collaboration
description: >-
  Manages a Directed Acyclic Graph (DAG) of experiment commits for multi-agent collaboration, replacing human-centric version control (main branches, pull requests, merge queues) with a search graph agents traverse directly. Every commit is a node carrying its parent state, the agent that created it, a hypothesis, a code diff, an evaluation metric, and environment info. Agents query the graph for children, leaves (the unexplored frontier), lineage (ancestry to root), and diffs between any two nodes — and preferentially branch new experiments off already-successful lineages, bounded by an explicit anti-herding rule so exploration doesn't collapse onto a single winner. Use this whenever the user wants agents to collaborate asynchronously without a shared context window, needs multiple experiment lineages to stay alive instead of forcing everything into one branch, wants to track which agent tried what and why, or is designing a swarm/loop hybrid where results need to be branchable rather than strictly sequential. Trigger on phrases like "manage experiment lineage," "let agents branch off each other's work," "track which experiments came from where," "build a DAG of agent commits," "GitHub for agents," or "avoid forcing every result into one branch." The natural companion to ratchet-loop (one lineage, sequential — a single path through this DAG), swarm-orchestration (many workers, one shot — this DAG is where their results can live and branch afterward), and knowledge-graph-memory (the DAG tracks work lineage; the knowledge graph tracks domain knowledge — keep them separate, cross-link them).
title: commit-dag-collaboration
canonical_url: https://skilld.dev/gh/mb1810/bergerskills/commit-dag-collaboration
last_updated: 2026-10-06T00:04:53.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install mb1810/bergerskills/commit-dag-collaboration`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/commit-dag-collaboration`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/mb1810/bergerskills/commit-dag-collaboration) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/commit-dag-collaboration`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/commit-dag-collaboration --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/commit-dag-collaboration --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Commit DAG Collaboration Skill

## Overview
Human version control assumes a canonical path: one main branch, pull requests that converge into it, a single agreed history. That assumption doesn't fit a swarm of agents running hundreds of experiments — most of which will fail, many of which are only interesting in combination, and none of which need to "merge" anywhere to be useful.

This skill treats the commit history itself as the graph. Every experiment is a node: it has a parent (the state it started from), a hypothesis (why this change should work), a diff, an evaluation metric, and an environment. Agents don't work from a shared context window or a full transcript history — they query the graph directly for exactly the connected state a given decision needs.

The key reframe: the primary operation is no longer "merge this into main." It's "traverse the search graph." A failed experiment with a clear, logged reason is not wasted work — it's a leaf that tells every other agent not to try that path again.

## When to Use
- Multiple agents need to collaborate asynchronously without holding each other's full transcripts in context
- The search space genuinely branches — several live hypotheses need to stay explorable in parallel rather than being forced into one linear sequence
- You want an auditable record of which agent tried what, from which starting point, and why
- Results from a swarm (see `swarm-orchestration`) need a place to live and branch further afterward, rather than being consumed once and discarded

## When Not to Use
- The work is genuinely one linear sequence with no real alternative branches worth preserving — use `ratchet-loop` directly instead of building DAG machinery around a single lineage
- A small number of agents can just share full context directly — the DAG earns its cost when the group is too large or too asynchronous for that
- Nobody will ever query the lineage or frontier — if the graph is never traversed, it's just an expensive commit log

## Core Operating Rules

### 1. Commit as Node — Full Provenance, Every Time
Every experiment commit carries, at minimum: parent commit (the state it branched from), the agent that created it, a one-line motivating hypothesis, the code diff, the evaluation metric and its value, runtime/environment info, and a keep-or-discard status. A commit missing any of these fields is not a usable node in the graph — it's noise.

### 2. Remove Convergence Abstractions on Purpose
No required main branch. No pull requests. No merge queue. No assumption that any one leaf is canonical. This is a deliberate design choice, not an omission — most experiments in a real search graph never merge anywhere, and forcing convergence would throw away the branches that didn't win but still taught something.
- The primary operation is `traverse the search graph`, not `merge this into main`
- A discarded branch stays in the graph, addressable and queryable — it is evidence that an idea fails under a given condition, not deleted history

### 3. Four Query Primitives Are the Whole Interface
Agents interact with the graph through a small, fixed set of operations:
- **children** — what has already been tried on top of this node (don't repeat it)
- **leaves** — the unexplored frontier (where to branch next)
- **lineage** — the ancestry path from any node back to root (how did we get here)
- **diff** — compare any two commits directly (what changed between two states)

An agent should never need to replay the entire history to make a decision — these four operations retrieve exactly the connected state needed for the current choice.

### 4. A Thin Social Layer Alongside the Graph
Provide a lightweight coordination channel (a message board, discussion thread, or equivalent) separate from the graph itself, where agents can post hypotheses, explain failures, and leave coordination notes tied to specific commits.
- A discarded experiment with a posted explanation ("tried X, failed because Y") teaches other agents not to repeat it — without this layer, that lesson is lost the moment the branch is abandoned
- Keep this layer additive: it annotates the graph, it does not replace the structured commit metadata from Rule 1

### 5. Preferential Attachment, Bounded by an Anti-Herding Rule (default ON)
Agents should disproportionately branch new experiments off already-successful lineages rather than spreading uniformly across the graph — this is what concentrates effort on winners instead of diluting it evenly (see `power-law-engineering`).
- But unqualified preferential attachment collapses exploration: if every agent branches off "the current best node," the swarm converges onto one lineage and loses the diverse leaves the DAG exists to preserve
- **Default requirement:** reserve an explicit minimum share of new branches (state the fraction, e.g., 20-30%) for non-top-N nodes or genuinely novel starting points, rather than letting every agent chase the current leader
- State this quota explicitly before agents start branching — treat it as load-bearing, not a nice-to-have, the same way `swarm-orchestration`'s diversity-across-workers rule defaults on

### 6. Mechanism/Culture Separation
The DAG itself is agnostic to what agents are optimizing for — it doesn't know whether they're tuning validation loss, searching for vulnerabilities, or designing APIs. What agents post, how they describe results, and which experiments they attempt is entirely defined by their prompts and instructions, not by the graph structure. Don't conflate "the graph supports X" with "agents will do X" — the culture has to be set separately.

### 7. Growth Requires Pruning, Not Just Accumulation
An ever-growing, never-merged DAG does not stay queryable forever. Plan for this explicitly rather than treating it as someone else's future problem:
- Decide, up front, a policy for archiving or compacting old, low-value branches
- Distinguish "pruned from active querying" from "deleted" — pruning should demote a branch's visibility, not destroy its provenance (consistent with `knowledge-graph-memory`'s "nothing is silently deleted" invariant)
- Watch for graph growth outpacing query value as a signal it's time to archive, not a signal to just add more storage

### 8. Output Requirements
Always deliver, in this order:
1. The commit schema in use (fields every node must carry)
2. The anti-herding quota in effect (stated fraction, and why)
3. A snapshot of the current frontier: notable leaves, and the lineage of the best-performing node
4. Any discarded branches worth surfacing explicitly, with their logged reason for failure
5. The pruning/archiving policy, or an explicit statement that the graph is still small enough not to need one yet

## Worked Example

**Input**: "We have 12 agents independently trying to improve a ranking model's offline metric over the next few hours. Let them branch off each other's work instead of running in isolation."

**Setup**:
- Commit schema: parent, agent id, hypothesis, diff, metric (offline NDCG), environment, keep/discard
- Anti-herding quota: 25% of new branches must originate from a node outside the current top 3 by metric
- Social layer: each commit links to a short post — what was tried, what happened, one line on why

**Loop behavior**: agents query `leaves` to find unexplored frontier nodes, occasionally query `lineage` on the current best node to understand how it got there, and branch — 75% of the time from a top-3 node, 25% from elsewhere, enforced by whatever's coordinating agent assignment.

**Output at the end**: a graph snapshot — best lineage and its NDCG, 3 other interesting-but-not-best leaves worth a human look, and 4 discarded branches with logged failure reasons (e.g., "feature X reduced NDCG on the tail queries specifically — don't retry without addressing that").

## Advanced Techniques
- **Pairing with ratchet-loop**: a single agent walking one lineage inside the DAG is exactly `ratchet-loop`'s reversible commit pattern — the DAG is what you get when many such loops run concurrently and are allowed to branch off each other.
- **Pairing with swarm-orchestration**: a swarm's synthesizer can, instead of just aggregating and discarding, commit each worker's result as a DAG node — turning a one-shot swarm into a persistent, branchable search graph future swarms can build on.
- **Pairing with knowledge-graph-memory**: keep the DAG (work lineage) and the knowledge graph (domain knowledge) as separate, cross-linked structures — a claim in the knowledge graph can point to the commit that produced it; a commit can point to which entities it touched. Don't collapse one into the other.
- **Lineage-aware prioritization**: when deciding where a new agent should start, prefer nodes with quickly-improving lineages over nodes that plateaued early — a leaf that got there fast is more likely to have room left than one that took many iterations to reach the same score.

## Quality Checklist (run before agents start branching)
- [ ] Commit schema defined: parent, agent, hypothesis, diff, metric, environment, keep/discard — all required fields
- [ ] No forced convergence: no required main branch, no merge-to-canonical assumption baked into the design
- [ ] All four query primitives (children, leaves, lineage, diff) available and agents know to use them instead of replaying full history
- [ ] Social/coordination layer in place so discarded branches leave a legible reason, not silent absence
- [ ] Anti-herding quota stated as an explicit fraction, not left as unqualified "prefer winners"
- [ ] Pruning/archiving policy stated, or explicitly deferred with a reason
- [ ] Culture (what agents optimize for, what they post) has been set via instructions — not assumed to follow automatically from graph structure
