[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BY17MW7H5N43P7FXE2YWVP":3,"skill-same:01M7BY17MW7H5N43P7FXE2YWVP":67},{"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":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":34,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M7BY17MW7H5N43P7FXE2YWVP","greploop-apps",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. Identical to greploop, but triggers reviews by tagging @greptile-apps, which bypasses Greptile's file-count limit on huge PRs that the plain @greptile mention refuses to review. Use when the user wants to fully optimize a large PR\u002FMR\u002FCL against Greptile's code review standards.","ernestngenest\u002Fnez-harness","ernestngenest","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F60044067?v=4","01M7BW73YK8GQEAGTP20ZBZ2H4","officialnezt","01M7BW73Z68WHST66TP1QCR9R8",1,"MIT","https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness\u002Fblob\u002Fmain\u002Fopencode\u002Fskills\u002Fgreploop-apps\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness\u002Fblob\u002Fmain\u002Fopencode\u002Fskills\u002Fgreploop-apps\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: greploop-apps\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. Identical to greploop, but triggers\n  reviews by tagging @greptile-apps, which bypasses Greptile's file-count limit on huge PRs that the\n  plain @greptile mention refuses to review. Use when the user wants to fully optimize a large\n  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 Apps\n\nIteratively fix a PR\u002FMR\u002FCL until Greptile gives a perfect review: 5\u002F5 confidence, zero unresolved comments. This variant tags `@greptile-apps` to trigger reviews, which bypasses the file-count limit that makes Greptile skip huge PRs (e.g. \"Too many files changed for review\"). Because auto-review skips those PRs, every push needs a fresh `@greptile-apps review` comment.\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- **`--max-iterations N`** (optional, default **10**): cap on review-fix-push cycles before the loop stops and reports the current state. Raise it for large PRs where Greptile keeps surfacing new findings; lower it to bound cost.\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 at most **`--max-iterations`** times (default **10**) 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-apps 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\n**Huge-PR fallback:** on PRs over Greptile's file limit, the tagged review may never create a check run for the new head — Greptile instead edits its existing summary comment when it finishes. If the check run has not appeared after a few attempts, poll the latest Greptile-authored issue comment instead and stop when its `updated_at` moves past the time you posted the trigger and its body carries a confidence score (rather than the \"Too many files changed\" notice):\n\n```bash\ngh api --paginate \"repos\u002F{owner}\u002F{repo}\u002Fissues\u002F\u003CPR_NUMBER>\u002Fcomments?per_page=100\" \\\n  --jq '[.[] | select(.user.login | test(\"greptile\"; \"i\"))] | sort_by(.updated_at) | last | {updated_at, body}'\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-apps 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 (`\u003CN>` is the effective cap — the `--max-iterations` value supplied, or 10 by default):\n\n```\nGreploop stopped after \u003CN> iterations (--max-iterations \u003CN>).\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 Apps\n\nIteratively fix a PR\u002FMR\u002FCL until Greptile gives a perfect review: 5\u002F5 confidence, zero unresolved comments. This variant tags `@greptile-apps` to trigger reviews, which bypasses the file-count limit that makes Greptile skip huge PRs (e.g. \"Too many files changed for review\"). Because auto-review skips those PRs, every push needs a fresh `@greptile-apps review` comment.\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- **`--max-iterations N`** (optional, default **10**): cap on review-fix-push cycles before the loop stops and reports the current state. Raise it for large PRs where Greptile keeps surfacing new findings; lower it to bound cost.\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 at most **`--max-iterations`** times (default **10**) 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-apps 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\n**Huge-PR fallback:** on PRs over Greptile's file limit, the tagged review may never create a check run for the new head — Greptile instead edits its existing summary comment when it finishes. If the check run has not appeared after a few attempts, poll the latest Greptile-authored issue comment instead and stop when its `updated_at` moves past the time you posted the trigger and its body carries a confidence score (rather than the \"Too many files changed\" notice):\n\n```bash\ngh api --paginate \"repos\u002F{owner}\u002F{repo}\u002Fissues\u002F\u003CPR_NUMBER>\u002Fcomments?per_page=100\" \\\n  --jq '[.[] | select(.user.login | test(\"greptile\"; \"i\"))] | sort_by(.updated_at) | last | {updated_at, body}'\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-apps 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 (`\u003CN>` is the effective cap — the `--max-iterations` value supplied, or 10 by default):\n\n```\nGreploop stopped after \u003CN> iterations (--max-iterations \u003CN>).\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":25,"description":28,"allowed-tools":29,"compatibility":30},{"author":26,"version":27},"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. Identical to greploop, but triggers reviews by tagging @greptile-apps, which bypasses Greptile's file-count limit on huge PRs that the plain @greptile mention refuses to review. Use when the user wants to fully optimize a large 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","b03d14086eb4da27ec44e0162b65ce005fbca9ed","opencode\u002Fskills\u002Fgreploop-apps",0,"https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness","https:\u002F\u002Fgithub.com\u002Fernestngenest","just a normal person","2026-10-23 15:39:32",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add ernestngenest\u002Fnez-harness --skill greploop-apps",{"tool":45,"command":46},"bunx","bunx skills add ernestngenest\u002Fnez-harness --skill greploop-apps",{"tool":48,"command":49},"pnpm","pnpm dlx skills add ernestngenest\u002Fnez-harness --skill greploop-apps","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness\u002Fblob\u002Fmain\u002Fopencode\u002Fskills\u002Fgreploop-apps\u002FSKILL.md",true,[53,57,63],{"path":54,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":16},"LICENSE","许可证",1068,{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Fgitlab-api.md","REFERENCE","参考文档",2750,"https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness\u002Fblob\u002Fmain\u002Fopencode\u002Fskills\u002Fgreploop-apps\u002Freferences\u002Fgitlab-api.md",{"path":64,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Fgraphql-queries.md",1202,"https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness\u002Fblob\u002Fmain\u002Fopencode\u002Fskills\u002Fgreploop-apps\u002Freferences\u002Fgraphql-queries.md",[68,76,84,92,100,108],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":72,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":20},"01M7BYF1Z91D9CYG2410P3VGA2","unslop","Cut AI tells from text you write or edit for a human reader (commit messages, PR titles and bodies, docs, code comments, replies). Apply before committing, posting, or sending; leave prose you didn't touch alone.","https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness\u002Fblob\u002Fmain\u002Fopencode\u002Fskills\u002Funslop\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness\u002Fblob\u002Fmain\u002Fopencode\u002Fskills\u002Funslop\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":20},"01M7BY247Q6NB1W44F00PM7GMA","impeccable","Use when the user wants to design, redesign, shape, critique, audit, polish, simplify, harden, animate, or otherwise improve a frontend interface: websites, landing pages, dashboards, product UI, components, forms, settings, onboarding, empty states, and native iOS or Android screens. Handles UX review, hierarchy, layout, typography, color, motion, UX copy, accessibility, responsive behavior, edge cases, and capturing or documenting design systems (DESIGN.md, tokens). Also for making bland UI bolder, loud UI quieter, or ambitious visual effects. Not for backend-only or non-UI tasks.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness\u002Fblob\u002Fmain\u002Fopencode\u002Fskills\u002Fimpeccable\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":88,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":20},"01M7BY1DHADTGJW1M0KM2EZFAK","greploop","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.","https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness\u002Fblob\u002Fmain\u002Fopencode\u002Fskills\u002Fgreploop\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness\u002Fblob\u002Fmain\u002Fopencode\u002Fskills\u002Fgreploop\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":96,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":20},"01M7BXY714BYKX2MKT5SBJ3QCW","drawio-skill","Create and edit draw.io\u002Fdiagrams.net diagrams as editable `.drawio` files. Covers architecture, UML\u002FERD\u002Fsequence, BPMN, network, and swimlane views authored from a description or converted from code, IaC, SQL, and API schemas, plus sync, query, test, review, export, and publish of existing diagrams. Use when the user asks for draw.io\u002Fdiagrams.net or an editable diagram; prefer Mermaid\u002FPlantUML when diagrams-as-code is enough.","https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness\u002Fblob\u002Fmain\u002Fopencode\u002Fskills\u002Fdrawio-skill\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness\u002Fblob\u002Fmain\u002Fopencode\u002Fskills\u002Fdrawio-skill\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":104,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":20},"01M7BXVAC0D129YAS4JT6AQD5X","before-and-after","Captures before\u002Fafter screenshots of web pages or elements for visual comparison. Use when user says \"take before and after\", \"screenshot comparison\", \"visual diff\", \"PR screenshots\", \"compare old and new\", or needs to document UI changes. Accepts two URLs (file:\u002F\u002F, http:\u002F\u002F, https:\u002F\u002F) or two image paths.","https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness\u002Fblob\u002Fmain\u002Fopencode\u002Fskills\u002Fbefore-and-after\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness\u002Fblob\u002Fmain\u002Fopencode\u002Fskills\u002Fbefore-and-after\u002FSKILL.md",[],[],{"skillNo":109,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":20},"01M7BXS6S4C979SHY7K3KFRM2D","https:\u002F\u002Fgithub.com\u002Fernestngenest\u002Fnez-harness\u002Fblob\u002Fmain\u002Fcodex\u002Fskills\u002Fimpeccable\u002FSKILL.md",[],[]]