
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(x) = (x-a-1)e^{x}-\frac{1}{2}x^{2}+ax$, where $a\in \mathbb{R}$.  
$(1)$ When $a \gt 0$, find the intervals where the function $f(x)$ is monotonic.  
$(2)$ If $f(x)$ has a local minimum at $x_{1}$ and a local maximum at $x_{2}$, and for any $a \gt 0$, $f(x_{1})-f(x_{2}) \lt ka^{3}$, find the range of real number $k$.

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