[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M73B4A7630WFKNQP8B9MSKWG":3,"skill-same:01M73B4A7630WFKNQP8B9MSKWG":62},{"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":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":35,"ownerDescription":36,"updatedAt":37,"install":38,"resources":51},"01M73B4A7630WFKNQP8B9MSKWG","greploop",null,"Iterate on an existing PR, MR, or shelved changelist until Greptile reaches 5\u002F5 with no unresolved comments. Use only when that review context, tooling, auth, and external-action approval exist.","TrebuchetDynamics\u002Fpi-toolset","TrebuchetDynamics","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F131306559?v=4","01M73B3AA92AQHVRYPW64WJSZ5","Trebuchet Dynamics","01M73B3ABCZH5W4YDBMD7CP7ZV",5,"MIT","https:\u002F\u002Fgithub.com\u002FTrebuchetDynamics\u002Fpi-toolset\u002Fblob\u002Fmain\u002Fskills\u002Fdelivery\u002Fgreploop\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: greploop\ndescription: Iterate on an existing PR, MR, or shelved changelist until Greptile reaches 5\u002F5 with no unresolved comments. Use only when that review context, tooling, auth, and external-action approval exist.\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.2\"\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)\n\nwhile true; do\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 5\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 10\ndone\n```\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')\n\nwhile true; do\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 5\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 5\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 10\ndone\n```\n\n#### B. Fetch Greptile review results\n\nGreptile may surface its score in two places — check **both** (three for Perforce):\n\n**GitHub:**\n\n**1. PR description (body):**\n```bash\ngh pr view \u003CPR_NUMBER> --json body -q '.body'\n```\n\n**2. 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 recent** score.\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\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. If `codebase-map-understand.md` exists and the finding's impact is cross-module, consult the codebase map for caller\u002Fpath leads and verify named files.\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\n## Shared contract\n\nFollow [the shared skill contract](..\u002F..\u002Fshared\u002FCOMMON-CONTRACT.md) for repo study, dirty-worktree hygiene, verification evidence, safe handoffs, and safety defaults.\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)\n\nwhile true; do\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 5\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 10\ndone\n```\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')\n\nwhile true; do\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 5\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 5\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 10\ndone\n```\n\n#### B. Fetch Greptile review results\n\nGreptile may surface its score in two places — check **both** (three for Perforce):\n\n**GitHub:**\n\n**1. PR description (body):**\n```bash\ngh pr view \u003CPR_NUMBER> --json body -q '.body'\n```\n\n**2. 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 recent** score.\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\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. If `codebase-map-understand.md` exists and the finding's impact is cross-module, consult the codebase map for caller\u002Fpath leads and verify named files.\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\n## Shared contract\n\nFollow [the shared skill contract](..\u002F..\u002Fshared\u002FCOMMON-CONTRACT.md) for repo study, dirty-worktree hygiene, verification evidence, safe handoffs, and safety defaults.\n",{"name":5,"license":15,"metadata":24,"description":7,"allowed-tools":27,"compatibility":28},{"author":25,"version":26},"greptileai","1.2","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","5e9aa8398adb6812fb816bf887d1ad10f12c55db","skills\u002Fdelivery\u002Fgreploop",0,"https:\u002F\u002Fgithub.com\u002FTrebuchetDynamics\u002Fpi-toolset","https:\u002F\u002Fgithub.com\u002FTrebuchetDynamics","https:\u002F\u002Ftrebuchetdynamics.com","Serious engineering for systems that cannot fail quietly","2026-10-17 04:37:36",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add TrebuchetDynamics\u002Fpi-toolset --skill greploop",{"tool":44,"command":45},"bunx","bunx skills add TrebuchetDynamics\u002Fpi-toolset --skill greploop",{"tool":47,"command":48},"pnpm","pnpm dlx skills add TrebuchetDynamics\u002Fpi-toolset --skill greploop","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTrebuchetDynamics\u002Fpi-toolset\u002Fblob\u002Fmain\u002Fskills\u002Fdelivery\u002Fgreploop\u002FSKILL.md",true,[52,58],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fgitlab-api.md","REFERENCE","参考文档",2745,"https:\u002F\u002Fgithub.com\u002FTrebuchetDynamics\u002Fpi-toolset\u002Fblob\u002Fmain\u002Fskills\u002Fdelivery\u002Fgreploop\u002Freferences\u002Fgitlab-api.md",{"path":59,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fgraphql-queries.md",753,"https:\u002F\u002Fgithub.com\u002FTrebuchetDynamics\u002Fpi-toolset\u002Fblob\u002Fmain\u002Fskills\u002Fdelivery\u002Fgreploop\u002Freferences\u002Fgraphql-queries.md",[63,72,79,86,93],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":67,"licenseFileUrl":68,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M73B6VW40W876ZJH991GNECA","impeccable","Use when designing, building, redesigning, critiquing, auditing, or polishing a frontend interface, including websites, landing pages, dashboards, product UI, components, forms, onboarding, typography, color, layout, motion, UX copy, accessibility, responsive behavior, and design systems. Also for live browser variant iteration. Not for backend-only or non-UI tasks.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FTrebuchetDynamics\u002Fpi-toolset\u002Fblob\u002Fmain\u002Fskills\u002Ffrontend\u002Fimpeccable\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTrebuchetDynamics\u002Fpi-toolset\u002Fblob\u002Fmain\u002Fskills\u002Ffrontend\u002Fimpeccable\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M73B6RVWFDBP9XDF3EPC23BX","diagram-design","Create standalone architecture, sequence, and process diagrams as accessible HTML\u002FSVG. Use for shareable visual explanations; not app UI, scientific plots, or simple inline Mermaid diagrams.","https:\u002F\u002Fgithub.com\u002FTrebuchetDynamics\u002Fpi-toolset\u002Fblob\u002Fmain\u002Fskills\u002Ffrontend\u002Fdiagram-design\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M73B6DAS71JY33H0J64NNP4D","beautify-github-readme","Use when improving a GitHub repository README visually, creating GitHub-safe README SVG assets, or auditing README presentation; not general website UI or ordinary documentation maintenance.","https:\u002F\u002Fgithub.com\u002FTrebuchetDynamics\u002Fpi-toolset\u002Fblob\u002Fmain\u002Fskills\u002Ffrontend\u002Fbeautify-github-readme\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M73B6830KQA1THCG9BZPKYR4","wayfinder","Plan work larger than one agent session as a shared map of decision tickets, then resolve them one at a time. Use when a large, unclear effort needs durable cross-session planning before implementation.","https:\u002F\u002Fgithub.com\u002FTrebuchetDynamics\u002Fpi-toolset\u002Fblob\u002Fmain\u002Fskills\u002Fengineering\u002Fwayfinder\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M73B3WDJ75QXPFMY4V7YXWYV","ponytail","Persistent YAGNI and shortest-safe-diff implementation mode. Use when the user says ponytail, be lazy, simplest\u002Fminimal solution, do less, or complains about over-engineering. Do not use for non-coding requests or one-shot audits\u002Freviews.","https:\u002F\u002Fgithub.com\u002FTrebuchetDynamics\u002Fpi-toolset\u002Fblob\u002Fmain\u002Fskills\u002Fcommunication\u002Fponytail\u002FSKILL.md",[],[]]