Board hook automation: session-start sync + post-merge done-move (Phase 11d+11e) #97

Closed
opened 2026-03-14 21:25:40 +00:00 by forgejo_admin · 0 comments
Contributor

Lineage

plan-pal-e-agency → Phase 11 (Board Workflow Enforcement) → 11d + 11e

Repo

forgejo_admin/claude-custom

User Story

As Betty Sue
I want boards to auto-sync at session start and board items to auto-move to done after merge
So that board state stays accurate without manual intervention

Context

Phase 11 of the Agency plan connects board infrastructure into a continuous kanban workflow. The board SOP (sop-board-workflow) defines sync cadence: session start + post-merge. Currently, session-start sync is manual (Betty Sue must remember to call sync_board), and remind-sprint-update.sh only reminds to move board items — it doesn't actually do it. This issue automates both.

Also cleans up residual "sprint" terminology in hook files and settings.json (QA nit from PR #94).

The pal-e-docs API base URL is: https://pal-e-docs.tail5b443a.ts.net

File Targets

Files to modify or create:

11d — Session-start auto-sync:

  • hooks/session-start-board-sync.sh — NEW. PostToolUse or SessionStart hook that calls sync_board on active project boards via the pal-e-docs API. Should call POST /boards/{slug}/sync for each active board. Active boards: board-pal-e-platform, board-pal-e-docs, board-pal-e-agency, board-westside-basketball, board-pal-e-pac. Use the same auth pattern as other hooks that call pal-e-docs (check hooks/forgejo-helper.sh or similar for URL/auth patterns).
  • settings.json — Add the new hook to SessionStart event hooks array.

11e — Post-merge auto-board-update + sprint terminology cleanup:

  • hooks/remind-sprint-update.sh → rename to hooks/board-item-on-merge.sh. Change from Layer 4 (remind) to Layer 3 (auto) behavior: after a PR merge, identify the associated board item and move it to the done column via PATCH /boards/{board_slug}/items/{item_id} with {"column": "done"}. The board item can be found by matching the Forgejo issue URL against board items.
  • settings.json — Update the hook reference from remind-sprint-update.sh to board-item-on-merge.sh. Also clean any other residual "sprint" references in settings.json.
  • hooks/remind-update-docs.sh — Clean any "sprint" terminology in comments/messages (non-functional change).

Files NOT to touch:

  • skills/ — already cleaned in PR #94
  • commands/update-docs.md — already cleaned in PR #92

Acceptance Criteria

  • hooks/session-start-board-sync.sh exists and calls sync on 5+ active boards
  • SessionStart hooks in settings.json include the new sync hook
  • hooks/board-item-on-merge.sh exists (renamed from remind-sprint-update.sh)
  • hooks/remind-sprint-update.sh is deleted
  • Post-merge hook in settings.json references board-item-on-merge.sh
  • grep -r "sprint" hooks/ settings.json returns zero matches (excluding git history)
  • Board sync hook is idempotent (safe to run multiple times)
  • Post-merge hook gracefully handles cases where no board item exists for the merged issue

Test Expectations

  • bash hooks/session-start-board-sync.sh runs without error (may need env vars)
  • grep -r "sprint" hooks/ settings.json returns no matches
  • Each hook script is executable (chmod +x)
  • No automated tests — hook scripts only

Constraints

  • Use curl for pal-e-docs API calls (no SDK dependency in hooks)
  • Source credentials from ~/secrets/pal-e-services/forgejo.env for any Forgejo API calls
  • pal-e-docs API base: https://pal-e-docs.tail5b443a.ts.net
  • The session-start hook should be fast — parallel curl calls or fire-and-forget pattern preferred
  • The post-merge hook receives tool input as JSON on stdin (PostToolUse pattern) — parse the merged PR's issue URL from the tool output
  • Follow existing hook patterns in the repo (check other PostToolUse hooks for input parsing examples)

Checklist

  • PR opened
  • No unrelated changes
  • Closes this issue
  • project-pal-e-agency — project
  • phase-pal-e-agency-11-board-workflow-enforcement — parent phase
  • sop-board-workflow — defines sync cadence and column semantics
  • hook-catalog — enforcement surface map (Layer 3 + Layer 4 hooks)
### Lineage `plan-pal-e-agency` → Phase 11 (Board Workflow Enforcement) → 11d + 11e ### Repo `forgejo_admin/claude-custom` ### User Story As Betty Sue I want boards to auto-sync at session start and board items to auto-move to done after merge So that board state stays accurate without manual intervention ### Context Phase 11 of the Agency plan connects board infrastructure into a continuous kanban workflow. The board SOP (`sop-board-workflow`) defines sync cadence: session start + post-merge. Currently, session-start sync is manual (Betty Sue must remember to call `sync_board`), and `remind-sprint-update.sh` only reminds to move board items — it doesn't actually do it. This issue automates both. Also cleans up residual "sprint" terminology in hook files and settings.json (QA nit from PR #94). The pal-e-docs API base URL is: `https://pal-e-docs.tail5b443a.ts.net` ### File Targets Files to modify or create: **11d — Session-start auto-sync:** - `hooks/session-start-board-sync.sh` — NEW. PostToolUse or SessionStart hook that calls `sync_board` on active project boards via the pal-e-docs API. Should call `POST /boards/{slug}/sync` for each active board. Active boards: `board-pal-e-platform`, `board-pal-e-docs`, `board-pal-e-agency`, `board-westside-basketball`, `board-pal-e-pac`. Use the same auth pattern as other hooks that call pal-e-docs (check `hooks/forgejo-helper.sh` or similar for URL/auth patterns). - `settings.json` — Add the new hook to SessionStart event hooks array. **11e — Post-merge auto-board-update + sprint terminology cleanup:** - `hooks/remind-sprint-update.sh` → rename to `hooks/board-item-on-merge.sh`. Change from Layer 4 (remind) to Layer 3 (auto) behavior: after a PR merge, identify the associated board item and move it to the `done` column via `PATCH /boards/{board_slug}/items/{item_id}` with `{"column": "done"}`. The board item can be found by matching the Forgejo issue URL against board items. - `settings.json` — Update the hook reference from `remind-sprint-update.sh` to `board-item-on-merge.sh`. Also clean any other residual "sprint" references in settings.json. - `hooks/remind-update-docs.sh` — Clean any "sprint" terminology in comments/messages (non-functional change). Files NOT to touch: - `skills/` — already cleaned in PR #94 - `commands/update-docs.md` — already cleaned in PR #92 ### Acceptance Criteria - [ ] `hooks/session-start-board-sync.sh` exists and calls sync on 5+ active boards - [ ] SessionStart hooks in `settings.json` include the new sync hook - [ ] `hooks/board-item-on-merge.sh` exists (renamed from remind-sprint-update.sh) - [ ] `hooks/remind-sprint-update.sh` is deleted - [ ] Post-merge hook in `settings.json` references `board-item-on-merge.sh` - [ ] `grep -r "sprint" hooks/ settings.json` returns zero matches (excluding git history) - [ ] Board sync hook is idempotent (safe to run multiple times) - [ ] Post-merge hook gracefully handles cases where no board item exists for the merged issue ### Test Expectations - [ ] `bash hooks/session-start-board-sync.sh` runs without error (may need env vars) - [ ] `grep -r "sprint" hooks/ settings.json` returns no matches - [ ] Each hook script is executable (`chmod +x`) - No automated tests — hook scripts only ### Constraints - Use `curl` for pal-e-docs API calls (no SDK dependency in hooks) - Source credentials from `~/secrets/pal-e-services/forgejo.env` for any Forgejo API calls - pal-e-docs API base: `https://pal-e-docs.tail5b443a.ts.net` - The session-start hook should be fast — parallel curl calls or fire-and-forget pattern preferred - The post-merge hook receives tool input as JSON on stdin (PostToolUse pattern) — parse the merged PR's issue URL from the tool output - Follow existing hook patterns in the repo (check other PostToolUse hooks for input parsing examples) ### Checklist - [ ] PR opened - [ ] No unrelated changes - [ ] Closes this issue ### Related - `project-pal-e-agency` — project - `phase-pal-e-agency-11-board-workflow-enforcement` — parent phase - `sop-board-workflow` — defines sync cadence and column semantics - `hook-catalog` — enforcement surface map (Layer 3 + Layer 4 hooks)
forgejo_admin 2026-03-14 21:38:21 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/claude-custom#97
No description provided.