TL;DR: Strip HTML comment blocks from the PR body before parsing, treat empty placeholder sections as absent, and fall back to summarizing the diff when the body has no real content. PR templates are mostly HTML comments with a few headings; a naive parser chokes on the markup and returns nothing. The diff fallback turns even a blank template into a useful summary.

```text
agent can't parse the PR description template: returned an empty summary
```

1. Strip HTML comment blocks from the PR body before parsing. Templates hide their instructions in comments.
   Expected: the remaining text is the actual content.
2. Split the body into sections on its headings and read each section's content.
   Expected: a map of section names to their text.
3. Treat empty or placeholder sections ("describe your changes here") as absent, not as errors.
   Expected: no crash on unfilled templates.
4. If every section is empty after stripping, fall back to summarizing the diff itself: files changed, size, and apparent purpose.
   Expected: a useful summary even from a blank template.
5. Handle the common template shapes: checkbox lists, headings at different levels, and templates that are entirely comments.
   Expected: the parser handles all three without special-casing each repo.
6. Log which template shape was seen so new shapes get noticed instead of silently producing empty summaries.
   Expected: unseen shapes surface in logs, not as blank output.

## Use this when
- the agent summarizes PRs from their description bodies
- repos use pull request templates with HTML comments
- summaries come back empty despite a filled-in body

## Not for this skill when
- the PR body is genuinely empty (summarize the diff; that is the normal fallback path)
- the problem is summary quality rather than emptiness (tune the summarizer)
- the template parses fine but sections are mislabeled (that is a mapping bug)

## Variant phrasings
### PR template parsing returned nothing
### review agent blank summary on templated PR description
### agent couldnt read the pull request template sections

## Why it happens
PR templates are scaffolding: HTML comments containing instructions, plus headings the author is supposed to fill in. A parser that treats comment markers as content boundaries, or that requires every section to be non-empty, finds nothing to work with and returns an empty summary. Authors also frequently submit the template untouched, in which case there genuinely is no description and only the diff can supply the summary.

## Edge cases
- Templates nested inside other templates (org-level plus repo-level) produce duplicate sections; dedupe by heading.
- Non-English templates need heading matching that is not hardcoded to English words.
- Bodies that are only a linked issue reference ("Fixes #123") should use the issue title as the summary source.
- Extremely long bodies should be truncated by section priority, not cut mid-section.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_WtVbf5a5y85Nf4TvH5VkhQ
