Skip to content

Add docs-frontmatter-sweep agentic workflow - #123

Merged
theletterf merged 1 commit into
mainfrom
docs-frontmatter-sweep
May 5, 2026
Merged

theletterf merged 1 commit into
mainfrom
docs-frontmatter-sweep

Conversation

@theletterf

@theletterf theletterf commented May 5, 2026 •

Copy link
Copy Markdown
Member

Summary

  • New scheduled / on-demand sweep that audits frontmatter quality across a docs corpus on a deterministic rotating slice each run.
  • Combines two existing skills: docs-frontmatter-audit (required-field validation) and docs-frontmatter-description (SEO-quality descriptions).
  • Emits a single labeled fix-issue (docs-fix:frontmatter) with structured YAML findings consumable by a future fix-agent.
  • Establishes the sweep pattern (rotation + recently-changed pass + scope-copy + structured fix-issue) reused by the follow-up sweeps in the stacked PRs.

This is the foundational PR of three. The next stacked PR adds applies-to / openings / style / typos sweeps + the docs-quality-sweep orchestrator; the third stacked PR adds staleness and coherence sweeps.

Implements phase 3 of elastic/docs-content-internal#949.

Where this is meant to run

  • Workflow runs in elastic/docs-content-internal (or whichever repo you want fix-issues to land in).
  • Sweep audits a different repo specified via the source-repo input — defaults to elastic/docs-content in the trigger template.
  • Fix-issues are filed in the calling repo via the auto-provided GITHUB_TOKEN. No cross-repo PAT, no extra secret.
  • Only secret needed: COPILOT_GITHUB_TOKEN, which already exists in docs-content-internal for the existing docs-issue-scope / docs-triage installs.

Test plan

  • make compile passes with 0 errors / 0 warnings.
  • make lint passes (no new files trigger pre-commit hooks).
  • Manual workflow_dispatch run from a sandbox internal repo against a small public repo via source-repo=... — confirm the rotating slice + recently-changed selection works.
  • When findings exist: confirm the YAML block in the fix-issue body parses cleanly (yq smoke test) and file / line / evidence are accurate for 2-3 sampled findings.
  • Confirm the issue is filed in the calling repo (not in source-repo).
  • Confirm close-older-issues: true closes the prior fix-issue on a second run.

🤖 Generated with Claude Code

@theletterf
theletterf requested a review from a team as a code owner May 5, 2026 07:52
@theletterf
theletterf requested a review from Mpdreamz May 5, 2026 07:52
@theletterf theletterf self-assigned this May 5, 2026
@theletterf theletterf added the enhancement New feature or request label May 5, 2026
New scheduled / on-demand sweep that audits frontmatter quality across a
docs corpus on a rotating slice each run. Combines two existing skills
(`docs-frontmatter-audit` for required-field validation and
`docs-frontmatter-description` for SEO-quality descriptions) and emits a
single labeled fix-issue with structured YAML findings consumable by a
future fix-agent.

Establishes the sweep pattern shared by the rest of this family:

- Deterministic rotating slice via `hash(path) mod N == iso_week mod N`,
  with `N` auto-derived from corpus size.
- Pages modified in the last 7 days included regardless of rotation.
- Slice files copied to `/tmp/gh-aw/sweep-data/scope/` so skills can
  operate without affecting the repo.
- Fix-issues filed cross-repo to `elastic/docs-content-internal` (via
  `safe-outputs.create-issue.target-repo`) to keep AI triage findings
  out of public docs repos. Consumers must configure
  `DOCS_FIX_ISSUES_TOKEN` with `issues:write` on the internal repo.
- `close-older-issues: true` keeps the tracker clean across runs.

Part of phase 3 of elastic/docs-content-internal#949.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@theletterf
theletterf force-pushed the docs-frontmatter-sweep branch from bc64d2e to 96aa8bc Compare May 5, 2026 08:13
@theletterf theletterf mentioned this pull request May 5, 2026
8 tasks
@theletterf
theletterf merged commit 167c30e into main May 5, 2026
3 checks passed
@theletterf
theletterf deleted the docs-frontmatter-sweep branch May 5, 2026 08:50
theletterf added a commit that referenced this pull request May 5, 2026
Every APM-importing reusable workflow in this repo currently caches its
skill bundle under the constant key `apm-copilot-` when called from
elastic/docs-content. The cache key formula
`apm-${engine}-${hashFiles('.github/workflows/*.lock.yml')}` is evaluated
in the caller's workspace, which has no lock files — so the hash segment
is empty for every workflow.

