Skip to content

Commit 9b18b4a

Browse files
YunchuWangclaude
andcommitted
fix: address Copilot review comments on self-reflection PR
- Use scan_labels input in gh pr list query (was declared but unused) - Add copilot CLI install step to workflow (prevents failure on fresh runner) - Change simulation template from ESM import to CommonJS require (matches repo's module system) - Replace ts-node recommendation with plain JS default and Node.js --experimental-strip-types for TS (no external tooling dependency) - Replace non-existent fetch_webpage tool reference with runTerminal + curl Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
1 parent 5187ecf commit 9b18b4a

3 files changed

Lines changed: 29 additions & 10 deletions

File tree

.github/skills/js-fact-checking/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Clearly state the specific behavioral claim you need to verify. Examples:
3535
Search the following authoritative sources **in priority order**:
3636

3737
1. **Node.js Official Docs**https://nodejs.org/api/
38-
- Use `fetch_webpage` tool to retrieve the relevant API page
38+
- Use `runTerminal` with `curl` to retrieve the relevant API page
3939
- Look for the specific section about the API in question
4040
- Pay attention to "Stability" markers and version-specific behavior
4141

.github/skills/simulation/SKILL.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ Write a **single TypeScript or JavaScript file** that:
6060

6161
### Script Template
6262

63-
```typescript
63+
```javascript
6464
// Simulation: <one-line description of what we're verifying>
6565
// Question: <the specific behavioral question>
6666
// Expected: <what we expect to happen if our assumption is correct>
6767

68-
import { EventEmitter } from "events";
68+
const { EventEmitter } = require("events");
6969

7070
function main() {
7171
console.log("=== SIMULATION START ===");
@@ -114,13 +114,10 @@ main();
114114
```bash
115115
cd /tmp/dt-simulation-<timestamp>
116116

117-
# For TypeScript files:
118-
npx ts-node --swc simulation.ts
119-
120-
# For plain JavaScript files:
117+
# Preferred: plain JavaScript (no external tooling needed)
121118
node simulation.js
122119

123-
# If ts-node is not available, use Node.js directly with ESM:
120+
# For TypeScript files (requires Node.js >= 22.6.0):
124121
node --experimental-strip-types simulation.ts
125122
```
126123

.github/workflows/self-reflection.yaml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ on:
1616
Leave empty to scan all merged PRs.
1717
required: false
1818
type: string
19+
install_copilot:
20+
description: >-
21+
Whether to install copilot CLI (set to false if pre-installed on runner).
22+
required: false
23+
type: boolean
24+
default: true
1925

2026
permissions:
2127
contents: write
@@ -61,13 +67,23 @@ jobs:
6167
6268
echo "Fetching merged PRs since ${SCAN_SINCE}..."
6369
70+
# Build label filter if provided
71+
LABEL_FILTER=""
72+
if [ -n "${{ inputs.scan_labels }}" ]; then
73+
IFS=',' read -ra LABELS <<< "${{ inputs.scan_labels }}"
74+
for label in "${LABELS[@]}"; do
75+
LABEL_FILTER="${LABEL_FILTER} --label \"$(echo "$label" | xargs)\""
76+
done
77+
fi
78+
6479
# Fetch merged PRs with reviews and comments
65-
MERGED_PRS=$(gh pr list \
80+
MERGED_PRS=$(eval gh pr list \
6681
--state merged \
6782
--limit 100 \
6883
--search "merged:>=${SCAN_SINCE}" \
84+
${LABEL_FILTER} \
6985
--json number,title,body,mergedAt,url,files,labels \
70-
--jq 'sort_by(.mergedAt) | reverse' \
86+
--jq "'sort_by(.mergedAt) | reverse'" \
7187
2>/dev/null || echo "[]")
7288
7389
PR_COUNT=$(echo "$MERGED_PRS" | jq 'length')
@@ -107,6 +123,12 @@ jobs:
107123
GH_TOKEN: ${{ github.token }}
108124
GH_REPO: ${{ github.repository }}
109125

126+
- name: 📦 Install Copilot CLI
127+
if: inputs.install_copilot != false
128+
run: |
129+
npm install -g @github/copilot
130+
copilot --version
131+
110132
- name: 🪞 Run Self-Reflection Agent
111133
run: |
112134
SCAN_SINCE="${{ steps.scan-window.outputs.scan_since }}"

0 commit comments

Comments
 (0)