Skip to content

[Ability] update-post-content — Read, modify, and save post content with validated block markup #34

Description

@pluginslab

Use Case

User says "add a paragraph after the heading" or "delete the second block" in the block editor chat. AI reads the current post blocks, performs the requested insert/replace/delete operation, validates the markup with parse_blocks(), and saves via REST API. Destructive operations (replace, delete) require confirmation.

Checklist

  • Writer: Define natural language triggers, expected response format, and confirmation requirements per operation type
  • PHP Dev: Create includes/abilities/update-post-content.php using register_agentic_ability()
  • JS Dev: Create src/extensions/abilities/update-post-content.js with registerAbility()
  • JS Dev: Register in src/extensions/abilities/index.js
  • LLM Tester: Add test cases to tests/abilities/core-abilities.test.js
  • Build & verify: npm run build and npm run test:abilities

References

  • Abilities Guide
  • Existing destructive ability example: includes/abilities/plugin-deactivate.php + src/extensions/abilities/plugin-deactivate.js

Notes

Operations: insert, replace, delete blocks by position. Reads current content from editor state or REST API (GET /wp/v2/posts/{id}). Saves via PUT /wp/v2/posts/{id} with content field. Validates all markup with parse_blocks() before saving — zero "Attempt Block Recovery" errors. Replace and delete operations are destructive and need requiresConfirmation: true. Depends on Goal 7 (block editor chat window) for the editor-side surface. See CLOUDFEST_HACKATHON.md Goal 8.

Activity

  1. added
    phpPHP backend work
    react-jsReact/JavaScript frontend work
    hackathonCloudFest Hackathon 2026
    abilityNew ability implementation
    testingTesting and QA
    on Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    abilityNew ability implementationhackathonCloudFest Hackathon 2026phpPHP backend workreact-jsReact/JavaScript frontend worktestingTesting and QA

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions