Skip to content

feat: target-aware hook event diagnostics #541

@danielmeppiel

Description

@danielmeppiel

Summary

When APM deploys hooks for a package, it should log which hook event names were found and note if they may not be recognized by the target platform. Currently APM silently deploys all events regardless of target.

Background

The hooks specification has no unified standard — three implementations exist with divergent event names and schemas:

Platform Event naming Example events Spec reference
GitHub Copilot Agent (cloud/CLI) camelCase sessionStart, preToolUse, postToolUse, userPromptSubmitted docs.github.com
VS Code (Copilot Chat extension) PascalCase SessionStart, PreToolUse, PostToolUse, UserPromptSubmit code.visualstudio.com
Claude Code PascalCase SessionStart, PreToolUse, PostToolUse, UserPromptSubmit, PermissionRequest, FileChanged code.claude.com

Additionally, each platform supports different events — Claude Code has 25+ events, while GH Agent has 8.

Proposed Behavior

When deploying hooks to a target (e.g., copilot, claude, cursor, codex):

  1. Log the event names found in the hook JSON (e.g., "Deployed 3 hook events: preToolUse, postToolUse, sessionStart")
  2. Optionally note if events use a naming convention that may not match the target (e.g., "Note: camelCase events detected — these are GitHub Copilot Agent format; VS Code expects PascalCase")

Scope

  • Informational only — do NOT block deployment
  • Emit via existing logger.info or diagnostics mechanism
  • Consider a future --strict mode that warns on unrecognized events per target

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions