Epilogue nits: hook updates, Dottie config, worktree cleanup #86

Closed
opened 2026-03-13 20:34:44 +00:00 by forgejo_admin · 0 comments
Contributor

Lineage

plan-pal-e-agency → Epilogue (nits #5-9)

Repo

forgejo_admin/claude-custom

User Story

As a platform operator
I want hooks and agent configs to be complete and current
So that enforcement gaps don't let agents bypass boundaries

Context

QA review of PR #85 (enforcement nits — dottie spawn gate, hook fixes) found 5 items: 3 non-blocking nits and 2 deferred scope items. Per convention, these were captured in the plan Epilogue table.

File Targets

Files to modify:

  • hooks/block-docs-writes.sh — add missing board tools (delete_project, delete_board, remove_board_item, bulk_move_board_items) and remove stale sprint tool references (create_sprint, update_sprint, delete_sprint, list_sprints, get_sprint)
  • hooks/check-agent-spawn.sh — consolidate dottie and general-purpose agent types (they're functionally identical in the spawn schema, creating dual maintenance)
  • hooks/inject-dottie-context.sh — add get_note(slug="agent-dottie") instruction and block-first convention reference to context injection
  • hooks/ — NEW: add block-dottie-code-writes.sh PreToolUse hook that blocks Dottie (general-purpose subagent) from using Write/Edit/Bash on repo files (deferred from Phase 2)
  • hooks/ — NEW: add cleanup-worktrees.sh that runs on session start or post-merge to clean stale worktrees (deferred from Phase 2)

Acceptance Criteria

  • block-docs-writes.sh blocks all current board write tools and has no references to removed sprint tools
  • Spawn schema treats dottie and general-purpose identically (single code path, not dual)
  • Dottie context injection includes agent-dottie note reference and block-first convention
  • Dottie PreToolUse hook blocks Write/Edit/Bash calls targeting repo directories (~/pal-e-*, ~/basketball-api, ~/claude-custom, etc.) but allows pal-e-docs MCP writes
  • Worktree cleanup script lists stale worktrees and removes them (with confirmation or auto if >7 days old)

Test Expectations

  • Manual test: verify block-docs-writes.sh catches delete_board tool call
  • Manual test: verify Dottie code write hook blocks Write to ~/pal-e-docs/src/file.py
  • Manual test: verify worktree cleanup identifies stale worktrees from git worktree list

Constraints

  • Hooks are hardlinked to ~/.claude/hooks/ — changes deploy on git pull
  • Match existing hook patterns (check-agent-spawn.sh, block-docs-writes.sh)
  • PreToolUse hooks must output JSON: {"decision": "block", "reason": "..."} or {"decision": "allow"}
  • Do NOT access pal-e-docs MCP tools — this is a repo-only agent

Checklist

  • PR opened
  • All hooks follow existing patterns
  • No unrelated changes
  • plan-pal-e-agency — parent plan
  • PR #85 — source of these nits
### Lineage `plan-pal-e-agency` → Epilogue (nits #5-9) ### Repo `forgejo_admin/claude-custom` ### User Story As a platform operator I want hooks and agent configs to be complete and current So that enforcement gaps don't let agents bypass boundaries ### Context QA review of PR #85 (enforcement nits — dottie spawn gate, hook fixes) found 5 items: 3 non-blocking nits and 2 deferred scope items. Per convention, these were captured in the plan Epilogue table. ### File Targets Files to modify: - `hooks/block-docs-writes.sh` — add missing board tools (`delete_project`, `delete_board`, `remove_board_item`, `bulk_move_board_items`) and remove stale sprint tool references (`create_sprint`, `update_sprint`, `delete_sprint`, `list_sprints`, `get_sprint`) - `hooks/check-agent-spawn.sh` — consolidate dottie and general-purpose agent types (they're functionally identical in the spawn schema, creating dual maintenance) - `hooks/inject-dottie-context.sh` — add `get_note(slug="agent-dottie")` instruction and block-first convention reference to context injection - `hooks/` — NEW: add `block-dottie-code-writes.sh` PreToolUse hook that blocks Dottie (general-purpose subagent) from using Write/Edit/Bash on repo files (deferred from Phase 2) - `hooks/` — NEW: add `cleanup-worktrees.sh` that runs on session start or post-merge to clean stale worktrees (deferred from Phase 2) ### Acceptance Criteria - [ ] `block-docs-writes.sh` blocks all current board write tools and has no references to removed sprint tools - [ ] Spawn schema treats dottie and general-purpose identically (single code path, not dual) - [ ] Dottie context injection includes `agent-dottie` note reference and block-first convention - [ ] Dottie PreToolUse hook blocks Write/Edit/Bash calls targeting repo directories (~/pal-e-*, ~/basketball-api, ~/claude-custom, etc.) but allows pal-e-docs MCP writes - [ ] Worktree cleanup script lists stale worktrees and removes them (with confirmation or auto if >7 days old) ### Test Expectations - [ ] Manual test: verify block-docs-writes.sh catches `delete_board` tool call - [ ] Manual test: verify Dottie code write hook blocks `Write` to `~/pal-e-docs/src/file.py` - [ ] Manual test: verify worktree cleanup identifies stale worktrees from `git worktree list` ### Constraints - Hooks are hardlinked to `~/.claude/hooks/` — changes deploy on `git pull` - Match existing hook patterns (check-agent-spawn.sh, block-docs-writes.sh) - PreToolUse hooks must output JSON: `{"decision": "block", "reason": "..."}` or `{"decision": "allow"}` - Do NOT access pal-e-docs MCP tools — this is a repo-only agent ### Checklist - [ ] PR opened - [ ] All hooks follow existing patterns - [ ] No unrelated changes ### Related - `plan-pal-e-agency` — parent plan - PR #85 — source of these nits
forgejo_admin 2026-03-13 20:52:48 +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#86
No description provided.