Skip to content

refactor: standardize output delimiters with <display> tag#1452

Closed
alexeyv wants to merge 5 commits intobmad-code-org:mainfrom
alexeyv:fix/output-block-delimiters
Closed

refactor: standardize output delimiters with <display> tag#1452
alexeyv wants to merge 5 commits intobmad-code-org:mainfrom
alexeyv:fix/output-block-delimiters

Conversation

@alexeyv
Copy link
Copy Markdown
Collaborator

@alexeyv alexeyv commented Jan 29, 2026

Summary

Replaces all inconsistent output delimiter conventions (Display: "...", bare quote blocks, <output-block>) with a single <display> XML tag — registered as an official supported tag in workflow.xml. Also fixes a misapplied delimiter in PRD step-07 that was wrapping subprocess instructions instead of user-facing output.

What Changed

New <display> tag in workflow.xml

Added <display> to the <supported-tags> output group with clear semantics: "Present enclosed content to user verbatim (no file save, no pause)." This distinguishes it from <template-output> which saves to file and pauses for user input.

Delimiter migration (73 files)

Converted all output delimiters to <display> tags across:

  • Core workflows: brainstorming (8 step files), party-mode (3 step files + workflow.md)
  • BMM Analysis: product-brief (2 step files), research domain/market/technical (18 step files)
  • BMM PRD: create-prd workflow.md + steps-c (12 files), steps-v (13 files), steps-e (5 files)
  • BMM Solutioning: check-implementation-readiness, create-epics-and-stories (3 step files)
  • BMM Quick Flow: quick-spec (3 step files), quick-dev (1 step file)

Conversion rules applied

Converted:

  • Multi-line quote blocks → <display> wrapped
  • Single-line Display: "..."<display> wrapped (quotes stripped)
  • Display: with backtick-wrapped text → <display> wrapped (backticks stripped)
  • <output-block> → renamed to <display>

Preserved (not converted):

  • Quotes in bullet items, code fences, YAML frontmatter, inline prose, template examples

PRD step-07 fix

  • Removed <display> tag from subprocess lookup instructions (lines 58-69) — these are instructions to a subprocess, not user-facing output
  • Converted the one remaining Display: "..." line that was missed in the original pass

Test plan

  • All schema tests pass (52/52)
  • All installation component tests pass (12/12)
  • Agent schema validation passes (10/10)
  • ESLint clean (zero warnings)
  • Markdown lint clean (258 files, 0 errors)
  • Prettier format check passes
  • Audited all display blocks — confirmed none contain template-output content
  • Manual validation: run representative workflows to confirm output rendering

Relates to #1433

@alexeyv
Copy link
Copy Markdown
Collaborator Author

alexeyv commented Jan 29, 2026

This came out of the discussion in #1434@arcaven flagged what looked like an orphaned closing quote in step-04-review.md. Turned out both quotes were intentional output block delimiters, but the conversation raised a valid question: are those quotes actually doing anything useful?

We ran a structured A/B test across 5 models and 5 delimiter styles to find out. Full methodology and results are in the PR description above. The short version: quotes work for LLMs but are invisible as block boundaries to humans, confuse linters, and — most importantly — we found 15 existing blocks across 13 files that already have double quotes inside quote-delimited blocks (JSON objects, template fallbacks like "None found", conversational text). That's a structural ambiguity waiting to bite.

Thanks to @arcaven for surfacing this — what started as a one-character fix turned into a real improvement.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Replaced raw user-facing prompts and headings with <output-block> wrapped tags in the step-04-review flow, consolidating how static display strings are emitted to standardize output formatting across multiple sections.

Changes

