Repository navigation
Description
Context
Spec-driven development frameworks (spec-kit, kiro, openspec, etc.) are replacing traditional plan mode in AI coding workflows. Instead of a single plan file, these frameworks generate multiple markdown artifacts (spec.md, plan.md, tasks.md, research.md, data-model.md) that go through iterative review cycles.
Plannotator's annotation UI is a perfect fit for reviewing these artifacts — inline, targeted feedback on markdown is exactly what's needed. I've built integrations for both Claude Code (PostToolUse hook) and OpenCode (event plugin) that trigger plannotator annotate whenever a spec artifact is written.
The value proposition is significant: every spec-driven framework generates multiple markdown files per feature, each needing human review. Plannotator could be the universal review layer across all of them.
Problem
plannotator annotate currently has no approve/accept exit path. The UI shows Close and Annotate buttons, but no Approve.
This creates three issues:
-
No "looks good" signal: Closing without feedback returns
"Annotation session closed without feedback"on stdout. There's no way to distinguish "I reviewed this and it's fine" from "I dismissed this without looking." -
Claude Code hook breaks: The Claude Code hook (source) runs as a blocking PostToolUse hook. Any stdout from plannotator triggers a block — including the "closed without feedback" message. This means every spec file write gets blocked with no way to approve.
-
OpenCode plugin works around it, but incompletely: The OpenCode plugin (source) runs async and sends annotations back as a session prompt. Empty stdout = no action, which is better. But "closed without feedback" still produces stdout, and there's still no explicit approve signal.
Proposed Solution
Add an Approve (or Accept) button to the annotation UI for plannotator annotate:
- Approve: exits with code 0 and empty stdout (or a structured
{"decision": "approved"}if downstream hooks want to distinguish approved from dismissed) - Annotate: existing behavior — exits with annotations on stdout
- Close/Dismiss: exits with code 0 and empty stdout (current behavior for no annotations, but currently outputs the "closed without feedback" message)
Optionally:
- A
--gateor--review-modeflag that explicitly enables the 3-button (Approve/Annotate/Dismiss) UX for hook integrations - Structured JSON output mode (
--json) so hooks can parse the decision cleanly
Why This Matters Beyond Plan Mode
Plannotator currently shines for plan review. But spec-driven development is where the volume is:
- A single feature generates 4-6 markdown files (spec, plan, tasks, research, data-model, quickstart)
- Each goes through clarify → review → approve cycles
- Multiple frameworks exist (spec-kit, kiro, openspec) with the same pattern
- All of them need a human-in-the-loop review step for markdown artifacts
A working approve/reject flow for plannotator annotate would make plannotator the universal review tool for all of these frameworks.
Related Issues
- feat(review): add configurable approval prompts #561 — configurable approval prompts (review-specific, but related UX pattern)
- feat(hook): notify agent when no VCS detected on plan approval #493 — hook notify on plan approval (similar hook integration concern)
- Support for OpenAI Codex Hooks #497 — OpenAI Codex hooks support (another agent integration)
Environment
- plannotator binary:
~/.local/bin/plannotator(installed ~April 14, 2026) - Claude Code: PostToolUse Python hook
- OpenCode: Bun event plugin
- OS: macOS Darwin 25.4.0
Activity
backnotprop commentedon Apr 15, 2026
Great details provided. Thank you.
backnotprop commentedon Apr 15, 2026
I will prioritize this soon, possibly tonight or the next day, unless somebody else wants to take it on.
punk-dev-robot commentedon Apr 16, 2026
if you leave some pointers i could give it a try this weekend
leoreisdias commentedon Apr 17, 2026
Man, this would be huge! Totally amazing idea. I have been testing a lot of SDD tools from GSD to BMAD, and the idea of having a tool like Plannotator in the middle is really cool.
Let me know if I could help with something!
backnotprop commentedon Apr 18, 2026
If you have a specific idea of what would work best with you - that would be great.
backnotprop commentedon Apr 18, 2026
I'm around all weekend at a sf hackathon putting a bow on plannotator real time collab rooms.
Happy to meet with others to discuss this feature direction
backnotprop commentedon Apr 23, 2026
Hey @punk-dev-robot and @leoreisdias, I'm developing this now. We'll cut a release tonight. Please review these flags:
--gate: enables the three-way UX (Approve / Annotate / Close) in the UI.--json: emits structured{"decision":"...","feedback":"..."}stdout for explicit hook routing.Stdout matrix:
Key property for your spec-kit hook: in
--gatemode without--json, Approve and Close are both empty stdout, so your existing PostToolUse block-on-any-stdout hook works unchanged. Only Annotate blocks. Add--jsonif you want explicit approved-vs-dismissed routing.Also shipping: the
"Annotation session closed without feedback."stdout leak gets dropped unconditionally.Parity across Claude Code, OpenCode, and Pi: same
--gatesemantics regardless of harness. For annotate-last there's a companion recipe that uses the same flag on a Stop hook (turn-by-turn review gate).Draft PR: #606
Would love your eyes on the flag names and the matrix before I lock them in.
feat(shared): add parseAnnotateArgs utility + tests
feat(server): gate mode and /api/approve for annotate (bun + pi parity)
feat(editor): three-button annotate header when gate is enabled
feat(hook): --gate and --json flags for annotate / annotate-last
feat(opencode): --gate passthrough for annotate / annotate-last
feat(pi): --gate passthrough for annotate / annotate-last
5 remaining items
feat(server): gate mode and /api/approve for annotate (bun + pi parity)
feat(editor): three-button annotate header when gate is enabled
feat(hook): --gate and --json flags for annotate / annotate-last
feat(opencode): --gate passthrough for annotate / annotate-last
feat(pi): --gate passthrough for annotate / annotate-last
docs(annotate): document --gate, --json, and hook recipes (#570)
leoreisdias commentedon Apr 24, 2026
@backnotprop you nailed it!
feat(annotate): add --gate, --json, and --silent-approve flags (backn…
backnotprop commentedon Apr 24, 2026
Follow-up:
--hookreplaces--silent-approveAfter shipping #606, we reviewed the Claude Code hook docs and Codex hook docs and discovered that
--silent-approvedoesn't work with either hook system:{"decision":"block","reason":"..."}actually blocks.{"decision":"block","reason":"..."}prevents stopping.So the "naive hooks that treat any stdout as a block signal" pattern doesn't exist in either system. Our
--jsonformat ({"decision":"approved"}) also isn't recognized — the hook protocol only understandsdecision: "block".The fix (PR #610):
--hookreplaces--silent-approveand emits hook-native JSON directly:{"decision":"block","reason":"<feedback>"}(hook blocks)--hookimplies--gate(three-button UX). Works with both Claude Code and Codex hooks without a wrapper script.--gateand--jsonremain unchanged for slash command and wrapper script use cases.feat(annotate): replace --silent-approve with --hook for native hook …
feat(annotate): add --gate, --json, and --silent-approve flags (backn…
feat(annotate): replace --silent-approve with --hook for native hook …
annotate-last: pick which message to annotate (fixes #800) (#809)
Squashed commit of the following: