Playbook: Fix Missing .claude/commands (sr, commit, create-pr)
When to use
/sr,/commit, or/create-prnot available in Claude Code VS Code extension for a reporepo-consistency-audit.mdreports missing command files
Root cause
.claude/commands/*.md files define project-specific slash commands. Without them, only the
global ~/.claude/commands/ commands are available (and even those may not execute if
settings.json is missing auto-approvals — fix that first: fix-claude-settings-missing.md).
The three required commands
| File | Purpose | Source |
|---|---|---|
sr.md | Session report — lists open items at session end | p24-infra .claude/commands/sr.md |
commit.md | Auto-commit with conventional message | p24-infra .claude/commands/commit.md |
create-pr.md | Create PR to dev with auto-detected issue link | Choose template based on repo type (see below) |
Fix
Step 1 — Check what’s missing
$repo = "C:\code_2026\<repo>"
$cmds = "$repo\.claude\commands"
@("sr.md","commit.md","create-pr.md") | ForEach-Object {
"$_`: $(if (Test-Path "$cmds\$_") { 'OK' } else { 'MISSING' })"
}Step 2 — Copy sr.md and commit.md (generic, work in all repos)
$src = "C:\code_2026\p24-infra\.claude\commands"
$cmds = "C:\code_2026\<repo>\.claude\commands"
New-Item -ItemType Directory -Force $cmds | Out-Null
Copy-Item "$src\sr.md" "$cmds\sr.md"
Copy-Item "$src\commit.md" "$cmds\commit.md"sr.md and commit.md are fully generic — they work in any repo without modification.
Step 3 — Add create-pr.md
All repos now use the same milestone-only pipeline (the GitHub Projects v2 board sync was
removed 2026-07-08 — silent failures, unreliable, and never the actual dispatch mechanism).
Set-PipelineState just calls gh issue edit --milestone.
Copy-Item "C:\code_2026\p24-infra\.claude\commands\create-pr.md" "$cmds\create-pr.md"If the target repo uses a dev base branch instead of main (e.g. et-operational-platform),
adjust the --base argument in the copied template accordingly.
Step 4 — Commit
git -C "C:\code_2026\<repo>" add .claude/commands/
git -C "C:\code_2026\<repo>" commit -m "chore: add missing .claude/commands — sr, commit, create-pr
Adds /sr (session report), /commit (auto-commit), /create-pr (PR to dev).
Fixes missing slash commands in Claude Code VS Code extension.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>"
git -C "C:\code_2026\<repo>" push origin HEADStep 5 — Verify
Reload VS Code window in the target repo. Type /s — sr should appear in autocomplete.
Affected repos (as of 2026-06-28)
| Repo | Missing | Template |
|---|---|---|
| brandpilot | sr.md only | copy from p24-infra |
| radekkonarski-personal-brand | sr.md, commit.md, create-pr.md | sr+commit from p24-infra; create-pr from whatsup template |
| amazon-kdp-tango | sr.md, commit.md, create-pr.md | sr+commit from p24-infra; create-pr from whatsup template |
Escalation
If commands appear in autocomplete but fail on execution: check settings.json has sufficient
allow entries — skill execution uses the same permission system as manual tool calls.
If commit.md produces wrong author: the skill uses Co-Authored-By: Claude Sonnet 4.6 — update
the model name if the project uses a different Claude model.