This AddOn allows you to use /click PetSpecialAttackButton in macros to use your current pet's special ability. It will probably work with Stampede.
It can also update a macro's icon to show your current pet's special ability, just set your macro's name at the top of core.lua. The icon doesn't always update properly when you summon a pet for the first time, so you can use /psab_update or /psabu to manually trigger an icon update.
It currently only works in English clients, but I can easily add localisations for any language that Wowhead is available in. If you want support for a language that Wowhead isn't available in, please translate the PET_ABILITIES table in the abilities_enUS.lua file and post it in the comments on Curse or WoW Interface. The best way to do this is to submit your translation to a paste service like CurseForge Pastes, GitHub Gists or PasteBin and then post a link to your paste in the comments.
You can view the source code of this AddOn on GitHub.
Thanks to Tybudd for posting this thread on the official UI and Macro forum, which inspired me to write this AddOn.
Add missing comma to abilities_enUS.lua
Change generate script to add a trailing comma to the abilities table
Add option to update a macro's icon with the current pet's special ability
Add slash command (/psab_update, /psabu) to manually trigger an icon update
Change EXCEPTIONS table to OVERRIDES in generate script
Change output for each family to show whether the selected ability is an override
Add overrides for Cat, Shale Spider and Silithid as per Tybudd's recommendations
Re-generate abilities_enUS.lua with these overrides
Add manual ability exceptions to generate script
Default exception list is Surface Trot for Water Strider
Re-generate abilities_enUS.lua with this exception list and sort entries into alphabetical order