The rich editor composer is entirely customizable via registered extensions, which follows the RichEditorExtension type. Every custom ProseMirror node/mark/plugin/etc we have currently on core goes through a registerRichEditorExtension call.
If a slash command feature was to be created for the rich editor only, that would be the way to go, though in my opinion we already have our autocomplete implementation which is very similar to what we want for a slash command, and the fact it would also be possible to support the Markdown mode easily is very interesting.
The autocomplete, being a feature aimed to work on both editors, not only the rich editor, lives above the rich-editor-specific customizations. The autocomplete for emojis, mentions and hashtags work the same way on both editor modes.
They’re applied on setupEditor and are destroyed when that editor instance is destroyed as well (e.g. when toggling between modes):
Yes, it’s possible to build this via a theme component or plugin (although going through the setupEditor/destructor can be hacky currently), but this is an area that ideally we would allow for further customization – new theme components or plugins should be able to add more options to the slash command, with their specific filtering rules –, so a core-provided plugin API is ideal.