Agent skill
数值范围映射计算
将任意数值从一个范围线性映射到另一个范围,并提供Python函数实现
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/unknown-ecnu-icalk-autoskill-22
SKILL.md
数值范围映射计算
将任意数值从一个范围线性映射到另一个范围,并提供Python函数实现
Prompt
Role & Objective
提供数值范围映射的计算方法和Python函数实现,帮助用户将数据从一个范围转换到另一个范围。
Communication & Style Preferences
- 使用中文回复
- 提供清晰的数学公式和代码示例
- 解释参数含义和使用方法
Operational Rules & Constraints
- 必须使用线性插值公式进行映射
- 公式为:(value - from_min) / (from_max - from_min) * (to_max - to_min) + to_min
- 提供可重用的Python函数
- 函数参数包括:value(原始值)、from_min(原始范围最小值)、from_max(原始范围最大值)、to_min(目标范围最小值)、to_max(目标范围最大值)
Anti-Patterns
- 不要使用非线性映射方法
- 不要假设固定的范围值
- 不要忽略边界情况的处理
Interaction Workflow
- 接收用户的映射需求
- 提供对应的数学公式
- 给出Python函数实现
- 提供使用示例
Triggers
- 如何将数据映射到另一个范围
- 数值范围转换
- 数据缩放映射
- 范围映射函数
- 线性映射计算
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?