Agent Skillsdyad-sh/dyad › dyad:pr-fix:ci

dyad:pr-fix:ci

GitHub

诊断并修复 PR 最新 CI 运行中的失败项,包括 E2E、跨平台单元测试及构建问题。通过分析日志和制品定位根因,执行针对性修复与测试验证。

.claude/skills/pr-fix-ci/SKILL.md dyad-sh/dyad

Trigger Scenarios

PR CI 检查失败 E2E/Playwright 测试报错 macOS/Windows 单元测试失败 预提交或类型检查失败

Install

npx skills add dyad-sh/dyad --skill dyad:pr-fix:ci -g -y
More Options

Non-standard path

npx skills add https://github.com/dyad-sh/dyad/tree/main/.claude/skills/pr-fix-ci -g -y

Use without installing

npx skills use dyad-sh/dyad@dyad:pr-fix:ci

指定 Agent (Claude Code)

npx skills add dyad-sh/dyad --skill dyad:pr-fix:ci -a claude-code -g -y

安装 repo 全部 skill

npx skills add dyad-sh/dyad --all -g -y

预览 repo 内 skill

npx skills add dyad-sh/dyad --list

SKILL.md

Frontmatter
{
    "name": "dyad:pr-fix:ci",
    "description": "Diagnose and fix failing CI checks on a pull request from its latest GitHub Actions CI run. Use when PR CI has E2E\/Playwright failures, macOS or Windows unit-test failures, or presubmit\/type\/build failures; analyzes the exact run logs and artifacts, invokes dyad:deflake-e2e-from-run for E2E failures, reproduces targeted unit tests locally, and publishes the fixes."
}

PR Fix: CI

Fix failures from the latest CI workflow run for a pull request. Base the diagnosis on that run's logs and artifacts, not on a fresh local full-suite run.

Arguments

  • $ARGUMENTS: Optional PR number or URL. If omitted, use the current branch's PR.

Workflow

  1. Track the phases below with the available task-tracking tool.

  2. Resolve the PR and record its repository, number, head SHA, head repository, and head ref. Check out the PR head before editing. Stop if it cannot be checked out or pushed safely.

  3. Find the newest CI workflow run for the PR's current head SHA:

    gh run list -R dyad-sh/dyad --workflow CI --commit <HEAD_SHA> \
      --json databaseId,url,status,conclusion,createdAt,headSha --limit 10
    

    Select the newest run whose headSha exactly matches. If it is still running, wait for completion. Keep its URL for the final summary.

  4. Enumerate every job and its failed step:

    gh api repos/dyad-sh/dyad/actions/runs/<RUN_ID>/jobs --paginate \
      --jq '.jobs[] | {id,name,status,conclusion,failed_steps:[.steps[] | select(.conclusion == "failure") | .name]}'
    

    Diagnose setup, lint, formatting, type-check, and build failures directly from the job log and reproduce them with the repository-supported command before fixing them.

Unit tests on macOS and Windows

Inspect both unit-tests-macos and unit-tests-windows, even when only one failed. This distinguishes a shared failure from an OS-specific one.

  1. Download each job log separately:

    gh run view <RUN_ID> -R dyad-sh/dyad --job <JOB_ID> --log > <SCRATCH_DIR>/<OS>.log
    
  2. Read the failing step and extract the exact test files, test names, assertion diffs, stack traces, exit codes, and platform-specific paths/errors. Do not infer a test failure merely from the job name: the macOS job also runs presubmit and type-checking.

  3. Compare the two logs:

    • Same test and error on both platforms: investigate one shared root cause.
    • Different failures: treat them independently and fix both.
    • Windows-only: inspect path separators, shell behavior, file locking, case sensitivity, and platform guards. Do not weaken a valid assertion just because Windows cannot be run locally.
    • macOS-only: inspect native-module, Keychain, filesystem, and timing assumptions.
  4. Reproduce the narrowest failing Vitest target with npm test -- <test-file>. For package-local suites, use that package's documented test command. Never run npx tsc, tsc, or Jest-only flags.

  5. Fix the underlying behavior or deterministic test isolation. Add or adjust the narrowest regression test. Rerun every affected target locally. When a Windows-only behavior cannot be executed on macOS, add a platform-independent unit test for the relevant transformation and explicitly rely on the next Windows CI run for final confirmation.

