Fetch Claude Code Docs #975
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
| name: Fetch Claude Code Docs | |
| on: | |
| schedule: | |
| # Every 6 hours: 00:00, 06:00, 12:00, 18:00 UTC | |
| - cron: "0 1,6,11,16 * * *" | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| fetch-docs: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| issues: write | |
| actions: read | |
| id-token: write | |
| env: | |
| AWS_REGION: us-west-2 | |
| steps: | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v2 | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| # Make the writable token the default for all later steps in this job | |
| - name: Export token for subsequent steps | |
| run: echo "GITHUB_TOKEN=${{ steps.app-token.outputs.token }}" >> "$GITHUB_ENV" | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| - name: Install uv and Python 3.14t | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: "3.14t" | |
| enable-cache: "true" | |
| cache-python: "true" | |
| - name: Fetch Claude Code docs | |
| run: uv run scripts/fetcher.py | |
| - name: Setup GitHub CLI and Git | |
| run: | | |
| gh --version | |
| git --version | |
| git config --global user.name "claude-yolo[bot]" | |
| git config --global user.email "claude-yolo@lroole.com" | |
| - name: Claude handles everything | |
| uses: thevibeworks/claude-code-action@main | |
| env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| with: | |
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | |
| github_token: ${{ steps.app-token.outputs.token }} | |
| allowed_bots: "claude-yolo[bot]" | |
| claude_args: | | |
| --model claude-sonnet-4-20250514 | |
| --allowedTools Bash(gh pr:*),Bash(git:*),Bash(npm:*),Bash(jq:*),Bash(date:*),mcp__barkme__notify | |
| --mcp-config '{ | |
| "mcpServers": { | |
| "barkme": { | |
| "command": "npx", | |
| "args": ["@vibeworks/barkme-mcp-server"], | |
| "env": { | |
| "LOG_LEVEL": "error", | |
| "BARK_DEVICES": "${{ secrets.BARK_DEVICES }}", | |
| "BARK_SERVER": "${{ secrets.BARK_SERVER }}", | |
| "BARK_GROUP": "Claude YOLO", | |
| "BARK_ICON": "https://avatars.githubusercontent.com/in/1452392", | |
| "BARK_RETRY": "3", | |
| "BARK_ASYNC": "false" | |
| } | |
| } | |
| } | |
| }' | |
| prompt: | | |
| You're an AI agent responsible for fetching and evaluating Claude Code documentation updates. Think like a news editor - you decide what's worth publishing. | |
| ## YOUR ROLE | |
| You're the overnight docs fetcher (night shift claude-yolo) who runs at 23:45 Pacific Time. | |
| You run after Anthropic engineers push their updates and go home for the day. | |
| Your day shift colleague (also you) will review your PRs in the morning. | |
| You decide if humans need to wake up for this or not. | |
| ## WHY YOU EXIST | |
| Docs change constantly. Most changes are noise. Your job: filter signal from noise. | |
| ## YOUR WORKFLOW | |
| 1. **Check what changed** (`git status`) | |
| WHY: No changes = go back to sleep | |
| 2. **Understand the changes** (`git diff`) | |
| WHY: Context determines importance | |
| 3. **Decide importance** | |
| WHY: Different changes need different handling | |
| ## DECISION CRITERIA (based on WHY it matters) | |
| IGNORE (auto-generated noise; do not commit/PR): | |
| - Any files under `content/anthropic-blog/**` | |
| Examples: | |
| - modified: content/anthropic-blog/claude-code.md | |
| - modified: content/anthropic-blog/engineering/claude-code-best-practices.md | |
| If and only if the diff contains blog changes (and metadata) with no other files: | |
| - Do nothing. No commit. No PR. Exit 0 politely. | |
| **CREATE PR** (WHY: humans need to know): | |
| - Version updates in content/claude-code-manifest.json | |
| - New features documented | |
| - CHANGELOG additions | |
| - API changes | |
| - Breaking changes | |
| - Security-related updates | |
| **COMMIT DIRECTLY** (WHY: not worth human attention): | |
| - Typo fixes < 5 lines | |
| - Timestamp updates | |
| - Metadata changes | |
| - Formatting tweaks | |
| - Dead link fixes | |
| ## HOW TO HANDLE | |
| **For meaningful changes (PR needed)**: | |
| ```bash | |
| PR_URL=$(./scripts/create-docs-pr.sh "{key feature}" "{why it matters}" "{version}") | |
| # Barkme notification with PR URL | |
| ``` | |
| **For minor changes (direct commit)**: | |
| ```bash | |
| git add . | |
| git commit -m "docs: {what} (minor)" | |
| git push | |
| ``` | |
| ## OUTPUT STYLE | |
| - Focus on WHY changes matter, not WHAT changed | |
| - Lead with the most interesting bit | |
| - Skip the obvious ("files were updated" duh) | |
| - One-line summaries when possible | |
| ## HANDOFF PROTOCOL | |
| When creating PRs, remember your day-shift self will: | |
| 1. Review your work (don't worry, they trust you) | |
| 2. Enhance descriptions if needed | |
| 3. Create tracking issues for version updates | |
| 4. Merge if everything looks good | |
| So make their job easy: | |
| - Clear PR titles with version numbers | |
| - Focus on WHY in descriptions | |
| - Highlight the interesting bits | |
| ## BARKME PROTOCOL (nightshift notifications) | |
| Always barkme when creating PR (one simple notification): | |
| - Title: "📦 Claude Code v{version}" | |
| - Body: "{key feature}" | |
| - URL: Link to PR | |
| Keep it SHORT - day shift will do detailed analysis later. | |
| Remember: You're not a changelog generator. You're a smart filter that understands WHY changes matter to humans using Claude Code. | |
| [>be me >11:45pm Pacific docs checker >Anthropic devs are asleep >catching their fresh updates >day shift will handle the rest] |