Actually we declare what scripture declares, that by works of the law no man will be saved.
Gal 2:16
Knowing that a man is not justified by the works of the law, but by the faith of Jesus Christ, even we have believed in Jesus Christ, that we might be justified by the faith of Christ, and not by the works of the law: for by the works of the law shall no flesh be justified.
As for James 4:17, you err by assuming "good" means obeying the law.
Consider the context of James 4 to see what it means by "good".
Firstly, note that it addresses spiritual adulterers, in adultery with Hagar (symbolic for righteousness by works of the law, Gal 4:24).
James 4:4
Ye adulterers and adulteresses, know ye not that the friendship of the world is enmity with God? whosoever therefore will be a friend of the world is the enemy of God.
This is confirmed by James 4:12
There is one lawgiver, who is able to save and to destroy: who art thou that judgest another?
And note the salvation call to these legalists/unbelievers.
James 4:7,8
Submit yourselves therefore to God. Resist the devil, and he will flee from you. Draw nigh to God, and he will draw nigh to you. Cleanse your hands, ye sinners; and purify your hearts, ye double minded.
James 4 is addressing legalists/unbelievers.
Scripture shows us that to do good is to believe on Jesus. The thief on the cross who called Jesus "Lord" did good. He believed on Jesus.
Note also that unbelief in Jesus is the sin the world is convicted of. Unbelief is doing bad.
John 16:8,9
And when he is come, he will reprove the world of sin, and of righteousness, and of judgment:
Of sin, because they believe not on me
Hence we see from the context of James 4 that doing "good" is referring to believing on Jesus.
Then the problem seems to me that you can not distinguish between law keeping as a means of salvation and law keeping as a fruit of salvation.
One by works the other by faith. You seem to lump them together from my perspective.
You also seem to still limit what believing in Jesus actually means.
I think the Gospel is simple,
Slaves to sin by Faith become free in Christ.
Slaves to sin, do sin.
Free in Christ, do righteousness.
You seem to want both at the same time, That is not freedom that is deceptive slavery, lukewarm religion.
Think about it logically for a second.
The law leads us to Christ how?
Because we are sinners and thus when we see we are breaking the law we see our need of saving.
Thus Saving in Christ not only needs to fix my past sin but also my current life so I stop sinning. Because If I keep sinning then the law keeps condemning me.
We are judged not by our profession but by our works, and the law is the measuring stick to see who is in faith and who is not.
Ecc 12:13 Let us hear the conclusion of the whole matter: Fear God, and keep his commandments: for this is the whole duty of man.
Ecc 12:14 For God shall bring every work into judgment, with every secret thing, whether it be good, or whether it be evil.
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.
So your Faith is it has not works then its dead and does not help you at all.