chore(skills): add open-time conflict hygiene to implement-step
Why
Parallel step MRs against one plan conflict with each other far more than they conflict with main, and the breaks that cost the most carry no conflict marker at all. The virtual and remote repositories workstream, S17 Phase 6: virtual and remote repository CRUD (#314) • Hayley Swimelar, is where that got measured: across its ten open step branches, 33 of 45 sibling pairs conflicted while one branch conflicted with main, and at least nine breaks merged clean and then failed a build, a vet, a lint, or a runtime assertion. A third of the conflict hunks were comment-only.
/implement-step cuts the branch each of those MRs grows from, and said nothing about any of it.
The checks land where the skill's flow already has a step: the sibling survey and the stacked-parent pin in Set up the worktree, the authoring rules in a new Shared-seam conventions section that the dispatch prompts carry into the agents, and a new Check the merged tree section before hand-back.
Test plan
Docs-only. vale --minAlertLevel error and lychee --offline --include-fragments are clean on the file. markdownlint-cli2 excludes .claude/skills/** by config, so it lints zero files here.
Every shell recipe in the diff was run against real open MR heads before it was written down, including the duplicate-declaration loop, which reports ContainerRemoteImageReader and seven other names on the merge of two open siblings.
An independent falsification pass then attacked the result, and the second commit fixes what it found. Three of the gates reported success without checking anything: the duplicate-declaration loop returns a clean result under set -euo pipefail (git grep exits 1 per non-match), the materialized tree cannot build without mise exec because mise will not load an untrusted .mise.toml and GOEXPERIMENT=jsonv2 never reaches the toolchain, and the stacked-step item described a branch shape Precondition 3 forbids. Each fix was re-measured in the failing condition before being written down.
No e2e scenario is added or affected. The change is authoring guidance and touches no service behavior.
Benchmark
Skill changes require benchmark results in the MR description per docs/dev/conventions.md (Skill changes); the earlier deferral of that requirement for this MR is superseded. This section is the result of the /skill-creator flow's comparison benchmark.
Method. Eight scenario evals were written for this change, modeled on the existing mr-watch/evals/evals.json shape: survey verdict recording, glob-based overlap matching, zero-overlap dispatch composition, stacked-parent pin detection, merged-tree gate execution and its guards, duplicate-declaration grep, conflict adoption, and hand-back composition. Each eval ran twice in isolated simulator executors — once with the changed skill (head 9b0f2ec70) and once with the main version (c476c600) as the baseline — each executor reading only its assigned skill file and fixture, producing the artifact the skill directs (39 assertions total). Executors simulated git/glab mechanics; no real merges, pushes, or network calls ran. Timing and token figures are simulator artifacts and are omitted as meaningful metrics.
Pass-rate table
| Eval | New skill | Main baseline | Delta |
|---|---|---|---|
| 1. Survey verdict recording | 5/5 | 3/5 | +2 |
| 2. Overlap glob matching | 4/4 | 2/4 | +2 |
| 3. Zero-overlap dispatch | 5/5 | 5/5 | 0 |
| 4. Stacked-parent pin detection | 5/6 | 2/6 | +3 |
| 5. Merged-tree gate execution + guards | 4/4 | 0/4 | +4 |
| 6. Duplicate-declaration grep | 4/5 | 2/5 | +2 |
| 7. Conflict adoption | 5/5 | 0/5 | +5 |
| 8. Hand-back composition | 5/5 | 2/5 | +3 |
| Overall | 37/39 (95%) | 16/39 (41%) | +21 |
Findings that surfaced during the benchmark
- The change converts unexecutable or unmechanized instruction into followable recipes: the two zero-scoring evals on
main(merged-tree gates 0/4, conflict adoption 0/5) are sections that did not exist in the baseline skill, and the baseline's partial passes are judgment-without-mechanism (a correct overlap verdict reached without glob semantics; hand-back base bullets without the union records). - Two of 39 assertions failed for the new skill, both executor-completeness rather than missing content: the stacked-pin executor did not surface the skill's note on why a bare
git merge-base --is-ancestor origin/main HEADcannot carry the test, and the grep executor did not restate the pattern'svar/constand grouped-block blind spots — the skill documents both. - Eval 3 does not discriminate (5/5 both configurations): the baseline skill has no seam paragraph to drop, so "seam sentence absent" passes trivially. A positive-case eval (overlapping sibling present, seam paragraph must name iids/files/owning file) belongs in the follow-up suite.
- The baseline executors were instructed to state explicitly rather than invent where the main skill lacks a mechanism; their honest-absence reports confirm the round-1 and round-2 content is new capability, not restated prose.
Benchmark artifacts. The eval suite and raw outputs live in the scratch workspace this run used; committing the suite to .claude/skills/implement-step/evals/ (with a positive-case eval 3) is the follow-up, tracked as part of the eval-suite work this MR's review threads already named.
Context for LLM agents
Design rationale
Placement over aggregation. Each check sits at the point in the existing flow where it runs, rather than in one "conflict hygiene" appendix. Rejected the appendix: the branch-time checks would then be read after the branch was already cut, which is the failure the MR exists to fix.
The build gate runs only on a clean merge tree. git merge-tree --write-tree writes conflict markers into the tree it produces, so compiling a conflicted tree reports the markers as syntax errors and says nothing about what is under them. Measured on the merge of two open siblings: syntax error: non-declaration statement outside function body on the marker lines, with a real cross-file redeclaration sitting underneath, unreported. The duplicate-declaration grep is exempt and runs on either tree, because a marker does not hide a declaration.
The branch-time survey records a baseline, not a verdict. At worktree-creation time the branch is origin/main, so merge-tree against a sibling measures that sibling's own state. The text says so rather than implying the step contributed something. The later merged-tree check re-runs the same pairs, and the difference is the step's contribution.
No plan-field reference at all. An earlier revision keyed the seam list off a "shared-seams entry" in the plan. No plan under docs/plans/ has one, docs/plans/TEMPLATE.md defines no such field, and Precondition 2 hard-stops a plan that drifts from the template, so the primary branch of that instruction was dead and <owning file> had nothing to substitute. The file-overlap check is now the only rule, and the owning file is the orchestrator's pick recorded in the hand-back report.
Two named instances, both verified first-hand on written merge trees, rather than quoted: a cache type declared in internal/managementapi/artifact.go on one group of branches and internal/managementapi/version_file_resources.go on another, and ContainerRemoteImageReader declared by one step in internal/managementapi/container_images.go and by another in internal/managementapi/container_tags.go.
Non-goals
Not a CI gate. Making the merged tree the unit of CI is the higher-value change and is a pipeline edit with its own cost and blast radius. This MR puts the check in the authoring loop, where it needs no runner budget. The CI version belongs in its own MR.
Not a plan-template or planner change. A sibling MR owns the plan-template side of this work. Nothing here edits docs/plans/TEMPLATE.md or the planner skill, and after the correction above nothing here depends on that MR landing.
Does not touch /validate-step or /review-branch. Both still reason about the branch, which is correct for what they do. The hand-back report is the only place the union gets recorded, and the new hand-back bullets say so.
No Related to line. chore is maintenance class and exempt under AGENTS.md's related-issue guardrail.
Overlap disclosure. !118 (closed) is the one open MR touching this file. It is a stale Draft of mine whose diff against current main only reverts frontmatter and intro text that main has since gained. No region overlap with the sections added here.