doc-barcode-code128

Generate CODE128 barcodes using JsBarcode for easy printing labels and scanning on documents. Intended for frontend scenarios that need to create barcodes in CODE128 format and document labels.

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

Generate CODE128 barcodes using JsBarcode for easy printing labels and scanning on documents. Intended for frontend scenarios that need to create barcodes in CODE128 format and document labels.

0 Downloads

Introduction source: third_party · user_f1b049da · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: doc-barcode-code128
slug: rmvn2026748
displayName: 单据条形码
version: 1.0.0
summary: 用 JsBarcode 生成 CODE128 条码,便于打印贴码与单据扫码。
license: MIT
description: 用 JsBarcode 生成 CODE128 条码,便于打印贴码与单据扫码。当用户需要前端生成条形码、CODE128、单据贴码时使用。

单据条形码(JsBarcode)

灵感:能力工具箱 barcode(pkg: jsbarcode)。

何时使用

  • 跟进单号、入库单号生成可打印 CODE128
  • 浏览器内画到 <svg> / <canvas> 再打印

硬约束

  1. 默认格式 CODE128;内容为可见 ASCII,空串拒绝。
  2. 使用 JsBarcode;展示可读文字(displayValue: true)除非用户关闭。
  3. 打印场景:条码区域足够对比度,宽度随内容长度自适应说明。
  4. 非法字符导致库抛错时,给出可读提示。
  5. 交付 SVG/Canvas 用法片段;勿依赖仓库私有组件。

推荐实现要点

import JsBarcode from 'jsbarcode'

export function renderCode128(
  el: SVGSVGElement | HTMLCanvasElement,
  value: string,
  opts?: { height?: number; displayValue?: boolean },
) {
  const text = String(value || '').trim()
  if (!text) throw new Error('条码内容不能为空')
  JsBarcode(el, text, {
    format: 'CODE128',
    height: opts?.height ?? 64,
    displayValue: opts?.displayValue ?? true,
    margin: 8,
  })
}

Agent 步骤

  1. 实现渲染函数;单据号输入框失焦生成。
  2. 自测:样例单号可被手机扫码识别(有条件时)。
  3. 打印样式:避免缩放模糊。

附加

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

  • 提供前端生成 CODE128 条码的能力,适用于单据贴码、打印等实际业务场景
  • 具有明确的实用价值,属于通用工具范畴
Trigger Precision85/100

Highlights

  • description 中明确描述了适用场景,触发词清晰,边界明确
Structure and Standards75/100

Areas to improve

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

    文档缺少完整的 HTML 使用示例,仅有代码片段

    Recommendation: 建议补充一个完整的 HTML 示例,展示如何在前端页面中使用该条码生成功能

Highlights

  • 文档结构清晰,包含何时使用、硬约束、推荐实现要点、Agent 步骤等
  • frontmatter 完整,有代码示例
Execution Reliability72/100

Areas to improve

  • 异常处理覆盖不全 Reported severity: Minor

    未覆盖所有可能的异常情况,如非法字符的具体处理

    Recommendation: 建议补充对非法字符等异常情况的处理说明和示例

Highlights

  • 提供了具体的实现代码,参数明确
  • 有基本的错误处理(空值检查),工具来源明确(JsBarcode)
Evidence Verifiability (mean of the first four)78/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.

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