diplomacy-skill
Diplomacy system work for civ-game (foreign economy/development/military simulation, treaties, alliances/organizations, relations like colony or subject, diplomatic actions, and diplomacy UI or events). Use when implementing or modifying diplomacy logic, diplomatic AI, treaties or agreements, nation relations/organization systems, foreign market calculations, or DiplomacyTab UX in this repo.
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
Diplomacy Skill
Overview
Implement and extend the game's diplomacy system: nation relations, treaties, alliances or organizations, foreign economy development and military simulation, plus diplomacy UI and events.
Workflow
- Clarify the feature scope: treaties, relations, organizations, foreign market simulation, or AI behavior.
- Review existing diplomacy logic and configs; load references/diplomacy-files.md.
- Define or adjust the data model for relations, treaties, organizations, and foreign markets.
- Implement logic in src/logic/diplomacy and related economy or military modules.
- Update configs, events, and UI to surface new actions and effects.
- Ensure exports are wired through src/logic/index.js or src/components/index.js when needed.
- Validate with lint or build when feasible.
Design Rules
- Follow repo conventions: 4-space indent, semicolons, React 19 + Vite + Tailwind.
- Keep diplomacy logic in src/logic/diplomacy; shared helpers in src/utils.
- Prefer config-driven definitions for treaties, actions, or organizations.
- Add short Chinese comments only for non-obvious logic.
Core Capabilities
Treaties and agreements
- Model treaty types (non-aggression, investment, free trade) with terms, duration, and effects.
- Gate player actions and AI evaluation in aiDiplomacy and the diplomacy UI.
Relations and statuses
- Represent relation states (ally, rival, colony, subject) with clear transitions and modifiers.
- Centralize relation math and validation in nations.js or utils.
Organizations and blocs
- Support membership rules, shared effects, and triggers (e.g., alliances or free trade zones).
- Keep organization effects composable so multiple blocs can stack.
Foreign simulation
- Track foreign market supply and demand, industry development, and military capacity.
- Separate deterministic simulation from UI; keep AI decisions in aiDiplomacy, aiEconomy, and aiWar.
Resources
references/
- references/diplomacy-files.md: map of relevant files and where to make changes.
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-01-26
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!