Agent spawn requirements schema (JSON + hook validation) #59
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/claude-custom#59
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Plan
plan-2026-02-26-tf-modularize-postgres-- Phase 7f-2Repo
forgejo_admin/claude-customUser Story
As Betty Sue (main session agent)
I want agent spawn requirements defined in a JSON schema validated by the hook
So that adding a new agent type means adding a JSON entry, not editing bash
Context
The
check-agent-spawn.shhook currently uses hardcoded regexes (issue #57 just merged). This works for 4 agent types but doesn't scale. A JSON schema makes the contract between Betty Sue (caller) and agents (callees) explicit, self-documenting, and extensible.Inspired by data augmentation patterns where inputs and outputs are clearly defined to scope exactly where intelligence is needed. Each agent type has a structured contract: what must be in the prompt, what the agent produces, and whether it runs in isolation.
File Targets
Files to create:
schemas/agent-spawn-requirements.json-- the schema defining required_patterns, description, produces, isolation per agent typeFiles to modify:
hooks/check-agent-spawn.sh-- read schema, validate prompt against required_patterns for the given subagent_type. Deny unknown types.Files NOT to touch:
agents/*.md)Acceptance Criteria
schemas/agent-spawn-requirements.jsonwith entries for: dev, qa, general-purpose, ExploreTest Expectations
echo '{"tool_input":{"prompt":"Fix issue #100","subagent_type":"dev"}}' | bash hooks/check-agent-spawn.shexits 0echo '{"tool_input":{"prompt":"Review PR #101. Issue #100","subagent_type":"qa"}}' | bash hooks/check-agent-spawn.shexits 0echo '{"tool_input":{"prompt":"Update docs. plan-foo","subagent_type":"general-purpose"}}' | bash hooks/check-agent-spawn.shexits 0echo '{"tool_input":{"prompt":"Explore the codebase","subagent_type":"dev"}}' | bash hooks/check-agent-spawn.shoutputs deny JSONecho '{"tool_input":{"prompt":"Do stuff","subagent_type":"new-unknown-type"}}' | bash hooks/check-agent-spawn.shoutputs deny JSONConstraints
Checklist
Related
phase-7f-2-agent-spawn-schema-- phase notephase-7f-1-deprecate-issue-creator-- prerequisite (issue-gate hook)agent-spawn-conventions-- convention to update after merge