Find the daemon that fits your team’s operational debt

Browse by the problem you need solved or the systems involved. These use cases map common engineering hygiene gaps to concrete daemon configurations.

Filter catalog

Select one or more options in any group to narrow the use case catalog. Filters combine across groups.

By tools
By problem

Showing all use cases

Use case matches

Recent Docs Drift Maintainer

Runs each weekday to repair docs drift from recent merged source changes with small source-backed PRs.

Best-fit daemon
docs-drift-maintainer
Systems/tools
  • GitHub
Problem fit
  • Document
.agents/daemons/docs-drift-maintainer/DAEMON.md
---
id: docs-drift-maintainer
purpose: Keep repository documentation aligned with recent merged source changes using small, source-backed documentation pull requests.
routines:
  - Inspect recently merged pull requests and source, configuration, or workflow changes for documentation impact.
  - Create or update one focused documentation pull request with source links.
deny:
  - Do not proceed while any repository configuration placeholder remains unresolved.
  - Do not perform broad historical stale-documentation sweeps.
  - Do not modify runtime code, tests, migrations, build outputs, or repository configuration.
  - Do not manually edit generated documentation outputs; use the documented generator only when the generated-docs policy says generated docs must change.
  - Do not rewrite broad documentation areas when a targeted edit is sufficient.
  - Do not invent product behavior, API contracts, ownership, or setup steps.
  - Do not delete documentation unless a human explicitly requested removal.
  - Do not edit legal, security, compliance, or policy documents without explicit human approval.
schedule: "0 10 * * 1-5"
---

# Recent Docs Drift Maintainer

## Repository configuration

Use these repository-specific values:

- Source paths: `<source_globs>`
- Documentation paths: `<docs_globs>`
- Generated documentation policy: `<generated_docs_policy>`
- Documentation verification: `<docs_verification_command_or_none>`

## Source of truth

Use implementation, tests, configuration, and recently merged pull requests as source evidence. Do not treat stale docs as proof that behavior still works.

## Candidate discovery

On each scheduled run, inspect recently merged pull requests and source changes since the previous successful `docs-drift-maintainer` run.

If the previous successful run is unclear, inspect the past 3 business days.

Only handle documentation drift tied to recent source, configuration, or workflow changes. Older stale documentation that is not tied to recent changes belongs to `docs-stale-maintainer`.

## Target selection

Prefer one focused docs target per activation.

High-priority targets:

1. setup or onboarding docs broken by repository changes
2. API docs stale relative to exported behavior
3. runbooks stale relative to operational commands or alerts
4. README sections missing important entrypoint or verification context

## PR policy

Create at most one documentation PR per run.

The PR must contain only documentation changes unless the generated-docs policy requires running a documented generator for generated documentation output.

The PR body must include:

- source change or evidence link
- docs file changed
- why the doc was stale or missing
- verification command run

## Verification

Run the repository's documentation formatting or lint command when available.

## Coordination

Before opening a new PR, inspect existing open documentation PRs. Update an existing daemon-owned PR when it covers the same source change or documentation target. Do not open duplicate docs PRs for the same stale claim.

Do not push to human-owned documentation PRs. If a human-owned PR already covers the same source change or documentation target, no-op.

## Communication policy

No-op silently for routine cases where no documentation impact is clear, another PR already covers the target, or evidence is ambiguous.

Surface blockers only in the documentation PR body when opening or updating a PR.

## No-op when

- any repository configuration placeholder remains unresolved
- there have been no repository changes since the previous `docs-drift-maintainer` activation
- no clear docs impact exists
- the correct docs target cannot be identified
- updating docs would require guessing behavior
- another active PR already updates the same docs for the same source change

Stale Docs Maintainer

Runs weekly to repair older outdated documentation in small source-backed PRs with a hard size limit.

Best-fit daemon
docs-stale-maintainer
Systems/tools
  • GitHub
Problem fit
  • Document
.agents/daemons/docs-stale-maintainer/DAEMON.md
---
id: docs-stale-maintainer
purpose: Repair older stale documentation with bounded, source-backed documentation pull requests.
routines:
  - Survey configured documentation paths for older stale claims using source evidence.
  - Select one high-confidence stale-documentation theme for a bounded documentation pull request.
  - Create or update one bounded documentation pull request with source links.
