Replace old manual/split-based _parse_frontmatter with the
line-delimited YAML parser from s07. This fixes skill loading
for YAML block scalars, multiline descriptions, and CRLF line
endings in both s08 and s20. Also update name/desc fallback
from meta.get(k, default) to meta.get(k) or default so empty
string values correctly fall through.
s08 previously used a manual split(':', 1) parser that could not
handle YAML syntax at all. s20 used yaml.safe_load but with the
old text.split('---', 2) approach that misses boundary cases.
reactive_compact summarized the full message history before slicing off
the recent tail, so the kept tail was summarized and then re-attached
verbatim, and the emergency prompt-too-long path re-summarized the whole
oversized context. Move the summarize_history call below the tail
computation (including the tool_use/tool_result pair adjustment) and
summarize only messages[:tail_start], so the summary covers older history
while the recent tail stays verbatim.
Applied to the duplicated function in s08, s09, and s20, with the s08
README snippets (en/zh/ja) updated to match. Adds tests covering the
normal path and the case where a tool pair straddles the tail boundary.
Fixes#350