Repository navigation
Description
Summary
/assess Step 5 ("Conflict Detection") only inspects active worktrees — it can't predict collisions between two unstarted issues that will both modify the same file. As a result, batch /assess recommends parallel sequant run commands that race on shared files at merge time.
This issue adds a predicted-collision heuristic that reads issue bodies before output formatting and warns when 2+ PROCEED issues are likely to touch the same file.
Motivation — concrete recent example
/assess 532 543 551 552 (today). Issues #551 and #552 both:
- Modify
qa/SKILL.md(added new sections, distinct concerns but same file) - Require 3-dir sync across
.claude/skills/,templates/skills/,skills/ - Have explicit ACs naming the file paths
The skill's current output didn't auto-detect this — I caught it manually by reading both issue bodies and added an Order: warning + suggested sequential execution. Without that manual catch, the recommended commands would have started parallel worktrees that collide on identical line ranges.
The signal is grep-able from issue body content: both issues mention qa/SKILL.md and 3-dir sync. A simple cross-issue grep would have surfaced it.
Acceptance Criteria
- AC-1: Path extraction from issue bodies. During Step 1 (Context Gathering), for each PROCEED candidate, extract file paths mentioned in the issue body. Heuristics:
- Backtick-quoted paths matching
*.md,*.ts,*.tsx,*.json,*.sh - Paths under
.claude/,templates/,skills/,src/,bin/,docs/ - "3-dir sync" / "across all three skill directories" → flag the named file as touching all three skill roots
- Backtick-quoted paths matching
- AC-2: Cross-issue overlap detection. After path extraction, compute pairwise intersection. Any pair sharing ≥1 file → flag as predicted collision.
- AC-3: Output annotation. Predicted collisions emit an
Order:line referencing the specific shared file, plus a⚠per affected issue:Order: 551 → 552 (both modify qa/SKILL.md — sequential execution avoids 3-dir-sync merge conflicts) ⚠ #551 Modifies qa/SKILL.md (overlaps #552); land sequentially ⚠ #552 Modifies qa/SKILL.md (overlaps #551); land sequentially - AC-4: Suggest
--chainwhen 3+ issues collide on the same file. Add aChain:suggestion alongside default commands (suggest-only, never auto-applied — same rule as existing chain detection). - AC-5: False-positive guards. Don't flag overlap when:
- The shared file is
CHANGELOG.md(every PROCEED issue touches it; would flag on every batch) - The shared file is
package.jsonlockfile (low-conflict, alphabetically merged in practice) - One issue's body uses the path only in a
<!-- comment -->or quoted code block that's clearly not the file-of-modification
Document the guard list inreferences/predicted-collision-detection.mdso it's tunable without skill edits.
- The shared file is
- AC-6: Tests. In
src/lib/__tests__/assess-skill.test.ts(or newassess-collision-detect.test.ts):- Two issue bodies both mentioning
qa/SKILL.md→ overlap detected - One issue mentions
qa/SKILL.md, the other only mentions it inside a code-block → no overlap (false-positive guard) - Both issues mention
CHANGELOG.mdonly → no overlap (excluded path) - Use feat(qa): require detection-pattern verification for skill regex/grep/awk changes #551 and feat(spec,qa): detect behavior-rule implementations across skill+runtime touchpoints #552 issue bodies as fixtures.
- Two issue bodies both mentioning
- AC-7: SKILL.md documents the new detection step under Step 5 ("Conflict Detection") — extend the existing section rather than adding a new step. 3-dir sync.
- AC-8: CHANGELOG entry under
[Unreleased] / ### Added.
Non-Goals
- Not auto-running issues sequentially. The skill still suggests; the user decides. Same precedent as existing
Chain:detection. - Not parsing the full diff of each issue (premature — issue bodies contain the signal in 90%+ of cases).
- Not detecting collisions in already-running worktrees. That's Step 5's existing scope.
Risks / Open Questions
- Path-extraction false-positive rate. Backtick-quoted paths often appear in issue bodies as references to existing code, not files-to-modify. Mitigation: weight paths by proximity to AC bullets — paths inside
- [ ] **AC-N:**blocks score higher than paths in "Motivation" or "Additional context". Tune inreferences/predicted-collision-detection.md. - Cost of running heuristic on large batches. For 13 issues (max realistic batch), pairwise comparison is 78 pairs — cheap. No real performance concern.
- Interaction with
Order:rule from feat(assess): emit minimal command flags — drop default --phases, prefer additive flags #554 AC-8. AC-8 of feat(assess): emit minimal command flags — drop default --phases, prefer additive flags #554 clarifies that file-collision filenames are validOrder:reasons. This issue generates those Order: lines automatically. Coordinate by landing feat(assess): emit minimal command flags — drop default --phases, prefer additive flags #554 first.
Complexity
medium — heuristic detection logic + 2 reference files + tests + 3-dir sync. Skill-prompt heavy.
Self-assessed workflow
spec → exec → qa with -q (multi-file: skill changes + reference doc + tests + CHANGELOG)
Related
- Discovered during
/assess 532 543 551 552session 2026-04-26 — manually caught the 551/552 collision; this issue automates the catch. - Depends on / coordinates with feat(assess): emit minimal command flags — drop default --phases, prefer additive flags #554 (Order: rule allows file-collision reasons)
Activity
admarble commentedon May 3, 2026
→ PROCEED — Predicted file-collision detection in
/assess, 8 ACsWorkflow:
spec → exec → qawith-q⚠ Sequential after #559 — both modify
assess/SKILL.mdacross 3 skill dirs (and possiblysrc/lib/__tests__/assess-skill.test.ts). #554 prerequisite (Order: file-collision rule) already shipped via #557.admarble commentedon May 4, 2026
/spec Plan
AC Checklist (verbatim from issue)
3-dir syncmentions) — Verify: unit testOrder:line +⚠per affected issue) — Verify: unit test--chainwhen 3+ issues collide on the same file (suggest-only) — Verify: unit testCHANGELOG.md, lockfiles, code-block-only mentions); guard list documented inreferences/predicted-collision-detection.md— Verify: unit test + reference doc reviewsrc/lib/__tests__/assess-collision-detect.test.tsusing verbatim feat(qa): require detection-pattern verification for skill regex/grep/awk changes #551 / feat(spec,qa): detect behavior-rule implementations across skill+runtime touchpoints #552 issue bodies as fixtures — Verify: vitestassess/SKILL.mdextended (not new step), 3-dir mirrored — Verify: existing 3-dir-sync test[Unreleased] / ### AddedImplementation Plan
Phase 1 — Core detection module
src/lib/assess-collision-detect.ts:extractPathsFromIssueBody(body)— strips fenced code blocks +<!-- HTML comments -->first, then runs path regex over the remainder; expands3-dir syncmentions to all three skill rootsdetectFileCollisions(issuePaths)— pairwise intersect →{ issues, file }[]EXCLUDED_PATHS(CHANGELOG.md, package-lock.json, yarn.lock, pnpm-lock.yaml)formatCollisionAnnotations(results)→{ orderLines, warnings, chainSuggestion? }Phase 2 — Skill prose (3-dir sync)
assess/SKILL.md(per AC-7) with a "Predicted file-collision" sub-section that names the new fns and points at the reference doc.references/predicted-collision-detection.md(also 3-dir-mirrored) covering path regex, excluded-path list, proximity-weighting note.Phase 3 — Tests + CHANGELOG
src/lib/__tests__/assess-collision-detect.test.tswith verbatim feat(qa): require detection-pattern verification for skill regex/grep/awk changes #551 / feat(spec,qa): detect behavior-rule implementations across skill+runtime touchpoints #552 bodies as inline fixtures (positive overlap, code-block-only false negative, CHANGELOG-only exclusion).[Unreleased] / ### Added.Design Review
src/lib/assess-collision-detect.ts— parallel tosrc/lib/assess-comment-parser.tsfrom feat(assess): detect prior assess markers — supersession note + re-assessment churn warning #555. Skill prose stays declarative; testable heuristic lives in TS.assess-comment-parser.ts(pure fns + SKILL.md links by name + vitest with fixture-driven cases).Open Questions
(+N more)suffix. Caps line width.Conflict Risk
In-flight worktree
feature/551-…modifiesqa/SKILL.md; this issue modifiesassess/SKILL.md. No file overlap.Recommended Workflow
spec → exec → qawith-q(multi-file 3-dir sync × 2 + new TS module + tests).admarble commentedon May 4, 2026
/qa Review
Verdict: READY_FOR_MERGE
AC Coverage (8/8 MET)
PATH_REGEXcovers 5 extensions × 6 tracked roots;SKILL_FILE_REGEX+ 3-dir-sync trigger; code-blocks + HTML comments stripped before matchingdetectFileCollisionsbuilds file→issue map, emits oneCollisionResultper shared file (≥2 issues)formatCollisionAnnotationsemits both. Output uses fully-qualified path (.claude/skills/qa/SKILL.md) — consistent with #554's bare-filename-as-reason rule for file-collision Order: linesissues.length >= 3; suggest-only string (no auto-apply)CHANGELOG.md,package-lock.json,yarn.lock,pnpm-lock.yamlexcluded; fenced code blocks + HTML comments stripped; full guard list inreferences/predicted-collision-detection.mdqa/SKILL.md), 5 use synthetic fixtures for false-positive guards (code-block-only, HTML-comment-only, CHANGELOG-only, glob-pattern, bare filename); 3-issue Chain: case coveredassess-skill.test.ts3-dir-sync test passes byte-identical)[Unreleased] / ### AddedQuality Gates
npx tsccleanassess-skill.test.ts3-dir-sync test confirms byte-identical content across.claude/skills/,templates/skills/,skills/npx sequant run A B C --chain --qa-gate -qexample uses only valid flagsAdversarial Re-read
/qadiscussed casually (not modifying) under 3-dir-sync language → flagsqa/SKILL.md. Documented in the reference doc as known tradeoff. The warning is non-blocking and easy to dismiss..claude/skills/foo/SKILL.md.bakwould partially-match…/SKILL.md. Issue bodies don't carry.bakfiles; non-issue./assessactually invokes them and renders the result. Same pattern asassess-comment-parser.tsfrom feat(assess): detect prior assess markers — supersession note + re-assessment churn warning #555 — the LLM-driven harness is verified by the human review of dashboard output.Risk Assessment
/qawhen neither modifiesqa/SKILL.md. Cost: a spurious sequencing warning the user ignores. No production impact./assessend-to-end on a live batch of issues. Equivalent gap exists for feat(assess): detect prior assess markers — supersession note + re-assessment churn warning #555.PR-bound
Diff: 9 files, +913 / -0 (3 SKILL.md mirrors + 3 reference-doc mirrors + 1 module + 1 test + CHANGELOG).
admarble commentedon May 4, 2026
/fullsolve Complete
Issue: #556
PR: #577
Status: READY_FOR_MERGE
Summary
Iterations
*/inside JSDoc comment)Risk Assessment
/qacasually under 3-dir-sync language. Cost: spurious sequencing warning. No production impact./assessend-to-end on a live batch — requires post-merge verification.Ready for human review and merge.
fix(#556): normalize skill-mirror paths to canonical bare form
admarble commentedon May 4, 2026
Adversarial follow-up — gap fix pushed
User asked "any gaps?" after the structured QA pass. Adversarial re-read against AC-3's literal expected output surfaced 3 real gaps that the structured pipeline missed:
Gap 1 — Triple-noise on 3-dir-sync mirror collisions
The prior implementation expanded
qa/SKILL.mdto all three mirrors at extraction time, sodetectFileCollisionsemitted three Order: lines and six ⚠ warnings for one logical conflict:vs. the issue's expected:
Fix: normalize skill-mirror prefixes (
.claude/skills/,templates/skills/,skills/) to canonical bare form (qa/SKILL.md) at extraction. Mirrored references deduplicate naturally; one collision per logical conflict.Gap 2 — AC-6 fixture using wrong path
AC-6 literally says: "One issue mentions
qa/SKILL.md, the other only mentions it inside a code-block → no overlap." My test usedsrc/lib/foo.tsinstead, weakening the AC-6 link. Added a new test using #552 verbatim plus a synthetic code-block-only fixture.Gap 3 — AC-1 says "during Step 1", prose was Step-5-only
AC-1 specifies extraction "during Step 1 (Context Gathering)". Added a cross-reference in Step 1 prose pointing at Step 5's detector.
Verification
npx tscclean.claude/skills/assess/SKILL.mdfrom feat(spec,qa): detect behavior-rule implementations across skill+runtime touchpoints #552, code-block-only AC-6 fixture, multi-issue Chain: caseassess-skill.test.tsCommit: 8591f6b
feat(#556): predict file-collision between PROCEED issues from body c…
fix(#769): section-aware path extraction; drop background-only citati…
fix(#769): section-aware path extraction; drop background-only citations