context と template のペアで、ドル始まり文字列を変数としてのテンプレート展開。
.context as $context | .template | walk( if (type == "string" and test("^\\$")) then $context[.[1:]] else . end )
関数を使うとわかりやすいかも。
.context as $context | .template | walk( if (is_placeholder) then $context[get_key] else . end )
is_placeholder と get_key をエクスポートするモジュールを動的に渡せばプラグインぽくなる。