You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: use opus 4.6 and restructure review skill (#53)
## Summary
- Switch to `claude-opus-4-6` for better prompt compliance (was
defaulting to Sonnet)
- Increase max-turns from 15 to 100
- Restructure the review skill to be more resilient to structural
shortcuts
## What changed in the skill
- **Step checklist at the top** with explicit deliverables per step —
agent knows upfront what's expected
- **Docs staleness promoted to Agent 4** — runs in parallel with code
review agents instead of being a post-processing sub-item that gets
skipped
- **Required summary template** with a mandatory Documentation section —
forces the agent to report on docs staleness
- **File classification table** updated to include `docs/connector.mdx`
→ docs-reviewer
## Why
The previous run on
[baton-twingate#16](ConductorOne/baton-twingate#16)
had the docs staleness skill on disk but didn't flag the missing docs
update (PR adds provisioning for roles without updating the Capabilities
table). Root causes:
1. Sonnet was taking shortcuts and skipping the multi-step orchestration
2. The docs check was buried as item 6 in a validation step — easy to
skip
@@ -5,22 +5,28 @@ description: Review a baton connector PR in CI. Performs a structured, read-only
5
5
6
6
# Review Baton Connector PR (CI)
7
7
8
-
Perform a structured code review of a baton connector PR. Uses at most 3 focused agents with embedded criteria to minimize token usage.
8
+
Perform a structured code review of a baton connector PR.
9
9
10
10
This skill runs in CI — do NOT write files, create commits, or run build/test commands.
11
11
12
-
## Step 1: Determine Context
12
+
**You MUST complete ALL of the following steps in order. Do NOT skip any step. Each step has a deliverable — produce it before moving on.**
13
13
14
-
1.**Changed files:** Identify files changed in this PR from the diff context provided. Exclude `vendor/`, `conf.gen.go`, non-`.go` files (keep `go.mod`/`go.sum` and `docs/connector.mdx`). Stop if empty (no Go files and no docs changes).
15
-
2.**PR context:** Use the PR title, description, comments, and review comments provided in the conversation context.
14
+
| Step | Deliverable |
15
+
|------|-------------|
16
+
| 1. Determine Context | List of changed files by category |
| 3. Validate and Aggregate | Merged findings list |
19
+
| 4. Post Results | Summary comment with ALL required sections |
16
20
17
-
## Step 2: Gather Diffs
21
+
---
18
22
19
-
For each category of files, read the relevant diffs from the PR context provided. If you need full file content to evaluate a finding, use the Read tool.
23
+
## Step 1: Determine Context
20
24
21
-
## Step 3: Spawn Review Agents
25
+
1.**Changed files:** Identify files changed in this PR from the diff context provided. Exclude `vendor/`, `conf.gen.go`, non-`.go` files (keep `go.mod`/`go.sum` and `docs/connector.mdx`). Stop if empty (no Go files and no docs changes).
26
+
2.**PR context:** Use the PR title, description, comments, and review comments provided in the conversation context.
27
+
3.**Classify files** into categories per the table below.
22
28
23
-
Classify changed files and spawn **at most 3 agents** in parallel using the Task tool.
29
+
**Deliverable:** Print the list of changed files grouped by category before proceeding.
24
30
25
31
### File Classification
26
32
@@ -33,10 +39,27 @@ Classify changed files and spawn **at most 3 agents** in parallel using the Task
For each category of files, read the relevant diffs from the PR context provided. If you need full file content to evaluate a finding, use the Read tool.
49
+
50
+
Spawn agents in parallel using the Task tool: up to 3 code review agents (Agents 1-3) plus the docs-reviewer (Agent 4) which always runs.
51
+
52
+
### Agent Spawning Rules
53
+
54
+
- If no provisioning files changed → skip provisioning-reviewer
55
+
- If no config/dep files changed → skip lightweight-reviewer
56
+
- If only config/dep files changed → skip sync-reviewer, only spawn lightweight-reviewer
57
+
-**Always spawn docs-reviewer** (Agent 4) — it runs on every PR
58
+
- Always spawn at least one code review agent
36
59
37
-
### Agent 1: sync-reviewer (sonnet)
60
+
### Agent 1: sync-reviewer
38
61
39
-
Spawn with `subagent_type: "general-purpose"`. Reviews ALL non-provisioning Go files including breaking change detection. This is the main review agent.
62
+
Spawn with `subagent_type: "general-purpose"`. Reviews ALL non-provisioning Go files including breaking change detection.
40
63
41
64
**Prompt template:**
42
65
@@ -110,7 +133,7 @@ FILES AND DIFFS:
110
133
<paste diffs here, grouped by file>
111
134
```
112
135
113
-
### Agent 2: provisioning-reviewer (sonnet)
136
+
### Agent 2: provisioning-reviewer
114
137
115
138
Only spawn if changed files contain `*_actions.go` or `actions.go` files. This agent MUST read the full provisioning files (not just diffs) because entity source correctness requires understanding the complete Grant/Revoke flow.
116
139
@@ -147,7 +170,7 @@ FILES TO READ: <list full paths>
147
170
DIFFS: <paste diffs>
148
171
```
149
172
150
-
### Agent 3: lightweight-reviewer (haiku)
173
+
### Agent 3: lightweight-reviewer
151
174
152
175
Only spawn if changed files contain config or dependency files. Use `model: "haiku"` for efficiency.
153
176
@@ -173,40 +196,88 @@ DIFFS:
173
196
<paste diffs>
174
197
```
175
198
176
-
### Agent Spawning Rules
199
+
### Agent 4: docs-reviewer
200
+
201
+
**Always spawn this agent.** It checks whether the PR's code changes require updates to `docs/connector.mdx`. Spawn with `subagent_type: "general-purpose"`.
202
+
203
+
**Prompt template:**
204
+
205
+
```
206
+
You are checking whether a baton connector PR requires documentation updates.
207
+
208
+
The file docs/connector.mdx documents the connector's capabilities, configuration, and credentials for end users. Your job is to determine if the code changes in this PR make the docs stale.
177
209
178
-
- If no provisioning files changed → skip Agent 2
179
-
- If no config/dep files changed → skip Agent 3
180
-
- If only config/dep files changed → skip Agent 1, only spawn Agent 3
181
-
- Always spawn at least one agent
210
+
Procedure:
182
211
183
-
## Step 4: Validate and Aggregate
212
+
1. Check if docs/connector.mdx exists in the repo (use the Glob tool).
213
+
2. If it does not exist, return: {"status": "no_docs"}
214
+
3. If it exists, check whether it is included in the PR's changed files list below.
215
+
4. If it is in the changed files, return: {"status": "docs_updated"}
216
+
5. If it exists but is NOT in the changed files, check the code diffs below for:
184
217
185
-
1. Parse JSON arrays from each agent. Filter confidence < 80.
218
+
- D1: Capabilities table — Resource types added, removed, or changed sync/provision support (new resource builders, removed ResourceSyncers entries, added Grant/Revoke methods).
219
+
- D2: Connector actions — Action schemas added, removed, or modified (new BatonActionSchema definitions, changed action names, added/removed arguments).
220
+
- D3: Credential requirements — Required API scopes or permissions changed (new OAuth scopes, different permission levels, new authentication methods).
221
+
- D4: Configuration fields — Config fields added, removed, or renamed in pkg/config/config.go.
222
+
223
+
If any of D1-D4 apply, read docs/connector.mdx to confirm the specific section that would need updating.
224
+
225
+
Return a JSON object:
226
+
{"status": "stale", "findings": [{"id": "D1", "section": "<section name in docs>", "reason": "<why it's stale>"}]}
227
+
228
+
Or if none apply:
229
+
{"status": "up_to_date"}
230
+
231
+
CHANGED FILES:
232
+
<list of changed file paths>
233
+
234
+
DIFFS:
235
+
<paste diffs>
236
+
```
237
+
238
+
**Deliverable:** All agent tasks launched. Wait for them to complete before proceeding.
6.**Check for documentation staleness** (see below).
191
-
192
-
### Documentation Staleness Check (D1-D4)
193
-
194
-
Connector repos have a `docs/connector.mdx` file that documents the connector's capabilities, configuration, and credentials for end users. If `docs/connector.mdx` exists in the repo but is NOT included in the PR's changed files, check whether the code changes affect documented functionality:
249
+
6. Parse the docs-reviewer (Agent 4) result. If status is "stale", convert each finding to a warning.
195
250
196
-
-**D1: Capabilities table** — If resource types are added, removed, or change sync/provision support (new resource builders, removed ResourceSyncers entries, added Grant/Revoke methods), the Capabilities table in the docs likely needs updating.
197
-
-**D2: Connector actions** — If action schemas are added, removed, or modified in `*_actions.go` or `actions.go` (new `BatonActionSchema` definitions, changed action names, added/removed arguments), the Connector Actions table in the docs likely needs updating.
198
-
-**D3: Credential requirements** — If required API scopes or permissions change (new OAuth scopes, different permission levels, new authentication methods), the credential gathering section in the docs likely needs updating.
199
-
-**D4: Configuration fields** — If config fields are added, removed, or renamed in `pkg/config/config.go`, the configuration instructions in the docs likely need updating.
251
+
**Deliverable:** A merged list of findings (code + docs) with duplicates removed. Print the count of findings by severity.
200
252
201
-
If any of D1-D4 apply, add a warning finding recommending the author update `docs/connector.mdx`. Read the current docs file to confirm the specific section that's stale rather than guessing.
253
+
---
202
254
203
-
## Step 5: Post Results
255
+
## Step 4: Post Results
204
256
205
257
Post findings directly as PR comments:
206
258
207
259
1.**Inline comments** on specific lines where issues are found, with the finding ID, severity, description, and recommendation.
0 commit comments