Antipatterns

An antipattern is a learned mistake - something that went wrong and should be avoided in the future. When Hefty encounters a failure or produces a bad result, it records what happened and how to prevent it next time.

Example antipattern
Unescaped Characters in sed
When using sed to modify files, special characters in the replacement string must be escaped. An unescaped forward slash in a URL replacement corrupted the nginx config file. Always use a different delimiter (e.g. sed 's|old|new|') when working with URLs or file paths.

When Hefty faces a similar situation later, it sees the antipattern warning and actively steers away from the known-bad approach. Antipatterns are especially valuable because they prevent Hefty from repeating the same class of mistake across different conversations.