feat: add 'fix-pr' skill for agentic iterative PR fixing

This commit is contained in:
mkorwel
2026-03-13 19:25:03 -07:00
parent 7d85e84d17
commit 3649059a28
3 changed files with 119 additions and 0 deletions
@@ -0,0 +1,18 @@
import { spawnSync } from 'child_process';
import path from 'path';
export async function runFixPlaybook(prNumber: string, targetDir: string, policyPath: string, geminiBin: string) {
console.log(`🚀 Offload | FIX | PR #${prNumber}`);
console.log('Switching to agentic fix loop inside Gemini CLI...');
// Use the nightly gemini binary to activate the fix-pr skill and iterate
const result = spawnSync(geminiBin, [
'--policy', policyPath,
'--cwd', targetDir,
'-p', `Please activate the 'fix-pr' skill and use it to iteratively fix PR #${prNumber}.
Ensure you handle CI failures, merge conflicts, and unaddressed review comments
until the PR is fully passing and mergeable.`
], { stdio: 'inherit' });
return result.status || 0;
}