opencode-onboard 0.4.2 → 0.4.4
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.
- package/LICENSE +21 -0
- package/README.md +304 -301
- package/content/.agents/agents/basic-engineer.md +4 -2
- package/content/.agents/agents/devops-manager.md +123 -123
- package/content/.agents/skills/ob-default/SKILL.md +25 -21
- package/content/.agents/skills/ob-generic-guardrails/SKILL.md +36 -32
- package/content/.agents/skills/ob-global/SKILL.md +92 -49
- package/content/.agents/skills/ob-pullrequest-az/SKILL.md +168 -160
- package/content/.agents/skills/ob-pullrequest-gh/SKILL.md +140 -136
- package/content/.opencode/commands/create-engineer.md +109 -0
- package/content/.opencode/commands/init.md +1 -1
- package/content/.opencode/commands/main.md +1 -1
- package/content/.opencode/commands/opsx-apply.md +131 -70
- package/content/.opencode/commands/plan.md +1 -1
- package/content/.opencode/plugins/session-log.js +523 -519
- package/content/.opencode/skills/openspec-apply-change/SKILL.md +86 -64
- package/content/AGENTS.md +67 -39
- package/package.json +1 -1
- package/src/commands/join.js +3 -3
- package/src/commands/single.js +2 -0
- package/src/commands/wizard.js +124 -99
- package/src/presets/browser.json +22 -18
- package/src/presets/optimization.json +27 -22
- package/src/presets/source.json +7 -1
- package/src/steps/browser/browser.test.js +115 -81
- package/src/steps/browser/index.js +62 -54
- package/src/steps/clean/index.js +108 -107
- package/src/steps/copy/agents.js +28 -0
- package/src/steps/copy/copy.test.js +1 -0
- package/src/steps/copy/index.js +2 -1
- package/src/steps/metadata/index.js +63 -61
- package/src/steps/models/format.js +61 -60
- package/src/steps/models/write.test.js +117 -117
- package/src/steps/openspec/ensemble.js +30 -7
- package/src/steps/openspec/ensemble.test.js +79 -79
- package/src/steps/openspec/index.js +121 -32
- package/src/steps/openspec/index.test.js +63 -0
- package/src/steps/optimization/caveman.js +34 -29
- package/src/steps/optimization/codegraph.js +52 -0
- package/src/steps/optimization/global.js +88 -64
- package/src/steps/optimization/global.test.js +99 -0
- package/src/steps/optimization/index.js +109 -101
- package/src/steps/optimization/optimization.test.js +101 -93
- package/src/steps/optimization/quota.js +84 -84
- package/src/steps/source/index.js +48 -0
- package/src/steps/source/source.test.js +124 -91
- package/src/utils/__tests__/copy.test.js +117 -117
- package/src/utils/exec-spinner.js +47 -47
- package/src/utils/exec.js +134 -131
- package/src/utils/terminal.js +6 -0
|
@@ -1,160 +1,168 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ob-pullrequest-az
|
|
3
|
-
description: Create Azure DevOps PRs with screenshots, or read and triage PR review feedback. Use when shipping a feature branch or when user says "I've added comments to the PR".
|
|
4
|
-
license: MIT
|
|
5
|
-
compatibility: Requires az CLI, az devops extension, openspec CLI, and opencode-browser for screenshots.
|
|
6
|
-
metadata:
|
|
7
|
-
author: copilots
|
|
8
|
-
version: "1.0"
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
**Browser MCP tools are FORBIDDEN for all Azure DevOps operations.**
|
|
12
|
-
Browser tools are ONLY permitted for screenshots of the LOCAL running app on `localhost` URLs.
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Mode A: Create PR (ship mode)
|
|
17
|
-
|
|
18
|
-
Triggered when devops-manager is in ship mode after implementation is complete.
|
|
19
|
-
|
|
20
|
-
### Step 1: Verify feature branch
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
git branch --show-current
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Branch must be `feature/{id}-{slug}`. NEVER push to `main`.
|
|
27
|
-
|
|
28
|
-
### Step 2: Capture screenshots (if UI changes exist)
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
browser_navigate url="http://localhost:{port}/{route}"
|
|
32
|
-
browser_wait ms=2000
|
|
33
|
-
browser_screenshot
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Save to: `openspec/changes/{change-name}/images/{feature}.png`
|
|
37
|
-
|
|
38
|
-
### Step 3: Commit and push
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
git add .
|
|
42
|
-
git commit -m "feat(#{id}): {description}"
|
|
43
|
-
git push origin feature/{id}-{slug}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Step 4: Create PR
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
az repos pr create \
|
|
50
|
-
--repository {repo} \
|
|
51
|
-
--source-branch feature/{id}-{slug} \
|
|
52
|
-
--target-branch main \
|
|
53
|
-
--title "feat(#{id}): {title}" \
|
|
54
|
-
--description "{description}"
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### Step 5: Link work item (MANDATORY, run sequentially, not in parallel)
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
az repos pr work-item add --id {pr-id} --work-items {workitem-id}
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### Step 6: Post screenshot comment
|
|
64
|
-
|
|
65
|
-
Build raw URL for each image:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
--
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
az
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
{
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
1
|
+
---
|
|
2
|
+
name: ob-pullrequest-az
|
|
3
|
+
description: Create Azure DevOps PRs with screenshots, or read and triage PR review feedback. Use when shipping a feature branch or when user says "I've added comments to the PR".
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires az CLI, az devops extension, openspec CLI, and opencode-browser for screenshots.
|
|
6
|
+
metadata:
|
|
7
|
+
author: copilots
|
|
8
|
+
version: "1.0"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
**Browser MCP tools are FORBIDDEN for all Azure DevOps operations.**
|
|
12
|
+
Browser tools are ONLY permitted for screenshots of the LOCAL running app on `localhost` URLs.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Mode A: Create PR (ship mode)
|
|
17
|
+
|
|
18
|
+
Triggered when devops-manager is in ship mode after implementation is complete.
|
|
19
|
+
|
|
20
|
+
### Step 1: Verify feature branch
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
git branch --show-current
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Branch must be `feature/{id}-{slug}`. NEVER push to `main`.
|
|
27
|
+
|
|
28
|
+
### Step 2: Capture screenshots (if UI changes exist)
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
browser_navigate url="http://localhost:{port}/{route}"
|
|
32
|
+
browser_wait ms=2000
|
|
33
|
+
browser_screenshot
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Save to: `openspec/changes/{change-name}/images/{feature}.png`
|
|
37
|
+
|
|
38
|
+
### Step 3: Commit and push
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
git add .
|
|
42
|
+
git commit -m "feat(#{id}): {description}"
|
|
43
|
+
git push origin feature/{id}-{slug}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Step 4: Create PR
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
az repos pr create \
|
|
50
|
+
--repository {repo} \
|
|
51
|
+
--source-branch feature/{id}-{slug} \
|
|
52
|
+
--target-branch main \
|
|
53
|
+
--title "feat(#{id}): {title}" \
|
|
54
|
+
--description "{description}"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Step 5: Link work item (MANDATORY, run sequentially, not in parallel)
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
az repos pr work-item add --id {pr-id} --work-items {workitem-id}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Step 6: Post screenshot comment
|
|
64
|
+
|
|
65
|
+
Build raw URL for each image:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
https://dev.azure.com/{org}/{project}/_apis/git/repositories/{repo}/items?path=openspec/changes/{change}/images/{file}.png&versionType=branch&version={branch}&api-version=7.1
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Post via:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
az devops invoke \
|
|
75
|
+
--area git --resource pullRequestThreads \
|
|
76
|
+
--route-parameters project={project} repositoryId={repo} pullRequestId={pr-id} \
|
|
77
|
+
--http-method POST --api-version 7.1 --in-file body.json
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`body.json`:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{
|
|
84
|
+
"comments": [
|
|
85
|
+
{
|
|
86
|
+
"parentCommentId": 0,
|
|
87
|
+
"content": "## Screenshots\n\n",
|
|
88
|
+
"commentType": 1
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"status": "active"
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Mode B: Read PR Feedback (feedback mode)
|
|
98
|
+
|
|
99
|
+
Triggered when user says "I've added comments to the PR" or "check PR feedback".
|
|
100
|
+
|
|
101
|
+
### Step 1: Find PRs
|
|
102
|
+
|
|
103
|
+
If PR link provided, extract ID from URL. Otherwise:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
az repos pr list --repository {repo} --status active --top 1
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Step 2: Read comment threads
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
az devops invoke \
|
|
113
|
+
--area git --resource pullRequestThreads \
|
|
114
|
+
--route-parameters project={project} repositoryId={repo} pullRequestId={id} \
|
|
115
|
+
--http-method GET --api-version 7.1
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Step 3: Categorize feedback
|
|
119
|
+
|
|
120
|
+
| Category | Description | Action |
|
|
121
|
+
| ------------- | ----------------------------------- | ----------------------------------- |
|
|
122
|
+
| `code-change` | Reviewer requests code modification | Return to lead to spawn specialists |
|
|
123
|
+
| `spec-update` | Affects proposal, design, or tasks | Update openspec artifacts |
|
|
124
|
+
| `question` | Reviewer asks a question | Reply with answer |
|
|
125
|
+
| `resolved` | Thread already resolved | Skip |
|
|
126
|
+
|
|
127
|
+
### Step 4: Update openspec (if spec-update)
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
git branch --show-current
|
|
131
|
+
# feature/193208-roles-crud → change: us-193208-roles-crud
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Update: `openspec/changes/{change}/proposal.md`, `design.md`, or `tasks.md` as appropriate.
|
|
135
|
+
|
|
136
|
+
### Step 5: Reply to each thread
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
az devops invoke \
|
|
140
|
+
--area git --resource pullRequestThreadComments \
|
|
141
|
+
--route-parameters project={project} repositoryId={repo} pullRequestId={id} threadId={tid} \
|
|
142
|
+
--http-method POST --api-version 7.1 --in-file reply.json
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
`reply.json`:
|
|
146
|
+
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"comments": [
|
|
150
|
+
{
|
|
151
|
+
"parentCommentId": 1,
|
|
152
|
+
"content": "Acknowledged, applying this change now.",
|
|
153
|
+
"commentType": 1
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Guardrails
|
|
161
|
+
|
|
162
|
+
- ✅ Commit and push to feature branches only
|
|
163
|
+
- ✅ Create and comment on PRs via az CLI
|
|
164
|
+
- ✅ Screenshots of localhost only via browser_screenshot
|
|
165
|
+
- ❌ Commit or push to `main`, FORBIDDEN
|
|
166
|
+
- ❌ Force push, FORBIDDEN
|
|
167
|
+
- ❌ Merge or approve PRs, human-only
|
|
168
|
+
- ❌ Navigate browser to dev.azure.com, FORBIDDEN
|
|
@@ -1,136 +1,140 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ob-pullrequest-gh
|
|
3
|
-
description: Create GitHub PRs with screenshots, or read and triage PR review feedback. Use when shipping a feature branch or when user says "I've added comments to the PR".
|
|
4
|
-
license: MIT
|
|
5
|
-
compatibility: Requires gh CLI, openspec CLI, and opencode-browser for screenshots.
|
|
6
|
-
metadata:
|
|
7
|
-
author: copilots
|
|
8
|
-
version: "1.0"
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
**ALL GitHub data MUST come from `gh` CLI. NEVER use webfetch, HTTP requests, or browser MCP tools for GitHub operations, even if gh CLI fails. If `gh` is unavailable, report as a blocker.**
|
|
12
|
-
Always pass `--repo {owner}/{repo}` explicitly, never rely on git context to resolve the repo.
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Mode A: Create PR (ship mode)
|
|
17
|
-
|
|
18
|
-
Triggered when devops-manager is in ship mode after implementation is complete.
|
|
19
|
-
|
|
20
|
-
### Step 1: Verify feature branch
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
git branch --show-current
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Branch must be `feature/{id}-{slug}`. NEVER push to `main`.
|
|
27
|
-
|
|
28
|
-
### Step 2: Capture screenshots (if UI changes exist)
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
browser_navigate url="http://localhost:{port}/{route}"
|
|
32
|
-
browser_wait ms=2000
|
|
33
|
-
browser_screenshot
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Save to: `openspec/changes/{change-name}/images/{feature}.png`
|
|
37
|
-
|
|
38
|
-
### Step 3: Commit and push
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
git add .
|
|
42
|
-
git commit -m "feat(#{id}): {description}"
|
|
43
|
-
git push origin feature/{slug}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Step 4: Create PR
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
gh pr create \
|
|
50
|
-
--base main \
|
|
51
|
-
--head feature/{slug} \
|
|
52
|
-
--title "feat: {title}" \
|
|
53
|
-
--body "{description}"
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### Step 5: Post screenshot comment
|
|
57
|
-
|
|
58
|
-
Resolve commit SHA (the commit that includes screenshots):
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
|
102
|
-
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
- ❌
|
|
1
|
+
---
|
|
2
|
+
name: ob-pullrequest-gh
|
|
3
|
+
description: Create GitHub PRs with screenshots, or read and triage PR review feedback. Use when shipping a feature branch or when user says "I've added comments to the PR".
|
|
4
|
+
license: MIT
|
|
5
|
+
compatibility: Requires gh CLI, openspec CLI, and opencode-browser for screenshots.
|
|
6
|
+
metadata:
|
|
7
|
+
author: copilots
|
|
8
|
+
version: "1.0"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
**ALL GitHub data MUST come from `gh` CLI. NEVER use webfetch, HTTP requests, or browser MCP tools for GitHub operations, even if gh CLI fails. If `gh` is unavailable, report as a blocker.**
|
|
12
|
+
Always pass `--repo {owner}/{repo}` explicitly, never rely on git context to resolve the repo.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Mode A: Create PR (ship mode)
|
|
17
|
+
|
|
18
|
+
Triggered when devops-manager is in ship mode after implementation is complete.
|
|
19
|
+
|
|
20
|
+
### Step 1: Verify feature branch
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
git branch --show-current
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Branch must be `feature/{id}-{slug}`. NEVER push to `main`.
|
|
27
|
+
|
|
28
|
+
### Step 2: Capture screenshots (if UI changes exist)
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
browser_navigate url="http://localhost:{port}/{route}"
|
|
32
|
+
browser_wait ms=2000
|
|
33
|
+
browser_screenshot
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Save to: `openspec/changes/{change-name}/images/{feature}.png`
|
|
37
|
+
|
|
38
|
+
### Step 3: Commit and push
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
git add .
|
|
42
|
+
git commit -m "feat(#{id}): {description}"
|
|
43
|
+
git push origin feature/{id}-{slug}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Step 4: Create PR
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
gh pr create \
|
|
50
|
+
--base main \
|
|
51
|
+
--head feature/{id}-{slug} \
|
|
52
|
+
--title "feat(#{id}): {title}" \
|
|
53
|
+
--body "{description}"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Step 5: Post screenshot comment
|
|
57
|
+
|
|
58
|
+
Resolve commit SHA (the commit that includes screenshots):
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
git rev-parse HEAD
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Build blob URL for each image (preferred, stable in PR discussion):
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
https://github.com/{owner}/{repo}/blob/{sha}/openspec/changes/{change}/images/{file}.png
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Post comment:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
gh pr comment {pr-number} --repo {owner}/{repo} --body $'## Screenshots\n\n'
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Mode B: Read PR Feedback (feedback mode)
|
|
79
|
+
|
|
80
|
+
Triggered when user says "I've added comments to the PR" or "check PR feedback".
|
|
81
|
+
|
|
82
|
+
### Step 1: Find PRs
|
|
83
|
+
|
|
84
|
+
If PR link provided, extract number from URL. Otherwise:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
gh pr list --repo {owner}/{repo} --state open --limit 1
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Step 2: Read comment threads
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
gh pr view {pr-number} --repo {owner}/{repo} --comments
|
|
94
|
+
# Or structured output:
|
|
95
|
+
gh api repos/{owner}/{repo}/pulls/{pr-number}/comments
|
|
96
|
+
gh api repos/{owner}/{repo}/pulls/{pr-number}/reviews
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Step 3: Categorize feedback
|
|
100
|
+
|
|
101
|
+
| Category | Description | Action |
|
|
102
|
+
| ------------- | ----------------------------------- | ----------------------------------- |
|
|
103
|
+
| `code-change` | Reviewer requests code modification | Return to lead to spawn specialists |
|
|
104
|
+
| `spec-update` | Affects proposal, design, or tasks | Update openspec artifacts |
|
|
105
|
+
| `question` | Reviewer asks a question | Reply with answer |
|
|
106
|
+
| `resolved` | Thread already resolved | Skip |
|
|
107
|
+
|
|
108
|
+
### Step 4: Update openspec (if spec-update)
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
git branch --show-current
|
|
112
|
+
# feature/add-user-auth → change: add-user-auth
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Update: `openspec/changes/{change}/proposal.md`, `design.md`, or `tasks.md` as appropriate.
|
|
116
|
+
|
|
117
|
+
### Step 5: Reply to each comment thread
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Reply to a review comment
|
|
121
|
+
gh api repos/{owner}/{repo}/pulls/{pr-number}/comments/{comment-id}/replies \
|
|
122
|
+
--method POST \
|
|
123
|
+
--field body="Acknowledged, applying this change now."
|
|
124
|
+
|
|
125
|
+
# Or post a general PR comment
|
|
126
|
+
gh pr comment {pr-number} --body "Updated design.md to reflect feedback."
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Guardrails
|
|
132
|
+
|
|
133
|
+
- ✅ Commit and push to feature branches only
|
|
134
|
+
- ✅ Create and comment on PRs via gh CLI with explicit `--repo {owner}/{repo}`
|
|
135
|
+
- ✅ Screenshots of localhost only via browser_screenshot
|
|
136
|
+
- ❌ Commit or push to `main`, FORBIDDEN
|
|
137
|
+
- ❌ Force push, FORBIDDEN
|
|
138
|
+
- ❌ Merge or approve PRs, human-only
|
|
139
|
+
- ❌ Navigate browser to github.com, FORBIDDEN
|
|
140
|
+
- ❌ webfetch or HTTP requests to GitHub URLs, FORBIDDEN
|