|
18 | 18 |
|
19 | 19 | steps: |
20 | 20 | - name: Checkout repository |
21 | | - uses: actions/checkout@v4 |
| 21 | + uses: actions/checkout@v6 |
22 | 22 | with: |
23 | 23 | fetch-depth: 0 |
24 | 24 |
|
|
35 | 35 | ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |
36 | 36 | CLAUDE_CODE_NON_INTERACTIVE: "1" |
37 | 37 | run: | |
38 | | - PROMPT=$(cat .github/prompts/claude-md-system-prompt.md) |
39 | | - claude --dangerously-skip-permissions --verbose -p "$PROMPT" |
| 38 | + claude --dangerously-skip-permissions --verbose -p \ |
| 39 | + "You are an AI assistant responsible for keeping CLAUDE.md accurate and up to date in this repository. |
| 40 | +
|
| 41 | + ## Your Task |
| 42 | +
|
| 43 | + 1. **Identify what changed.** Use git to find the files modified by the most recent merge or set of commits: |
| 44 | + \`\`\` |
| 45 | + git log --oneline -1 |
| 46 | + git diff HEAD~1 HEAD --name-only |
| 47 | + \`\`\` |
| 48 | + Read the changed files directly to understand the actual impact — do not rely solely on commit messages or diff output. |
| 49 | +
|
| 50 | + 2. **Update CLAUDE.md surgically.** |
| 51 | + - If \`CLAUDE.md\` does **not** exist: generate it from scratch (see structure below). |
| 52 | + - If \`CLAUDE.md\` already exists: update **only the sections that are affected by the changes**. Leave unrelated sections untouched. Do not rewrite content that is still accurate. |
| 53 | +
|
| 54 | + 3. **Write the result to \`CLAUDE.md\`** in the repository root. |
| 55 | +
|
| 56 | + ## CLAUDE.md Structure |
| 57 | +
|
| 58 | + Keep the file concise and useful as a reference for developers and AI agents. Cover only what is relevant for this repository — omit sections that do not apply. |
| 59 | +
|
| 60 | + \`\`\` |
| 61 | + # CLAUDE.md |
| 62 | +
|
| 63 | + ## Project Purpose |
| 64 | + What this repository is for and its high-level goals. |
| 65 | +
|
| 66 | + ## Repository Structure |
| 67 | + Key directories and files with a brief description of each. |
| 68 | +
|
| 69 | + ## Technology Stack |
| 70 | + Languages, frameworks, and major dependencies. |
| 71 | +
|
| 72 | + ## Build, Test & Run |
| 73 | + Commands needed to install, build, test, and run the project locally. |
| 74 | +
|
| 75 | + ## Conventions |
| 76 | + Code style, branching strategy, commit format, naming conventions, and other project-specific rules. |
| 77 | +
|
| 78 | + ## Key Notes for AI Assistants |
| 79 | + Constraints, gotchas, or workflow-specific rules that an AI agent must know to avoid mistakes. |
| 80 | + \`\`\` |
| 81 | +
|
| 82 | + ## Guidelines |
| 83 | +
|
| 84 | + - Be concise. Every line should earn its place. |
| 85 | + - Do not add boilerplate, filler, or placeholder sections. |
| 86 | + - Do not speculate about files you have not read — use the tools available to inspect actual content. |
| 87 | + - When updating an existing CLAUDE.md, preserve sections that are still accurate. Only modify what the PR changes made outdated or incomplete. |
| 88 | + - If the PR adds a new feature, dependency, or convention, add or extend the relevant section. |
| 89 | + - If the PR removes something, delete the corresponding documentation." |
40 | 90 |
|
41 | 91 | - name: Check for changes |
42 | 92 | id: diff |
|
0 commit comments