@rozek/nanoclaw 1.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (305) hide show
  1. package/.claude/settings.json +1 -0
  2. package/.claude/skills/add-compact/SKILL.md +135 -0
  3. package/.claude/skills/add-discord/SKILL.md +203 -0
  4. package/.claude/skills/add-gmail/SKILL.md +220 -0
  5. package/.claude/skills/add-image-vision/SKILL.md +94 -0
  6. package/.claude/skills/add-ollama-tool/SKILL.md +153 -0
  7. package/.claude/skills/add-parallel/SKILL.md +290 -0
  8. package/.claude/skills/add-pdf-reader/SKILL.md +104 -0
  9. package/.claude/skills/add-reactions/SKILL.md +117 -0
  10. package/.claude/skills/add-slack/SKILL.md +207 -0
  11. package/.claude/skills/add-telegram/SKILL.md +222 -0
  12. package/.claude/skills/add-telegram-swarm/SKILL.md +384 -0
  13. package/.claude/skills/add-voice-transcription/SKILL.md +148 -0
  14. package/.claude/skills/add-whatsapp/SKILL.md +372 -0
  15. package/.claude/skills/convert-to-apple-container/SKILL.md +175 -0
  16. package/.claude/skills/customize/SKILL.md +110 -0
  17. package/.claude/skills/debug/SKILL.md +349 -0
  18. package/.claude/skills/get-qodo-rules/SKILL.md +122 -0
  19. package/.claude/skills/get-qodo-rules/references/output-format.md +41 -0
  20. package/.claude/skills/get-qodo-rules/references/pagination.md +33 -0
  21. package/.claude/skills/get-qodo-rules/references/repository-scope.md +26 -0
  22. package/.claude/skills/qodo-pr-resolver/SKILL.md +326 -0
  23. package/.claude/skills/qodo-pr-resolver/resources/providers.md +329 -0
  24. package/.claude/skills/setup/SKILL.md +218 -0
  25. package/.claude/skills/update-nanoclaw/SKILL.md +235 -0
  26. package/.claude/skills/update-skills/SKILL.md +130 -0
  27. package/.claude/skills/use-local-whisper/SKILL.md +152 -0
  28. package/.claude/skills/x-integration/SKILL.md +417 -0
  29. package/.claude/skills/x-integration/agent.ts +243 -0
  30. package/.claude/skills/x-integration/host.ts +159 -0
  31. package/.claude/skills/x-integration/lib/browser.ts +148 -0
  32. package/.claude/skills/x-integration/lib/config.ts +62 -0
  33. package/.claude/skills/x-integration/scripts/like.ts +56 -0
  34. package/.claude/skills/x-integration/scripts/post.ts +66 -0
  35. package/.claude/skills/x-integration/scripts/quote.ts +80 -0
  36. package/.claude/skills/x-integration/scripts/reply.ts +74 -0
  37. package/.claude/skills/x-integration/scripts/retweet.ts +62 -0
  38. package/.claude/skills/x-integration/scripts/setup.ts +87 -0
  39. package/.env.example +1 -0
  40. package/.github/CODEOWNERS +10 -0
  41. package/.github/PULL_REQUEST_TEMPLATE.md +14 -0
  42. package/.github/workflows/bump-version.yml +32 -0
  43. package/.github/workflows/ci.yml +25 -0
  44. package/.github/workflows/merge-forward-skills.yml +160 -0
  45. package/.github/workflows/update-tokens.yml +42 -0
  46. package/.husky/pre-commit +1 -0
  47. package/.mcp.json +3 -0
  48. package/.nvmrc +1 -0
  49. package/.prettierrc +3 -0
  50. package/CHANGELOG.md +8 -0
  51. package/CLAUDE.md +64 -0
  52. package/CONTRIBUTING.md +23 -0
  53. package/CONTRIBUTORS.md +15 -0
  54. package/LICENSE +21 -0
  55. package/NanoClaw_with_Web-Support.md +290 -0
  56. package/README.md +261 -0
  57. package/README_zh.md +200 -0
  58. package/assets/nanoclaw-favicon.png +0 -0
  59. package/assets/nanoclaw-icon.png +0 -0
  60. package/assets/nanoclaw-logo-dark.png +0 -0
  61. package/assets/nanoclaw-logo.png +0 -0
  62. package/assets/nanoclaw-profile.jpeg +0 -0
  63. package/assets/nanoclaw-sales.png +0 -0
  64. package/assets/social-preview.jpg +0 -0
  65. package/config-examples/mount-allowlist.json +25 -0
  66. package/container/Dockerfile +70 -0
  67. package/container/agent-runner/package-lock.json +1524 -0
  68. package/container/agent-runner/package.json +21 -0
  69. package/container/agent-runner/src/index.ts +558 -0
  70. package/container/agent-runner/src/ipc-mcp-stdio.ts +338 -0
  71. package/container/agent-runner/tsconfig.json +15 -0
  72. package/container/build.sh +23 -0
  73. package/container/skills/agent-browser/SKILL.md +159 -0
  74. package/container/skills/capabilities/SKILL.md +100 -0
  75. package/container/skills/status/SKILL.md +104 -0
  76. package/dist/channels/index.d.ts +2 -0
  77. package/dist/channels/index.d.ts.map +1 -0
  78. package/dist/channels/index.js +9 -0
  79. package/dist/channels/index.js.map +1 -0
  80. package/dist/channels/registry.d.ts +13 -0
  81. package/dist/channels/registry.d.ts.map +1 -0
  82. package/dist/channels/registry.js +11 -0
  83. package/dist/channels/registry.js.map +1 -0
  84. package/dist/channels/registry.test.d.ts +2 -0
  85. package/dist/channels/registry.test.d.ts.map +1 -0
  86. package/dist/channels/registry.test.js +32 -0
  87. package/dist/channels/registry.test.js.map +1 -0
  88. package/dist/channels/web.d.ts +2 -0
  89. package/dist/channels/web.d.ts.map +1 -0
  90. package/dist/channels/web.js +1738 -0
  91. package/dist/channels/web.js.map +1 -0
  92. package/dist/cli.d.ts +11 -0
  93. package/dist/cli.d.ts.map +1 -0
  94. package/dist/cli.js +182 -0
  95. package/dist/cli.js.map +1 -0
  96. package/dist/config.d.ts +19 -0
  97. package/dist/config.d.ts.map +1 -0
  98. package/dist/config.js +36 -0
  99. package/dist/config.js.map +1 -0
  100. package/dist/container-runner.d.ts +44 -0
  101. package/dist/container-runner.d.ts.map +1 -0
  102. package/dist/container-runner.js +467 -0
  103. package/dist/container-runner.js.map +1 -0
  104. package/dist/container-runner.test.d.ts +2 -0
  105. package/dist/container-runner.test.d.ts.map +1 -0
  106. package/dist/container-runner.test.js +150 -0
  107. package/dist/container-runner.test.js.map +1 -0
  108. package/dist/container-runtime.d.ts +22 -0
  109. package/dist/container-runtime.d.ts.map +1 -0
  110. package/dist/container-runtime.js +96 -0
  111. package/dist/container-runtime.js.map +1 -0
  112. package/dist/container-runtime.test.d.ts +2 -0
  113. package/dist/container-runtime.test.d.ts.map +1 -0
  114. package/dist/container-runtime.test.js +93 -0
  115. package/dist/container-runtime.test.js.map +1 -0
  116. package/dist/credential-proxy.d.ts +21 -0
  117. package/dist/credential-proxy.d.ts.map +1 -0
  118. package/dist/credential-proxy.js +95 -0
  119. package/dist/credential-proxy.js.map +1 -0
  120. package/dist/credential-proxy.test.d.ts +2 -0
  121. package/dist/credential-proxy.test.d.ts.map +1 -0
  122. package/dist/credential-proxy.test.js +134 -0
  123. package/dist/credential-proxy.test.js.map +1 -0
  124. package/dist/db.d.ts +115 -0
  125. package/dist/db.d.ts.map +1 -0
  126. package/dist/db.js +549 -0
  127. package/dist/db.js.map +1 -0
  128. package/dist/db.test.d.ts +2 -0
  129. package/dist/db.test.d.ts.map +1 -0
  130. package/dist/db.test.js +360 -0
  131. package/dist/db.test.js.map +1 -0
  132. package/dist/env.d.ts +8 -0
  133. package/dist/env.d.ts.map +1 -0
  134. package/dist/env.js +42 -0
  135. package/dist/env.js.map +1 -0
  136. package/dist/formatting.test.d.ts +2 -0
  137. package/dist/formatting.test.d.ts.map +1 -0
  138. package/dist/formatting.test.js +183 -0
  139. package/dist/formatting.test.js.map +1 -0
  140. package/dist/group-folder.d.ts +5 -0
  141. package/dist/group-folder.d.ts.map +1 -0
  142. package/dist/group-folder.js +44 -0
  143. package/dist/group-folder.js.map +1 -0
  144. package/dist/group-folder.test.d.ts +2 -0
  145. package/dist/group-folder.test.d.ts.map +1 -0
  146. package/dist/group-folder.test.js +29 -0
  147. package/dist/group-folder.test.js.map +1 -0
  148. package/dist/group-queue.d.ts +34 -0
  149. package/dist/group-queue.d.ts.map +1 -0
  150. package/dist/group-queue.js +263 -0
  151. package/dist/group-queue.js.map +1 -0
  152. package/dist/group-queue.test.d.ts +2 -0
  153. package/dist/group-queue.test.d.ts.map +1 -0
  154. package/dist/group-queue.test.js +341 -0
  155. package/dist/group-queue.test.js.map +1 -0
  156. package/dist/index.d.ts +12 -0
  157. package/dist/index.d.ts.map +1 -0
  158. package/dist/index.js +518 -0
  159. package/dist/index.js.map +1 -0
  160. package/dist/ipc-auth.test.d.ts +2 -0
  161. package/dist/ipc-auth.test.d.ts.map +1 -0
  162. package/dist/ipc-auth.test.js +434 -0
  163. package/dist/ipc-auth.test.js.map +1 -0
  164. package/dist/ipc.d.ts +32 -0
  165. package/dist/ipc.d.ts.map +1 -0
  166. package/dist/ipc.js +311 -0
  167. package/dist/ipc.js.map +1 -0
  168. package/dist/logger.d.ts +3 -0
  169. package/dist/logger.d.ts.map +1 -0
  170. package/dist/logger.js +14 -0
  171. package/dist/logger.js.map +1 -0
  172. package/dist/mount-security.d.ts +34 -0
  173. package/dist/mount-security.d.ts.map +1 -0
  174. package/dist/mount-security.js +325 -0
  175. package/dist/mount-security.js.map +1 -0
  176. package/dist/remote-control.d.ts +32 -0
  177. package/dist/remote-control.d.ts.map +1 -0
  178. package/dist/remote-control.js +185 -0
  179. package/dist/remote-control.js.map +1 -0
  180. package/dist/remote-control.test.d.ts +2 -0
  181. package/dist/remote-control.test.d.ts.map +1 -0
  182. package/dist/remote-control.test.js +321 -0
  183. package/dist/remote-control.test.js.map +1 -0
  184. package/dist/router.d.ts +8 -0
  185. package/dist/router.d.ts.map +1 -0
  186. package/dist/router.js +37 -0
  187. package/dist/router.js.map +1 -0
  188. package/dist/routing.test.d.ts +2 -0
  189. package/dist/routing.test.d.ts.map +1 -0
  190. package/dist/routing.test.js +81 -0
  191. package/dist/routing.test.js.map +1 -0
  192. package/dist/sender-allowlist.d.ts +14 -0
  193. package/dist/sender-allowlist.d.ts.map +1 -0
  194. package/dist/sender-allowlist.js +79 -0
  195. package/dist/sender-allowlist.js.map +1 -0
  196. package/dist/sender-allowlist.test.d.ts +2 -0
  197. package/dist/sender-allowlist.test.d.ts.map +1 -0
  198. package/dist/sender-allowlist.test.js +186 -0
  199. package/dist/sender-allowlist.test.js.map +1 -0
  200. package/dist/session-commands.d.ts +47 -0
  201. package/dist/session-commands.d.ts.map +1 -0
  202. package/dist/session-commands.js +102 -0
  203. package/dist/session-commands.js.map +1 -0
  204. package/dist/session-commands.test.d.ts +2 -0
  205. package/dist/session-commands.test.d.ts.map +1 -0
  206. package/dist/session-commands.test.js +190 -0
  207. package/dist/session-commands.test.js.map +1 -0
  208. package/dist/task-scheduler.d.ts +22 -0
  209. package/dist/task-scheduler.d.ts.map +1 -0
  210. package/dist/task-scheduler.js +210 -0
  211. package/dist/task-scheduler.js.map +1 -0
  212. package/dist/task-scheduler.test.d.ts +2 -0
  213. package/dist/task-scheduler.test.d.ts.map +1 -0
  214. package/dist/task-scheduler.test.js +107 -0
  215. package/dist/task-scheduler.test.js.map +1 -0
  216. package/dist/timezone.d.ts +6 -0
  217. package/dist/timezone.d.ts.map +1 -0
  218. package/dist/timezone.js +17 -0
  219. package/dist/timezone.js.map +1 -0
  220. package/dist/timezone.test.d.ts +2 -0
  221. package/dist/timezone.test.d.ts.map +1 -0
  222. package/dist/timezone.test.js +23 -0
  223. package/dist/timezone.test.js.map +1 -0
  224. package/dist/types.d.ts +78 -0
  225. package/dist/types.d.ts.map +1 -0
  226. package/dist/types.js +2 -0
  227. package/dist/types.js.map +1 -0
  228. package/docs/APPLE-CONTAINER-NETWORKING.md +90 -0
  229. package/docs/DEBUG_CHECKLIST.md +143 -0
  230. package/docs/REQUIREMENTS.md +196 -0
  231. package/docs/SDK_DEEP_DIVE.md +643 -0
  232. package/docs/SECURITY.md +122 -0
  233. package/docs/SPEC.md +785 -0
  234. package/docs/docker-sandboxes.md +359 -0
  235. package/docs/nanoclaw-architecture-final.md +1063 -0
  236. package/docs/nanorepo-architecture.md +168 -0
  237. package/docs/skills-as-branches.md +662 -0
  238. package/groups/global/CLAUDE.md +58 -0
  239. package/groups/main/CLAUDE.md +246 -0
  240. package/launchd/com.nanoclaw.plist +32 -0
  241. package/package.json +45 -0
  242. package/repo-tokens/README.md +113 -0
  243. package/repo-tokens/action.yml +186 -0
  244. package/repo-tokens/badge.svg +23 -0
  245. package/repo-tokens/examples/green.svg +14 -0
  246. package/repo-tokens/examples/red.svg +14 -0
  247. package/repo-tokens/examples/yellow-green.svg +14 -0
  248. package/repo-tokens/examples/yellow.svg +14 -0
  249. package/scripts/run-migrations.ts +105 -0
  250. package/setup/container.ts +144 -0
  251. package/setup/environment.test.ts +121 -0
  252. package/setup/environment.ts +94 -0
  253. package/setup/groups.ts +229 -0
  254. package/setup/index.ts +58 -0
  255. package/setup/mounts.ts +115 -0
  256. package/setup/platform.test.ts +120 -0
  257. package/setup/platform.ts +132 -0
  258. package/setup/register.test.ts +257 -0
  259. package/setup/register.ts +177 -0
  260. package/setup/service.test.ts +187 -0
  261. package/setup/service.ts +362 -0
  262. package/setup/status.ts +16 -0
  263. package/setup/verify.ts +192 -0
  264. package/setup.sh +161 -0
  265. package/src/channels/index.ts +12 -0
  266. package/src/channels/registry.test.ts +42 -0
  267. package/src/channels/registry.ts +32 -0
  268. package/src/channels/web.ts +1856 -0
  269. package/src/cli.ts +209 -0
  270. package/src/config.ts +73 -0
  271. package/src/container-runner.test.ts +210 -0
  272. package/src/container-runner.ts +707 -0
  273. package/src/container-runtime.test.ts +149 -0
  274. package/src/container-runtime.ts +127 -0
  275. package/src/credential-proxy.test.ts +192 -0
  276. package/src/credential-proxy.ts +125 -0
  277. package/src/db.test.ts +484 -0
  278. package/src/db.ts +803 -0
  279. package/src/env.ts +42 -0
  280. package/src/formatting.test.ts +256 -0
  281. package/src/group-folder.test.ts +43 -0
  282. package/src/group-folder.ts +44 -0
  283. package/src/group-queue.test.ts +484 -0
  284. package/src/group-queue.ts +365 -0
  285. package/src/index.ts +731 -0
  286. package/src/ipc-auth.test.ts +679 -0
  287. package/src/ipc.ts +461 -0
  288. package/src/logger.ts +16 -0
  289. package/src/mount-security.ts +419 -0
  290. package/src/remote-control.test.ts +397 -0
  291. package/src/remote-control.ts +224 -0
  292. package/src/router.ts +52 -0
  293. package/src/routing.test.ts +170 -0
  294. package/src/sender-allowlist.test.ts +216 -0
  295. package/src/sender-allowlist.ts +128 -0
  296. package/src/session-commands.test.ts +247 -0
  297. package/src/session-commands.ts +163 -0
  298. package/src/task-scheduler.test.ts +129 -0
  299. package/src/task-scheduler.ts +295 -0
  300. package/src/timezone.test.ts +29 -0
  301. package/src/timezone.ts +16 -0
  302. package/src/types.ts +107 -0
  303. package/tsconfig.json +20 -0
  304. package/vitest.config.ts +7 -0
  305. package/vitest.skills.config.ts +7 -0
