Skip to main content
Beta feature. As of October 6, 2025, proactive behaviors execute once per day at 00:00 PST. Cron‑like schedules and event‑based triggers are coming soon.
See Instructions & Playbooks to learn how playbooks work and how to author them. This page focuses on enabling and operating proactive behaviors.

Overview

Proactive behaviors (beta) let Charlie execute selected playbooks automatically and open pull requests or Linear issues on your behalf. Nothing is enabled by default—you opt in by listing playbooks in your repo’s .charlie/config.yml.

How it works (at a glance)

  1. Write a playbook describing that actions you’d like Charlie to take.
  2. Add the playbook to your repo’s .charlie/config.yml.
  3. Each day at 00:00 PST, Charlie discovers and runs the proactive behaviors, automatically creating issues or PRs for you.

Opt‑in configuration

Location: .charlie/config.yml on your default branch. Changes take effect after merging to default.
beta:
  proactive:
    - playbook: ".charlie/playbooks/tech-debt-cleanup.md"
    - playbook: ".charlie/playbooks/sentry-triage.md"
  • playbook is the path to a playbook file in your repository.
  • Remove entries (or the whole beta.proactive key) to disable.

Triggers

While in beta, all proactive behaviors are triggered daily at 00:00 PST. Cron‑like schedules and event‑based triggers are coming soon. This will give you the ability to configure a specific time/frequency, or choose a specific event like PR CI checks failing, which could be used to proactively push fixes to the PR and keep CI green.

Writing effective proactive playbooks

Use the structure from Instructions & Playbooks and add constraints so Charlie’s actions are safe and predictable.

Checklist

What good proactive playbooks include:
  • Expected artifact and naming (if desired)
    • PR or Linear issue? Consider including a clear title pattern and, for PRs, a branch convention (for example, proactive/<slug>-YYYYMMDD).
  • Limits (keep scope small and safe)
    • Max artifacts per run (for example, “≤ 1 PR” or “≤ 3 issues”).
    • Max diff size for PRs (for example, “≤ 500 changed lines”) and allowed/blocked paths.
  • Data gathering instructions
    • Be explicit and narrow to high‑signal inputs:
      • Sentry: queries like is:unresolved event.type:error env:production lastSeen:<=24h.
      • GitHub: failing checks, idle PRs, or merged windows, scoped to default branch.
      • Repo scans: target directories/globs; exclude generated/third‑party code.
  • No‑op criteria (when to create nothing)
    • Clear conditions to skip creating artifacts (e.g., “no Sentry issues above threshold,” “changes exceed max diff,” “no safe candidates”).
  • Idempotency and traceability
    • Stable branch/date keys; optionally include the playbook path in artifact bodies.
  • Guardrails (things not to do)
    • Never change secrets, deployment manifests, or infra unless the playbook is explicitly about those.
    • Don’t auto‑close existing issues or rewrite history; avoid broad reformatting.
  • Verify and Rollback
    • Minimal checks to prove safety (types/lint/tests when present).
    • One‑step rollback instructions (e.g., revert the PR).
  • References
    • Link dashboards, searches, or paths the steps rely on.

Template snippet (copy into a playbook)

# <Action-oriented title>

## Overview
One sentence outcome.

## Creates
- Artifact: PR | Linear issue
- Title pattern: <your preferred pattern>
- Labels: <labels>

## Limits
- Max artifacts per run: <N>
- Max diff size: <lines> lines changed
- Allowed paths: <globs>

## Data collection
- Sentry: <query>, scope, thresholds
- Repo scan: <globs>, exclusions
- GitHub checks: <criteria>

## No-op when
- <clear conditions>

## Steps
1.
2.

## Verify
-

## Rollback
-

## References
-

Example playbooks (copy‑paste)

These examples are intentionally conservative and safe to try. Drop the files under .charlie/playbooks/.
Read Instructions & Playbooks for general guidance on writing playbooks.
Naming conventions shown in these examples (title prefixes, branch names, body content) are suggestions inside the playbook. The system does not enforce them—add the conventions you want directly to your playbooks.

Prune dead code and unused dependencies

Place in: .charlie/playbooks/dead-code-cleanup.md
# Prune dead code and unused dependencies

## Overview
Remove clearly unused files, exports, and dependencies with a small, reversible PR.

## Creates
- Artifact: PR
- Title pattern: "Proactive (beta): Prune dead code and unused deps"
- Branch: `proactive/dead-code-YYYYMMDD`
- Labels: `proactive-beta` (if available)

## Limits
- Max artifacts per run: 1 PR
- Max files changed: 20
- Max total diff: 500 changed lines
- Allowed paths: `src/**`, `packages/**`
- Excluded paths: `**/__tests__/**`, `**/__mocks__/**`, `**/fixtures/**`, `**/examples/**`, `**/docs/**`, `**/build/**`, `**/dist/**`, `**/*.d.ts`, `**/migrations/**`
- Guardrails:
  - Do not touch secrets, infra, or deployment manifests.
  - Do not remove exported symbols from a package with `"private": false` in its `package.json`; open an issue instead.

## Data collection
- Prefer analyzer output when available:
  - If the repo uses Knip: run the project’s script (e.g., `bun run knip` or `pnpm knip`) and capture: unused files, unused exports, unused deps.
  - TypeScript: enable/use compiler warnings for unused locals/params and capture results.
- Fallback heuristics (if no analyzer is present):
  - Unreferenced file candidates: files with 0 inbound references from the repo (exclude dynamic imports and entrypoints).
  - Unused export candidates: exported symbols never imported/used within the repo.
- For each candidate:
  - Verify at least two independent signals (e.g., Knip + no inbound references).
  - Ensure candidate is not an entrypoint (bin/export) nor mentioned in `exports` or `files` in `package.json`.

## No‑op when
- No candidates pass the two‑signal test, or
- The change would exceed any limit (files/lines), or
- Any candidate sits in excluded paths, or a package is public (non‑private).

## Steps
1. Create a branch `proactive/dead-code-YYYYMMDD`.
2. Build the candidate list from Data collection (respect limits/guardrails).
3. Apply removals in small commits grouped by package/area:
   - Remove dead files; update barrel exports; delete unused exports.
   - Remove unused runtime deps; keep devDeps unless clearly unused across repo tooling.
4. Run available checks (only those that exist in this repo):
   - Typecheck, lint, unit tests, knip (re‑run), and Prettier formatting.
5. If checks fail, revert the offending chunk or reduce scope until green.
6. Open a PR titled "Proactive (beta): Prune dead code and unused deps".
   - Body must include: the playbook path, a bulleted “Removals” list, analyzer excerpts, and confirmation of checks run.

## Verify
- All selected project checks pass (typecheck/lint/tests/knip when present).
- No new TypeScript unused warnings remain related to removals.

## Rollback
- Revert the PR (single revert commit). No additional cleanup required.

## References
- Internal analyzer or repo scripts (e.g., Knip).
- `package.json` `exports`/`files` fields for entrypoint validation.

Fix README commands, links, and badges

Place in: .charlie/playbooks/readme-corrections.md
# Fix README commands, links, and badges

## Overview
Bring README instructions up to date: correct commands, fix broken links/badges, and tighten quickstart steps with a minimal PR.

## Creates
- Artifact: PR
- Title pattern: "Proactive (beta): Fix README.md commands and links"
- Branch: `proactive/readme-fixes-YYYYMMDD`
- Labels: `proactive-beta` (if available)

## Limits
- Max artifacts per run: 1 PR
- Max files changed: 3 (prefer only the root `README.md`)
- Max total diff: 200 changed lines
- Allowed paths: `README.md`, `README.mdx`, `docs/**` (only if the root README references those docs)
- Guardrails:
  - Do not rewrite prose or restructure sections; only fix factual inaccuracies.
  - Do not change license text or policy statements.
  - Prefer removing broken badges vs. replacing them unless a clear, current URL is known.

## Data collection
- Scripts and commands:
  - Parse `package.json` `scripts` and check for README references to removed/renamed commands; flag mismatches.
  - Verify Node/PNPM/Bun version statements in README against `engines` (if present).
- Links and badges:
  - Validate external links and badge URLs with an HTTP HEAD/GET (3s timeout). Treat 4xx/5xx as broken.
  - For internal repo links, ensure targets exist on the default branch.
