<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Convergence.Game%2FCODE_STYLE</id>
	<title>Convergence.Game/CODE STYLE - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Convergence.Game%2FCODE_STYLE"/>
	<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Convergence.Game/CODE_STYLE&amp;action=history"/>
	<updated>2026-12-06T07:32:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.3</generator>
	<entry>
		<id>https://mindattic.com/wiki/docs/index.php?title=Convergence.Game/CODE_STYLE&amp;diff=2667&amp;oldid=prev</id>
		<title>Docs Sync: md2wiki: sync from MindAttic.Docs</title>
		<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Convergence.Game/CODE_STYLE&amp;diff=2667&amp;oldid=prev"/>
		<updated>2026-12-02T18:57:34Z</updated>

		<summary type="html">&lt;p&gt;md2wiki: sync from MindAttic.Docs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Code style: file size and layout (GG-T1998) =&lt;br /&gt;
&lt;br /&gt;
These rules keep files small enough that two agents working on different features rarely touch the same file. &amp;lt;code&amp;gt;python tools/polish_lint.py --size&amp;lt;/code&amp;gt; checks them (rule POL-S1) and exits 1 on a new offender; the full &amp;lt;code&amp;gt;python tools/polish_lint.py&amp;lt;/code&amp;gt; table shows POL-S1 next to the other polish rules.&lt;br /&gt;
&lt;br /&gt;
== Limits ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strong&amp;gt;No .cs file over 1200 lines&amp;lt;/strong&amp;gt; (Assets/Convergence and Tests). Split by concern before you cross it, not after.&lt;br /&gt;
* &amp;lt;strong&amp;gt;One screen per file.&amp;lt;/strong&amp;gt; A screen is any concrete &amp;lt;code&amp;gt;GameScreen&amp;lt;/code&amp;gt; subclass (directly or through &amp;lt;code&amp;gt;HubPage&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;HeroScreen&amp;lt;/code&amp;gt;). The file is named after the screen: &amp;lt;code&amp;gt;App/Screens/&amp;amp;lt;Area&amp;gt;/&amp;amp;lt;Name&amp;gt;Screen.cs&amp;lt;/code&amp;gt;. Helpers only that screen uses (a row builder, a nested popup) live in the same file; helpers two screens share get their own file beside them.&lt;br /&gt;
* Files that broke a rule before it existed are listed in &amp;lt;code&amp;gt;tools/size_baseline.json&amp;lt;/code&amp;gt; and pass. When you split one, drop its entry (or rerun &amp;lt;code&amp;gt;python tools/polish_lint.py --write-size-baseline&amp;lt;/code&amp;gt; once the split has landed). Never add an entry to get past the check: split the file instead. A baselined shared file may lose screens but not gain one.&lt;br /&gt;
&lt;br /&gt;
== Screens: &amp;lt;code&amp;gt;App/Screens/&amp;amp;lt;Area&amp;gt;/&amp;lt;/code&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Area&lt;br /&gt;
! Holds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;FrontDoor/&amp;lt;/code&amp;gt;&lt;br /&gt;
| title, save slots, character select, profiles, about and credits&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Hub/&amp;lt;/code&amp;gt;&lt;br /&gt;
| camp hub, camp groups, stage select and confirm, their launchers&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Camp/&amp;lt;/code&amp;gt;&lt;br /&gt;
| stations: shop, blacksmith, alchemist, enchantress, aetherist, caravan, crucible, bounty, bestiary&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Heroes/&amp;lt;/code&amp;gt;&lt;br /&gt;
| hero screen and its tabs (status, equip, abilities, party, skill hex), mercenaries&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Items/&amp;lt;/code&amp;gt;&lt;br /&gt;
| items screen and item UI helpers&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Summon/&amp;lt;/code&amp;gt;&lt;br /&gt;
| summon, summon history, the reveal&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Story/&amp;lt;/code&amp;gt;&lt;br /&gt;
| dialogue, talk, story crawl, story beats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Settings/&amp;lt;/code&amp;gt;&lt;br /&gt;
| settings, save export and import&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Battle screen: partials by concern ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;BattleScreen&amp;lt;/code&amp;gt; is one &amp;lt;code&amp;gt;partial class&amp;lt;/code&amp;gt; spread over &amp;lt;code&amp;gt;App/Battle/BattleScreen.&amp;amp;lt;Concern&amp;gt;.cs&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;BattleScreen.cs&amp;lt;/code&amp;gt; holds the fields and entry points and is the only file that names the base class; each concern gets its own file (&amp;lt;code&amp;gt;BattleScreen.Hud.cs&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;BattleScreen.Lifecycle.cs&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;BattleScreen.Fx.cs&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;BattleScreen.AbilitySheet.cs&amp;lt;/code&amp;gt; ...). Event playback splits one level further by event family: &amp;lt;code&amp;gt;BattleScreen.Playback.&amp;amp;lt;Family&amp;gt;.cs&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;.Move&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.Combat&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.Spells&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.Status&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;.Waves&amp;lt;/code&amp;gt;). Any other class that outgrows a file follows the same pattern (&amp;lt;code&amp;gt;AutomationServer.&amp;amp;lt;Routes&amp;gt;.cs&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
== Meta: domain folders ==&lt;br /&gt;
&lt;br /&gt;
Meta services sit one type (or one tight family) per file, grouped by domain:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Folder&lt;br /&gt;
! Holds&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Meta/&amp;lt;/code&amp;gt; (root)&lt;br /&gt;
| cross-cutting services: progression, battle report, battle factory, caravan, and the existing single-purpose files&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Meta/Economy/&amp;lt;/code&amp;gt;&lt;br /&gt;
| camp, shop, bargains, station progress, crafting, brewing, forging, enchanting, recipes, repair, inn&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Meta/Heroes/&amp;lt;/code&amp;gt;&lt;br /&gt;
| equipment, abilities, training, party, permadeath, summon&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Meta/Save/&amp;lt;/code&amp;gt;&lt;br /&gt;
| save migrations, settings, hero saves, bestiary knowledge, progress saves (bounty, quest, crucible)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Core content follows the same idea: &amp;lt;code&amp;gt;Core/Content/Models/&amp;lt;/code&amp;gt; for content definitions and &amp;lt;code&amp;gt;Core/Content/Validation/&amp;amp;lt;Domain&amp;gt;Validator.cs&amp;lt;/code&amp;gt; for the load-time checks.&lt;br /&gt;
&lt;br /&gt;
== Moving code ==&lt;br /&gt;
&lt;br /&gt;
A split is a move, never a rewrite: same namespace, same names, same order of side effects, no behaviour change. Commit the Unity-generated &amp;lt;code&amp;gt;.meta&amp;lt;/code&amp;gt; file for every new .cs file and folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-crumb&amp;quot;&amp;gt;Part of [[Convergence.Game]].&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-source&amp;quot;&amp;gt;From [https://github.com/mindattic/Convergence.Game/blob/main/docs/CODE_STYLE.md Convergence.Game/docs/CODE_STYLE.md] via MindAttic.Docs; synced automatically, so edit the repo, not this page.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Convergence.Game]]&lt;/div&gt;</summary>
		<author><name>Docs Sync</name></author>
	</entry>
</feed>