Be stable. Where breaking changes are made, use versioning or just a completeley new function.
Be testable and have such tests included here.
Try to be as environment agnostic as possible (i.e. as useful in a web api as it is in a cli application). Sometimes this is not possible and where it is not, usually multiple versions of the same function are available for each environment.