- Quickstart accuracy:
  - Compare README setup steps with the actual app/package run scripts; ensure the minimal path works.

## No‑op when
- No broken links/badges and no command mismatches, or
- Fixes would exceed limits, or
- Required authoritative targets are unclear (e.g., multiple plausible docs).

## Steps
1. Create a branch `proactive/readme-fixes-YYYYMMDD`.
2. Prepare a change list:
   - Replace or remove broken links/badges (prefer authoritative replacements).
   - Update command examples to match current scripts.
   - Align engine/version notes with `engines` if present.
3. Keep edits surgical (small diffs; avoid rewrapping large sections).
4. Run available checks:
   - Markdown/Prettier formatting, link checker if present (otherwise spot-check).
5. Open a PR titled "Proactive (beta): Fix README.md commands and links".
   - Body must include: the playbook path, a concise “Changes” list (links updated, commands corrected), and validation notes (e.g., which links were verified).

## Verify
- Links in the changed sections resolve successfully.
- Any example command runs locally in CI/dev scripts (when feasible) or is at least present in `package.json`.

## Rollback
- Revert the PR (single commit). If badges were removed, note prior URLs in the revert body for future reference.

## References
- `package.json` `scripts` and `engines`
- Internal docs referenced by README

Triage top Sentry errors

Place in: .charlie/playbooks/sentry-triage.md
# Triage top Sentry errors

## Overview
Review recent Sentry errors and open focused Linear issues for the highest‑impact problems with clear next steps.

## Creates
- Artifact: Linear issue(s)

## Limits
- Max artifacts per run: up to 3 issues
  - If >3 candidates meet thresholds: create 1 summary issue and include links to remaining candidates; do not open more than 3 issues total.
- Time window: last 24 hours (production)
- Guardrails:
  - Skip issues previously triaged in the last 7 days (same fingerprint).
  - Skip Sentry issues that already have a corresponding Linear issue.

## Data collection
- Sentry filter (example semantics):
  - Status: unresolved
  - Event type: error
  - Environment: production
  - Window: last 24 hours
- Ranking:
  - Sort by event count and affected users. Prefer issues with both high frequency and user impact.
- For each candidate, capture:
  - Issue title, permalink, fingerprint, event count, users affected, first/last seen, culprit, suspect commits (if available), release/version, environment.

## No‑op when
- No candidates meet thresholds (e.g., event count < 10 and users affected < 3), or
- All candidates were triaged in the past 7 days, or
- Sentry API unavailable (log and skip; do not create placeholder issues).

## Steps
1. Build candidate list using Data collection and thresholds; de‑dupe by fingerprint and recent triage history.
2. If candidates ≤ 3:
   - Create one Linear issue per candidate with:
     - Clear description (what it is, why it matters), Sentry permalink, metrics (events/users), and last seen.
     - An analysis of the likely root cause of the issue.
     - A short “Next steps” checklist (repro, owner guess, rollback plan).
3. If candidates > 3:
   - Create a single summary Linear issue with a table/list of the top N and direct permalinks, plus a triage checklist.
4. Include the playbook path in the issue(s) and note the date key for idempotency.
5. Do not close or edit existing bugs; only create new issues per the limits.

## Verify
- Each created issue contains working Sentry links and the required fields (metrics, last seen).
- No duplicate issue exists for the same fingerprint within the last 7 days.

## Rollback
- Close the created Linear issue(s) with a comment explaining the rollback and keep links for future reference.

## References
- Sentry search and ownership rules for the project(s)
- Team conventions for incident priority and assignment

FAQs

When are proactive behaviors executed? Daily at 00:00 America/Los_Angeles. Custom schedules and event triggers are planned but not available in beta. How do I enable or disable proactive behaviors? Add or remove entries under beta.proactive in .charlie/config.yml and merge to the default branch. What if a listed playbook file is missing? The behavior is skipped and logged. Ensure the path exists on the default branch. Will proactive behaviors review my PRs? No. Proactive behaviors create artifacts (PRs/issues). PR review behavior is unchanged. Can proactive behaviors create Slack messages? No. Proactive behaviors can only create GitHub PRs and issues and Linear issues.
I