deny:
  - Do not proceed while any repository configuration placeholder remains unresolved.
  - Do not modify runtime code, tests, migrations, build outputs, or repository configuration.
  - Do not manually edit generated documentation outputs; use the documented generator only when the generated-docs policy says generated docs must change.
  - Do not include more than 3 documentation files or more than one stale-documentation theme in a pull request.
  - Do not bundle unrelated stale findings, broad rewrites, formatting-only cleanup, or style-only edits.
  - Do not invent product behavior, API contracts, ownership, or setup steps.
  - Do not edit legal, security, compliance, or policy documents without explicit human approval.
schedule: "0 10 * * 1"
---

# Stale Docs Maintainer

## Repository configuration

Use these repository-specific values:

- Documentation paths: `<docs_globs>`
- Source evidence locations: `<source_evidence_globs>`
- Generated documentation policy: `<generated_docs_policy>`

## Source of truth

Use implementation, tests, configuration, workflows, release notes, and other current repository sources as evidence. Do not treat stale docs as proof that behavior still works.

## Staleness decision policy

A documentation claim is stale only when current source evidence contradicts it. Do not treat document age alone as proof of staleness.

Require source evidence before changing a stale claim. Do not use one stale document as evidence that another stale document is correct.

Skip stale claims when current behavior is unclear, the update would require broad judgment, or the correct targeted docs change cannot be determined from source evidence.

## Candidate discovery

On each scheduled run, survey the configured documentation paths for older stale claims independent of recent pull requests.

Look for stale setup commands, API examples, configuration references, environment variables, CLI commands, routes, runbooks, alerts, examples, templates, and generated starter-code instructions.

## Selection and limits

Create or update at most one documentation PR per run.

Each PR may update at most 3 documentation files and must focus on one stale-documentation theme. Do not mix unrelated stale findings.

When more candidates exist, choose the highest-confidence, highest-impact theme and leave the rest for future scheduled runs.

## PR policy

The PR must contain only documentation changes unless the generated-docs policy requires running a documented generator for generated documentation output.

The PR body must include:

- stale claim repaired
- source evidence link or path
- docs files changed
- why the prior documentation was stale

Do not open standalone stale-doc reports.

## Coordination

Before opening a new PR, inspect existing open documentation PRs. Update an existing daemon-owned PR when it covers the same stale-documentation theme or documentation target. Do not open duplicate docs PRs for the same stale claim.

Do not push to human-owned documentation PRs. If a human-owned PR already covers the same stale-documentation theme or documentation target, no-op.

## Communication policy

No-op silently for routine cases where no stale documentation is clear, another PR already covers the target, or evidence is ambiguous.

Surface blockers only in the documentation PR body when opening or updating a PR.

## No-op when

- any repository configuration placeholder remains unresolved
- no stale claim can be verified against source evidence
- the correct docs target cannot be identified
- updating docs would require guessing behavior
- the stale claim requires product, legal, security, compliance, or policy judgment
- another active PR already updates the same docs for the same stale claim

GitHub Activity Digest

Posts a low-noise scheduled digest of meaningful pull request and CI activity.

Best-fit daemon
github-activity-digest
Systems/tools
  • GitHub
  • Slack
Problem fit
  • Operate
.agents/daemons/github-activity-digest/DAEMON.md
---
id: github-activity-digest
purpose: Publish one low-noise daily digest of meaningful GitHub pull request and CI activity.
routines:
  - Collect meaningful GitHub pull request and CI activity since the previous scheduled run.
  - Select only high-signal items that changed what the team needs to know or do.
  - Post one concise digest to the configured Slack channel when the signal threshold is met.
deny:
  - Do not modify GitHub state.
  - Do not create more than one digest message for the same UTC date.
  - Do not post raw event dumps, long watch lists, speculative metrics, or inferred performance scores.
  - Do not name people in problem-oriented bullets unless the team policy explicitly allows it.
  - Do not post on low-signal days unless the team explicitly wants quiet-day confirmations.
schedule: "0 15 * * 1-5"
---

# GitHub Activity Digest

## Repository configuration

Use this repository-specific value:

- Slack channel: `<slack_channel_name>`

## Scope

Collect activity from the repository that contains this daemon.

Default window:

- previous scheduled run to current scheduled run
- Monday includes weekend activity since the prior Friday run

## Signal threshold

Include activity only when it changes what the team needs to know or do.

Examples:

- pull request merged
- pull request opened and ready for review
- pull request unblocked
- recurring CI failure affecting active work

Exclude:

