numeric-data-processing-standards

提供处理代码中数值数据的全面指南,包括数据类型选择、避免使用魔法数字、类型转换以及边界检查。用于编写或审查涉及数值变量、常量、计算或比较的代码,以防止类型错误、溢出和运行时异常。

仓库最近推送
GitHub Stars
140
Forks
36
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "numeric-data-processing-standards":https://skillpi.com/zh/skills/deepskill-5f0a9fab50d47ffa2d99405f6bf14c6690c3036a897a4172e68b307d0d16641c。安装前核对上游来源和版本:https://github.com/kitchen-engineer42/pdf2skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

提供处理代码中数值数据的全面指南,包括数据类型选择、避免使用魔法数字、类型转换以及边界检查。用于编写或审查涉及数值变量、常量、计算或比较的代码,以防止类型错误、溢出和运行时异常。

0 下载

介绍来源: third_party · kitchen-engineer42 · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
适合谁
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: numeric-data-processing-standards
description: Provides comprehensive guidelines for handling numeric data in code, including data type selection, magic number avoidance, type conversions, and boundary checks. Use this skill when writing or reviewing code that involves numeric variables, constants, calculations, or comparisons to prevent type errors, overflow, and runtime exceptions.

Numeric Data Processing Standards

When to Use

Apply this skill when:

  • Defining numeric variables or constants
  • Performing numeric calculations or operations
  • Comparing numeric values
  • Converting between data types
  • Reviewing code for potential numeric-related defects

Core Procedures

1. Data Type Selection and Declaration

  • Choose appropriate data type based on requirements (BCD, floating-point, integer)
  • Review compiler warnings related to data types
  • Add explanatory comments when declaring variables
  • Define portable data types for cross-platform compatibility

2. Literals and Magic Number Handling

  • Replace literal numbers with named constants
  • Avoid hardcoded 0 and 1 except when semantically appropriate
  • Eliminate "magic numbers" by using descriptive constant names

3. Numeric Operations and Conversions

  • Handle numeric type conversions explicitly
  • Avoid comparisons between mixed types
  • Prevent operations on numbers with vastly different magnitudes
  • Consider computational cost of common operations

4. Error Prevention and Boundary Checks

  • Implement integer overflow protection
  • Validate integer ranges before operations
  • Prevent division by zero errors
  • Apply boundary analysis to avoid off-by-one errors

Key Considerations

  • Type Safety: Always verify type compatibility before operations
  • Precision: Be aware of floating-point precision limitations
  • Portability: Use type definitions that work across platforms
  • Performance: Balance safety with computational efficiency
  • Readability: Named constants improve code maintainability

Common Pitfalls to Avoid

  • Implicit type conversions that lose precision
  • Comparing floating-point numbers for exact equality
  • Assuming integer overflow behavior across compilers
  • Using magic numbers without documentation
  • Ignoring compiler warnings about type mismatches

当前收录版本

0.0.1

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值75/100

亮点

  • 为开发者提供数值数据处理的系统性指导
  • 涵盖数据类型选择、魔法数字处理、类型转换和边界检查等关键方面
触发精准85/100

亮点

  • 触发描述完整且位置正确
  • When to Use 章节进一步细化了适用场景
结构规范90/100

亮点

  • Core Procedures 步骤划分清晰,逻辑性强
  • 文档结构完整,包含注意事项和常见陷阱
执行可靠88/100

亮点

  • 建议基于通用编程最佳实践,可操作性强
  • 覆盖了数值处理的主要风险点和异常情况
证据可验 (前四项均值)85/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。