Skip to content

[Feature]: Hook events for the bundled bug extension commands #4799

Description

@alexcpn

Problem Statement

Core commands (plan, tasks, implement, …) check .specify/extensions.yml
for before_* / after_* hooks. The three commands in the bundled bug
extension (speckit.bug.assess, speckit.bug.fix, speckit.bug.test) do not,
and no *_bug_* events are defined. That leaves other extensions no way to add
a step to the bug workflow. A manifest that registers before_bug_assess passes
validation, but the hook never fires.

Proposed Solution

Add the standard hook-check block (the same block templates/commands/plan.md
uses) to each bug command, for these events:

Event Where it fires
before_bug_assess After Slug Resolution/Prerequisites (so BUG_SLUG / BUG_DIR exist), before Execution → Ingest
after_bug_assess After assessment.md is written
before_bug_fix / after_bug_fix Around fix.md
before_bug_test / after_bug_test Around test.md

before_bug_assess has to run after slug resolution rather than at the top
of the command, because a pre-hook needs to know BUG_DIR to write into. This
uses the handoff the bug commands already rely on: "downstream commands in the
same session may reuse [the slug] from context without re-prompting."

With no hooks registered, behavior is exactly as today.

Alternatives Considered

  • Hook at the very top of assess, before slug resolution. That is
    consistent with core commands, but the hook would have nowhere to write and
    would have to guess the slug.

Component

Extensions: bundled bug extension (extensions/bug/)

AI Agent (if applicable)

All. Hooks are plain command-template instructions.

Use Cases

Acceptance Criteria

  • speckit.bug.{assess,fix,test} check .specify/extensions.yml for their
    before_* / after_* events using the same block as core commands.
  • before_bug_assess fires after BUG_DIR exists and before Ingest.
  • The new events are listed under Hook Events in
    EXTENSION-API-REFERENCE.md.
  • With no hooks registered, the command output is unchanged.

I'm happy to send the PR.

Additional Context

AI Disclosure

Drafted with Claude Code (Claude Opus 5.5) from my notes. I reviewed it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-assessRun the Spec Kit idea-assessment pipeline on this feature requesttriage-can-waitVerdict: valid and in-scope but deprioritized; held behind the evidence gate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions