New "macros" (named expansions) can be created as described on https://espanso.org/docs/get-started/ with what looks like a YAML file. Here it should be some extra info about how to declare expansions and use packages but the documentations is just great, go read it!.