Skip to content

Skill-invocation guard on plan/research file edits should not fire once the plan already has a finalized status and decision #312

Description

@DrumRobot

Problem

A PostToolUse guard fires automatically whenever a plan or research markdown file is edited, and instructs the assistant to invoke a specific skill afterward. The guard's purpose is to make sure in-progress plan edits go through that skill's review flow.

However, the guard fires unconditionally on every edit, including edits made after a plan has already reached a finalized state — for example, a plan file whose frontmatter already records status: ready and a recorded decision: value, being edited only to relocate it to a different repository or to correct a file path reference. In a single session this guard fired 6+ times for edits of that kind, none of which needed the review flow the guard exists to protect. Each time, the edit's intent was still validated (informally, by re-checking the change made sense) but the guard's own literal instruction to invoke the skill was not followed, since doing so for a purely mechanical fix to an already-decided plan adds no value.

Scope

  1. Add an exemption condition to the trigger source (the part of the codebase that generates the guard) so that when a plan/research file's frontmatter already declares both a finalized status (e.g. ready) and a recorded decision field, edits to that file do not re-trigger the skill-invocation guard.
  2. Regenerate the compiled guard from the updated trigger source using the project's existing trigger-compilation tooling.
  3. The trigger compiler currently detects "content worth guarding" via a hardcoded pattern matched against checklist/checkbox-style diffs only. Extending it to also recognize frontmatter field state (status/decision) requires understanding the compiler's current matching approach first — a plain regex addition on top of the existing checkbox-diff pattern is not sufficient by itself.

Verification

Feature Procedure Expected Result
Guard exempts finalized plans Edit a plan file whose frontmatter already has status: ready and a decision: field (e.g. a relocation-only or path-correction edit) Guard does not fire the skill-invocation instruction
Guard still fires for undecided plans Edit a plan file that does NOT yet have both status: ready and a decision: field Guard fires as before, unchanged
No regression in existing checkbox-diff detection Edit a plan file's checklist/checkbox content Guard still fires per its original behavior

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions