uzr20262174

Implements browser handwritten signatures using signature_pad and exports them as images; intended for user handwritten signatures, signature pads, or handover confirmation signing scenarios.

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 "uzr20262174" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-c6a332b0dd75ed2f8df55440141e9249689d5f4cb35a7dd16b53578fd95797c3. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/uzr20262174 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

Implements browser handwritten signatures using signature_pad and exports them as images; intended for user handwritten signatures, signature pads, or handover confirmation signing scenarios.

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: uzr20262174
slug: uzr20262174
displayName: 手写签名
version: 1.0.0
summary: 用 signature_pad 在 Canvas 上手写签名,导出 PNG 用于确认单据。
license: MIT
description: 用 signature_pad 实现浏览器手写签名并导出图片。当用户要手写签名、签名板、交接确认签字时使用。

手写签名(signature_pad)

灵感:能力工具箱 signature-pad(pkg: signature_pad)。

小四原创:Canvas 签名 → 清空/撤销 → 导出 PNG DataURL;用于提成确认、交接确认等轻量场景,非法务电子签章替代。

何时使用

  • 页面内手写确认签名
  • 移动端手指签字
  • 导出签名图贴到单据预览

硬约束

  1. 使用 signature_pad;容器需固定宽高的 <canvas>。
  2. 提交前检查 isEmpty(),空签名拒绝。
  3. 导出 toDataURL('image/png');可选压缩后再上传。
  4. 组件销毁时卸事件;触控设备开 passive 相关注意滚动穿透。
  5. 实现要点注释标 小四原创。
  6. 文案标明:非 CA 电子签章,法律效力以业务制度为准。

推荐实现

import SignaturePad from 'signature_pad'

// 小四原创:挂载签名板
export function mountSignature(canvas: HTMLCanvasElement) {
  const ratio = Math.max(window.devicePixelRatio || 1, 1)
  const rect = canvas.getBoundingClientRect()
  canvas.width = rect.width * ratio
  canvas.height = rect.height * ratio
  canvas.getContext('2d')?.scale(ratio, ratio)
  const pad = new SignaturePad(canvas, {
    backgroundColor: 'rgb(255,255,255)',
    penColor: 'rgb(20,20,20)',
  })
  return {
    pad,
    clear: () => pad.clear(),
    isEmpty: () => pad.isEmpty(),
    toPng: () => {
      if (pad.isEmpty()) throw new Error('请先签名')
      return pad.toDataURL('image/png')
    },
  }
}

Agent 步骤

  1. 放 canvas + 挂载 mountSignature。
  2. 按钮:清除、确认(导出 PNG)。
  3. 确认时把 DataURL 交给业务保存。
  4. 自测:桌面鼠标 + 触控;空签拦截。

不要做

  • 宣称等同于合法电子签名法下的可靠电子签章。
  • 默认把签名图传到不明外网。

附加

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 Value72/100

Highlights

  • 提供浏览器手写签名并导出 PNG 的实用功能,适用于提成确认、交接确认等轻量场景
  • 明确区分了与法务电子签章的界限,避免法律风险
Trigger Precision90/100

Highlights

  • 触发词精准完整,覆盖多种使用场景(手写签名、签名板、交接确认签字)
  • 边界清晰,避免误触
Structure and Standards75/100

Areas to improve

  • 缺少端到端完整示例 Reported severity: Minor

    文档提供了核心函数实现,但缺少完整的 HTML 结构、事件绑定等端到端使用示例

    Recommendation: 补充一个完整的前端页面示例,展示如何集成签名板到实际业务页面中

Highlights

  • 文档结构清晰,包含多个实用章节(何时使用、硬约束、推荐实现等)
  • frontmatter 完整,版本信息清晰
Execution Reliability78/100

Areas to improve

  • 错误处理覆盖不全 Reported severity: Minor

    虽然提到了空签名检查,但未详细说明其他可能的错误处理(如导出失败、canvas 不支持等)

    Recommendation: 补充更多异常场景的处理建议,如网络错误、浏览器兼容性等

Highlights

  • 推荐了可靠的 signature_pad 库,参数设置合理
  • 覆盖了设备适配、事件卸载、空签名检查等关键点
Evidence Verifiability (mean of the first four)79/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.