There isn't a specific guide for this feature beyond what is in CONTRIBUTING.md in the SwiftPM repository, but it is a good idea to add some more detailed steps to the implementation PR since it requires PackagePlugin changes. Because the implementation-in-progress is guarded by setting
1 in the environment, I am hoping to get this into the main toolchain fairly quickly so that everyone can try it out in nightly builds.
This will be possible using this proposal, if you are fine with running the build from your plugin. In other words, this proposal is for cases where the custom command is the primary entry point. It can then do a build as a part of its implementation, but that isn't how users invoke the command plugin.
A separate kind of plugin that would be useful (but which is not this proposal) would be a kind of "build event watcher" plugin that would automatically run at some stage of the build, e.g. after an executable that uses SwiftArgumentParser is linked. Such a plugin would be activated as a side effect of doing a normal build. But that is not possible using this proposal.