Update CLAUDE.md and add GitHub automation workflows

- Restructure CLAUDE.md with project leadership and clearer organization
- Add GitHub workflows for daily summaries and lead notifications
- Add issue template for rebase reminders
- Add hooks README for future git hook documentation

Closes #17

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
dlond 2025-08-20 20:16:35 +12:00 committed by Daniel Lond
parent 9c70d9a98f
commit ac77be6ede
5 changed files with 316 additions and 46 deletions

View file

@ -0,0 +1,33 @@
---
name: Rebase Reminder
about: Automated reminder to rebase active worktrees
title: '⚠️ Rebase Reminder: [PR NUMBER]'
labels: rebase-reminder, automated
assignees: ''
---
## Action Required
PR #[NUMBER] has been merged to main. Active worktrees should be rebased.
## Steps to Rebase
```bash
# Update main
cd ~/dev/projects/[PROJECT]
git fetch origin main
git pull origin main
# For each active worktree
cd ~/dev/worktrees/[PROJECT]/[WORKTREE]
git rebase origin/main
git push --force-with-lease
```
## Checklist
- [ ] Main branch updated
- [ ] Active worktrees identified
- [ ] Each worktree rebased
- [ ] Changes pushed with --force-with-lease
---
*This is an automated reminder. Close this issue once all worktrees are rebased.*

2
.github/hooks/README.md vendored Normal file
View file

@ -0,0 +1,2 @@
# GitHub Hooks
Place webhook processing scripts here

59
.github/workflows/daily-summary.yml vendored Normal file
View file

@ -0,0 +1,59 @@
name: Daily Activity Summary
on:
schedule:
- cron: '0 9 * * *' # 9 AM daily
workflow_dispatch: # Allow manual trigger
jobs:
generate-summary:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: read
steps:
- name: Generate Activity Summary
id: summary
run: |
echo "# 📊 Daily Activity Summary" > summary.md
echo "**Date**: $(date -u +"%Y-%m-%d")" >> summary.md
echo "**Repository**: ${{ github.repository }}" >> summary.md
echo "" >> summary.md
# Get open PRs
echo "## 🔄 Open Pull Requests" >> summary.md
gh pr list --repo ${{ github.repository }} --state open --limit 10 --json number,title,author,createdAt \
--jq '.[] | "- PR #\(.number): \(.title) by @\(.author.login)"' >> summary.md || echo "- None" >> summary.md
echo "" >> summary.md
# Get open issues
echo "## 📝 Open Issues" >> summary.md
gh issue list --repo ${{ github.repository }} --state open --limit 10 --json number,title,author,createdAt \
--jq '.[] | "- Issue #\(.number): \(.title) by @\(.author.login)"' >> summary.md || echo "- None" >> summary.md
echo "" >> summary.md
# Recent merges (last 24 hours)
echo "## ✅ Recently Merged (24h)" >> summary.md
gh pr list --repo ${{ github.repository }} --state merged --limit 5 --json number,title,mergedAt \
--jq '.[] | select(.mergedAt > (now - 86400 | strftime("%Y-%m-%dT%H:%M:%SZ"))) | "- PR #\(.number): \(.title)"' >> summary.md || echo "- None" >> summary.md
cat summary.md
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Summary Issue
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
run: |
# Close previous daily summaries
gh issue list --repo ${{ github.repository }} --label "daily-summary" --state open --json number \
--jq '.[].number' | xargs -I {} gh issue close {} --repo ${{ github.repository }} || true
# Create new summary
gh issue create \
--repo ${{ github.repository }} \
--title "📊 Daily Summary: $(date -u +"%Y-%m-%d")" \
--body-file summary.md \
--label "daily-summary,automated"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

128
.github/workflows/lead-notifications.yml vendored Normal file
View file

