dotfiles/link/claude/skills/handoff-to-expert/SKILL.md
Create a fully standalone escalation brief for a programming/debugging problem when an agent is stuck, repeated fixes have failed, root cause is uncertain, or the user asks to hand off context to a stronger model, senior engineer, teammate, maintainer, or external expert. Produces a no-prior-context, no-repo-access packet with goal, failure evidence, embedded relevant code/config/examples, attempted fixes, constraints, hypotheses, and verification criteria.
npx skillsauth add kylehughes/knapsack handoff-to-expertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create an expert-ready handoff brief, not another speculative fix. The brief must let a capable engineer diagnose the issue without reading the prior conversation or accessing the repository. It should preserve the highest-signal facts, evidence, constraints, and failed attempts while avoiding noise, secrets, and unsupported claims.
Use this skill when any of these are true:
Do not use this skill for ordinary first-pass debugging, simple code review, or direct implementation unless the user explicitly asks for an escalation-style brief.
When invoked, stop trying to solve the bug unless the user explicitly asks for more coding. Gather and compress evidence into a brief that maximizes the expert's chance of solving the problem.
Assume the expert is operating in a vacuum. They cannot read local files, browse the repository, inspect the previous conversation, access private CI artifacts, open screenshots, run commands, or view attachments unless the handoff directly includes their contents. The expert may use web search for public documentation, but public docs cannot substitute for project-specific code, config, logs, schemas, prompts, examples, or failure output.
File paths, line numbers, commit hashes, test names, CI URLs, screenshots, and artifact names are useful provenance, but they are not enough. If the expert needs a code shape, config value, log excerpt, API payload, schema, UI state, command output, or data example to reason about the issue, embed the relevant contents directly in the brief.
Never imply evidence was inspected, commands were run, or behavior was reproduced unless that actually happened. If information is unavailable, say so precisely and list what would be needed.
The final brief must be independent of:
When including code or configuration, provide enough surrounding context for a vacuum reader to understand it:
// ... unrelated setup omitted ....Never write instructions like "look at path/to/file," "see the screenshot," "check the logs above," or "use the attached diff" unless the needed content is also embedded in the handoff. Use references only as provenance labels or optional follow-up locations for someone who later gains access.
Prefer concrete, recent evidence over memory or narrative. If repository or tool access is available, inspect the smallest useful set of artifacts before writing:
If evidence conflicts, preserve the conflict rather than smoothing it over.
Use targeted inspection. Do not perform a broad, slow crawl when a few files, tests, logs, or diffs are enough.
High-value checks often include:
git diff, changed files, or relevant uncommitted edits when available.Use path:line or path:start-end references when possible, but treat them as provenance labels only. Include every source, config, output, and data excerpt needed to reason about the issue directly in the brief. Avoid dumping large files, repeated logs, or full stack traces unless each part matters; use focused excerpts with explicit omissions.
Redact secrets before including evidence. This includes tokens, API keys, passwords, cookies, private keys, credentials, authorization headers, session IDs, personal data, and internal-only URLs when sharing externally.
Preserve debugging value while redacting. Keep field names, shapes, prefixes/suffixes, error classes, status codes, host categories, and variable names when safe. Use placeholders such as <REDACTED_API_KEY>, <USER_ID>, or <INTERNAL_HOST>.
Never recommend sharing proprietary code, customer data, or private logs externally unless the user has authorized it. When external sharing risk exists, include a sanitized version and note what was removed.
Separate facts, observations, inferences, and hypotheses.
Do not invent prior attempts. If the conversation suggests an attempt but details are unclear, write "Reported/unclear attempt" and explain what is known.
Rank hypotheses by plausibility and diagnostic value, not by confidence alone. Prefer hypotheses that explain all observed symptoms and suggest a decisive next check.
Use this structure unless the user requests a different format.
One short paragraph with:
Explain the intended behavior and why the current behavior is wrong. Include expected vs. actual behavior.
Describe only the context needed to reason about the issue, but make it complete enough for a reader with no repository access:
Provide exact symptoms and reproduction information:
If reproduction is unknown, give the best-known trigger and label gaps clearly.
List the relevant artifacts and why each matters. Use file and line references when possible, then embed the relevant contents directly.
Include:
For each meaningful attempt, include:
Separate attempted fixes from passive observations. Do not include trivial or duplicate attempts unless they prevent rework.
Capture:
Use two subsections:
Confirmed facts
Ranked hypotheses
For each hypothesis, include:
List missing artifacts that would materially improve diagnosis, such as logs, repro data, failing command output, env vars, dependency versions, screenshots, schema state, CI artifact, or relevant file contents.
Only include items that matter. Do not turn this into a generic questionnaire.
If a needed artifact exists but cannot be included safely or was not inspected, list it here with the precise reason. Do not assume the expert can fetch it.
Name exact verification criteria:
End with a direct request. Be specific about what help is needed, for example:
Write for a senior engineer. Be concise, factual, and specific. Use bullets, tables, and snippets where they improve scanability. Avoid vague phrasing like "it doesn't work," "tests fail," or "probably config" without exact supporting evidence.
Prefer a compact but complete brief over a long transcript summary. If compactness conflicts with standalone completeness, choose standalone completeness. Preserve failed attempts and contradictions because they are diagnostic constraints. Avoid conversational filler, apologies, or speculation presented as fact.
Before finalizing, verify that the brief answers:
tools
Use when preparing or verifying a host for Moshi remote coding. Trigger this for SSH or preferably Mosh readiness, non-interactive shell PATH issues, tmux defaults, creating a tmux project session rooted at a chosen directory, adapting shell or tmux behavior with the `MOSHI_CLIENT` env signal, installing Moshi agent hooks for Claude Code or Codex CLI, or offering the optional `moshi DIR` shell helper.
development
Refine and structure prompts for LLMs to ensure clarity, reliability, and optimal performance. Use when writing system prompts, complex instructions, or debugging agent behaviors.
development
Curates context, optimizes prompts with XML, and manages extended thinking for Anthropic Claude models. Use when building Claude-based agents, designing system prompts, or handling long-context tasks.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.