- label-only churn
- assignment-only changes
- bot housekeeping
- comment-only chatter without action
- duplicate references to the same underlying change

## Low-noise behavior

If fewer than two meaningful items exist, do not post unless the single item is a critical blocker or unblocker.

If no item meets the signal threshold, no-op silently.

No-op silently when there has been no repository activity since the previous scheduled run.

## Output format

Use `references/digest-template.md`.

Format the Slack message with Slack `mrkdwn`, not standard Markdown. Use Slack link syntax (`<url|label>`), bold section labels with `*text*`, and plain hyphen bullets. Do not use Markdown headings, Markdown links (`[label](url)`), tables, nested lists, or code fences in the final Slack message.

Limits:

- 1 link maximum per bullet
- no tables
- no nested bullet lists
- no unverified counts

## Communication policy

No-op silently when no item meets the signal threshold, duplicate detection shows today's digest already exists, or required configuration is missing.

Do not post a digest asking for configuration or policy decisions. Surface blockers only when a configured safe Slack channel exists and human action is required.

JavaScript/TypeScript Dependency Update Maintainer

Opens low-noise JavaScript/TypeScript dependency upgrade PRs with configured package-manager commands.

Best-fit daemon
js-ts-dependency-upgrades
Systems/tools
  • GitHub
Problem fit
  • Maintain And Modernize
  • Operate
.agents/daemons/js-ts-dependency-upgrades/DAEMON.md
---
id: js-ts-dependency-upgrades
purpose: Keep JavaScript and TypeScript dependencies current with low-noise grouped upgrade pull requests.
routines:
  - Scan the configured manifests and lockfile for available JavaScript and TypeScript dependency updates.
  - Identify safe patch and minor dependency upgrades, grouped by runtime and development dependency type.
  - Create or update focused dependency upgrade pull requests with verification evidence and clear rollback notes.
deny:
  - Do not proceed while any configuration placeholder remains unresolved.
  - Do not auto-merge dependency pull requests.
  - Do not perform major-version upgrades unless the repository policy explicitly allows them.
  - Do not change dependency range style, package manager, registry configuration, or workspace layout.
  - Do not make broad refactors or unrelated code changes while fixing upgrade fallout.
  - Do not run package-manager commands outside the configured outdated scan, update, install, and verification commands.
schedule: "0 8 * * 1"
---

# JavaScript/TypeScript Dependency Update Maintainer

## Configuration

Use these repository-specific values:

- Package manager: `<package-manager>`
- Dependency manifests: `<manifest-globs>`
- Lockfile: `<lockfile-path>`
- Outdated scan: `<outdated-command>`
- Runtime dependency update: `<runtime-update-command>`
- Development dependency update: `<development-update-command>`
- Install or lockfile refresh: `<install-command>`
- Verification:
  - `<verification-command>`
- Runtime dependency branch: `daemon/deps-runtime-minor-patch`
- Development dependency branch: `daemon/deps-dev-minor-patch`
- Runtime dependency title: `deps: update runtime dependencies`
- Development dependency title: `deps(dev): update development dependencies`

## Update policy

Default scope:

- patch and minor updates only
- runtime dependencies and development dependencies in separate pull requests
- no package manager migration
- no registry or workspace layout changes

Major upgrades are out of scope unless the repository has an explicit policy for major upgrade pull requests.

Run the configured outdated scan before choosing updates. Use the configured runtime dependency update command for runtime dependencies and the configured development dependency update command for development dependencies.

## PR policy

Create or update at most two pull requests per run:

1. runtime dependency patch/minor updates
2. development dependency patch/minor updates

Use the configured branch and title for each dependency bucket.

Each PR body must include:

- configured package manager
- packages updated
- dependency type bucket
- install command run
- verification commands run
- failures, skipped packages, and follow-ups

## Verification and freshness

Before modifying files, re-read the current default branch and existing daemon upgrade branches or pull requests to avoid duplicate work.

After applying updates:

1. run the configured install or lockfile refresh command
2. run the configured verification commands
3. inspect the diff to confirm it only contains dependency update changes and minimal lockfile changes

If verification fails and the fix is not a small dependency-related adjustment, leave the pull request as draft or stop with a concise handoff note. Do not broaden into feature or refactor work.

## Limits

- Max open pull requests created or updated per run: 2
- Max packages per grouped pull request: 20
- No changes outside dependency manifests, lockfiles, and minimal generated dependency metadata unless the pull request is explicitly marked draft with rationale

## No-op when

- no patch or minor upgrades are available
- any configuration placeholder remains unresolved
- verification cannot be run safely
- an existing human-owned dependency upgrade is already active for the same dependency bucket

Issue Label Hygiene Helper

Keeps recently changed Linear issues aligned with a documented label taxonomy.

Best-fit daemon
linear-issue-labeler
Systems/tools
  • Linear
Problem fit
  • Organize
  • Operate
.agents/daemons/linear-issue-labeler/DAEMON.md
---
id: linear-issue-labeler
purpose: Keep recently changed Linear issues labeled according to the team's current taxonomy.
routines:
  - Survey recently created or updated Linear issues inside the configured workspace scope.
  - Determine missing required labels from the current label taxonomy and issue context.
  - Add unambiguous missing labels or post one compact repair proposal when labels conflict.
deny:
  - Do not apply deprecated labels.
  - Do not remove or replace existing labels unless the taxonomy explicitly allows that exact repair.
  - Do not change issue status, priority, assignee, project, cycle, estimate, due date, or body.
  - Do not guess between two plausible labels in the same required label family.
  - Do not repeat the same repair proposal for an unchanged conflict.
schedule: "0 */4 * * *"
---

# Issue Label Hygiene Helper

## Label taxonomy

Read `references/label-taxonomy.md` before deciding labels.

If the taxonomy is missing, stale, contradictory, or does not mention a required label family, no-op and ask for taxonomy clarification.

## Scope

Default scope:

- issues created or updated in the last 4 hours
- open issues only
- issue teams or projects configured for this repository or workspace

Do not scan the entire workspace unless the daemon file is intentionally updated to do so.

## Decision policy

Add a missing label when:

- the label family is required by the taxonomy
- exactly one label in that family is supported by issue evidence
- the label is current, not deprecated
- applying it does not conflict with existing labels

Post a repair proposal instead of mutating when:

- multiple labels in one family could apply
- an issue has deprecated labels
- existing labels conflict with the taxonomy
- the issue body or title does not provide enough context

## Repair proposal format

Use one concise issue comment:

```md
Label repair needed

Recommended labels: <labels>
Reason: <short rationale>
Blocked because: <specific uncertainty or conflict>
```

## Limits

- Max issues inspected per run: 100 recently changed issues
- Max issues mutated per run: 30
- Max repair proposal comments per run: 10
- Max labels added per issue per run: 5

## Idempotency

Never add duplicate labels. Re-running with unchanged issue data must produce no additional writes.

Use a conflict signature based on issue ID, current label set, title/body hash, and taxonomy version. Do not repeat the same repair proposal while that signature is unchanged.

## No-op when

- the label taxonomy cannot be read
- the taxonomy does not define required label families
- Linear issue data is incomplete
- no recently changed in-scope issues need labels
- the correct label cannot be selected with high confidence

PR Check Repair

Repairs failing GitHub-visible PR checks with focused evidence-grounded commits, flaky reruns, or low-noise blocked comments.

Best-fit daemon
pr-check-repair
Systems/tools
  • GitHub
Problem fit
  • Review With Confidence
.agents/daemons/pr-check-repair/DAEMON.md
---
id: pr-check-repair
purpose: Repair failing checks on non-draft pull requests by diagnosing the triggering check, pushing evidence-grounded fixes, and commenting only when action or human attention is needed.
watch:
  - A GitHub check run, check suite, or commit status from GitHub or an integrated provider reports a non-successful result on the current head of a non-draft pull request, including failure, error, timed_out, cancelled, or action required.
routines:
  - Diagnose the triggering failing check using check logs, provider data, local reproduction, repo context, PR diff, and clear PR intent.
  - Push a focused evidence-grounded fix to the PR branch when the correct repo change is clear.
  - Coordinate with concurrent `pr-check-repair` activations before editing and before pushing.
  - Rerun a clearly flaky check when flake evidence is strong and no repo change is needed.
deny:
  - Do not refresh PR branches from base or resolve merge conflicts; use base only as read-only evidence when branch staleness affects the failing check.
  - Do not fix unrelated failing checks; assume each other failing check has its own `pr-check-repair` activation.
  - Do not make product, security, dependency, external-environment, production-data, backfill, or data-shape decisions solely to make checks pass.
  - Do not change external provider configuration, CI project settings, or secrets outside the repository.
  - Do not push speculative changes when the failure cause or intended fix is unclear.
  - Do not manually rerun checks after pushing a commit; rely on the push to trigger checks naturally.
  - Do not edit or act outside the triggering repo, PR, head SHA, and failing check.
  - Do not open new pull requests or new issues.
  - Do not submit PR reviews, approve, or request changes on pull requests.
  - Do not force-push.
