Skip to content
← Public packages

@kentcdodds/friction-log

File friction to GitHub or wake Patch; daily sweep groups friction issues with Clef, one Devin session per group. All-issues mode covers every open issue.

FollowFork

OtherTopics: friction, github-issues, devin, clef, kody, contributing, patch, qualify, issue-sweep

Version
0.8.0
License
Published
November 5, 2026
Pinned commit
efdd4b7
Rating
★ 5.0 (1)
Forks
0
Adaptation effort
2.0

README

Agent docs

@kentcdodds/friction-log

Intent

Capture durable friction (recurring, clear-owner, reproducible contract gaps) and route each papercut to the right place:

  • host: 'github': GitHub issue labeled friction on the caller's owner/repo (dedupe/reuse by title). Use repo: 'kody-hq/kody' when the platform repo is the intended target.
  • host: 'kody': wake Patch for that Kody package (no GitHub issue).

Separately, every day at 5am America/Denver the package sweeps open friction issues in each sweep repo (sweepRepos in src/shared.ts: kody-hq/kody and kentcdodds/mediarss). It groups them by area and starts one Devin session per group. Each session works its group and ships at most one PR through @kentcdodds/ship-pr.

Success for the sweep: an already-fixed or invalid issue is closed, and low-or-medium-risk fixes ship in the group's PR and merge through ship-pr.

When an issue waits on the owner. Only when a fix needs the owner's product direction: a user-facing change in behavior or a breaking change to users' packages (public APIs, package runtime behavior, CLI or MCP contracts, removing or renaming something users rely on). Examples: changing search result ordering as a product choice, changing billing amounts or plans, or forcing users to sign in again. Everything else is fixed by the session, including bug, security, and performance fixes in the extra-care areas below, internal refactors, large internal work, tests, tooling, CI, docs, and internal product calls it can make sensibly. Size or uncertainty alone is never a reason to hand an issue to the owner. Friction modes mark owner issues friction-skipped; the all-issues and re-evaluation modes use needs-kent. Either way the issue gets a recommendation comment that describes the user-facing change.

Extra-care areas. Auth, tenant or per-user isolation, billing, data-dropping migrations, backups and disaster recovery, secrets and credentials, security hardening, token handling, search ranking, and publish idempotency (src/extra-care.ts). Fixes there are on autopilot with a checklist: add tests, never log or print secrets, keep migrations reversible or backfilled with no silent data loss, ship with ship-pr risk high so the full AI review gate applies (then merge with mergeAuthority: true), and keep the diff minimal. Issues whose labels or title hit an area are tagged extraCare in the prompt; nothing is excluded or labeled for it.

What it does

  • Qualify: soft gates before create/file so one-off session confusion and "how do I use this once" reports get a clear skip path (principles, not a title deny-list)
  • Create: require target: { host, repo }; GitHub file/reuse or Patch wake
  • File: batch with one top-level target applied to all items; returns filed / reused / woke / skipped (dryRun supported)
  • Scan: read-only plan of the daily sweep (never starts a session)
  • Sweep: list, select, group, and start one Devin session per group (dryRun: true previews the groups and prompts without starting anything)
  • Backlog: one-time pass over every open friction issue except needs-kent, including previously skipped ones (dry run unless confirmed)
  • All issues: same grouped Devin flow over every open issue in repos marked allIssues (friction issues only in the other sweep repos), with owner-decision issues left out (dry run with dryRun: true)
  • Daily job: 5am America/Denver wrapper used by the scheduler
  • Pause / resume: kill switch for automatic sessions
  • Status: operator snapshot with the live eligible count per repo
  • Record-outcome: final report from each sweep session

What counts as friction

Two kinds (kind on ./create and ./file):

  • general (default): a durable, recurring, clear-owner, reproducible contract, API, or docs gap.
  • wasteful-context: docs, skills, or comments that cost readers context or mislead them: too much detail, missing progressive disclosure, inaccurate code comments, or stale or inaccurate docs. A valid repro is relevantFiles with the path and line range (docs/x.md:10-80) plus cost holding the claim versus reality or the context wasted (extra reads or tokens). GitHub filings also get the friction:wasteful-context label (created when missing). The sweep treats them as normal autopilot work.

Qualification bar (soft skip)

Skip (do not throw) when any of: missing/invalid target; structured filing missing preliminaryInvestigation (and no body); missing reproducible gap (no howToReproduce, no body, structured fields too thin); looks transient/session-bound (heuristic: no howToReproduce, empty cost, short whatHappened); unknown kind; GitHub title empty after Friction: normalize. relevantFiles plus cost counts as a repro for both heuristics. Prefer either kind above.

Every structured papercut should carry a short preliminary investigation: what was already looked at, plus relevantFiles when any paths look relevant. Do not invent a root cause. Do not require a file list when none is known. Keep it short, not a second copy of a full issue thread. A raw body may include the same section inline.

How the sweep picks and groups issues

  1. Lists open friction issues per repo (titles, labels, bodies; no comments).
  2. Keeps the eligible ones. Daily: not friction-skipped and not needs-kent. Backlog: not needs-kent.
  3. Leaves out issues that a still-open session or an unmerged sweep PR already holds, and issues any open PR references (another agent covers them). At most 100 issues are held at once across all sessions.
  4. Ranks by priority label (P1 first), then oldest first, and keeps what fits: at most 5 groups per run and 20 issues per group.
  5. Clusters each repo's selection by area with Clef, Cloudflare's decision model on Workers AI. If Clef fails or returns anything malformed, a deterministic keyword rule takes over for those issues. One group is used whenever everything fits in one; a group is never a lone stray issue (strays fold into the nearest group), except when a repo has only that one issue.
  6. Fetches comments only for the issues it grouped, then writes one prompt per group and starts one Devin session per group.

