qth20266512

Use Konva to draw circles, arrows, and text annotations on contract screenshots or images and export them. Suitable for scenarios that require visual annotation and export on a canvas for contract screenshots or images.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "qth20266512" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-fad91b7e106c38c9cd69588982f0d648d6c6dda4173ec16f8b26834cd55ac10b. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/qth20266512 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Use Konva to draw circles, arrows, and text annotations on contract screenshots or images and export them. Suitable for scenarios that require visual annotation and export on a canvas for contract screenshots or images.

0 Downloads

Introduction source: third_party · user_f1b049da · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Not specified in the source documentation.
Inputs and outputs
Not specified in the source documentation.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: qth20266512
slug: qth20266512
displayName: 画布批注
version: 1.0.0
summary: 用 Konva 在合同/截图上画圈批注,导出标注图便于评审。
license: MIT
description: 用 Konva 在合同截图或图片上画圈、箭头与文字批注并导出。当用户要画布批注、Konva 标注、合同截图圈点时使用。

画布批注(Konva)

灵感:能力工具箱 canvas-mark(pkg: konva)。

小四原创:底图 + 矢量批注层;评审时画圈/箭头/便签,一键导出带标注的 PNG。

何时使用

  • 合同/协议截图上圈出争议条款
  • 设计稿/单据图上加点评
  • 需要可擦除、可导出的轻量标注,不上重型白板

硬约束

  1. 使用 konva(Stage / Layer / Image / Circle / Arrow / Text)。
  2. 底图与批注分 Layer;清除批注不毁掉底图。
  3. 导出用 stage.toDataURL() 或等价;文件名安全化。
  4. 移动端:优先画笔/圆,避免过密控件。
  5. 实现要点注释标 小四原创。

推荐实现

import Konva from 'konva'

// 小四原创:合同截图批注台
export async function mountMarkCanvas(
  container: HTMLDivElement,
  imageUrl: string,
  opts?: { width?: number },
) {
  const width = opts?.width ?? container.clientWidth || 640
  const img = await loadHtmlImage(imageUrl)
  const height = Math.round((img.height / img.width) * width)
  const stage = new Konva.Stage({ container, width, height })
  const bg = new Konva.Layer()
  const marks = new Konva.Layer()
  stage.add(bg)
  stage.add(marks)
  bg.add(new Konva.Image({ image: img, width, height }))
  bg.draw()

  // 小四原创:点击画红圈
  stage.on('click tap', (e) => {
    if (e.target !== stage && e.target.getLayer() === bg) {
      const pos = stage.getPointerPosition()
      if (!pos) return
      marks.add(new Konva.Circle({
        x: pos.x, y: pos.y, radius: 28,
        stroke: '#e11d48', strokeWidth: 3, listening: false,
      }))
      marks.draw()
    }
  })

  return {
    stage,
    clearMarks: () => { marks.destroyChildren(); marks.draw() },
    exportPng: () => stage.toDataURL({ pixelRatio: 2 }),
  }
}

function loadHtmlImage(src: string) {
  return new Promise<HTMLImageElement>((resolve, reject) => {
    const i = new Image()
    i.crossOrigin = 'anonymous'
    i.onload = () => resolve(i)
    i.onerror = reject
    i.src = src
  })
}

Agent 步骤

  1. 挂载容器 + 载入截图 URL/File。
  2. 提供:画圈、(可选)箭头/文字、清除、导出 PNG。
  3. 跨域图失败时提示改本地 File 或代理。
  4. 自测:圈能画、清得掉、导出含圈。

不要做

  • 做成完整 Figma;保持批注轻量。
  • 默认上传标注图到不明服务器。

附加

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供合同截图批注、设计稿点评等实用场景,解决用户评审标注需求
  • 功能定位清晰,轻量标注不上重型白板,受众明确
Trigger Precision85/100

Highlights

  • 触发词覆盖合理,明确指向画布批注、Konva 标注、合同截图圈点等场景
Structure and Standards90/100

Highlights

  • 文档结构完整,包含何时使用、硬约束、推荐实现、Agent 步骤等关键章节
  • 代码示例清晰,分层处理底图与批注,体现小四原创设计
Execution Reliability88/100

Areas to improve

  • 引用文件缺失 Reported severity: Minor

    SKILL.md 引用了 README.md、reference.md、templates/usage.md 但未传入

    Recommendation: 请补充被引用的文件,或移除引用链接

Highlights

  • 使用 konva 库实现分层批注,提供清除与导出功能
  • 提及跨域图失败时的处理建议,增强执行鲁棒性
Evidence Verifiability (mean of the first four)85/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.