Creating a package is the most common way of contributing to Macaulay2. Packages can contain code for working with objects of a certain category, generating examples for testing a conjecture, or an implementation of algorithms introduced in the literature.
The name of the package must be the name of the file, without the .m2 suffix. Thus a package NewMath will be in a file named NewMath.m2. Other sources required by the package may be stored in a subdirectory named NewMath located in the same directory as the package.
The documentation and tests included in a package inform others about how to use your package and ensure that your package continues to work with future versions of Macaulay2. See writing documentation for more information.
To add your package to the list of packages distributed with Macaulay2, authors can submit their package via a pull request to the GitHub repository for Macaulay2.