Skip to content
Productivity
Skill

/apply-comments

Apply pending @slide-comment markers written by the open-slide inspector tool. Use when the user asks to "apply comments", "process slide comments", "apply the inspector comments", or references markers left inside `slides/<id>/index.tsx`.

From plugin
public-agent-skills
25646 skills4 agents

Claude Code

$ npx -y skills add cafe3310/public-agent-skills --skill apply-comments --agent claude-code

SKILL.md

apply-comments.SKILL.md
name: apply-comments
description: Apply pending @slide-comment markers written by the open-slide inspector tool. Use when the user asks to "apply comments", "process slide comments", "apply the inspector comments", or references markers left inside `slides/<id>/index.tsx`.

Apply slide comments

The open-slide editor has a comment mode that lets the user click a rendered page element, or drag across a region of the page, and attach a textual comment (e.g. *"make this red"*, *"change to 'Open Slide Rocks'"*). Each comment is persisted as an in-source JSX marker inside `slides/<slideId>/index.tsx`.

Your job: read those markers, perform the described edits, and delete the markers.

> **Before making any page edit**, consult the **`slide-authoring`** skill — it is the technical reference for how `slides/<id>/index.tsx` is structured (canvas, type scale, palette, assets, file contract). A comment like *"make this bigger"* or *"change the accent colour"* should be applied in a way that stays consistent with those rules.

Marker format

{/* @slide-comment id="c-<8hex>" ts="<ISO>" text="<base64url(JSON)>" */}
  • Sits as the **first child inside** the JSX element it refers to (i.e. between that element's opening `>` and its other children). The marker is dropped *into* its target, not floated above it. Newly written markers get a line of their own; older ones may share a line with the content that follows them.
  • `text` is base64url-encoded JSON: `{"note": "...", "hint"?: "...", "rect"?: {"x", "y", "w", "h"}, "page"?: n}`.
  • `rect` is present when the comment was left on a dragged region rather than on an element. Values are pixels on the 1920×1080 page canvas, measured from the page's top-left corner. The marker still sits inside the deepest element that contains the region, but the note refers to what is *inside* that region — possibly several children, or only part of the enclosing element.
  • `page` is the 0-based index (into the default export array) of the page the comment was left on.
  • Detection regex (authoritative — use exactly this):
  /\{\/\*\s*@slide-comment\s+id="(c-[a-f0-9]+)"\s+ts="([^"]+)"\s+text="([A-Za-z0-9_\-]+={0,2})"\s*\*\/\}/g

Procedure

1. **Identify the target slide(s).**

  • If the user names one (`getting-started`, `q2-roadmap`, etc.), work on that single `slides/<slideId>/index.tsx`.
  • If they say "all" or don't specify, scan every `slides/*/index.tsx`. Process each slide one at a time.

2. **Read the file and find all markers.**

  • Run the regex above against the whole file.
  • For each match, base64url-decode `text` and `JSON.parse` it to get `{ note, hint?, rect?, page? }`.
  • Record each hit as `{ id, lineIndex (0-based), note, hint, rect, page }`.
  • If there are no markers, tell the user and stop.

3. **Understand each comment in context.**

  • The targeted JSX element is the **enclosing** element of the marker — i.e. read upward from the marker line until you reach the unclosed JSX opening tag whose body the marker lives in. That element is the target. (For self-closing elements like `<img />`, the inspector hoists the marker to the nearest non-self-closing ancestor; in that case the comment usually refers to a child of the enclosing element rather than the enclosing element itself — use the `note` text to disambiguate.)
  • Read enough surrounding code (parent element, sibling elements, inline styles) to apply the change faithfully. A comment inside a `<div>` with an inline `background` style usually refers to that element's styling, for example.
  • When the payload has a `rect`, work out which children of the enclosing element fall inside that region (compare their positions and sizes against the rect on the 1920×1080 canvas) and apply the note to those — not to the whole enclosing element.
  • If the `note` is ambiguous, do the smallest reasonable interpretation and mention the assumption in your summary.

4. **Apply edits in reverse line order.**

  • Sort markers by descending `lineIndex` and process one at a time, using the `Edit` tool.
  • Processing top-down would invalidate line numbers for later markers as the file shrinks/grows.

5. **Remove each marker after applying its edit.**

  • Delete the marker token. If nothing else is left on that line, delete the whole line including its trailing `\n`; if content shares the line, keep that content.
  • Never leave a marker behind for an edit you applied — that signals a failure. Markers deliberately skipped per the edge cases below stay in place.

6. **Verify.**

  • After all edits, re-read the file and confirm the only remaining markers are ones you reported as skipped.
  • Confirm the edited JSX is well-formed (balanced tags, no dangling attributes). If the project's `package.json` has typecheck/lint scripts, run them with the project's package manager; scaffolded projects ship neither TypeScript nor a linter — there, rely on the running dev server (or the `build` script) to surface compile errors. Fix any errors you introduced.
  • If the dev server is running, screenshot each edited page via `/s/<id>/preview?p=N` to confirm the change looks right — see **Previewing a page visually** in `slide-authoring`.

7. **Report.**

  • Summarise: `N applied, M skipped` plus a one-line description of each change (including the slide id).

base64url decoding helper

function decode(s) {
  const pad = s.length % 4 === 0 ? '' : '='.repeat(4 - (s.length % 4));
  return Buffer.from(s.replace(/-/g, '+').replace(/_/g, '/') + pad, 'base64').toString('utf8');
}

You can run this inline via `node -e '...'` if you need to inspect a payload; otherwise just reason about the decoded string.

Edge cases

  • **Marker with no enclosing JSX element** (shouldn't happen — the inspector won't write one — but if you find one): delete it and note as orphan.
  • **Multiple markers stacked on consecutive lines inside the same element**: they all refer to that encl
Read more
@cafe3310
Ships withpublic-agent-skills

个人常用的 Agent Skill(公开部分)。通过合适的上下文工程,可以将 Agent Skill 用在几乎任何地方。

25646 skills4 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
256
Star history of cafe3310/public-agent-skills on GitHub, a chart by star-history.com

Other skills on public-agent-skills.

agent-browser

agent-browser

为 Agent 设计的自动化浏览器 CLI 工具,也能操作 Electron 桌面应用。当需要与网站交互(包括页面导航)时使用

aop-product-planner

aop-product-planner

面向切面 (AOP) 的智能产品策划与需求拆解范式。用于从目标叙事、AOP 切面分层、乱序 Idea 收集、功能边界界定到需求依赖拓扑与优先级的全流程产品工程规划。

More skills from other plugins.

i-have-adhd

i-have-adhd

Shape output for a reader with ADHD: lead with the next action, number multi-step work, restate state across turns, suppress…

@ayghri@ayghriInstall Skill
ab-test-analysis

ab-test-analysis

Analyze A/B test results with statistical significance, sample size validation, confidence intervals, and ship/extend/stop…

@phuryn@phurynInstall Skill
distilly

distilly

Set up the owner profile so a personal agent knows who it works for (first-run setup, \"get to know me\"), or distill colleague,…

Questions about apply-comments.

Which coding agents can use apply-comments?
apply-comments installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.