$npx -y skills add opendatahub-io/ai-helpers --skill doc-postUse this skill to post validation and review findings as comments on a GitHub PR or GitLab MR. Reads workspace findings files and formats them as inline or summary comments.
| 1 | # doc-post |
| 2 | |
| 3 | Post validation and review findings as comments on a PR/MR. |
| 4 | |
| 5 | ## Parse arguments |
| 6 | |
| 7 | `$ARGUMENTS` contains: |
| 8 | 1. **PR URL**: GitHub or GitLab PR/MR URL (required) |
| 9 | 2. **Flags** (optional): |
| 10 | - `--validation`: post validation findings only |
| 11 | - `--review`: post review findings only |
| 12 | - `--all` (default): post both validation and review findings |
| 13 | |
| 14 | ## Step 1: Detect platform |
| 15 | |
| 16 | From the PR URL, determine the platform: |
| 17 | - `github.com` → GitHub (use `gh` CLI) |
| 18 | - Other → GitLab (use GitLab API) |
| 19 | |
| 20 | ## Step 2: Load findings |
| 21 | |
| 22 | Based on flags, read the relevant findings files: |
| 23 | |
| 24 | - **Validation**: `workspace/validation-findings.json` |
| 25 | - **Review**: `workspace/review-findings.json` |
| 26 | |
| 27 | If a requested file doesn't exist, warn and skip it. |
| 28 | |
| 29 | ## Step 3: Format comments |
| 30 | |
| 31 | ### Summary comment |
| 32 | |
| 33 | Create a summary comment with an overview table: |
| 34 | |
| 35 | ```markdown |
| 36 | ## Documentation Review Results |
| 37 | |
| 38 | | Category | High | Medium | Low | Total | |
| 39 | |----------|------|--------|-----|-------| |
| 40 | | Validation | 0 | 3 | 5 | 8 | |
| 41 | | Review | 1 | 2 | 3 | 6 | |
| 42 | | **Total** | **1** | **5** | **8** | **14** | |
| 43 | |
| 44 | **Review confidence**: 0.78 |
| 45 | |
| 46 | ### High-severity findings |
| 47 | |
| 48 | 1. **[ref_model-serving-params.adoc:42]** Technical inaccuracy: The documented API field 'replicas' should be 'minReplicas' |
| 49 | - **Suggestion**: Change 'replicas' to 'minReplicas' per the CRD type definition |
| 50 | |
| 51 | ### Medium-severity findings |
| 52 | |
| 53 | 1. **[con_model-serving.adoc:15]** Vale: Use 'Red Hat OpenShift AI' instead of 'RHOAI' on first reference |
| 54 | ``` |
| 55 | |
| 56 | ### Inline comments (GitHub only) |
| 57 | |
| 58 | For findings that reference specific files and lines in the PR's changed files: |
| 59 | |
| 60 | 1. Get the list of changed files: `gh pr view <URL> --json files` |
| 61 | 2. For each finding that references a changed file, post an inline review comment |
| 62 | 3. For findings in files not in the PR diff, include them in the summary comment |
| 63 | |
| 64 | ## Step 4: Post comments |
| 65 | |
| 66 | ### GitHub |
| 67 | |
| 68 | ```bash |
| 69 | # Post summary comment |
| 70 | gh pr comment <PR-URL> --body "<summary>" |
| 71 | |
| 72 | # Post inline review (if applicable) |
| 73 | gh api repos/{owner}/{repo}/pulls/{number}/reviews \ |
| 74 | --method POST \ |
| 75 | --field body="Documentation review complete" \ |
| 76 | --field event="COMMENT" \ |
| 77 | --field comments="[...]" |
| 78 | ``` |
| 79 | |
| 80 | ### GitLab |
| 81 | |
| 82 | Use the GitLab API to post merge request notes. |
| 83 | |
| 84 | ## Step 5: Report |
| 85 | |
| 86 | Report to caller: |
| 87 | - Number of comments posted |
| 88 | - Summary of findings posted |
| 89 | - Any findings that could not be posted (e.g., file not in PR diff) |
| 90 | |
| 91 | ## Output |
| 92 | |
| 93 | Comments posted on the PR/MR. No workspace file produced. |
| 94 | |
| 95 | ## Stop conditions |
| 96 | |
| 97 | - **Halt**: PR URL not provided or invalid |
| 98 | - **Halt**: No findings files exist |
| 99 | - **Warn**: `gh` CLI not available (cannot post to GitHub) |
| 100 | - **Continue**: Some inline comments fail to post (include in summary instead) |