Psalm 22 is a clear prophecy of the crucifixion of Jesus and is used as such in the NT. That makes David a prophet, and by extension everything he contributed to the Psalms as the work of a prophet.
Prophecy is also misunderstood. It isn’t always about telling the future. It is forth-telling, speaking forth a message from God. To the extent the writers of Scripture were, as Peter says, moved by the Spirit of God to write what they did, they were engaged in prophetic ministry.
Peace,
SR
The definition of a prophet is one that speaks for God ... so the entire scripture is written by a prophet .