Skip to content

feat: Add hooks category to patch manifest for agent-loop template #57

Description

@rdwj

Summary

The agent-template now ships a hooks/ directory with lifecycle hook support (setup_complete, shutdown, pre/post_tool_use, pre/post_mcp_connect, mcp_auth_refresh). The fips-agents patch command doesn't know about this directory because .fips-template.yaml has no hooks category.

Scaffolded agents that run fips-agents patch won't receive the example hook files or new hook YAML bindings added to the template.

What needs to change

Add a hooks category to the agent-loop (and optionally workflow) .fips-template.yaml:

hooks:
  description: Lifecycle hook examples and bindings
  patterns:
    - hooks/**/*
  ask_before_patch: true

ask_before_patch: true is recommended since developers may have customized their hook scripts.

Files in the template's hooks/ directory

  • hooks/setup-memory.yaml — example hook binding (setup_complete event)
  • hooks/fetch-memory.sh — example hook script (MemoryHub memory loading)

Related

  • fips-agents/agent-template aa75998 — lifecycle hook system
  • fips-agents/agent-template d64c95b — pre/post_mcp_connect events
  • fips-agents/agent-template b64fc01 — mcp_auth_refresh event (#225)
  • fips-agents/agent-template 85419aa — headers field on McpServerConfig (#224)

Additional context

agent.yaml is in AGENT_NEVER_PATCH (correctly — users customize it), so the new hooks: [] section and headers: documentation won't auto-merge. Users pick these up via fips-agents patch docs which updates CLAUDE.md, or by manually merging from the template's agent.yaml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions