- name
- context-token-budget
- description
- Guard AI context usage with a fail-closed token budget — stop burning tokens. 用 fail-closed 的 token 预算守护 AI 上下文,防止积分烧光。 适用场景:当需要估算上下文 token 用量并执行 fail-closed 预算(防止超限烧积分)时使用本技能;触发词:context、token、budget、上下文预算、限额。
- slug
- context-token-budget
- title
- context-token-budget
- version
- 1.0.1
- license
- MIT
- category
- 效率
- author
- SynomosAI (LGD initiative)
- platforms
- ["windows","macos","linux"]
- tags
- ["context","token","budget"]
- description_zh
- 用 fail-closed 的 token 预算守护 AI 上下文,防止积分烧光:中英文感知 token 估算 + 超额退出码 1 + SHA-256 锚点。
- description_en
- Fail-closed token budget guard for AI context: CJK/English-aware token estimation, PASS/FAIL verdict and SHA-256 content anchor.
- read_when
- ["估算一段文本/文件的 token 用量(中英文感知)并执行 fail-closed 预算","上下文超限/积分烧光前要 PASS/FAIL 判定与处置建议"]
- risk_tier
- medium
- ai_protocol
- true
- spec
- usk/1.0
- interface
- {"type":"cli","entry_point":"scripts/budget.py","runtime":"python3","call_pattern":"args"}
- input_schema
- {"args":{"type":"string","description":"命令行参数透传给主脚本,具体取值见 --help","required":false}}
- output_schema
- {"stdout":{"type":"string","description":"标准输出为 JSON 结果或结构化文本,含逐项检查与总体结论"},"exit_code":{"type":"integer","description":"0=OK/PASS; 1=findings/warnings; 2=usage or argument error"}}
- capabilities
- ["cli_tool"]
- permissions
- {"network":false,"filesystem":false,"subprocess":false}
- requirements
- {"python_packages":[],"min_python":"3.8"}
- changelog
- 1.0.1: Bilingual rewrite (full EN+ZH, English first); 1.0.0: initial upload