본문으로 건너뛰기

blader/first-responder

An AI agent skill that acts as the first responder for your oncall Slack channel: investigates incidents, posts evidence-backed findings, and drives validated fix PRs

https://skillcdn.ai/gh/blader/first-responder

내 AI에 이 주소를 연결하면 이 스킬을 쓸 수 있어요. 연결 방법 보기

  • 미확인
  • 기본 브랜치main
  • 커밋10734e9
  • 라이선스MIT
  • 검색단어
GitHub에서 보기

first-responder

Use when asked to watch an oncall Slack channel, triage a new incident or alert thread, post first-pass investigation findings, or drive a validated fix PR from an incident report. Defaults to a continuous monitoring loop over the team's oncall channel (default #oncall) until explicitly told to stop.

경로
SKILL.md
라이선스
MIT

First Responder

Overview

Use this skill to run a full oncall first-response loop against your team's incident channel. Default behavior is continuous monitoring of the oncall channel (default #oncall) with a ten-minute poll interval unless the user gives a different interval, a specific thread, a narrower sweep, or explicitly tells you to stop. Detect new incident threads, investigate them quickly but rigorously, build the highest-fidelity reproduction you can before editing, reply in-thread with an evidence-backed initial assessment, and — when the active fix policy allows — proceed into the code-fix and draft-PR path.

Read references/investigation-checklist.md before posting the Slack reply or starting the fix branch.

Configuration

The skill is zero-config by default: every binding either comes from the environment at run time or has a working default. Run it from a checkout of the repo you want monitored, with Slack connected, and it runs.

Team-specific setup lives in CONFIG.md in this skill's directory — created from CONFIG.example.md and gitignored, so updating the skill (git pull) never conflicts with a team's setup. Never edit this SKILL.md (or the other tracked files) for team setup; this file should stay identical to upstream. If CONFIG.md does not exist, run on pure defaults. Cache resolved channel ids in CONFIG.md directly; for anything else worth remembering — an override the user gives you, observability knowledge you discover — offer to write it into CONFIG.md. Either way, create the file from CONFIG.example.md first if needed.

Derived from the environment at run time (no setting exists for these):

  • The repo — the current checkout (git rev-parse --show-toplevel). Run the agent from the repo it should investigate and fix.
  • The base branch — the repo's default branch (from origin/HEAD). Worktrees branch from it and PRs target it.
  • The timezone — the system's local timezone. All Last updated: stamps use it.
  • The Slack workspace — from the connected Slack runtime (team info, or the domain of any message permalink). Used to build permalinks.

If a derived value resolves wrong for this team — say origin/HEAD points at the wrong branch — ask the user once for the correct value, then offer to record it as an override in CONFIG.md.

Defaults (override in CONFIG.md, never by editing this table):

KeyDefaultNotes
oncall_channel#oncallThe channel to monitor.
oncall_channel_idauto-resolveResolved from oncall_channel by Slack channel search on first use. After resolving, cache the id in CONFIG.md so future runs skip the lookup.
feed_channel#feed-oncall-automationCompanion channel for detailed automation updates. If it does not exist, ask the user once whether to create it; if it stays unavailable, use single-thread fallback mode. Set to none to disable deliberately.
feed_channel_idauto-resolveSame caching rule as oncall_channel_id.
repo_docsCLAUDE.md, AGENTS.mdRepo docs to read before investigating, plus any agent-docs index they point to. Read the ones that exist; skip missing files silently.
fix_policyreply-onlyalways | confident-only | reply-only. Graduate per the README's trust ramp. See "Fix And PR Decision".
automation_markerFirst responder:Opening-line marker on every automation message so nobody mistakes it for a human.

If a default fails to resolve at run time — the oncall channel name does not exist in this workspace, the repo has no remote — ask the user once for the right value, then offer to record it in CONFIG.md.

Three further pieces of org knowledge are processes, not parameters, so they live as prose sections of CONFIG.md rather than override keys:

  • "Your team's observability stack" — the one with no useful generic default; investigation quality depends on it. When absent, the first run self-discovers (see "Observability").
  • "Your team's environment" — optional; see "Production-Shaped Reproduction".
  • "Your team's post-PR process" — optional; see "Post-PR Follow-Through".

The reply templates in references/investigation-checklist.md use First responder: as the marker; substitute the automation_marker override everywhere it appears if CONFIG.md sets one.

