
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Given the function $f\left(x\right)=x^{3}-x^{2}+ax$ has a local minimum at $1$.  
$(1)$ Find $a$;  
$(2)$ If a line passing through the point $\left(-1,-1\right)$ is tangent to the curve $y=f\left(x\right)$, find the equation of the tangent line.

Present the answer in LaTex format: \boxed{Your answer}
user