{"id":31765112,"url":"https://github.com/jamiew/clactions","last_synced_at":"2025-10-15T05:52:59.957Z","repository":{"id":318705831,"uuid":"1072152031","full_name":"jamiew/clactions","owner":"jamiew","description":"Adventures in Claude + GitHub Actions automations. Update websites, scrape data, respond to webhooks, plus self-repair and autonomous improve code or even the Claude setup itself","archived":false,"fork":false,"pushed_at":"2025-10-09T13:03:51.000Z","size":290,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-09T14:01:48.188Z","etag":null,"topics":["agents","automation","claude","github-actions"],"latest_commit_sha":null,"homepage":"https://jamiew.github.io/clactions/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamiew.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-08T10:29:38.000Z","updated_at":"2025-10-09T13:03:55.000Z","dependencies_parsed_at":"2025-10-09T14:01:52.606Z","dependency_job_id":"e4182ba2-718a-4dc3-8da7-53bfa3de500d","html_url":"https://github.com/jamiew/clactions","commit_stats":null,"previous_names":["jamiew/clactions"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/jamiew/clactions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiew%2Fclactions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiew%2Fclactions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiew%2Fclactions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiew%2Fclactions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamiew","download_url":"https://codeload.github.com/jamiew/clactions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiew%2Fclactions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005718,"owners_count":26083948,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","automation","claude","github-actions"],"created_at":"2025-10-10T00:13:17.613Z","updated_at":"2025-10-12T02:01:40.673Z","avatar_url":"https://github.com/jamiew.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Claude GitHub Actions Playground\n\nExperimental sandbox for combining Claude Code with GitHub Actions. Claude fetches data, updates websites, creates PRs, reviews code, and attempts to fix its own failures.\n\n## What This Tests\n\nThis repo explores autonomous AI infrastructure across five categories:\n1. **Data Fetchers \u0026 Scrapers** - Claude fetches external data and updates the website\n2. **Autonomous Development** - Claude modifies the codebase, triages issues, and implements tasks\n3. **Self-Improvement \u0026 Meta** - Claude improves its own setup and fixes its own failures\n4. **Webhooks \u0026 External Triggers** - External services can trigger Claude workflows\n5. **Build \u0026 Deploy** - Website generation and deployment automation\n\nAdditionally, Claude Code's built-in features are installed via `/install-github-app`:\n- **@claude mentions in issues** - Comment `@claude` to get implementation PRs\n- **Code Review** - Claude reviews all PRs automatically\n\n**12 of 17 documented workflows** use Claude Code for decision-making and implementation.\n\n## Workflows\n\n### Data Fetchers \u0026 Scrapers\nClaude fetches external data and updates data used to generate the website.\n\n| Workflow | Prompt for Claude | Triggers | Uses Claude | Commits | Opens Issues | Opens PRs |\n|----------|-------------------|----------|-------------|---------|--------------|-----------|\n| [nytimes-headlines.yml](.github/workflows/nytimes-headlines.yml) | Parse NYT RSS feed → `data/nytimes.json` | Daily (9am UTC) | ✅ | ✅ | ❌ | ❌ |\n| [glif-top-content.yml](.github/workflows/glif-top-content.yml) | Fetch Glif featured content → `data/glif.json` | Daily (10am UTC) | ✅ | ✅ | ❌ | ❌ |\n| [weather-data.yml](.github/workflows/weather-data.yml) | Fetch NYC weather → `data/weather.json` | Daily (8am UTC) | ✅ | ✅ | ❌ | ❌ |\n| [crypto-prices.yml](.github/workflows/crypto-prices.yml) | Fetch BTC/ETH/SOL/HNT prices via **CoinGecko MCP server** → `data/crypto-prices.json` | Daily (11am UTC) | ✅ | ✅ | ❌ | ❌ |\n| [rhizome-community.yml](.github/workflows/rhizome-community.yml) | Scrape Rhizome.org community → `data/rhizome.json` | Every 6h | ✅ | ✅ | ❌ | ❌ |\n\n### Autonomous Development\nClaude modifies its own codebase and implements tasks.\n\n| Workflow | Prompt for Claude | Triggers | Uses Claude | Commits | Opens Issues | Opens PRs |\n|----------|-------------------|----------|-------------|---------|--------------|-----------|\n| [claude.yml](.github/workflows/claude.yml) | Respond to @claude mentions in issues/PRs → implement requests | @claude mention | ✅ | ✅ | ❌ | ✅ |\n| [todo-worker.yml](.github/workflows/todo-worker.yml) | Read TODO.md → pick task → implement via PR | Every 8h | ✅ | ❌ | ❌ | ✅ |\n| [issue-triage.yml](.github/workflows/issue-triage.yml) | Analyze issue → apply labels → ask clarifying questions | On issue open | ✅ | ❌ | ❌ | ❌ |\n| [claude-code-review.yml](.github/workflows/claude-code-review.yml) | Review PRs and provide feedback | On PR open/update | ✅ | ❌ | ❌ | ❌ |\n| [cross-repo-notify.yml](.github/workflows/cross-repo-notify.yml) | Detect workflow changes → create issue in external repo | Every 8h | ❌ | ❌ | ✅ (external) | ❌ |\n| [auto-merge.yml](.github/workflows/auto-merge.yml) | Auto-merge approved Claude PRs | On PR review/checks | ❌ | ❌ | ❌ | ❌ |\n\n### Self-Improvement \u0026 Meta\nClaude improves its own setup and fixes its own failures.\n\n| Workflow | Prompt for Claude | Triggers | Uses Claude | Commits | Opens Issues | Opens PRs |\n|----------|-------------------|----------|-------------|---------|--------------|-----------|\n| [self-repair.yml](.github/workflows/self-repair.yml) | Read failure logs → diagnose → fix (commit or PR) | Every 6h + on failures | ✅ | ✅ | ✅ | ✅ |\n| [self-improver.yml](.github/workflows/self-improver.yml) | Analyze changes → improve CLAUDE.md \u0026 Claude Code setup via PR | On PR merge/issue activity | ✅ | ❌ | ❌ | ✅ |\n| [update-docs.yml](.github/workflows/update-docs.yml) | Generate workflow docs → create docs/*.md \u0026 data/docs.json | Weekly (Sunday) | ✅ | ✅ | ❌ | ❌ |\n\n### Webhooks \u0026 External Triggers\nExternal services can trigger workflows via GitHub's `repository_dispatch` API.\n\n| Workflow | Prompt for Claude | Triggers | Uses Claude | Commits | Opens Issues | Opens PRs |\n|----------|-------------------|----------|-------------|---------|--------------|-----------|\n| [webhook-demo.yml](.github/workflows/webhook-demo.yml) | Echo webhook payload for testing | webhook (`repository_dispatch`) | ❌ | ❌ | ❌ | ❌ |\n\n### Build \u0026 Deploy\nWebsite generation and deployment automation.\n\n| Workflow | Prompt for Claude | Triggers | Uses Claude | Commits | Opens Issues | Opens PRs |\n|----------|-------------------|----------|-------------|---------|--------------|-----------|\n| [adaptive-theme.yml](.github/workflows/adaptive-theme.yml) | Generate CSS based on time/season/weather from `data/weather.json` → `theme-nyc.css` | Daily (noon UTC) | ✅ | ✅ | ❌ | ❌ |\n| [update-website.yml](.github/workflows/update-website.yml) | Build website from data files → deploy to Pages | Daily (1pm UTC) + on data changes | ❌ | ❌ | ❌ | ❌ |\n\n## How It Works\n\nThe system operates through several categories of workflows that work together:\n\n### Data Collection\n- `nytimes-headlines.yml`, `weather-data.yml`, `crypto-prices.yml`, etc. fetch external data\n- All commit directly to main → trigger website rebuild\n\n### Build \u0026 Theming\n- `adaptive-theme.yml` generates CSS based on time/season/weather from `data/weather.json`\n- `update-website.yml` builds and deploys the static site to GitHub Pages\n- Runs after data updates to keep site current\n\n### Development Automation\n- `claude.yml` responds to @claude mentions in issues/PRs to implement user requests\n- `todo-worker.yml` implements tasks from TODO.md via PRs\n- `issue-triage.yml` analyzes and labels new issues\n- `auto-merge.yml` merges approved Claude PRs automatically\n\n### Self-Improvement \u0026 Meta\nThese workflows improve the system itself:\n\n**[self-repair.yml](.github/workflows/self-repair.yml)** - Autonomous error recovery:\n1. Detects workflow failures\n2. Analyzes logs and identifies root cause\n3. Implements fix (commit or PR based on complexity)\n4. Re-runs the failed workflow\n5. Runs every 6 hours to catch stragglers\n\n**[self-improver.yml](.github/workflows/self-improver.yml)** - Claude Code setup optimization:\n- Analyzes merged PRs and issue discussions\n- Improves CLAUDE.md, slash commands, subagent docs\n- Acts when users say \"update Claude rules\", \"DRY this up\", etc.\n- Creates PRs with setup improvements\n\n**[update-docs.yml](.github/workflows/update-docs.yml)** - Documentation generation:\n- Creates `docs/*.md` for each workflow\n- Generates `data/docs.json` metadata\n- Runs weekly, commits directly to main\n- Website includes these docs automatically\n\n**Trigger self-repair manually:**\n```bash\ngh workflow run self-repair.yml\n# Or debug directly\n./scripts/debug-workflows.sh\n```\n\n**Success rate:** Variable. Claude can fix simple issues (missing files, permission errors, API changes) but struggles with complex logic bugs.\n\n## Workflow Commands\n\nManage workflows with `gh`:\n\n```bash\n# List all workflows\ngh workflow list\n\n# Run a workflow\ngh workflow run nytimes-headlines.yml\ngh workflow run todo-worker.yml -f mode=plan\n\n# Watch runs in real-time\ngh run watch\n\n# List recent runs\ngh run list --limit 20\n\n# View specific run\ngh run view \u003crun-id\u003e\ngh run view \u003crun-id\u003e --log\ngh run view \u003crun-id\u003e --log-failed\n\n# Re-run failed workflow\ngh run rerun \u003crun-id\u003e\n```\n\nExample: Manually trigger NY Times headlines:\n```bash\ngh workflow run nytimes-headlines.yml \u0026\u0026 gh run watch\n```\n\n## Webhook Triggers\n\nThe `webhook-demo.yml` workflow can be triggered via external webhooks using GitHub's `repository_dispatch` API.\n\n### Generating a GitHub Token\n\nYou need a GitHub Personal Access Token to trigger workflows via webhook.\n\n**Option 1: Fine-Grained Token (Recommended)**\n\n1. Go to https://github.com/settings/tokens?type=beta\n2. Click **\"Generate new token\"**\n3. Configure the token:\n   - **Token name**: `webhook-trigger` (or whatever you prefer)\n   - **Expiration**: Choose duration (90 days, 1 year, custom, or no expiration)\n   - **Repository access**: Select **\"Only select repositories\"** → Choose your repo\n   - **Permissions** → Repository permissions:\n     - **Administration**: **Read and write** ✅\n4. Click **\"Generate token\"**\n5. **Copy the token immediately** (you won't see it again!)\n\n**Option 2: Classic Token**\n\n1. Go to https://github.com/settings/tokens\n2. Click **\"Generate new token (classic)\"**\n3. Configure the token:\n   - **Note**: `webhook-trigger`\n   - **Expiration**: Choose duration\n   - **Scopes**: Check **`repo`** (Full control of private repositories) ✅\n4. Click **\"Generate token\"**\n5. **Copy the token immediately**\n\n**Security Notes:**\n- Store the token securely (password manager, environment variable)\n- Never commit it to git\n- Treat it like a password\n- Use fine-grained tokens for better security (limited scope)\n- Set expiration dates and rotate tokens regularly\n\n### Using the Webhook\n\n**Endpoint:**\n```\nPOST https://api.github.com/repos/jamiew/claude-gha-demo/dispatches\n```\n\n**Headers:**\n```\nAccept: application/vnd.github+json\nAuthorization: Bearer YOUR_GITHUB_TOKEN\n```\n\n**Payload:**\n```json\n{\n  \"event_type\": \"custom-webhook-event\",\n  \"client_payload\": {\n    \"message\": \"Your custom message\",\n    \"action\": \"deploy\",\n    \"data\": {\n      \"key\": \"value\"\n    }\n  }\n}\n```\n\n**Trigger with curl:**\n```bash\n# Replace ghp_xxxxxxxxxxxx with your actual token\ncurl -X POST \\\n  -H \"Accept: application/vnd.github+json\" \\\n  -H \"Authorization: Bearer ghp_xxxxxxxxxxxx\" \\\n  https://api.github.com/repos/jamiew/claude-gha-demo/dispatches \\\n  -d '{\"event_type\":\"custom-webhook-event\",\"client_payload\":{\"message\":\"Hello from webhook!\"}}'\n```\n\n**Trigger with gh CLI (easiest):**\n```bash\n# gh CLI uses your authenticated session automatically\ngh api repos/jamiew/claude-gha-demo/dispatches \\\n  -f event_type=custom-webhook-event \\\n  -f client_payload[message]=\"Hello from webhook\" \\\n  -f client_payload[action]=\"deploy\"\n```\n\n**Using environment variable:**\n```bash\n# Set token once\nexport GITHUB_TOKEN=ghp_xxxxxxxxxxxx\n\n# Then use it\ncurl -X POST \\\n  -H \"Accept: application/vnd.github+json\" \\\n  -H \"Authorization: Bearer $GITHUB_TOKEN\" \\\n  https://api.github.com/repos/jamiew/claude-gha-demo/dispatches \\\n  -d '{\"event_type\":\"custom-webhook-event\",\"client_payload\":{\"message\":\"Hello!\"}}'\n```\n\n**Supported event types:**\n- `custom-webhook-event` - General webhook demo\n- `test-webhook` - Test webhook trigger\n\n**Payload fields** (all optional):\n- `message` - Custom message to echo\n- `action` - Action type (e.g., \"deploy\", \"notify\")\n- `data` - Any JSON object with additional data\n\nThe workflow will echo all payload data and can be extended to perform actions based on the payload content.\n\n**View the workflow run:**\n```bash\ngh run list --workflow=webhook-demo.yml --limit 5\ngh run watch\n```\n\n**Public webhook endpoints:**\n\nTo make a publicly accessible webhook (no GitHub token required for callers), use a serverless function to proxy the request:\n- [Val Town](https://val.town) - Simple hosted functions\n- [Cloudflare Workers](https://workers.cloudflare.com/) - Free edge functions\n- Other options: Vercel Functions, AWS Lambda, etc.\n\nStore your `GITHUB_TOKEN` as an environment variable in the function, then proxy requests to GitHub's API.\n\n## Debug Tools\n\nDiagnose workflow failures:\n```bash\n./scripts/debug-workflows.sh\n```\n\n## Setup\n\n### 1. Enable GitHub Actions\nSettings → Actions → General → **Allow all actions**\n\n### 2. Add Secrets\nSettings → Secrets and variables → Actions → New repository secret\n\n**Required:**\n- `CLAUDE_CODE_OAUTH_TOKEN` - From Claude Code GitHub App install\n\n**Optional:**\n- `GLIF_API_TOKEN` - From https://glif.app (for Glif featured content integration)\n- `CROSS_REPO_PAT` - Personal Access Token for cross-repo notifications (only needed if using cross-repo-notify workflows)\n\n#### Creating CROSS_REPO_PAT (Optional)\n\nOnly needed if you want to use the `cross-repo-notify.yml` workflow to send notifications to another repo.\n\n1. Go to https://github.com/settings/tokens?type=beta\n2. Click **\"Generate new token\"**\n3. Configure:\n   - **Token name**: `cross-repo-pat`\n   - **Expiration**: 1 year (or your preference)\n   - **Repository access**: **Public Repositories (read-only)** (or select specific repos)\n   - **Permissions** → Repository permissions:\n     - **Issues**: **Read and write** ✅\n4. Click **\"Generate token\"** and copy it\n5. Add to this repo: Settings → Secrets → Actions → New secret\n   - Name: `CROSS_REPO_PAT`\n   - Value: paste the token\n\n### 3. Configure Permissions\nSettings → Actions → General → Workflow permissions:\n- ✅ **Read and write permissions**\n- ✅ **Allow GitHub Actions to create and approve pull requests**\n\n### 4. Enable GitHub Pages\n\n**This must be done manually via web interface:**\n\n1. Go to Settings → Pages\n2. Under \"Build and deployment\":\n   - **Source**: Select **GitHub Actions** (NOT \"Deploy from a branch\")\n3. Click Save\n\nYour site will be at: `https://[username].github.io/[repo-name]`\n\n**Why GitHub Actions source?**\n- Multiple workflows can deploy (on push, on schedule, on demand)\n- No extra `gh-pages` branch to manage\n- Workflows control when/how to build and deploy\n- Better for dynamic content that updates frequently\n- Modern best practice (same as Vercel, Netlify)\n\n**Note**: Deploy workflows will fail until Pages is enabled. Once enabled, they'll work automatically.\n\n**Verify Pages is enabled:**\n```bash\n# Check if Pages is enabled\ngh api repos/jamiew/claude-gha-demo/pages\n\n# Should return Pages config, not 404\n```\n\n### 5. Install Claude Code GitHub App Features\n\nInstall built-in features using Claude Code CLI:\n```bash\n/install-github-app\n```\n\nThis enables:\n- **@claude mentions in issues** - Create an issue and mention `@claude` to get an implementation PR\n- **Automated Code Review** - Claude reviews all PRs automatically\n\n### 6. YOLO Mode (Optional but Recommended)\nFor maximum autonomy, enable auto-merge:\n\n**Settings → General:**\n- ✅ **Allow auto-merge** (lets Claude merge its own PRs)\n- ✅ **Automatically delete head branches** (cleanup after merge)\n\nThis lets the system truly run itself. Claude creates PRs → reviews them → auto-merges → deletes branches. Full autonomy.\n\n## The Feedback Loop\n\n```\nExternal data → Claude fetches → Updates data/ → Deploys site\n                                         ↓\n                        Claude improves code → Creates PR\n                                         ↓\n                            Claude reviews PR → Auto-merge\n                                         ↓\n                                  [Updated site]\n```\n\nIn parallel:\n- `self-improver.yml` improves Claude Code setup based on learnings\n- `update-docs.yml` generates workflow documentation\n- `self-repair.yml` attempts to fix failures\n- `todo-worker.yml` implements tasks from TODO.md\n- `issue-triage.yml` organizes and labels incoming issues\n\nThe goal is autonomous infrastructure that iterates on itself. Success varies.\n\n## Files\n\n- `data/` - Data directory (nytimes.json, glif.json, weather.json, crypto-prices.json, rhizome.json, docs.json)\n- `data.json` - Legacy data store (still supported for backward compatibility)\n- `docs/` - Auto-generated workflow documentation (created by `update-docs.yml`)\n- `TODO.md` - Ideas and tasks for Claude to implement\n- `.github/workflows/` - All workflow definitions\n- `scripts/` - Debug and repair utilities\n  - `scripts/build-website.js` - Builds static website from data files\n  - `scripts/debug-workflows.sh` - Diagnose workflow failures\n- `.claude/commands/` - Custom slash commands (Markdown)\n- `.claude/subagents/` - Subagent documentation\n- `theme-nyc.css` - Adaptive CSS theme generated based on time/weather\n\n## Glif Integration\n\nFetches top workflows/agents via API and displays them on the site.\n\n## Common Issues\n\n**Pages not enabled**: Settings → Pages → Source: GitHub Actions\n\n**Missing secrets**: Settings → Secrets → `CLAUDE_CODE_OAUTH_TOKEN`\n\n**Permission denied**: Settings → Actions → Workflow permissions → Read/write\n\n**data.json missing**: Create it: `{\"message\": \"Initial data\"}`\n\nLet `self-repair.yml` fix most issues automatically.\n\n## TODO-Driven Development\n\nAdd ideas to `TODO.md`. The `todo-worker.yml` workflow reads it regularly, picks feasible tasks, and implements them via PRs.\n\nTrigger manually:\n```bash\n# Let Claude pick best item\ngh workflow run todo-worker.yml\n\n# Work on specific item\ngh workflow run todo-worker.yml -f force_item=\"Add Reddit scraper\"\n\n# Just plan, don't implement\ngh workflow run todo-worker.yml -f mode=plan\n```\n\nModes:\n- **implement** (default) - Actually builds the feature\n- **plan** - Creates implementation plan without coding\n- **survey** - Organizes and prioritizes all TODOs\n\n## Philosophy\n\nExperimental playground for autonomous AI infrastructure. What happens when Claude can:\n- Read external data sources\n- Modify its own codebase\n- Review and merge its own changes\n- Attempt to fix its own failures\n- Respond to developer requests\n\nAdd ideas to TODO.md and Claude will attempt to build them. This is a sandbox for exploring the possibilities and limitations of AI-driven development workflows.\n\n## Live Demo\n\n**Website**: https://jamiew.github.io/claude-gha-demo\n\nThe dashboard updates automatically as workflows run and fetch new data.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiew%2Fclactions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamiew%2Fclactions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiew%2Fclactions/lists"}