Cohort / File(s) Summary
Output Block Formatting
src/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-04-review.md
Wrapped multiple user-facing prompts, headers, and menu presentations (tech-spec review header, Quick Summary section, Select menu, final file location notice, and completion message) with <output-block> tags for consistent output formatting.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • bmadcode
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions '' tag standardization, but the actual changes in step-04-review.md use '' tags, not '' tags. This is a mismatch between the title and the implementation. Update the title to accurately reflect the actual changes, e.g., 'refactor: standardize output delimiters with output-block tags in step-04-review' to match the implementation.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The description clearly explains the changes, including the motivation for using XML-style tags, the conversion rules applied, testing results, and that this is a proof-of-concept for broader convention changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-04-review.md`:
- Around line 34-46: The markdown inside custom <output-block> tags is being
treated as raw HTML and the Markdown markers (**, -, backticks) will render
literally after sanitization; update occurrences of the <output-block> element
(lines referenced in the diff) to either replace the tag with HTML
equivalents—use <strong> for bold, <ul><li>…</li></ul> for lists and
<pre><code>…</code></pre> for code blocks—or remove the <output-block> wrapper
and use native Markdown or a supported <details><summary> block so the bold,
lists, and code fences render correctly (apply changes for the <output-block>
instances shown in the diff).
🧹 Nitpick comments (1)
src/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-04-review.md (1)

34-52: Delimiter style is now mixed within the same step.

This section uses <output-block>, while the later “Tech-Spec Complete!” menu still uses a fenced block. If the intent is to standardize delimiters, consider aligning the Section 4 completion block to the same convention or documenting why it’s intentionally different.

@alexeyv alexeyv marked this pull request as draft January 29, 2026 13:55
@alexeyv
Copy link
Copy Markdown
Collaborator Author

alexeyv commented Jan 29, 2026

We agreed that it should be output-block XML style tags and it should be applied consistently across the board. So marking this PR "draft" untilI have that change worked out.

@alexeyv alexeyv force-pushed the fix/output-block-delimiters branch from cf12697 to e474696 Compare February 1, 2026 17:40
@alexeyv alexeyv changed the title fix: replace quote delimiters with output-block tags in step-04-review refactor: migrate quote-delimited output blocks to output-block tags Feb 1, 2026
@alexeyv alexeyv force-pushed the fix/output-block-delimiters branch 2 times, most recently from c5e6e95 to 2205001 Compare February 1, 2026 18:59
@alexeyv alexeyv changed the title refactor: migrate quote-delimited output blocks to output-block tags refactor: standardize output delimiters with <display> tag Feb 1, 2026
@alexeyv alexeyv marked this pull request as ready for review February 1, 2026 20:48
- Register <display> as supported tag in workflow.xml
- Replace <output-block>, Display: "...", and bare quote blocks
- Fix PRD step-07: remove misapplied tag from subprocess instructions
@alexeyv alexeyv force-pushed the fix/output-block-delimiters branch from c87aa90 to 7746b8f Compare February 1, 2026 20:49
Copy link
Copy Markdown
Collaborator Author

@alexeyv alexeyv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐦‍⬛ The Raven's Review

The conversions that ARE here are clean and correct. Tags open and close properly, no content was accidentally modified, the workflow.xml registration is semantically sound, and the PRD step-07 fix is spot-on. CodeRabbit's concern about GFM sanitization was rightly dismissed — these are AI-agent processing markers, not rendered HTML.

That said, the raven found a few things worth picking at:


🔴 Finding 1: Orphaned closing quote in step-09-functional.md:179

**What would you like to do?**"

The Display: "..." wrapper was removed, but the trailing " on this line survived. This is the only actual bug in the converted files — a leftover artifact. It's cosmetic to the AI agent (which will likely ignore it), but it's sloppy.

File: src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-09-functional.md:179


🟡 Finding 2: Three Display: " left unconverted in step-e-04-complete.md

This file was partially converted by the PR, but three instances in the menu handling logic were missed:

  • Line 135: Display: "**Additional Edits**"
  • Line 145: Display: "**Edit Workflow Complete**"
  • Line 150: Display: "**Edit Workflow Complete**"

File: src/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-04-complete.md


🟡 Finding 3: Scope vs. claim mismatch

The PR description says "Delimiter migration (73 files)" and "Converted all output delimiters to <display> tags," but there are significant unconverted instances remaining:

  • document-project/ — 15+ Display: " instances across instructions.md and full-scan-instructions.md
  • create-ux-design/ — 50+ bare quote output blocks across steps 02-13
  • create-architecture/ — multiple bare quote blocks across steps 01-07
  • create-product-brief/ steps 02-06 — unconverted bare quotes (only steps 01/01b were converted)
  • check-implementation-readiness/ — unconverted bare quotes in steps 02-06 (only step 01 was converted)

This isn't necessarily a blocker — it's reasonable to scope incrementally — but the PR description should say "Converted output delimiters in [subset]" rather than implying completeness. Otherwise someone grepping for remaining old patterns will be surprised.


✅ What looks good

  • All <output-block> instances: fully eliminated (zero remaining in src/)
  • workflow.xml tag registration: correctly placed in the <output> group with clear semantics
  • PRD step-07 fix: correctly identifies and removes misapplied delimiters from subprocess instructions
  • No accidental content modifications in any converted file
  • All <display> tags properly opened and closed, no nesting issues

Verdict: Fix the orphaned quote (Finding 1) and the three missed conversions in step-e-04-complete.md (Finding 2). Consider updating the PR description to accurately scope what was converted, or convert the remaining files. The work itself is clean.

Convert remaining bare quote output blocks and Display: patterns
to <display> tags in 48 files across product-brief, ux-design,
architecture, check-implementation-readiness, quick-spec, research,
brainstorming, party-mode, generate-project-context, and
document-project workflows. Fix orphaned quote artifact in
step-09-functional.md.
@alexeyv alexeyv marked this pull request as draft February 1, 2026 21:36
- Restore emojis/checkmarks stripped during delimiter conversion
- Unwrap subprocess instructions incorrectly wrapped in <display>
- Convert Present: "..." to <display> tags for consistency
- Strip redundant Display: labels preceding <display> blocks
- Wrap bare Display: + content blocks in <display> tags
Remove redundant Display: label before display block, wrap bare
Display/Present keyword content in proper <display> tags, and remove
misplaced code fence pair in architecture step-03-starter.
Split display blocks containing AI meta-instructions like
[Show the complete markdown content from step X] into separate
display blocks with the instruction outside the tags.
@alexeyv alexeyv closed this Feb 2, 2026
@bmadcode
Copy link
Copy Markdown
Collaborator

bmadcode commented Feb 3, 2026

Agree, why was this closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants