{"id":48877133,"url":"https://github.com/ianlintner/caretaker","last_synced_at":"2026-05-14T01:02:55.520Z","repository":{"id":351171516,"uuid":"1209833711","full_name":"ianlintner/caretaker","owner":"ianlintner","description":"Agentic Repo Maintenance","archived":false,"fork":false,"pushed_at":"2026-05-06T10:36:15.000Z","size":7670,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-06T12:27:48.584Z","etag":null,"topics":["agentic","caretaker","copilot","devops","llm","python"],"latest_commit_sha":null,"homepage":"https://ianlintner.github.io/caretaker/","language":"Python","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/ianlintner.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","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":"docs/agents.md","dco":null,"cla":null}},"created_at":"2026-04-13T20:35:13.000Z","updated_at":"2026-05-06T10:36:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"5db26ad4-e16b-423a-b1ad-b7b2edef4892","html_url":"https://github.com/ianlintner/caretaker","commit_stats":null,"previous_names":["ianlintner/caretaker"],"tags_count":62,"template":false,"template_full_name":null,"purl":"pkg:github/ianlintner/caretaker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianlintner%2Fcaretaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianlintner%2Fcaretaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianlintner%2Fcaretaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianlintner%2Fcaretaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianlintner","download_url":"https://codeload.github.com/ianlintner/caretaker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianlintner%2Fcaretaker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32723647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["agentic","caretaker","copilot","devops","llm","python"],"created_at":"2026-04-16T01:03:31.575Z","updated_at":"2026-05-14T01:02:55.509Z","avatar_url":"https://github.com/ianlintner.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Caretaker\n\nAutonomous GitHub repository management powered by Copilot and github app.\n\n\u003cimg width=\"100\" alt=\"Caretaker Avatar\" src=\"https://github.com/user-attachments/assets/fb236484-2b83-41c6-b836-ec6f2d378b46\" /\u003e\n\nDocumentation: https://ianlintner.github.io/caretaker/\n\n**One issue. No CLI. No tooling.** Paste a setup issue into your repo, assign it to `@copilot`, walk away. Your repo is now autonomously maintained.\n\n---\n\n## How It Works\n\n1. **You** paste a setup issue into your repo and assign it to `@copilot`\n2. **Copilot** reads our [SETUP_AGENT.md](setup-templates/SETUP_AGENT.md), analyzes your repo, and opens a PR with everything configured\n3. **You** merge the PR\n4. **The orchestrator** runs daily via GitHub Actions, managing PRs, issues, and upgrades\n\nThe orchestrator uses Copilot as its execution engine — it observes your repo state, decides what needs to happen, and delegates code changes to Copilot via structured comments.\n\n---\n\n## Setup\n\n### 1. Create a new issue in your repo:\n\n\u003e **Tip:** Visit the [Getting Started docs](https://ianlintner.github.io/caretaker/getting-started/) and use the **copy** button on the code block below to copy the issue template in one click.\n\n```markdown\n## Setup Caretaker\n\n@copilot Please set up the caretaker system for this repository.\n\n### Instructions\n\n1. Read the setup guide at:\n   https://github.com/ianlintner/caretaker/blob/main/setup-templates/SETUP_AGENT.md\n\n2. Follow the instructions in that guide exactly.\n\n3. After creating all files, open a single PR with the changes.\n   Title: \"chore: setup caretaker\"\n\n### Context\n\nThis repo uses the caretaker system for automated repo management.\nSee: https://github.com/ianlintner/caretaker\n```\n\n### 2. Assign the issue to `@copilot`\n\n### 3. Review and merge the PR that Copilot opens\n\n### 4. Add `COPILOT_PAT` from a write-capable user for Copilot hand-offs, and `ANTHROPIC_API_KEY` for enhanced AI features\n\n`COPILOT_PAT` should be a fine-grained PAT that belongs to a real user or machine user with write access to the repository.\nCaretaker uses that token for:\n\n- API-based assignment of issues to GitHub Copilot\n- PR comments that `@copilot` must see as coming from a write-capable identity rather than `github-actions[bot]`\n\n---\n\n## What Gets Installed\n\nAfter setup, your repo has:\n\n```\n.github/\n  copilot-instructions.md         ← Copilot project memory (appended)\n  agents/\n    maintainer-pr.md              ← PR agent persona\n    maintainer-issue.md           ← Issue agent persona\n    maintainer-upgrade.md         ← Upgrade agent persona\n  maintainer/\n    config.yml                    ← Repo-specific settings\n    .version                      ← Pinned version\n```\n\nNo Python. No Node. No vendored code. **No GitHub Actions workflow either** — all\nexecution happens server-side, driven by App webhooks. Just config and Copilot\ninstructions.\n\n---\n\n## Features\n\n### Coding backends\n\nWhen an agent needs to make a code change, it routes through the\n`ExecutorDispatcher`, which picks one of four backends per dispatch:\n\n- **Copilot** — `@copilot` hand-off comment (the legacy default).\n- **Foundry** — in-process LLM tool loop, drives Azure AI Foundry or\n  any LiteLLM-compatible provider directly from `mcp_backend`.\n- **HandoffAgent** — tags the PR/issue and lets `claude-code-action`\n  or `opencode_local` GitHub Actions run asynchronously.\n- **K8s Job** — durable per-task pod for long-running work; brokered\n  through Azure Service Bus and the `caretaker-job-dispatcher`\n  deployment.\n\nThree labels override per-item: `agent:custom`, `agent:copilot`,\n`agent:quarantine`.\n\n### Core Agents\n\nThese eleven agents handle the day-to-day repository workload. Seven\nadditional specialist agents (review, principal, refactor, perf,\nmigration, test, bootstrap) are documented in\n[docs/agents.md](https://ianlintner.github.io/caretaker/agents/).\n\n#### PR Agent\n- Monitors all open PRs in real-time\n- Detects and triages CI failures (test, lint, build, type errors)\n- Requests fixes from Copilot via structured comments\n- Retry loop with escalation after max attempts\n- Auto-merge for Copilot, Dependabot, and human PRs (configurable)\n- Handles flaky test detection and CI re-runs\n- Review state analysis and auto-approval (configurable)\n\n#### Issue Agent\n- Triages incoming issues (bug, feature, question, duplicate, stale)\n- Dispatches implementable issues through the configured coding backend\n- Tracks issue → PR → merge lifecycle\n- Auto-closes answered questions and stale issues (configurable)\n- Escalates complex issues to repo owners\n\n#### DevOps Agent\n- Monitors default-branch CI failures\n- Automatically creates fix issues for build/test failures\n- Deduplicates similar issues with cooldown periods\n- Routes fixes through the configured coding backend\n\n#### Self-Heal Agent\n- Detects `mcp_backend` and dispatcher failures\n- Creates self-diagnosis issues\n- Reports bugs to upstream caretaker repository (configurable)\n- Ensures the system can maintain itself\n\n#### Security Agent\n- Triages Dependabot alerts\n- Monitors code scanning findings\n- Tracks secret scanning alerts\n- Filters by severity thresholds\n- Creates remediation issues with context\n\n#### Dependency Agent\n- Reviews Dependabot PRs\n- Auto-merges patch and minor updates (configurable)\n- Posts dependency update digests\n- Smart merge strategies by update type\n\n#### Docs Agent\n- Reconciles merged PRs into changelog updates\n- Maintains documentation freshness\n- Configurable lookback period\n- Optional README updates\n\n#### Charlie Agent\n- Cleans up duplicate caretaker-managed issues and PRs\n- Closes abandoned work after 14-day default window\n- Prevents operational clutter accumulation\n- Exempt label support for critical work\n\n#### Stale Agent\n- Warns and closes stale issues and PRs (60+ days default)\n- Deletes merged branches automatically\n- Configurable stale thresholds\n- Exempt labels for pinned or security work\n\n#### Escalation Agent\n- Creates human escalation digest issues\n- Aggregates work requiring maintainer attention\n- Configurable targets and notification\n- Tracks escalation age and priority\n\n#### Upgrade Agent\n- Detects new caretaker releases\n- Creates upgrade issues for the configured coding backend to execute\n- Supports multiple strategies: auto-minor, auto-patch, latest, pinned\n- Handles breaking vs. non-breaking upgrades\n- Version pinning via `.version` file\n- Preview channel support\n\n### Advanced Features\n\n#### Goal Engine (Experimental)\n- Quantitative goal-based agent dispatch\n- Measures repository health across dimensions:\n  - CI health (green builds on main and PRs)\n  - PR lifecycle velocity\n  - Security posture\n  - Self-health monitoring\n- Scores each goal from 0.0 (unmet) to 1.0 (satisfied)\n- Prioritizes agents based on goal impact\n- Detects divergence and critical states\n- Tracks goal history for trend analysis\n\n#### Memory Store\n- Disk-backed SQLite storage for agent memory\n- Persistent deduplication across runs\n- Namespaced memory for different agent concerns\n- Automatic snapshot generation for auditing\n- Bounded storage with configurable limits\n\n### Optional: Claude Integration\n\nAdd `ANTHROPIC_API_KEY` to unlock enhanced AI features:\n\n- **CI log analysis** — better at parsing long, noisy logs\n- **Architectural review** — understands complex code review comments\n- **Issue decomposition** — breaks down multi-faceted bugs\n- **Upgrade impact analysis** — assesses breaking change risk\n\n### Optional: OpenRouter Integration\n\nSet `OPENROUTER_API_KEY` (or its accepted alias `OPEN_ROUTER_API_KEY`)\nand `provider: openrouter` in\n`.github/maintainer/config.yml` to route LLM calls through\n[OpenRouter](https://openrouter.ai), which gives you:\n\n- **300+ models behind one key** — DeepSeek R1, Gemini, Llama, Qwen,\n  GLM, plus all the proprietary frontier models.\n- **Per-feature model routing** — pin different caretaker features to\n  different best-fit models via `feature_models`.\n- **Web-grounded analysis** — append `:online` to a model string to add\n  a web search step before the completion. Caretaker ships this as the\n  default for `upgrade_impact_analysis`, `migration_analysis`, and\n  `migration_plan` so release-note and breaking-change context comes\n  from current sources rather than stale model knowledge.\n\nSample config:\n\n```yaml\nllm:\n  provider: openrouter\n  default_model: openrouter/anthropic/claude-sonnet-4.6\n  feature_models:\n    ci_log_analysis:\n      model: openrouter/deepseek/deepseek-r1\n    principal_architecture_review:\n      model: openrouter/anthropic/claude-opus-4.6\n```\n\n**Cost note:** `:online` adds OpenRouter's web-search step\n(~$4 per 1k searches) on top of the model call. The\n`caretaker.llm.online=true` OTel span attribute lets you break out\nweb-grounded spend in cost dashboards.\n\nWhen `provider: openrouter` is set, every model string must begin\nwith `openrouter/`. Caretaker rejects bare model names at\nconfig-load to prevent the silent bypass to Anthropic-direct that\nLiteLLM otherwise performs.\n\n---\n\n## What's new\n\n### Fleet registry (opt-in)\n\nEach consumer repo's successful `caretaker run` can POST a small\nheartbeat to a central caretaker backend so an operator sees every\nmanaged repository in one dashboard — without running an org-wide\nGitHub crawl.\n\nEnable in `.github/maintainer/config.yml`:\n\n```yaml\nfleet_registry:\n  enabled: true\n  endpoint: https://\u003cyour-caretaker-backend\u003e/api/fleet/heartbeat\n```\n\nSee [docs/fleet-registry.md](docs/fleet-registry.md) for architecture,\npayload shape, and HMAC-signed delivery.\n\n### Custom coding agent\n\nSmall tasks (lint fixes, trivial test failures, review comments) no\nlonger have to go to `copilot-swe-agent[bot]`. A configurable\nexecutor routes them to caretaker's own Foundry tool-loop or to an\n`anthropics/claude-code-action` hand-off, with a size-budget guard\nand an explicit escalation path back to Copilot.\n\nThree routing labels let operators steer individual items:\n\n- `agent:custom` — force the custom executor.\n- `agent:copilot` — force the legacy path.\n- `agent:quarantine` — refuse dispatch (for hostile or confusing issues).\n\nOn AKS deployments, the MCP backend exposes\n`POST /api/admin/agent-tasks` which spawns a short-lived\n`batch/v1 Job` per dispatch. See\n[docs/custom-coding-agent-plan.md](docs/custom-coding-agent-plan.md)\nfor the full design, phased rollout, size budget, and security model;\n[docs/custom-coding-agent-e2e.md](docs/custom-coding-agent-e2e.md)\nfor the operator runbook.\n\n---\n\n## Configuration\n\nSee [setup-templates/templates/config-default.yml](setup-templates/templates/config-default.yml) for the full config schema.\n\nKey settings:\n\n```yaml\npr_agent:\n  auto_merge:\n    copilot_prs: true # Auto-merge Copilot PRs\n    dependabot_prs: true # Auto-merge dependency updates\n  copilot:\n    max_retries: 2 # Fix attempts before escalation\n\nissue_agent:\n  auto_assign_bugs: true # Auto-assign simple bugs to Copilot\n  auto_assign_features: false\n\ndevops_agent:\n  target_branch: main # Monitor default branch CI\n  max_issues_per_run: 3 # Prevent issue spam\n  dedup_open_issues: true\n\nsecurity_agent:\n  min_severity: medium # Filter by severity\n  include_dependabot: true\n  include_code_scanning: true\n  include_secret_scanning: true\n\ndependency_agent:\n  auto_merge_patch: true\n  auto_merge_minor: true\n  post_digest: true\n\ncharlie_agent:\n  stale_days: 14 # Short janitorial window for caretaker-managed work\n  close_duplicate_issues: true\n  close_duplicate_prs: true\n\nstale_agent:\n  stale_days: 60 # General stale threshold\n  close_after: 14\n  delete_merged_branches: true\n\nupgrade_agent:\n  strategy: auto-minor # auto-minor | auto-patch | latest | pinned\n  channel: stable # stable | preview\n\ngoal_engine:\n  enabled: false # Experimental: goal-driven dispatch\n  goal_driven_dispatch: false # Reorder agents by goal impact\n  divergence_threshold: 3 # Runs before triggering alerts\n\nmemory_store:\n  enabled: true # Persistent agent memory\n  db_path: .caretaker-memory.db\n  max_entries_per_namespace: 1000\n```\n\n---\n\n## Architecture\n\nThe orchestrator runs server-side on AKS, not in your repo. Three\ndeployable processes split the work:\n\n```\nGitHub App webhooks\n  │\n  ▼\nmcp_backend (FastAPI x2, AKS)\n  │   ├── HMAC + allow-list\n  │   ├── dedup + rate-limit\n  │   └── Redis Streams ──► agent router ──► ExecutorDispatcher\n  │                                              │\n  │                                              ├──► Copilot @-mention (legacy)\n  │                                              ├──► Foundry  (in-process LLM tool loop)\n  │                                              ├──► HandoffAgent  (opencode_local / claude-code-action)\n  │                                              └──► Azure Service Bus ──► caretaker-job-dispatcher\n  │                                                                              │\n  │                                                                              ▼\n  │                                                                         per-task K8s Job\n  │                                                                              │\n  ▼                                                                              ▼\nMongoDB / Cosmos · Neo4j · SQLite                                          git push + PR comment\n```\n\nEighteen agents live behind the dispatcher, grouped by trigger\n(event-driven, scheduled, dispatch-time / advisory). The orchestrator\n**never writes code itself** — it routes to one of four coding backends.\n\nFor diagrams of the runtime topology, webhook event pipeline, durable\ncoding-job lifecycle, and full agent inventory, see\n[docs/architecture.md](https://ianlintner.github.io/caretaker/architecture/).\n\n---\n\n## Development\n\n```bash\n# Clone and install\ngit clone https://github.com/ianlintner/caretaker.git\ncd caretaker\npip install -e \".[dev]\"\n\n# Run tests\npytest tests/ -v\n\n# Lint\nruff check src/ tests/\nruff format --check src/ tests/\n\n# Type check\nmypy src/\n```\n\n---\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianlintner%2Fcaretaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianlintner%2Fcaretaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianlintner%2Fcaretaker/lists"}