Skip to content

feat: standalone skills package + HTML render-annotate mode#687

Open
backnotprop wants to merge 6 commits intomainfrom
feat/skills-pkg
Open

feat: standalone skills package + HTML render-annotate mode#687
backnotprop wants to merge 6 commits intomainfrom
feat/skills-pkg

Conversation

@backnotprop
Copy link
Copy Markdown
Owner

Summary

  • Move skills to repo root (apps/skills/skills/) for npx skills add compatibility. All install scripts (sh, ps1, cmd), tests, and CI updated.
  • New skill: plannotator-plan — generates rich standalone HTML implementation plans with SVG architecture diagrams, UI mockups, and syntax-highlighted code snippets. Uses Plannotator theme tokens for theme-aware rendering.
  • New skill: plannotator-pr-explainer — generates visual HTML PR walkthroughs with inline diffs, risk maps, file-by-file commentary, before/after comparisons, and "where to focus" guidance.
  • New flag: --render-html on plannotator annotate — renders HTML files as-is in an iframe (instead of converting to markdown via Turndown), with full annotation support via a postMessage bridge. Supported across all three servers (Bun, Pi/Node, OpenCode).
  • New UI component: HtmlViewer — iframe-based renderer with injected theme tokens, annotation bridge script, and same ViewerHandle interface as the existing Viewer. Includes theme change propagation via MutationObserver.

Skills install

npx skills add backnotprop/plannotator@plannotator-plan
npx skills add backnotprop/plannotator@plannotator-pr-explainer
npx skills add backnotprop/plannotator@plannotator-compound

Test plan

  • bun test packages/shared/annotate-args.test.ts — 28/28 pass (includes new --render-html tests)
  • bun test scripts/install.test.ts — 60/60 pass (updated paths)
  • Vite build compiles 3411+ modules cleanly
  • plannotator annotate test.html — existing behavior unchanged (converts to markdown)
  • plannotator annotate test.html --render-html — HTML renders in iframe with theme tokens
  • Select text in iframe → annotation toolbar appears at correct position
  • Create comment/deletion annotations → appear in panel, highlight in iframe
  • Click annotation in panel → iframe scrolls to highlight
  • Theme toggle → iframe colors update
  • --render-html --gate → Approve button works

Move skills from apps/skills/ to skills/ at repo root so they're
discoverable by `npx skills add backnotprop/plannotator@<skill-name>`.
Update all install scripts (sh, ps1, cmd) and tests.

Add two new visual HTML skills:
- plannotator-plan: generates rich implementation plans with SVG diagrams,
  mockups, and code snippets using Plannotator theme tokens
- plannotator-pr-explainer: generates PR walkthroughs with inline diffs,
  risk maps, file tours, and architecture diagrams

Add --render-html flag to `plannotator annotate` that renders HTML files
as-is in an iframe instead of converting to markdown via Turndown. Enables
annotating the visual HTML plans with full highlight/comment/deletion support.

Implementation:
- Shared flag parser (annotate-args.ts) + all three servers (Bun, Pi, OpenCode)
- iframe srcdoc rendering with injected theme tokens and annotation bridge script
- postMessage protocol between iframe and parent for selection, marks, scroll, resize
- HtmlViewer component with same ViewerHandle interface as Viewer
- Theme propagation via MutationObserver on document.documentElement
- Fix AnnotationToolbar prop names (element/positionMode, not anchorEl/mode)
- Add isGlobal prop to both CommentPopover usages
- Move action bar above iframe to avoid overflow:hidden clipping
- Accept maxWidth prop so Wide/Focus toggle controls HtmlViewer width
- Global Comment button now opens CommentPopover (not instant-fire)
- Add AttachmentsButton to action bar for image attachments
Remove allow-same-origin from iframe sandbox so scripts in user HTML
files cannot access the parent app or local API endpoints. The bridge
only needs postMessage which works without same-origin.

Use rawHtml as the draft key source in render-html mode so each HTML
file gets its own autosave slot (both Bun and Pi servers).
Gate renderAs on rawHtml existence so the server response is honest
when --render-html is passed with a non-HTML file (both Bun and Pi).
Remove unused sourceInfo prop from HtmlViewer. Remove dead COMMENT
branch from handleAnnotate — comments route through onRequestComment.
Extend SharePayload with h (rawHtml) and r (renderAs) fields. HTML
shares always go through the paste service (encrypted short links) —
hash-based sharing returns null for HTML mode.

Fix generateShortUrl guard to allow rawHtml when markdown is empty.
Fix refreshShareUrl to handle null return from generateShareUrl.
Fix restore logic in both paste and hash paths to detect HTML payloads
and set rawHtml/renderAs state via optional chaining (graceful for old
callers). Fix importFromShareUrl title extraction to check payload.h.

Fix ExportModal to show "Create short link" button when hash URL is
unavailable (HTML mode), and hide the empty hash textarea.

Fix callback bot gates, button disabled states, annotation panel share
button, and handleCopyShareLink to use shortShareUrl as fallback.
@backnotprop
Copy link
Copy Markdown
Owner Author

Before merge integrate https://github.com/nicobailon/visual-explainer

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant