From Robert Shaw's "Reformed Faith"- a commentary on the Westminster Confession of Faith -
Chapter XIX. Of the Law of God Section I.— God gave to Adam a law, as a covenant of works, by which he bound him and all his posterity to personal, entire, exact, and perpetual obedience; promised life upon the fulfilling, and threatened death upon the breach of it; and endued him with power and ability to keep it.
God having formed man an intelligent creature, and a subject of moral government, he gave him a law for the rule of his conduct. This law was founded in the infinitely righteous nature of God, and the moral relations necessarily subsisting between him and man. It was originally written on the heart of man, as he was endowed with such a perfect knowledge of his Maker’s will as was sufficient to inform him concerning the whole extent of his duty, in the whole extent of his duty, in the circumstances in which he was placed, and was also furnished with power and ability to yield all that obedience which was required of him. This is included in the moral image of God, after which man was created.—Gen. i. 27.
The law, as thus inscribed on the heart of the first man, is often styled the law of creation, because it was the will of the sovereign Creator, revealed to the reasonable creature, by impressing it upon his mind and heart at his creation. It is also called the moral law, because it was a revelation of the will of God, as his moral governor, and was the standard and rule of man’s moral actions. Adam was originally placed under this law in its natural form, as merely directing and obliging him to perfect obedience. He was brought under it in a covenant form, when an express threatening of death, and a gracious promise of life, was annexed to it; and then a positive precept was added, enjoining him not to eat of the fruit of the tree of knowledge, as the test of his obedience to the whole law.—Gen. ii. 16, 17.
That this covenant was made with the first man, not as a single person, but as the federal representative of all his natural posterity, has been formerly shown. The law, as invested with a covenant form, is called, by the Apostle Paul, "The law of works" (Rom. iii. 27); that is, the law as a covenant of works. In this form, the law is to be viewed as not only prescribing duty, but as promising life as the reward of obedience, and denouncing death as the punishment of transgression. This law "which was ordained to life," is now become "weak through the flesh," or through the corruption of our fallen nature. It prescribes terms which we are incapable of performing; and instead of being encouraged to seek life by our own obedience to the law as a covenant, we are required to renounce all hopes of salvation in that way, and to seek it by faith in Christ. But all men are naturally under the law as a broken covenant, obnoxious to its penalty, and bound to yield obedience to its commands. The covenant being made with Adam, not only for himself, but also for all his posterity, when he violated it, he left them all under it as a broken covenant. Most miserable, therefore is the condition of all men by nature; for "as many as are of the works of the law are under the curse."—Gal. iii. 10. Truly infatuated are they who seek for righteousness by the works of the law; for "by the deeds of the law shall no flesh be justified in the sight of God."—Rom. iii. 20.
Section II.— This law, after his fall, continued to be a perfect rule of righteousness; and, as such, was delivered by God upon mount Sinai in ten commandments, and written in two tables; the first four commandments containing our duty toward God, and the other six our duty to man.
Upon the fall of man, the law, considered as a covenant of works, was annulled and set aside; but, considered as moral, it continued to be a perfect rule of righteousness. That fair copy of the law which had been inscribed on the heart of the first man in his creation, was, by the fall, greatly defaced, although not totally obliterated. Some faint impressions of it still remain on the minds of all reasonable creatures. Its general principles, such as, that God is to be worshipped, that parents ought to be honoured, that we should do to others what we would reasonably wish that they should do to us—such general principles as these are still, in some degree, engraved on the minds of all men. - Rom. ii. 14,15. But the original edition of the law being greatly obliterated, God was graciously pleased to give a new and complete copy of it. He delivered it to the Israelites from Mount Sinai, with awful solemnity...
It may be remarked, that the law of the ten commandments was promulgated to Israel from Sinai in the form of a covenant of works. Not that it was the design of God to renew a covenant of works with Israel, or to put them upon seeking life by their own obedience to the law; but the law was published to them as a covenant of works, to show them that without a perfect righteousness, answering to all the demands of the law, they could not be justified before God; and that, finding themselves wholly destitute of that righteousness, they might be excited to take hold of the covenant of grace, in which a perfect righteousness for their justification is graciously provided.
The Sinai transaction was a mixed dispensation. In it the covenant of grace was published, as appears from these words in the preface standing before the commandments: "I am the Lord thy God, which have brought thee out of the land of Egypt, out of the house of bondage;" and from the promulgation of the ceremonial law at the same time. But the moral law, as a covenant of works, was also displayed, to convince the Israelites of their sinfulness and misery, to teach them the necessity of an atonement, and lead them to embrace by faith the blessed Mediator, the Seed promised to Abraham, in whom all the families of the earth were to be blessed. The law, therefore, was published at Sinai as a covenant of works, in subservience to the covenant of grace. And the law is still published in subservience to the gospel, as "a schoolmaster to bring sinners to Christ, that they may be justified by faith."—Gal. iii. 24.