-
Notifications
You must be signed in to change notification settings - Fork 905
ci(docs): add weekly docs update workflow #1365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+177
−2
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # Weekly Docs Update | ||
|
|
||
| Review recently merged PRs and update documentation to reflect any new features, changed behavior, or removed functionality. | ||
|
|
||
| ## Instructions | ||
|
|
||
| 1. **Find PRs merged in the last 7 days** | ||
| - Use `gh pr list --state merged --search "merged:>=$(date -d '7 days ago' +%Y-%m-%d)" --json number,title,body,url,mergedAt,files --limit 50` to get all recently merged PRs | ||
| - For each PR, read the title, body, and changed files to understand what changed | ||
|
|
||
| 2. **Read the current docs** | ||
| - Read `apps/docs/content/docs/meta.json` to understand the doc structure | ||
| - Read each existing doc page in `apps/docs/content/docs/` to understand current content | ||
|
|
||
| 3. **Identify docs that need updating** | ||
|
|
||
| For each merged PR, determine if it affects documentation by checking: | ||
|
|
||
| | Change Type | Docs Action | | ||
| |-------------|-------------| | ||
| | New user-facing feature | Add section to relevant doc page, or create new page if it's a major feature area | | ||
| | Changed behavior/UI | Update the relevant doc page to reflect new behavior | | ||
| | New keyboard shortcut | Update `keyboard-shortcuts.mdx` | | ||
| | New terminal feature | Update `terminal-integration.mdx` or `terminal-presets.mdx` | | ||
| | New MCP capability | Update `mcp.mdx` | | ||
| | New agent feature | Update `agent-integration.mdx` | | ||
| | New workspace feature | Update `workspaces.mdx` | | ||
| | Changed port behavior | Update `ports.mdx` | | ||
| | New setup/teardown script feature | Update `setup-teardown-scripts.mdx` | | ||
| | Diff viewer changes | Update `diff-viewer.mdx` | | ||
| | IDE integration changes | Update `use-with-ide.mdx` | | ||
| | Monorepo changes | Update `using-monorepos.mdx` | | ||
| | Customization changes | Update `customization.mdx` | | ||
| | Removed feature | Remove or update the relevant section | | ||
| | Internal-only change (CI, refactor, dev tooling) | **Skip** - no docs update needed | | ||
|
|
||
| 4. **Skip if nothing needs updating** | ||
| - If no merged PRs require documentation changes, make no edits and report that docs are up to date | ||
| - Do NOT make changes for the sake of making changes - only update docs when PRs genuinely introduced user-facing changes that aren't already documented | ||
|
|
||
| 5. **Make targeted edits** | ||
| - Edit existing doc files rather than rewriting them | ||
| - Match the writing style and formatting of the existing content | ||
| - Keep changes minimal and focused - only add/update what the PRs changed | ||
| - Preserve all existing content that is still accurate | ||
|
|
||
| 6. **Creating new doc pages** (rare - only for major new feature areas) | ||
| - Create at `apps/docs/content/docs/slug-name.mdx` | ||
| - Use this frontmatter format: | ||
| ```mdx | ||
| --- | ||
| title: Page Title | ||
| description: Brief description of what this page covers | ||
| --- | ||
| ``` | ||
| - Add the new page slug to `apps/docs/content/docs/meta.json` in the appropriate section | ||
| - Follow the style of existing pages - concise, scannable, focused on what users can do | ||
|
|
||
| 7. **Writing style** | ||
| - **Match existing tone** - The docs are concise and practical, not verbose | ||
| - **Lead with what the user can do** - Not implementation details | ||
| - **Use bullet points** for feature lists | ||
| - **Use headings** (##) to organize sections | ||
| - **Keep sentences short** - One idea per sentence | ||
| - **No fluff** - Skip filler words and marketing language | ||
|
|
||
| ## Existing doc pages for reference | ||
|
|
||
| Read these to match the format and style: | ||
| - `apps/docs/content/docs/overview.mdx` - Product overview | ||
| - `apps/docs/content/docs/terminal-integration.mdx` - Feature doc example | ||
| - `apps/docs/content/docs/keyboard-shortcuts.mdx` - Reference doc example | ||
|
|
||
| ## Output | ||
|
|
||
| Edit the relevant doc files. If no updates are needed, make no changes and report that documentation is already up to date. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| name: Update Docs | ||
|
|
||
| on: | ||
| schedule: | ||
| # Run every Wednesday at 9:00 AM UTC | ||
| - cron: "0 9 * * 3" | ||
| workflow_dispatch: # Allow manual triggering | ||
|
|
||
| jobs: | ||
| update-docs: | ||
| name: Update Docs | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: 1.3.3 | ||
|
|
||
| - name: Cache dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.bun/install/cache | ||
| key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }} | ||
|
|
||
| - name: Install dependencies | ||
| run: bun install --frozen | ||
|
|
||
| - name: Install Claude Code | ||
| run: npm install -g @anthropic-ai/claude-code | ||
|
|
||
| - name: Create branch | ||
| run: | | ||
| BRANCH_NAME="docs/update-$(date +%Y-%m-%d)-${GITHUB_RUN_ID}" | ||
| git checkout -B "$BRANCH_NAME" | ||
| echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV | ||
|
|
||
| - name: Update docs with Claude Code | ||
| env: | ||
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| claude -p "$(cat .github/prompts/update-docs.md)" --allowedTools "Bash(git*)" "Bash(gh*)" "Bash(date*)" "Bash(ls*)" "Read" "Write" "Edit" "Glob" "Grep" | ||
|
|
||
| - name: Check for changes | ||
| id: check-changes | ||
| run: | | ||
| if [ -n "$(git status --porcelain)" ]; then | ||
| echo "has_changes=true" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "has_changes=false" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Run lint fix | ||
| if: steps.check-changes.outputs.has_changes == 'true' | ||
| run: bun run lint:fix | ||
|
|
||
| - name: Commit and push changes | ||
| if: steps.check-changes.outputs.has_changes == 'true' | ||
| run: | | ||
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
| git config --local user.name "github-actions[bot]" | ||
| git add -A | ||
| git commit -m "docs: weekly docs update $(date +%Y-%m-%d)" | ||
| git push origin "$BRANCH_NAME" | ||
|
|
||
| - name: Create Pull Request | ||
| if: steps.check-changes.outputs.has_changes == 'true' | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| CURRENT_DATE=$(date +%Y-%m-%d) | ||
| gh pr create \ | ||
| --reviewer kitenite --reviewer saddlepaddle --reviewer AviPeltz \ | ||
| --title "docs: weekly docs update - $CURRENT_DATE" \ | ||
| --body "## Summary | ||
| This PR was automatically generated by Claude Code to update documentation based on recent PRs. | ||
|
|
||
| ## Details | ||
| - **Prompt file**: \`.github/prompts/update-docs.md\` | ||
| - **Generated on**: $CURRENT_DATE | ||
|
|
||
| ## Review Checklist | ||
| - [ ] Review all doc changes for accuracy | ||
| - [ ] Verify new content matches actual product behavior | ||
| - [ ] Check that no existing correct content was accidentally removed | ||
|
|
||
| Please review the changes before merging." \ | ||
| --base main \ | ||
| --head "$BRANCH_NAME" | ||
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.
Uh oh!
There was an error while loading. Please reload this page.