E2E failures

After unit-test fixes are ready, list the run artifacts. If an E2E shard failed and html-report exists, invoke /dyad:deflake-e2e-from-run with the selected run URL. Follow its artifact-first trace analysis, rebuild, and targeted E2E verification. Running it after unit fixes lets its required /dyad:pr-push publish the complete CI fix together.

If merge-reports failed, inspect that job's failed step before delegating. An install, artifact-download, or merge failure can occur before html-report is uploaded. Diagnose reporting-infrastructure failures from the merge job log. When shard failures also need trace analysis but html-report is absent, list and download every retained blob-report-* artifact into one scratch directory, then run Playwright's merge command locally to reconstruct the HTML report before following /dyad:deflake-e2e-from-run's report-analysis phases:

gh api repos/dyad-sh/dyad/actions/runs/<RUN_ID>/artifacts --paginate \
  --jq '.artifacts[] | select(.name | startswith("blob-report-")) | .name' \
  > <SCRATCH_DIR>/blob-artifact-names
while IFS= read -r artifact; do
  gh run download <RUN_ID> -R dyad-sh/dyad -n "$artifact" \
    -D <SCRATCH_DIR>/blob-reports
done < <SCRATCH_DIR>/blob-artifact-names
PLAYWRIGHT_HTML_OUTPUT_DIR=<SCRATCH_DIR>/html-report \
  npx playwright merge-reports --config=merge.config.ts <SCRATCH_DIR>/blob-reports

If no shard failed and the merge job failed before producing html-report, do not invoke the deflake skill: fix and verify the merge/reporting failure directly.

The standalone safe-storage-e2e job is not included in the merged html-report. If it failed, download and inspect its dedicated artifact before editing:

gh run download <RUN_ID> -R dyad-sh/dyad \
  -n safe-storage-e2e-report -D <SCRATCH_DIR>/safe-storage-e2e-report

Treat blob-report/ and test-results/ as the authoritative failure evidence. Read the retained Playwright errors, traces, screenshots, and error-context files using the same artifact-first trace analysis from /dyad:deflake-e2e-from-run. This spec swaps the machine-global default macOS Keychain, so never run it locally or on a self-hosted runner. Verify the surrounding logic with the narrowest safe local tests, then rely on the next ephemeral GitHub-hosted safe-storage-e2e job for final confirmation and say so explicitly.

If the failure is a snapshot mismatch, use /dyad:e2e-rebase when appropriate. Do not substitute raw job-log guessing for retained Playwright artifacts.

Verify and publish

Before publishing, run the narrowest affected tests plus npm run fmt, npm run lint, and npm run ts. If E2E application code changed, run npm run build before targeted E2E tests.

If /dyad:deflake-e2e-from-run did not already publish the combined changes, invoke /dyad:pr-push. Report the source run URL, each failed job's concrete root cause and fix, commands run locally, and any platform result that still requires CI confirmation.

Version History

  • 7158f6f Current 2026-08-20 16:42

Same Skill Collection

.claude/skills/add-models/SKILL.md
.claude/skills/check-workflows/SKILL.md
.claude/skills/debug-minified-error/SKILL.md
.claude/skills/debug-with-playwright/SKILL.md
.claude/skills/deflake-e2e-from-run/SKILL.md
.claude/skills/deflake-e2e-recent-commits/SKILL.md
.claude/skills/deflake-e2e/SKILL.md
.claude/skills/e2e-rebase/SKILL.md
.claude/skills/feedback-to-issues/SKILL.md
.claude/skills/fix-issue/SKILL.md
.claude/skills/plan-to-issue/SKILL.md
.claude/skills/pr-fix-comments/SKILL.md
.claude/skills/pr-fix/SKILL.md
.claude/skills/pr-push/SKILL.md
.claude/skills/pr-rebase/SKILL.md
.claude/skills/pr-screencast/SKILL.md
.claude/skills/promote-beta-to-stable/SKILL.md
.claude/skills/remember-learnings/SKILL.md
.claude/skills/swarm-pr-review/SKILL.md
.claude/skills/swarm-to-plan/SKILL.md
.claude/skills/multi-pr-review/SKILL.md

Metadata

Files
0
Version
157ab55
Hash
3e8ba849
Indexed
2026-08-20 16:42

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-29 19:51
浙ICP备14020137号-1 $Гость$