Basic concept of the first rule of thermodynamics There is a cylinder-piston system with some gas in it, and let's say this system is a closed system.
Say that the system is submerged in a large beaker of water whose temperature is $25\ \mathrm{^\circ C}$. A spark is used to trigger a reaction in the system, and after the reaction is completed, the temperature of the water bath increased to $28\ \mathrm{^\circ C}$, and the piston went inside the cylinder.

By instinct, I think that heat is lost by the system since the surrounding(water)'s temperature increased, and work has been done to the system. However, when I consider the thermal equilibrium, the system's temperature must be $28\ \mathrm{^\circ C}$ as well. In this case, is heat added to the system or not? Furthermore, in the equation $\Delta E = q+w$, what are the signs (plus or minus) of the three terms?
Chemical energy of system has been converted to thermal energy of both  the system and the surrounding water. 

Additionally, water did work on system, as the system shrinked down.

$$\Delta E_\mathrm{system}=-C_\mathrm{water} \cdot \Delta T_\mathrm{water}-p \cdot \Delta V_\mathrm{system}$$

For $H=E + p \cdot V$, 
$\Delta H=\Delta  E + p \cdot \Delta V + V \cdot \Delta p$

As p is constant, 

$\Delta H=\Delta  E + p \cdot \Delta V $

$\Delta H_\mathrm{system}=-C_\mathrm{water} \cdot \Delta T_\mathrm{water}$

where $H$ means enthalpy, energy at the constant pressure.

If we considered other thermodynamic quantities like Gibbs energy or entropy, we would need to examine the underwent reaction and system composition. But if the system energy is considered, its change is related just to exchanged thermal energy and work.

$q$ in the equation $\Delta E = q+w$ means heat transfers to the system, so it is negative. $w$ is work done on system and is positive.  $\Delta E$ is very probably negative, as work value would be much less than transferred heat.