The modularity playbook reference the tools/modularity_check tool which is currently on a local branch. This tool currently sees tree-sitter to parse the source code, but the implementation comes with tradeoffs and is not intended to be the final result.
This ticket will merge the existing tool to make it available to developers, and a following FIXME ticket will be created to have the tool use the regex formatting produced by WT-13601.