@@ -0,0 +1,326 @@
1
+ ---
2
+ name: qodo-pr-resolver
3
+ description: Review and resolve PR issues with Qodo - get AI-powered code review issues and fix them interactively (GitHub, GitLab, Bitbucket, Azure DevOps)
4
+ version: 0.3.0
5
+ triggers:
6
+ - qodo.?pr.?resolver
7
+ - pr.?resolver
8
+ - resolve.?pr
9
+ - qodo.?fix
10
+ - fix.?qodo
11
+ - qodo.?review
12
+ - review.?qodo
13
+ - qodo.?issues?
14
+ - show.?qodo
15
+ - get.?qodo
16
+ - qodo.?resolve
17
+ ---
18
+
19
+ # Qodo PR Resolver
20
+
21
+ Fetch Qodo review issues for your current branch's PR/MR, fix them interactively or in batch, and reply to each inline comment with the decision. Supports GitHub, GitLab, Bitbucket, and Azure DevOps.
22
+
23
+ ## Prerequisites
24
+
25
+ ### Required Tools:
26
+ - **Git** - For branch operations
27
+ - **Git Provider CLI** - One of: `gh` (GitHub), `glab` (GitLab), `bb` (Bitbucket), or `az` (Azure DevOps)
28
+
29
+ **Installation and authentication details:** See [providers.md](./resources/providers.md) for provider-specific setup instructions.
30
+
31
+ ### Required Context:
32
+ - Must be in a git repository
33
+ - Repository must be hosted on a supported git provider (GitHub, GitLab, Bitbucket, or Azure DevOps)
34
+ - Current branch must have an open PR/MR
35
+ - PR/MR must have been reviewed by Qodo (pr-agent-pro bot, qodo-merge[bot], etc.)
36
+
37
+ ### Quick Check:
38
+ ```bash
39
+ git --version # Check git installed
40
+ git remote get-url origin # Identify git provider
41
+ ```
42
+
43
+ See [providers.md](./resources/providers.md) for provider-specific verification commands.
44
+
45
+ ## Understanding Qodo Reviews
46
+
47
+ Qodo (formerly Codium AI) is an AI-powered code review tool that analyzes PRs/MRs with compliance checks, bug detection, and code quality suggestions.
48
+
49
+ ### Bot Identifiers
50
+ Look for comments from: **`pr-agent-pro`**, **`pr-agent-pro-staging`**, **`qodo-merge[bot]`**, **`qodo-ai[bot]`**
51
+
52
+ ### Review Comment Types
53
+ 1. **PR Compliance Guide** 🔍 - Security/ticket/custom compliance with 🟢/🟡/🔴/⚪ indicators
54
+ 2. **PR Code Suggestions** ✨ - Categorized improvements with importance ratings
55
+ 3. **Code Review by Qodo** - Structured issues with 🐞/📘/📎 sections and agent prompts (most detailed)
56
+
57
+ ## Instructions
58
+
59
+ When the user asks for a code review, to see Qodo issues, or fix Qodo comments:
60
+
61
+ ### Step 0: Check code push status
62
+
63
+ Check for uncommitted changes, unpushed commits, and get the current branch.
64
+
65
+ #### Scenario A: Uncommitted changes exist
66
+
67
+ - Inform: "⚠️ You have uncommitted changes. These won't be included in the Qodo review."
68
+ - Ask: "Would you like to commit and push them first?"
69
+ - If yes: Wait for user action, then proceed to Step 1
70
+ - If no: Warn "Proceeding with review of pushed code only" and continue to Step 1
71
+
72
+ #### Scenario B: Unpushed commits exist
73
+
74
+ (no uncommitted changes)
75
+
76
+ - Inform: "⚠️ You have N unpushed commits. Qodo hasn't reviewed them yet."
77
+ - Ask: "Would you like to push them now?"
78
+ - If yes: Execute `git push`, inform "Pushed! Qodo will review shortly. Please wait ~5 minutes then run this skill again."
79
+ - Exit skill (don't proceed - Qodo needs time to review)
80
+ - If no: Warn "Proceeding with existing PR review" and continue to Step 1
81
+
82
+ #### Scenario C: Everything pushed
83
+
84
+ (both uncommitted changes and unpushed commits are empty)
85
+
86
+ - Proceed to Step 1
87
+
88
+ ### Step 1: Detect git provider
89
+
90
+ Detect git provider from the remote URL (`git remote get-url origin`).
91
+
92
+ See [providers.md](./resources/providers.md) for provider detection patterns.
93
+
94
+ ### Step 2: Find the open PR/MR
95
+
96
+ Find the open PR/MR for this branch using the provider's CLI.
97
+
98
+ See [providers.md § Find Open PR/MR](./resources/providers.md#find-open-prmr) for provider-specific commands.
99
+
100
+ ### Step 3: Get Qodo review comments
101
+
102
+ Get the Qodo review comments using the provider's CLI.
103
+
104
+ Qodo typically posts both a **summary comment** (PR-level, containing all issues) and **inline review comments** (one per issue, attached to specific lines of code). You must fetch both.
105
+
106
+ See [providers.md § Fetch Review Comments](./resources/providers.md#fetch-review-comments) for provider-specific commands.
107
+
108
+ Look for comments where the author is "qodo-merge[bot]", "pr-agent-pro", "pr-agent-pro-staging" or similar Qodo bot name.
109
+
110
+ #### Step 3a: Check if review is still in progress
111
+
112
+ - If any comment contains "Come back again in a few minutes" or "An AI review agent is analysing this pull request", the review is still running
113
+ - In this case, inform the user: "⏳ Qodo review is still in progress. Please wait a few minutes and try again."
114
+ - Exit early - don't try to parse incomplete reviews
115
+
116
+ #### Step 3b: Deduplicate issues
117
+
118
+ Deduplicate issues across summary and inline comments:
119
+
120
+ - Qodo posts each issue in two places: once in the **summary comment** (PR-level) and once as an **inline review comment** (attached to the specific code line). These will share the same issue title.
121
+ - Qodo may also post multiple summary comments (Compliance Guide, Code Suggestions, Code Review, etc.) where issues can overlap with slightly different wording.
122
+ - Deduplicate by matching on **issue title** (primary key - the same title means the same issue):
123
+ - If an issue appears in both the summary comment and as an inline comment, merge them into a single issue
124
+ - Prefer the **inline comment** for file location (it has the exact line context)
125
+ - Prefer the **summary comment** for severity, type, and agent prompt (it is more detailed)
126
+ - **IMPORTANT:** Preserve each issue's **inline review comment ID** — you will need it later (Step 8) to reply directly to that comment with the decision
127
+ - Also deduplicate across multiple summary comments by location (file path + line numbers) as a secondary key
128
+ - If the same issue appears in multiple places, combine the agent prompts
129
+
130
+ ### Step 4: Parse and display the issues
131
+
132
+ - Extract the review body/comments from Qodo's review
133
+ - Parse out individual issues/suggestions
134
+ - **IMPORTANT: Preserve Qodo's exact issue titles verbatim** — do not rename, paraphrase, or summarize them. Use the title exactly as Qodo wrote it.
135
+ - **IMPORTANT: Preserve Qodo's original ordering** — display issues in the same order Qodo listed them. Qodo already orders by severity.
136
+ - Extract location, issue description, and suggested fix
137
+ - Extract the agent prompt from Qodo's suggestion (the description of what needs to be fixed)
138
+
139
+ #### Severity mapping
140
+
141
+ Derive severity from Qodo's action level and position:
142
+
143
+ 1. **Action level determines severity range:**
144
+ - **"Action required"** issues → Can only be 🔴 CRITICAL or 🟠 HIGH
145
+ - **"Review recommended"** / **"Remediation recommended"** issues → Can only be 🟡 MEDIUM or ⚪ LOW
146
+ - **"Other"** / **"Advisory comments"** issues → Always ⚪ LOW (lowest priority)
147
+
148
+ 2. **Qodo's position within each action level determines the specific severity:**
149
+ - Group issues by action level ("Action required" vs "Review recommended" vs "Other")
150
+ - Within "Action required" and "Review recommended" groups: earlier positions → higher severity, later positions → lower severity
151
+ - Split point: roughly first half of each group gets the higher severity, second half gets the lower
152
+ - All "Other" issues are treated as ⚪ LOW regardless of position
153
+
154
+ **Example:** 7 "Action required" issues would be split as:
155
+ - Issues 1-3: 🔴 CRITICAL
156
+ - Issues 4-7: 🟠 HIGH
157
+ - Result: No MEDIUM or LOW issues (because there are no "Review recommended" or "Other" issues)
158
+
159
+ **Example:** 5 "Action required" + 3 "Review recommended" + 2 "Other" issues would be split as:
160
+ - Issues 1-2 or 1-3: 🔴 CRITICAL (first ~half of "Action required")
161
+ - Issues 3-5 or 4-5: 🟠 HIGH (second ~half of "Action required")
162
+ - Issues 6-7: 🟡 MEDIUM (first ~half of "Review recommended")
163
+ - Issue 8: ⚪ LOW (second ~half of "Review recommended")
164
+ - Issues 9-10: ⚪ LOW (all "Other" issues)
165
+
166
+ **Action guidelines:**
167
+ - 🔴 CRITICAL / 🟠 HIGH ("Action required"): Always "Fix"
168
+ - 🟡 MEDIUM ("Review recommended"): Usually "Fix", can "Defer" if low impact
169
+ - ⚪ LOW ("Review recommended" or "Other"): Can be "Defer" unless quick to fix; "Other" issues are lowest priority
170
+
171
+ #### Output format
172
+
173
+ Display as a markdown table in Qodo's exact original ordering (do NOT reorder by severity - Qodo's order IS the severity ranking):
174
+
175
+ ```
176
+ Qodo Issues for PR #123: [PR Title]
177
+
178
+ | # | Severity | Issue Title | Issue Details | Type | Action |
179
+ |---|----------|-------------|---------------|------|--------|
180
+ | 1 | 🔴 CRITICAL | Insecure authentication check | • **Location:** src/auth/service.py:42<br><br>• **Issue:** Authorization logic is inverted | 🐞 Bug ⛨ Security | Fix |
181
+ | 2 | 🔴 CRITICAL | Missing input validation | • **Location:** src/api/handlers.py:156<br><br>• **Issue:** User input not sanitized before database query | 📘 Rule violation ⛯ Reliability | Fix |
182
+ | 3 | 🟠 HIGH | Database query not awaited | • **Location:** src/db/repository.py:89<br><br>• **Issue:** Async call missing await keyword | 🐞 Bug ✓ Correctness | Fix |
183
+ ```
184
+
185
+ ### Step 5: Ask user for fix preference
186
+
187
+ After displaying the table, ask the user how they want to proceed using AskUserQuestion:
188
+
189
+ **Options:**
190
+ - 🔍 "Review each issue" - Review and approve/defer each issue individually (recommended for careful review)
191
+ - ⚡ "Auto-fix all" - Automatically apply all fixes marked as "Fix" without individual approval (faster, but less control)
192
+ - ❌ "Cancel" - Exit without making changes
193
+
194
+ **Based on the user's choice:**
195
+ - If "Review each issue": Proceed to Step 6 (manual review)
196
+ - If "Auto-fix all": Skip to Step 7 (auto-fix mode - apply all "Fix" issues automatically using Qodo's agent prompts)
197
+ - If "Cancel": Exit the skill
198
+
199
+ ### Step 6: Review and fix issues (manual mode)
200
+
201
+ If "Review each issue" was selected:
202
+
203
+ - For each issue marked as "Fix" (starting with CRITICAL):
204
+ - Read the relevant file(s) to understand the current code
205
+ - Implement the fix by **executing the Qodo agent prompt as a direct instruction**. The agent prompt is the fix specification — follow it literally, do not reinterpret or improvise a different solution. Only deviate if the prompt is clearly outdated relative to the current code (e.g. references lines that no longer exist).
206
+ - Calculate the proposed fix in memory (DO NOT use Edit or Write tool yet)
207
+ - **Present the fix and ask for approval in a SINGLE step:**
208
+ 1. Show a brief header with issue title and location
209
+ 2. **Show Qodo's agent prompt in full** so the user can verify the fix matches it
210
+ 3. Display current code snippet
211
+ 4. Display proposed change as markdown diff
212
+ 5. Immediately use AskUserQuestion with these options:
213
+ - ✅ "Apply fix" - Apply the proposed change
214
+ - ⏭️ "Defer" - Skip this issue (will prompt for reason)
215
+ - 🔧 "Modify" - User wants to adjust the fix first
216
+ - **WAIT for user's choice via AskUserQuestion**
217
+ - **If "Apply fix" selected:**
218
+ - Apply change using Edit tool (or Write if creating new file)
219
+ - Reply to the Qodo inline comment with the decision (see Step 8 for inline reply commands)
220
+ - Git commit the fix: `git add <modified-files> && git commit -m "fix: <issue title>"`
221
+ - Confirm: "✅ Fix applied, commented, and committed!"
222
+ - Mark issue as completed
223
+ - **If "Defer" selected:**
224
+ - Ask for deferral reason using AskUserQuestion
225
+ - Reply to the Qodo inline comment with the deferral (see Step 8 for inline reply commands)
226
+ - Record reason and move to next issue
227
+ - **If "Modify" selected:**
228
+ - Inform user they can make changes manually
229
+ - Move to next issue
230
+ - Continue until all "Fix" issues are addressed or the user decides to stop
231
+
232
+ #### Important notes
233
+
234
+ **Single-step approval with AskUserQuestion:**
235
+ - NO native Edit UI (no persistent permissions possible)
236
+ - Each fix requires explicit approval via custom question
237
+ - Clearer options, no risk of accidental auto-approval
238
+
239
+ **CRITICAL:** Single validation only - do NOT show the diff separately and then ask. Combine the diff display and the question into ONE message. The user should see: brief context → current code → proposed diff → AskUserQuestion, all at once.
240
+
241
+ **Example:** Show location, Qodo's guidance, current code, proposed diff, then AskUserQuestion with options (✅ Apply fix / ⏭️ Defer / 🔧 Modify). Wait for user choice, apply via Edit tool if approved.
242
+
243
+ ### Step 7: Auto-fix mode
244
+
245
+ If "Auto-fix all" was selected:
246
+
247
+ - For each issue marked as "Fix" (starting with CRITICAL):
248
+ - Read the relevant file(s) to understand the current code
249
+ - Implement the fix by **executing the Qodo agent prompt as a direct instruction**. The agent prompt is the fix specification — follow it literally, do not reinterpret or improvise a different solution. Only deviate if the prompt is clearly outdated relative to the current code (e.g. references lines that no longer exist).
250
+ - Apply the fix using Edit tool
251
+ - Reply to the Qodo inline comment with the decision (see Step 8 for inline reply commands)
252
+ - Git commit the fix: `git add <modified-files> && git commit -m "fix: <issue title>"`
253
+ - Report each fix with the agent prompt that was followed:
254
+ > ✅ **Fixed: [Issue Title]** at `[Location]`
255
+ > **Agent prompt:** [the Qodo agent prompt used]
256
+ - Mark issue as completed
257
+ - After all auto-fixes are applied, display summary:
258
+ - List of all issues that were fixed
259
+ - List of any issues that were skipped (with reasons)
260
+
261
+ ### Step 8: Post summary to PR/MR
262
+
263
+ **REQUIRED:** After all issues have been reviewed (fixed or deferred), ALWAYS post a comment summarizing the actions taken, even if all issues were deferred.
264
+
265
+ See [providers.md § Post Summary Comment](./resources/providers.md#post-summary-comment) for provider-specific commands and summary format.
266
+
267
+ **After posting the summary, resolve the Qodo review comment:**
268
+
269
+ Find the Qodo "Code Review by Qodo" comment and mark it as resolved or react to acknowledge it.
270
+
271
+ See [providers.md § Resolve Qodo Review Comment](./resources/providers.md#resolve-qodo-review-comment) for provider-specific commands.
272
+
273
+ If resolve fails (comment not found, API error), continue — the summary comment is the important part.
274
+
275
+ ### Step 9: Push to remote
276
+
277
+ If any fixes were applied (commits were created in Steps 6/7), ask the user if they want to push:
278
+ - If yes: `git push`
279
+ - If no: Inform them they can push later with `git push`
280
+
281
+ **Important:** If all issues were deferred, there are no commits to push — skip this step.
282
+
283
+ ### Special cases
284
+
285
+ #### Unsupported git provider
286
+
287
+ If the remote URL doesn't match GitHub, GitLab, Bitbucket, or Azure DevOps, inform the user and exit.
288
+
289
+ See [providers.md § Error Handling](./resources/providers.md#error-handling) for details.
290
+
291
+ #### No PR/MR exists
292
+
293
+ - Inform: "No PR/MR found for branch `<branch-name>`"
294
+ - Ask: "Would you like me to create a PR/MR?"
295
+ - If yes: Use appropriate CLI to create PR/MR (see [providers.md § Create PR/MR](./resources/providers.md#create-prmr-special-case)), then inform "PR created! Qodo will review it shortly. Run this skill again in ~5 minutes."
296
+ - If no: Exit skill
297
+
298
+ **IMPORTANT:** Do NOT proceed without a PR/MR
299
+
300
+ #### No Qodo review yet
301
+
302
+ - Check if PR/MR has comments from Qodo bots (pr-agent-pro, qodo-merge[bot], etc.)
303
+ - If no Qodo comments found: Inform "Qodo hasn't reviewed this PR/MR yet. Please wait a few minutes for Qodo to analyze it."
304
+ - Exit skill (do NOT attempt manual review)
305
+
306
+ **IMPORTANT:** This skill only works with Qodo reviews, not manual reviews
307
+
308
+ #### Review in progress
309
+
310
+ If "Come back again in a few minutes" message is found, inform user to wait and try again, then exit.
311
+
312
+ #### Missing CLI tool
313
+
314
+ If the detected provider's CLI is not installed, provide installation instructions and exit.
315
+
316
+ See [providers.md § Error Handling](./resources/providers.md#error-handling) for provider-specific installation commands.
317
+
318
+ #### Inline reply commands
319
+
320
+ Used per-issue in Steps 6 and 7 to reply to Qodo's inline comments:
321
+
322
+ Use the inline comment ID preserved during deduplication (Step 3b) to reply directly to Qodo's comment.
323
+
324
+ See [providers.md § Reply to Inline Comments](./resources/providers.md#reply-to-inline-comments) for provider-specific commands and reply format.
325
+
326
+ Keep replies short (one line). If a reply fails, log it and continue.
@@ -0,0 +1,329 @@
1
+ # Git Provider Commands Reference
2
+
3
+ This document contains all provider-specific CLI commands and API interactions for the Qodo PR Resolver skill. Reference this file when implementing provider-specific operations.
4
+
5
+ ## Supported Providers
6
+
7
+ - GitHub (via `gh` CLI)
8
+ - GitLab (via `glab` CLI)
9
+ - Bitbucket (via `bb` CLI)
10
+ - Azure DevOps (via `az` CLI with DevOps extension)
11
+
12
+ ## Provider Detection
13
+
14
+ Detect the git provider from the remote URL:
15
+
16
+ ```bash
17
+ git remote get-url origin
18
+ ```
19
+
20
+ Match against:
21
+ - `github.com` → GitHub
22
+ - `gitlab.com` → GitLab
23
+ - `bitbucket.org` → Bitbucket
24
+ - `dev.azure.com` → Azure DevOps
25
+
26
+ ## Prerequisites by Provider
27
+
28
+ ### GitHub
29
+
30
+ **CLI:** `gh`
31
+ - **Install:** `brew install gh` or [cli.github.com](https://cli.github.com/)
32
+ - **Authenticate:** `gh auth login`
33
+ - **Verify:**
34
+ ```bash
35
+ gh --version && gh auth status
36
+ ```
37
+
38
+ ### GitLab
39
+
40
+ **CLI:** `glab`
41
+ - **Install:** `brew install glab` or [glab.readthedocs.io](https://glab.readthedocs.io/)
42
+ - **Authenticate:** `glab auth login`
43
+ - **Verify:**
44
+ ```bash
45
+ glab --version && glab auth status
46
+ ```
47
+
48
+ ### Bitbucket
49
+
50
+ **CLI:** `bb` or API access
51
+ - **Install:** See [bitbucket.org/product/cli](https://bitbucket.org/product/cli)
52
+ - **Verify:**
53
+ ```bash
54
+ bb --version
55
+ ```
56
+
57
+ ### Azure DevOps
58
+
59
+ **CLI:** `az` with DevOps extension
60
+ - **Install:** `brew install azure-cli` or [docs.microsoft.com/cli/azure](https://docs.microsoft.com/cli/azure)
61
+ - **Install extension:** `az extension add --name azure-devops`
62
+ - **Authenticate:** `az login` then `az devops configure --defaults organization=https://dev.azure.com/yourorg project=yourproject`
63
+ - **Verify:**
64
+ ```bash
65
+ az --version && az devops
66
+ ```
67
+
68
+ ## Find Open PR/MR
69
+
70
+ Get the PR/MR number for the current branch:
71
+
72
+ ### GitHub
73
+
74
+ ```bash
75
+ gh pr list --head <branch-name> --state open --json number,title
76
+ ```
77
+
78
+ ### GitLab
79
+
80
+ ```bash
81
+ glab mr list --source-branch <branch-name> --state opened
82
+ ```
83
+
84
+ ### Bitbucket
85
+
86
+ ```bash
87
+ bb pr list --source-branch <branch-name> --state OPEN
88
+ ```
89
+
90
+ ### Azure DevOps
91
+
92
+ ```bash
93
+ az repos pr list --source-branch <branch-name> --status active --output json
94
+ ```
95
+
96
+ ## Fetch Review Comments
97
+
98
+ Qodo posts both **summary comments** (PR-level) and **inline review comments** (per-line). Fetch both.
99
+
100
+ ### GitHub
101
+
102
+ ```bash
103
+ # PR-level comments (includes the summary comment with all issues)
104
+ gh pr view <pr-number> --json comments
105
+
106
+ # Inline review comments (per-line comments on specific code)
107
+ gh api repos/{owner}/{repo}/pulls/<pr-number>/comments
108
+ ```
109
+
110
+ ### GitLab
111
+
112
+ ```bash
113
+ # All MR notes including inline comments
114
+ glab mr view <mr-iid> --comments
115
+ ```
116
+
117
+ ### Bitbucket
118
+
119
+ ```bash
120
+ # All PR comments including inline comments
121
+ bb pr view <pr-id> --comments
122
+ ```
123
+
124
+ ### Azure DevOps
125
+
126
+ ```bash
127
+ # PR-level threads (includes summary comments)
128
+ az repos pr show --id <pr-id> --output json
129
+
130
+ # All PR threads including inline comments
131
+ az repos pr policy list --id <pr-id> --output json
132
+ az repos pr thread list --id <pr-id> --output json
133
+ ```
134
+
135
+ ## Reply to Inline Comments
136
+
137
+ Use the inline comment ID preserved during deduplication to reply directly to Qodo's comments.
138
+
139
+ ### GitHub
140
+
141
+ ```bash
142
+ gh api repos/{owner}/{repo}/pulls/<pr-number>/comments/<inline-comment-id>/replies \
143
+ -X POST \
144
+ -f body='<reply-body>'
145
+ ```
146
+
147
+ **Reply format:**
148
+ - **Fixed:** `✅ **Fixed** — <brief description of what was changed>`
149
+ - **Deferred:** `⏭️ **Deferred** — <reason for deferring>`
150
+
151
+ ### GitLab
152
+
153
+ ```bash
154
+ glab api "/projects/:id/merge_requests/<mr-iid>/discussions/<discussion-id>/notes" \
155
+ -X POST \
156
+ -f body='<reply-body>'
157
+ ```
158
+
159
+ ### Bitbucket
160
+
161
+ ```bash
162
+ bb api "/2.0/repositories/{workspace}/{repo}/pullrequests/<pr-id>/comments" \
163
+ -X POST \
164
+ -f 'content.raw=<reply-body>' \
165
+ -f 'parent.id=<inline-comment-id>'
166
+ ```
167
+
168
+ ### Azure DevOps
169
+
170
+ ```bash
171
+ az repos pr thread comment add \
172
+ --id <pr-id> \
173
+ --thread-id <thread-id> \
174
+ --content '<reply-body>'
175
+ ```
176
+
177
+ ## Post Summary Comment
178
+
179
+ After reviewing all issues, post a summary comment to the PR/MR.
180
+
181
+ ### GitHub
182
+
183
+ ```bash
184
+ gh pr comment <pr-number> --body '<comment-body>'
185
+ ```
186
+
187
+ ### GitLab
188
+
189
+ ```bash
190
+ glab mr comment <mr-iid> --message '<comment-body>'
191
+ ```
192
+
193
+ ### Bitbucket
194
+
195
+ ```bash
196
+ bb pr comment <pr-id> '<comment-body>'
197
+ ```
198
+
199
+ ### Azure DevOps
200
+
201
+ ```bash
202
+ az repos pr thread create \
203
+ --id <pr-id> \
204
+ --comment-content '<comment-body>'
205
+ ```
206
+
207
+ **Summary format:**
208
+
209
+ ```markdown
210
+ ## Qodo Fix Summary
211
+
212
+ Reviewed and addressed Qodo review issues:
213
+
214
+ ### ✅ Fixed Issues
215
+ - **Issue Title** (Severity) - Brief description of what was fixed
216
+
217
+ ### ⏭️ Deferred Issues
218
+ - **Issue Title** (Severity) - Reason for deferring
219
+
220
+ ---
221
+ *Generated by Qodo PR Resolver skill*
222
+ ```
223
+
224
+ ## Resolve Qodo Review Comment
225
+
226
+ After posting the summary, resolve the main Qodo review comment.
227
+
228
+ **Steps:**
229
+ 1. Fetch all PR/MR comments
230
+ 2. Find the Qodo bot comment containing "Code Review by Qodo"
231
+ 3. Resolve or react to the comment
232
+
233
+ ### GitHub
234
+
235
+ ```bash
236
+ # 1. Fetch comments to find the comment ID
237
+ gh pr view <pr-number> --json comments
238
+
239
+ # 2. React with thumbs up to acknowledge
240
+ gh api "repos/{owner}/{repo}/issues/comments/<comment-id>/reactions" \
241
+ -X POST \
242
+ -f content='+1'
243
+ ```
244
+
245
+ ### GitLab
246
+
247
+ ```bash
248
+ # 1. Fetch discussions to find the discussion ID
249
+ glab api "/projects/:id/merge_requests/<mr-iid>/discussions"
250
+
251
+ # 2. Resolve the discussion
252
+ glab api "/projects/:id/merge_requests/<mr-iid>/discussions/<discussion-id>" \
253
+ -X PUT \
254
+ -f resolved=true
255
+ ```
256
+
257
+ ### Bitbucket
258
+
259
+ ```bash
260
+ # Fetch comments via bb api, find the comment ID, then update to resolved status
261
+ bb api "/2.0/repositories/{workspace}/{repo}/pullrequests/<pr-id>/comments/<comment-id>" \
262
+ -X PUT \
263
+ -f 'resolved=true'
264
+ ```
265
+
266
+ ### Azure DevOps
267
+
268
+ ```bash
269
+ # Mark the thread as resolved
270
+ az repos pr thread update \
271
+ --id <pr-id> \
272
+ --thread-id <thread-id> \
273
+ --status resolved
274
+ ```
275
+
276
+ ## Create PR/MR (Special Case)
277
+
278
+ If no PR/MR exists for the current branch, offer to create one.
279
+
280
+ ### GitHub
281
+
282
+ ```bash
283
+ gh pr create --title '<title>' --body '<body>'
284
+ ```
285
+
286
+ ### GitLab
287
+
288
+ ```bash
289
+ glab mr create --title '<title>' --description '<body>'
290
+ ```
291
+
292
+ ### Bitbucket
293
+
294
+ ```bash
295
+ bb pr create --title '<title>' --description '<body>'
296
+ ```
297
+
298
+ ### Azure DevOps
299
+
300
+ ```bash
301
+ az repos pr create \
302
+ --title '<title>' \
303
+ --description '<body>' \
304
+ --source-branch <branch-name> \
305
+ --target-branch main
306
+ ```
307
+
308
+ ## Error Handling
309
+
310
+ ### Missing CLI Tool
311
+
312
+ If the detected provider's CLI is not installed:
313
+ 1. Inform the user: "❌ Missing required CLI tool: `<cli-name>`"
314
+ 2. Provide installation instructions from the Prerequisites section
315
+ 3. Exit the skill
316
+
317
+ ### Unsupported Provider
318
+
319
+ If the remote URL doesn't match any supported provider:
320
+ 1. Inform: "❌ Unsupported git provider detected: `<url>`"
321
+ 2. List supported providers: GitHub, GitLab, Bitbucket, Azure DevOps
322
+ 3. Exit the skill
323
+
324
+ ### API Failures
325
+
326
+ If inline reply or summary posting fails:
327
+ - Log the error
328
+ - Continue with remaining operations
329
+ - The workflow should not abort due to comment posting failures