plugin hook: refuse an issue create with no prior duplicate search in the session #705

Open
opened 2026-10-03 19:50:20 +00:00 by hexajon · 0 comments
Owner

What to build

A hook in madtea's Claude Code plugin, before madt_issues creates an issue (the single-create, batch, and epic paths). The hook looks in the session's own file for a prior existing-issue search in the same session: a madt_issues action=list with a query, a search, or an action=rank. When the session shows no such search, the hook refuses. Nothing is created, and the refusal tells the agent to search the tracker first (madt_issues action=list q=..., or action=rank), then retry.

The hook reads no setting the agent can change (ADR 0009). The session-file format is not a documented contract, so the hook refuses with a clear message when it cannot read the file.

Why

A new issue must not duplicate an open one. Today nothing makes the duplicate scan happen before a create, so a parallel issue can be filed for work an open issue already tracks. The check makes the scan a step that cannot be skipped.

  • #662, the same plugin-hook pattern, before a different write.

Acceptance

  • A create with no prior existing-issue search in the session is refused, and nothing is created.
  • A create that follows an issue search in the same session is allowed.
  • A create that follows only an unrelated read, not an issue search, is refused.
  • An unreadable session file is refused, with a clear message.
## What to build A hook in madtea's Claude Code plugin, before `madt_issues` creates an issue (the single-create, batch, and epic paths). The hook looks in the session's own file for a prior existing-issue search in the same session: a `madt_issues action=list` with a query, a search, or an `action=rank`. When the session shows no such search, the hook refuses. Nothing is created, and the refusal tells the agent to search the tracker first (`madt_issues action=list q=...`, or `action=rank`), then retry. The hook reads no setting the agent can change (ADR 0009). The session-file format is not a documented contract, so the hook refuses with a clear message when it cannot read the file. ## Why A new issue must not duplicate an open one. Today nothing makes the duplicate scan happen before a create, so a parallel issue can be filed for work an open issue already tracks. The check makes the scan a step that cannot be skipped. ## Related - #662, the same plugin-hook pattern, before a different write. ## Acceptance - A create with no prior existing-issue search in the session is refused, and nothing is created. - A create that follows an issue search in the same session is allowed. - A create that follows only an unrelated read, not an issue search, is refused. - An unreadable session file is refused, with a clear message.
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
sixfold-space/madtea#705
No description provided.