In the first part of this paper, we outline the construction of an inflationary cosmology in the framework where inflation is described by a universally evolving scalar field φ with potential V (φ). By considering a generic situation that inflaton attains a nearly constant velocity, during inflation, m −1 P |dφ/dN | ≡ α + β exp(βN ) (where N ≡ ln a is the e-folding time), we reconstruct a scalar potential and find the conditions that have to satisfied by the (reconstructed) potential to be consistent with the WMAP inflationary data. The consistency of our model with WMAP result (such as n s = 0.951 +0.015 −0.019 and r < 0.3) would require 0.16 < α < 0.26 and β < 0. The running of spectral index, α ≡ dn s /d ln k, is found to be small for a wide range of α.In the second part of this paper, we introduce a novel approach of constructing dark energy within the context of the standard scalar-tensor theory. The assumption that a scalar field might roll with a nearly constant velocity, during inflation, can also be applied to quintessence or dark energy models. For the minimally coupled quintessence, α Q ≡ dA(Q)/d(κQ) = 0 (where A(Q) is the standard matter-quintessence coupling), the dark energy equation of state in the range −1 ≤ w DE < −0.82 can be obtained for 0 ≤ α < 0.63. For α < 0.1, the model allows for only modest evolution of dark energy density with redshift. We also show, under certain conditions, that the α Q > 0 solution decreases the dark energy equation of state w Q with decreasing redshift as compared to the α Q = 0 solution. This effect can be opposite in the α Q < 0 case. The effect of the matterquintessence coupling can be significant only if |α Q | 0.1, while a small coupling |α Q | < 0.1 will have almost no effect on cosmological parameters, including Ω Q , w Q and H(z). The best fit value of α Q in our model is found to be α Q ≃ 0.06, but it may contain significant numerical errors, viz α Q = 0.06 ± 0.35, which thereby implies the consistency of our model with general relativity (for which α Q = 0) at 1σ level.