Logo: Repair Pr

Repair Pr

Communautéit
kdy1
repair-pr

One-shot GitHub pull request repair workflow for the current or specified repository. Use when asked to resolve merge conflicts, handle unresolved feedback from chatgpt-codex-connector[bot], cubic-dev-ai[bot], and the authenticated GitHub user (@me), fix failing CI within the PR scope, commit each distinct repair problem separately, perform final pushes under shared stack ownership, resolve handled review threads, and update the PR body when needed. Post no PR comments by default, except optional English explanations of objectively incorrect bot findings.

Iwwersiicht

Editeurkdy1
Repositorykdy1-scripts
Skill-Nummrepair-pr
Stären
33
Forks
0
Matgeliwwert Dateien
18
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 18 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    kdy1 huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Repair Pr an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/kdy1/kdy1-scripts/tree/main/skills/repair-pr
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/kdy1/kdy1-scripts.git /tmp/kdy1-scripts
mkdir -p .claude/skills
cp -r /tmp/kdy1-scripts/skills/repair-pr .claude/skills/repair-pr
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Repair Pr an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Repair Pr automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Repair Pr net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Repair PR

Goal

Repair only problems within the scope of the current or specified GitHub PR once, then stop. Handle merge conflicts, unresolved review feedback from chatgpt-codex-connector[bot], cubic-dev-ai[bot], and the authenticated GitHub user (@me), and CI failures in that order. Correct actionable findings, assess incorrect findings with concrete evidence, and resolve handled threads. Update the PR body when needed to describe the final diff and validation accurately. Create a separate commit for each distinct repair problem that changes files, but publish only after all local changes are complete. Ordinary PRs push once; stacked PRs use the scoped final pushes owned by $manage-stacked-prs.

Repair scope

  • Before fixing a review finding or CI failure, establish its relationship to the PR's purpose and diff using the relevant implementation, logs, and tests. A failure outside the changed files is in scope when the PR changes caused it; file location alone does not determine scope.
  • Do not fix unrelated pre-existing bugs or CI/infrastructure failures. Report them with supporting evidence in the current chat. If the relationship to the PR is unclear, do not make a speculative fix; report what evidence is missing.
  • Record out-of-scope review findings as blocked and leave their threads unresolved. Being outside the PR scope does not make a finding incorrect.
  • Record required validation failures accurately, even when their causes are outside the PR scope. Failed or skipped validation does not block the final push or handling fixed and incorrect review threads; preserve those results in the repair record and final report.

PR body

  • Compare the current PR body with the final diff, behavior, and validation results. Correct stale or inaccurate statements and add material omissions when needed. Leave an accurate body unchanged.
  • Preserve the existing language, repository template, required sections, relevant issue references, and stack navigation or generated metadata. Change issue-closing claims only when the final diff and evidence support them. Describe the resulting PR, not the repair history.
  • A repair invocation includes necessary PR body edits without a separate request. This does not authorize changing the title or posting comments. Body-only corrections require no empty commit or push.

Comment policy

  • By default, report repair results, progress, and supporting evidence in the current chat. Do not post top-level PR comments, repair summaries, new reviews, or inline replies to actionable findings.
  • An objectively incorrect bot finding is the exception: a concise English explanation with concrete evidence may be posted in its original inline thread without a separate human request. This exception does not apply to findings authored by @me. This reply is optional; resolving the incorrect-finding thread is required under Finish once, even when the reply is omitted or fails.
  • Other PR comments require an explicit human request. Preserve that request and its scope when supplied directly or through an authorized handoff. A repair or maintenance invocation alone is not a request to post comments.

