AgentSkillsCN

scoring-strategy

计算水质评分的数学原理和逻辑。当添加新矿物质、调整阈值或解释评分结果时,可使用此功能。

SKILL.md
--- frontmatter
name: scoring-strategy
description: Mathematical principles and logic for calculating water quality scores. Use when adding new minerals, adjusting thresholds, or explaining score results.

Scoring Strategy: "wasser"

This skill defines how water analysis values are transformed into normalized scores (0-100) based on specific mineral characteristics and user profiles.

Core Scoring Functions

1. Bell Curve (bellScore)

Used for minerals where a specific range is "ideal," and values either above or below are penalized (e.g., pH, Calcium).

  • Logic: Normalized distance from the ideal center.

2. Band Scoring (bandScore)

Used for substances where "less is better" (e.g., Nitrate, Sodium).

  • Thresholds:
    • IDEAL: 100 points.
    • ACCEPTABLE: 70-90 points.
    • LIMIT: 50 points (legal limit).
    • EXCESSIVE: 0 points.

Profile Logic

Scores are adjusted based on the active user profile:

  • Baby: stricter limits for Nitrate, Sodium, and Sulfate.
  • Sport: higher requirements for Electrolytes (Magnesium, Sodium).
  • Blood Pressure: ultra-low Sodium thresholds.

Fallback Values

If no specific reference values exist for a mineral, use FALLBACK_RANGES based on general drinking water guidelines.

Implementation Reference

  • Primary scoring logic: src/domain/scoring.ts
  • Mineral configurations: src/domain/mineralConfig.ts
  • Score formatting: src/lib/scoring-display.ts