Skip to content

Commit 8fe53fc

Browse files
authored
fix: Update actions/checkout to v6 and enhance CLAUDE.md generation prompt (#246)
1 parent eb355ff commit 8fe53fc

File tree

2 files changed

+53
-54
lines changed

2 files changed

+53
-54
lines changed

.github/prompts/claude-md-system-prompt.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/claude-md-maintenance.yml

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
steps:
2020
- name: Checkout repository
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v6
2222
with:
2323
fetch-depth: 0
2424

@@ -35,8 +35,58 @@ jobs:
3535
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
3636
CLAUDE_CODE_NON_INTERACTIVE: "1"
3737
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."
4090
4191
- name: Check for changes
4292
id: diff

0 commit comments

Comments
 (0)