{"slug":"fetch-failed-pr-checks","title":"fetch-failed-pr-checks","summary":"Use when the user asks to check / fetch / list / show failed CI checks (GitHub Actions, external CI) on a GitHub PR — including details/logs of the failures. Pulls the statusCheckRollup, filters to non-passing terminal states, and (for GitHub Actions runs) appends a log excerpt, ","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-11-29T00:43:59.331748Z","repo":{"url":"https://github.com/MotleyAI/living-architecture","stars":16,"forks":2,"license":"MIT","updatedAt":"2026-11-27T11:19:06Z"},"bodyHtml":"<hr>\n<h2>name: fetch-failed-pr-checks\ndescription: Use when the user asks to check / fetch / list / show failed CI checks (GitHub Actions, external CI) on a GitHub PR — including details/logs of the failures. Pulls the statusCheckRollup, filters to non-passing terminal states, and (for GitHub Actions runs) appends a log excerpt, or why there is none.</h2>\n<p><strong>Preflight:</strong> run <code>la-doctor --plugin &lt;this skill's base directory&gt;</code> once per session before using any <code>la-*</code> or <code>trmv-*</code> command; if it fails, stop and show the user its output. If <code>la-doctor</code> is not found, or reports the la tools older than the plugin, stop and give the user the install command at this plugin's <code>version</code> (in its <code>.claude-plugin/plugin.json</code>): <code>uv tool install living-architecture==&lt;version&gt; --with-executables-from type-rename-move</code> in a Python repo, <code>npm install -g living-architecture@&lt;version&gt; type-rename-move@&lt;version&gt;</code> in a TS/JS repo.</p>\n<h1>Fetch failed CI checks (and their log excerpts) for a PR</h1>\n<h2>How to run</h2>\n<pre><code>la-fetch-failed-pr-checks &lt;PR_NUMBER&gt; [--repo OWNER/REPO] [--max-log-lines N]\n</code></pre>\n<ul>\n<li><code>&lt;PR_NUMBER&gt;</code> — required.</li>\n<li><code>--repo OWNER/REPO</code> — optional; defaults to the cwd repo via <code>gh repo view</code>.</li>\n<li><code>--max-log-lines N</code> — cap each failed job's log excerpt at N lines (default 200). Pass <code>0</code> to skip log fetching entirely.</li>\n</ul>\n<h2>Output</h2>\n<p>Always emits <strong>both</strong>:</p>\n<ul>\n<li><p><strong>Markdown to stdout</strong> — one section per failed check: workflow / job name, conclusion, details URL, and either a log excerpt inside a collapsible <code>&lt;details&gt;</code> block whose summary names its source, or a line saying why there is none.</p>\n</li>\n<li><p><strong>JSON file</strong> at <code>${TMPDIR:-/tmp}/failed-pr-checks-&lt;pr&gt;-&lt;utc-ts&gt;.json</code>. Path printed on the last line, prefixed <code>JSON: </code>. Schema:</p>\n<pre><code>{\n  \"pr\": 70,\n  \"repo\": \"owner/name\",\n  \"failed_checks\": [\n    {\n      \"typename\": \"CheckRun\" | \"StatusContext\" | \"WorkflowRun\",\n      \"name\": \"test\",\n      \"workflow_name\": \"CI\",\n      \"conclusion\": \"FAILURE\",\n      \"status\": \"COMPLETED\",\n      \"details_url\": \"https://github.com/.../actions/runs/12345/job/67890\",\n      \"completed_at\": \"2026-05-03T07:42:13Z\",\n      \"run_id\": \"12345\",\n      \"job_id\": \"67890\",\n      \"log_excerpt\": \"...\",\n      \"log_source\": \"log-failed\" | \"log\" | \"api-step\" | \"api-errors-tail\" | null,\n      \"log_attempts\": [{\"command\": \"gh run view --job 67890 --log-failed\", \"outcome\": \"empty log\"}]\n    }\n  ]\n}\n</code></pre>\n</li>\n</ul>\n<h2>What counts as \"failed\"</h2>\n<p>Any check whose <code>conclusion</code> (CheckRun/WorkflowRun) or <code>state</code> (StatusContext) is one of:</p>\n<ul>\n<li><code>FAILURE</code></li>\n<li><code>TIMED_OUT</code></li>\n<li><code>CANCELLED</code></li>\n<li><code>ACTION_REQUIRED</code></li>\n<li><code>STARTUP_FAILURE</code></li>\n<li><code>ERROR</code> (StatusContext only)</li>\n</ul>\n<p>In-progress / pending / skipped checks are excluded.</p>\n<h2>Steps</h2>\n<ol>\n<li>Run the script with the PR number the user gave (or infer from <code>gh pr view --json number -q .number</code>).</li>\n<li>Read the Markdown output and present a concise summary — count, which workflows / jobs failed, the most likely root cause if visible in the log excerpt.</li>\n<li>The log excerpt comes from the first source that gives a log: <code>gh run view --log-failed</code>, then the tail of the full log (<code>--log</code>), then GitHub's job-log API sliced to the failed step (its <code>##[error]</code> lines plus the tail when the step can't be isolated). The <code>&lt;details&gt;</code> summary and <code>log_source</code> name the source; with no excerpt, the check lists each attempt and why it gave nothing. If the default 200-line excerpt isn't enough, re-run with a larger <code>--max-log-lines</code> (e.g. <code>--max-log-lines 1000</code>). Don't reach for <code>gh run view --log</code> directly — keep this workflow inside the command.</li>\n</ol>\n<h2>Why use this instead of <code>gh pr checks</code> / <code>gh run view</code> directly</h2>\n<ul>\n<li>One call gives you all failed checks plus a log excerpt of each, in both Markdown and JSON form.</li>\n<li>Handles the three <code>statusCheckRollup</code> typenames (CheckRun / StatusContext / WorkflowRun) — <code>gh pr checks</code> doesn't expose StatusContext cleanly.</li>\n<li>Truncated logs (default 200 lines per job) keep output bounded; raise with <code>--max-log-lines</code> when you need more.</li>\n</ul>\n<p>If the command is missing a flag you need, extend it rather than reaching for <code>gh</code> directly.</p>\n","files":[{"path":"SKILL.md","sizeBytes":4094,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-11-29T00:45:54.249315Z","sha256":"2DA7BBBC571A1CB7281B556F157798BD9D4CE29965C424E3629A0E617285F5E7","sizeBytes":2093},"review":null,"source":{"repositoryUrl":"https://github.com/MotleyAI/living-architecture","path":"plugin/la/skills/fetch-failed-pr-checks","license":"MIT","commit":"c1ecf0af05da41d754e0a83233334edf6cbca797","subtreeSha":"86588513F585CA783CC4F1CA572FEF3987BA16D1F4E79E4397B9B3913807BB9B","lastSyncedAt":"2026-11-29T00:43:57.908191Z"},"reviewedAt":"2026-11-29T00:52:35.819659Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/MotleyAI/living-architecture/tree/main/plugin/la/skills/fetch-failed-pr-checks"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install motleyai-living-architecture@llmmart"},{"target":"git","command":"git clone https://github.com/MotleyAI/living-architecture.git"}]}