Renumber prioritized tasks to start from 1 with no gaps
Renumbers prioritized tasks in docs/tasks-todo to start from 1 with no gaps. Use this when you've deleted tasks and want to clean up numbering while preserving order.
/plugin marketplace add dannysmith/claude-marketplace/plugin install personal@dannysmithdev/Renumber all prioritized tasks in docs/tasks-todo to maintain their current order but start from 1 with no gaps.
/personal:dev:tasks-renumber
List all tasks in the todo folder
docs/tasks-todo directorytask-[0-9]+-*.md (ignore task-x-*.md)Create renumbering plan
Renumbering plan:
task-4-implement-auth.md -> task-1-implement-auth.md
task-9-fix-bug.md -> task-2-fix-bug.md
Execute renaming using bash
cd docs/tasks-todo
# Get all numbered tasks, sorted by number
files=$(ls task-[0-9]*-*.md 2>/dev/null | sort -t- -k2,2n)
if [ -z "$files" ]; then
echo "No numbered tasks found to renumber"
exit 0
fi
# Rename to temporary names first to avoid conflicts
counter=1
echo "$files" | while read file; do
# Extract the part after the number (including the dash)
suffix=$(echo "$file" | sed 's/^task-[0-9]*\(-.*\.md\)$/\1/')
temp_name="task-temp-${counter}${suffix}"
mv "$file" "$temp_name"
((counter++))
done
# Now rename from temp names to final names
counter=1
for file in task-temp-*-*.md; do
if [ -f "$file" ]; then
# Extract the part after "temp-number"
suffix=$(echo "$file" | sed 's/^task-temp-[0-9]*\(-.*\.md\)$/\1/')
final_name="task-${counter}${suffix}"
mv "$file" "$final_name"
echo "Renamed to: $final_name"
((counter++))
fi
done
echo "Renumbering complete!"
task-x-* files)