diff --git a/.github/workflows/claude-md-maintenance.yml b/.github/workflows/claude-md-maintenance.yml deleted file mode 100644 index 1b9de1b..0000000 --- a/.github/workflows/claude-md-maintenance.yml +++ /dev/null @@ -1,137 +0,0 @@ -name: Claude MD Maintenance (reusable) - -on: - workflow_dispatch: - workflow_call: - secrets: - ANTHROPIC_API_KEY: - required: true - -permissions: - contents: write - pull-requests: write - -jobs: - update-claude-md: - name: Generate / update CLAUDE.md - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 - with: - fetch-depth: 0 - - - name: Set up Node.js - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0 - with: - node-version: "24" - - - name: Install Claude Code CLI - run: npm install -g @anthropic-ai/claude-code - - - name: Generate CLAUDE.md - env: - ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} - CLAUDE_CODE_NON_INTERACTIVE: "1" - run: | - claude --dangerously-skip-permissions --verbose -p \ - "You are an AI assistant responsible for keeping CLAUDE.md accurate and up to date in this repository. - - ## Your Task - - 1. **Identify what changed.** Use git to find the files modified by the most recent merge or set of commits: - \`\`\` - git log --oneline -1 - git diff HEAD~1 HEAD --name-only - \`\`\` - Read the changed files directly to understand the actual impact — do not rely solely on commit messages or diff output. - - 2. **Update CLAUDE.md surgically.** - - If \`CLAUDE.md\` does **not** exist: generate it from scratch (see structure below). - - 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. - - 3. **Write the result to \`CLAUDE.md\`** in the repository root. - - ## CLAUDE.md Structure - - 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. - - \`\`\` - # CLAUDE.md - - ## Project Purpose - What this repository is for and its high-level goals. - - ## Repository Structure - Key directories and files with a brief description of each. - - ## Technology Stack - Languages, frameworks, and major dependencies. - - ## Build, Test & Run - Commands needed to install, build, test, and run the project locally. - - ## Conventions - Code style, branching strategy, commit format, naming conventions, and other project-specific rules. - - ## Key Notes for AI Assistants - Constraints, gotchas, or workflow-specific rules that an AI agent must know to avoid mistakes. - \`\`\` - - ## Guidelines - - - Be concise. Every line should earn its place. - - Do not add boilerplate, filler, or placeholder sections. - - Do not speculate about files you have not read — use the tools available to inspect actual content. - - When updating an existing CLAUDE.md, preserve sections that are still accurate. Only modify what the PR changes made outdated or incomplete. - - If the PR adds a new feature, dependency, or convention, add or extend the relevant section. - - If the PR removes something, delete the corresponding documentation." - - - name: Check for changes - id: diff - run: | - if git ls-files --others --exclude-standard CLAUDE.md | grep -q . || ! git diff --quiet CLAUDE.md 2>/dev/null; then - echo "changed=true" >> "$GITHUB_OUTPUT" - else - echo "changed=false" >> "$GITHUB_OUTPUT" - fi - - - name: Prepare branch name - if: steps.diff.outputs.changed == 'true' - id: branch - run: echo "name=chore/update-claude-md-$(date +%Y%m%d%H%M%S)" >> "$GITHUB_OUTPUT" - - - name: Commit CLAUDE.md - if: steps.diff.outputs.changed == 'true' - uses: apify/actions/signed-commit@v1.0.0 - with: - message: "docs: update CLAUDE.md [skip ci]" - add: CLAUDE.md - github-token: ${{ github.token }} - branch: ${{ steps.branch.outputs.name }} - create-branch: 'true' - - - name: Create PR with updated CLAUDE.md - if: steps.diff.outputs.changed == 'true' - id: create-pr - env: - GH_TOKEN: ${{ github.token }} - run: | - PR_URL=$(gh pr create \ - --title "docs: update CLAUDE.md" \ - --body "Automated update of CLAUDE.md generated by the Claude MD Maintenance workflow." \ - --base "${{ github.ref_name }}" \ - --head "${{ steps.branch.outputs.name }}") - echo "pr_url=$PR_URL" >> "$GITHUB_OUTPUT" - - - name: Assign PR and request review - if: steps.create-pr.outputs.pr_url != '' - continue-on-error: true - env: - GH_TOKEN: ${{ github.token }} - run: | - gh pr edit "${{ steps.create-pr.outputs.pr_url }}" \ - --add-assignee "${{ github.actor }}" - gh pr edit "${{ steps.create-pr.outputs.pr_url }}" \ - --add-reviewer "${{ github.actor }}"