Workflow

  1. Resolve the PR context.

    • Resolve the bundled helper relative to this SKILL.md. Read repair session commands and run node "<skill-directory>/scripts/repair-pr.mjs" preflight --pr <pr> --json (omit --pr for the current branch). This read-only command checks Git/gh/auth, PR identity, remotes, worktrees, pending operations, and stack membership. Reconcile its blockers before mutation; it does not acquire ownership or authorize a checkout.
    • Read the applicable AGENTS.md and any equivalent repository-local instructions before changing code. Follow their scope rules, required documentation updates, validation commands, and commit conventions.
    • If the user provided a PR number or URL, use it; otherwise use gh pr view --json number,url,baseRefName,headRefName.
    • Before checkout, ref changes, file edits, PR body edits, or review-thread writes, read shared stack coordination. Run its read-only lookup for both the exact PR URL and authenticated head repository/branch; defer on an active registry transaction, read errors, ambiguous membership, a building stack without its recorded batch repair handoff, or another active owner. Do not treat a lookup failure as no stack.
    • If the PR belongs to an existing stack, read $manage-stacked-prs. For an unregistered published stack, verify membership and register it under that skill's snapshot before acquiring ownership. Acquire a whole-stack repair token, or claim the coordinator reservation only after verifying this child's actual assignment in the recorded ledger. A matching PR URL alone is insufficient. Complete $manage-stacked-prs’s boundary snapshot while holding that token, before any merge or code change; final restacking must use the recorded pre-change inherited boundaries. Retain the coordination ID, root, owner/token, and snapshot path throughout the repair. Reuse that token in $manage-stacked-prs; do not acquire a second lock. A direct invocation cannot bypass a build or reservation. A batch-assigned repair may claim a building stack only after its build owner used suspend-build and recorded this assignment and START; preserve the building phase and enclosing ownership through alignment.
    • Keep merged lower layers in the registry and snapshot. The session helper accepts a verified contiguous merged prefix whose merge commits are contained in the first open layer’s base; preserve those retired layers unchanged. Closed unmerged layers or merged layers above an open layer require reconciliation.
    • A successful lookup with no registered membership does not prove that the PR is standalone: inspect authenticated PR base relationships and available gh-stack state. If stack membership cannot be resolved, report the blocker before mutation. For a verified ordinary PR, retain the ordinary workflow and existing PR/branch ownership checks.
    • Preflight requires a clean worktree. If it is dirty, stop and ask how to handle the pre-existing changes. Preserve user-owned worktrees and pending Git operations.
    • If the user provided a PR number or URL, check out the PR branch with gh pr checkout <pr> before making commits. Otherwise, assert that the current branch matches the PR headRefName; if it does not, stop before changing files.
    • After checkout and, for stacks, token acquisition and the pre-change boundary snapshot, initialize a session outside source with session init --file <session> --pr <pr>. Supply --stack-file <ownership-json> for a stack; reuse its held owner/token and snapshot. Initialization repeats preflight and rejects pre-existing ahead commits. Run status --pr <pr> to collect merge state, relevant unresolved review threads, and failing checks. Preserve incomplete reads as blockers rather than treating them as healthy.
  2. Resolve merge conflicts first.

    • Treat mergeStateStatus: DIRTY or GitHub reporting conflicts as the conflict signal.
    • Fetch the PR base branch and merge it into the PR branch; do not rebase.
    • Identify the correct remote for the PR and merge its remote-tracking base ref. Do not assume the remote is named origin.
    • Resolve conflicts using the code, tests, and applicable repository contracts. Do not choose --ours or --theirs blindly.
    • Run focused verification for the resolved area, then git add the intended files and commit the merge or conflict repair before moving on. Record that problem and its commit/validation with session record --file <session> --input <record-json>.
  3. Apply review feedback.

    • Consider only unresolved, non-outdated review threads with at least one comment authored by chatgpt-codex-connector[bot], cubic-dev-ai[bot], or the authenticated GitHub user (@me). Resolve @me from viewer.login at runtime; if the account cannot be identified, stop and report the failure.
    • Ignore approvals, resolved threads, outdated threads, duplicates, non-actionable notes, full-review bodies, and threads with no comment from any eligible author.
    • Evaluate each finding against the current diff, applicable contracts, implementation behavior, and tests. Apply Repair scope before making changes. Do not assume the review is correct because of its author.
    • Handle each distinct actionable, in-scope finding independently. Do not combine findings merely because they affect the same behavior or file. If multiple threads are duplicate reports of the same root cause, treat them as one problem.
    • Implement the smallest correct fix for one problem, including any documentation or repository-instruction update required by that fix or its public-contract change.
    • Run focused tests for that problem, then commit and record it before starting the next problem. Record its commit, validation, evidence, and fixed thread IDs with session record. One commit may handle multiple review threads only when they are duplicate reports of the same root cause.
    • When a finding is objectively incorrect, do not change correct code to appease it. Record the thread id and report the review's incorrect assumption with concrete evidence in the current chat, such as the relevant behavior, invariant, or test. For an incorrect bot finding only, optionally prepare a concise English reply with that evidence for the same inline thread under Comment policy; do not merely state that the finding is wrong.
    • Record fixed, incorrect, and blocked dispositions with concrete evidence in the session. An optional incorrect-bot explanation uses replyBodyFile containing the English explanation. Do not resolve handled threads until publication is verified, if a push is required.
    • Treat uncertain or ambiguous findings as blockers, not as incorrect findings. Leave their threads unresolved and report what evidence or decision is missing. Also leave a thread unresolved when applying its suggestion would cause a regression but the review's premise cannot be conclusively disproved.
  4. Fix CI failures.

    • Use the status and ci-logs helpers to read current-head check runs and commit statuses through REST. They paginate both sources, retain the latest attempts, and mark incomplete or changing reads as unknown. Do not use gh pr checks for this inventory.
    • Run ci-logs --session <session> --output-dir <outside-source-directory> to collect failing current-head Actions logs with repository/head/attempt checks and duplicate log removal. Inspect its per-check results; unavailable logs are not a successful CI result. Use job logs from gh api when additional evidence is needed.
    • Treat external checks as report-only unless their logs are available through gh.
    • Identify each independent root cause. Multiple failing checks caused by the same root cause are one problem; unrelated root causes are separate problems.
    • Apply Repair scope to each root cause before fixing it. Report unrelated failures and failures whose relationship to the PR remains unclear with evidence in the current chat; do not record an unfixed failure as a ci problem, which requires a repair commit.
    • Fix one in-scope root cause, run focused local verification, then commit and record that fix before starting the next root cause.
  5. Finish once.

    • Run the validation required by the repository instructions plus the closest relevant checks for every touched area. Derive commands from the target project instead of assuming a language, package manager, or directory layout.
    • Re-run the bundled helper's status --pr <pr> command once for a final summary.
    • Record every required final validation at the final local head, then run session verify --file <session>. For an ordinary PR, run publish --session <session> after every repair commit is ready. It verifies the recorded commits and destination, performs one normal final push when needed, and rereads the remote head. Do not push intermediate commits or force-push. A verified no-op does not push.
    • For a stacked PR, complete $manage-stacked-prs before review-thread handling: snapshot inherited boundaries before changes, align affected upper layers, run required final checks, push each changed branch only after all local repair/replay work is ready, and verify remote heads and base chains. Repair commits append without rebasing merely to update trunk. Only upper layers replayed from the lowest changed layer may use explicit expected-SHA leases; if a confirmed necessary lower-layer fix makes the original target part of that upper cascade, preserve its repair commits during replay. This stack-specific rule replaces the ordinary single-branch push count. No repeated target push or whole-stack publication shortcut. If alignment or any required push is incomplete or uncertain, retain the stack token and do not resolve handled findings as completed.
    • Keep the whole-stack token through PR body updates, permitted replies, and thread resolution. Acquire/release the short shared catalog token around gh-stack mutations under the coordination reference.
    • For a stack, record complete per-layer publication results and any replayed repair SHA mapping through session record, then record final target validation. Keep the original inherited boundaries and the shared stack token; the helper does not restack or release ownership.
    • After publication verification (or a validated no-op), apply PR body. If an edit is needed, snapshot the current body and prepare the replacement outside source, then run update-body --session <session> --snapshot <pr-json> --body-file <body-md> as described in the session reference. For a stack, do this after alignment so the latest navigation is preserved, while holding the same token. Inspect the verified result; report any failure or uncertain outcome without claiming the body was updated.
    • Run finish-threads --session <session> after publication verification, or immediately for a validated no-op. It rereads PR membership, publication, eligible authors, and, for stacks, remote heads/base chains and ownership. It sends only optional incorrect-bot replies recorded under Comment policy, then resolves every fixed and incorrect thread. It leaves blocked findings unresolved. An optional reply failure does not skip resolution. If it lists threads that became outdated without their own repair changing the file, reassess each at the current head, record a reassessment (see the session reference), and rerun it; do not bypass the gate with resolve-thread.
    • Report each reply/resolution outcome accurately from the command's JSON. A failed or uncertain write is not completion. Reexecution reconciles actual remote state and skips completed writes; it does not blindly retry uncertain writes. Preserve session evidence and follow the reference's interrupted-operation procedure.
    • For a ready stack, release the stack token only after remote alignment, body-update outcomes, and thread-handling outcomes are reconciled. For a building-stack repair, return the retained token and complete results to the coordinator; it records the results and uses resume-build instead of releasing protection. Report a known thread-write failure accurately without claiming resolution; interrupted or uncertain effects require reconciliation before release.
    • In the final chat report, distinguish repaired problems from out-of-scope failures and problems whose scope remains unclear. Include any PR body update, evidence for exclusions, and any required validation or publication blockers without claiming that the remaining checks passed.
    • Do not start a monitoring loop or keep polling checks after the final status check.