@ -0,0 +1,128 @@
name: Lead Notifications
on:
issues:
types: [opened, closed, reopened, assigned, unassigned]
pull_request:
types: [opened, closed, reopened, review_requested, ready_for_review, merged]
pull_request_review:
types: [submitted]
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
push:
branches: [main]
jobs:
notify-lead:
runs-on: ubuntu-latest
if: github.actor != 'github-actions[bot]' # Don't notify about bot actions
steps:
- name: Generate Summary
id: summary
run: |
# Determine event description
case "${{ github.event_name }}" in
"issues")
DESCRIPTION="Issue #${{ github.event.issue.number }}: ${{ github.event.action }}"
URL="${{ github.event.issue.html_url }}"
;;
"pull_request")
DESCRIPTION="PR #${{ github.event.pull_request.number }}: ${{ github.event.action }}"
URL="${{ github.event.pull_request.html_url }}"
;;
"pull_request_review")
DESCRIPTION="Review on PR #${{ github.event.pull_request.number }}"
URL="${{ github.event.review.html_url }}"
;;
"issue_comment")
DESCRIPTION="Comment on #${{ github.event.issue.number }}"
URL="${{ github.event.comment.html_url }}"
;;
"pull_request_review_comment")
DESCRIPTION="Review comment on PR #${{ github.event.pull_request.number }}"
URL="${{ github.event.comment.html_url }}"
;;
"push")
DESCRIPTION="Push to main by ${{ github.actor }}"
URL="${{ github.event.compare }}"
;;
*)
DESCRIPTION="${{ github.event_name }} by ${{ github.actor }}"
URL="${{ github.server_url }}/${{ github.repository }}"
;;
esac
echo "description=$DESCRIPTION" >> $GITHUB_OUTPUT
echo "url=$URL" >> $GITHUB_OUTPUT
- name: Create Desktop Notification (macOS)
if: runner.os == 'macOS'
run: |
osascript -e 'display notification "${{ steps.summary.outputs.description }}" with title "[${{ github.repository }}]" sound name "Glass"'
- name: Log Activity
run: |
echo "📢 Repository Activity:"
echo "Repository: ${{ github.repository }}"
echo "Event: ${{ github.event_name }}"
echo "Actor: ${{ github.actor }}"
echo "Description: ${{ steps.summary.outputs.description }}"
echo "URL: ${{ steps.summary.outputs.url }}"
echo "Time: $(date -u +"%Y-%m-%d %H:%M:%S UTC")"
# Optional: Post to Slack
# - name: Slack Notification
# if: github.event_name == 'pull_request' && github.event.action == 'opened'
# uses: slackapi/slack-github-action@v1
# with:
# payload: |
# {
# "text": "New PR in ${{ github.repository }}",
# "blocks": [{
# "type": "section",
# "text": {
# "type": "mrkdwn",
# "text": "🔔 *${{ steps.summary.outputs.description }}*\n<${{ steps.summary.outputs.url }}|View on GitHub>"
# }
# }]
# }
# env:
# SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
rebase-reminder:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
steps:
- name: Create Rebase Reminder Issue
run: |
gh issue create \
--repo ${{ github.repository }} \
--title "⚠️ Rebase Reminder: PR #${{ github.event.pull_request.number }} merged" \
--body "PR #${{ github.event.pull_request.number }} was merged to main.
Active worktrees should be rebased to avoid conflicts:
\`\`\`bash
# Update main
cd ~/dev/projects/$(basename ${{ github.repository }})
git fetch origin main
git pull origin main
# For each active worktree
cd ~/dev/worktrees/$(basename ${{ github.repository }})/<worktree-name>
git rebase origin/main
git push --force-with-lease
\`\`\`
**Merged PR**: ${{ github.event.pull_request.title }}
**Merged by**: ${{ github.event.pull_request.merged_by.login }}
**Link**: ${{ github.event.pull_request.html_url }}
This issue can be closed once all active worktrees have been rebased." \
--label "rebase-reminder,automated"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}