Skip to content

Automation to keep llm.txt file up to date #2135

@sandijean90

Description

@sandijean90

Is your feature request related to a problem? Please describe.
A custom llm.txt file is currently updated manually, which creates a risk of it drifting out of sync with the actual documentation. We need an automated process to keep it up to date whenever the docs/ folder changes.

Proposed solution:
A GitHub Action that triggers on any push that modifies docs/** and runs the following pipeline:

1. Detect what changed
Use git diff to identify which files in docs/ were added, modified, or removed in the latest commit.

2. Build the LLM prompt
Assemble a prompt containing:

  • The current contents of llm.txt
  • The diff of changed files
  • Instructions to update llm.txt only if the documentation changes warrant it, preserving existing style and format

3. Call the LLM API
Send the prompt to the LLM and request a structured JSON response: { "needs_update": true/false, "updated_content": "..." }

4. Parse the response

  • If needs_update: true → overwrite llm.txt with the new content
  • If needs_update: false → exit cleanly with no changes

5. Commit and log the result
If llm.txt was updated, automatically commit and push it back to the repo with a descriptive commit message (e.g. chore: update llm.txt to reflect docs changes).

Rollout strategy:

  • Phase 1: Set up the action with a manual trigger (workflow_dispatch) so the team can test and validate the output before enabling automation
  • Phase 2: Once validated, add a PR trigger so the action runs automatically on any PR that touches docs/**

Acceptance criteria:

  • GitHub Action triggers only when files under docs/ are changed
  • llm.txt is updated automatically when relevant docs change
  • llm.txt is left untouched when changes are not significant
  • Updates are committed back to the repo with a clear commit message
  • The action fails gracefully if the API call fails (no broken commits)

Blockers:

  • A shared API key must be created and stored as a GitHub Secret (e.g. LLM_AUTOMATION_API_KEY) before this action can run. This key is configured once at the repo/org level and is never exposed to individual team members.

Metadata

Metadata

Assignees

Labels

docsImprovements or additions to documentationenhancementNew feature or request

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions