How can you guarantee stability of an inverting opamp configuration amplifier?
The short answer is to put a cap accross the feedback resistor.  Make sure this cap has short leads and is physically close to the output and negative input pins.

A cap accross the feedback resistor will also reduce the overall gain at high frequencies.  Figure out what your maximum frequency of interest is, then adjust the cap so that the low pass rolloff is a bit above that.  Most likely that will still allow for a much larger cap than necessary to keep the opamp stable.

For example, let's say you are sampling this power supply voltage signal every 1 ms in the microcontroller.  That means the samples can't represent frequencies in the signal higher than 500 Hz anyway.  Even worse, if such frequencies exist they will become aliases and therefore noise on the desired signal.

Let's say that upon considering system response issues you decide that you don't need to know about frequency content above 100 Hz.  The rolloff knee of a R-C filter is

&nbsp;&nbsp;F = 1 / (2 &pi; R C)

When R is in Ohms, C in Farads, then F is in Hz.  To get a 100 Hz knee with a 15.8 k&Omega; resistor requires 100 nF.  That is way more than required to keep the opamp stable (probably a few 10s of pF is enough for that).

So the answer to the example is so put a 47-100 nF capacitor accross Rf.  This will not only keep the opamp stable, but will reduce unwanted high frequencies on Vout.