openpress-apply-comments

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

open-press Apply Comments

open-press 应用评论

This is the workflow skill for turning pending
@openpress-comment
markers into source edits. A comment is resolved only when the requested source change has been made and the marker has been removed.
openpress-collaborate
owns whether the agent should propose, refresh, apply a reviewed preview, or edit directly. Use this skill for marker mechanics. If the user asks to apply
.openpress/review/current.json
, return to
openpress-collaborate
instead of interpreting the Comments as a separate direct-edit batch.
这是一项工作流技能,用于将待处理的
@openpress-comment
标记转换为源文件编辑操作。只有当请求的源文件修改完成且标记已被移除时,评论才算解决。
openpress-collaborate
负责决定Agent是否应提出建议、刷新内容、应用已审核的预览或直接编辑。本技能仅用于标记的相关操作。如果用户要求应用
.openpress/review/current.json
,请返回至
openpress-collaborate
,而非将评论视为单独的直接编辑批次进行处理。

Responsibilities

职责

  • List pending
    @openpress-comment
    markers.
  • Read the decoded comment note, hint, source path, and nearby source.
  • Apply the requested edit as a small source change.
  • Remove the marker after the edit is complete.
  • Leave ambiguous or failed comments in place.
  • Verify before reporting completion.
  • 列出待处理的
    @openpress-comment
    标记。
  • 读取解码后的评论说明、提示、源文件路径及附近的源代码。
  • 将请求的编辑操作作为小型源文件修改应用。
  • 编辑完成后移除标记。
  • 保留模糊或处理失败的评论标记。
  • 报告完成前进行验证。

Boundary

边界

  • Use
    openpress
    for the canonical source/generated path table when unsure.
  • Edit source, not generated output.
  • Default to editing the source file that contains the marker.
  • Route domain-heavy work to the owning skill:
    • openpress-create-pages
      for page prose, hierarchy, captions, claims, tone, narrative, page theme, and page components.
    • openpress-create-slide
      for deck narrative, slide density, direct slide sources, active theme tokens, core Object API composition, Tailwind semantic styling, and reusable UI primitives.
    • openpress-plugins
      for external diagramming, visual tools, and writing helpers.
  • Do not rewrite unrelated sections while resolving one comment.
  • 当不确定时,使用
    openpress
    获取标准的源文件/生成文件路径表。
  • 编辑源文件,而非生成的输出文件。
  • 默认编辑包含标记的源文件。
  • 将领域相关的工作路由至对应的专属技能:
    • openpress-create-pages
      :负责页面文案、层级结构、说明文字、声明、语气、叙事、页面主题及页面组件。
    • openpress-create-slide
      :负责演示文稿叙事、幻灯片密度、幻灯片源文件、活动主题令牌、核心Object API组合、Tailwind语义样式及可复用UI基础组件。
    • openpress-plugins
      :负责外部图表工具、可视化工具及写作辅助工具。
  • 解决单个评论时,请勿重写无关内容。

Workflow

工作流

  1. Discover comments.
    bash
    rg "@openpress-comment" press -n
    If decoded notes are needed and the framework helper exists, use it:
    bash
    node --input-type=module -e 'import { listCommentMarkers } from "./packages/core/engine/react/comment-marker.mjs"; console.log(JSON.stringify(await listCommentMarkers({ root: process.cwd() }), null, 2));'
  2. Pick the requested scope.
    • If the user names one comment, resolve only that comment.
    • If the user says apply comments without an id, process pending comments in source order.
    • Handle comments one at a time; do not batch unrelated rewrites under one marker.
  3. Inspect the target.
    • Read the source file that contains the marker.
    • Inspect nearby lines before editing.
    • Use the marker hint and rendered-object metadata when present, but verify against source.
  4. Apply the edit.
    • Make the smallest source change that satisfies the comment.
    • Preserve local style, component APIs, and MDX structure.
    • If the request is ambiguous, ask for clarification and leave the marker in place.
  5. Remove the resolved marker.
    • Delete the
      @openpress-comment
      marker only after the source edit is complete.
    • Do not clear a marker just because it was read.
    • Clear a marker without applying only when the user explicitly asks.
  6. Verify.
    bash
    npm run build
    build
    validates structure and renders the full output. When iterating fast on the inner steps:
    bash
    node engine/cli.mjs validate .   # structural checks only, no render
    node engine/cli.mjs export .     # rewrite document.json only, no Vite bundle
  1. 发现评论。
    bash
    rg "@openpress-comment" press -n
    如果需要解码后的说明且框架辅助工具存在,请使用以下命令:
    bash
    node --input-type=module -e 'import { listCommentMarkers } from "./packages/core/engine/react/comment-marker.mjs"; console.log(JSON.stringify(await listCommentMarkers({ root: process.cwd() }), null, 2));'
  2. 选择请求的范围。
    • 如果用户指定了某条评论,仅解决该评论。
    • 如果用户未指定ID就要求应用评论,按源文件顺序处理待处理评论。
    • 一次处理一条评论;请勿在一个标记下批量处理无关的重写操作。
  3. 检查目标文件。
    • 读取包含标记的源文件。
    • 编辑前检查附近的代码行。
    • 若存在标记提示和渲染对象元数据,可参考但需与源文件进行验证。
  4. 应用编辑操作。
    • 做出满足评论要求的最小源文件修改。
    • 保留本地样式、组件API及MDX结构。
    • 如果请求模糊不清,请询问用户澄清并保留标记。
  5. 移除已解决的标记。
    • 仅在源文件编辑完成后删除
      @openpress-comment
      标记。
    • 请勿仅因读取了标记就清除它。
    • 仅当用户明确要求时,才在未应用编辑的情况下清除标记。
  6. 验证。
    bash
    npm run build
    build
    命令会验证结构并渲染完整输出。当快速迭代内部步骤时,可使用:
    bash
    node engine/cli.mjs validate .   # 仅进行结构检查,不渲染
    node engine/cli.mjs export .     # 仅重写document.json,不进行Vite打包

Completion Report

完成报告

Report:
  • which comment ids were resolved,
  • which files changed,
  • which comments remain because they were ambiguous or failed,
  • which verification commands ran and whether they passed.
报告内容需包含:
  • 已解决的评论ID,
  • 已修改的文件,
  • 因模糊或处理失败而保留的评论,
  • 运行的验证命令及结果是否通过。

Common Mistakes

常见错误

  • Do not edit
    public/openpress/
    ,
    dist-react/
    ,
    .deploy/
    , or
    .openpress/
    . The separate
    openpress-collaborate
    workflow alone owns
    .openpress/review/current.json
    .
  • Do not remove unresolved comments.
  • Do not rewrite broad sections unless the comment explicitly asks for that.
  • Do not claim the browser changed until the source has been exported when export is required.
  • 请勿编辑
    public/openpress/
    dist-react/
    .deploy/
    .openpress/
    目录下的文件。只有独立的
    openpress-collaborate
    工作流有权处理
    .openpress/review/current.json
  • 请勿移除未解决的评论标记。
  • 除非评论明确要求,否则请勿重写大范围内容。
  • 当需要导出时,请勿声称浏览器内容已更改,直到源文件完成导出操作。