Repository navigation
Description
Problem
mfrieman/agentic-ai-collective
(v0.1.0-alpha) uses a tagged-block merge convention to let workstream
compositions add content to existing squad documents without clobbering
user-authored content. Merge files live under compositions/workstreams/<name>/merge/
with a .merge suffix and contain content wrapped in HTML comment tags:
<!-- squad:start:code-review-routing -->
## Code Review routing
...workstream-owned content...
<!-- squad:end:code-review-routing -->When a workstream is installed, its merge patches are injected into the target
file (e.g., .squad/routing.md) between those tags. When the workstream is
removed, only content between the tags is removed — the rest of the file is
untouched.
The upstream Squad CLI has no merge engine. There is no command to process .merge
files, no concept of tagged blocks, and no mechanism to cleanly remove
workstream-contributed content during uninstall.
Current state
.merge files in compositions/workstreams/<name>/merge/ have no CLI consumer.
Consumers process them by hand. Workstream installs and removals do not exist.
Desired state
A tagged-block merge engine embedded in the Squad CLI, used internally by
squad workstream add and squad workstream remove.
Tag format
<!-- squad:start:{block-id} -->
<content owned by this workstream>
<!-- squad:end:{block-id} -->
{block-id}is a string unique within the file (e.g.,code-review-routing).- Tags use HTML comment syntax so they are invisible in rendered Markdown.
- Content between tags is fully owned by the workstream. User edits outside the
tags are always preserved.
Merge operations
Insert (during workstream add):
If the block-id does not exist in the target file:
Append the tagged block at the end of the file (or at the position
specified in the .merge file via an `after:` directive).
If the block-id already exists:
Replace the existing block content with the new version.
Remove (during workstream remove):
If the block content matches the installed version (no user edits):
Remove the entire tagged block including the comment tags.
If the block content has been modified by the user:
Warn. Leave the block in place. Do not destroy user edits.
The user must remove manually or pass --force.
Upgrade (during workstream upgrade):
Replace block content with the new version's content.
Warn if the block was modified by the user since install.
.merge file format
# merge target: .squad/routing.md
# position: after-section: "## Routing"
<!-- squad:start:code-review-routing -->
## Code review routing
Route `review` tasks to the `code-reviewer` agent.
<!-- squad:end:code-review-routing -->Acceptance criteria
-
squad workstream addprocesses all.mergefiles in the workstream and
injects tagged blocks into target files without overwriting any content
outside the tag boundaries. - Installing the same workstream twice produces identical output (idempotent).
-
squad workstream removeremoves tagged blocks for the specified workstream,
leaving all content outside the blocks unchanged. - If a tagged block has been user-modified since install,
removeprints a
warning and skips that block unless--forceis passed. -
squad workstream upgradereplaces the tagged block content with the new
version's content, with a warning if user edits are detected. - The tag format (
<!-- squad:start:{id} -->/<!-- squad:end:{id} -->) is
documented and stable so users know which content is workstream-managed. - The merge engine is usable standalone via a lower-level command (e.g.,
squad merge apply <file> <block-id> <content>) for tooling/scripting use.
References
mfrieman/agentic-ai-collectivev0.1.0-alpha — consumer library motivating this gapARCHITECTURE.md— "Workstream Anatomy"
(describesmerge/subtree and.mergefile convention).squad/decisions.mdline 562 — flags tagged-block merge engine as upstream gap.squad/decisions.mdline 602 — ratified workstream install model with tagged-block
merges intoteam.md,routing.md,ceremonies.md- Related gap issues: Issue feat: GitHub Issues intake, PRD mode, and human team members #2 (workstream lifecycle commands), Issue Feature: Get squads to use project boards #6 (workstream layout)
Notes
- The HTML comment tag format keeps squad-managed blocks invisible in rendered
Markdown, which is important for.squad/files that are rendered by squad and
read by AI agents. - The
position:directive in.mergefiles is optional but important for
readability — appending to the end of the file is a sensible default, but some
content (e.g., routing rules) needs to be in a specific section. - Consider whether tag IDs should be namespaced by workstream alias
(e.g.,review:code-review-routing) to prevent collisions when multiple
workstreams are installed. - The merge engine is also potentially useful outside workstreams — any tool that
wants to contribute governed sections to a shared config file (CI, bots) could
use this same primitive.
Activity
bradygaster commentedon Nov 5, 2026
Closing as not planned for the 2.0 line during board triage (owner decision). The squad:// registry/workstream install work is out of scope for 2.0; reopen if it returns to the roadmap.