| name | next-issue-number |
| description | Determine the next available issue number across all change types (feature, fix, workflow) by checking both local docs and remote branches, then reserve it by pushing an empty branch. |
Skill Instructions
Purpose
Ensure unique issue numbering across all change types (feature, fix, workflow) by:
- Finding the highest number used in local docs folders (docs/features/, docs/issues/, docs/workflow/)
- Finding the highest number used in remote branches on GitHub (feature/NNN-, fix/NNN-, workflow/NNN-*)
- Finding the highest number used in recent
copilot/* remote branches (less than one week old)
- Calculating the next available number (max + 1)
- Immediately pushing the new branch to GitHub to reserve the number for other agents
This prevents duplicate issue numbers when multiple agents work concurrently or when work-in-progress exists on remote branches but not yet in main.
Session Start Hook
A sessionStart hook (.github/hooks/session-start.json) automatically runs scripts/next-issue-number.sh when a new agent session begins and writes the result to .next-issue-number. This means the next issue number is pre-calculated for you at session start.
Read the pre-calculated value first (fast, no network call required):
if [ -f .next-issue-number ]; then
NEXT_NUMBER=$(cat .next-issue-number)
else
NEXT_NUMBER=$(scripts/next-issue-number.sh)
fi
echo "Next issue number: $NEXT_NUMBER"