Files
agency-agents/design
hotragn 3d80c07945 fix(markdown): seven agents' templates break out of their code blocks
Markdown has no nesting at equal fence length. Inside a ```markdown
template, a ```bash line is text, and the example's bare ``` closes the
template. Seven agents nest example blocks inside a template that way, so on
GitHub the rest of each template renders as headings and prose, and in three
of them the last block then runs open to the end of the file:

  design-ux-architect          code from line 414 to EOF
  ats-validator-architect      code from line 307 to EOF
  master-plan-architect        code from line 102 to EOF
  technical-writer, incident-response-commander, developer-advocate,
  workflow-architect           templates end early, rest renders as markdown

The fix for each is the one CommonMark intends: fence the outer template
with four backticks so the three-backtick examples stay inside it. Nine outer
blocks change; no content does.

Nothing caught this because lib.sh's fence_closes_p accepted "```python" as
a closing fence. CommonMark allows only whitespace after a closing run, and
GitHub renders by that rule. With the old rule the linter and the OpenClaw
split read those seven files one way and GitHub another, so each agreed with
itself and all three disagreed with what users see. fence_closes_p now
requires a bare run, and the OpenClaw split invariant in
test-convert-outputs.sh uses the same rule.

lint-agents.sh gets two errors, each with the file line number:

  - a fence line inside an open block that is long enough to close it but
    carries an info string -- the only way that happens is an attempted
    nest, and the message says how to fix it
  - a block that is still open at the end of the file

The body loop now reads the file from the line after the frontmatter
instead of from $body, which drops every "---" line and so cannot give a
line number. It also keeps a last line with no trailing newline; two agents
end on a closing fence with none, and without that they read as unclosed.

The whole roster lints with 0 errors after the fix; on main the same check
reports 18 errors across the seven files.
scripts/test-lint-fences.sh covers both errors, the suggested fix, tilde
fences, and fence_closes_p directly, and runs in check-tools.yml.
2026-09-30 04:37:58 -04:00
..