Michael Ramos fc655beb0e feat: Pi-style iterative planning for OpenCode plugin (#318)
* feat: extract checklist utilities to shared package

Move ChecklistItem, parseChecklist, extractDoneSteps, and
markCompletedSteps from Pi extension to @plannotator/shared
for reuse by the OpenCode plugin.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: Pi-style iterative planning for OpenCode plugin

Rewrite the OpenCode plugin to match Pi's planning methodology:

- Inject rich iterative planning prompt when agent is "plan"
  (explore → update plan → ask user loop, structured plan format)
- File-based submit_plan: reads plan from disk instead of requiring
  it as a string arg. Resolves path from OpenCode's system prompt,
  falls back to PLAN.md
- Suppress plan_exit via tool.definition hook (directs to submit_plan)
- Add PLANNOTATOR_ALLOW_SUBAGENTS env var for #289
- Pass planFilePath to denial feedback template
- Keep existing subagent/build/title guards intact

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address review findings in OpenCode plugin

- Cache agents list (static per session, was fetched every LLM call)
- Remove TOCTOU: drop redundant file.exists() before file.text()
- Eliminate duplicate system.join() by reusing joined string
- Resolve getSharingEnabled() once in submit_plan instead of twice
- Use path.join() instead of string concatenation for file paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: session-scoped plan files and tool-neutral prompt

Replace plugin-global resolvedPlanFilePath and prompt-path parsing with
per-session plan files at ~/.plannotator/session-plans/opencode/{id}/plan.md.
Remove resolvePlanFilePath() regex (fixes spaces-in-path and cross-session
race). Make planning prompt tool-neutral (no write/edit references) so it
works with apply_patch models. Strip OpenCode's native read-only and
experimental-mode prompt lines before injecting Plannotator's planning prompt.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: directory-based plan storage with path validation

Replace session-scoped plan files with a shared plan directory at
~/.plannotator/session-plans/opencode/. Agent picks the filename,
submit_plan takes a path arg and validates it (absolute, inside plan
dir, exists, readable, non-empty) with canonical path checks to
defeat traversal and symlink escapes. Remove summary and plan string
args. Planning prompt is now tool-neutral and directs the agent to
reuse the same file on feedback, not create new ones.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use OpenCode's native plans directory for permission compatibility

OpenCode's plan mode permission ruleset only allows edits to
.opencode/plans/*.md and $XDG_DATA_HOME/opencode/plans/*.md.
Our custom ~/.plannotator/session-plans/opencode/ path was blocked
by PermissionDeniedError at the tool level regardless of prompt
stripping. Switch to the XDG path that OpenCode already allows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat: exploration-first planning prompt

Restructure the planning prompt as a phased workflow:
Explore → Ask → Write → Submit. The agent now explores the
codebase before creating a plan file or asking questions,
producing better-researched plans for existing codebases.
Greenfield tasks can skip straight to questions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: fix stale path in JSDoc header comment

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 16:13:57 -07:00
2026-03-16 08:43:13 -07:00
2026-03-13 19:06:50 -07:00

Plannotator

Plannotator

Interactive Plan & Code Review for AI Coding Agents. Mark up and refine your plans or code diffs using a visual UI, share for team collaboration, and seamlessly integrate with Claude Code, OpenCode, Pi, and Codex.

Plan Mode Demos:

Claude Code

Claude Code Demo

Watch Demo

OpenCode

OpenCode Demo

Watch Demo

New: Code Review

Features

Visual Plan ReviewBuilt-in hookApprove or deny agent plans with inline annotations
Plan DiffAutomaticSee what changed when the agent revises a plan
Code Review/plannotator-reviewReview git diffs with line-level annotations
Annotate Any File/plannotator-annotateAnnotate any markdown file and send feedback to your agent

Sharing Plans

Plannotator lets you privately share plans, annotations, and feedback with colleagues. For example, a colleague can annotate a shared plan, and you can import their feedback to send directly back to the coding agent.

Small plans are encoded entirely in the URL hash. No server involved, nothing stored anywhere.

Large plans use a short link service with end-to-end encryption. Your plan is encrypted with AES-256-GCM in your browser before upload. The server stores only ciphertext it cannot read. The decryption key lives only in the URL you share. Pastes auto-delete after 7 days.

  • Zero-knowledge storage, similar to PrivateBin
  • Fully open source and self-hostable (see docs)

Install

Install for Claude Code

Install the plannotator command:

macOS / Linux / WSL:

curl -fsSL https://plannotator.ai/install.sh | bash

Windows PowerShell:

irm https://plannotator.ai/install.ps1 | iex

Then in Claude Code:

/plugin marketplace add backnotprop/plannotator
/plugin install plannotator@plannotator

# IMPORTANT: Restart Claude Code after plugin install

See apps/hook/README.md for detailed installation instructions including a manual hook approach.


Install for OpenCode

Add to your opencode.json:

{
  "plugin": ["@plannotator/opencode@latest"]
}

Run the install script to get /plannotator-review:

curl -fsSL https://plannotator.ai/install.sh | bash

Windows:

irm https://plannotator.ai/install.ps1 | iex

This also clears any cached plugin versions. Then restart OpenCode.


Install for Pi

pi install npm:@plannotator/pi-extension

Then start Pi with --plan to enter plan mode, or toggle it during a session with /plannotator.

See apps/pi-extension/README.md for full usage details, commands, and flags.


Install for Codex

Install the plannotator command:

macOS / Linux / WSL:

curl -fsSL https://plannotator.ai/install.sh | bash

Windows PowerShell:

irm https://plannotator.ai/install.ps1 | iex

Then in Codex — feedback flows back into the agent loop automatically:

!plannotator review           # Code review for current changes
!plannotator annotate file.md # Annotate a markdown file

Plan mode is not yet supported.

See apps/codex/README.md for details.


How It Works

When your AI agent finishes planning, Plannotator:

  1. Opens the Plannotator UI in your browser
  2. Lets you annotate the plan visually (delete, insert, replace, comment)
  3. Approve → Agent proceeds with implementation
  4. Request changes → Your annotations are sent back as structured feedback

License

Copyright 2025-2026 backnotprop

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

S
Description
plannotator-visual-explainer: Generate self-contained HTML visualizations with Plannotator theming. Use for implementation plans, PR explainers, architecture diagrams, data tables, slide…; plannotator-compound: Analyze a user's Plannotator plan archive to extract denial patterns, feedback taxonomy, evolution over time, and actionable prompt improvements — then produce…; plannotator-setup-goal: Turn an idea or objective into a goal package for /goal. Interviews the user, builds a reviewed fact s…
Readme 198 MiB
Languages
TypeScript 92.2%
CSS 1.9%
Shell 1.8%
Astro 1.4%
HTML 0.7%
Other 2%