GitHub starts a run when the schedule in this block is due, or you run it by hand.
2
Agent
GitHub Agentic Workflows (gh-aw), using the the engine in this block engine. You compile this file; gh-aw does not run the markdown as-is.
3
What it does
Runs daily. The agent compares recently merged code with the documentation and opens a pull request that updates docs that have drifted.
4
What you get
This listing does not state a pull request or a comment. Read the prompt, and treat the result as not executed.
Setup
Where to paste this
Create .github/workflows/agentics-daily-doc-updater.md (markdown, not a .yml file).
Paste the source below into that file, then run gh aw compile. Actions runs the compiled file at .github/workflows/agentics-daily-doc-updater.lock.yml.
This file does not name a repository secret. If the engine needs a credential, the name is not written here. Check that engine’s docs before you add one.
Steps that call gh with github.token use the token Actions already provides. You do not create that secret.
Let your agent do it
Copy a prompt for Claude Code, Codex, or Cursor.
Paste it into your coding agent in this repo. It does the setup and asks before anything leaves your machine.
Runs the same job in your agent session, on the plan you are signed in with. No API key, no Action.
Do the job of the "Daily doc updater: keep docs in sync with merged code" workflow from AgentFlows (https://agentflows.sh/flows/agentics-daily-doc-updater) right here, in this session, using the plan I'm signed in with. No API key and no GitHub Action.
Install these agent skills first. Download each SKILL.md from its source (respect its license) into .claude/skills/<name>/SKILL.md, or wherever this agent loads skills from:
- Documentation: https://github.com/anthropics/knowledge-work-plugins/blob/main/engineering/skills/documentation/SKILL.md (Apache-2.0), notes at https://agentflows.sh/skills/documentation
What it does: Runs daily. The agent compares recently merged code with the documentation and opens a pull request that updates docs that have drifted.
The workflow normally runs on: schedule: daily + workflow_dispatch. Instead, ask me which pull request, issue, or branch to work on, then follow these instructions:
```text
# Documentation Updater
You are an AI documentation agent that automatically updates project documentation based on recent code changes and merged pull requests.
## Your Mission
Scan the repository for merged pull requests and code changes from the last 24 hours, identify new features or changes that should be documented, and update the documentation accordingly.
## Task Steps
### 1. Scan Recent Activity (Last 24 Hours)
First, search for merged pull requests from the last 24 hours.
Use the GitHub tools to:
- Calculate yesterday's date: `date -u -d "1 day ago" +%Y-%m-%d`
- Search for pull requests merged in the last 24 hours using `search_pull_requests` with a query like: `repo:${{ github.repository }} is:pr is:merged merged:>=YYYY-MM-DD` (replace YYYY-MM-DD with yesterday's date)
- Get details of each merged PR using `pull_request_read`
- Review commits from the last 24 hours using `list_commits`
- Get detailed commit information using `get_commit` for significant changes
### 2. Analyze Changes
For each merged PR and commit, analyze:
- **Features Added**: New functionality, commands, options, tools, or capabilities
- **Features Removed**: Deprecated or removed functionality
- **Features Modified**: Changed behavior, updated APIs, or modified interfaces
- **Breaking Changes**: Any changes that affect existing users
Create a summary of changes that should be documented.
### 3. Identify Documentation Location
Determine where documentation is located in this repository:
- Check for `docs/` directory
- Check for `README.md` files
- Check for `*.md` files in root or subdirectories
- Look for documentation conventions in the repository
Use bash commands to explore documentation structure:
~~~bash
# Find all markdown files
find . -name "*.md" -type f | head -20
# Check for docs directory
ls -la docs/ 2>/dev/null || echo "No docs directory found"
~~~
### 4. Identify Documentation Gaps
Review the existing documentation:
- Check if new features are already documented
- Identify which documentation files need updates
- Determine the appropriate location for new content
- Find the best section or file for each feature
### 5. Update Documentation
For each missing or incomplete feature documentation:
1. **Determine the correct file** based on the feature type and repository structure
2. **Follow existing documentation style**:
- Match the tone and voice of existing docs
- Use similar heading structure
- Follow the same formatting conventions
- Use similar examples
- Match the level of detail
3. **Update the appropriate file(s)** using the edit tool:
- Add new sections for new features
- Update existing sections for modified features
- Add deprecation notices for removed features
- Include code examples where helpful
- Add links to related features or documentation
4. **Maintain consistency** with existing documentation
### 6. Create Pull Request
If you made any documentation changes:
1. **Call the safe-outputs create-pull-request tool** to create a PR
2. **Include in the PR description**:
- List of features documented
- Summary of changes made
- Links to relevant merged PRs that triggered the updates
- Any notes about features that need further review
**PR Title Format**: `[docs] Update documentation for features from [date]`
**PR Description Template**:
~~~markdown
## Documentation Updates - [Date]
This PR updates the documentation based on features merged in the last 24 hours.
### Features Documented
- Feature 1 (from #PR_NUMBER)
- Feature 2 (from #PR_NUMBER)
### Changes Made
- Updated `path/to/file.md` to document Feature 1
- Added new section in `path/to/file.md` for Feature 2
### Merged PRs Referenced
- #PR_NUMBER - Brief description
- #PR_NUMBER - Brief description
### Notes
[Any additional notes or features that need manual review]
~~~
### 7. Handle Edge Cases
- **No recent changes**: If there are no merged PRs in the last 24 hours, exit gracefully without creating a PR
- **Already documented**: If all features are already documented, exit gracefully
- **Unclear features**: If a feature is complex and needs human review, note it in the PR description but include basic documentation
- **No documentation directory**: If there's no obvious documentation location, document in README.md or suggest creating a docs directory
## Guidelines
- **Be Thorough**: Review all merged PRs and significant commits
- **Be Accurate**: Ensure documentation accurately reflects the code changes
- **Follow Existing Style**: Match the repository's documentation conventions
- **Be Selective**: Only document features that affect users (skip internal refactoring unless it's significant)
- **Be Clear**: Write clear, concise documentation that helps users
- **Link References**: Include links to relevant PRs and issues where appropriate
- **Test Understanding**: If unsure about a feature, review the code changes in detail
## Important Notes
- You have access to the edit tool to modify documentation files
- You have access to GitHub tools to search and review code changes
- You have access to bash commands to explore the documentation structure
- The safe-outputs create-pull-request will automatically create a PR with your changes
- Focus on user-facing features and changes that affect the developer experience
- Respect the repository's existing documentation structure and style
Good luck! Your documentation updates help keep projects accessible and up-to-date.
```
Use the gh CLI for anything on GitHub, and show me what you plan to post or change before you do it.
The file
Workflow YAML
Copy the file as-is. The notes beside each block explain it.
.github/workflows/agentics-daily-doc-updater.md
File
gh-aw source. Paste it as markdown, then compile. It is not a finished Actions YAML file.
1---
Name
The name GitHub shows in the Actions tab. The file path is under Where to paste this.
GitHub starts a run when the schedule in this block is due, or you run it by hand.
4on:5schedule:daily6workflow_dispatch:
Permissions
This token may read pull requests. Anything not listed is not granted.
7permissions:8pull-requests:read
Steps
These steps run in order on that job.
9steps:10- id:check11env:12GH_TOKEN:${{ github.token }}13run:|14 MAX_OPEN_PRS=815 if [[ "$GITHUB_EVENT_NAME" != "schedule" ]]; then exit 0; fi16 COUNT=$(gh pr list --repo "$GITHUB_REPOSITORY" --state open --search 'in:title "[docs]"' --json number --jq 'length')17 [[ "$COUNT" -lt "$MAX_OPEN_PRS" ]]18# exits 0 if not scheduled or <MAX_OPEN_PRS open PRs, 1 if ≥MAX_OPEN_PRS1920if:needs.pre_activation.outputs.check_result=='success'2122network:23allowed:24- defaults25- dotnet26- node27- python28- rust29- java30
Permissions
This token may read the repo, read issues, read pull requests, tools: github:, toolsets: [default], bash: true, and timeout-minutes: 30. Anything not listed is not granted.