shdskill02

Skill for bulk scanning QR codes in PDF e-invoices and automatically extracting invoice numbers, exporting the results in Excel format. Intended for finance or accounting users who need to process large numbers of e-invoices; in Work Buddy it operates by adding multiple PDF files to quickly extract and organize invoice numbers.

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

Skill for bulk scanning QR codes in PDF e-invoices and automatically extracting invoice numbers, exporting the results in Excel format. Intended for finance or accounting users who need to process large numbers of e-invoices; in Work Buddy it operates by adding multiple PDF files to quickly extract and organize invoice numbers.

0 Downloads

Introduction source: third_party · user_9355e276 · 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: shdskill02
description: 提取PDF电子发票发票号码

{ "name": "扫描PDF二维码提取发票号码", "description": "批量扫描PDF文件中的二维码,提取发票号码并以Excel格式输出。支持在Work Buddy新建任务对话框中点击左下角+号添加多个PDF文件。", "triggers": [ "扫描PDF二维码提取发票号码", "扫描PDF二维码", "提取发票号码", "批量提取发票号码", "PDF二维码识别", "发票号码提取", "扫码提取发票", "PDF扫码" ], "window": { "title": "扫描PDF二维码提取发票号码", "width": 700, "height": 480, "resizable": true, "modal": true }, "ui": { "type": "custom", "html": "<div style='display:flex;flex-direction:column;height:100%;padding:20px 24px;font-family:'Segoe UI',system-ui,sans-serif;background:#f7f9fc;box-sizing:border-box;'>\n <div style='margin-bottom:16px;'>\n <h3 style='margin:0 0 6px 0;color:#1a1a2e;font-weight:600;font-size:18px;'>📄 扫描PDF二维码提取发票号码</h3>\n <p style='margin:0;color:#666;font-size:13px;'>点击下方「+ 添加文件」选择PDF文件(支持多选),系统将自动识别二维码中的发票号码</p>\n </div>\n\n <!-- 文件上传区域 -->\n <div style='display:flex;align-items:center;gap:12px;margin-bottom:16px;flex-wrap:wrap;'>\n <button id='addFilesBtn' style='padding:10px 24px;border:2px dashed #0078d4;border-radius:8px;background:#fff;color:#0078d4;cursor:pointer;font-size:14px;font-weight:600;transition:all 0.2s;'>+ 添加文件</button>\n <span style='font-size:13px;color:#888;'>已添加 <span id='fileCount'>0</span> 个PDF文件</span>\n <button id='clearFilesBtn' style='padding:6px 16px;border:1px solid #ddd;border-radius:4px;background:#fff;cursor:pointer;font-size:12px;color:#999;'>清空列表</button>\n </div>\n\n <!-- 文件列表 -->\n <div style='flex:1;border:1px solid #e0e0e0;border-radius:8px;background:#fff;overflow:hidden;display:flex;flex-direction:column;min-height:0;'>\n <div style='display:flex;justify-content:space-between;padding:10px 16px;background:#f0f2f5;border-bottom:1px solid #e0e0e0;font-weight:600;font-size:13px;color:#444;'>\n <span style='flex:1;'>文件名</span>\n <span style='width:120px;text-align:center;'>状态</span>\n <span style='width:100px;text-align:center;'>发票号码</span>\n </div>\n <div id='fileListContainer' style='flex:1;overflow-y:auto;padding:4px 0;'></div>\n </div>\n\n <!-- 底部操作栏 -->\n <div style='display:flex;justify-content:space-between;align-items:center;margin-top:16px;'>\n <div style='display:flex;gap:12px;'>\n <button id='scanBtn' style='padding:10px 36px;border:none;border-radius:6px;background:#0078d4;color:#fff;cursor:pointer;font-size:14px;font-weight:600;'>开始扫描</button>\n <button id='exportBtn' style='padding:10px 28px;border:1px solid #0078d4;border-radius:6px;background:#fff;color:#0078d4;cursor:pointer;font-size:14px;font-weight:600;'>导出Excel</button>\n </div>\n <button id='closeBtn' style='padding:8px 24px;border:1px solid #ddd;border-radius:6px;background:#fff;cursor:pointer;font-size:13px;color:#888;'>关闭</button>\n </div>\n</div>" }, "actions": { "addFiles": { "description": "打开文件选择对话框,添加PDF文件", "code": "async (context) => {\n const result = await context.showOpenFilePicker({\n multiple: true,\n filters: [{ name: 'PDF文件', extensions: ['pdf'] }]\n });\n if (result && result.length > 0) {\n const currentFiles = context.state.fileList || [];\n const newFiles = result.map(file => ({\n name: file.name,\n path: file.path,\n status: '待扫描',\n invoiceNumber: ''\n }));\n const updated = [...currentFiles, ...newFiles];\n context.setState({ fileList: updated });\n context.renderFileList(updated);\n context.updateUI('fileCount', updated.length);\n }\n}" }, "clearFiles": { "description": "清空文件列表", "code": "async (context) => {\n context.setState({ fileList: [] });\n context.renderFileList([]);\n context.updateUI('fileCount', 0);\n}" }, "scanFiles": { "description": "扫描所有PDF文件中的二维码,提取发票号码", "code": "async (context) => {\n const fileList = context.state.fileList || [];\n if (fileList.length === 0) {\n await context.showMessage('请先添加PDF文件!', 'warning');\n return;\n }\n // 更新所有文件状态为“扫描中”\n const scanningList = fileList.map(f => ({ ...f, status: '扫描中...' }));\n context.setState({ fileList: scanningList });\n context.renderFileList(scanningList);\n let processed = 0;\n for (const item of scanningList) {\n try {\n // 调用PDF二维码识别功能(Work Buddy内置API)\n const result = await context.scanPDFQRCode(item.path);\n // 从二维码内容中提取发票号码(支持多种格式)\n const invoiceNumber = context.extractInvoiceNumber(result);\n item.status = '已完成';\n item.invoiceNumber = invoiceNumber || '未识别';\n } catch (e) {\n item.status = '失败';\n item.invoiceNumber = '识别失败';\n }\n processed++;\n context.renderFileList(scanningList);\n context.updateUI('fileCount', scanningList.length);\n // 更新进度(可选)\n await context.updateProgress(processed, scanningList.length);\n }\n const completed = scanningList.filter(f => f.status === '已完成' && f.invoiceNumber && f.invoiceNumber !== '未识别');\n await context.showMessage(扫描完成!共 ${scanningList.length} 个文件,成功识别 ${completed.length} 个发票号码。, 'info');\n}" }, "exportExcel": { "description": "将识别结果导出为Excel文件", "code": "async (context) => {\n const fileList = context.state.fileList || [];\n const validResults = fileList.filter(f => f.invoiceNumber && f.invoiceNumber !== '未识别' && f.invoiceNumber !== '识别失败');\n if (validResults.length === 0) {\n await context.showMessage('没有可导出的发票号码数据,请先执行扫描!', 'warning');\n return;\n }\n // 构建Excel数据\n const excelData = [\n ['序号', '文件名', '发票号码', '状态']\n ];\n validResults.forEach((item, index) => {\n excelData.push([\n index + 1,\n item.name,\n item.invoiceNumber,\n item.status\n ]);\n });\n try {\n const filePath = await context.exportExcel(excelData, '发票号码提取结果.xlsx');\n await context.showMessage(Excel导出成功!文件保存至:${filePath}, 'info');\n } catch (e) {\n await context.showMessage(导出失败:${e.message}, 'error');\n }\n}" }, "close": { "description": "关闭弹窗", "code": "async (context) => { context.close(); }" } }, "state": { "fileList": [] }, "permissions": [ "readFiles", "writeFiles", "showDialog", "showOpenFilePicker", "scanQRCode", "exportExcel" ], "lifecycle": { "onOpen": { "code": "async (context) => {\n // 初始化状态\n context.setState({ fileList: [] });\n\n // 定义提取发票号码的函数\n context.extractInvoiceNumber = (qrContent) => {\n if (!qrContent) return null;\n const content = String(qrContent);\n // 常见发票号码格式:\n // 1. 纯数字发票号码(如:1234567890)\n // 2. 发票号码+发票代码组合(如:发票号码:1234567890)\n // 3. JSON格式中的发票号码字段\n let match = content.match(/发票号码[:::\s]([0-9]{8,12})/);\n if (match) return match[1];\n match = content.match(/invoice[:::\s]([0-9]{8,12})/i);\n if (match) return match[1];\n match = content.match(/number[:::\s]([0-9]{8,12})/i);\n if (match) return match[1];\n match = content.match(/\"发票号码\"\s[::]\s\"([0-9]{8,12})\"/);\n if (match) return match[1];\n match = content.match(/\"invoiceNumber\"\s[::]\s\"([0-9]{8,12})\"/i);\n if (match) return match[1];\n // 如果内容中只有一串数字且长度在8-12位之间,视为发票号码\n const numbers = content.match(/[0-9]{8,12}/g);\n if (numbers && numbers.length === 1) {\n return numbers[0];\n }\n // 尝试提取JSON对象中的发票号码\n try {\n const json = JSON.parse(content);\n if (json.invoiceNumber) return String(json.invoiceNumber);\n if (json.invoice_no) return String(json.invoice_no);\n if (json.number) return String(json.number);\n if (json.发票号码) return String(json.发票号码);\n } catch (e) { / 忽略非JSON内容 */ }\n return null;\n };\n\n // 渲染文件列表\n context.renderFileList = (fileList) => {\n const container = context.getUIElement('fileListContainer');\n if (!container) return;\n if (!fileList || fileList.length === 0) {\n container.innerHTML = '<div style=\"padding:40px 20px;text-align:center;color:#bbb;font-size:14px;\">暂无文件,请点击「+ 添加文件」添加PDF</div>';\n return;\n }\n let html = '';\n fileList.forEach((item, index) => {\n const statusColor = item.status === '已完成' ? '#28a745' :\n item.status === '失败' ? '#dc3545' :\n item.status === '扫描中...' ? '#ffc107' : '#6c757d';\n const invoiceDisplay = item.invoiceNumber || '-';\n html += \n <div style='display:flex;justify-content:space-between;padding:8px 16px;border-bottom:1px solid #f0f0f0;font-size:13px;align-items:center;'>\n <span style='flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#333;'>${item.name}</span>\n <span style='width:120px;text-align:center;color:${statusColor};font-weight:500;'>${item.status}</span>\n <span style='width:100px;text-align:center;color:#1a1a2e;font-weight:600;'>${invoiceDisplay}</span>\n </div>\n;\n });\n container.innerHTML = html;\n };\n\n // 绑定UI事件\n context.bindUI('addFilesBtn', 'addFiles');\n context.bindUI('clearFilesBtn', 'clearFiles');\n context.bindUI('scanBtn', 'scanFiles');\n context.bindUI('exportBtn', 'exportExcel');\n context.bindUI('closeBtn', 'close');\n\n // 初始化空列表\n context.renderFileList([]);\n context.updateUI('fileCount', 0);\n }\n}" } }

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

Highlights

  • 解决财务/办公自动化场景中的核心痛点,批量提取发票号码显著提升效率
  • 功能闭环完整,从文件选择到结果导出形成完整工作流
Trigger Precision95/100

Highlights

  • 触发词覆盖全面,包含多种用户可能使用的表达方式
  • 边界清晰,不易与其他Skill混淆
Structure and Standards90/100

Highlights

  • 操作流程清晰,步骤划分明确
  • UI设计合理,用户体验良好
Execution Reliability88/100

Highlights

  • 异常处理完善,覆盖主要错误场景
  • 使用Work Buddy内置API,工具来源可靠
Evidence Verifiability (mean of the first four)91/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.