bbsbot 2026-02-21
Decompose every file over 500 LOC into focused subpackages across the entire codebase
212 files · 14,171+ · 18,873-

Scripts decomposed into packages

10 files changed
  • __init__.py Package init
  • execution.py Execution logic (239 lines)
  • navigation.py Navigation logic (218 lines)
  • trading.py Trading logic (276 lines)
  • __init__.py Package init
  • execution.py Execution logic (152 lines)
  • navigation.py Navigation logic (198 lines)
  • __init__.py Package init
  • execution.py Execution logic (73 lines)
  • navigation.py Navigation logic (201 lines)
  • play_to_win.py (864 lines) split into play_to_win/ package: init, main, execution.py (239), main.py (89), models.py (57), navigation.py (218), trading.py (276) decouple internal
    2 files
    • execution.py
    • navigation.py
  • play_tw2002_1000turns.py (520 lines) split into play_tw2002_1000turns/ package: execution.py (152), main.py (73), models.py (47), navigation.py (198), parsing.py (43), reporting.py (130) decouple internal
    1 file
    • execution.py
  • play_tw2002_intelligent.py (605 lines) split into play_tw2002_intelligent/ package: execution.py (73), main.py (48), models.py (37), navigation.py (201), reporting.py (157), testing.py (120) decouple internal
    1 file
    • execution.py

Game actions further decomposed

8 files changed
  • executor_trade.py Trade executor extracted (376 lines)
  • executor_warp.py Warp executor extracted (157 lines)
  • loop_guards.py Loop guards extracted (305 lines)
  • loop_handlers.py Loop handlers extracted (185 lines)
  • guard_core.py Guard core extracted (122 lines)
  • guard_decision.py Guard decision extracted (471 lines)
  • screen.py Trade screen module (212 lines)
  • utils.py Trade utilities (79 lines)
  • game_actions/action_executor.py split: executor_trade.py (376), executor_warp.py (157) extracted decouple internal
    2 files
    • executor_trade.py
    • executor_warp.py
  • game_actions/game_loop.py split: loop_context.py (42), loop_guards.py (305), loop_handlers.py (185) extracted decouple internal
    2 files
    • loop_guards.py
    • loop_handlers.py
  • game_actions/guard_routing.py split: guard_core.py (122), guard_decision.py (471) extracted decouple internal
    2 files
    • guard_core.py
    • guard_decision.py
  • Added game_actions/trade/screen.py (212), trade/utils.py (79) instantiate internal
    2 files
    • screen.py
    • utils.py

Config decomposed into package

6 files changed
  • __init__.py Config package init
  • gameplay.py Gameplay config (181 lines)
  • goals.py Goals config (109 lines)
  • infra.py Infrastructure config (55 lines)
  • loader.py Config loader (67 lines)
  • strategies.py Strategy config (162 lines)
  • games/tw2002/config.py (577 lines) split into config/ package: gameplay.py (181), goals.py (109), infra.py (55), loader.py (67), strategies.py (162) decouple internal
    2 files
    • gameplay.py
    • strategies.py

MCP tools decomposed

5 files changed
  • __init__.py MCP tools package init
  • control_basic.py Basic control tools (478 lines)
  • control_hijack.py Hijack control tools (208 lines)
  • admin_direct.py Admin direct tools (151 lines)
  • admin_remote.py Admin remote tools (93 lines)
  • mcp_tools.py split into mcp_tools/init.py, control_basic.py (478), control_hijack.py (208) extracted from mcp_tools_control.py (826 lines) decouple internal
    2 files
    • control_basic.py
    • control_hijack.py
  • Added games/tw2002/admin_direct.py (151), admin_remote.py (93) instantiate internal
    1 file
    • admin_direct.py

Multi-character decomposed

6 files changed
  • __init__.py Multi-character package init
  • lifecycle.py Lifecycle management (140 lines)
  • locking.py Locking logic (72 lines)
  • manager.py Manager logic (83 lines)
  • records.py Record management (109 lines)
  • selection.py Selection logic (62 lines)
  • multi_character.py (543 lines) split into package: lifecycle.py (140), locking.py (72), manager.py (83), models.py (27), records.py (109), selection.py (62) decouple internal
    2 files
    • lifecycle.py
    • manager.py

Strategies and AI decomposed

7 files changed
  • strategy_core.py AI strategy core (382 lines)
  • strategy_goals.py AI strategy goals (199 lines)
  • strategy_interventions.py AI strategy interventions (131 lines)
  • __init__.py Opportunistic package init
  • exploration.py Exploration logic (135 lines)
  • opportunity_finder.py Opportunity finder (220 lines)
  • strategy_core.py Opportunistic strategy core (323 lines)
  • strategies/ai_strategy.py (818 lines) split: ai/strategy_core.py (382), strategy_goals.py (199), strategy_interventions.py (131) extracted decouple internal
    2 files
    • strategy_core.py
    • strategy_goals.py
  • strategies/opportunistic.py (734 lines) split into package: exploration.py (135), opportunity_finder.py (220), strategy_core.py (323) decouple internal
    2 files
    • exploration.py
    • strategy_core.py

Other module decompositions

12 files changed
  • __init__.py Detection package init
  • fast_check.py Fast check (137 lines)
  • heuristics.py Heuristics (165 lines)
  • recovery.py Recovery (208 lines)
  • pattern_loader.py Pattern loader extracted (174 lines)
  • rule_application.py Rule application extracted (166 lines)
  • bot_process.py Bot process extracted (291 lines)
  • manager.py Timeseries manager (137 lines)
  • row_builder.py Timeseries row builder (491 lines)
  • summary.py Timeseries summary (371 lines)
  • monitor.py Swarm monitor (247 lines)
  • renderer.py Swarm monitor renderer (288 lines)
  • orientation/detection.py (636 lines) split into package: contexts.py (40), fast_check.py (137), heuristics.py (165), patterns.py (15), recovery.py (208) decouple internal
    2 files
    • fast_check.py
    • heuristics.py
  • learning/engine.py split: pattern_loader.py (174), rule_application.py (166) extracted decouple internal
    2 files
    • pattern_loader.py
    • rule_application.py
  • manager/init.py (1304 lines) split: bot_process.py (291), timeseries/manager.py (137), timeseries/row_builder.py (491), timeseries/summary.py (371) extracted decouple internal
    2 files
    • bot_process.py
    • manager.py
  • tui/swarm_monitor.py (548 lines) split into package: monitor.py (247), renderer.py (288), utils.py (68) decouple internal
    2 files
    • monitor.py
    • renderer.py

Test path updates

5 files changed
  • test_mcp_hijack_tools.py Updated to reflect new module paths
  • test_engine.py Updated to reflect new module paths
  • test_game_filtering.py Updated to reflect new module paths
  • test_client.py Updated to reflect new module paths
  • test_manager_timeseries.py Updated to reflect new module paths
  • Updated test imports across 5 test files to reflect new module paths qualify internal
    3 files
    • test_mcp_hijack_tools.py
    • test_engine.py
    • test_manager_timeseries.py