numeric-data-processing-standards

Provide comprehensive guidance for handling numeric data in code, including data type selection, avoiding magic numbers, type conversions, and boundary checks. Used when writing or reviewing code involving numeric variables, constants, calculations, or comparisons to prevent type errors, overflow, and runtime exceptions.

Last repository push
GitHub Stars
140
Forks
36
Issues / PRs
1

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 "numeric-data-processing-standards" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-5f0a9fab50d47ffa2d99405f6bf14c6690c3036a897a4172e68b307d0d16641c. Verify the upstream source and version against https://github.com/kitchen-engineer42/pdf2skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Provide comprehensive guidance for handling numeric data in code, including data type selection, avoiding magic numbers, type conversions, and boundary checks. Used when writing or reviewing code involving numeric variables, constants, calculations, or comparisons to prevent type errors, overflow, and runtime exceptions.

0 Downloads

Introduction source: third_party · kitchen-engineer42 · 0.0.1 Reference

SkillPi interpretation

Tasks
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.
Audience
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
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
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

Current listing version

0.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value75/100

Highlights

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

Highlights

  • 触发描述完整且位置正确
  • When to Use 章节进一步细化了适用场景
Structure and Standards90/100

Highlights

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

Highlights

  • 建议基于通用编程最佳实践,可操作性强
  • 覆盖了数值处理的主要风险点和异常情况
Evidence Verifiability (mean of the first four)85/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.