Skip to content

Add docs cherry pick command#48

Open
kquinn1204 wants to merge 9 commits intoredhat-documentation:mainfrom
kquinn1204:add-docs-cherry-pick-command
Open

Add docs cherry pick command#48
kquinn1204 wants to merge 9 commits intoredhat-documentation:mainfrom
kquinn1204:add-docs-cherry-pick-command

Conversation

@kquinn1204
Copy link

@kquinn1204 kquinn1204 commented Mar 20, 2026

Adds docs-cherry-pick command and docs-branch-audit skill for intelligent cherry-pick backporting across enterprise branches.

What it does

  • Audits which PR files exist on each target branch before cherry-picking
  • Excludes modules not present on older releases (the GitHub bot can't do this)
  • Detects path differences across releases (e.g., assemblies that moved between 4.16 and 4.17+)
  • --deep mode scores each file as HIGH/MEDIUM/NEEDS-REVIEW based on content divergence
  • Resolves conflicts intelligently during cherry-pick, with user confirmation for ambiguous cases

When to use this vs the GitHub bot

Use the bot for simple backports (no exclusions, no path changes). Use this command when:

  • Files need to be excluded (modules don't exist on the target branch)
  • Assemblies have moved paths between releases
  • Deep audit shows NEEDS-REVIEW files (100+ lines divergence)

Tested against 7 real PRs — 6 were bot-suitable, 1 (PR #106280, 28 PTP files) required this command due to exclusions, path differences, and 440-line content divergence.

Files added

  • plugins/docs-tools/commands/docs-cherry-pick.md — command orchestration
  • plugins/docs-tools/skills/docs-branch-audit/SKILL.md — skill definition
  • plugins/docs-tools/skills/docs-branch-audit/scripts/branch_audit.sh — file existence checker
  • plugins/docs-tools/skills/docs-branch-audit/scripts/deep_audit.sh — content divergence analyzer

Depends on the existing git-pr-reader skill. Requires git, python3, bash.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive docs for a Cherry-Pick Backport command and a Branch Audit skill, detailing usage, options, outputs, and deep-audit behavior.
  • New Features
    • Introduced CLI tooling: a docs cherry-pick command, a branch-audit utility, and a deep-audit tool to assess applicability, detect divergences, and surface potential conflicts across branches.
  • Chores
    • Clarified contributor guidance to run Vale checks manually before submitting and bumped plugin manifest version.

@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds docs and scripts implementing a documentation cherry-pick backport workflow: a new command doc, a branch-audit skill (with deep-audit), two executable Bash scripts for per-branch existence and deep applicability checks, a README Vale reminder for AsciiDocDITA, and a plugin manifest version bump.

Changes

Cohort / File(s) Summary
DITA Tools Documentation
plugins/dita-tools/README.md
Added an Important note requiring contributors to run Vale with the AsciiDocDITA style (vale --config=.vale.ini --glob='*.adoc') before submitting PRs.
Cherry-Pick Backport Workflow (doc)
plugins/docs-tools/commands/docs-cherry-pick.md
New command documentation describing /docs-tools:docs-cherry-pick: inputs/options, PR/commit metadata extraction, branch auditing, optional deep comparison, user confirmation, per-target apply/cherry-pick flow (conflict handling via Agent subworkflow, commit/stats), optional push and PR description generation.
Branch Audit Skill (doc)
plugins/docs-tools/skills/docs-branch-audit/SKILL.md
New skill doc describing audit modes (PR/commit/file list), required --branches, output formats (text/JSON), --deep confidence levels (HIGH/MEDIUM/NEEDS-REVIEW), invocation prerequisites, and expected outputs.
Branch Audit Script
plugins/docs-tools/skills/docs-branch-audit/scripts/branch_audit.sh
New executable Bash script parsing --pr/--commit/--files/--branches/--json/--deep/--dry-run, collecting .adoc candidates, fetching remote branches, producing per-branch include/exclude lists (text or JSON), and invoking deep_audit.sh when requested.
Deep Audit Script
plugins/docs-tools/skills/docs-branch-audit/scripts/deep_audit.sh
New executable Bash script performing per-file branch diffs, classifying confidence by diff size, detecting AsciiDoc version gating and version-attribute usage, comparing heading counts, optional PR-patch applicability checks (git apply --check --3way), writing artifacts, and emitting a summary.
Plugin Manifest
plugins/docs-tools/.claude-plugin/plugin.json
Bumped plugin manifest version from 0.0.11 to 0.0.12.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CLI as docs-cherry-pick
  participant PRReader as git_pr_reader/gh
  participant BranchAudit as docs-branch-audit (branch_audit.sh)
  participant DeepAudit as deep_audit.sh
  participant Git as Git (local/remote)
  participant Agent as ConflictResolver

  User->>CLI: invoke with source + --target(s) + options
  CLI->>PRReader: fetch PR/commit metadata and file list
  PRReader-->>CLI: return changed .adoc paths and diff
  CLI->>BranchAudit: audit file presence across target branches
  BranchAudit-->>CLI: include/exclude lists per branch
  alt deep mode
    CLI->>DeepAudit: run per-branch deep comparisons
    DeepAudit-->>CLI: per-file confidence + issues
  end
  CLI->>User: present included/excluded files and confirmation
  User-->>CLI: approve
  loop per target branch
    CLI->>Git: create backport branch
    CLI->>Git: cherry-pick commit(s) (no-commit)
    alt conflicts detected
      CLI->>Agent: attempt automated per-file resolution
      Agent-->>CLI: resolution or mark for review
      CLI->>User: request manual resolution for REVIEW items
    end
    CLI->>Git: commit staged changes with structured message
    opt push
      CLI->>Git: push branch and prepare PR descriptor
    end
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add docs cherry pick command' directly and clearly summarizes the main change—introduction of a new docs-cherry-pick command, which is the primary objective of the PR.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copy link

@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

🧹 Nitpick comments (9)
plugins/docs-tools/skills/docs-branch-audit/SKILL.md (1)

61-75: Add language specifier to fenced code blocks.

The linter flags these output examples as missing a language specifier. Use text or console to satisfy MD040:

-```
+=== Branch Audit: enterprise-4.17 ===
+```text
+=== Branch Audit: enterprise-4.17 ===

Also applies to: 79-99

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

In `@plugins/docs-tools/skills/docs-branch-audit/SKILL.md` around lines 61 - 75,
The fenced code blocks showing the branch audit output (e.g., the block starting
with "=== Branch Audit: enterprise-4.17 ===" and other similar audit/example
blocks) are missing a language specifier; update each triple-backtick fence to
include a language such as text or console (for example replace ``` with
```text) so the linter MD040 is satisfied for the blocks referenced around the
"Branch Audit" examples.
plugins/docs-tools/skills/docs-branch-audit/scripts/deep_audit.sh (1)

141-157: git apply --check may not work as expected without proper worktree context.

The patch is extracted from a unified diff and git apply --check --3way is run, but this operates on the current worktree state, not the target branch content. For the check to be meaningful, the worktree would need to reflect the target branch version of the file.

Consider either:

  1. Documenting this limitation (the check is best-effort)
  2. Using git apply --check --3way with an explicit index built from the target ref

Given this is a heuristic audit tool, this may be acceptable as-is with a comment noting the limitation.

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

In `@plugins/docs-tools/skills/docs-branch-audit/scripts/deep_audit.sh` around
lines 141 - 157, The current git apply --check --3way invocation (when checking
"$FILE_PATCH") operates against the current worktree, not the target branch
snapshot; update the deep_audit.sh logic around the FILE_PATCH check to either
(A) add a clear comment documenting this limitation as a best-effort heuristic,
or (B) implement a safer check by building an explicit temporary index/tree from
the target ref and running git apply --check --3way against that index (use the
same FILE_PATCH and preserve setting of CONFIDENCE and ISSUES), and ensure the
CONFIDENCE and ISSUES handling (patch-conflict / patch-mismatch / patch: applies
cleanly) remains unchanged.
plugins/docs-tools/commands/docs-cherry-pick.md (4)

614-617: Use fully qualified skill names in references.

Per coding guidelines, skill references should use the plugin:skill format:

 ## Related
 
-- **docs-branch-audit skill**: The underlying file existence and content comparison check used by this command
-- **git-pr-reader skill**: PR/MR file listing and diff extraction used for source analysis
+- **docs-tools:docs-branch-audit**: The underlying file existence and content comparison check used by this command
+- **docs-tools:git-pr-reader**: PR/MR file listing and diff extraction used for source analysis
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/docs-tools/commands/docs-cherry-pick.md` around lines 614 - 617,
Update the two Related entries to use fully qualified skill names in the
plugin:skill format; replace "docs-branch-audit skill" with
"plugin:docs-branch-audit" and "git-pr-reader skill" with "plugin:git-pr-reader"
(preserve the descriptive text/links and formatting). Ensure the markdown list
under "## Related" uses the exact plugin:skill identifiers so they follow the
project's naming guideline.

1-6: Missing recommended documentation sections.

The pipeline lint indicates this command documentation is missing recommended sections: ## Name, ## Synopsis, ## Description, and ## Implementation. Consider adding these sections for consistency with other command docs.

📝 Suggested structure
---
description: Intelligently cherry-pick documentation changes to enterprise branches...
argument-hint: <pr-url|--commit sha> --target <branch> [--dry-run]
allowed-tools: Read, Write, Glob, Grep, Edit, Bash, Skill, AskUserQuestion, Agent
---

## Name

docs-cherry-pick — Backport documentation changes to enterprise branches

## Synopsis

/docs-tools:docs-cherry-pick --target [--dry-run] [--deep] [--no-push]
/docs-tools:docs-cherry-pick --commit --target [--ticket ]


## Description

Intelligently backport documentation changes from a PR or commit...

## Implementation

<!-- existing workflow content -->
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/docs-tools/commands/docs-cherry-pick.md` around lines 1 - 6, Add the
recommended documentation sections to the command doc by inserting top-level
headings "## Name", "## Synopsis", "## Description", and "## Implementation"
after the existing YAML frontmatter in
plugins/docs-tools/commands/docs-cherry-pick.md; populate "## Name" with a short
one-line command description (e.g., docs-cherry-pick — Backport documentation
changes to enterprise branches), "## Synopsis" with example CLI usages (showing
both PR URL and --commit patterns and common flags like --target, --dry-run,
--deep, --no-push, --ticket), "## Description" with a concise paragraph
describing the command behavior (intelligently cherry-picks/backports docs
changes and excludes files not present on target releases), and "##
Implementation" with a note or the existing workflow details that explain how
the command performs the backporting so the file matches the suggested
structure.

105-105: Same grep -oP portability issue.

This line uses grep -oP which is not available on macOS's default grep. Use the same sed-based alternative suggested for branch_audit.sh.

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

In `@plugins/docs-tools/commands/docs-cherry-pick.md` at line 105, The PR_NUMBER
extraction uses GNU grep's -oP which is not portable; update the assignment that
sets PR_NUMBER from SOURCE (the line referencing PR_NUMBER and SOURCE) to use a
POSIX-friendly sed extraction of trailing digits (use sed with extended regex to
capture the final numeric group and return only that capture) instead of grep
-oP so the script works on macOS and Linux.

254-273: Add language specifiers to text output blocks.

Several code blocks (lines 254, 336, 403, 467, 478, 558) lack language specifiers. For text output and prompts, use ```text to satisfy MD040.

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

In `@plugins/docs-tools/commands/docs-cherry-pick.md` around lines 254 - 273, The
markdown contains several fenced code blocks showing plain text output (e.g.,
the "Cherry-pick plan for <source> → <target-branch>:" block and other
prompt/output blocks referenced at lines 254, 336, 403, 467, 478, 558) that lack
language specifiers; update each of those triple-backtick fences to use ```text
so the blocks are marked as plain text (search for the exact text snippets like
"Cherry-pick plan for <source> → <target-branch>:" and the other prompt/output
blocks and replace their opening ``` with ```text). Ensure every
plain-output/code block in docs-cherry-pick.md uses ```text to satisfy MD040.
plugins/dita-tools/README.md (1)

35-36: Consider removing this duplicate note.

This Important note duplicates the warning block on lines 8-10 almost verbatim. Having the same guidance in two places creates maintenance burden—if the instruction changes, both need updating. Consider keeping only the warning block at the top, which is more prominent.

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

In `@plugins/dita-tools/README.md` around lines 35 - 36, Remove the duplicate
"**Important:** Always validate your reworked content with the AsciiDocDITA Vale
style..." note (the repeated warning block in the README) and keep the original,
more prominent warning at the top; ensure only the single warning block with the
Vale command ("vale --config=.vale.ini --glob='*.adoc'") remains so maintenance
and guidance stay centralized.
plugins/docs-tools/skills/docs-branch-audit/scripts/branch_audit.sh (2)

104-105: grep -oP may not be portable to macOS.

The -P flag for Perl-compatible regex is not available on macOS's default BSD grep. Consider using sed or awk for extraction, or document GNU grep as a prerequisite.

♻️ Alternative using sed
-        PR_NUMBER=$(echo "$PR_URL" | grep -oP '/pull/\K[0-9]+')
-        OWNER_REPO=$(echo "$PR_URL" | grep -oP 'github\.com/\K[^/]+/[^/]+')
+        PR_NUMBER=$(echo "$PR_URL" | sed -n 's|.*/pull/\([0-9]*\).*|\1|p')
+        OWNER_REPO=$(echo "$PR_URL" | sed -n 's|.*github\.com/\([^/]*/[^/]*\).*|\1|p')
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/docs-tools/skills/docs-branch-audit/scripts/branch_audit.sh` around
lines 104 - 105, The two extraction commands setting PR_NUMBER and OWNER_REPO
use grep -oP (Perl regex) which isn't available on macOS; replace them with
portable alternatives (e.g., use sed or awk) so PR_NUMBER and OWNER_REPO are
extracted reliably across platforms — update the assignments for the variables
PR_NUMBER and OWNER_REPO in branch_audit.sh to use a POSIX-compatible sed/awk
expression that captures the digits after "/pull/" and the owner/repo after
"github.com/" respectively, preserving existing behavior and error handling.

209-220: JSON output lacks proper escaping.

File paths are embedded directly into JSON strings without escaping. While unlikely for .adoc paths, any path containing quotes, backslashes, or control characters would produce malformed JSON.

If robustness is needed, consider piping through jq for proper encoding:

printf '%s' "${INCLUDE_FILES[$i]}" | jq -Rs '.'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/docs-tools/skills/docs-branch-audit/scripts/branch_audit.sh` around
lines 209 - 220, The JSON emission in branch_audit.sh builds arrays using raw
values from INCLUDE_FILES and EXCLUDE_FILES which can yield invalid JSON if
paths contain quotes/backslashes; update the loops that print these arrays to
JSON-escape each filename (e.g., pipe each "${INCLUDE_FILES[$i]}" and
"${EXCLUDE_FILES[$i]}" through jq -Rs or a small json_escape helper) and use the
jq-escaped output when echoing the quoted entries so all produced JSON strings
are correctly encoded.
🤖 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/docs-tools/skills/docs-branch-audit/scripts/deep_audit.sh`:
- Around line 93-101: The divergence thresholds in deep_audit.sh (the
BRANCH_DIFF_LINES checks that set CONFIDENCE and append to ISSUES) do not match
SKILL.md; change the numeric cutoffs to match the documented ranges (HIGH: <20,
MEDIUM: 20–99, NEEDS-REVIEW: >=100) so the conditional branches that set
CONFIDENCE ("high"/"medium"/"needs-review") and the ISSUES messages reflect
those ranges; update the comparisons around BRANCH_DIFF_LINES and the
corresponding ISSUES text to use 20 and 100 as the boundaries (or alternatively
update SKILL.md if you intend to keep current numbers).

In `@plugins/docs-tools/skills/docs-branch-audit/SKILL.md`:
- Around line 103-107: Documentation thresholds in SKILL.md are inconsistent
with the script deep_audit.sh; update the table so the Level ranges match the
script (HIGH should cover files with up to 50 lines differing, MEDIUM should be
51–200 lines differing, and NEEDS-REVIEW should be >200 lines differing), adjust
the Meaning text accordingly (e.g., "File identical or ≤50 lines differ" for
HIGH, "51–200 lines differ, minor/conditional conflicts" for MEDIUM, ">200 lines
differ, structural changes" for NEEDS-REVIEW), and ensure the Action column
descriptions reflect the script behavior for cherry-pick/apply expectations.

---

Nitpick comments:
In `@plugins/dita-tools/README.md`:
- Around line 35-36: Remove the duplicate "**Important:** Always validate your
reworked content with the AsciiDocDITA Vale style..." note (the repeated warning
block in the README) and keep the original, more prominent warning at the top;
ensure only the single warning block with the Vale command ("vale
--config=.vale.ini --glob='*.adoc'") remains so maintenance and guidance stay
centralized.

In `@plugins/docs-tools/commands/docs-cherry-pick.md`:
- Around line 614-617: Update the two Related entries to use fully qualified
skill names in the plugin:skill format; replace "docs-branch-audit skill" with
"plugin:docs-branch-audit" and "git-pr-reader skill" with "plugin:git-pr-reader"
(preserve the descriptive text/links and formatting). Ensure the markdown list
under "## Related" uses the exact plugin:skill identifiers so they follow the
project's naming guideline.
- Around line 1-6: Add the recommended documentation sections to the command doc
by inserting top-level headings "## Name", "## Synopsis", "## Description", and
"## Implementation" after the existing YAML frontmatter in
plugins/docs-tools/commands/docs-cherry-pick.md; populate "## Name" with a short
one-line command description (e.g., docs-cherry-pick — Backport documentation
changes to enterprise branches), "## Synopsis" with example CLI usages (showing
both PR URL and --commit patterns and common flags like --target, --dry-run,
--deep, --no-push, --ticket), "## Description" with a concise paragraph
describing the command behavior (intelligently cherry-picks/backports docs
changes and excludes files not present on target releases), and "##
Implementation" with a note or the existing workflow details that explain how
the command performs the backporting so the file matches the suggested
structure.
- Line 105: The PR_NUMBER extraction uses GNU grep's -oP which is not portable;
update the assignment that sets PR_NUMBER from SOURCE (the line referencing
PR_NUMBER and SOURCE) to use a POSIX-friendly sed extraction of trailing digits
(use sed with extended regex to capture the final numeric group and return only
that capture) instead of grep -oP so the script works on macOS and Linux.
- Around line 254-273: The markdown contains several fenced code blocks showing
plain text output (e.g., the "Cherry-pick plan for <source> → <target-branch>:"
block and other prompt/output blocks referenced at lines 254, 336, 403, 467,
478, 558) that lack language specifiers; update each of those triple-backtick
fences to use ```text so the blocks are marked as plain text (search for the
exact text snippets like "Cherry-pick plan for <source> → <target-branch>:" and
the other prompt/output blocks and replace their opening ``` with ```text).
Ensure every plain-output/code block in docs-cherry-pick.md uses ```text to
satisfy MD040.

In `@plugins/docs-tools/skills/docs-branch-audit/scripts/branch_audit.sh`:
- Around line 104-105: The two extraction commands setting PR_NUMBER and
OWNER_REPO use grep -oP (Perl regex) which isn't available on macOS; replace
them with portable alternatives (e.g., use sed or awk) so PR_NUMBER and
OWNER_REPO are extracted reliably across platforms — update the assignments for
the variables PR_NUMBER and OWNER_REPO in branch_audit.sh to use a
POSIX-compatible sed/awk expression that captures the digits after "/pull/" and
the owner/repo after "github.com/" respectively, preserving existing behavior
and error handling.
- Around line 209-220: The JSON emission in branch_audit.sh builds arrays using
raw values from INCLUDE_FILES and EXCLUDE_FILES which can yield invalid JSON if
paths contain quotes/backslashes; update the loops that print these arrays to
JSON-escape each filename (e.g., pipe each "${INCLUDE_FILES[$i]}" and
"${EXCLUDE_FILES[$i]}" through jq -Rs or a small json_escape helper) and use the
jq-escaped output when echoing the quoted entries so all produced JSON strings
are correctly encoded.

In `@plugins/docs-tools/skills/docs-branch-audit/scripts/deep_audit.sh`:
- Around line 141-157: The current git apply --check --3way invocation (when
checking "$FILE_PATCH") operates against the current worktree, not the target
branch snapshot; update the deep_audit.sh logic around the FILE_PATCH check to
either (A) add a clear comment documenting this limitation as a best-effort
heuristic, or (B) implement a safer check by building an explicit temporary
index/tree from the target ref and running git apply --check --3way against that
index (use the same FILE_PATCH and preserve setting of CONFIDENCE and ISSUES),
and ensure the CONFIDENCE and ISSUES handling (patch-conflict / patch-mismatch /
patch: applies cleanly) remains unchanged.

In `@plugins/docs-tools/skills/docs-branch-audit/SKILL.md`:
- Around line 61-75: The fenced code blocks showing the branch audit output
(e.g., the block starting with "=== Branch Audit: enterprise-4.17 ===" and other
similar audit/example blocks) are missing a language specifier; update each
triple-backtick fence to include a language such as text or console (for example
replace ``` with ```text) so the linter MD040 is satisfied for the blocks
referenced around the "Branch Audit" examples.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2222bbbd-c4c5-458b-bfc1-b9f14596199c

📥 Commits

Reviewing files that changed from the base of the PR and between abb3fe9 and a06afbd.

📒 Files selected for processing (5)
  • plugins/dita-tools/README.md
  • plugins/docs-tools/commands/docs-cherry-pick.md
  • plugins/docs-tools/skills/docs-branch-audit/SKILL.md
  • plugins/docs-tools/skills/docs-branch-audit/scripts/branch_audit.sh
  • plugins/docs-tools/skills/docs-branch-audit/scripts/deep_audit.sh

Copy link

@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: 3

🤖 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/docs-tools/commands/docs-cherry-pick.md`:
- Line 296: Add the missing language identifiers to unlabeled fenced code blocks
in plugins/docs-tools/commands/docs-cherry-pick.md by changing each
triple-backtick fence that currently has no info string to use "text" (e.g.,
```text), specifically for the blocks containing the "Cherry-pick plan for
<source> → <target-branch>:" section, the Agent(...) example
(Agent(subagent_type="general-purpose", description="resolve conflict in
<file>", ...)), the "The following conflicts could not be resolved
automatically:" block, the "Stats comparison (source PR vs backport):" block and
the "⚠️  Stats divergence..." / "Branch pushed: <branch-name>" blocks; apply the
same fix at the additional locations mentioned (lines 378, 445, 509, 520, 600)
so markdownlint MD040 is satisfied.
- Line 74: Replace bare inline skill references with fully qualified
plugin:skill names; specifically change occurrences like `docs-branch-audit` to
the fully qualified form (for example `docs-tools:docs-branch-audit`) and update
the other mentioned inline references similarly (e.g., replace any bare
`jira-reader` style mentions with `docs-tools:jira-reader` or the appropriate
plugin prefix). Ensure all agent frontmatter, Skill tool invocation examples,
inline text references, and cross-references in this document use the
plugin:skill syntax consistently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 16f08627-a69e-45ef-aa36-45a1999f8b86

📥 Commits

Reviewing files that changed from the base of the PR and between aeab038 and e733b80.

📒 Files selected for processing (1)
  • plugins/docs-tools/commands/docs-cherry-pick.md

Copy link

@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.

♻️ Duplicate comments (1)
plugins/docs-tools/commands/docs-cherry-pick.md (1)

302-322: ⚠️ Potential issue | 🟡 Minor

Add language identifiers to unlabeled fenced code blocks.

These fences still violate MD040 (fenced-code-language). Please label them (e.g., text) to keep lint clean.

Suggested fix
-```
+```text
 Cherry-pick plan for <source> → <target-branch>:
 ...
-```
+```

-```
+```text
 Agent(subagent_type="general-purpose", description="resolve conflict in <file>",
 ...
-```
+```

-```
+```text
 The following conflicts could not be resolved automatically:
 ...
-```
+```

-```
+```text
 Stats comparison (source PR vs backport):
 ...
-```
+```

-```
+```text
 ⚠️  Stats divergence exceeds excluded files — review the backport for unintended changes.
-```
+```

-```
+```text
 Branch pushed: <branch-name>
 ...
-```
+```

Also applies to: 384-418, 451-460, 515-522, 526-528, 606-615

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

In `@plugins/docs-tools/commands/docs-cherry-pick.md` around lines 302 - 322, The
markdown file contains multiple unlabeled fenced code blocks (e.g., the block
starting with "Cherry-pick plan for <source> → <target-branch>:", the block
containing 'Agent(subagent_type="general-purpose"...', the block beginning "The
following conflicts could not be resolved automatically:", the "Stats comparison
(source PR vs backport):" block, and the "Branch pushed: <branch-name>" block)
which trigger MD040; update each triple-backtick fence to include a language
identifier (suggest `text`) so they read ```text ... ```; apply the same fix to
the other similar unlabeled blocks mentioned in the comment so all code fences
in docs-cherry-pick.md are labeled.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@plugins/docs-tools/commands/docs-cherry-pick.md`:
- Around line 302-322: The markdown file contains multiple unlabeled fenced code
blocks (e.g., the block starting with "Cherry-pick plan for <source> →
<target-branch>:", the block containing
'Agent(subagent_type="general-purpose"...', the block beginning "The following
conflicts could not be resolved automatically:", the "Stats comparison (source
PR vs backport):" block, and the "Branch pushed: <branch-name>" block) which
trigger MD040; update each triple-backtick fence to include a language
identifier (suggest `text`) so they read ```text ... ```; apply the same fix to
the other similar unlabeled blocks mentioned in the comment so all code fences
in docs-cherry-pick.md are labeled.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ac9ea762-4ca1-4fdb-8014-e5c935c68151

📥 Commits

Reviewing files that changed from the base of the PR and between e733b80 and f8770fd.

📒 Files selected for processing (1)
  • plugins/docs-tools/commands/docs-cherry-pick.md

@aireilly
Copy link
Member

This seems to be an openshift-docs specific workflow. Has it been tested against other docs repos?

@kquinn1204
Copy link
Author

tested against OCP - would love if tested against other repos could this be refined over time by others or are we creating a doc specific repo

@aireilly
Copy link
Member

docs-branch-audit looks great. docs-cherry-pick needs some work I think. The cherry-pick logic relies on Claude interpreting 631 lines of prose, not ideal. Also, Claude commands are deprecated, https://code.claude.com/docs/en/skills We need to migrate away from these generally (plans underway to get rid of the commands in this repo).

@kquinn1204
Copy link
Author

Audit one is a nice heads up for all this vale stuff so I need to work CP stuff command as we are moving away from this. CP was use when lots of changes

@kquinn1204
Copy link
Author

@aireilly updated based on your feedback found --dryrun useful for large PRs with lots of changes. There is a sweet spot:
The dryrun always has some value but when to use skill to do CP:
Use the GitHub bot for simple backports (no exclusions, no path changes). Use this command when:

  • Files need to be excluded (modules don't exist on the target branch)
  • Assemblies have moved paths between releases
  • Deep audit shows NEEDS-REVIEW files (100+ lines divergence)

@kquinn1204 kquinn1204 force-pushed the add-docs-cherry-pick-command branch from 1a303e1 to e3b7ef5 Compare March 24, 2026 11:33
aireilly and others added 8 commits March 24, 2026 11:50
- Update install links to marketplace URL across all plugin READMEs
- Add AsciiDocDITA Vale validation note to dita-tools README and
  both rework modes in dita-rework command

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
Add intelligent cherry-pick backporting for documentation changes across
enterprise branches. The command audits file existence and content
compatibility per branch, then creates targeted backport PRs that exclude
modules not present on each release.

Two components:

1. docs-branch-audit skill - Checks which files from a PR/commit exist on
   target branches, with optional deep content comparison that reports
   confidence levels (HIGH/MEDIUM/NEEDS-REVIEW) per file.

2. docs-cherry-pick command - Full backport workflow: audit, cherry-pick,
   version-aware conflict resolution, stats comparison, and PR description
   generation. Supports --dry-run --deep for audit-only mode.

The GitHub cherry-pick bot handles simple cases (all files exist, no
conflicts). This command fills the gap for PRs with file exclusions,
path differences between releases, or version-specific content that
requires context-aware conflict resolution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
HIGH: < 20 lines, MEDIUM: 20-99 lines, NEEDS-REVIEW: 100+ lines

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Restructure docs-cherry-pick.md to match the command format
expected by the plugin linter (.claudelint.yaml).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add GitLab merge-requests refspec for open MR mode alongside
the existing GitHub pull refspec.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes markdownlint MD040 warnings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move cherry-pick logic from 631 lines of prose (command) into a bash
script that handles all deterministic operations: PR info fetching,
branch audit, cherry-pick execution, commit, push, and PR description
generation. The SKILL.md is a thin wrapper (123 lines) covering only
conflict resolution rules that require LLM judgement.

- Delete commands/docs-cherry-pick.md
- Add skills/docs-cherry-pick/SKILL.md
- Add skills/docs-cherry-pick/scripts/cherry_pick.sh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

and counted toward included files rather than excluded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kquinn1204 kquinn1204 force-pushed the add-docs-cherry-pick-command branch from e3b7ef5 to ea87401 Compare March 24, 2026 11:52
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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