The basic approach would be:
/roll {1d20+@{STR}}>8
But you'd need to hard code for every different use case. You can make queries:
/roll {1d20+@{STR}}>?{Difficulty|8}
This will prompt the player to enter a difficulty level, with the defeault set at 8.
If you want to tailor it for different attributes, you can make a query that works for those
/roll {1d20+?{Choose Attribute|
STR,@{STR}|
DEX,@{DEX}|
CON,@{CON}|
INT,@{INT}}}>?{Difficulty|8}
In the above query, the bit on the left side of the comma is the label that appears to the player, while the bit on the right is the attribute value used by the macro.
The above works if every character creates this macro in their character sheet's Abilities section. If you want to make macros that you only have to create once and are usable by everyone, you can add selected| to the attribute terms, like so
/roll {1d20+?{Choose Attribute|
STR,@{selected|STR}|
DEX,@{selected|DEX}|
CON,@{selected|CON}|
INT,@{selected|INT}}}>?{Difficulty|8}
This requires players each have a token that represents their character. With their token selected, they can run this macro, and it will take the values needed from their character sheets.
Create this macro, or one like it, in your Macros sidebar, and make sure Visibility is set to All. It makes sense to tick the Token Action button too. Then whenever a player selects their token, a button will appear at the top left of their screen to launch this macro.