Added LLM-based website docs validation section to CONTRIBUTING.md #480
Added LLM-based website docs validation section to CONTRIBUTING.md #480
Conversation
WalkthroughAdds duplicated "Validate website doc snippets" guidance to CONTRIBUTING.md and inserts two Release-process steps recommending running the validation task locally, creating a website docs PR to update SDK/version and fix docs, and merging related website docs PRs. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
3129490 to
2d49303
Compare
2d49303 to
ba656e8
Compare
ba656e8 to
81e8e41
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CONTRIBUTING.md`:
- Line 204: Update the CONTRIBUTING.md instruction that tells the LLM to
create/update chat_swift_api_verification_report.md to specify a safe output
location and/or prevent commits: change the directive to either write the file
to an explicit out‑of‑tree path (for example in the user's home directory) or
add guidance to add chat_swift_api_verification_report.md to .gitignore and
state clearly that the file must not be committed; reference the filename
chat_swift_api_verification_report.md in the text so readers and automation know
which file to ignore or where to place it.
- Line 220: The sentence on line containing "made changes to public interfaces"
is wordy; update that phrase to "changed public interfaces" so the line reads:
"If you’ve deprecated any public methods or properties, changed public
interfaces, or are uncertain about the impact of your updates, run the [Validate
website docs snippet changes](`#validate-website-docs-snippet-changes`) task
locally..." — replace only the phrase "made changes to public interfaces" with
"changed public interfaces" to keep the rest of the sentence intact.
- Line 170: The fenced code block in CONTRIBUTING.md is missing a language
specifier which triggers MD040; update the opening triple-backtick fence for the
snippet that starts with "Verify all `swift` annotated code snippets ..." to
include a language tag (e.g., use text or plaintext) so the fence becomes
```text and enables correct rendering and linting.
- Around line 185-188: Update the CONTRIBUTING.md bullets "Syntax errors" and
"Naming conventions" to remove non‑Swift examples and replace them with
Swift‑specific guidance: for "Syntax errors" mention issues like missing init
methods, incorrect use of optional unwrapping (force unwrapping vs optional
binding), incorrect protocol conformance signatures, and misplaced braces or
parentheses; for "Naming conventions" replace JS/C#/Kotlin examples with Swift
conventions (UpperCamelCase for types, camelCase for properties/variables,
lowerCamelCase for enums/cases only when using camelCase API, and leading
underscore rules). Ensure the "API accuracy" and "Type correctness" bullets
remain but, where examples are needed, reference Swift symbols such as init(),
Optional, enum cases, and protocol names to avoid cross‑language artifacts.
81e8e41 to
6016edf
Compare
6016edf to
9fa8b7d
Compare
There was a problem hiding this comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@CONTRIBUTING.md`:
- Line 204: The CONTRIBUTING.md instruction to "Create/update a markdown report
file `chat_swift_api_verification_report.md`" lacks a safe output path; update
the docs to either (1) recommend creating the report in an out-of-tree location
(example: ~/chat_swift_api_verification_report.md) or (2) require adding
`chat_swift_api_verification_report.md` to .gitignore before creating it;
reference the filename `chat_swift_api_verification_report.md` in the text and
add a short note showing the preferred option so contributors won’t accidentally
stage/commit the file.
9fa8b7d to
adaf719
Compare
|
Shouldn't it use similar aproach as implemented in ably/docs#3192? ( |
We can surely add this to claude skills in the near future and also add it to the CI -> https://ably.atlassian.net/browse/DX-837. However, this approach seems limited to Claude. So, we should always have a separate generic prompt that can be used with any LLM, in case Claude is unavailable/offline, so we can manually run and verify the website docs as part of the release process. Additionally, based on my experience, this task typically requires manual intervention and multiple refinement cycles to achieve accurate results. |
… swift code snippets in the web documentation against the SDK source code.
adaf719 to
71ee872
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
CONTRIBUTING.md (2)
220-221: Break down this complex multi-action step for clarity.This bullet point combines several distinct actions into a single, dense sentence:
- A conditional check (deprecated methods, changed interfaces, or uncertainty)
- Running the validation task
- Reviewing the report
- Creating a docs PR with version update and fixes
- A requirement to create a PR even without API changes
Consider restructuring this as a parent bullet with sub-items, or as separate sequential bullets, to improve readability and make each action explicit.
Additionally, the statement "Even if there are no public API changes, a PR must still be created to update the SDK version" conflicts with the conditional opening. If a version-update PR is always required, consider making that a separate, unconditional step rather than embedding it within a conditional step.
♻️ Possible restructure
-- If you've deprecated any public methods or properties, changed public interfaces, or are uncertain about the impact of your updates, run the [Validate website doc snippets](`#validate-website-doc-snippets`) task locally. This will verify that the `swift` code snippets in the web documentation (https://github.com/ably/docs) are accurate and aligned with the current SDK source. Review the generated report and address any issues it identifies. -- Create a PR on the [website docs](https://github.com/ably/docs) that updates the SDK version in the setup/installation guide. Additionally, include fixes for any documentation issues identified in the previous step. Even if there are no public API changes, a PR must still be created to update the SDK version. +- If you've deprecated any public methods or properties, changed public interfaces, or are uncertain about the impact of your updates: + - Run the [Validate website doc snippets](`#validate-website-doc-snippets`) task locally to verify that the `swift` code snippets in the web documentation are accurate and aligned with the current SDK source + - Review the generated report and address any issues it identifies +- Create a PR on the [website docs](https://github.com/ably/docs) to update the SDK version in the setup/installation guide and include fixes for any documentation issues identified above🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@CONTRIBUTING.md` around lines 220 - 221, Split the combined bullet that begins "If you've deprecated any public methods or properties, changed public interfaces, or are uncertain about the impact of your updates, run the [Validate website doc snippets](`#validate-website-doc-snippets`) task locally..." into a parent bullet with clear sub-items: (a) list the condition that triggers validation ("deprecated methods, changed interfaces, or uncertainty"), (b) instruct to run the "Validate website doc snippets" task, (c) instruct to review and address the generated report, and (d) instruct to create a PR on the website docs to update the SDK version and include any fixes; then extract the sentence "Even if there are no public API changes, a PR must still be created to update the SDK version" and make it a separate unconditional bullet so the version-update requirement is explicit and not tied to the conditional validation step.
226-226: Clarify which website docs PRs should be merged.The phrase "Merge any [website docs] PRs related to the changes" is ambiguous. Does this refer to:
- The version-update PR mentioned in the previous step (line 221)?
- Additional PRs that may have been created independently?
- Both?
Consider being more explicit, for example:
- "Merge the website docs PR created in the previous step" (if it's always one PR), or
- "Merge the version-update PR and any additional website docs PRs related to this release" (if there can be multiple)
♻️ Possible clarification
-- Merge any [website docs](https://github.com/ably/docs) PRs related to the changes. +- Merge the [website docs](https://github.com/ably/docs) PR created above that updates the SDK version and any related fixes.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@CONTRIBUTING.md` at line 226, Replace the ambiguous sentence "Merge any [website docs] PRs related to the changes." with an explicit instruction naming the version-update PR and any other docs PRs — e.g., "Merge the website docs version-update PR created in the previous step and any additional website docs PRs related to this release." This clarifies that both the version-update PR and any other independent website docs PRs should be merged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@CONTRIBUTING.md`:
- Around line 220-221: Split the combined bullet that begins "If you've
deprecated any public methods or properties, changed public interfaces, or are
uncertain about the impact of your updates, run the [Validate website doc
snippets](`#validate-website-doc-snippets`) task locally..." into a parent bullet
with clear sub-items: (a) list the condition that triggers validation
("deprecated methods, changed interfaces, or uncertainty"), (b) instruct to run
the "Validate website doc snippets" task, (c) instruct to review and address the
generated report, and (d) instruct to create a PR on the website docs to update
the SDK version and include any fixes; then extract the sentence "Even if there
are no public API changes, a PR must still be created to update the SDK version"
and make it a separate unconditional bullet so the version-update requirement is
explicit and not tied to the conditional validation step.
- Line 226: Replace the ambiguous sentence "Merge any [website docs] PRs related
to the changes." with an explicit instruction naming the version-update PR and
any other docs PRs — e.g., "Merge the website docs version-update PR created in
the previous step and any additional website docs PRs related to this release."
This clarifies that both the version-update PR and any other independent website
docs PRs should be merged.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
CONTRIBUTING.md
Summary by CodeRabbit