\RequirePackage is supposed to work before \documentclass and, indeed, the following MCE works like a charm:
\RequirePackage{url}
\documentclass{article}
\begin{document}
\url{foo}
\end{document}
But, in the case of the tocloft package, this doesn't work. Indeed, the following MCE fails to compile with the following error message:
! LaTeX Error: Command \cftdot undefined.
\RequirePackage{tocloft}
\documentclass{article}
\renewcommand{\cftdot}{\ensuremath{\ast}}
\begin{document}
Foo.
\end{document}
What's going on?
tocloftdoesn't check for this later, e.g.\AtBeginDocument: it would have been helpful for classes which load packages that needtocloftto be loaded before them, such asetoc. – Denis Bitouzé Oct 07 '19 at 14:44