Skip to content

Add AI assisted content review utilizing WordPress Notes#260

Merged
jeffpaul merged 37 commits intoWordPress:developfrom
dkotter:feature/review-notes
Mar 4, 2026
Merged

Add AI assisted content review utilizing WordPress Notes#260
jeffpaul merged 37 commits intoWordPress:developfrom
dkotter:feature/review-notes

Conversation

@dkotter
Copy link
Collaborator

@dkotter dkotter commented Feb 26, 2026

What?

Closes #251

Adds an AI assisted content review process

Why?

Provides a quick and easy way to get high-level feedback of your content prior to publishing. Will check things like grammar, spelling, accessibility and SEO.

How?

  • Adds a new Review_Notes experiment and Review_Notes Ability
  • When configured, will add a button in the post status sidebar that is used to trigger an AI review
  • Will send each block off one-by-one to our review-notes Ability, which will send the block content, block type and surrounding content to AI with instructions on what to look for
  • If any suggestions are returned, those will be added as a Note attached to the block
  • Adds all unit tests and E2E tests
  • Adds documentation

Note

After the review is done, a save is required to keep the connection between a note and a block. This is how notes work in the block editor, where it adds some metadata to the block attribute. We could trigger an autosave though I know I've gotten feedback on other PRs not to do that.

Use of AI Tools

Used Claude Code running Sonnet 4.6 to help build out a plan and execute on that initial plan. Lots of manual refinement along the way.

Testing Instructions

  1. Pull this PR down and run npm i && npm run build && composer install
  2. Add valid AI credentials
  3. Turn on the Review Notes Experiment
  4. Create a new post or edit an existing post
  5. Find the Generate Review Notes button in the post status sidebar and click on it
  6. Ensure a loading state is shown
  7. Once finished, ensure a success message is shown
  8. Save the post (required to keep the association between a note and the block it's attached to)
  9. Click into the new Notes interface
  10. Ensure WordPress AI notes are there

Screenshots

New Generate Review Notes button that shows in the post status sidebar In progress review state of the Generate Review Notes button Final state of the review in the post status sidebar Example of a WordPress note that flags a few issues Open WordPress Playground Preview

…her information about each block and send along an API request. Process that response properly and add notes as needed
…ck and skip sending those blocks for processing
… returning results as LLMs struggle to do that deduping. Update our system instructions to be more robust
…tent we send to limit the token usage. Update docs
@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 77.10843% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.48%. Comparing base (e63b750) to head (75b6c7b).
⚠️ Report is 38 commits behind head on develop.

Files with missing lines Patch % Lines
includes/Abilities/Review_Notes/Review_Notes.php 80.10% 39 Missing ⚠️
includes/Experiments/Review_Notes/Review_Notes.php 64.58% 17 Missing ⚠️
...udes/Abilities/Review_Notes/system-instruction.php 50.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #260      +/-   ##
=============================================
+ Coverage      55.67%   57.48%   +1.80%     
- Complexity       516      563      +47     
=============================================
  Files             32       35       +3     
  Lines           2660     2907     +247     
=============================================
+ Hits            1481     1671     +190     
- Misses          1179     1236      +57     
Flag Coverage Δ
unit 57.48% <77.10%> (+1.80%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…Remove the limit on total blocks and individual block content length we process
@dkotter dkotter self-assigned this Mar 2, 2026
@dkotter dkotter added this to the 0.4.0 milestone Mar 2, 2026
@dkotter dkotter marked this pull request as ready for review March 2, 2026 21:08
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dkotter <dkotter@git.wordpress.org>
Co-authored-by: jeffpaul <jeffpaul@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@dkotter dkotter requested a review from jeffpaul March 2, 2026 21:16
Copy link
Member

@jeffpaul jeffpaul left a comment

Choose a reason for hiding this comment

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

Only minimal feedback from testing, nice work...

  1. Post-review the "## suggestions added." text under the "Review with AI" button could perhaps be amended to "## suggestions added, view those Notes here." that links to either the All notes sidebar/tray or the View notes floating notes view.
  2. Not totally sold on this, but perhaps update the displayname from "AI Reviewer" to "WordPress AI"?
  3. In the "Reviewing... (#/##)" text that appears while the post is being processed, do the numbers relate to the number of blocks being processed? If so, let's perhaps adjust there to "Reviewing blocks... (# of ##)" to make that a bit more clear.
  4. I'm starting to think removing "AI", "with AI", etc sort of copy might be helpful to simplify things. In which case perhaps we update the button copy from "Review with AI" to "Suggest Refinements", "Suggest Improvements", "Generate Review Notes", "Suggest Changes", or whatever resonates best for this initial version. Depending on what button text we use, we might want to adjust the Experiment name on the Settings page.
  5. Depending on the button naming above, we might adjust the experiment settings description as well as the helper text in the editor sidebar. At least hyphenating block-by-block and capitalizing Notes where used (and ideally making those two text items more similar).

@jeffpaul jeffpaul mentioned this pull request Mar 3, 2026
20 tasks
@dkotter
Copy link
Collaborator Author

dkotter commented Mar 4, 2026

  1. Post-review the "## suggestions added." text under the "Review with AI" button could perhaps be amended to "## suggestions added, view those Notes here." that links to either the All notes sidebar/tray or the View notes floating notes view.

This has been updated now to ## suggestions added, view those Notes here, with here linking to the floating Notes view

  1. Not totally sold on this, but perhaps update the displayname from "AI Reviewer" to "WordPress AI"?

Updated to WordPress AI but can easily change that if we get feedback

  1. In the "Reviewing... (#/##)" text that appears while the post is being processed, do the numbers relate to the number of blocks being processed? If so, let's perhaps adjust there to "Reviewing blocks... (# of ##)" to make that a bit more clear.

Yes, numbers here are the blocks that have been processed and total blocks. Updated this now to Reviewing blocks... (# of ##)

  1. I'm starting to think removing "AI", "with AI", etc sort of copy might be helpful to simplify things. In which case perhaps we update the button copy from "Review with AI" to "Suggest Refinements", "Suggest Improvements", "Generate Review Notes", "Suggest Changes", or whatever resonates best for this initial version. Depending on what button text we use, we might want to adjust the Experiment name on the Settings page.

Went with Generate Review Notes as the text used in the button

  1. Depending on the button naming above, we might adjust the experiment settings description as well as the helper text in the editor sidebar. At least hyphenating block-by-block and capitalizing Notes where used (and ideally making those two text items more similar).

Made a handful of text edits to ensure we use Notes everywhere (instead of notes) and added those hyphens. Also a few other minor updates to ensure things are consistent.

@dkotter dkotter requested a review from jeffpaul March 4, 2026 17:05
@jeffpaul jeffpaul added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Mar 4, 2026
@github-actions github-actions bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Mar 4, 2026
@jeffpaul jeffpaul added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Mar 4, 2026
@github-actions github-actions bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Mar 4, 2026
@jeffpaul jeffpaul merged commit 3b059d9 into WordPress:develop Mar 4, 2026
20 of 28 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.

Add “Suggest Refinements” to create AI review Notes for recommended improvements

2 participants