mobile-carrier-detect
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 "mobile-carrier-detect" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-d864048181c52f1e0667f83459228c7c0eee8449299dc87bfc396f39d3c28165. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/hnwk2026583 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
Locally identifies a phone number's carrier by number prefix (China Mobile/China Unicom/China Telecom/China Radio and TV), without providing home-location information. Intended for scenarios requiring carrier determination for phone numbers, tagging contact number prefixes in CRM, or use within a mobile-carrier toolbox.
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: mobile-carrier-detect
slug: hnwk2026583
displayName: 运营商号段识别
version: 1.0.0
summary: 按号段本地识别移动/联通/电信/广电,无归属地接口。
license: MIT
description: 按号段本地识别移动/联通/电信/广电,无归属地接口。当用户需要手机号运营商判断、CRM 联系人号段标注,或提到工具箱 mobile-carrier 时使用。运营商号段识别
灵感:能力工具箱 mobile-carrier(轻量、纯本地号段表)。
何时使用
- 录入大陆 11 位手机号时,提示所属运营商(移动/联通/电信/广电)。
- 不能或不想调用归属地/运营商第三方接口。
硬约束
- 仅号段表:根据前 3~4 位匹配;禁止伪装成实时归属地查询。
- 格式:清洗非数字后须匹配
^1\d{10}$,否则返回无效。 - 未收录号段:返回「未知/虚拟运营」类提示,勿瞎猜。
- 说明局限:号段会携号转网/调整;表为常用样本,需可扩展。
- 不输出省市:除非另有本地库,否则不要编造归属地。
推荐实现要点
type Hit = { prefix: string; carrier: string }
const SEGMENTS: Hit[] = [
{ prefix: '138', carrier: '中国移动' },
{ prefix: '186', carrier: '中国联通' },
{ prefix: '189', carrier: '中国电信' },
{ prefix: '192', carrier: '中国广电' },
// …可按业务扩充
]
export function detectMobileCarrier(mobile: string) {
const digits = String(mobile || '').replace(/\D/g, '')
if (!/^1\d{10}$/.test(digits)) {
return { valid: false, carrier: '—', message: '非有效大陆 11 位手机号' }
}
// 长前缀优先:按 prefix 长度降序再 find
const ordered = [...SEGMENTS].sort((a, b) => b.prefix.length - a.prefix.length)
const hit = ordered.find((s) => digits.startsWith(s.prefix))
if (!hit) {
return { valid: true, carrier: '未知/虚拟运营', message: '号段未收录' }
}
return { valid: true, carrier: hit.carrier, message: '号段匹配(本地表)' }
}
Agent 执行步骤
- 实现检测函数与可维护的号段表(至少覆盖四大运营商常见号段)。
- 匹配时长前缀优先,避免短前缀误伤。
- UI 旁注:「本地号段,非官方实时数据」。
- 用移动/联通/电信/广电各 1 个样例自测,再测非法长度。
附加
- 说明见 README.md
- 排错见 reference.md
- 模板见 templates/usage.md
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供手机号运营商号段识别功能,适用于 CRM 标注、表单校验等实际业务场景
- 纯本地实现,避免第三方接口依赖,符合隐私与离线使用需求
Highlights
- 触发描述清晰,覆盖手机号运营商判断、CRM 联系人标注等典型使用场景
- 明确提及工具箱 mobile-carrier,便于用户联想触发
Areas to improve
-
缺少端到端完整示例 Reported severity: Minor
文档提供了代码实现片段,但缺少一个完整的端到端使用示例(如输入手机号到输出结果的完整流程展示)。
Recommendation: 补充一个完整的端到端示例,展示从用户输入手机号到返回运营商结果的完整交互流程。
-
引用文件未验证完整性 Reported severity: Minor
文档末尾引用了 README.md、reference.md、templates/usage.md 等文件,但未验证这些文件是否实际存在且内容完整。
Recommendation: 确保所有引用的文件都存在且内容完整,或移除无法提供的引用链接。
Highlights
- 文档结构清晰,包含何时使用、硬约束、实现要点、执行步骤等必要章节
- frontmatter 完整,版本、许可证等信息齐全
Highlights
- 提供了完整的 TypeScript 实现逻辑,包含输入清洗、正则校验、长前缀优先匹配等关键处理
- 异常处理覆盖全面,包括无效格式、未收录号段等情况,并有明确的用户提示
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.