True, works is our actions. What are the works of faith?
Let's stick with James for a spell.
a) James 2:19 shows that even devils believe (faith) they tremble (works) because
God's word say they're going to Hell.
b)James 2:21 Abraham believe(faith)
God's word (in thy seed all nation shall be blessed) So his works was to trust God when he was asked to sacrifice his son.
c) James 2:25 Rahab believed
God's word that the land would belong to Israel.
Read here about her works.
Jos 2:9“I know the LORD has given you this land,” she told them. “We are all afraid of you. Everyone in the land is living in terror.
Jos 2:10 For we have heard how the LORD made a dry path for you through the Red Sea
Jos 2:11 No wonder our hearts have melted in fear! No one has the courage to fight after hearing such things. For the LORD your God is the supreme God of the heavens above and the earth below.
Jos 2:12¶“Now swear to me by the LORD that you will be kind to me and my family since I have helped you. Give me some guarantee that
Jos 2:13 when Jericho is conquered, you will let me live, along with my father and mother, my brothers and sisters, and all their families.”
Jos 2:14¶“We offer our own lives as a guarantee for your safety,” the men agreed. “If you don’t betray us, we will keep our promise and be kind to you when the LORD gives us the land.”
Jos 2:15¶Then, since Rahab’s house was built into the town wall, she let them down by a rope through the window.
My point is this: James is saying that; works is based on actions taken, while believing (faith) that God will fulfill His word.
James is not talking about the works of keeping the law or ten commandments. So your link to keeping the commandments is likely a false connection. ..... because neither devils, Abraham or Rahab were under the Old Covenant to keep the law.
Context says different. Let's take a look at the preceding verses.
Let us not be tempted, drawn away by our own Lust, bringing forth sin unto death. For every good gift and perfect gift cometh down from the Father of lights, us. We are Begotten by the word of truth, receive with meekness the engrafted word, the PERFECT gift.
Being Begotten of the word Be doers of the engrafted word not hearers only deceiving ourselves. For we are Begotten so don't forget who we are when Looking into a mirror at the perfect law of Liberty who we now are, the engrafted word and continue therein when we goeth our way.
Be a doer of the work and we will be blessed in the deeds. Being Begotten with the engrafted Word, The Royal Law, the Whole Law, the Law of Liberty in which we will be judged.
Jas 1:14 But every man is tempted, when he is drawn away of his own lust, and enticed.
Jas 1:15 Then when lust hath conceived, it bringeth forth sin: and sin, when it is finished, bringeth forth death.
Jas 1:16 Do not err, my beloved brethren.
Jas 1:17 Every good gift and every perfect gift is from above, and cometh down from the Father of lights, with whom is no variableness, neither shadow of turning.
Jas 1:18 Of his own will begat he us with the word of truth, that we should be a kind of firstfruits of his creatures.
Jas 1:19 Wherefore, my beloved brethren, let every man be swift to hear, slow to speak, slow to wrath:
Jas 1:20 For the wrath of man worketh not the righteousness of God.
Jas 1:21 Wherefore lay apart all filthiness and superfluity of naughtiness, and receive with meekness the engrafted word, which is able to save your souls.
Jas 1:22 But be ye doers of the word, and not hearers only, deceiving your own selves.
Jas 1:23 For if any be a hearer of the word, and not a doer, he is like unto a man beholding his natural face in a glass:
Jas 1:24 For he beholdeth himself, and goeth his way, and straightway forgetteth what manner of man he was.
Jas 1:25 But whoso looketh into the perfect law of liberty, and continueth therein, he being not a forgetful hearer, but a doer of the work, this man shall be blessed in his deed.
Jas 1:26 If any man among you seem to be religious, and bridleth not his tongue, but deceiveth his own heart, this man's religion is vain.
Jas 1:27 Pure religion and undefiled before God and the Father is this, To visit the fatherless and widows in their affliction, and to keep himself unspotted from the world.
Jas 2:1 My brethren, have not the faith of our Lord Jesus Christ, the Lord of glory, with respect of persons.
Jas 2:2 For if there come unto your assembly a man with a gold ring, in goodly apparel, and there come in also a poor man in vile raiment;
Jas 2:3 And ye have respect to him that weareth the gay clothing, and say unto him, Sit thou here in a good place; and say to the poor, Stand thou there, or sit here under my footstool:
Jas 2:4 Are ye not then partial in yourselves, and are become judges of evil thoughts?
Jas 2:5 Hearken, my beloved brethren, Hath not God chosen the poor of this world rich in faith, and heirs of the kingdom which he hath promised to them that love him?
Jas 2:6 But ye have despised the poor. Do not rich men oppress you, and draw you before the judgment seats?
Jas 2:7 Do not they blaspheme that worthy name by the which ye are called?
Jas 2:8 If ye fulfil the royal law according to the scripture, Thou shalt love thy neighbour as thyself, ye do well:
Jas 2:9 But if ye have respect to persons, ye commit sin, and are convinced of the law as transgressors.
Jas 2:10 For whosoever shall keep the whole law, and yet offend in one point, he is guilty of all.
Jas 2:11 For he that said, Do not commit adultery, said also, Do not kill. Now if thou commit no adultery, yet if thou kill, thou art become a transgressor of the law.
Jas 2:12 So speak ye, and so do, as they that shall be judged by the law of liberty.