Season 7 Episode 12 The Pegasus
Challenging the Treaty of Algeron and Starfleet using Cloaking Devices.
But here in "All Good Things" season finale the treaty must have expired when Riker comes out of cloak in the enterprise F
Keep in mind that the Treaty of Algeron - which created the Neutral Zone - stated that the Federation would not develop cloaking technology against the Romulans. I don’t know if it said anything against the Klingons..
Also, in All Good Things, the Enterprise F was based on an alternate timeline that was created by Q because of him putting humanity on trial. The original timeline was also still there as well.
BL.