zxcvbn-pwd-check

Use zxcvbn in the browser to assess password strength, estimate guess counts, and provide improvement suggestions without uploading passwords; suitable for registration password checks and weak-password warnings.

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

Use zxcvbn in the browser to assess password strength, estimate guess counts, and provide improvement suggestions without uploading passwords; suitable for registration password checks and weak-password warnings.

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: zxcvbn-pwd-check
slug: dzl20266512
displayName: 密码强度检测
version: 1.0.0
summary: 用 zxcvbn 本地评估账号密码强度与猜测次数。
license: MIT
description: 用 zxcvbn 在浏览器内评估密码强度、猜测次数与改进建议,不上传密码。当用户需要密码强度检测、zxcvbn、注册密码校验、弱密码提示时使用。

密码强度检测(zxcvbn)

灵感:能力工具箱 zxcvbn-pwd(pkg: zxcvbn)。

在注册/改密表单旁本地评估密码强度与估算猜测次数,密码不出浏览器。

何时使用

  • 账号注册、修改密码
  • 需要「太弱 / 一般 / 较强」等级与中文提示
  • 不想把密码发到后端做强度评分

硬约束

  1. 依赖 zxcvbn(或维护中的兼容包);禁止把明文密码 POST 到第三方测强度。
  2. 输出至少包含:score(0~4)、中文等级、guesses(或可读估算)、1~3 条改进建议(可映射官方 feedback)。
  3. 可把用户名、邮箱本地名作为 user_inputs,降低「密码=账号」得分。
  4. UI 仅强度条/文案,不替用户生成并自动填入不可见密码(除非用户明确要求生成器另做)。
  5. 尊重减动效:强度条可不做动画。

推荐实现要点

import zxcvbn from 'zxcvbn'

const LEVELS = ['很弱', '弱', '一般', '较强', '很强'] as const

export function checkPasswordStrength(
  password: string,
  userInputs: string[] = [],
) {
  if (!password) {
    return { score: 0, level: '未输入', guesses: 0, tips: ['请输入密码'] }
  }
  const r = zxcvbn(password, userInputs.filter(Boolean))
  const tips = [r.feedback.warning, ...(r.feedback.suggestions || [])]
    .filter(Boolean)
    .slice(0, 3)
  return {
    score: r.score as 0 | 1 | 2 | 3 | 4,
    level: LEVELS[r.score],
    guesses: r.guesses,
    crackTime: r.crack_times_display?.offline_slow_hashing_1e4_per_second,
    tips: tips.length ? tips : ['可再加长或混用字词与符号'],
  }
}

/** 业务可否提交:建议 score >= 2 或按安全策略调整 */
export function isPasswordAcceptable(password: string, minScore = 2) {
  return checkPasswordStrength(password).score >= minScore
}

Agent 步骤

  1. 安装 zxcvbn,封装 checkPasswordStrength。
  2. 输入框 @input 本地更新强度条;传入账号相关 userInputs。
  3. 自测:123456 很弱;较长无规律口令 score 更高;确认无网络请求。

附加

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 密码强度检测是用户注册、改密等场景下的高频刚需
  • zxcvbn 是行业标准算法,本地评估不上传密码符合安全最佳实践
Trigger Precision80/100

Highlights

  • description 明确描述了适用场景,触发词覆盖合理
Structure and Standards85/100

Highlights

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

Highlights

  • 依赖 zxcvbn 包,参数使用正确
  • 覆盖了空密码等边界情况,有明确的业务提交判断逻辑
Evidence Verifiability (mean of the first four)83/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.