dr-init-id-collision-window

Detects task-ID collisions and performs batched in-file rewrites with coordinated git renames.

11|1|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/Arcanada-one/datarim --skill dr-init-id-collision-window
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dr-init-id-collision-window
Source: https://github.com/Arcanada-one/datarim/tree/main/skills/dr-init-id-collision-window
Command: npx skills add https://github.com/Arcanada-one/datarim --skill dr-init-id-collision-window

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents two concurrent agent sessions from reserving the same TASK ID during the workspace TOCTOU window, which can later cause inconsistent artifact paths, duplicate archive entries, and broken references.

Core Features & Use Cases

  • Collision detection across canonical task and archive sets: Probes tasks, backlog, active context, and documentation/archive subdirectories to determine whether an ID already exists outside the current session’s scope.
  • Retroactive ID relabel with safe renaming: Performs batched sed updates across artifact bodies and audit logs, coordinates git renames, updates thin-index files, and restores file permissions for verification audit logs.
  • Guided anti-pattern prevention: Avoids renaming mid-pipeline and avoids partial renames that would desynchronize filenames from frontmatter task_id keys.

Use case: Two parallel runs attempt to execute /dr-init and then commit via /dr-archive using the same TASK-PREFIX-NNNN; the loser renames its entire derived chain (PRD, plan, QA artifacts, reports, reflection, snapshots) so the archive and indexes stay consistent.

Quick Start

Run the Skill when /dr-init probe or /dr-archive collision detection indicates the candidate TASK-PREFIX-NNNN already exists, then execute the retroactive rename procedure to move the losing chain to the next free ID.

Frequently Asked Questions about dr-init-id-collision-window

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix task ID collisions when two parallel git workflows reserve the same task ID?

To fix task ID collisions, the losing session performs batched sed updates across artifact bodies and audit logs, coordinates git renames, and updates thin-index files to move the entire derived chain to the next free ID.

Why does my workspace have duplicate artifact paths after concurrent agent sessions run /dr-init?

Duplicate artifact paths occur due to a TOCTOU window between /dr-init reservation and /dr-archive completion, where two concurrent sessions reserve the same task ID before either detects the conflict.

How do I rename task artifacts safely without desynchronizing filenames from frontmatter task_id keys?

To rename task artifacts safely, perform batched in-file ID rewrites across artifact bodies and audit logs simultaneously with coordinated git renames, ensuring filenames match frontmatter task_id keys to prevent partial rename desynchronization.

Can I use batched sed updates to rewrite task IDs across archived documentation and audit logs?

Yes, you can use batched sed updates to rewrite task IDs across archived documentation and audit logs, followed by chmod restoration for verify audit logs and post-rename validation to confirm only historical evidence remains.

What is the TOCTOU window in task ID reservation and when does collision closure apply?

The TOCTOU window is the race condition timeframe between /dr-init reservation and /dr-archive completion where duplicate task IDs can be assigned, requiring collision closure via retroactive ID relabeling and full canonical probing for hot-fix branches.

Does collision detection probe both active task state and archived artifacts across subdirectories?

Yes, collision detection probes both active task state and all archived artifacts across subdirectories including tasks, backlog, active context, and documentation/archive sets to determine whether an ID already exists outside the current session's scope.