Skip to content

Add rhivos-content plugin for automotive documentation pipeline#88

Merged
mcljot merged 3 commits intomainfrom
feature/rhivos-content-plugin
Apr 15, 2026
Merged

Add rhivos-content plugin for automotive documentation pipeline#88
mcljot merged 3 commits intomainfrom
feature/rhivos-content-plugin

Conversation

@mcljot
Copy link
Copy Markdown
Collaborator

@mcljot mcljot commented Apr 15, 2026

New plugin with 5 skills forming a modular pipeline to convert upstream CentOS Automotive SIG Markdown content into downstream Red Hat modular AsciiDoc, restructured using JTBD principles with style governance.

Skills: rhivos-map-upstream, rhivos-fetch-convert, rhivos-jtbd-restructure, rhivos-quality-review, rhivos-workflow (orchestrator with interactive gates).

Includes md2adoc.py post-processor for Material for MkDocs extensions, product attribute and modular docs reference files, and design spec.

Co-authored by Claude Code, under the supervision of Alex McLeod

Summary by CodeRabbit

  • New Features
    • Introduced RHIVOS 2.0 documentation pipeline plugin with automated workflows for content mapping, format conversion, restructuring, quality review, and publishing.
    • Added comprehensive documentation standards and style guidelines for modular AsciiDoc content management and product attributes.

New plugin with 5 skills forming a modular pipeline to convert upstream
CentOS Automotive SIG Markdown content into downstream Red Hat modular
AsciiDoc, restructured using JTBD principles with style governance.

Skills: rhivos-map-upstream, rhivos-fetch-convert, rhivos-jtbd-restructure,
rhivos-quality-review, rhivos-workflow (orchestrator with interactive gates).

Includes md2adoc.py post-processor for Material for MkDocs extensions,
product attribute and modular docs reference files, and design spec.

Co-authored by Claude Code, under the supervision of Alex McLeod
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 15, 2026

Walkthrough

A new "rhivos-content" plugin is added to manage the RHIVOS 2.0 documentation pipeline. The plugin includes five orchestrated skills for mapping upstream CentOS Automotive SIG markdown to downstream Red Hat modular AsciiDoc, converting content, restructuring via JTBD principles, quality review, and workflow orchestration, along with reference documentation for modular doc conventions and product attributes.

Changes

Cohort / File(s) Summary
Plugin Configuration
.claude-plugin/marketplace.json, plugins/rhivos-content/.claude-plugin/plugin.json
Registered new rhivos-content plugin with metadata (category: documentation, tags for rhivos/automotive/asciidoc/jtbd/modular-docs/conversion), version 1.0.0, and author attribution.
Plugin Documentation
plugins/rhivos-content/README.md, plugins/rhivos-content/reference/*
Added plugin overview documenting five skills and their purposes, prerequisites, and usage instructions; plus reference guides for modular AsciiDoc conventions and product attribute substitution rules.
Map Upstream Skill
plugins/rhivos-content/skills/rhivos-map-upstream/SKILL.md
Defined workflow for matching downstream RHIVOS topics to upstream CentOS Automotive SIG markdown sources via title similarity and keyword heuristics, inferring content types (CONCEPT/PROCEDURE/REFERENCE), and generating upstream-mapping.yaml with confidence levels and net-new flags.
Fetch & Convert Skill
plugins/rhivos-content/skills/rhivos-fetch-convert/SKILL.md, plugins/rhivos-content/skills/rhivos-fetch-convert/scripts/md2adoc.py
Specified end-to-end Markdown→AsciiDoc conversion workflow using pandoc and custom post-processing; added md2adoc.py script that transforms MkDocs syntax (admonitions, tabs, snippets, code titles, links, frontmatter) into AsciiDoc equivalents and applies modular doc conventions (anchors, content-type attributes, abstracts, product substitutions, module prefixes).
JTBD Restructure Skill
plugins/rhivos-content/skills/rhivos-jtbd-restructure/SKILL.md
Defined workflow for reframing technology-oriented headings into job-oriented JTBD titles, reordering intra-module sections by JTBD stage, standardizing abstracts to "When… so you can…" pattern, generating stub modules for net-new topics, and producing assembly files with consolidated JTBD outputs.
Quality Review Skill
plugins/rhivos-content/skills/rhivos-quality-review/SKILL.md
Specified three-pass review (style guide compliance, Vale linting, modular docs validation) with RHIVOS-specific checks for product attributes, ASIL B placement, italic formatting, and reusable snippet includes; supports auto-fix based on confidence threshold and interactive issue triage.
Workflow Orchestration Skill
plugins/rhivos-content/skills/rhivos-workflow/SKILL.md
Defined end-to-end five-stage pipeline (MAP → CONVERT → RESTRUCTURE → REVIEW → PUBLISH) with mandatory interactive review gates, resume support via state file, argument parsing (Google Doc URL, title, optional sig-docs-path), and progress tracking across artifact stages.

Sequence Diagram(s)

sequenceDiagram
    participant Writer
    participant rhivos-workflow
    participant rhivos-map-upstream
    participant rhivos-fetch-convert
    participant rhivos-jtbd-restructure
    participant rhivos-quality-review
    participant DocRepo

    Writer->>rhivos-workflow: /rhivos-workflow "<gdoc-url>" --title "Doc Title"
    
    rect rgba(100, 150, 200, 0.5)
    Note over rhivos-workflow: MAP Stage
    rhivos-workflow->>rhivos-map-upstream: Execute
    rhivos-map-upstream->>rhivos-map-upstream: Match downstream topics to upstream sources
    rhivos-map-upstream-->>rhivos-workflow: upstream-mapping.yaml
    rhivos-workflow->>Writer: Review mapping results
    Writer-->>rhivos-workflow: Approve/Adjust
    end
    
    rect rgba(150, 100, 200, 0.5)
    Note over rhivos-workflow: CONVERT Stage
    rhivos-workflow->>rhivos-fetch-convert: Execute with mapping
    rhivos-fetch-convert->>rhivos-fetch-convert: Pandoc + md2adoc transforms
    rhivos-fetch-convert->>rhivos-fetch-convert: Apply modular doc conventions
    rhivos-fetch-convert-->>rhivos-workflow: AsciiDoc modules + report
    rhivos-workflow->>Writer: Review conversion results
    Writer-->>rhivos-workflow: Approve/Inspect/Reconvert
    end
    
    rect rgba(200, 100, 150, 0.5)
    Note over rhivos-workflow: RESTRUCTURE Stage
    rhivos-workflow->>rhivos-jtbd-restructure: Execute with converted modules
    rhivos-jtbd-restructure->>rhivos-jtbd-restructure: Reframe to job-oriented titles
    rhivos-jtbd-restructure->>rhivos-jtbd-restructure: Reorder sections by JTBD stage
    rhivos-jtbd-restructure->>rhivos-jtbd-restructure: Generate assembly file
    rhivos-jtbd-restructure-->>rhivos-workflow: Restructured modules + assembly
    rhivos-workflow->>Writer: Review reframing results
    Writer-->>rhivos-workflow: Approve/Inspect/Reframe
    end
    
    rect rgba(100, 200, 150, 0.5)
    Note over rhivos-workflow: REVIEW Stage
    rhivos-workflow->>rhivos-quality-review: Execute with modules
    rhivos-quality-review->>rhivos-quality-review: Style, Vale, and modular-docs checks
    rhivos-quality-review->>rhivos-quality-review: RHIVOS-specific validations
    rhivos-quality-review-->>rhivos-workflow: Issues + report
    rhivos-workflow->>Writer: Review quality issues (with optional auto-fix)
    Writer-->>rhivos-workflow: Approve/Fix/Inspect
    end
    
    rect rgba(200, 150, 100, 0.5)
    Note over rhivos-workflow: PUBLISH Stage
    rhivos-workflow->>DocRepo: Copy artifacts to doc repo
    rhivos-workflow-->>Writer: Publication complete
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • aireilly
🚥 Pre-merge checks | ✅ 8
✅ Passed checks (8 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add rhivos-content plugin for automotive documentation pipeline' accurately describes the main change: adding a new plugin for RHIVOS documentation processing with automotive focus.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
No Real People Names In Style References ✅ Passed No references to real people by name found in plugin commands, skill documentation, example prompts, or style references.
Git Safety Rules ✅ Passed The rhivos-content plugin adheres to all git safety rules with no hardcoded remote names, git push operations, main/master branch pushes, or force pushes. Git commands are presented as optional manual steps requiring explicit user action.
No Untrusted Mcp Servers ✅ Passed PR introduces rhivos-content plugin with documentation, configuration, and Python utility script using only standard library dependencies. No MCP server installations, npm packages, GitHub repositories, or external tool installations are added.
Skill And Script Conventions ✅ Passed All skill references use bare names without plugin: prefixes, no old slash-command syntax present, and script invocations follow proper conventions.
Plugin Registry Consistency ✅ Passed rhivos-content plugin is registered in marketplace.json with matching name and description from plugin.json; five new skills are domain-specific to RHIVOS automotive documentation pipeline with no significant overlaps with existing plugins.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/rhivos-content-plugin

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 15, 2026

mcljot added 2 commits April 15, 2026 15:04
- Fix regex for ??? collapsible admonitions: \\?{3} -> \?{3}
- Remove unused `marker` variable in convert_admonitions
- Add Edit to allowed-tools in rhivos-fetch-convert skill

Co-authored by Claude Code, under the supervision of Alex McLeod
Co-authored by Claude Code, under the supervision of Alex McLeod
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: 4

🧹 Nitpick comments (3)
plugins/rhivos-content/skills/rhivos-workflow/SKILL.md (1)

35-41: Consider adding language specifiers to code blocks.

Multiple code blocks throughout this skill document lack language specifiers (flagged by MD040). For the pipeline overview diagram, consider using text:

-```
+```text
 Stage 1: MAP         -> rhivos-map-upstream       -> GATE 1: interactive mapping review

Similarly for JSON blocks (line 63), bash blocks (lines 56, 162), and output structure blocks (line 214).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/rhivos-content/skills/rhivos-workflow/SKILL.md` around lines 35 - 41,
Add explicit language specifiers to the fenced code blocks in SKILL.md to
satisfy MD040: change the pipeline overview block (the Stage 1..5 diagram) to
use ```text, the JSON example block (the JSON payload shown near line 63) to use
```json, all shell snippets (the bash examples around lines 56 and 162) to use
```bash, and the output structure block (the expected output example near line
214) to use the appropriate language (e.g., ```json or ```text) so each fence
explicitly declares its language.
plugins/rhivos-content/skills/rhivos-fetch-convert/scripts/md2adoc.py (1)

238-251: Nested function redefined on each line iteration.

The replace_link function is redefined inside the for line in lines loop. While functionally correct, this creates unnecessary overhead. Consider moving it outside the loop.

♻️ Move nested function outside the loop
 def convert_markdown_links(lines: list[str]) -> list[str]:
     ...
     result = []
     link_pattern = re.compile(r"\[([^\]]+)\]\(([^)]+)\)")

+    def replace_link(m):
+        text = m.group(1)
+        target = m.group(2)
+        # Skip external URLs
+        if target.startswith(("http://", "https://", "mailto:")):
+            return m.group(0)
+        # Convert .md to .adoc
+        if target.endswith(".md"):
+            target = target[:-3] + ".adoc"
+        return f"xref:{target}[{text}]"
+
     for line in lines:
-
-        def replace_link(m):
-            text = m.group(1)
-            target = m.group(2)
-            # Skip external URLs
-            if target.startswith(("http://", "https://", "mailto:")):
-                return m.group(0)
-            # Convert .md to .adoc
-            if target.endswith(".md"):
-                target = target[:-3] + ".adoc"
-            return f"xref:{target}[{text}]"
-
         result.append(link_pattern.sub(replace_link, line))
     return result
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/rhivos-content/skills/rhivos-fetch-convert/scripts/md2adoc.py` around
lines 238 - 251, The nested function replace_link is being redefined on every
iteration of the for line in lines loop which is unnecessary; move the
replace_link definition out above the loop (keeping its logic that references
m.group(1)/m.group(2) and uses link_pattern) and then inside the loop simply
call result.append(link_pattern.sub(replace_link, line)); ensure replace_link
still skips external targets (http://, https://, mailto:) and converts .md to
.adoc so behavior of link_pattern.sub remains unchanged.
docs/specs/2026-04-15-rhivos-content-plugin-design.md (1)

36-52: Consider adding language specifiers to fenced code blocks.

Multiple code blocks throughout the spec document lack language specifiers. While these are primarily structural/diagram blocks, adding appropriate languages (e.g., text for file trees, yaml for YAML examples, bash for commands) improves readability and satisfies MD040 linting.

For file structure blocks, use text:

-```
+```text
 redhat-docs-agent-tools/
   plugins/
     rhivos-content/
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/specs/2026-04-15-rhivos-content-plugin-design.md` around lines 36 - 52,
The spec's fenced code blocks (e.g., the file tree snippet showing
"redhat-docs-agent-tools/ ... .claude-plugin/plugin.json" and other examples
like YAML or shell snippets) lack language specifiers causing MD040 lint
failures; update each triple-backtick fence in
docs/specs/2026-04-15-rhivos-content-plugin-design.md to include an appropriate
language token (use "text" for the file tree block, "yaml" for any YAML
examples, "bash" for commands, etc.) so the file-tree block and other code
blocks (references to plugin.json, SKILL.md, scripts/md2adoc.py) are tagged
correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/rhivos-content/README.md`:
- Around line 26-28: The fenced code block containing the example command
`/rhivos-workflow "<google-doc-url>" --title "RHIVOS Image Building"` must
include a language specifier for proper markdown linting; update the opening
fence from ``` to ```bash so the block becomes a bash code block, ensuring MD040
is satisfied and syntax highlighting is enabled.
- Around line 36-41: The fenced code block showing the example invocations for
/rhivos-map-upstream, /rhivos-fetch-convert, /rhivos-jtbd-restructure, and
/rhivos-quality-review needs a language specifier; update the triple-backtick
fence around that block in README.md to use "bash" (i.e., change ``` to ```bash)
so the commands are syntax-highlighted as bash.

In `@plugins/rhivos-content/skills/rhivos-fetch-convert/scripts/md2adoc.py`:
- Around line 214-217: The code in the while loop that gathers a fenced code
block currently uses lines[i].startswith("```") which can falsely match content
lines that begin with triple backticks; update the closure detection in the
block-handling logic (the while loop that appends to result after detecting the
code-block header) to require an exact fence match (e.g., lines[i].strip() ==
"```") or to capture and compare the original fence string/length so the loop
only ends when the exact closing fence is seen; modify the condition that
currently checks lines[i].startswith("```") accordingly to use the stricter
comparison.
- Around line 176-180: convert_figure_captions currently searches backward in
the list `result` for a line starting with "image::" and inserts the caption
before it, but if none is found the caption is silently dropped; modify the
logic in convert_figure_captions to handle this orphaned caption case by either
logging a warning (using the module logger) and appending the caption to the end
of `result` or inserting it immediately after the current processing position so
it is preserved, and ensure you reference `result`, `caption`, and the existing
backward loop/`startswith("image::")` check when making the change.

---

Nitpick comments:
In `@docs/specs/2026-04-15-rhivos-content-plugin-design.md`:
- Around line 36-52: The spec's fenced code blocks (e.g., the file tree snippet
showing "redhat-docs-agent-tools/ ... .claude-plugin/plugin.json" and other
examples like YAML or shell snippets) lack language specifiers causing MD040
lint failures; update each triple-backtick fence in
docs/specs/2026-04-15-rhivos-content-plugin-design.md to include an appropriate
language token (use "text" for the file tree block, "yaml" for any YAML
examples, "bash" for commands, etc.) so the file-tree block and other code
blocks (references to plugin.json, SKILL.md, scripts/md2adoc.py) are tagged
correctly.

In `@plugins/rhivos-content/skills/rhivos-fetch-convert/scripts/md2adoc.py`:
- Around line 238-251: The nested function replace_link is being redefined on
every iteration of the for line in lines loop which is unnecessary; move the
replace_link definition out above the loop (keeping its logic that references
m.group(1)/m.group(2) and uses link_pattern) and then inside the loop simply
call result.append(link_pattern.sub(replace_link, line)); ensure replace_link
still skips external targets (http://, https://, mailto:) and converts .md to
.adoc so behavior of link_pattern.sub remains unchanged.

In `@plugins/rhivos-content/skills/rhivos-workflow/SKILL.md`:
- Around line 35-41: Add explicit language specifiers to the fenced code blocks
in SKILL.md to satisfy MD040: change the pipeline overview block (the Stage 1..5
diagram) to use ```text, the JSON example block (the JSON payload shown near
line 63) to use ```json, all shell snippets (the bash examples around lines 56
and 162) to use ```bash, and the output structure block (the expected output
example near line 214) to use the appropriate language (e.g., ```json or
```text) so each fence explicitly declares its language.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 420dd1ee-d975-4e65-90c3-06ac41164da7

📥 Commits

Reviewing files that changed from the base of the PR and between 8b3292d and 9d8ba50.

📒 Files selected for processing (12)
  • .claude-plugin/marketplace.json
  • docs/specs/2026-04-15-rhivos-content-plugin-design.md
  • plugins/rhivos-content/.claude-plugin/plugin.json
  • plugins/rhivos-content/README.md
  • plugins/rhivos-content/reference/modular-docs-rules.md
  • plugins/rhivos-content/reference/product-attributes.md
  • plugins/rhivos-content/skills/rhivos-fetch-convert/SKILL.md
  • plugins/rhivos-content/skills/rhivos-fetch-convert/scripts/md2adoc.py
  • plugins/rhivos-content/skills/rhivos-jtbd-restructure/SKILL.md
  • plugins/rhivos-content/skills/rhivos-map-upstream/SKILL.md
  • plugins/rhivos-content/skills/rhivos-quality-review/SKILL.md
  • plugins/rhivos-content/skills/rhivos-workflow/SKILL.md

Comment on lines +26 to +28
```
/rhivos-workflow "<google-doc-url>" --title "RHIVOS Image Building"
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add language specifier to fenced code block.

The code block should specify a language for proper syntax highlighting and to satisfy markdown linting (MD040).

📝 Proposed fix
-```
+```bash
 /rhivos-workflow "<google-doc-url>" --title "RHIVOS Image Building"
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.22.0)

[warning] 26-26: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/rhivos-content/README.md` around lines 26 - 28, The fenced code block
containing the example command `/rhivos-workflow "<google-doc-url>" --title
"RHIVOS Image Building"` must include a language specifier for proper markdown
linting; update the opening fence from ``` to ```bash so the block becomes a
bash code block, ensuring MD040 is satisfied and syntax highlighting is enabled.

Comment on lines +36 to +41
```
/rhivos-map-upstream "<google-doc-url>" --title "Doc Title"
/rhivos-fetch-convert artifacts/<doc-title-slug>/upstream-mapping.yaml
/rhivos-jtbd-restructure <doc-title-slug>
/rhivos-quality-review <doc-title-slug>
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add language specifier to fenced code block.

Same as above — add bash language specifier for the individual skill invocation examples.

📝 Proposed fix
-```
+```bash
 /rhivos-map-upstream "<google-doc-url>" --title "Doc Title"
 /rhivos-fetch-convert artifacts/<doc-title-slug>/upstream-mapping.yaml
 /rhivos-jtbd-restructure <doc-title-slug>
 /rhivos-quality-review <doc-title-slug>
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.22.0)

[warning] 36-36: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/rhivos-content/README.md` around lines 36 - 41, The fenced code block
showing the example invocations for /rhivos-map-upstream, /rhivos-fetch-convert,
/rhivos-jtbd-restructure, and /rhivos-quality-review needs a language specifier;
update the triple-backtick fence around that block in README.md to use "bash"
(i.e., change ``` to ```bash) so the commands are syntax-highlighted as bash.

Comment on lines +176 to +180
# Find the preceding image in result and prepend the caption
for j in range(len(result) - 1, -1, -1):
if result[j].startswith("image::"):
result.insert(j, f".{caption}")
break
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Figure caption silently dropped if no preceding image:: found.

When convert_figure_captions encounters a /// figure-caption block but finds no image:: line in the preceding output, the caption is collected but never inserted. Consider logging a warning or preserving the caption text.

🛠️ Proposed fix to warn on orphaned captions
             # Find the preceding image in result and prepend the caption
+            found = False
             for j in range(len(result) - 1, -1, -1):
                 if result[j].startswith("image::"):
                     result.insert(j, f".{caption}")
+                    found = True
                     break
+            if not found:
+                # Preserve caption as a comment for manual review
+                result.append(f"// ORPHANED CAPTION: {caption}")
         else:
             result.append(lines[i])
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Find the preceding image in result and prepend the caption
for j in range(len(result) - 1, -1, -1):
if result[j].startswith("image::"):
result.insert(j, f".{caption}")
break
# Find the preceding image in result and prepend the caption
found = False
for j in range(len(result) - 1, -1, -1):
if result[j].startswith("image::"):
result.insert(j, f".{caption}")
found = True
break
if not found:
# Preserve caption as a comment for manual review
result.append(f"// ORPHANED CAPTION: {caption}")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/rhivos-content/skills/rhivos-fetch-convert/scripts/md2adoc.py` around
lines 176 - 180, convert_figure_captions currently searches backward in the list
`result` for a line starting with "image::" and inserts the caption before it,
but if none is found the caption is silently dropped; modify the logic in
convert_figure_captions to handle this orphaned caption case by either logging a
warning (using the module logger) and appending the caption to the end of
`result` or inserting it immediately after the current processing position so it
is preserved, and ensure you reference `result`, `caption`, and the existing
backward loop/`startswith("image::")` check when making the change.

Comment on lines +214 to +217
while i < len(lines) and not lines[i].startswith("```"):
result.append(lines[i])
i += 1
result.append("----")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Code block closing detection may match mid-content triple backticks.

The condition not lines[i].startswith("```") could prematurely close on a line that happens to start with triple backticks inside a code block (e.g., a nested code block example in documentation). Consider matching the exact closing fence or tracking fence length.

🛠️ Proposed fix for stricter closing fence matching
 def convert_code_block_titles(lines: list[str]) -> list[str]:
     ...
     while i < len(lines):
         match = re.match(r"^```(\w*)\s+title=\"([^\"]+)\"\s*$", lines[i])
         if match:
             lang = match.group(1)
             title = match.group(2)
             result.append(f".{title}")
             if lang:
                 result.append(f"[source,{lang}]")
             result.append("----")
             i += 1
-            while i < len(lines) and not lines[i].startswith("```"):
+            while i < len(lines) and lines[i].strip() != "```":
                 result.append(lines[i])
                 i += 1
             result.append("----")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
while i < len(lines) and not lines[i].startswith("```"):
result.append(lines[i])
i += 1
result.append("----")
while i < len(lines) and lines[i].strip() != "
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/rhivos-content/skills/rhivos-fetch-convert/scripts/md2adoc.py` around
lines 214 - 217, The code in the while loop that gathers a fenced code block
currently uses lines[i].startswith("```") which can falsely match content lines
that begin with triple backticks; update the closure detection in the
block-handling logic (the while loop that appends to result after detecting the
code-block header) to require an exact fence match (e.g., lines[i].strip() ==
"```") or to capture and compare the original fence string/length so the loop
only ends when the exact closing fence is seen; modify the condition that
currently checks lines[i].startswith("```") accordingly to use the stricter
comparison.

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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plugins/rhivos-content/skills/rhivos-fetch-convert/SKILL.md`:
- Around line 143-161: The Markdown fenced code blocks that start with the text
"Converted <N> modules for \"<Doc Title>\":" and the block listing
"artifacts/<doc-title-slug>/" are missing fence language identifiers (causing
MD040); update both triple-backtick fences to use a language tag (e.g., ```text)
so the blocks become ```text ... ``` and satisfy the linter, ensuring you change
the fence at the block beginning and its matching closing fence for both
occurrences referenced in SKILL.md.
- Around line 33-36: The prereq check for pandoc currently only echoes an error
and continues; update the check around the `command -v pandoc` invocation so
that when pandoc is not found it prints the error and exits the script (use an
OR block that calls exit 1) before running `pandoc --version | head -1`,
ensuring the script stops with a clear error instead of continuing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8e3ada48-a21f-4d67-a16f-b2e8a74d4563

📥 Commits

Reviewing files that changed from the base of the PR and between 9d8ba50 and b0f112c.

📒 Files selected for processing (2)
  • plugins/rhivos-content/skills/rhivos-fetch-convert/SKILL.md
  • plugins/rhivos-content/skills/rhivos-fetch-convert/scripts/md2adoc.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • plugins/rhivos-content/skills/rhivos-fetch-convert/scripts/md2adoc.py

Comment on lines +33 to +36
```bash
command -v pandoc >/dev/null 2>&1 || echo "ERROR: pandoc not found. Install with: sudo dnf install pandoc"
pandoc --version | head -1
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Prerequisite check does not stop on missing pandoc (instruction/behavior mismatch).

Line 34 prints an error but continues; this conflicts with the “stop with clear error if missing” requirement and can cause downstream failures.

🔧 Proposed fix
 ```bash
-command -v pandoc >/dev/null 2>&1 || echo "ERROR: pandoc not found. Install with: sudo dnf install pandoc"
+command -v pandoc >/dev/null 2>&1 || { echo "ERROR: pandoc not found. Install with: sudo dnf install pandoc"; exit 1; }
 pandoc --version | head -1
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/rhivos-content/skills/rhivos-fetch-convert/SKILL.md` around lines 33
- 36, The prereq check for pandoc currently only echoes an error and continues;
update the check around the `command -v pandoc` invocation so that when pandoc
is not found it prints the error and exits the script (use an OR block that
calls exit 1) before running `pandoc --version | head -1`, ensuring the script
stops with a clear error instead of continuing.

Comment on lines +143 to +161
```
Converted <N> modules for "<Doc Title>":
- <X> clean conversions
- <Y> with warnings (MkDocs extensions required manual handling)
- <Z> multi-source merges (flagged for reconciliation)

<list warnings and merges>

Full report: artifacts/<slug>/conversion-report.md
Modules: artifacts/<slug>/modules/

Actions:
approve — Accept conversions, continue to next stage
inspect <file> — Display the full converted AsciiDoc file
reconvert <file> — Re-run conversion for a specific file
abort — Stop and save progress

Your choice?
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add fence languages to satisfy Markdown lint (MD040).

The fenced blocks starting at Line 143 and Line 165 are missing language identifiers.

🧹 Proposed fix
-```
+```text
 Converted <N> modules for "<Doc Title>":
   - <X> clean conversions
   - <Y> with warnings (MkDocs extensions required manual handling)
@@
 Your choice?

@@
- +text
artifacts//
modules/
con_.adoc

</details>
As per coding guidelines, markdown quality rules for changed `.md` files should be enforced unless explicitly identified as known false positives (only MD046 is exempted in retrieved learnings).


Also applies to: 165-172

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.22.0)</summary>

[warning] 143-143: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

<details>
<summary>🤖 Prompt for AI Agents</summary>

Verify each finding against the current code and only fix it if needed.

In @plugins/rhivos-content/skills/rhivos-fetch-convert/SKILL.md around lines 143

  • 161, The Markdown fenced code blocks that start with the text "Converted
    modules for "":" and the block listing
    "artifacts//" are missing fence language identifiers (causing
    MD040); update both triple-backtick fences to use a language tag (e.g., text) so the blocks become text ... ``` and satisfy the linter, ensuring you change
    the fence at the block beginning and its matching closing fence for both
    occurrences referenced in SKILL.md.

</details>

<!-- fingerprinting:phantom:triton:hawk:01562915-37ba-4d77-ba19-6685d4ca225a -->

<!-- This is an auto-generated comment by CodeRabbit -->

@mcljot mcljot merged commit 9b2c90c into main Apr 15, 2026
6 of 7 checks passed
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.

1 participant