{"id":50668619,"url":"https://github.com/grobomo/github-agent","last_synced_at":"2026-06-08T08:35:04.545Z","repository":{"id":349476398,"uuid":"1202483459","full_name":"grobomo/github-agent","owner":"grobomo","description":"Monitor GitHub activity across accounts — LLM-powered analysis with auto-response, alerting, and task dispatch","archived":false,"fork":false,"pushed_at":"2026-04-06T06:20:41.000Z","size":78,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-06T06:27:28.406Z","etag":null,"topics":["automation","github","llm","monitoring","sqlite"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grobomo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2026-04-06T04:23:28.000Z","updated_at":"2026-04-06T06:20:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/grobomo/github-agent","commit_stats":null,"previous_names":["grobomo/github-agent"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/grobomo/github-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grobomo%2Fgithub-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grobomo%2Fgithub-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grobomo%2Fgithub-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grobomo%2Fgithub-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grobomo","download_url":"https://codeload.github.com/grobomo/github-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grobomo%2Fgithub-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34055249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"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":["automation","github","llm","monitoring","sqlite"],"created_at":"2026-06-08T08:35:04.444Z","updated_at":"2026-06-08T08:35:04.535Z","avatar_url":"https://github.com/grobomo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Agent\n\nMonitors all GitHub activity across multiple accounts. Polls issues, PRs, discussions, notifications, workflow runs, and settings changes. Uses LLM analysis (`claude -p`) with full historical context to decide actions: respond, dispatch tasks, send alerts, or log.\n\n## How it works\n\n```\nGitHub API (via gh CLI)\n  │\n  ▼\nGitHubPoller (per-account, auto-discovers repos)\n  ├── Issues, PRs, Discussions, Notifications\n  ├── Repo events (pushes, forks, stars)\n  ├── Workflow runs (failures)\n  └── Settings snapshots (drift detection)\n  │\n  ▼\nNormalizer → EventStore (SQLite + FTS)\n  │\n  ▼\nBrain (LLM analysis with three-tier memory)\n  │\n  ▼\nDispatcher (comment via gh, dispatch to CCC, alert via email, log)\n```\n\nThe brain classifies each event as one of:\n\n| Action | Description |\n|--------|-------------|\n| **IGNORE** | Routine activity, no action needed |\n| **LOG** | Interesting but not actionable — stored for context |\n| **RESPOND** | Post a comment on the issue/PR/discussion |\n| **DISPATCH** | Send a task to the CCC dispatcher for deeper work |\n| **ALERT** | Email notification — something urgent or security-sensitive |\n\nSecurity-sensitive events (visibility changes, branch protection removal, admin access grants, leaked secrets) always trigger ALERT.\n\n## Quick start\n\n```bash\n# Prerequisites: gh CLI authenticated, Python 3.12+\npip install -r requirements.txt  # optional: only pyyaml for config file support\n\n# Single account, single poll, dry run\npython main.py --account grobomo --once --dry-run -v\n\n# Continuous monitoring (10s notification checks, 5min full scans)\npython main.py --account grobomo --interval 10 --full-scan-interval 300\n\n# With health endpoint\npython main.py --account grobomo --interval 10 --health-port 8081\n```\n\n## Running as a service\n\n```bash\n# Install as continuous service (silent, no visible windows)\nbash scripts/install-scheduler.sh --mode service\n\n# Install as periodic task (every 5 min)\nbash scripts/install-scheduler.sh\n\n# Check status\nbash scripts/install-scheduler.sh --status\n\n# Remove\nbash scripts/install-scheduler.sh --remove\n\n# Check agent health (reads heartbeat file)\nbash scripts/watchdog.sh\n```\n\nThe service uses tiered polling: fast notification checks every 10 seconds, full repo scans every 5 minutes. A process guard prevents duplicate instances. On Windows, the service runs silently via VBS launcher (no cmd windows, no focus stealing).\n\n### Health monitoring\n\nThe agent writes `data/heartbeat.json` after each poll cycle. The watchdog script (`scripts/watchdog.sh`) checks heartbeat freshness and kills stale processes. A circuit breaker (`--max-errors 50`) exits after consecutive errors to prevent infinite loops — the scheduled task restarts it on the next cycle.\n\nLog rotation is built in: `--log-max-bytes 5000000 --log-backup-count 3` (defaults).\n\n## Dashboard\n\nGenerate a self-contained HTML status page from the SQLite database:\n\n```bash\n# Generate report and open in browser\npython main.py --account grobomo --report\n\n# Custom output path\npython main.py --account grobomo --report --output status.html\n```\n\nThe dashboard includes:\n- Agent status cards (total events, 24h activity, actions taken)\n- Event volume chart (SVG bar chart, last 24h by hour)\n- Recent events table with type badges\n- Action history (responses, alerts, dispatches)\n\n## Project structure\n\n```\nmain.py                    # CLI entry point + agent loop\ncore/\n  store.py                 # EventStore — SQLite + FTS + WAL mode\n  brain.py                 # LLM analyzer + rule-based fallback\n  dispatcher.py            # Action executor (gh comment, email, CCC)\n  context.py               # Context cache for brain prompts (Tier 1)\n  memory.py                # Per-repo + account memory (Tier 2/3)\n  compactor.py             # LLM-based memory compaction\n  report.py                # HTML dashboard report generator\ngithub/\n  poller.py                # GitHub API polling via gh CLI\n  normalizer.py            # Raw API → EventStore records\n  settings.py              # Settings snapshot + drift detection\n  gh_cli.py                # gh CLI wrapper\nscripts/\n  service.sh               # Continuous service launcher (Linux/Git Bash)\n  service.bat              # Continuous service launcher (Windows)\n  service-silent.vbs       # Silent VBS launcher (no visible windows)\n  install-scheduler.sh     # Install/remove OS scheduled task\n  watchdog.sh              # Health check — heartbeat freshness monitor\n  run.sh                   # Run all accounts in parallel\ntests/                     # 90 tests covering all modules\n```\n\n## Design decisions\n\n- **One process per account** — security isolation between accounts\n- **SQLite WAL mode** — concurrent reads during polling, busy_timeout for resilience\n- **Three-tier memory** — Tier 1: hot cache (24h events), Tier 2: per-repo JSON (purpose, milestones, threads), Tier 3: account-level summary. LLM compaction distills events into long-term context.\n- **Rule-based fallback** — when `claude` CLI is unavailable, built-in rules handle common patterns (own pushes → IGNORE, security events → ALERT)\n- **Settings drift detection** — snapshots repo settings each cycle, alerts on security-relevant changes with severity levels (critical/high/medium/low)\n- **Service health** — heartbeat file, log rotation, watchdog script, circuit breaker for consecutive errors\n- **Source-agnostic core** — `core/` knows nothing about GitHub specifically, designed for reuse by other agents (Teams, Slack, etc.)\n\n## Configuration\n\nCreate `config/accounts.yaml` to define accounts:\n\n```yaml\naccounts:\n  grobomo:\n    repos: []  # empty = auto-discover all repos\n  another-account:\n    repos:\n      - owner/specific-repo\n```\n\nOr pass repos directly via CLI: `--repos owner/repo1 owner/repo2`\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrobomo%2Fgithub-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrobomo%2Fgithub-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrobomo%2Fgithub-agent/lists"}