The problem with your over simplistic theology is your mistaken thinkng that "works" leading to salvation are never inspired/guided by the Holy Spirit, but only by ones self-righteous mindset.
The Apostle James was not of a pre-Roman Catholic or pre-Calvinist mindset. .So it would benefit you NOT to misinterpret the inspired words of James ...
14 What does it profit, my brethren, if someone says he has faith but does not have works? Can faith save him? 15 If a brother or sister is naked and destitute of daily food, 16 and one of you says to them, “Depart in peace, be warmed and filled,” but you do not give them the things which are needed for the body, what does it profit? 17 Thus also faith by itself, if it does not have works, is dead.
By their fruits you will know them