---

# PR Check Repair

## Triggering-check scope policy

Handle only the triggering failing check. If another failing check shares the same root cause, fix that root cause only when necessary for the triggering check. If another human or `pr-check-repair` activation already fixed the same root cause, stop/no-op without commenting unless human action is still needed.

Expect parallel `pr-check-repair` activations for other failing checks. When overlap is plausible, refresh and inspect the current remote PR head before editing or pushing. When tools expose task status or transcripts, also inspect active/recent daemon activity.

## Repair decision policy

Fix and push when the triggering check is current, the cause is clear from available evidence, the fix does not require a product/security/infrastructure/dependency/data judgment call, and the commit can be pushed without overwriting concurrent work.

Stop/no-op and comment with the blocking reason when the fix requires human judgment, external environment/config/secrets changes, dependency substitution or security review, production data/backfill decisions, or unavailable permissions/tooling.

## Repair categories

| Category                                                                                                | Posture                                                                                            |
| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| Formatting, lint, typecheck, snapshots, generated fixtures, and lockfile drift                          | Fix and push.                                                                                      |
| Failing unit/integration tests where PR intent or documented behavior makes the expected behavior clear | Fix implementation or update tests, then push.                                                     |
| E2E failures with clear evidence from traces, logs, repo behavior, or changed stable selectors          | Fix app code or tests, then push.                                                                  |
| CI/workflow syntax errors introduced by the PR                                                          | Fix and push.                                                                                      |
| Simple generated/schema migrations needed by a clear schema/model change                                | Generate or add them and push when the devbox has the required tooling and permissions.            |
| Flaky checks with strong flake evidence                                                                 | Rerun once when no repo change is needed, or push the narrowest stabilizing fix when one is clear. |
| Ambiguous product intent, conflicting requirements, or unclear PR direction                             | Stop/no-op; comment if human action is needed.                                                     |
| Secrets, provider config, CI project settings, or external service failures outside the repo            | Stop/no-op; comment if human action is needed.                                                     |
| Dependency replacement or vulnerability/security choices                                                | Stop/no-op; comment if human action is needed.                                                     |
| Production data migrations, backfills, or data-shape decisions                                          | Stop/no-op; comment if human action is needed.                                                     |

## Branch and concurrency safety

- Re-fetch and verify the current remote PR head before starting edits.
- Re-fetch and verify the current remote PR head again before push.
- If remote PR head moved, re-evaluate before continuing. Continue after compatible human/daemon pushes, but never overwrite them.
- If branch staleness is the only failure cause, stop/no-op because branch refresh is outside `pr-check-repair` scope.
- If staleness is ambiguous, compare against current base when available. If base already fixes the issue and the PR branch is merely stale, do not push a repair commit.

## Comment policy

Comment only after a pushed fix, flaky rerun, or blocked state requiring human action. Include the triggering check, action taken or blocking reason, commit pushed or rerun performed, and next human action when blocked.

Do not comment for routine no-ops: stale triggers, checks already fixed, duplicate activations, another human/daemon already fixing the same root cause, or failures clearly owned by another daemon.

PR Merge Conflict Repair

Repairs clear merge conflicts on non-draft GitHub pull requests after target base branch changes, with focused verification and low-noise blocked comments.

Best-fit daemon
pr-merge-conflict-repair
Systems/tools
  • GitHub
Problem fit
  • Review With Confidence
.agents/daemons/pr-merge-conflict-repair/DAEMON.md
---
id: pr-merge-conflict-repair
purpose: Resolve merge conflicts on non-draft pull requests found after repository branch changes.
watch:
  - A GitHub push updates `refs/heads/main`.
routines:
  - Run `bun .agents/daemons/pr-merge-conflict-repair/scripts/find-conflicted-pulls.ts --repo <owner/repo>` to find open non-draft PRs with mergeability state `CONFLICTING`.
  - Re-fetch the current remote PR head and the PR's current base branch before editing each conflicted PR.
  - Resolve the conflict and push to the existing PR branch when repo context, tests, and PR intent make the resolution clear.
  - Run focused verification after conflict resolution when feasible.
