| name | ticket-claim |
| description | Claim a local ticket for work (cross-worktree safe). |
| disable-model-invocation | false |
| user-invocable | true |
| argument-hint | <ticket-id> |
Claim ticket $ARGUMENTS
Steps
-
Validate the ticket ID โ must be exactly 4 digits:
echo "$ARGUMENTS" | grep -qE '^[0-9]{4}$' || { echo "Invalid ticket ID: must be 4 digits"; exit 1; }
-
Verify the ticket exists: tickets/$ARGUMENTS-*.erg
-
Check for existing claim:
wip_dir="$(git rev-parse --git-common-dir)/ticket-wip"
cat "$wip_dir/$ARGUMENTS.wip" 2>/dev/null
If claimed by another worktree, stop and report.
-
Write the claim:
wip_dir="$(git rev-parse --git-common-dir)/ticket-wip"
mkdir -p "$wip_dir"
echo "$(date -u +%Y-%m-%dT%H:%MZ) $(whoami) $(pwd)" > "$wip_dir/$ARGUMENTS.wip"
-
Update the ticket file:
- Change
Status: open โ Status: doing
- Append log line:
{timestamp} {agent} claimed
- Append log line:
{timestamp} {agent} status doing
-
Commit the ticket status change.
On release
When abandoning or completing, delete the .wip file:
rm "$(git rev-parse --git-common-dir)/ticket-wip/$ARGUMENTS.wip"