Technical guidelines for AI agents working on the Histrategy game project.
Install
mkdir -p .claude/skills/skills-emergencescience && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9619" && unzip -o skill.zip -d .claude/skills/skills-emergencescience && rm skill.zipInstalls to .claude/skills/skills-emergencescience
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Instructions for AI coding agents (Claude Code, Hermes, Cursor, etc.) contributing to this project.Key capabilities
- →Validate knowledge base data
- →Serialize game state
- →Generate narrative via LLM
How it works
It enforces a strict architecture where the LLM acts as the game engine and state is managed via serializable dataclasses.
Inputs & outputs
When to use skills
- →Adhering to project architecture
- →Validating game knowledge base data
- →Ensuring correct usage of WorldState dataclasses
About this skill
SKILL.md — Agent Instructions for 三國志略
Instructions for AI coding agents (Claude Code, Hermes, Cursor, etc.) contributing to this project.
Project Identity
三國志略 (Histrategy) — An open-source, AI-powered text-based Three Kingdoms strategy game. The LLM is the game engine, not a narrator over pre-computed results.
Agent Workflow
Before Writing Code
- Read
CLAUDE.mdfor critical architecture context and current priorities - Read
docs/PRD.mdanddocs/tech-design.mdfor product vision and architecture - Understand the Plan/Command two-tier architecture before touching engine code
- Check
histrategy/knowledge/data/schema.jsonbefore editing any JSON data file
While Writing Code
- Test-first: Write or update tests alongside code changes
- LLM-first: All advisor speeches, suggestions, consequences, and NPC actions come from the LLM layer — never write Python string templates for game content
- State-first: Use
WorldStatedataclasses. All state is serializable viato_dict()/from_dict() - Minimal changes: Don't refactor or add abstractions beyond what the task requires. No half-finished implementations.
Before Submitting
# 1. Run full test suite
pytest tests/ -v
# 2. Validate knowledge base (if data files changed)
python histrategy/knowledge/scripts/validate_data.py
# 3. Smoke test dev mode
histrategy --dev --new
What to Avoid
- DO NOT write hardcoded template functions (
_generate_*,_format_*,_compute_*) for game narrative - DO NOT add comments explaining what code does — well-named identifiers do that
- DO NOT add error handling for scenarios that can't happen — trust internal code and framework guarantees
- DO NOT create documentation files unless explicitly requested
- DO NOT use backwards-compatibility shims or keep unused code — delete it
Project Layout (Quick Reference)
histrategy/engine/ # Game engine (game.py, advisors.py, command.py)
histrategy/llm/ # LLM layer (game_master.py, adapter.py, prompts.py)
histrategy/state/ # Game state (world_state.py)
histrategy/cli/ # Terminal UI (app.py for Rich TUI, dev_cli.py for --dev)
histrategy/knowledge/ # Historical data (data/*.json, scripts/validate_data.py)
docs/ # Design docs (PRD.md, tech-design.md)
tests/ # Pytest suite (test_engine.py, test_e2e.py)
Module Purposes
| Module | Purpose |
|---|---|
engine/game.py | Game orchestrator — turn loop, Plan/Command mode dispatch |
engine/advisors.py | Plan Mode: advisor generation, 4 strategic suggestions |
engine/command.py | Command Mode: bureaucracy execution, seed system |
engine/offline_sim.py | Rule-based fallback when no LLM API key |
llm/game_master.py | LLM-powered Game Master — generates plan mode, command mode, NPC moves |
llm/adapter.py | Multi-provider LLM client (DeepSeek, OpenAI, Tongyi, OpenRouter) |
llm/prompts.py | System prompt templates for LLM calls |
state/world_state.py | WorldState / FactionState dataclasses with JSON persistence |
cli/app.py | Rich terminal UI (colors, panels, layout) |
cli/dev_cli.py | Plain-text dev mode for testing (--dev flag) |
Commit Style
Follow the existing commit convention: short Chinese + English prefix describing the change (e.g. H24a: Rich TUI refactor — unified LLM GameMaster display). Commits are co-authored with the AI agent that produced them.
When not to use it
- →When writing hardcoded narrative templates
- →When adding unused abstractions
Prerequisites
Limitations
- →No hardcoded template functions allowed
How it compares
It mandates LLM-first narrative generation instead of using traditional string templates.
Compared to similar skills
skills side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| skills (this skill) | 0 | 2mo | Review | Intermediate |
| codex-cli-bridge | 9 | 9mo | Review | Intermediate |
| massgen-develops-massgen | 1 | 5mo | Review | Advanced |
| wox-plugin-creator | 1 | 1mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
codex-cli-bridge
alirezarezvani
Bridge between Claude Code and OpenAI Codex CLI - generates AGENTS.md from CLAUDE.md, provides Codex CLI execution helpers, and enables seamless interoperability between both tools
massgen-develops-massgen
massgen
Guide for using MassGen to develop and improve itself. This skill should be used when agents need to run MassGen experiments programmatically (using automation mode) OR analyze terminal UI/UX quality (using visual evaluation tools). These are mutually exclusive workflows for different improvement goals.
wox-plugin-creator
Wox-launcher
Create and scaffold Wox plugins (nodejs, python, script-nodejs, script-python). Use when cloning official SDK templates, generating script plugin templates, or preparing plugins for publish.
droidrun-docs
droidrun
DroidRun documentation reference. Use when users ask about DroidRun setup, configuration, SDK usage, CLI commands, device setup, agents, architecture, app cards, credentials, tracing, Docker, migration, structured output, or any DroidRun "how do I..." questions.
klingai-text-to-video
jeremylongshore
Generate videos from text prompts with Kling AI. Use when creating videos from descriptions or learning prompt techniques. Trigger with phrases like 'kling ai text to video', 'klingai prompt', 'generate video from text', 'text2video kling'.
agent-implementer-sparc-coder
ruvnet
Agent skill for implementer-sparc-coder - invoke with $agent-implementer-sparc-coder