pcfj2026232
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 "pcfj2026232" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-5aa6b2a0ef6d69456126e579bbd66434af2f3f28c4ba740d60919a045d3a8551. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/pcfj2026232 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
Randomly draw and display results from a list of options, usable for decisions, task assignment, or casual interaction; supports optional weighting.
Introduction source: third_party · user_f1b049da · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: pcfj2026232
slug: pcfj2026232
displayName: 趣味抽签
version: 1.0.0
summary: 从选项列表中随机抽签并展示结果,可用于决策、分工或轻松互动,支持可选权重。
license: MIT
description: 从选项列表中随机抽签并展示结果,可用于决策、分工或轻松互动,支持可选权重。趣味抽签
给定一组签文/选项(可带权重),点一次抽出一条,给出明确结果提示。适合「谁跟进」「先做哪家」「轻松抽任务」。
何时使用
- 用户要「抽签」「随机选一个」「摇签」「抽人/抽任务」
- 需要可复现的简单随机(同一种子可选,默认真随机)
硬约束
- 选项至少 2 条;不足时拒绝并提示。
- 有权重时按权重抽样;无权重则均匀随机。
- 结果必须可见(文案 + 可选轻动效),并给出成功/失败提示。
- 不调用外部占卜 API;逻辑本地完成。
核心实现
export type Lot = { text: string; weight?: number };
export function drawLot(lots: Lot[]): { ok: boolean; text?: string; message: string } {
const list = (lots || []).filter(l => String(l?.text || '').trim());
if (list.length < 2) {
return { ok: false, message: '至少需要 2 个选项才能抽签' };
}
const weights = list.map(l => (l.weight != null && l.weight > 0 ? l.weight : 1));
const sum = weights.reduce((a, b) => a + b, 0);
let r = Math.random() * sum;
for (let i = 0; i < list.length; i++) {
r -= weights[i];
if (r <= 0) {
const text = list[i].text.trim();
return { ok: true, text, message: `抽中:${text}` };
}
}
const text = list[list.length - 1].text.trim();
return { ok: true, text, message: `抽中:${text}` };
}
验收
['甲','乙','丙']多次抽取,结果落在集合内。- 权重
{A:9,B:1}时 A 明显更常出现。 - 1 条选项时失败提示清晰。
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供随机抽签功能,支持权重设置,适用于决策分工等实用场景
- 逻辑简单清晰,满足轻量级互动需求
Highlights
- 触发词覆盖合理,如“抽签”“随机选一个”等,边界清晰
Areas to improve
-
缺少端到端用户示例 Reported severity: Minor
文档缺少具体输入输出的端到端用户交互示例
Recommendation: 建议补充一个完整的用户调用示例,展示输入格式和输出结果
Highlights
- 文档结构清晰,包含何时使用、硬约束、核心实现等必要章节
- frontmatter 完整,版本信息明确
Highlights
- 核心逻辑完整,包含参数校验和异常处理
- 无外部依赖,执行可靠
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.
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.
User discussion
No verified reviews yet.