Non-negotiables

  • Treat the Slack thread as an index into evidence, not as the evidence itself.
  • For every actionable oncall ticket — unless feed_channel is set to none — create or reuse one companion automation thread in the feed channel (default #feed-oncall-automation) and keep substantive automation updates there.
  • Treat every ticket with a companion-thread registry entry and ticket_open=true as an open tracked object that must be revisited on every monitor poll, even if no new oncall parent or Slack reply appears.
  • Treat new human or bot replies inside open companion feed threads as monitored state changes, not just background context.
  • In the original oncall thread, create at most one automation bridge message per ticket unless a human explicitly asks for another on-thread update — with one exception: once the investigation reaches a definitive solution, post exactly one solution reply in the main oncall thread (see "Definitive Solution Reply").
  • The oncall bridge message must link to the companion feed thread exactly once so detailed reading is opt-in.
  • After the bridge message exists, update that same oncall message in place with new summary state instead of posting new automation messages in the main oncall thread.
  • Every bridge-message edit must include a Last updated: timestamp in the local timezone, with the timezone abbreviation included so readers elsewhere are not misled.
  • After the bridge message exists, post all later detailed automation updates, PR links, repro notes, and pipeline status to the companion thread instead of the main oncall thread.
  • Post proactive companion-thread updates whenever PR state, CI state, repro state, or the current theory materially changes. Do not wait for a new oncall reply to narrate those changes.
  • If the runtime cannot edit Slack messages in place, do not post extra automation replies into the oncall channel as a workaround. Keep the original bridge message as-is, continue detailed updates in the companion thread, and report the bridge-edit blocker explicitly.
  • Use exact dates and times in Slack replies and final summaries when the issue is time-sensitive.
  • Do not claim a root cause without at least one production signal plus one code or config signal.
  • For plausible repo bugs, attempt a concrete reproduction before editing. Do not let a persuasive code read substitute for a missing repro when a repro is still practical to build.
  • Prefer the highest-fidelity reproduction available: exact request replay, failing automated test, minimal script or harness, or a tightly specified manual flow with captured logs and outputs.
  • When the failure is data-shaped — tied to a specific org or customer, production data scale, or real schema state that seed data cannot mimic — reach for a production-shaped reproduction (see "Production-Shaped Reproduction") instead of settling for a lower-fidelity repro.
  • Treat reproduction as a ladder, not a binary. If exact reproduction is not possible, keep stepping down in fidelity until you have the best defensible local signal and state the remaining gap explicitly.
  • Before investigating any newly detected actionable oncall issue, first sync the current worktree from the remote base branch (the repo's default branch unless overridden) so code reads and any follow-on fix branch start from fresh repo state.
  • Do not open a PR for infra noise, unverified hunches, cross-repo fixes, or issues that need product direction first.
  • Never edit the operator's current checkout for the fix path. Create a separate worktree first.
  • A fix is not validated until it is tested against the same reproduction artifact used to justify the diagnosis, with a clear before-and-after result.
  • If you create a PR, the fix path is incomplete until the post-PR follow-through (see "Post-PR Follow-Through", including any team-specific process documented there) has actually been carried out on that exact PR branch.
  • Do not treat local validation, ad hoc cleanup, or a passing initial check as a substitute for the post-PR follow-through.
  • After PR creation, the only valid path is: complete the post-PR follow-through -> post the follow-up Slack reply -> continue monitoring. Do not stop earlier unless the user explicitly tells you to skip that path.
  • If Slack write tools are unavailable in the runtime, produce the exact thread reply text and say that the post could not be sent automatically.
  • If the observability platform is unreachable, say exactly what access was attempted, continue with thread and code evidence only, and label the missing production signal explicitly — the two-signal rule above still applies, so an unreachable platform caps you at a theory, not a root-cause claim.
  • If the feed channel or companion-thread creation fails, say so explicitly and fall back to the single-thread behavior instead of dropping updates entirely.
  • If GitHub publish tools or gh auth are unavailable, stop before push/PR creation and report the blocker clearly.
  • When a diagnosis or fix is corrected, refuted, or superseded — by a human, by new evidence, or by a better fix — run the "Learning Extraction When You Get It Wrong" workflow before moving on. A correction must produce durable memory entries, not just thread edits.

Learning Extraction When You Get It Wrong

Treat any of these as a correction event:

  • A human says the fix or diagnosis is wrong, or supersedes it with a different root cause or remediation.
  • New production evidence overturns a theory already posted to Slack, or invalidates the reproduction the diagnosis rested on.
  • The automation's PR is demoted, closed, or replaced in favor of a different fix.
  • A validation artifact turns out to have encoded the same wrong assumption as the code it validated.

On every correction event, do all of the following:

  1. Extract the lesson, not just the fact. Write down what conclusion was wrong, why the reasoning produced it (the question that was never asked, the affordance never checked, the assumption never tested), and the generalized rule that would have prevented it. "The fix was X not Y" is a fact; "reproducing a misconfiguration is not the same as reproducing a bug — ask why the intended mechanism didn't work" is a lesson.
  2. Persist each lesson to durable agent memory using the runtime's memory system, so future sessions recall it before making the same class of mistake. Include: what went wrong, why, and how to apply the rule next time. Update existing memory entries instead of duplicating them.
  3. Correct the record in ticket state per the existing rules: companion-thread correction post, registry notes update, PR demotion or deferral comment as applicable.
  4. Audit this skill. If the lesson is about the oncall process itself rather than project specifics, update this skill (or its references) so the process improves.
  5. Report it. The next run report must include a short "what was wrong and what was learned" note instead of silently absorbing the correction.

Lesson shapes that recur and are always worth saving: solving a symptom at the wrong layer when the product already has a configuration affordance for it; mistaking an exact repro of a misconfigured state for an exact repro of a defect; tests that pass because they encode the author's own wrong assumption; guards keyed on flags or modes when the truth is initialization state.

Entry Modes

Use one of these modes based on the request. If the user invokes the skill without specifying a thread, sweep limit, or stop condition, default to Continuous monitor on the oncall channel.

  1. Single-thread mode
    • Use when the user gives a Slack thread URL or asks about one specific thread.
    • Parse the URL with scripts/parse_slack_thread_url.py if needed.
  2. Backlog sweep
    • Use when the user asks for the newest unhandled oncall threads.
    • Read the oncall channel newest-first and process the most recent actionable parents first.
  3. Continuous monitor
    • Use when the user explicitly asks to monitor the oncall channel, or when the skill is invoked without a narrower scope.
    • Default poll frequency is once every ten minutes. Continue indefinitely until the user explicitly tells you to stop.
    • Drive the loop with whatever recurring mechanism the harness provides (scheduled wake-ups, a loop command, cron). The companion-thread registry is the durable state that makes restarts safe.

Monitoring Workflow

  1. Establish scope.
    • If given a thread URL, parse it and investigate that exact thread.
    • Otherwise read the oncall channel with newest-first ordering and identify candidate parent messages.
  2. Identify actionable new threads.
    • Prefer monitoring-alert, incident, and error-report parents with replies or obvious investigation needs.
    • Skip threads that already contain an investigation reply from the current Slack-connected user, unless the user asked for a refresh.
  3. Before investigating each newly actionable thread, sync the current worktree from the remote base branch.
    • Run from the current worktree before reading code or creating a fix worktree.
    • Prefer git pull --ff-only origin <base_branch> when the current checkout is already on the base branch.
    • If the current checkout is not on the base branch, or the pull cannot fast-forward cleanly, stop and report the sync blocker instead of continuing from stale code.
  4. For continuous monitoring, maintain an in-memory handled set keyed by parent message_ts.
    • Keep the handled set updated whenever a new actionable thread appears or you post a new initial investigation reply so already-processed parents are not re-triaged on the next poll.
  5. Maintain a companion-thread mapping keyed by the oncall parent message_ts.
    • Prefer using scripts/companion_thread_registry.py so the oncall thread and the companion feed thread stay linked across restarts.
    • Create the companion thread before posting substantive automation updates whenever practical.
    • Use the same registry entry as the durable open-ticket lifecycle record: stage, PR metadata, head SHA, whether a follow-up is still owed, and the latest material state hash.
  6. Revisit open tickets on every poll, not just new parents.
    • Load registry entries with ticket_open=true and inspect whether any of them now owe a proactive companion-thread update.
    • Also inspect the companion feed thread for new replies from humans or bots since the last recorded feed-thread activity.
    • A ticket is still open if the issue is under investigation, a PR exists, the post-PR follow-through is in progress, CI is draining, review is active, or a human asked for more follow-up.
    • Only mark ticket_open=false when the workflow is explicitly concluded or a human says to stop tracking it.

Companion Thread Workflow

  1. Resolve the companion channel.
    • Use the feed channel (default #feed-oncall-automation, overridable in CONFIG.md); resolve the channel id by Slack channel search when unknown, then cache it in CONFIG.md.
    • If the channel does not exist, ask the user once whether to create it. If it stays unavailable, or feed_channel is set to none, skip this workflow and use single-thread fallback mode.
  2. Create or reuse one companion thread per oncall parent.
    • The companion parent message should identify the original oncall ticket, include a permalink back to it when available, and act as the single home for ongoing automation narration.
    • Persist the mapping from oncall parent message_ts to companion thread metadata with scripts/companion_thread_registry.py.
    • Treat the companion parent message timestamp as the canonical feed_thread_ts. Do not build the bridge link from a reply timestamp inside that companion thread.
스킬의 지침이 아직 전부 로드되지 않았습니다. 계속 읽어 상위 폴더의 규칙과 필수 내용을 확인하세요.

이 스킬의 파일

지원 파일 전체 둘러보기