From f05c6a42b0bd5e06d985334dc28d5c60f7c7ac37 Mon Sep 17 00:00:00 2001 From: dave Date: Wed, 25 Mar 2026 14:46:06 +0000 Subject: [PATCH] storkit: done 392_refactor_extract_shared_transport_utilities_from_matrix_module_into_chat_submodule --- ..._from_matrix_module_into_chat_submodule.md | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .storkit/work/5_done/392_refactor_extract_shared_transport_utilities_from_matrix_module_into_chat_submodule.md diff --git a/.storkit/work/5_done/392_refactor_extract_shared_transport_utilities_from_matrix_module_into_chat_submodule.md b/.storkit/work/5_done/392_refactor_extract_shared_transport_utilities_from_matrix_module_into_chat_submodule.md new file mode 100644 index 00000000..cd9a5c5c --- /dev/null +++ b/.storkit/work/5_done/392_refactor_extract_shared_transport_utilities_from_matrix_module_into_chat_submodule.md @@ -0,0 +1,27 @@ +--- +name: "Extract shared transport utilities from matrix module into chat submodule" +agent: "coder-opus" +--- + +# Refactor 392: Extract shared transport utilities from matrix module into chat submodule + +## Current State + +- TBD + +## Desired State + +Several functions currently living in the matrix transport module are used by all transports (WhatsApp, Slack, Matrix). These should be pulled up into a shared location under the chat module. Candidates include: strip_prefix_ci, strip_bot_mention, try_handle_command, drain_complete_paragraphs, markdown_to_whatsapp (pattern could generalize), chunk_for_whatsapp, and the command dispatch infrastructure. A chat::util or chat::text submodule would be a natural home for string utilities like strip_prefix_ci. The command dispatch (try_handle_command, CommandDispatch, BotCommand registry) could live in chat::commands. + +## Acceptance Criteria + +- [ ] Shared string utilities (strip_prefix_ci, strip_bot_mention, drain_complete_paragraphs) moved to a chat::util or chat::text submodule +- [ ] Command dispatch infrastructure (try_handle_command, CommandDispatch, BotCommand, command registry) moved to chat::commands +- [ ] Per-transport formatting functions (markdown_to_whatsapp, markdown_to_slack) remain in their respective transport modules +- [ ] All transports import from the new shared location instead of reaching into matrix:: +- [ ] No functional changes — purely structural refactor +- [ ] All existing tests pass and move with their code + +## Out of Scope + +- TBD