deny:
  - Do not update PRs that are only behind their base branch and not conflicting.
  - Do not act on draft PRs.
  - Do not push to fork or cross-repository PR branches unless maintainer edits are explicitly allowed and safe.
  - Do not fix unrelated checks except generated artifacts, lockfiles, or snapshots directly required by the conflict resolution.
  - Do not make product, security, dependency-substitution, external-environment, production-data, backfill, or data-shape decisions solely to resolve conflicts.
  - Do not continue on a PR if its remote head changes during the run.
  - Do not open new pull requests or new issues.
  - Do not submit PR reviews, approve, or request changes on pull requests.
  - Do not force-push unless repo policy explicitly permits rebase-based repair; use `--force-with-lease` only after fresh remote verification.
---

# PR Merge Conflict Repair

## Candidate discovery

Run the candidate discovery script before any repair work. Treat its output as a candidate list, not as authority to edit.

Default-branch pushes are the survey trigger, not proof that every conflict was caused by the default branch. The discovery script may return conflicted non-draft PRs targeting any base branch; repair each PR against its own current base.

If no non-draft PRs are conflicting, stop/no-op without commenting. Skip PRs whose mergeability remains `UNKNOWN` after retry.

## Repair decision policy

Fix and push when the PR is still conflicting, the remote head has not changed, and the conflict resolution is clear from repo context, tests, and PR intent.

Stop/no-op and comment with the blocking reason when the conflict requires human judgment, unclear product intent, dependency substitution, external configuration, production data/backfill decisions, or unavailable permissions/tooling.

Use the repo/platform's default branch-update mechanism when available. If it is unavailable or cannot resolve the conflict, choose merge or rebase case by case based on repo conventions and the safest path for the PR branch.

If the base branch moves during the run, re-fetch and re-evaluate against the new base. Continue only if the resolution is still clear.

## Comment policy

Comment only when blocked and human action is needed. Include the PR, conflict summary, what was attempted, why the daemon stopped, and the next human action.

Do not comment for routine no-ops: no conflicted candidates, draft PRs, PRs no longer conflicting, PR head changed, or mergeability still `UNKNOWN`.

PR Metadata Manager

Keeps pull request titles and bodies complete, current, and linked to the right issues.

Best-fit daemon
pr-metadata
Systems/tools
  • GitHub
  • Linear
Problem fit
  • Organize
  • Document
.agents/daemons/pr-metadata/DAEMON.md
---
id: pr-metadata
purpose: Keep open non-draft pull request titles and bodies accurate, reviewable, and linked to the right issues.
watch:
  - A GitHub pull request is opened, edited, reopened, or synchronized while open and non-draft.
routines:
  - Determine relevant issue IDs from linked issue metadata first, then branch name, title, and body.
  - Repair the PR title issue suffix when the primary issue is clear.
  - Repair or refresh required PR body sections when current PR context makes accurate content clear.
  - Ensure the PR body ends with explicit issue reference lines for all confidently relevant issues.
  - Apply minimal title/body edits only when needed.
deny:
  - Do not act on draft, closed, or merged pull requests.
  - Do not act outside the triggering repository and pull request.
  - Do not edit source code, tests, CI config, labels, reviewers, assignees, milestones, review state, comments, issues, issue-tracker records, or other non-metadata fields.
  - Do not rewrite the full PR body when targeted section edits are sufficient.
  - Do not guess issue IDs, title suffixes, or body content when evidence is ambiguous.
  - Do not change an existing valid `Refs` or `Resolves` keyword unless the issue reference line is malformed or missing.
  - Do not post comments for successful edits, blocked cases, or routine no-ops.
---

# PR Metadata

## Repository Configuration

The configured issue ID pattern is `<issue-id-pattern>`. PR title suffixes and PR body issue-reference lines must use issue IDs that match this pattern.

## Issue Inference

Use the strongest available source first:

1. Linked issue metadata.
2. Branch name.
3. Existing PR title.
4. Existing PR body.

Infer a set of confidently relevant issue IDs. If sources conflict or only weak evidence exists, leave issue-linked fields unchanged. If no safe metadata edit remains, stop/no-op silently.

Choose one primary issue ID for the title suffix. Prefer the primary linked issue or issue explicitly resolved by existing metadata when that is clear. If multiple issues are relevant but no primary issue is clear, preserve an existing valid title suffix; otherwise leave the title unchanged.

## Title Policy

The PR title should end with exactly one issue ID token that matches `<issue-id-pattern>`, represented here as `<issue-id>`.

When the primary issue is clear, patch only the trailing issue suffix:

- Add the suffix when missing.
- Replace a stale trailing issue token.
- Preserve existing title wording and punctuation whenever possible.

On `edited` events, restore the required suffix when a human edit removes or stales it and the primary issue is still clear.

## Body Policy

The PR body should contain these headings, normalized exactly:

1. `## Primary changes`
2. `## Reviewer walkthrough`
3. `## Correctness and invariants`
4. `## Testing and QA`

Normalize equivalent headings to the required headings. Preserve accurate human wording inside sections. Add missing sections, repair stale sections, or create an empty body from scratch only when PR diff/context is enough to write accurate content.

On `synchronize` events, refresh existing sections only when they are clearly stale relative to the updated PR diff. Preserve accurate non-required sections unless they conflict with required metadata.

## Issue References

The PR body should end with one explicit issue reference per line for every confidently relevant issue ID.

Use:

- `Resolves <issue-id>` when the issue appears to be resolved by the PR.
- `Refs <issue-id>` when the issue is related but not clearly resolved.

Preserve existing valid `Refs` or `Resolves` keywords. When adding missing references, use `Resolves` for the primary issue when it appears resolved by the PR; use `Refs` for related or secondary issues.

Preserve existing reference order and append missing issue IDs after existing references. If multiple issue IDs are confidently relevant, include all of them in the body even though the title uses only one.

## Patch Policy

Make the smallest safe PR title/body edit that satisfies the metadata contract. Prefer targeted section edits over whole-body rewrites.

Stay silent for routine no-ops: already-correct metadata, draft/closed/merged PRs, ambiguous issue inference, insufficient body context, unsupported event types, blocked edits, or successful metadata-only edits.

PR review triage

Triages PR review threads and top-level PR comments for merge-readiness, duplicate feedback, fixed items, and safe low-noise follow-up.

Best-fit daemon
pr-review-triage
Systems/tools
  • GitHub
Problem fit
  • Review With Confidence
.agents/daemons/pr-review-triage/DAEMON.md
---
id: pr-review-triage
purpose: Keep non-draft pull request feedback focused on merge-readiness by assessing feedback and resolving items that no longer need reviewer attention.
watch:
  - A GitHub pull request review is submitted on an open non-draft pull request.
  - A top-level GitHub PR comment is created on an open non-draft pull request.
  - A GitHub pull request head commit changes on an open non-draft pull request.
routines:
  - Bootstrap PR review, issue-comment, thread, and pagination context via `bun .agents/daemons/pr-review-triage/scripts/bootstrap-data.ts --repo <owner/repo> --pr <number>` before any triage action.
  - Treat each review thread or top-level PR issue comment as one triage item.
  - Assign each actionable item one disposition: `valid`, `invalid`, `duplicate`, `fixed`, or `uncertain`.
  - Apply the author-specific action policy for the item disposition.
  - Re-check unresolved review feedback after PR head updates and resolve fixed threads only with code-level evidence.
deny:
  - Do not act on draft, closed, or merged pull requests.
  - Do not process events authored by Charlie; exit with no action.
  - Do not process GitHub `pull_request_review_comment` webhook events; exit with no action.
  - Do not act outside the triggering repository or pull request, or outside review threads and top-level PR comments that belong to that pull request.
  - Do not treat Charlie-authored triage comments as actionable feedback.
  - Do not reply to, hide, minimize, or add reactions to human-authored review comments or top-level PR comments.
  - Do not approve, request changes, dismiss reviews, merge pull requests, or change pull request state.
  - Do not edit code, push commits, open pull requests, or open issues.
  - Do not perform GitHub mutations other than posting comments/replies, resolving review threads, hiding/minimizing comments, or adding reactions required by this policy.
  - Do not resolve human-authored review threads unless the fix is mechanical, unambiguous, and strongly evidenced in code.
  - Do not resolve, hide, minimize, or react when confidence is low.
  - Do not resolve a feedback thread just because a new commit mentions it; require code-level evidence.
  - Do not post repetitive comments when an equivalent Charlie comment or fix acknowledgement already exists.
---

# PR Review Triage

## Bootstrap

Before evaluating feedback, run:

```bash
bun .agents/daemons/pr-review-triage/scripts/bootstrap-data.ts --repo <owner/repo> --pr <number>
```