Sweep PRs use a branch starting with friction-log/. @kentcdodds/ship-pr skips its "file leftover friction" step for those branches, so a sweep PR does not create new friction issues for the next sweep.

Sessions ship as the owner. Each session is created as the default Devin user saved in @kentcdodds/devin settings (which gives it Kody access), and it never uses git push or its own GitHub integration. It pushes commits and opens its PR with ./push-branch, which writes through the owner's GitHub account in @kentcdodds/github (account kent, OAuth github-kent). So the commits and the PR are owner-authored and owner-only review tooling (such as Bugbot) runs on them. ./push-branch only accepts sweep repos and friction-log/ branches, and never force-pushes. Workflow files under .github/workflows/ are allowed and always ship with ship-pr risk high. A live run starts no sessions when no default Devin run-as user is saved.

At most one spawning daily run per Denver calendar day. To add a repo, append it to sweepRepos with its policy doc (and, optionally, its own areas) and republish; the repo needs the friction and friction-skipped labels.

All-issues mode

./all-issues runs the same flow as the daily sweep with a wider net. For a repo marked allIssues: true in sweepRepos (today kody-hq/kody) it lists every open issue, not only friction. Other sweep repos stay friction-only, so this mode covers everything the daily sweep covers.

Left out of every group:

  • needs-kent, or any equivalent owner-decision label (requires-kent, waiting-on-kent, and similar)
  • friction-skipped (same rule as the daily sweep)
  • issues an open PR references, and issues an in-flight session holds

Issues in extra-care areas are included and follow the extra-care checklist.

Each session validates its issues first, then picks one outcome per issue: fixed (in the group's PR), already-fixed or stale (closed with a comment explaining why), waiting (a date, soak, or metric gate has not passed), needs-kent (a fix needs the owner's product direction: label plus a recommendation comment that describes the user-facing change), or not-reached (out of time). Caps, ordering, branch prefix, owner-authored pushes, and the in-flight budget are the same as the daily sweep. Branches look like friction-log/<day>-issues-<theme>.

Prompts are capped at 28000 characters (Devin rejects 30000 or more). Issue bodies and comments shrink evenly to fit, down to titles and links only; sessions read full issue details from GitHub themselves.

The daily job (5am America/Denver) runs ./src/jobs/daily-all-issues.ts, so the scheduled run is the all-issues mode. ./daily stays available as the friction-only wrapper for manual runs.

Re-evaluating needs-kent issues

./reevaluate-needs-kent sends open needs-kent issues (and equivalent labels) back through the grouped Devin flow under the rule above. It leaves out issues an open PR references and issues an in-flight session holds; issues: [...] limits a run to specific numbers. Same caps and Clef grouping; branches look like friction-log/<day>-reeval-<theme>.

Each session reads every comment first. An owner decision is followed, and an owner request to wait leaves the issue as it is. Otherwise, when no product direction is needed, the session removes needs-kent, comments briefly why, and fixes the issue in its PR or closes it as already fixed or stale. When a user-facing change is needed, the label stays and the session makes sure a clear recommendation comment describes that change. Dry run unless confirm: true; at most one spawning run per Denver day unless force: true (in-flight rows still prevent overlap).

Prerequisites / setup

  1. Depends on @kentcdodds/github (default bot account, secret github-botAccessToken; ./push-branch uses the kent account, OAuth github-kent), @kentcdodds/devin (secret devinServiceUserKey plus its saved org and default user), @kentcdodds/jev (secret cloudflareApiToken for Clef), and @kentcdodds/grok-bot (Patch wake). Approve host/package access if prompted.
  2. Keep the package daily job enabled unless you intentionally pause with ./pause. Do not disable live webhooks/jobs casually.
  3. Agents must pass an explicit target on ./create / ./file: no silent default host, no aliases. Prefer those exports over gh so GitHub issues get the friction label.
  4. Agents: see AGENTS.md for import paths and dry-run smoke.

Done when

  • ./status shows enabled: true (or you intentionally paused) and the live eligible counts per repo
  • ./scan / ./sweep({ dryRun: true }) lists the planned groups without starting sessions
  • ./backlog() (no arguments) previews the one-time pass without starting sessions
  • ./reevaluate-needs-kent() (no arguments) previews the re-evaluation groups without starting sessions
  • ./all-issues({ dryRun: true, includePrompts: false }) lists exclusions (repos[].excluded) and the planned theme groups without starting sessions or writing labels
  • ./create({ dryRun: true, target: { host: 'github', repo: 'kody-hq/kody' }, … }) previews without posting
  • A would-skip qualify case returns { ok: true, skipped: true, reason }
  • ./create({ dryRun: true, target: { host: 'kody', repo: '@scope/leaf' }, … }) dry-runs Patch wake
  • ./file({ dryRun: true, target, items: […] }) previews a batch
  • The live daily sweep starts at most 5 sessions per Denver day, holds at most 100 issues at once, and each session ships at most one PR
Report this listing

Log in to report this listing.