[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F30SWFJW5BQQDJRRMQC969":3,"skill-same:01M7F30SWFJW5BQQDJRRMQC969":63},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M7F30SWFJW5BQQDJRRMQC969","greploop",null,"Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5\u002F5 confidence score with zero unresolved comments. Triggers Greptile review, fixes all actionable comments, pushes\u002Fre-shelves, re-triggers review, and repeats. Use when the user wants to fully optimize a PR\u002FMR\u002FCL against Greptile's code review standards.","pipedude\u002Fyahont-ce","pipedude","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F190111823?v=4","01M7F2XW6B1ZCE54SHVKPEJPWN","Dmitrii Plaksin","01M7F2XW71CAQ4CVCPGJZ8FPG4",56,"MIT","https:\u002F\u002Fgithub.com\u002Fpipedude\u002Fyahont-ce\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fgreptile\u002Fgreploop\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: greploop\ndescription: >\n  Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile\n  gives it a 5\u002F5 confidence score with zero unresolved comments. Triggers Greptile review, fixes all\n  actionable comments, pushes\u002Fre-shelves, re-triggers review, and repeats. Use when the user wants to\n  fully optimize a PR\u002FMR\u002FCL against Greptile's code review standards.\nlicense: MIT\ncompatibility: Requires git, gh (GitHub CLI) or glab (GitLab CLI) authenticated, and Greptile installed on the repo. For Perforce, requires p4 CLI authenticated.\nmetadata:\n  author: greptileai\n  version: \"1.3\"\nallowed-tools: Bash(gh:*) Bash(glab:*) Bash(git:*) Bash(p4:*)\n---\n\n# Greploop\n\nIteratively fix a PR\u002FMR\u002FCL until Greptile gives a perfect review: 5\u002F5 confidence, zero unresolved comments.\n\n## Inputs\n\n- **PR\u002FMR\u002FCL number** (optional): If not provided, detect the PR\u002FMR for the current branch, or the default pending changelist for p4.\n\n## Instructions\n\n### 0. Detect platform\n\nFirst check for Perforce, then fall back to git remote detection:\n\n```bash\n# Check for Perforce environment\nif p4 info >\u002Fdev\u002Fnull 2>&1; then\n  VCS=\"perforce\"\nelse\n  REMOTE_URL=$(git remote get-url origin)\n  if echo \"$REMOTE_URL\" | grep -qi \"gitlab\"; then\n    VCS=\"gitlab\"\n  else\n    VCS=\"github\"\n  fi\nfi\n```\n\nFor self-hosted GitLab instances whose hostname doesn't contain \"gitlab\", the user can override by passing `--vcs gitlab` as an input. For Perforce, pass `--vcs perforce`.\n\n### 1. Identify the PR\u002FMR\u002FCL\n\n**GitHub:**\n```bash\ngh pr view --json number,headRefName -q '{number: .number, branch: .headRefName}'\n```\n\n**GitLab:**\n```bash\nglab mr view --output json | jq '{iid: .iid, branch: .source_branch}'\n```\n\nSwitch to the PR\u002FMR branch if not already on it.\n\n**Perforce:**\n```bash\n# List pending changelists for current user\u002Fclient\np4 changes -s pending -u $P4USER -c $P4CLIENT\n\n# Describe a specific CL\np4 describe -s \u003CCL_NUMBER>\n```\n\nEnsure the correct workspace (`p4 client`) is set before proceeding.\n\nKey field differences:\n- GitHub: `number`, `headRefName`, `headRefOid`\n- GitLab: `iid`, `source_branch`, `sha`\n- Perforce: changelist number, `P4CLIENT`, shelved files\n\n### 2. Loop\n\nRepeat the following cycle. **Max 5 iterations** to avoid runaway loops.\n\n#### A. Trigger Greptile review\n\nPush\u002Fshelve the latest changes (if any):\n\n**GitHub\u002FGitLab:**\n```bash\ngit push\n```\n\n**Perforce:**\n```bash\n# Re-shelve to update the shelved files for review\np4 shelve -f -c \u003CCL_NUMBER>\n```\n\nWait for checks to start after push\u002Fshelve:\n\n```bash\nsleep 5\n```\n\n**GitHub** — check if Greptile is already running before posting a new trigger comment:\n\n```bash\nGREPTILE_STATE=$(gh pr checks \u003CPR_NUMBER> --json name,state | jq -r '.[] | select(.name | test(\"greptile\"; \"i\")) | .state')\n```\n\nIf Greptile is **not** already running (`PENDING` or `IN_PROGRESS`), request a fresh review:\n\n```bash\nif [ \"$GREPTILE_STATE\" != \"PENDING\" ] && [ \"$GREPTILE_STATE\" != \"IN_PROGRESS\" ]; then\n  gh pr comment \u003CPR_NUMBER> --body \"@greptile review\"\nfi\n```\n\nThen poll for the Greptile check run to complete:\n\n```bash\nHEAD_SHA=$(gh pr view \u003CPR_NUMBER> --json headRefOid -q .headRefOid)\nATTEMPTS=0\nMAX_ATTEMPTS=60\nPOLL_INTERVAL_SECONDS=10\n\nwhile true; do\n  ATTEMPTS=$((ATTEMPTS + 1))\n  if [ \"$ATTEMPTS\" -gt \"$MAX_ATTEMPTS\" ]; then\n    echo \"Timed out waiting for the Greptile check run after approximately 10 minutes.\" >&2\n    exit 1\n  fi\n\n  GREPTILE_CHECK=$(gh api \"repos\u002F{owner}\u002F{repo}\u002Fcommits\u002F$HEAD_SHA\u002Fcheck-runs\" \\\n    --jq '.check_runs[] | select(.name | test(\"greptile\"; \"i\"))' 2>\u002Fdev\u002Fnull)\n  \n  if [ -z \"$GREPTILE_CHECK\" ]; then\n    echo \"Waiting for Greptile check to appear...\"\n    sleep \"$POLL_INTERVAL_SECONDS\"\n    continue\n  fi\n  \n  STATUS=$(echo \"$GREPTILE_CHECK\" | jq -r '.status \u002F\u002F \"completed\"')\n  CONCLUSION=$(echo \"$GREPTILE_CHECK\" | jq -r '.conclusion \u002F\u002F \"pending\"')\n  \n  if [ \"$STATUS\" = \"completed\" ]; then\n    if [ \"$CONCLUSION\" = \"success\" ]; then\n      echo \"Greptile check passed!\"\n    else\n      echo \"Greptile check completed with: $CONCLUSION\"\n    fi\n    break\n  fi\n  \n  echo \"Waiting for Greptile... (status: $STATUS)\"\n  sleep \"$POLL_INTERVAL_SECONDS\"\ndone\n```\n\nIf polling times out, stop the greploop workflow and report the timeout. Do not continue with stale or missing review results.\n\n**GitLab** — check if Greptile is already running before posting a trigger comment:\n\n```bash\nPIPELINES=$(glab api \"projects\u002F:fullpath\u002Fmerge_requests\u002F\u003CMR_IID>\u002Fpipelines\")\nGREPTILE_RUNNING=$(echo \"$PIPELINES\" | jq '[.[] | select(.status == \"running\" or .status == \"pending\")] | length')\n```\n\nIf no pipeline is running, post a trigger comment:\n\n```bash\nif [ \"$GREPTILE_RUNNING\" = \"0\" ]; then\n  glab mr note \u003CMR_IID> --message \"@greptile review\"\nfi\n```\n\n**Perforce** — Perforce does not have native check runs. If Greptile is integrated via a webhook triggered on `p4 shelve`, wait for it to process. Check your Greptile installation's webhook endpoint or dashboard for the review status. Poll by re-fetching the Greptile review comment on the CL until a score appears.\n\nThen poll for the Greptile pipeline job to complete (see [GitLab API reference](references\u002Fgitlab-api.md)):\n\n```bash\nHEAD_SHA=$(glab mr view \u003CMR_IID> --output json | jq -r '.sha')\nATTEMPTS=0\nMAX_ATTEMPTS=60\nPOLL_INTERVAL_SECONDS=10\n\nwhile true; do\n  ATTEMPTS=$((ATTEMPTS + 1))\n  if [ \"$ATTEMPTS\" -gt \"$MAX_ATTEMPTS\" ]; then\n    echo \"Timed out waiting for the Greptile pipeline job after approximately 10 minutes.\" >&2\n    exit 1\n  fi\n\n  PIPELINES=$(glab api \"projects\u002F:fullpath\u002Fmerge_requests\u002F\u003CMR_IID>\u002Fpipelines\")\n  # Find the most recent pipeline for this SHA\n  PIPELINE_ID=$(echo \"$PIPELINES\" | jq -r --arg sha \"$HEAD_SHA\" \\\n    '[.[] | select(.sha == $sha)] | sort_by(.id) | last | .id \u002F\u002F empty')\n\n  if [ -z \"$PIPELINE_ID\" ]; then\n    echo \"Waiting for Greptile pipeline to appear...\"\n    sleep \"$POLL_INTERVAL_SECONDS\"\n    continue\n  fi\n\n  JOBS=$(glab api \"projects\u002F:fullpath\u002Fpipelines\u002F$PIPELINE_ID\u002Fjobs\")\n  GREPTILE_JOB=$(echo \"$JOBS\" | jq '.[] | select(.name | test(\"greptile\"; \"i\"))')\n\n  if [ -z \"$GREPTILE_JOB\" ]; then\n    echo \"Waiting for Greptile job to appear...\"\n    sleep \"$POLL_INTERVAL_SECONDS\"\n    continue\n  fi\n\n  JOB_STATUS=$(echo \"$GREPTILE_JOB\" | jq -r '.status')\n\n  if [ \"$JOB_STATUS\" = \"success\" ] || [ \"$JOB_STATUS\" = \"failed\" ] || [ \"$JOB_STATUS\" = \"canceled\" ]; then\n    echo \"Greptile job completed with: $JOB_STATUS\"\n    break\n  fi\n\n  echo \"Waiting for Greptile... (status: $JOB_STATUS)\"\n  sleep \"$POLL_INTERVAL_SECONDS\"\ndone\n```\n\nIf polling times out, stop the greploop workflow and report the timeout. Do not continue with stale or missing review results.\n\n#### B. Fetch Greptile review results\n\nGreptile may surface its score in several places — check **all** of the relevant sources:\n\n**GitHub:**\n\n**1. PR description (body):**\n```bash\ngh pr view \u003CPR_NUMBER> --json body -q '.body'\n```\n\n**2. General PR comments (issue comments):**\n```bash\ngh api --paginate \"repos\u002F{owner}\u002F{repo}\u002Fissues\u002F\u003CPR_NUMBER>\u002Fcomments?per_page=100\"\n```\n\nFilter for Greptile-authored comments and use the body from the most recently updated comment (`updated_at`), not the most recently created comment. Greptile may edit the same general PR comment on each review cycle; parse the current body, including the \"Prompt to fix all with AI\" section, before deciding there are no remaining issues.\n\n**3. PR reviews:**\n```bash\ngh api repos\u002F{owner}\u002F{repo}\u002Fpulls\u002F\u003CPR_NUMBER>\u002Freviews\n```\n\nLook for the most recent entry from `greptile-apps[bot]` or `greptile-apps-staging[bot]`.\n\n**GitLab:**\n\n**1. MR description (body):**\n```bash\nglab mr view \u003CMR_IID> --output json | jq -r '.description'\n```\n\n**2. MR notes (comments):**\n```bash\nglab api \"projects\u002F:fullpath\u002Fmerge_requests\u002F\u003CMR_IID>\u002Fnotes\"\n```\n\nFilter for notes from the Greptile bot user (check the `author.username` field — the exact username may vary per installation; verify on first run).\n\n**Perforce:**\n\n**1. CL description:**\n```bash\np4 describe -s \u003CCL_NUMBER>\n```\nCheck the description field for a Greptile-appended score block.\n\n**2. CL comments \u002F review notes:**\nIf your installation uses a review tool such as Helix Swarm, fetch comments via its API.\n\nExample (Swarm API):\nGET \u002Fapi\u002Fv11\u002Fcomments?topic=reviews\u002F\u003CREVIEW_ID>\n\nResponse fields of interest typically include:\n- user (author username)\n- body (comment text)\n- flags\u002Fstate indicating whether the comment is resolved\n\nFilter to comments authored by the Greptile bot:\n- Prefer exact username match if known\n- Otherwise, use a heuristic where the author name contains \"greptile\" (case-insensitive)\n\nFor all platforms, parse the text for:\n- **Confidence score**: a pattern like `3\u002F5` or `5\u002F5` (or `Confidence: 3\u002F5`).\n- **Comment count**: Number of inline review comments noted in the summary.\n\nUse whichever source has the **most recently updated** score. For GitHub, prefer `updated_at` from issue comments when comparing an edited Greptile summary against older review entries.\n\nAlso fetch all unresolved inline comments:\n\n**GitHub:**\n```bash\ngh api repos\u002F{owner}\u002F{repo}\u002Fpulls\u002F\u003CPR_NUMBER>\u002Fcomments\n```\n\nAlso carry forward actionable items from the latest Greptile general PR comment, especially the \"Prompt to fix all with AI\" section, even if the inline comment endpoint returns zero unresolved comments.\n\n**GitLab:**\n```bash\nglab api \"projects\u002F:fullpath\u002Fmerge_requests\u002F\u003CMR_IID>\u002Fdiscussions\"\n```\n\nFilter to `DiffNote` type discussions (`notes[0].type == \"DiffNote\"`) from Greptile that are on the latest commit and not yet resolved (`\"resolved\": false`).\n\n**Perforce:**\nIf using Swarm:\n\n# Fetch inline diff comments for the review associated with the CL\nGET \u002Fapi\u002Fv11\u002Fcomments?topic=reviews\u002F\u003CREVIEW_ID>\n\nFilter to comments from the Greptile bot user that have not been marked as resolved\u002Faddressed.\n\n#### C. Check exit conditions\n\nStop the loop if **any** of these are true:\n\n- Confidence score is **5\u002F5** AND there are **zero unresolved comments**\n- Max iterations reached (report current state)\n\n#### D. Fix actionable comments\n\nFor each unresolved Greptile comment:\n\n1. Read the file and understand the comment in context.\n2. Determine if it's actionable (code change needed) or informational.\n3. If actionable, make the fix.\n4. If informational or a false positive, note it but still resolve the thread.\n\n#### E. Resolve threads\n\n**GitHub** — fetch unresolved review threads and resolve all that have been addressed (see [GraphQL reference](references\u002Fgraphql-queries.md)):\n\n```bash\ngh api graphql -f query='\nquery($cursor: String) {\n  repository(owner: \"OWNER\", name: \"REPO\") {\n    pullRequest(number: PR_NUMBER) {\n      reviewThreads(first: 100, after: $cursor) {\n        pageInfo { hasNextPage endCursor }\n        nodes {\n          id\n          isResolved\n          comments(first: 1) {\n            nodes { body path author { login } }\n          }\n        }\n      }\n    }\n  }\n}'\n```\n\nResolve addressed threads:\n\n```bash\ngh api graphql -f query='\nmutation {\n  t1: resolveReviewThread(input: {threadId: \"ID1\"}) { thread { isResolved } }\n  t2: resolveReviewThread(input: {threadId: \"ID2\"}) { thread { isResolved } }\n}'\n```\n\n**GitLab** — fetch unresolved discussions and resolve each one (see [GitLab API reference](references\u002Fgitlab-api.md)):\n\n```bash\nglab api \"projects\u002F:fullpath\u002Fmerge_requests\u002F\u003CMR_IID>\u002Fdiscussions?per_page=100\"\n```\n\nFilter for `\"resolved\": false` discussions. Then resolve each by its `id`:\n\n```bash\nglab api --method PUT \\\n  \"projects\u002F:fullpath\u002Fmerge_requests\u002F\u003CMR_IID>\u002Fdiscussions\u002F\u003CDISCUSSION_ID>\" \\\n  --field resolved=true\n```\n\nRepeat for each unresolved discussion ID. (GitLab has no batch resolution — loop through each one.)\n\n#### F. Commit and push \u002F re-shelve\n\n**GitHub\u002FGitLab:**\n```bash\ngit add -A\ngit commit -m \"address greptile review feedback (greploop iteration N)\"\ngit push\n```\n\n**Perforce:**\n```bash\n# Stage changes back into the CL and re-shelve for the next review round\np4 shelve -f -c \u003CCL_NUMBER>\n```\n\nWait for checks to start after push\u002Fshelve:\n\n```bash\nsleep 5\n```\n\nThen go back to step **A**.\n\n### 3. Report\n\nAfter exiting the loop, summarize:\n\n| Field              | Value      |\n| ------------------ | ---------- |\n| Platform           | GitHub \u002F GitLab \u002F Perforce |\n| Iterations         | N          |\n| Final confidence   | X\u002F5        |\n| Comments resolved  | N          |\n| Remaining comments | N (if any) |\n\nIf the loop exited due to max iterations, list any remaining unresolved comments and suggest next steps.\n\n## Output format\n\n```\nGreploop complete.\n  Platform:      GitHub\n  Iterations:    2\n  Confidence:    5\u002F5\n  Resolved:      7 comments\n  Remaining:     0\n```\n\nIf not fully resolved:\n\n```\nGreploop stopped after 5 iterations.\n  Platform:      GitLab\n  Confidence:    4\u002F5\n  Resolved:      12 comments\n  Remaining:     2\n\nRemaining issues:\n  - src\u002Fauth.ts:45 — \"Consider rate limiting this endpoint\"\n  - src\u002Fdb.ts:112 — \"Missing index on user_id column\"\n```\n\n**Perforce example:**\n\n```\nGreploop complete.\n  Platform:      Perforce\n  Changelist:    12345\n  Iterations:    3\n  Confidence:    5\u002F5\n  Resolved:      9 comments\n  Remaining:     0\n```\n","# Greploop\n\nIteratively fix a PR\u002FMR\u002FCL until Greptile gives a perfect review: 5\u002F5 confidence, zero unresolved comments.\n\n## Inputs\n\n- **PR\u002FMR\u002FCL number** (optional): If not provided, detect the PR\u002FMR for the current branch, or the default pending changelist for p4.\n\n## Instructions\n\n### 0. Detect platform\n\nFirst check for Perforce, then fall back to git remote detection:\n\n```bash\n# Check for Perforce environment\nif p4 info >\u002Fdev\u002Fnull 2>&1; then\n  VCS=\"perforce\"\nelse\n  REMOTE_URL=$(git remote get-url origin)\n  if echo \"$REMOTE_URL\" | grep -qi \"gitlab\"; then\n    VCS=\"gitlab\"\n  else\n    VCS=\"github\"\n  fi\nfi\n```\n\nFor self-hosted GitLab instances whose hostname doesn't contain \"gitlab\", the user can override by passing `--vcs gitlab` as an input. For Perforce, pass `--vcs perforce`.\n\n### 1. Identify the PR\u002FMR\u002FCL\n\n**GitHub:**\n```bash\ngh pr view --json number,headRefName -q '{number: .number, branch: .headRefName}'\n```\n\n**GitLab:**\n```bash\nglab mr view --output json | jq '{iid: .iid, branch: .source_branch}'\n```\n\nSwitch to the PR\u002FMR branch if not already on it.\n\n**Perforce:**\n```bash\n# List pending changelists for current user\u002Fclient\np4 changes -s pending -u $P4USER -c $P4CLIENT\n\n# Describe a specific CL\np4 describe -s \u003CCL_NUMBER>\n```\n\nEnsure the correct workspace (`p4 client`) is set before proceeding.\n\nKey field differences:\n- GitHub: `number`, `headRefName`, `headRefOid`\n- GitLab: `iid`, `source_branch`, `sha`\n- Perforce: changelist number, `P4CLIENT`, shelved files\n\n### 2. Loop\n\nRepeat the following cycle. **Max 5 iterations** to avoid runaway loops.\n\n#### A. Trigger Greptile review\n\nPush\u002Fshelve the latest changes (if any):\n\n**GitHub\u002FGitLab:**\n```bash\ngit push\n```\n\n**Perforce:**\n```bash\n# Re-shelve to update the shelved files for review\np4 shelve -f -c \u003CCL_NUMBER>\n```\n\nWait for checks to start after push\u002Fshelve:\n\n```bash\nsleep 5\n```\n\n**GitHub** — check if Greptile is already running before posting a new trigger comment:\n\n```bash\nGREPTILE_STATE=$(gh pr checks \u003CPR_NUMBER> --json name,state | jq -r '.[] | select(.name | test(\"greptile\"; \"i\")) | .state')\n```\n\nIf Greptile is **not** already running (`PENDING` or `IN_PROGRESS`), request a fresh review:\n\n```bash\nif [ \"$GREPTILE_STATE\" != \"PENDING\" ] && [ \"$GREPTILE_STATE\" != \"IN_PROGRESS\" ]; then\n  gh pr comment \u003CPR_NUMBER> --body \"@greptile review\"\nfi\n```\n\nThen poll for the Greptile check run to complete:\n\n```bash\nHEAD_SHA=$(gh pr view \u003CPR_NUMBER> --json headRefOid -q .headRefOid)\nATTEMPTS=0\nMAX_ATTEMPTS=60\nPOLL_INTERVAL_SECONDS=10\n\nwhile true; do\n  ATTEMPTS=$((ATTEMPTS + 1))\n  if [ \"$ATTEMPTS\" -gt \"$MAX_ATTEMPTS\" ]; then\n    echo \"Timed out waiting for the Greptile check run after approximately 10 minutes.\" >&2\n    exit 1\n  fi\n\n  GREPTILE_CHECK=$(gh api \"repos\u002F{owner}\u002F{repo}\u002Fcommits\u002F$HEAD_SHA\u002Fcheck-runs\" \\\n    --jq '.check_runs[] | select(.name | test(\"greptile\"; \"i\"))' 2>\u002Fdev\u002Fnull)\n  \n  if [ -z \"$GREPTILE_CHECK\" ]; then\n    echo \"Waiting for Greptile check to appear...\"\n    sleep \"$POLL_INTERVAL_SECONDS\"\n    continue\n  fi\n  \n  STATUS=$(echo \"$GREPTILE_CHECK\" | jq -r '.status \u002F\u002F \"completed\"')\n  CONCLUSION=$(echo \"$GREPTILE_CHECK\" | jq -r '.conclusion \u002F\u002F \"pending\"')\n  \n  if [ \"$STATUS\" = \"completed\" ]; then\n    if [ \"$CONCLUSION\" = \"success\" ]; then\n      echo \"Greptile check passed!\"\n    else\n      echo \"Greptile check completed with: $CONCLUSION\"\n    fi\n    break\n  fi\n  \n  echo \"Waiting for Greptile... (status: $STATUS)\"\n  sleep \"$POLL_INTERVAL_SECONDS\"\ndone\n```\n\nIf polling times out, stop the greploop workflow and report the timeout. Do not continue with stale or missing review results.\n\n**GitLab** — check if Greptile is already running before posting a trigger comment:\n\n```bash\nPIPELINES=$(glab api \"projects\u002F:fullpath\u002Fmerge_requests\u002F\u003CMR_IID>\u002Fpipelines\")\nGREPTILE_RUNNING=$(echo \"$PIPELINES\" | jq '[.[] | select(.status == \"running\" or .status == \"pending\")] | length')\n```\n\nIf no pipeline is running, post a trigger comment:\n\n```bash\nif [ \"$GREPTILE_RUNNING\" = \"0\" ]; then\n  glab mr note \u003CMR_IID> --message \"@greptile review\"\nfi\n```\n\n**Perforce** — Perforce does not have native check runs. If Greptile is integrated via a webhook triggered on `p4 shelve`, wait for it to process. Check your Greptile installation's webhook endpoint or dashboard for the review status. Poll by re-fetching the Greptile review comment on the CL until a score appears.\n\nThen poll for the Greptile pipeline job to complete (see [GitLab API reference](references\u002Fgitlab-api.md)):\n\n```bash\nHEAD_SHA=$(glab mr view \u003CMR_IID> --output json | jq -r '.sha')\nATTEMPTS=0\nMAX_ATTEMPTS=60\nPOLL_INTERVAL_SECONDS=10\n\nwhile true; do\n  ATTEMPTS=$((ATTEMPTS + 1))\n  if [ \"$ATTEMPTS\" -gt \"$MAX_ATTEMPTS\" ]; then\n    echo \"Timed out waiting for the Greptile pipeline job after approximately 10 minutes.\" >&2\n    exit 1\n  fi\n\n  PIPELINES=$(glab api \"projects\u002F:fullpath\u002Fmerge_requests\u002F\u003CMR_IID>\u002Fpipelines\")\n  # Find the most recent pipeline for this SHA\n  PIPELINE_ID=$(echo \"$PIPELINES\" | jq -r --arg sha \"$HEAD_SHA\" \\\n    '[.[] | select(.sha == $sha)] | sort_by(.id) | last | .id \u002F\u002F empty')\n\n  if [ -z \"$PIPELINE_ID\" ]; then\n    echo \"Waiting for Greptile pipeline to appear...\"\n    sleep \"$POLL_INTERVAL_SECONDS\"\n    continue\n  fi\n\n  JOBS=$(glab api \"projects\u002F:fullpath\u002Fpipelines\u002F$PIPELINE_ID\u002Fjobs\")\n  GREPTILE_JOB=$(echo \"$JOBS\" | jq '.[] | select(.name | test(\"greptile\"; \"i\"))')\n\n  if [ -z \"$GREPTILE_JOB\" ]; then\n    echo \"Waiting for Greptile job to appear...\"\n    sleep \"$POLL_INTERVAL_SECONDS\"\n    continue\n  fi\n\n  JOB_STATUS=$(echo \"$GREPTILE_JOB\" | jq -r '.status')\n\n  if [ \"$JOB_STATUS\" = \"success\" ] || [ \"$JOB_STATUS\" = \"failed\" ] || [ \"$JOB_STATUS\" = \"canceled\" ]; then\n    echo \"Greptile job completed with: $JOB_STATUS\"\n    break\n  fi\n\n  echo \"Waiting for Greptile... (status: $JOB_STATUS)\"\n  sleep \"$POLL_INTERVAL_SECONDS\"\ndone\n```\n\nIf polling times out, stop the greploop workflow and report the timeout. Do not continue with stale or missing review results.\n\n#### B. Fetch Greptile review results\n\nGreptile may surface its score in several places — check **all** of the relevant sources:\n\n**GitHub:**\n\n**1. PR description (body):**\n```bash\ngh pr view \u003CPR_NUMBER> --json body -q '.body'\n```\n\n**2. General PR comments (issue comments):**\n```bash\ngh api --paginate \"repos\u002F{owner}\u002F{repo}\u002Fissues\u002F\u003CPR_NUMBER>\u002Fcomments?per_page=100\"\n```\n\nFilter for Greptile-authored comments and use the body from the most recently updated comment (`updated_at`), not the most recently created comment. Greptile may edit the same general PR comment on each review cycle; parse the current body, including the \"Prompt to fix all with AI\" section, before deciding there are no remaining issues.\n\n**3. PR reviews:**\n```bash\ngh api repos\u002F{owner}\u002F{repo}\u002Fpulls\u002F\u003CPR_NUMBER>\u002Freviews\n```\n\nLook for the most recent entry from `greptile-apps[bot]` or `greptile-apps-staging[bot]`.\n\n**GitLab:**\n\n**1. MR description (body):**\n```bash\nglab mr view \u003CMR_IID> --output json | jq -r '.description'\n```\n\n**2. MR notes (comments):**\n```bash\nglab api \"projects\u002F:fullpath\u002Fmerge_requests\u002F\u003CMR_IID>\u002Fnotes\"\n```\n\nFilter for notes from the Greptile bot user (check the `author.username` field — the exact username may vary per installation; verify on first run).\n\n**Perforce:**\n\n**1. CL description:**\n```bash\np4 describe -s \u003CCL_NUMBER>\n```\nCheck the description field for a Greptile-appended score block.\n\n**2. CL comments \u002F review notes:**\nIf your installation uses a review tool such as Helix Swarm, fetch comments via its API.\n\nExample (Swarm API):\nGET \u002Fapi\u002Fv11\u002Fcomments?topic=reviews\u002F\u003CREVIEW_ID>\n\nResponse fields of interest typically include:\n- user (author username)\n- body (comment text)\n- flags\u002Fstate indicating whether the comment is resolved\n\nFilter to comments authored by the Greptile bot:\n- Prefer exact username match if known\n- Otherwise, use a heuristic where the author name contains \"greptile\" (case-insensitive)\n\nFor all platforms, parse the text for:\n- **Confidence score**: a pattern like `3\u002F5` or `5\u002F5` (or `Confidence: 3\u002F5`).\n- **Comment count**: Number of inline review comments noted in the summary.\n\nUse whichever source has the **most recently updated** score. For GitHub, prefer `updated_at` from issue comments when comparing an edited Greptile summary against older review entries.\n\nAlso fetch all unresolved inline comments:\n\n**GitHub:**\n```bash\ngh api repos\u002F{owner}\u002F{repo}\u002Fpulls\u002F\u003CPR_NUMBER>\u002Fcomments\n```\n\nAlso carry forward actionable items from the latest Greptile general PR comment, especially the \"Prompt to fix all with AI\" section, even if the inline comment endpoint returns zero unresolved comments.\n\n**GitLab:**\n```bash\nglab api \"projects\u002F:fullpath\u002Fmerge_requests\u002F\u003CMR_IID>\u002Fdiscussions\"\n```\n\nFilter to `DiffNote` type discussions (`notes[0].type == \"DiffNote\"`) from Greptile that are on the latest commit and not yet resolved (`\"resolved\": false`).\n\n**Perforce:**\nIf using Swarm:\n\n# Fetch inline diff comments for the review associated with the CL\nGET \u002Fapi\u002Fv11\u002Fcomments?topic=reviews\u002F\u003CREVIEW_ID>\n\nFilter to comments from the Greptile bot user that have not been marked as resolved\u002Faddressed.\n\n#### C. Check exit conditions\n\nStop the loop if **any** of these are true:\n\n- Confidence score is **5\u002F5** AND there are **zero unresolved comments**\n- Max iterations reached (report current state)\n\n#### D. Fix actionable comments\n\nFor each unresolved Greptile comment:\n\n1. Read the file and understand the comment in context.\n2. Determine if it's actionable (code change needed) or informational.\n3. If actionable, make the fix.\n4. If informational or a false positive, note it but still resolve the thread.\n\n#### E. Resolve threads\n\n**GitHub** — fetch unresolved review threads and resolve all that have been addressed (see [GraphQL reference](references\u002Fgraphql-queries.md)):\n\n```bash\ngh api graphql -f query='\nquery($cursor: String) {\n  repository(owner: \"OWNER\", name: \"REPO\") {\n    pullRequest(number: PR_NUMBER) {\n      reviewThreads(first: 100, after: $cursor) {\n        pageInfo { hasNextPage endCursor }\n        nodes {\n          id\n          isResolved\n          comments(first: 1) {\n            nodes { body path author { login } }\n          }\n        }\n      }\n    }\n  }\n}'\n```\n\nResolve addressed threads:\n\n```bash\ngh api graphql -f query='\nmutation {\n  t1: resolveReviewThread(input: {threadId: \"ID1\"}) { thread { isResolved } }\n  t2: resolveReviewThread(input: {threadId: \"ID2\"}) { thread { isResolved } }\n}'\n```\n\n**GitLab** — fetch unresolved discussions and resolve each one (see [GitLab API reference](references\u002Fgitlab-api.md)):\n\n```bash\nglab api \"projects\u002F:fullpath\u002Fmerge_requests\u002F\u003CMR_IID>\u002Fdiscussions?per_page=100\"\n```\n\nFilter for `\"resolved\": false` discussions. Then resolve each by its `id`:\n\n```bash\nglab api --method PUT \\\n  \"projects\u002F:fullpath\u002Fmerge_requests\u002F\u003CMR_IID>\u002Fdiscussions\u002F\u003CDISCUSSION_ID>\" \\\n  --field resolved=true\n```\n\nRepeat for each unresolved discussion ID. (GitLab has no batch resolution — loop through each one.)\n\n#### F. Commit and push \u002F re-shelve\n\n**GitHub\u002FGitLab:**\n```bash\ngit add -A\ngit commit -m \"address greptile review feedback (greploop iteration N)\"\ngit push\n```\n\n**Perforce:**\n```bash\n# Stage changes back into the CL and re-shelve for the next review round\np4 shelve -f -c \u003CCL_NUMBER>\n```\n\nWait for checks to start after push\u002Fshelve:\n\n```bash\nsleep 5\n```\n\nThen go back to step **A**.\n\n### 3. Report\n\nAfter exiting the loop, summarize:\n\n| Field              | Value      |\n| ------------------ | ---------- |\n| Platform           | GitHub \u002F GitLab \u002F Perforce |\n| Iterations         | N          |\n| Final confidence   | X\u002F5        |\n| Comments resolved  | N          |\n| Remaining comments | N (if any) |\n\nIf the loop exited due to max iterations, list any remaining unresolved comments and suggest next steps.\n\n## Output format\n\n```\nGreploop complete.\n  Platform:      GitHub\n  Iterations:    2\n  Confidence:    5\u002F5\n  Resolved:      7 comments\n  Remaining:     0\n```\n\nIf not fully resolved:\n\n```\nGreploop stopped after 5 iterations.\n  Platform:      GitLab\n  Confidence:    4\u002F5\n  Resolved:      12 comments\n  Remaining:     2\n\nRemaining issues:\n  - src\u002Fauth.ts:45 — \"Consider rate limiting this endpoint\"\n  - src\u002Fdb.ts:112 — \"Missing index on user_id column\"\n```\n\n**Perforce example:**\n\n```\nGreploop complete.\n  Platform:      Perforce\n  Changelist:    12345\n  Iterations:    3\n  Confidence:    5\u002F5\n  Resolved:      9 comments\n  Remaining:     0\n```\n",{"name":5,"license":15,"metadata":24,"description":27,"allowed-tools":28,"compatibility":29},{"author":25,"version":26},"greptileai","1.3","Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5\u002F5 confidence score with zero unresolved comments. Triggers Greptile review, fixes all actionable comments, pushes\u002Fre-shelves, re-triggers review, and repeats. Use when the user wants to fully optimize a PR\u002FMR\u002FCL against Greptile's code review standards.\n","Bash(gh:*) Bash(glab:*) Bash(git:*) Bash(p4:*)","Requires git, gh (GitHub CLI) or glab (GitLab CLI) authenticated, and Greptile installed on the repo. For Perforce, requires p4 CLI authenticated.","main","88bec499958036c0ae373555e0a5c8232bf4625d",".agents\u002Fskills\u002Fgreptile\u002Fgreploop",6,"https:\u002F\u002Fgithub.com\u002Fpipedude\u002Fyahont-ce","https:\u002F\u002Fwww.yahont.ai","https:\u002F\u002Fgithub.com\u002Fpipedude","AI Automation Engineer, Agentic Engineer","2026-11-08 22:04:32",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add pipedude\u002Fyahont-ce --skill greploop",{"tool":45,"command":46},"bunx","bunx skills add pipedude\u002Fyahont-ce --skill greploop",{"tool":48,"command":49},"pnpm","pnpm dlx skills add pipedude\u002Fyahont-ce --skill greploop","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpipedude\u002Fyahont-ce\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fgreptile\u002Fgreploop\u002FSKILL.md",true,[53,59],{"path":54,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fgitlab-api.md","REFERENCE","参考文档",2745,"https:\u002F\u002Fgithub.com\u002Fpipedude\u002Fyahont-ce\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fgreptile\u002Fgreploop\u002Freferences\u002Fgitlab-api.md",{"path":60,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Fgraphql-queries.md",1202,"https:\u002F\u002Fgithub.com\u002Fpipedude\u002Fyahont-ce\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fgreptile\u002Fgreploop\u002Freferences\u002Fgraphql-queries.md",[64,71,78],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7F310EDNAPPQZM5MZB16YSY","merge-dependabot-prs","Triages and lands a batch of open Dependabot PRs in the Onyx repo, where main is gated exclusively by GitHub's merge queue: approves and enqueues green PRs, closes superseded duplicates, fixes mechanical CI failures (stale backend\u002Frequirements exports, stale bun.lock), tells real regressions apart from pre-existing breakage and flakes, and tracks every PR through to merge. Use when the user asks to merge, clean up, clear out, or land Dependabot (or similar bot-authored) PRs.","https:\u002F\u002Fgithub.com\u002Fpipedude\u002Fyahont-ce\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fmerge-dependabot-prs\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7F30P07J82H9ZZD4RKMTPQC","cli-review","Runs a Greptile CLI review for the current local branch, installing or authenticating the CLI when needed, then summarizes JSON findings for the user. Use when the user wants Greptile feedback before opening a PR, outside a hosted PR review flow, or directly from a local checkout.","https:\u002F\u002Fgithub.com\u002Fpipedude\u002Fyahont-ce\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fgreptile\u002Fcli-review\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7F30ERT96QS94F4GZKYSQH4","check-pr","Checks a GitHub, GitLab, or Perforce (p4) pull request (or merge request, or shelved changelist) for unresolved review comments, failing status checks, and incomplete PR descriptions. Waits for pending checks to complete, categorizes issues as actionable or informational, and optionally fixes and resolves them. Use when the user wants to check a PR\u002FMR\u002FCL, address review feedback, or prepare a change for submission.","https:\u002F\u002Fgithub.com\u002Fpipedude\u002Fyahont-ce\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fgreptile\u002Fcheck-pr\u002FSKILL.md",[],[]]