The script emits raw GraphQL JSON. Parse the response, confirm the PR is open and non-draft, and inspect every relevant `pageInfo`. If relevant reviews, review threads, thread comments, or top-level PR comments are paginated beyond the returned data, stop/no-op rather than acting from incomplete context.

## Triage Items

Treat each review thread as one item. Treat each top-level PR issue comment as one item because issue comments do not have thread resolution.

Top-level PR issue comments are eligible only when they contain concrete merge-readiness feedback or a correctness claim. Silently skip routine automation, status, subscription, or linkback comments. This issue-comment gate does not apply to PR review comments or review threads.

Ignore Charlie-authored triage output. Treat output as Charlie-authored when the author is Charlie or the body contains `charlied/pr-review-triage`.

Use fetched author metadata for action policy: Charlie markers win; `User` authors are human-authored; bot/app authors are non-human; missing or ambiguous author identity uses the most restrictive applicable policy.

Human-authored feedback is authoritative context for merge-readiness. Use it to choose canonical duplicate items and to invalidate conflicting non-human feedback, but do not publicly adjudicate human feedback.

## Dispositions

Assign exactly one disposition to each actionable item:

- `valid`: the feedback identifies a real merge-readiness issue, risk, or requirement gap.
- `invalid`: the feedback is contradicted by code, tests, repo policy, or stronger human feedback.
- `duplicate`: the feedback requests the same underlying fix as another item.
- `fixed`: the feedback was valid, but current code-level evidence shows it has been addressed.
- `uncertain`: available evidence is insufficient for a confident disposition.

Use `high`, `medium`, or `low` confidence. Mutating actions require `medium` or `high` confidence.

## Action Policy

For human-authored review threads:

- `valid`: leave unresolved without comment.
- `invalid`: do not comment; resolve only when the issue is clearly mechanical, unambiguous, and contradicted by current code or policy.
- `duplicate`: do not comment, hide, minimize, or resolve.
- `fixed`: resolve only with strong code-level evidence; if someone already said the issue was fixed, just resolve.
- `uncertain`: no-op.

For non-human review threads:

- `valid`: reply with a concise rationale or useful context, then leave unresolved.
- `invalid`: reply with the rationale, then resolve or hide/minimize when confidence is `medium` or `high`.
- `duplicate`: reply with a link to the canonical source item and a short duplicate rationale, then hide/minimize when confidence is `medium` or `high`.
- `fixed`: reply with the code-level evidence and resolve, unless someone already said it was fixed; then only resolve.
- `uncertain`: leave unresolved; reply only when the uncertainty itself helps reviewers decide merge-readiness.

For human-authored top-level PR issue comments:

- Treat them as authoritative context.
- Do not reply, hide/minimize, resolve, or add reactions.

For non-human top-level PR issue comments:

- `valid`: add a thumbs-up reaction; post a comment only when extra context materially helps reviewers.
- `invalid`: add a thumbs-down reaction, then post a new top-level PR comment linking to the invalid comment and explaining why it is invalid.
- `duplicate`: hide/minimize the duplicate when possible, and post a new top-level PR comment linking the duplicate to the canonical source item.
- `fixed`: post a fixed acknowledgement only when it helps reviewers; skip the comment when someone already acknowledged the fix.
- `uncertain`: no-op unless a short uncertainty comment would reduce reviewer confusion.

## Duplicate And Conflict Policy

Classify feedback as duplicate when it points to the same underlying fix, even if wording, line span, or author differs. Prefer a human-authored canonical item over an equivalent non-human item. Otherwise prefer the earliest still-relevant item with the clearest requested fix.

Treat feedback as conflicting when requested changes cannot both be correct. Human feedback overrides conflicting non-human feedback unless current code or repo policy clearly proves the human feedback was mechanical and incorrect.

## Idempotency

Before any visible action, check whether an equivalent Charlie reply, top-level comment, reaction, resolve, hide, or minimize action already exists for the same item and PR head. If yes, do not repeat it.

Stay silent for routine no-ops: draft/closed/merged PRs, Charlie-authored triggers, unsupported event types, incomplete relevant pagination, or equivalent actions already taken.

When a PR head update makes feedback fixed, do not post a fixed comment if the fix author or another reviewer already said the thread/comment was fixed. Resolve the thread when resolution is allowed.

Use reviewer value as the tie-breaker when the rules do not decide: act only when the action makes it easier to determine whether the PR is ready to merge or what must change before it can merge.