I have written a little bit of declarative congruence magic:
https://github.com/gallais/potpourri/blob/b0b734fb8e768f280bc36519048b977b994d1a5e/agda/cong/Syntax/Focus.agda
Unlike the content of Tactic.Cong, it is not trying to guess what the
context should be but instead reads it off the goal type where users can mark the
focus of their action by using the ⟪_⟫ focus.