Proposal: RC docs-sync (daily poll + AI-drafted doc PRs)#388
Draft
enricobattocchi wants to merge 4 commits intomainfrom
Draft
Proposal: RC docs-sync (daily poll + AI-drafted doc PRs)#388enricobattocchi wants to merge 4 commits intomainfrom
enricobattocchi wants to merge 4 commits intomainfrom
Conversation
Adds the plumbing for a daily GitHub Action that polls Yoast product repos for new RC tags, runs a Claude agent against the developer-portal docs, and opens draft PRs where doc updates are warranted. Scope for this first phase: Yoast SEO (free) only. More products added iteratively by extending AGENT_MAP.md and the PRODUCTS dict in the workflow. Architecture: - No GitHub App or PAT required; product repos are public so anonymous cloning works and all writes to this repo use GITHUB_TOKEN. - Never writes to main; state lives in tracking-issue comments, identified by a machine-readable marker embedded in every run-summary comment. - Cloudflare Pages preview deploy on PR is the per-PR validation. - PRs are never auto-merged; branch protection's PR-review rule is the gate. Validated through three manual spikes (narrow positive, negative hotfix, multi-file new feature) plus end-to-end dry-runs of the orchestration prompt. Activation requirements (handled post-merge, see PR body): create a tracking issue, set TRACKING_ISSUE_WORDPRESS_SEO repo variable, set ANTHROPIC_API_KEY secret (coordinated with devops). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deploying yoast-developer with
|
| Latest commit: |
8766e1c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://181a9e67.yoast-developer.pages.dev |
| Branch Preview URL: | https://rc-docs-sync-proposal.yoast-developer.pages.dev |
Two refinements in response to review: - Agent now detects and reports "AGENT_MAP.md coverage gaps" during every RC run. A coverage gap is a hunk that looks like public surface (new apply_filters / do_action, new REST route, new top-level src/<subsystem>/ file with public classes) whose path or symbol isn't covered by any area's source_paths or symbol_namespaces. Listed in the run-summary comment under a "Coverage gaps observed" section only when present. Informational; does not block the run. Turns every RC into a free audit of the map. - Removed AI Brand Insights from AGENT_MAP.md's Product table and from the `ai` area's product list. Rationale: the developer portal currently has no feature-spec docs for it (only a changelog), so every docs-sync run on the product would reliably produce zero PRs. Keeping it in the map would waste compute and review attention on unambiguously no-op runs. Added a note in the `ai` area describing how to re-add it (product table entry plus source paths for ai-insights-api and ai-insights-frontend, plus a split-product rule) when/if feature docs land. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop the "off-by-default" flag from the duplicate-post area. It has docs in this repo (docs/duplicate-post/**) and an active release cadence in Yoast/duplicate-post, so there's no reason to treat it differently from any other documented product. Simplify the agent's "never touch" rule to docs/development/** only — the per-area docs_paths matching already ensures docs/duplicate-post/ is only touched when PRODUCT=duplicate-post. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The product has no feature docs in this repo and will not gain any, so per-product notes about how to re-integrate it later are noise. Replaced the two AI-Brand-Insights-specific notes (Product table + ai area) with a generic rule stating only products with feature docs belong in the table. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal — RC docs-sync
A daily workflow that polls Yoast product repos for new RC tags, runs a Claude agent against the developer-portal docs, and opens draft PRs when docs need updating. Initial scope: Yoast SEO (free) only; more products added once this settles.
This is a proposal for review — not ready to merge as-is. Even if merged, nothing fires until the
TRACKING_ISSUE_WORDPRESS_SEOrepo variable andANTHROPIC_API_KEYsecret are set, and the agent-invocation step in the workflow (currently a placeholder) is wired to a real Claude action.What this PR adds
AGENT_MAP.md(repo root) — source of truth for the feature-area taxonomy: docs paths per area, per-product source-path globs, symbol namespaces, and the Product → source repo table (with human-readable display names). The agent loads this at runtime to triage an RC diff and route proposed changes into PRs..github/claude-agent/run.md— the agent orchestration prompt. Triage + authoring + PR-creation flow, style rules, authoring discipline, PR title format, and the machine-readable marker for the run-summary comment (which doubles as state for the next run). Also includes a coverage-gap self-reporting step so every RC run surfaces any public surface observed in the diff but not yet covered byAGENT_MAP.md..github/workflows/rc-docs-sync.yml— the daily workflow.schedule: 0 6 * * *+workflow_dispatchfor manual backfill.How it works (per daily run)
wordpress-seoright now), query the product repo's tags via the public GitHub API — anonymous, no token.Yoast/wordpress-seoat the RC tag (anonymous).readme.txtchangelog entry.docs/tree..github/claude-agent/run.md. The agent triages, opens one PR per affected feature area (branchrc-sync/<product>/<rc_tag>/<area>, titleYoast SEO <base-version> — docs(<area>): <title>), surfaces anyAGENT_MAP.mdcoverage gaps it observed, and posts a summary comment back to the tracking issue. The comment's marker is the state for tomorrow's run.Why this architecture
GITHUB_TOKEN. The only external secret isANTHROPIC_API_KEY.main. State lives in tracking-issue comments (not a committed state file), so the workflow is indifferent tomainbeing protected.yarn buildlocally — broken Docusaurus builds fail the CF Pages deploy and surface on the PR.GITHUB_TOKENcan't approve PRs, and the workflow never callsgh pr merge. Human reviewer is the sole merge gate.Validation
Three manual spikes were run against past RCs of
Yoast/wordpress-seo:wpseo_llmstxt_link_descriptionfilter in 26.3-RC1llms-txt, authoring semantically matched the ground-truth doc PR.schema-aggregator(3 new docs +sidebars.js) and a bonus catch forrobots-txt(Schemamap directive +wpseo_disable_robots_schemamapfilter). The robots-txt update is something the team actually had to address in follow-up doc commits after the original schema-aggregator PR — the agent would have caught it at RC time.End-to-end dry-runs of the orchestration prompt on Spikes A and C produced the expected
proposed-docs.patch,proposed-sidebars.patch, andrun-summary.mdartifacts (with correct marker, correct PR-title format, correct area placement).What still needs to happen before activation
TRACKING_ISSUE_WORDPRESS_SEO= that issue's number (Settings → Secrets and variables → Actions → Variables tab).ANTHROPIC_API_KEY(coordinated with DevOps; separate short request doc available).echo "TODO: invoke agent ..."— needs to become a step using Anthropic's Claude Code Action (or equivalent) with the prompt from.github/claude-agent/run.mdand the bundled inputs.workflow_dispatchwithproduct=wordpress-seoand an explicitrc_tagto validate end-to-end before relying on the cron.Known caveats / TODOs before production
uses:step.Read,Grep,Glob,Edit,Write,Bash(git *),Bash(gh ...)) should be pinned once the Claude action is chosen.PRODUCTSdict in the workflow currently lists onlywordpress-seo. Adding a product = add slug + source repos + display name + tracking-issue var name here and create its tracking issue + variable.Rollout plan
wordpress-seoonly.wordpress-seo-premiumandwordpress-seo-local.wpseo-news,wpseo-video,wpseo-woocommerce,shopify-seo,duplicate-post. Each is a pure config addition (slug + repo + display name inAGENT_MAP.md, tracking issue created, repo variable set).🤖 Planning and artifact drafting assisted by Claude.