Phase 7f-7: Post-Merge Automation

phase-postgres-7f-7-post-merge-automation Phase

Goal: Create an executable /update-docs slash command that implements the sop-post-merge-docs traceability chain walk, triggered by the existing remind-update-docs.sh PostToolUse hook after PR merges.
Owner: Dev agent
Repo: forgejo_admin/claude-custom
Depends on: None (hook and SOP already exist)

Scope

The post-merge documentation SOP (sop-post-merge-docs) defines a 7-step traceability chain walk. The hook (remind-update-docs.sh) already fires on PostToolUse after mcp__forgejo__merge_approved_pr and injects a reminder to run /update-docs. But the /update-docs command doesn't exist yet -- no commands/ directory exists in claude-custom at all.
This phase creates the first custom slash command in the system.

Why

Without the slash command, the hook reminder is a dead end -- it tells Betty Sue to run a command that doesn't exist. The SOP is followed manually (or not at all). An executable command makes the workflow structured and repeatable.

Deliverables

  • commands/update-docs.md -- Claude Code slash command implementing the skill-update-docs workflow as a structured prompt
  • Deploy mechanism -- ensure commands are copied to ~/.claude/commands/ alongside hooks (may need deploy script update or documentation)
  • Verification -- test that /update-docs appears in Claude Code's command list and executes the traceability chain

Implementation Notes

Claude Code custom commands are .md files. Global commands live in ~/.claude/commands/. The command file is a markdown prompt that Claude follows when the user types /update-docs.
The command should reference the skill-update-docs workflow (9 steps) and use the MCP tools listed there: get_note, update_note, create_note, get_sprint_board, move_sprint_item.
Key design decisions:
  • The command needs context about WHICH PR was just merged -- the hook's additionalContext already provides this
  • The command should ask for the traceability chain if not obvious (phase slug, plan slug, project slug, sprint)
  • The command should be idempotent -- safe to run multiple times

Existing Infrastructure

Component Status Location
PostToolUse hook DEPLOYED <code>~/.claude/hooks/remind-update-docs.sh</code>
SOP ACTIVE <code>sop-post-merge-docs</code> (pal-e-docs)
Skill note ACTIVE <code>skill-update-docs</code> (pal-e-docs)
Slash command MISSING Needs <code>commands/update-docs.md</code>
Commands directory MISSING Needs <code>claude-custom/commands/</code>
  • phase-postgres-7f-doc-cleanup-sop -- parent phase
  • sop-post-merge-docs -- the SOP this command implements
  • skill-update-docs -- the workflow description in pal-e-docs
  • plan-2026-02-26-tf-modularize-postgres -- parent plan