Deprecate issue-creator agent + change spawn hook to require issue reference #57

Closed
opened 2026-03-07 15:50:24 +00:00 by forgejo_admin · 0 comments
Contributor

Plan

plan-2026-02-26-tf-modularize-postgres -- Phase 7f-1 (subphase of 7f Doc Cleanup + SOP Hardening)

Repo

forgejo_admin/claude-custom

User Story

As Betty Sue (main session agent)
I want the agent spawn hook to require a Forgejo issue reference instead of a plan reference
So that every spawned agent traces to a specific issue and undirected agent spawns are blocked

Context

The check-agent-spawn.sh hook currently requires plan-* or project-* in agent prompts. This was the right guard initially, but now that issues are the unit of work (issue-as-spec), the gate should be an issue reference.

The issue-creator agent type is also being removed. Betty Sue creates issues directly via mcp__forgejo__create_issue. Issue scoping is a planning conversation between Betty Sue and Lucas — not something to delegate to an agent.

Dottie (general-purpose doc ops) is the exception — her work isn't tied to Forgejo issues. She uses plan references.

Current hook logic (line 17): if echo "$PROMPT" | grep -qE 'plan-|project-'; then

New logic should be:

  • If prompt contains issue reference (#[0-9]+, issue, Issue, Forgejo issue) → allow
  • If prompt contains plan reference (plan-) AND subagent_type is general-purpose → allow (Dottie exception)
  • Otherwise → deny with message: "No issue, no agent."

The subagent_type can be read from the tool input: jq -r '.tool_input.subagent_type // empty'

File Targets

Files the agent should modify:

  • hooks/check-agent-spawn.sh -- change grep from plan-|project- to issue reference check with Dottie exception
  • settings.json -- remove issue-creator from agent types
  • hooks/inject-subagent-context.sh -- remove issue-creator case
  • agents/betty-sue.md -- remove issue-creator references

Files the agent should delete:

  • agents/issue-creator.md -- the agent definition being removed

Files the agent should NOT touch:

  • agents/dev.md, agents/qa.md -- no changes needed
  • skills/create-issue/SKILL.md -- keep the skill, Betty Sue uses it inline
  • Any hooks not listed above

Also clean up:

  • .claude/worktrees/agent-a27bc6af/ -- stale worktree, delete
  • .claude/worktrees/agent-acda354e/ -- stale worktree, delete
  • .claude/worktrees/agent-a6ee25b5/ -- stale worktree, delete

Acceptance Criteria

  • issue-creator agent type fully removed (agent def, settings, inject hook)
  • check-agent-spawn.sh requires issue reference for dev/QA/Explore agents
  • check-agent-spawn.sh allows plan reference for general-purpose agents (Dottie)
  • Dev agent prompt like "Fix issue #100 on repo. Plan: plan-foo" passes the hook
  • Dottie prompt like "Update docs. Plan: plan-foo" passes the hook
  • Bare prompt like "Explore the codebase" is denied
  • betty-sue.md no longer references issue-creator
  • Stale worktrees cleaned up

Test Expectations

  • Manual test: spawn a dev agent with issue reference → allowed
  • Manual test: spawn a general-purpose agent with plan reference → allowed
  • Manual test: spawn an agent with no issue or plan → denied
  • Run command: echo '{"tool_input":{"prompt":"Fix issue #100","subagent_type":"dev"}}' | bash hooks/check-agent-spawn.sh (should exit 0)

Constraints

  • The hook must be backward compatible with existing dev/QA spawn patterns that include both issue AND plan references
  • Keep create-issue SKILL.md — Betty Sue uses it inline, not via agent
  • The deny message should be clear: "No issue, no agent. Dev/QA/Explore agents require a Forgejo issue reference. Use general-purpose with a plan reference for doc ops."

Checklist

  • PR opened
  • Tests pass (manual hook tests)
  • No unrelated changes
  • phase-7f-1-deprecate-issue-creator -- phase note
  • agent-spawn-conventions -- convention to update after merge
  • agent-workflow -- references agent types
### Plan `plan-2026-02-26-tf-modularize-postgres` -- Phase 7f-1 (subphase of 7f Doc Cleanup + SOP Hardening) ### Repo `forgejo_admin/claude-custom` ### User Story As Betty Sue (main session agent) I want the agent spawn hook to require a Forgejo issue reference instead of a plan reference So that every spawned agent traces to a specific issue and undirected agent spawns are blocked ### Context The `check-agent-spawn.sh` hook currently requires `plan-*` or `project-*` in agent prompts. This was the right guard initially, but now that issues are the unit of work (issue-as-spec), the gate should be an issue reference. The `issue-creator` agent type is also being removed. Betty Sue creates issues directly via `mcp__forgejo__create_issue`. Issue scoping is a planning conversation between Betty Sue and Lucas — not something to delegate to an agent. Dottie (general-purpose doc ops) is the exception — her work isn't tied to Forgejo issues. She uses plan references. Current hook logic (line 17): `if echo "$PROMPT" | grep -qE 'plan-|project-'; then` New logic should be: - If prompt contains issue reference (`#[0-9]+`, `issue`, `Issue`, `Forgejo issue`) → allow - If prompt contains plan reference (`plan-`) AND subagent_type is `general-purpose` → allow (Dottie exception) - Otherwise → deny with message: "No issue, no agent." The subagent_type can be read from the tool input: `jq -r '.tool_input.subagent_type // empty'` ### File Targets Files the agent should modify: - `hooks/check-agent-spawn.sh` -- change grep from `plan-|project-` to issue reference check with Dottie exception - `settings.json` -- remove `issue-creator` from agent types - `hooks/inject-subagent-context.sh` -- remove issue-creator case - `agents/betty-sue.md` -- remove issue-creator references Files the agent should delete: - `agents/issue-creator.md` -- the agent definition being removed Files the agent should NOT touch: - `agents/dev.md`, `agents/qa.md` -- no changes needed - `skills/create-issue/SKILL.md` -- keep the skill, Betty Sue uses it inline - Any hooks not listed above Also clean up: - `.claude/worktrees/agent-a27bc6af/` -- stale worktree, delete - `.claude/worktrees/agent-acda354e/` -- stale worktree, delete - `.claude/worktrees/agent-a6ee25b5/` -- stale worktree, delete ### Acceptance Criteria - [ ] `issue-creator` agent type fully removed (agent def, settings, inject hook) - [ ] `check-agent-spawn.sh` requires issue reference for dev/QA/Explore agents - [ ] `check-agent-spawn.sh` allows plan reference for general-purpose agents (Dottie) - [ ] Dev agent prompt like `"Fix issue #100 on repo. Plan: plan-foo"` passes the hook - [ ] Dottie prompt like `"Update docs. Plan: plan-foo"` passes the hook - [ ] Bare prompt like `"Explore the codebase"` is denied - [ ] `betty-sue.md` no longer references issue-creator - [ ] Stale worktrees cleaned up ### Test Expectations - [ ] Manual test: spawn a dev agent with issue reference → allowed - [ ] Manual test: spawn a general-purpose agent with plan reference → allowed - [ ] Manual test: spawn an agent with no issue or plan → denied - Run command: `echo '{"tool_input":{"prompt":"Fix issue #100","subagent_type":"dev"}}' | bash hooks/check-agent-spawn.sh` (should exit 0) ### Constraints - The hook must be backward compatible with existing dev/QA spawn patterns that include both issue AND plan references - Keep `create-issue` SKILL.md — Betty Sue uses it inline, not via agent - The deny message should be clear: "No issue, no agent. Dev/QA/Explore agents require a Forgejo issue reference. Use general-purpose with a plan reference for doc ops." ### Checklist - [ ] PR opened - [ ] Tests pass (manual hook tests) - [ ] No unrelated changes ### Related - `phase-7f-1-deprecate-issue-creator` -- phase note - `agent-spawn-conventions` -- convention to update after merge - `agent-workflow` -- references agent types
forgejo_admin 2026-03-07 17:16:41 +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#57
No description provided.