Helper

Resolve <skill-directory> as the directory containing this SKILL.md. The target repository does not need its own copy of the helper.

bash
node "<skill-directory>/scripts/repair-pr.mjs" status
node "<skill-directory>/scripts/repair-pr.mjs" status --pr 123 --json
node "<skill-directory>/scripts/repair-pr.mjs" resolve-thread PRRT_kwDO...

Use reply-thread only under Comment policy, including optional explanations of objectively incorrect bot findings:

bash
node "<skill-directory>/scripts/repair-pr.mjs" reply-thread PRRT_kwDO... --body "The review assumes ..., but ..."
node "<skill-directory>/scripts/repair-pr.mjs" reply-thread PRRT_kwDO... --body-file /path/to/reply.md

The helper resolves @me to the authenticated GitHub account. Status JSON includes both bot logins and the authenticated user in reviewAuthors; the legacy reviewAuthor field retains chatgpt-codex-connector[bot].

Use repair session commands for preflight, problem/validation records, CI logs, ordinary final publication, PR body updates, and post-publication thread handling. The legacy commands above remain available for scoped manual use; do not use them to bypass publication or ownership gates.

The helper does not implement code fixes, stage changes, commit, decide whether a finding is correct, or group root causes. Its publish command handles only verified ordinary PR sessions; stack replay and publication remain owned by $manage-stacked-prs. Reading or editing these resources does not authorize a live repair.

The separate stack coordination helper manages local stack ownership and batch scheduling. It does not perform repairs, inventory GitHub, or grant authorization. For stacks, install manage-stacked-prs alongside this skill. Reading or editing either helper or skill does not repair PRs or register maintenance.

Commit And Push Rules

  • Create one commit for the merge-conflict repair and one separate commit for every distinct actionable review problem and independent CI root cause that changes files.
  • Never combine independent problems in one commit. Duplicate reports of the same root cause are one problem and may share one commit.
  • Stage only files that belong to the current problem.
  • For an ordinary PR, push exactly once at the end if at least one commit was created. For a stacked PR, defer publication to $manage-stacked-prs and push each changed branch once after all local work is ready, using explicit SHA leases only for replayed upper layers.
  • If neither repair commits nor required stack-alignment changes were needed, do not create an empty commit and do not push. A target no-op does not waive necessary affected-stack alignment.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Repair Pr?

One-shot GitHub pull request repair workflow for the current or specified repository. Use when asked to resolve merge conflicts, handle unresolved feedback from chatgpt-codex-connector[bot], cubic-dev-ai[bot], and the authenticated GitHub user (@me), fix failing CI within the PR scope, commit each distinct repair problem separately, perform final pushes under shared stack ownership, resolve handled review threads, and update the PR body when needed. Post no PR comments by default, except optional English explanations of objectively incorrect bot findings.

Firwat Repair Pr op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Repair Pr besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Repair Pr an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/kdy1/kdy1-scripts/tree/main/skills/repair-pr an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Repair Pr benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Repair Pr benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Repair Pr domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Repair Pr gratis?

kdy1 huet de Skill op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