next-issue-number
Skill174 starsChanged 2 months agoMITView on GitHub
Determine the next available issue number across all change types (feature, fix, workflow, website) by checking both local docs and remote branches, then reserve it by pushing an empty branch.
- Commits and pushes
In this repository59 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-runtimeSkill
- arc42-documentationSkill
- authoring-rolesSkill
- context-packSkill
- create-agent-skillSkill
- create-pr-azdoSkill
- create-pr-githubSkill
- detect-diagram-crossingsSkill
- flowchart_layout_optimizerSkill
- generate-demo-artifactsSkill
- generate-release-screenshotsSkill
- git-rebase-mainSkill
- merge-conflict-resolutionSkill
- next-issue-numberSkill
- pre-pr-checklistSkill
- retrospective-evidenceSkill
- run-dotnet-testsSkill
- run-uatSkill
- run-workflowSkill
- update-test-snapshotsSkill
- update-workflow-diagramSkill
- view-pr-githubSkill
- watch-uat-azdo-prSkill
- watch-uat-github-prSkill
- website-accessibility-checkSkill
- website-create-examplesSkill
- website-devtoolsSkill
- website-quality-checkSkill
- website-visual-assetsSkill
- agent-runtimeSkill
- arc42-documentationSkill
- authoring-rolesSkill
- context-packSkill
- create-agent-skillSkill
- create-pr-azdoSkill
- create-pr-githubSkill
- detect-diagram-crossingsSkill
- flowchart_layout_optimizerSkill
- generate-demo-artifactsSkill
- generate-release-screenshotsSkill
- git-rebase-mainSkill
- merge-conflict-resolutionSkill
- pre-pr-checklistSkill
- retrospective-evidenceSkill
- run-dotnet-testsSkill
- run-uatSkill
- run-workflowSkill
- update-test-snapshotsSkill
- update-workflow-diagramSkill
- view-pr-githubSkill
- watch-uat-azdo-prSkill
- watch-uat-github-prSkill
- website-accessibility-checkSkill
- website-create-examplesSkill
- website-devtoolsSkill
- website-quality-checkSkill
- website-visual-assetsSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Ensure unique issue numbering across all change types (feature, fix, workflow, website) by:
- Distinctive: line 90
Update and switch to main:
- Distinctive: line 96
Create the feature branch with the determined number:
- Distinctive: line 128
Create the fix branch with the determined number:
- Distinctive: line 160
Create the workflow branch with the determined number:
- Very specific: line 191
Verify the script ran correctly: scripts/next-issue-number.sh
- Distinctive: line 192
Check if someone pushed a new branch since you ran the script
- Distinctive: line 193
Delete your branch and re-run the script to get a fresh number
- Distinctive: line 197
After running the script and pushing your branch:
- Very specific: line 199
Verify the branch exists on GitHub: git ls-remote origin | grep "refs/heads/\(feature\|fix\|workflow\)/${NEXT_NUMBER}-"
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill Instructions
Purpose
Ensure unique issue numbering across all change types (feature, fix, workflow, website) 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 (declared in .agents/claude-settings.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"The .next-issue-number file is gitignored and refreshed each session. If it is missing or stale, fall back to running the script directly.
Hard Rules
Must
- Check ALL change types (feature, fix, workflow), not just one type
- Check both local docs folders AND remote GitHub branches (including recent copilot/* branches)
- Use the helper script
scripts/next-issue-number.shwhich handles all lookups - Push the new branch immediately after creation (before making any changes) to reserve the number
- Format the number as 3 digits with leading zeros (e.g., 033, 034, 035)
- Minimize Maintainer approvals by using a single stable wrapper script
Must Not
- Only check one change type (e.g., only features)
- Skip checking remote branches
- Delay pushing the branch until after making changes
- Assume the next number based on local state alone
Golden Example
# Step 1: Determine the next issue number (prefer pre-calculated value from session hook)
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"
# Step 2: Create the branch with the determined number
git fetch origin && git switch main && git pull --ff-only origin main
git switch -c feature/${NEXT_NUMBER}-my-feature-name
# Step 3: IMMEDIATELY push to reserve the number
git push -u origin HEAD
# Now proceed with your work...Actions
For Requirements Engineer (New Features)
Before creating a feature branch, get the next number:
if [ -f .next-issue-number ]; then NEXT_NUMBER=$(cat .next-issue-number) else NEXT_NUMBER=$(scripts/next-issue-number.sh) fiUpdate and switch to main:
git fetch origin && git switch main && git pull --ff-only origin mainCreate the feature branch with the determined number:
git switch -c feature/${NEXT_NUMBER}-<short-description>IMMEDIATELY push the branch to reserve the number:
git push -u origin HEAD- Proceed with gathering requirements and creating the specification
For Issue Analyst (Bug Fixes)
Before creating a fix branch, get the next number:
if [ -f .next-issue-number ]; then NEXT_NUMBER=$(cat .next-issue-number) else NEXT_NUMBER=$(scripts/next-issue-number.sh) fiUpdate and switch to main:
git fetch origin && git switch main && git pull --ff-only origin mainCreate the fix branch with the determined number:
git switch -c fix/${NEXT_NUMBER}-<short-description>IMMEDIATELY push the branch to reserve the number:
git push -u origin HEAD- Proceed with issue investigation and analysis
For Workflow Engineer (Workflow Improvements)
Before creating a workflow branch, get the next number:
if [ -f .next-issue-number ]; then NEXT_NUMBER=$(cat .next-issue-number) else NEXT_NUMBER=$(scripts/next-issue-number.sh) fiUpdate and switch to main:
git fetch origin && git switch main && git pull --ff-only origin mainCreate the workflow branch with the determined number:
git switch -c workflow/${NEXT_NUMBER}-<short-description>IMMEDIATELY push the branch to reserve the number:
git push -u origin HEAD- Proceed with workflow improvements
Troubleshooting
If GitHub authentication fails
The script will fall back to checking only local docs folders and warn you:
Warning: Could not fetch from GitHub. Using local data only.
Next available number based on local docs: 033In this case, manually verify on GitHub that no higher numbers exist in remote branches.
If the calculated number already exists
The script checks local docs, named branches, and recent copilot/* branches. If it still returns a number that exists:
- Verify the script ran correctly:
scripts/next-issue-number.sh - Check if someone pushed a new branch since you ran the script
- Delete your branch and re-run the script to get a fresh number
Verification
After running the script and pushing your branch:
- Verify the branch exists on GitHub:
git ls-remote origin | grep "refs/heads/\(feature\|fix\|workflow\)/${NEXT_NUMBER}-" - Confirm no docs folder exists yet:
ls -d docs/{features,issues,workflow}/${NEXT_NUMBER}-* 2>/dev/null(should be empty)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

