Skip to content

Commit 571f2a0

Browse files
authored
Merge pull request #480 from ably/feature/doc-update-release-process
Added LLM-based website docs validation section to CONTRIBUTING.md
2 parents 53b120d + c84ba34 commit 571f2a0

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

CONTRIBUTING.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,52 @@ Example:
158158
// @specNotApplicable CHA-EX3a - Our API does not have a concept of "partial options" unlike the JS API which this spec item considers.
159159
```
160160

161+
## Validate website doc snippets
162+
163+
To validate that the web documentation code snippets are accurate and up-to-date with the SDK source code, run the following prompt against a locally cloned copy of the [ably/docs](https://github.com/ably/docs) repository and this SDK repository.
164+
165+
> [!IMPORTANT]
166+
> This prompt should be run with the most powerful LLM available to you (e.g. Claude Opus, GPT-5, etc.) for the best results.
167+
168+
Replace `{DOCS_PATH}` with the path to your local clone of the [ably/docs](https://github.com/ably/docs) repository and `{SDK_PATH}` with the path to your local clone of the [ably-chat-swift](https://github.com/ably/ably-chat-swift) SDK repository. Ensure both the local `ably/docs` and `ably-chat-swift` repositories are on the `main` branch and in sync with the remote.
169+
170+
```text
171+
Verify all `swift` annotated code snippets in `.mdx` files located at `{DOCS_PATH}/src/pages/docs/chat` against the `ably-chat-swift` source code repository at `{SDK_PATH}`.
172+
173+
### Verification Steps:
174+
175+
1. **Find all code snippets**: Search for all code blocks with the `swift` annotation in `.mdx` files.
176+
177+
2. **Understand SDK structure**: Analyze the SDK source code to understand:
178+
- Public classes and their constructors
179+
- Public methods and their signatures (parameters, return types)
180+
- Public properties and their types
181+
- Enums and their values
182+
- Namespaces and import requirements
183+
184+
3. **Cross-check each snippet** for the following issues:
185+
- **Syntax errors**: Incorrect initializer syntax (e.g., missing argument labels, incorrect use of `try`/`await`), misuse of optional unwrapping (`!` vs `if let`/`guard let`), incorrect protocol conformance signatures, misplaced braces or parentheses
186+
- **Naming conventions**: Verify casing matches Swift conventions (e.g., `UpperCamelCase` for types, protocols, and enums; `lowerCamelCase` for methods, properties, and enum cases)
187+
- **API accuracy**: Verify method names, property names, and enum values exist in the SDK (e.g., correct `init()` signatures, protocol method names, `Optional` usage)
188+
- **Type correctness**: Verify correct types are used (e.g., `ConnectionEvent` vs `ConnectionState`)
189+
- **Namespace/import requirements**: Note any required imports that are missing from examples
190+
- **Wrong language**: Detect if code from another language was accidentally used
191+
192+
4. **Generate a verification report** with:
193+
- Total snippets found
194+
- List of issues found with:
195+
- File path and line number
196+
- Current (incorrect) code
197+
- Expected (correct) code
198+
- Source reference in SDK
199+
- List of verified APIs that are correct
200+
- Success rate percentage
201+
- Recommendations for fixes
202+
203+
### Output Format:
204+
Create/update a markdown report file `chat_swift_api_verification_report.md` with all findings.
205+
```
206+
161207
## Release process
162208

163209
For each release, the following needs to be done:
@@ -171,7 +217,10 @@ For each release, the following needs to be done:
171217
- From the newly generated changes remove everything that don't make much sense to the library user
172218
- Copy the final list of changes to the top of the `CHANGELOG.md` file. Modify as necessary to fit the existing format of this file
173219
- Commit these changes and push to the origin `git add CHANGELOG.md && git commit -m "Update change log." && git push -u origin release/x.x.x`
220+
- 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.
221+
- 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.
174222
- Make a pull request against `main` and await approval of reviewer(s)
175223
- Once approved and/or any additional commits have been added, merge the PR
176224
- After merging the PR, wait for all CI jobs for `main` to pass.
177225
- Publish your drafted release (refer to previous releases for release notes format)
226+
- Merge any [website docs](https://github.com/ably/docs) PRs related to the changes.

0 commit comments

Comments
 (0)