원클릭으로
rule-contribution
三國志略 — 指引 AI 代理 (如 Claude Code, Trae 等) 与开发者贡献/修改游戏 YAML 规则规范。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
三國志略 — 指引 AI 代理 (如 Claude Code, Trae 等) 与开发者贡献/修改游戏 YAML 规则规范。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
三國志略 / Histrategy — AI 驱动的历史策略游戏。支持三國和罗马双剧本。在飞书/Discord/Telegram 中用自然语言指挥千军万马。
三國志略 / Histrategy — AI-powered historical strategy game. Supports Three Kingdoms and Rome Triumvirate scenarios. Command armies through natural language. Multiplayer via IM.
Use when an agent (OpenClaw, Hermes) needs to install and play 三國志略 via pip-installed SDK with SQLite persistence. No server, no PostgreSQL — just pip install + play.
| name | rule-contribution |
| description | 三國志略 — 指引 AI 代理 (如 Claude Code, Trae 等) 与开发者贡献/修改游戏 YAML 规则规范。 |
| version | 1.0.0 |
| author | Emergence Science |
| license | MIT |
| platforms | ["linux","macos","windows"] |
| metadata | {"hermes":{"tags":["rules","yaml","modding","simulation","physics-engine"],"category":"configuration"}} |
Use this skill to guide AI agents and external contributors on how to define, configure, and modify game simulation rules and historical event parameters in the histrategy-engine module.
All core game simulation rules are modularized as YAML specifications located under: histrategy-engine/src/histrategy_engine/rules/
economy.yaml)These rules define deterministic updates (e.g., food production, tax rates, military upkeep). Each rule must define constants and formulas.
Example:
food_production:
constants:
base_yield: 1.2
population_factor: 0.05
formula: "base_yield * economy + population * population_factor * season_multiplier"
historical_events.yaml)These rules govern non-linear events triggered by physical thresholds, random chance, or historical narrative drift.
Fields:
preconditions (str): Python-evaluable expression evaluating to a boolean.probability_formula (str): Python-evaluable math formula producing a float probability ($0.0 \le p \le 1.0$).base_gravity (float): The default likelihood or weights of this event when preconditions are met.desc (str): Narrative description of the event.Example:
caocao_captures_xinye:
preconditions: "cao_strength > 2.0 * liubei_strength and xinye_owner == 'shu' and xinye_garrison < 5000"
probability_formula: "0.85 * (1.0 - player_deviation * 0.5)"
base_gravity: 0.8
desc: "曹军大军压境新野,刘备守军不支,城池陷落"
The RuleInterpreter evaluates YAML formulas inside a restricted sandbox environment. Only mathematical functions and specific local variables are supported.
The following mathematical functions from Python's standard math module are imported:
min(a, b)max(a, b)abs(x)round(x, n)pow(x, y)At runtime, the engine injects variables into the interpreter context depending on the rule context.
For general economy/territory rules:
economy: Current territory development/economy score.population: Current population in the territory.morale: Faction morale.season_multiplier: A multiplier based on the current season (e.g., Summer = 1.0, Winter = 0.05).For historical event triggers (e.g., historical_events.yaml checks):
{faction}_strength (e.g., cao_strength, liubei_strength): Total army strength of the faction.{territory}_owner (e.g., xinye_owner): Faction ID owning the territory.{territory}_garrison (e.g., xinye_garrison): Number of defensive troops stationed.player_deviation: Current history deviation factor ($0.0 \le d \le 1.0$).{event}_won or {state}_active (e.g., sunliu_alliance): Boolean flags representing game milestones.histrategy-engine/src/histrategy_engine/rules/.histrategy_engine/rules/interpreter.py../venv/bin/pytest histrategy-engine/tests/test_rules_interpreter.py
logs/rules_execution.log to verify that your formula was interpreted correctly and produced the expected numeric outputs.