Creating a PostCSS plugin is a straightforward process—the beauty of PostCSS is that we as developers are free to design and construct any plugin we desire; it does mean that not every plugin will be of the same quality as others!
This aside, the recommended way to construct any PostCSS plugin is to use the boilerplate code, which is available from https://github.com/postcss/postcss-plugin-boilerplate; we can see an example of it in this screenshot:
If we explore the source code for any PostCSS plugin hosted in GitHub, there will be a host of different files present; not all of them will be the same for each different plugin!
Nonetheless, if we delve in deeper, there are some files we would expect to see as part of the architecture of any plugin; they are as follows: