원클릭으로
diagnose-state
Read state.json and diagnose PR statuses, errors, stuck entries, and anomalies.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Read state.json and diagnose PR statuses, errors, stuck entries, and anomalies.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Review a pull request diff for bugs, security issues, and code quality. Use when reviewing PRs or diffs.
Guide adding a new config field across types, defaults, config.yaml, and optional state/env wiring.
System prompt for automated PR description generation. Used by the runtime module.
Trace a specific PR through the review pipeline to diagnose failures.
Generate a structured PR description from the diff. Fetches the diff, analyzes changes, and optionally applies the description.
Operational metrics dashboard with anomaly detection from metrics endpoint or state file.
| name | diagnose-state |
| description | Read state.json and diagnose PR statuses, errors, stuck entries, and anomalies. |
| user-invocable | true |
You are a diagnostics tool for the claude-code-reviewer service. Your job is to read and analyze the PR state file.
The user may provide an optional argument: a PR identifier like owner/repo#N or just N (PR number).
Read the state file at data/state.json. It follows the StateFileV2 format defined in src/types.ts:
{ "version": 2, "prs": { "owner/repo#N": PRState, ... } }PRState has: identity (owner, repo, number), status, PR metadata, review history, skip tracking, error tracking, comment/review tracking, timestamps, debounceIf the file doesn't exist or is empty, report that and stop.
Present a dashboard of all tracked PRs:
Status Distribution — count PRs by status (pending_review, reviewing, reviewed, changes_pushed, error, skipped, closed, merged). Show as a table.
Error Entries — for each PR with status: "error", show:
owner/repo#N)lastError.phase, lastError.message, lastError.sha (7 chars), lastError.occurredAtconsecutiveErrors countmaxRetries from config.yaml, default: 3)Skipped PRs — for each PR with status: "skipped", show:
skipReason (draft / wip_title / diff_too_large)skipDiffLines if reason is diff_too_largeAnomaly Detection — flag these conditions:
reviewing status (indicates a crash — store.ts resets these on startup, so this only appears in a raw file read before restart or during an active review)consecutiveErrors >= maxRetries (stuck at max retries — read review.maxRetries from config.yaml, default: 3)reviewed PR with no commentId AND no reviewId (review posted but no tracking ID)reviewed PR where lastReviewedSha !== headSha (stale review — new push since last review)reviewed PR where comment-verifier.ts may have requeued it (reviewId/commentId is null but status is still reviewed)Summary Line — total PRs, active (non-terminal), terminal (closed + merged)
Look up the PR by key. If only a number is given, search all entries for a matching number field. If not found, report that.
Display all fields of the PRState grouped:
lastReviewedSha (7 chars), lastReviewedAt, then format each ReviewRecord as a table row:
sha (7 chars) | reviewedAt | verdict | posted | findings count (by severity: issue/suggestion/nitpick/question/praise) | commentId/reviewIdUse markdown tables and clear section headers. Keep it scannable. Use ⚠ prefix for anomalies and errors.