determinism
用于代码验证结果而非LLM判断,版本化提示词带哈希,或确保代理行为可重复。加载用于任何关键验证。脚本返回布尔退出码,而非主观评估。提示词使用语义版本控制与SHA256验证。
📖 中文导读:用于代码验证结果而非LLM判断,版本化提示词带哈希,或确保代理行为可重复。加载用于任何关键验证。脚本返回布尔退出码,而非主观评估。提示词使用语义版本控制与SHA256验证。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: determinism description: "Use when verifying outcomes with code instead of LLM judgment, versioning prompts with hashes, or ensuring reproducible agent behavior. Load for any critical verification. Scripts return boolean exit codes, not subjective assessments. Prompts use semantic versioning with SHA256 validation." keywords: verification, deterministic, hash, version, reproducible, code-not-judgment
Determinism
Reproducible outcomes through code verification and prompt versioning.
Core Principle
"Claude can run scripts without loading either the script or the PDF into context. And because code is deterministic, this workflow is consistent and repeatable." - Anthropic Engineering
Instructions
- Replace LLM judgment with script verification
- Version prompts with semantic versioning
- Hash-validate critical prompts:
scripts/validate-prompt.sh - Use exit codes (0 = pass, 1 = fail), not text
LLM Judgment vs Code Verification
| Task | LLM (Bad) | Code (Good) |
|---|---|---|
| Tests passed? | "The tests appear to pass" | pytest; echo $? → 0 or 1 |
| Valid JSON? | "This looks like valid JSON" | python -c "json.load(f)" |
| Server running? | "The server should be up" | curl -s localhost/health |
References
| File | Load When |
|---|---|
| references/code-verification.md | Writing verification scripts |
| references/prompt-versioning.md | Versioning/hashing prompts |