While only docs-review used APM this was benign. Once the sweeps landed
(#123-#125), every additional workflow with a different `packages:` list
started overwriting the same cache slot. The next workflow to run hit
the previous one's bundle and got `Skill not found` for the skills it
actually imports — with the agent ultimately falling back to manual
analysis ("All skills are unavailable. I'll review the changes using my
own judgment now.").

Workaround: align every APM-importing workflow's `packages:` to the
union of all skills used across the repo, so all five workflows pack
the same bundle and cache collisions are no-ops. Adds a small per-run
download cost (each workflow pulls all seven skills, uses one or two)
but restores correctness.

Filed upstream as github/gh-aw#30365 — when fixed there, we can revert
each workflow's `packages:` back to its minimum set.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
theletterf added a commit that referenced this pull request May 5, 2026
Every APM-importing reusable workflow in this repo currently caches its
skill bundle under the constant key `apm-copilot-` when called from
elastic/docs-content. The cache key formula
`apm-${engine}-${hashFiles('.github/workflows/*.lock.yml')}` is evaluated
in the caller's workspace, which has no lock files — so the hash segment
is empty for every workflow.

While only docs-review used APM this was benign. Once the sweeps landed
(#123-#125), every additional workflow with a different `packages:` list
started overwriting the same cache slot. The next workflow to run hit
the previous one's bundle and got `Skill not found` for the skills it
actually imports — with the agent ultimately falling back to manual
analysis ("All skills are unavailable. I'll review the changes using my
own judgment now.").

Workaround: align every APM-importing workflow's `packages:` to the
union of all skills used across the repo, so all five workflows pack
the same bundle and cache collisions are no-ops. Adds a small per-run
download cost (each workflow pulls all seven skills, uses one or two)
but restores correctness.

Filed upstream as github/gh-aw#30365 — when fixed there, we can revert
each workflow's `packages:` back to its minimum set.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
theletterf added a commit that referenced this pull request May 5, 2026
* Pack identical APM skill bundle across all reusable workflows

Every APM-importing reusable workflow in this repo currently caches its
skill bundle under the constant key `apm-copilot-` when called from
elastic/docs-content. The cache key formula
`apm-${engine}-${hashFiles('.github/workflows/*.lock.yml')}` is evaluated
in the caller's workspace, which has no lock files — so the hash segment
is empty for every workflow.

While only docs-review used APM this was benign. Once the sweeps landed
(#123-#125), every additional workflow with a different `packages:` list
started overwriting the same cache slot. The next workflow to run hit
the previous one's bundle and got `Skill not found` for the skills it
actually imports — with the agent ultimately falling back to manual
analysis ("All skills are unavailable. I'll review the changes using my
own judgment now.").

Workaround: align every APM-importing workflow's `packages:` to the
union of all skills used across the repo, so all five workflows pack
the same bundle and cache collisions are no-ops. Adds a small per-run
download cost (each workflow pulls all seven skills, uses one or two)
but restores correctness.

Filed upstream as github/gh-aw#30365 — when fixed there, we can revert
each workflow's `packages:` back to its minimum set.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* Make docs agent workflows autonomous

Embed the docs review and sweep rules directly in the agent prompts so the workflows no longer depend on runtime Elastic Docs Skills, while keeping Elastic docs MCP as the bounded source for published-doc verification.

Co-authored-by: OpenAI GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>

* Run Vale before docs review

Add deterministic Vale output to the docs-review workflow so style findings are grounded in elastic/vale-rules instead of runtime skills or model-only judgment.

Co-authored-by: OpenAI GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>

* Carry over docs skill review guidance

Embed the high-value style, jargon, frontmatter, content-type, applies_to, and page-opening guidance from Elastic Docs Skills into the autonomous workflow prompts while keeping Vale and MCP as evidence sources.

Co-authored-by: OpenAI GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Co-authored-by: OpenAI GPT-5.5 <[email protected]>
Co-authored-by: Cursor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant