Skip to content

feat(docs): add LLM-driven narrative doc sync pipeline#20

Open
dylandepass wants to merge 2 commits into
mainfrom
llm-doc-sync
Open

feat(docs): add LLM-driven narrative doc sync pipeline#20
dylandepass wants to merge 2 commits into
mainfrom
llm-doc-sync

Conversation

@dylandepass

Copy link
Copy Markdown
Contributor

When a source repo (e.g. helix-commerce-api) merges to main, the new llm-doc-sync workflow computes diffs since each doc's lastReviewedCommit, sends them to GPT-5.6 Terra along with the current doc and style guide, and opens a PR with the drafted updates.

What's included

  • scripts/docs/llm-sync.mjs — Core sync script: scans docs/*.md frontmatter, computes filtered diffs (excludes tests, CI, lock files), calls the OpenAI API, writes updated docs
  • .github/workflows/llm-doc-sync.yaml — GitHub Actions workflow triggered by repository_dispatch (from source repos) or workflow_dispatch (manual). Checks out both repos, runs the sync, opens a PR labeled ai-authored
  • scripts/docs/README.md — Updated with LLM doc sync documentation, local run instructions, and env var reference

How it works

  1. Source repo fires a repository_dispatch event on merge to main
  2. Workflow identifies affected docs via sources frontmatter mapping
  3. Computes git diff lastReviewedCommit..HEAD (filtered to non-test code)
  4. Sends diff + current doc + CLAUDE.md style guide to GPT-5.6 Terra
  5. Opens a PR with the LLM-drafted updates for human review

Still needed (separate PRs)

  • Dispatch trigger added to each source repo's release workflow
  • SOURCE_REPOS_TOKEN and OPENAI_API_KEY secrets on this repo

When a source repo (e.g. helix-commerce-api) merges to main, the new llm-doc-sync workflow computes diffs since each doc's lastReviewedCommit, sends them to GPT-5.6 Terra along with the current doc and style guide, and opens a PR with the drafted updates. Includes the sync script, GitHub Actions workflow (repository_dispatch + workflow_dispatch), and README documentation.
@aem-code-sync

aem-code-sync Bot commented Jul 17, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

Replaces the SOURCE_REPOS_TOKEN PAT with a short-lived token minted from the Helix Commerce Review Bot GitHub App via create-github-app-token.
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.

1 participant