diff --git a/.story_kit/work/5_done/328_refactor_split_commands_rs_into_individual_command_handler_modules.md b/.story_kit/work/5_done/328_refactor_split_commands_rs_into_individual_command_handler_modules.md new file mode 100644 index 0000000..d9947a4 --- /dev/null +++ b/.story_kit/work/5_done/328_refactor_split_commands_rs_into_individual_command_handler_modules.md @@ -0,0 +1,34 @@ +--- +name: "Split commands.rs into individual command handler modules" +--- + +# Refactor 328: Split commands.rs into individual command handler modules + +## Current State + +- TBD + +## Desired State + +commands.rs is 1,947 lines with 9 command handlers (help, status, ambient, git, htop, cost, show, overview, delete) plus all their tests in one file. Split into: +- commands/mod.rs — command registry, dispatch, strip_bot_mention, BotCommand/CommandContext/CommandDispatch structs +- commands/status.rs — handle_status, build_pipeline_status, read_stage_items, story_short_label +- commands/cost.rs — handle_cost, extract_agent_type +- commands/git.rs — handle_git +- commands/ambient.rs — handle_ambient +- commands/show.rs — handle_show +- commands/overview.rs — handle_overview, find_story_merge_commit, get_commit_stat, extract_diff_symbols, parse_symbol_definition +- commands/help.rs — handle_help +- Tests split into corresponding test modules + +## Acceptance Criteria + +- [ ] commands.rs split into focused handler modules under matrix/commands/ +- [ ] Registry and dispatch remain in mod.rs +- [ ] Each handler module contains the handler function and its tests +- [ ] All existing tests pass without modification to test logic +- [ ] No public API changes — try_handle_command still works the same way + +## Out of Scope + +- TBD