pr-review-ci-fix
Automated PR review and CI auto-fix for GitHub and GitLab using the Composio CLI. Pulls diffs, fetches failing job logs, posts review comments, and loops fix commits until checks go green.
What this skill does
# PR Review + CI Auto-Fix
Drive GitHub/GitLab PR reviews and CI triage from the shell using the [Composio CLI](https://docs.composio.dev/docs/cli). No tab-switching between browser, terminal, and chat.
## When to Use
- A PR needs a structured review (correctness, style, risks) with inline comments.
- CI is red and you want the agent to read the logs, patch the code, and recheck.
- You want a single command that cycles: **fetch diff → critique → fix → push → rerun**.
## Prereqs
```bash
curl -fsSL https://composio.dev/install | bash
composio login
composio link github # or: composio link gitlab
```
Optional env for non-interactive runs: `COMPOSIO_API_KEY`.
## Core Toolkits
Discover slugs with search, then pin them for reuse:
```bash
composio search "list pull request files" --toolkits github
composio search "download workflow logs" --toolkits github
composio search "create pr comment" --toolkits gitlab
```
Common slugs you'll reuse:
- `GITHUB_GET_A_PULL_REQUEST`
- `GITHUB_LIST_PULL_REQUESTS_FILES`
- `GITHUB_CREATE_A_REVIEW_FOR_A_PULL_REQUEST`
- `GITHUB_LIST_WORKFLOW_RUNS_FOR_A_REPOSITORY`
- `GITHUB_DOWNLOAD_WORKFLOW_RUN_LOGS`
- `GITLAB_GET_SINGLE_MERGE_REQUEST`
- `GITLAB_LIST_MERGE_REQUEST_DISCUSSIONS`
- `GITLAB_CREATE_NEW_MERGE_REQUEST_NOTE`
Always confirm via `composio execute <SLUG> --get-schema` before first use.
## Review Workflow
1. **Pull the PR metadata + diff:**
```bash
composio execute GITHUB_GET_A_PULL_REQUEST \
-d '{"owner":"acme","repo":"app","pull_number":482}'
composio execute GITHUB_LIST_PULL_REQUESTS_FILES \
-d '{"owner":"acme","repo":"app","pull_number":482}'
```
2. **Summarize risk areas** (auth, migrations, public APIs, tests) into a review body.
3. **Post the review** with inline comments:
```bash
composio execute GITHUB_CREATE_A_REVIEW_FOR_A_PULL_REQUEST -d '{
"owner":"acme","repo":"app","pull_number":482,
"event":"COMMENT",
"body":"Overall LGTM with 2 blocking notes.",
"comments":[
{"path":"src/auth.ts","line":42,"body":"Missing null check on session"},
{"path":"src/auth.ts","line":88,"body":"Token TTL is hardcoded; move to config"}
]
}'
```
## CI Auto-Fix Loop
1. **Find the red run:**
```bash
composio execute GITHUB_LIST_WORKFLOW_RUNS_FOR_A_REPOSITORY \
-d '{"owner":"acme","repo":"app","branch":"feat/billing","status":"failure"}'
```
2. **Pull logs:**
```bash
composio execute GITHUB_DOWNLOAD_WORKFLOW_RUN_LOGS \
-d '{"owner":"acme","repo":"app","run_id":123456}'
```
3. **Parse failure → patch locally** (the agent writes the fix into the working tree).
4. **Commit + push** via local `git`, then re-poll step 1 until `conclusion=success`.
5. **Post a PR comment** describing each fix commit so the human reviewer sees what changed.
## One-Shot Workflow File
Save as `scripts/review-and-fix.ts` and run with `composio run --file ./scripts/review-and-fix.ts -- --pr 482`:
```ts
const pr = process.argv.includes("--pr")
? Number(process.argv[process.argv.indexOf("--pr") + 1])
: null;
const meta = await execute("GITHUB_GET_A_PULL_REQUEST", {
owner: "acme", repo: "app", pull_number: pr
});
const files = await execute("GITHUB_LIST_PULL_REQUESTS_FILES", {
owner: "acme", repo: "app", pull_number: pr
});
console.log(JSON.stringify({ meta, files }, null, 2));
```
## GitLab Variant
Swap slugs and param names:
```bash
composio execute GITLAB_GET_SINGLE_MERGE_REQUEST \
-d '{"id":"acme/app","merge_request_iid":482}'
composio execute GITLAB_CREATE_NEW_MERGE_REQUEST_NOTE \
-d '{"id":"acme/app","merge_request_iid":482,"body":"CI fix pushed as commit deadbeef"}'
```
## Troubleshooting
- **`Connection required for github`** → `composio link github`
- **Unknown input shape** → `composio execute <SLUG> --get-schema`
- **Log download huge** → stream via `composio proxy` against the raw API and `grep` locally
- **Rate limits** → serialize calls or lower poll frequency; avoid `--parallel` for the same repo
Full CLI reference: [docs.composio.dev/docs/cli](https://docs.composio.dev/docs/cli)
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.