Skip to content

Add agent skill for backporting PRs to WP Core - #80594

Open
scruffian wants to merge 6 commits into
trunkfrom
add/gutenberg-backport-claude-skill
Open

Add agent skill for backporting PRs to WP Core#80594
scruffian wants to merge 6 commits into
trunkfrom
add/gutenberg-backport-claude-skill

Conversation

@scruffian

@scruffian scruffian commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What?

Add a skills/gutenberg-backport-pr/SKILL.md file that gives coding agents task-scoped guidance for back-merging PRs to wordpress-develop.

This also adds a root AGENTS.md routing entry for backporting tasks, following the progressive-discovery convention introduced in #80650.

All durable content stays in docs/contributors/code/back-merging-to-wp-core.md; the skill is a thin pointer with workflow-shaping hints for agent tools.

Why?

Contributors using agent-assisted coding tools can invoke skills by name or trigger phrase. Placing a small skill file at the repository-standard skills/<domain>/SKILL.md path lets compatible agents discover it automatically when a contributor asks about backporting a PR, without embedding tool-specific procedural content in the wider docs.

Two design choices worth flagging:

  • This follows the progressive-discovery pattern from Add progressive-discovery pattern for agent instructions and skills #80650. The root AGENTS.md routes to the task skill, the skill stays short, and the substantive procedure remains in the public back-merging guide.
  • The SKILL.md is intentionally short. The substantive procedure lives in the doc so there is a single source of truth for both humans and AI tools. The skill only carries trigger metadata, pointers to the doc, a pre-flight checklist, a brief note on approach (local clone vs gh CLI + PHPCS), and a reminder to commit the backport-changelog entry once the WP Core PR is open.

How?

Adds:

  • skills/gutenberg-backport-pr/SKILL.md, the repository-standard skill file
  • a root AGENTS.md progressive-discovery route for backporting/back-merging tasks

The skill includes:

  • Frontmatter with trigger phrases ("create a backport PR", "backport to wordpress-develop", etc.)
  • Pointers to docs/contributors/code/back-merging-to-wp-core.md and backport-changelog/readme.md
  • A pre-flight checklist covering skip labels (Backport from WordPress Core, Backported to WordPress Core, No Core Sync Required), the target WordPress version, and the Trac ticket
  • A short "Approach" note covering local-clone vs gh CLI, mechanical vs compat-shim file mapping, and running PHPCS before pushing
  • A reminder to commit the backport-changelog/<wp-version>/<wp-develop-pr-number>.md entry back to the Gutenberg PR once the wordpress-develop PR is open

Testing Instructions

  1. Check out this branch.
  2. Confirm skills/gutenberg-backport-pr/SKILL.md exists.
  3. Confirm root AGENTS.md routes backporting/back-merging tasks to skills/gutenberg-backport-pr/SKILL.md.
  4. Confirm docs/contributors/code/back-merging-to-wp-core.md exists on trunk.
  5. Open the repo in an agent client that supports repository skills/ discovery.
  6. Ask something like "create a backport PR for Gutenberg Reusable blocks: Don't show trashed blocks in the editor or frontend #12345" and confirm the skill loads, delegates to the doc, and asks the pre-flight questions.

Use of AI Tools

This PR was drafted with Claude Code and updated with Codex. Per the WordPress AI Guidelines, the human author takes responsibility for the content.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

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: scruffian <scruffian@git.wordpress.org>
Co-authored-by: ciampo <mciampini@git.wordpress.org>

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

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Flaky tests detected in 9bc5703.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/30302791788
📝 Reported issues:

@scruffian scruffian changed the title Add a Claude Code skill for back-merging PRs to WP Core Add agent skills for back-merging PRs to WP Core Jul 22, 2026
@scruffian scruffian changed the title Add agent skills for back-merging PRs to WP Core Add generic agent skill for back-merging PRs to WP Core Jul 22, 2026
@scruffian scruffian changed the title Add generic agent skill for back-merging PRs to WP Core Add generic agent skill for backporting PRs to WP Core Jul 22, 2026
@scruffian scruffian self-assigned this Jul 22, 2026
@scruffian scruffian added the [Type] Developer Documentation Documentation for developers label Jul 22, 2026
@scruffian
scruffian requested a review from Copilot July 27, 2026 19:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a discoverable “gutenberg-backport-pr” agent skill to guide automated back-merging of Gutenberg PHP changes into WordPress/wordpress-develop, with a Claude Code compatibility entrypoint that delegates to the generic skill file.

Changes:

  • Add a generic agent skill definition at .agents/skills/gutenberg-backport-pr/SKILL.md that points to the authoritative backport procedure docs and includes pre-flight prompts.
  • Add a .claude/skills/.../SKILL.md compatibility entrypoint that forwards Claude Code users to the generic .agents skill.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.agents/skills/gutenberg-backport-pr/SKILL.md Introduces the generic, auto-discoverable backport skill that references the canonical docs and outlines the workflow.
.claude/skills/gutenberg-backport-pr/SKILL.md Provides a non-symlink Claude Code entrypoint that delegates to the .agents skill.

Establishes a lightweight .claude/skills/ pattern by adding a single
skill file that delegates to the existing back-merging doc. The
SKILL.md contains only the trigger metadata and a pre-flight
checklist; all durable procedural content lives at
docs/contributors/code/back-merging-to-wp-core.md so that non-Claude
tools and human contributors read the same source of truth.
@scruffian
scruffian force-pushed the add/gutenberg-backport-claude-skill branch from 29e1573 to fe86ef3 Compare July 27, 2026 20:21
@scruffian scruffian changed the title Add generic agent skill for backporting PRs to WP Core Add agent skill for backporting PRs to WP Core Jul 27, 2026
Comment on lines +24 to +28
Check the Gutenberg PR labels first. If any of these are set, no back-merge is needed and the workflow can stop:

- `Backport from WordPress Core`
- `Backported to WordPress Core`
- `No Core Sync Required`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The back-merging guide lists Backported to WordPress Core as an exception, while the changelog workflow and README only recognize Backport from WordPress Core and No Core Sync Required.

What's the up-to-date info? We should make all skills/docs are aligned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants