Only, may the LORD grant you discretion and understanding, that when he gives you charge over Israel you may keep the law of the LORD your God.
Though Solomon was young and tender, he was capable of receiving instructions, which his father accordingly gave him, concerning the work for which he was designed. When David came to the throne he had many things to do, for the foundations were all out of course; but Solomon had only one thing in charge, and that was to build a house for the Lord God of Israel, Ch1 22:6.
Commenting on 1 Chronicles 22:6-16
Only the Lord give thee wisdom and understanding,.... To manage and conduct an affair of such importance, as well as to govern the people, as follows: and give thee charge concerning Israel; or, when he gives, commits the charge of them to thee, sets thee king over them: that thou mayest keep the law of the Lord thy God; have wisdom and understanding to do...
Only the LORD give thee wisdom and understanding, and give thee charge concerning Israel, that thou mayest keep the law of the LORD thy God. (f) These are only the means by which kings govern their subjects correctly, and by which the realms prosper and flourish.