\(\lim\limits_{x\rightarrow1}\dfrac{x^2-\left(a+2\right)x+a+1}{x^3-1}=\lim\limits_{x\rightarrow1}\dfrac{x^2-x-\left(a+1\right)x+a+1}{\left(x-1\right)\left(x^2+x+1\right)}\)
\(=\lim\limits_{x\rightarrow1}\dfrac{x\left(x-1\right)-\left(a+1\right)\left(x-1\right)}{\left(x-1\right)\left(x^2+x+1\right)}=\lim\limits_{x\rightarrow1}\dfrac{\left(x-1\right)\left(x-a-1\right)}{\left(x-1\right)\left(x^2+x+1\right)}\)
\(=\lim\limits_{x\rightarrow1}\dfrac{x-a-1}{x^2+x+1}=\dfrac{1-a-1}{1+1+1}=-\dfrac{a}{3}\)