Weekly Maintenance Report #2
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: Weekly Maintenance Report | |
| # Performs weekly repository health audit and creates a maintenance report issue | |
| # Checks: TODO comments, version consistency, stale issues, open PRs, documentation, plugin structure | |
| on: | |
| schedule: | |
| - cron: "0 9 * * 1" # Monday 9:00 UTC | |
| workflow_dispatch: # Manual trigger for testing | |
| # Prevent multiple maintenance reports from running simultaneously | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| maintenance-report: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| issues: write | |
| id-token: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 1 | |
| - name: Generate maintenance report | |
| uses: anthropics/claude-code-action@6337623ebba10cf8c8214b507993f8062fd4ccfb # v1.0.22 | |
| with: | |
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | |
| prompt: | | |
| Perform a weekly maintenance audit of this repository and create a GitHub issue with the report. | |
| ## Repository Info | |
| - Repository: ${{ github.repository }} | |
| - Run URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| ## Checks to Perform | |
| ### 1. TODO Comments | |
| Search for TODO, FIXME, HACK, XXX comments in the codebase: | |
| - Use Grep to find all occurrences | |
| - Report file, line number, and comment content | |
| - Count total | |
| ### 2. Version Consistency | |
| Check that all version files match: | |
| - `plugins/plugin-dev/.claude-plugin/plugin.json` (source of truth) | |
| - `.claude-plugin/marketplace.json` (both metadata.version and plugins[0].version) | |
| Note: Skills do NOT have a version field (version is optional for skills and not used in this plugin). | |
| Read each file and extract the version. Report if any mismatch. | |
| ### 3. Stale Issues | |
| Find issues with no activity in the last 30 days: | |
| ```bash | |
| gh issue list --state open --json number,title,updatedAt --jq '[.[] | select((now - (.updatedAt | fromdateiso8601)) > (30 * 24 * 60 * 60))]' | |
| ``` | |
| Count and list the top 5 oldest. | |
| ### 4. Open PRs | |
| Find PRs that have been open for more than 7 days: | |
| ```bash | |
| gh pr list --state open --json number,title,createdAt --jq '[.[] | select((now - (.createdAt | fromdateiso8601)) > (7 * 24 * 60 * 60))]' | |
| ``` | |
| Count and list any found. | |
| ### 5. Documentation Freshness | |
| - Check if README.md mentions the current version | |
| - Check when CLAUDE.md was last modified (via git log) | |
| ### 6. Plugin Structure | |
| Check for draft files that shouldn't be in production directories: | |
| - Search for `*-SUGGESTED.md`, `*-BACKUP.md`, `*-OLD.md` in plugin directories | |
| - Report any found | |
| ## Report Format | |
| Create a markdown report with this structure: | |
| ```markdown | |
| # Weekly Maintenance Report - {YYYY-MM-DD} | |
| ## Summary | |
| | Check | Status | Details | | |
| |-------|--------|---------| | |
| | TODO Comments | {emoji} | {count} found | | |
| | Version Consistency | {emoji} | {status} | | |
| | Stale Issues | {emoji} | {count} issues >30 days | | |
| | Open PRs | {emoji} | {count} PRs >7 days | | |
| | Documentation | {emoji} | {status} | | |
| | Plugin Structure | {emoji} | {status} | | |
| ## Action Items | |
| ### {Section for each check that needs attention} | |
| {Details of what needs to be addressed} | |
| ## No Action Needed | |
| {List checks that passed} | |
| --- | |
| *Generated by [Weekly Maintenance workflow]({run_url})* | |
| ``` | |
| Use these status indicators: | |
| - Pass: checkmark emoji | |
| - Warning (minor issues): warning emoji | |
| - Fail (needs attention): x emoji | |
| ## Create the Issue | |
| After generating the report, create a GitHub issue: | |
| ```bash | |
| gh issue create \ | |
| --title "Weekly Maintenance Report - $(date +%Y-%m-%d)" \ | |
| --label "automation,maintenance" \ | |
| --body "{report_content}" | |
| ``` | |
| If the `maintenance` label doesn't exist, just use `automation`. | |
| ## Important Notes | |
| - Be thorough but concise in the report | |
| - Prioritize actionable findings | |
| - If a check has no issues, still mention it passed | |
| - Use the exact run URL provided above in the footer | |
| claude_args: | | |
| --allowedTools "Read,Glob,Grep,Bash(gh issue:*),Bash(gh pr list:*),Bash(git log:*),Bash(date:*)" |