Skip a failed increment and move to the next one in queue. Use when an increment has exhausted retries and you want to continue with other work.
Skip a failed increment and move to the next one in queue. Use when an increment has exhausted retries and you want to continue with other work.
/plugin marketplace add anton-abyzov/specweave/plugin install sw@specweaveSkip a failed increment and move to the next one in queue. Use when an increment has exhausted retries and you want to continue with other work.
/sw:skip-increment [INCREMENT_ID]
INCREMENT_ID: Optional. If not provided, skips the current pending skip.The skip creates a failedIncrements entry with skip metadata:
{
"incrementId": "0001-feature",
"skipReason": "test_failures",
"skippedAt": "2024-12-29T10:00:00Z",
"failureDetails": {
"file": "tests/auth.spec.ts",
"error": "timeout waiting for login"
}
}
When this command is invoked, execute the following:
SESSION_FILE="$PROJECT_ROOT/.specweave/state/auto-session.json"
if [ ! -f "$SESSION_FILE" ]; then
echo "No auto session active."
exit 1
fi
SESSION=$(cat "$SESSION_FILE")
PENDING_SKIP=$(echo "$SESSION" | jq -r '.pendingSkip // null')
if [ "$PENDING_SKIP" = "null" ]; then
echo "No increment pending skip. Run /sw:auto to continue."
exit 1
fi
SKIPPED_INCREMENT=$(echo "$PENDING_SKIP" | jq -r '.increment')
SKIP_REASON=$(echo "$PENDING_SKIP" | jq -r '.reason')
NEXT_INCREMENT=$(echo "$SESSION" | jq -r '.incrementQueue[1] // null')
if [ "$NEXT_INCREMENT" = "null" ]; then
echo "No more increments in queue."
exit 1
fi
# Move skipped increment to failed list and advance queue
jq --arg skipped "$SKIPPED_INCREMENT" --arg reason "$SKIP_REASON" \
--arg next "$NEXT_INCREMENT" --arg now "$(date -u +%Y-%m-%dT%H:%M:%SZ)" '
.failedIncrements += [{
"incrementId": $skipped,
"skipReason": $reason,
"skippedAt": $now,
"failureDetails": .pendingSkip
}] |
.currentIncrement = $next |
.incrementQueue = .incrementQueue[1:] |
.status = "running" |
del(.pendingSkip) |
del(.pauseTime) |
del(.pauseReason)
' "$SESSION_FILE" > "$SESSION_FILE.tmp" && mv "$SESSION_FILE.tmp" "$SESSION_FILE"
echo "Skipped increment $SKIPPED_INCREMENT, now working on $NEXT_INCREMENT"
Then continue with /sw:do to start working on the next increment.