# Provided a command in writing a class which can be used by the user

Suppose that I try to write a test_cls class, in which I want to provided a command \inst, that can be used by the user and also in the class doc itself.

The class file named test_cls.cls looks like:

\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{test_cls}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{test_cls}}
\ProcessOptions\relax
\DeclareRobustCommand{\inst}[1]{\def\inst@value{#1}}
\DeclareRobustCommand{\theauthor}{\inst@value\\\@author}



And the test_cls.tex is

\documentclass{test_cls}
%\inst{test}
\author{tester}
\begin{document}
\theauthor
\end{document}


The problem is this can't work and hint me that the command \inst@value is not defined.

I can solve this problem by add the default value by

\AtEndOfPackage{
%for the default value
\inst{default}
}


But don't know is there any other better way?