cjr20263721

Tool to generate business document numbers such as contract numbers, invoice numbers, and commission slips following prefix+date+sequence rules; used when users need document numbers or numbering rules.

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

Tool to generate business document numbers such as contract numbers, invoice numbers, and commission slips following prefix+date+sequence rules; used when users need document numbers or numbering rules.

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: cjr20263721
slug: cjr20263721
displayName: 单据编号生成
version: 1.0.0
summary: 按前缀+日期+序号生成合同/发票/提成单编号。
license: MIT
description: 生成合同、发票、提成单等业务编号(前缀+日期+流水号)。当用户要单据编号、合同号生成、单号规则时使用。

单据编号生成

灵感:能力工具箱 doc-serial(自研)。

小四原创:前缀 + yyyyMMdd + 序号;序号需可持久化(localStorage/服务端),防刷新撞号。

何时使用

  • 新建合同/发票/提成单自动带号
  • 多单据类型不同前缀(HT/FP/TC)
  • 演示环境本地流水号

硬约束

  1. 格式可配,默认:{prefix}{yyyyMMdd}{seq:4} → 如 HT202607220001。
  2. 同日前缀下序号递增;跨日归零或按产品约定(默认跨日从 1)。
  3. 并发:前端演示可用 localStorage;生产必须服务端原子取号。
  4. 实现要点注释标 小四原创。
  5. 与 nanoid 草稿 ID 区分:本包是可读业务单号。

推荐实现

export type SerialOpts = {
  prefix: string
  date?: Date
  seqWidth?: number
  /** 返回「下一个序号」,由调用方持久化 */
  nextSeq: (key: string) => number | Promise<number>
}

function ymd(d: Date) {
  const y = d.getFullYear()
  const m = String(d.getMonth() + 1).padStart(2, '0')
  const day = String(d.getDate()).padStart(2, '0')
  return `${y}${m}${day}`
}

// 小四原创:生成业务单号
export async function makeDocSerial(opts: SerialOpts) {
  const prefix = String(opts.prefix || '').toUpperCase().replace(/[^A-Z0-9]/g, '')
  if (!prefix) throw new Error('前缀不能为空')
  const d = opts.date ?? new Date()
  const day = ymd(d)
  const key = `${prefix}:${day}`
  const n = await opts.nextSeq(key)
  const width = opts.seqWidth ?? 4
  const seq = String(n).padStart(width, '0')
  return `${prefix}${day}${seq}`
}

// 小四原创:演示用本地序号(勿用于生产多开页)
export function localNextSeq(key: string): number {
  const k = `doc-serial:${key}`
  const cur = Number(localStorage.getItem(k) || '0') + 1
  localStorage.setItem(k, String(cur))
  return cur
}

Agent 步骤

  1. 配置前缀字典(合同 HT、发票 FP…)。
  2. 新建单据时 makeDocSerial;展示只读可复制。
  3. 生产接后端取号;演示用 localNextSeq。
  4. 自测:同日递增、跨日从 1、非法前缀。

不要做

  • 用 Math.random 当正式合同号。
  • 多标签页共用 localStorage 却声称绝对不撞号。

附加

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 解决企业日常高频刚需场景,提供合同、发票、提成单等业务编号生成能力
  • 具有明确的实用价值和广泛的应用场景
Trigger Precision90/100

Highlights

  • 触发词精准完整,覆盖单据编号、合同号生成、单号规则等多种使用场景
  • 边界清晰,用户容易理解何时使用该 Skill
Structure and Standards70/100

Highlights

  • 文档结构完整,包含何时使用、硬约束、推荐实现、Agent 步骤等关键章节
  • 提供了清晰的代码示例和执行流程
Execution Reliability75/100

Areas to improve

  • Missing referenced files Reported severity: Major

    SKILL.md 中引用了 README.md、reference.md、templates/usage.md 文件,但这些文件未在传入内容中提供

    Recommendation: 请补充所有被引用的文件,或移除无效的引用链接,以确保文档完整性

Highlights

  • 代码实现逻辑清晰,有完善的错误处理机制
  • 明确区分演示环境与生产环境的使用要求,提供了 localStorage 演示实现和服务端生产建议
Evidence Verifiability (mean of the first four)80/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.