@research-copilot/plugin 1.1.15
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 +82 -0
- package/dist/.claude-plugin/plugin.json +11 -0
- package/dist/.codex-plugin/plugin.toml +9 -0
- package/dist/.cursor-plugin/plugin.json +9 -0
- package/dist/.gemini-plugin/plugin.json +11 -0
- package/dist/.opencode-plugin/plugin.json +11 -0
- package/dist/.windsurf-plugin/plugin.json +11 -0
- package/dist/README.md +57 -0
- package/dist/agents/rc-experiment.md +203 -0
- package/dist/agents/rc-ideation.md +224 -0
- package/dist/agents/rc-literature.md +228 -0
- package/dist/agents/rc-plan.md +189 -0
- package/dist/agents/rc-polisher.md +166 -0
- package/dist/agents/rc-rebuttal.md +194 -0
- package/dist/agents/rc-reviewer.md +187 -0
- package/dist/agents/rc-update-spec.md +231 -0
- package/dist/agents/rc-verify.md +234 -0
- package/dist/agents/rc-writer.md +161 -0
- package/dist/skills/experiment-design/SKILL.md +331 -0
- package/dist/skills/full-research-workflow/SKILL.md +363 -0
- package/dist/skills/literature-search/SKILL.md +244 -0
- package/dist/skills/paper-polish/SKILL.md +320 -0
- package/dist/skills/sanity-check/SKILL.md +449 -0
- package/dist/skills/submission-sprint/SKILL.md +361 -0
- package/package.json +35 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: literature-search
|
|
3
|
+
description: Focused literature search skill. Searches papers, locks baselines, builds related-work map. Use for standalone literature tasks.
|
|
4
|
+
triggers:
|
|
5
|
+
- "search papers"
|
|
6
|
+
- "find baselines"
|
|
7
|
+
- "literature review"
|
|
8
|
+
- "related work"
|
|
9
|
+
- "find research on"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Literature Search
|
|
13
|
+
|
|
14
|
+
Orchestrate focused literature search: create task → dispatch @rc-literature → verify results.
|
|
15
|
+
|
|
16
|
+
## When to Use
|
|
17
|
+
|
|
18
|
+
Use this skill when:
|
|
19
|
+
- User asks to "search papers for X"
|
|
20
|
+
- User wants to "find baselines for Y"
|
|
21
|
+
- User needs a "literature review on Z"
|
|
22
|
+
- Standalone literature search (NOT part of full pipeline)
|
|
23
|
+
|
|
24
|
+
Do NOT use when:
|
|
25
|
+
- Part of full-research-workflow (that handles literature internally)
|
|
26
|
+
- User only wants a quick web search (use web-search skill)
|
|
27
|
+
|
|
28
|
+
## Task-First Protocol
|
|
29
|
+
|
|
30
|
+
Before starting, check if task exists:
|
|
31
|
+
|
|
32
|
+
```powershell
|
|
33
|
+
# Check for existing literature task
|
|
34
|
+
$taskFile = "C:\PythonProject\research_copilot\.rc\tasks\literature-search.json"
|
|
35
|
+
if (Test-Path $taskFile) {
|
|
36
|
+
$task = Get-Content $taskFile | ConvertFrom-Json
|
|
37
|
+
Write-Host "Found existing task: $($task.query)"
|
|
38
|
+
} else {
|
|
39
|
+
Write-Host "No existing task. Will create one."
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Create task if needed:
|
|
44
|
+
|
|
45
|
+
```powershell
|
|
46
|
+
# Create literature search task
|
|
47
|
+
rc task create --type literature --query "user query here" --output .rc/tasks/literature-search.json
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Auto-Context Loading
|
|
51
|
+
|
|
52
|
+
Read task context before orchestration:
|
|
53
|
+
|
|
54
|
+
```powershell
|
|
55
|
+
# Load task context
|
|
56
|
+
$taskFile = "C:\PythonProject\research_copilot\.rc\tasks\literature-search.json"
|
|
57
|
+
if (Test-Path $taskFile) {
|
|
58
|
+
$task = Get-Content $taskFile | ConvertFrom-Json
|
|
59
|
+
|
|
60
|
+
Write-Host "Task Query: $($task.query)"
|
|
61
|
+
Write-Host "Target Baselines: $($task.target_baselines)"
|
|
62
|
+
Write-Host "Categories Required: $($task.categories_required)"
|
|
63
|
+
|
|
64
|
+
# Load PRD if referenced
|
|
65
|
+
if ($task.prd_file -and (Test-Path $task.prd_file)) {
|
|
66
|
+
$prd = Get-Content $task.prd_file -Raw
|
|
67
|
+
Write-Host "PRD loaded: $($task.prd_file)"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Orchestration Logic
|
|
73
|
+
|
|
74
|
+
Execute literature search via agent dispatch:
|
|
75
|
+
|
|
76
|
+
```powershell
|
|
77
|
+
# Start task
|
|
78
|
+
rc task start literature-search
|
|
79
|
+
|
|
80
|
+
# Dispatch to literature agent
|
|
81
|
+
Write-Host "Dispatching to @rc-literature agent..."
|
|
82
|
+
|
|
83
|
+
# Agent will:
|
|
84
|
+
# 1. Parse query and extract search terms
|
|
85
|
+
# 2. Search multiple sources (arXiv, Semantic Scholar, Google Scholar)
|
|
86
|
+
# 3. Extract baselines and build comparison table
|
|
87
|
+
# 4. Categorize papers (method, survey, application)
|
|
88
|
+
# 5. Generate related-work map
|
|
89
|
+
# 6. Save results to .rc/literature/
|
|
90
|
+
|
|
91
|
+
# Wait for completion (agent runs autonomously)
|
|
92
|
+
# Check status
|
|
93
|
+
$status = rc task status literature-search
|
|
94
|
+
Write-Host "Task status: $status"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Verify results:
|
|
98
|
+
|
|
99
|
+
```powershell
|
|
100
|
+
# Verify literature search outputs
|
|
101
|
+
$litDir = "C:\PythonProject\research_copilot\.rc\literature"
|
|
102
|
+
|
|
103
|
+
# Check baselines file
|
|
104
|
+
$baselinesFile = Join-Path $litDir "baselines.json"
|
|
105
|
+
if (Test-Path $baselinesFile) {
|
|
106
|
+
$baselines = Get-Content $baselinesFile | ConvertFrom-Json
|
|
107
|
+
Write-Host "Found $($baselines.Count) baselines"
|
|
108
|
+
} else {
|
|
109
|
+
Write-Host "WARNING: No baselines file found"
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
# Check papers file
|
|
113
|
+
$papersFile = Join-Path $litDir "papers.json"
|
|
114
|
+
if (Test-Path $papersFile) {
|
|
115
|
+
$papers = Get-Content $papersFile | ConvertFrom-Json
|
|
116
|
+
Write-Host "Found $($papers.Count) papers"
|
|
117
|
+
} else {
|
|
118
|
+
Write-Host "WARNING: No papers file found"
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
# Check related-work map
|
|
122
|
+
$relatedWorkFile = Join-Path $litDir "related-work.md"
|
|
123
|
+
if (Test-Path $relatedWorkFile) {
|
|
124
|
+
Write-Host "Related-work map generated"
|
|
125
|
+
} else {
|
|
126
|
+
Write-Host "WARNING: No related-work map found"
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Complete task:
|
|
131
|
+
|
|
132
|
+
```powershell
|
|
133
|
+
# Mark task complete if quality gates passed
|
|
134
|
+
rc task complete literature-search
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Quality Gates
|
|
138
|
+
|
|
139
|
+
Verify before marking complete:
|
|
140
|
+
|
|
141
|
+
```powershell
|
|
142
|
+
# Quality gate checks
|
|
143
|
+
$passed = $true
|
|
144
|
+
|
|
145
|
+
# Gate 1: Minimum baselines
|
|
146
|
+
$baselinesFile = "C:\PythonProject\research_copilot\.rc\literature\baselines.json"
|
|
147
|
+
if (Test-Path $baselinesFile) {
|
|
148
|
+
$baselines = Get-Content $baselinesFile | ConvertFrom-Json
|
|
149
|
+
if ($baselines.Count -lt 3) {
|
|
150
|
+
Write-Host "FAIL: Need ≥3 baselines, found $($baselines.Count)"
|
|
151
|
+
$passed = $false
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
Write-Host "FAIL: No baselines file"
|
|
155
|
+
$passed = $false
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
# Gate 2: Category coverage
|
|
159
|
+
$papersFile = "C:\PythonProject\research_copilot\.rc\literature\papers.json"
|
|
160
|
+
if (Test-Path $papersFile) {
|
|
161
|
+
$papers = Get-Content $papersFile | ConvertFrom-Json
|
|
162
|
+
$categories = $papers | Select-Object -ExpandProperty category -Unique
|
|
163
|
+
if ($categories.Count -lt 2) {
|
|
164
|
+
Write-Host "FAIL: Need ≥2 categories, found $($categories.Count)"
|
|
165
|
+
$passed = $false
|
|
166
|
+
}
|
|
167
|
+
} else {
|
|
168
|
+
Write-Host "FAIL: No papers file"
|
|
169
|
+
$passed = $false
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
# Gate 3: PRD claim support
|
|
173
|
+
$prdFile = "C:\PythonProject\research_copilot\.rc\prd.md"
|
|
174
|
+
if (Test-Path $prdFile) {
|
|
175
|
+
$prd = Get-Content $prdFile -Raw
|
|
176
|
+
$claims = [regex]::Matches($prd, '\[CLAIM:([^\]]+)\]')
|
|
177
|
+
$supportedClaims = 0
|
|
178
|
+
|
|
179
|
+
foreach ($claim in $claims) {
|
|
180
|
+
$claimId = $claim.Groups[1].Value
|
|
181
|
+
$citationPattern = "\[$claimId\]"
|
|
182
|
+
if ($prd -match $citationPattern) {
|
|
183
|
+
$supportedClaims++
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if ($supportedClaims -lt $claims.Count) {
|
|
188
|
+
Write-Host "FAIL: Only $supportedClaims/$($claims.Count) claims supported"
|
|
189
|
+
$passed = $false
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if ($passed) {
|
|
194
|
+
Write-Host "All quality gates passed"
|
|
195
|
+
} else {
|
|
196
|
+
Write-Host "Quality gates failed - review needed"
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Report Format
|
|
201
|
+
|
|
202
|
+
Generate final report:
|
|
203
|
+
|
|
204
|
+
```markdown
|
|
205
|
+
# Literature Search Report
|
|
206
|
+
|
|
207
|
+
**Query**: {user_query}
|
|
208
|
+
**Date**: {date}
|
|
209
|
+
**Baselines Found**: {baseline_count}
|
|
210
|
+
**Papers Reviewed**: {paper_count}
|
|
211
|
+
|
|
212
|
+
## Baselines
|
|
213
|
+
|
|
214
|
+
| Method | Year | Metric | Score | Paper |
|
|
215
|
+
|--------|------|--------|-------|-------|
|
|
216
|
+
| {name} | {year} | {metric} | {score} | [{title}]({url}) |
|
|
217
|
+
|
|
218
|
+
## Paper Categories
|
|
219
|
+
|
|
220
|
+
- **Methods**: {count} papers
|
|
221
|
+
- **Surveys**: {count} papers
|
|
222
|
+
- **Applications**: {count} papers
|
|
223
|
+
|
|
224
|
+
## Related Work Map
|
|
225
|
+
|
|
226
|
+
{content from related-work.md}
|
|
227
|
+
|
|
228
|
+
## Key Findings
|
|
229
|
+
|
|
230
|
+
- Finding 1
|
|
231
|
+
- Finding 2
|
|
232
|
+
- Finding 3
|
|
233
|
+
|
|
234
|
+
## Next Steps
|
|
235
|
+
|
|
236
|
+
- [ ] Review baselines for integration
|
|
237
|
+
- [ ] Extract method details from top papers
|
|
238
|
+
- [ ] Update PRD with new citations
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Example Usage
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
User: "Search papers on graph neural networks for recommendation"
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: paper-polish
|
|
3
|
+
description: Polishes paper text and removes AI patterns. Use after writing stage to refine language and ensure venue compliance.
|
|
4
|
+
triggers:
|
|
5
|
+
- "polish paper"
|
|
6
|
+
- "de-AI"
|
|
7
|
+
- "remove AI flavor"
|
|
8
|
+
- "refine writing"
|
|
9
|
+
- "clean up text"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Paper Polish
|
|
13
|
+
|
|
14
|
+
Orchestrate paper polishing: create task → dispatch @rc-polisher → verify changes → complete.
|
|
15
|
+
|
|
16
|
+
Removes AI-generated patterns, ensures venue style compliance, validates that only wording changed (no data/formulas modified).
|
|
17
|
+
|
|
18
|
+
## When to Use
|
|
19
|
+
|
|
20
|
+
Use this skill when:
|
|
21
|
+
- User asks to "polish the paper"
|
|
22
|
+
- User wants to "remove AI patterns" or "de-AI the text"
|
|
23
|
+
- After drafting is complete and paper needs language refinement
|
|
24
|
+
- Before final submission to ensure professional writing style
|
|
25
|
+
|
|
26
|
+
Do NOT use when:
|
|
27
|
+
- Paper is still being drafted (use writing skills)
|
|
28
|
+
- User wants content changes (use revision skills)
|
|
29
|
+
- Only formatting/LaTeX fixes needed (handle directly)
|
|
30
|
+
|
|
31
|
+
## Task-First Protocol
|
|
32
|
+
|
|
33
|
+
Before starting, check if polish task exists:
|
|
34
|
+
|
|
35
|
+
```powershell
|
|
36
|
+
# Check for existing polish task
|
|
37
|
+
$taskFile = "C:\PythonProject\research_copilot\.rc\tasks\paper-polish.json"
|
|
38
|
+
if (Test-Path $taskFile) {
|
|
39
|
+
$task = Get-Content $taskFile | ConvertFrom-Json
|
|
40
|
+
Write-Host "Found existing polish task: $($task.paper_file)"
|
|
41
|
+
} else {
|
|
42
|
+
Write-Host "No existing task. Will create one."
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Create task if needed:
|
|
47
|
+
|
|
48
|
+
```powershell
|
|
49
|
+
# Create paper polish task
|
|
50
|
+
$paperFile = "paper_draft.tex" # Or user-specified file
|
|
51
|
+
rc task create --type polish --paper $paperFile --output .rc/tasks/paper-polish.json
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Auto-Context Loading
|
|
55
|
+
|
|
56
|
+
Read all context files before orchestration:
|
|
57
|
+
|
|
58
|
+
```powershell
|
|
59
|
+
# Load task context
|
|
60
|
+
$taskFile = "C:\PythonProject\research_copilot\.rc\tasks\paper-polish.json"
|
|
61
|
+
if (Test-Path $taskFile) {
|
|
62
|
+
$task = Get-Content $taskFile | ConvertFrom-Json
|
|
63
|
+
Write-Host "Paper file: $($task.paper_file)"
|
|
64
|
+
|
|
65
|
+
# Load PRD for research context
|
|
66
|
+
$prdFile = "C:\PythonProject\research_copilot\.rc\prd.md"
|
|
67
|
+
if (Test-Path $prdFile) {
|
|
68
|
+
$prd = Get-Content $prdFile -Raw
|
|
69
|
+
Write-Host "PRD loaded for context"
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
# Load venue specification
|
|
73
|
+
$venueFile = "C:\PythonProject\research_copilot\.rc\venue\spec.json"
|
|
74
|
+
if (Test-Path $venueFile) {
|
|
75
|
+
$venue = Get-Content $venueFile | ConvertFrom-Json
|
|
76
|
+
Write-Host "Venue: $($venue.name)"
|
|
77
|
+
Write-Host "Style guide: $($venue.style_guide)"
|
|
78
|
+
} else {
|
|
79
|
+
Write-Host "WARNING: No venue spec found"
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
# Load writing conventions
|
|
83
|
+
$conventionsFile = "C:\PythonProject\research_copilot\.rc\writing\conventions.md"
|
|
84
|
+
if (Test-Path $conventionsFile) {
|
|
85
|
+
Write-Host "Writing conventions loaded"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Orchestration Logic
|
|
91
|
+
|
|
92
|
+
Execute polishing via agent dispatch:
|
|
93
|
+
|
|
94
|
+
```powershell
|
|
95
|
+
# Start task
|
|
96
|
+
rc task start paper-polish
|
|
97
|
+
|
|
98
|
+
# Create backup before polishing
|
|
99
|
+
$paperFile = "paper_draft.tex"
|
|
100
|
+
$backupFile = "paper_draft.backup.tex"
|
|
101
|
+
Copy-Item $paperFile $backupFile -Force
|
|
102
|
+
Write-Host "Backup created: $backupFile"
|
|
103
|
+
|
|
104
|
+
# Dispatch to polisher agent
|
|
105
|
+
Write-Host "Dispatching to @rc-polisher agent..."
|
|
106
|
+
|
|
107
|
+
# Agent will:
|
|
108
|
+
# 1. Scan for AI patterns (excessive adjectives, mechanical transitions)
|
|
109
|
+
# 2. Check venue style compliance (citation format, section structure)
|
|
110
|
+
# 3. Refine wording while preserving meaning
|
|
111
|
+
# 4. Ensure no numbers/formulas are modified
|
|
112
|
+
# 5. Generate diff showing only text changes
|
|
113
|
+
# 6. Save polished version to paper_polished.tex
|
|
114
|
+
|
|
115
|
+
# Wait for completion
|
|
116
|
+
$status = rc task status paper-polish
|
|
117
|
+
Write-Host "Task status: $status"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Verify polishing results:
|
|
121
|
+
|
|
122
|
+
```powershell
|
|
123
|
+
# Verify polish outputs
|
|
124
|
+
$polishedFile = "paper_polished.tex"
|
|
125
|
+
|
|
126
|
+
if (-not (Test-Path $polishedFile)) {
|
|
127
|
+
Write-Host "ERROR: Polished file not generated"
|
|
128
|
+
exit 1
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
# Check that file was actually modified
|
|
132
|
+
$originalSize = (Get-Item $paperFile).Length
|
|
133
|
+
$polishedSize = (Get-Item $polishedFile).Length
|
|
134
|
+
if ($originalSize -eq $polishedSize) {
|
|
135
|
+
Write-Host "WARNING: File sizes identical - may be no changes"
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
# Verify polish report exists
|
|
139
|
+
$reportFile = "C:\PythonProject\research_copilot\.rc\polish\report.md"
|
|
140
|
+
if (Test-Path $reportFile) {
|
|
141
|
+
Write-Host "Polish report generated"
|
|
142
|
+
} else {
|
|
143
|
+
Write-Host "WARNING: No polish report found"
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Complete task:
|
|
148
|
+
|
|
149
|
+
```powershell
|
|
150
|
+
# Mark task complete if quality gates passed
|
|
151
|
+
rc task complete paper-polish
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Quality Gates
|
|
155
|
+
|
|
156
|
+
Verify before marking complete:
|
|
157
|
+
|
|
158
|
+
```powershell
|
|
159
|
+
# Quality gate checks
|
|
160
|
+
$passed = $true
|
|
161
|
+
|
|
162
|
+
# Gate 1: No AI patterns remain
|
|
163
|
+
$polishedFile = "paper_polished.tex"
|
|
164
|
+
if (Test-Path $polishedFile) {
|
|
165
|
+
$content = Get-Content $polishedFile -Raw
|
|
166
|
+
|
|
167
|
+
# Check for AI patterns
|
|
168
|
+
$aiPatterns = @(
|
|
169
|
+
'very\s+important',
|
|
170
|
+
'highly\s+significant',
|
|
171
|
+
'it\s+is\s+worth\s+noting',
|
|
172
|
+
'arguably',
|
|
173
|
+
'In\s+conclusion,\s+we\s+have',
|
|
174
|
+
'Furthermore,\s+we',
|
|
175
|
+
'Moreover,\s+it',
|
|
176
|
+
'bullet\s+list'
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
$patternsFound = @()
|
|
180
|
+
foreach ($pattern in $aiPatterns) {
|
|
181
|
+
if ($content -match $pattern) {
|
|
182
|
+
$patternsFound += $pattern
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if ($patternsFound.Count -gt 0) {
|
|
187
|
+
Write-Host "FAIL: AI patterns found: $($patternsFound -join ', ')"
|
|
188
|
+
$passed = $false
|
|
189
|
+
}
|
|
190
|
+
} else {
|
|
191
|
+
Write-Host "FAIL: No polished file"
|
|
192
|
+
$passed = $false
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
# Gate 2: Venue style compliance
|
|
196
|
+
$venueFile = "C:\PythonProject\research_copilot\.rc\venue\spec.json"
|
|
197
|
+
if (Test-Path $venueFile) {
|
|
198
|
+
$venue = Get-Content $venueFile | ConvertFrom-Json
|
|
199
|
+
|
|
200
|
+
# Check citation format
|
|
201
|
+
if ($venue.citation_style -eq "numeric") {
|
|
202
|
+
if ($content -notmatch '\\\cite\{[^\}]+\}') {
|
|
203
|
+
Write-Host "FAIL: No numeric citations found"
|
|
204
|
+
$passed = $false
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
# Check section structure
|
|
209
|
+
$requiredSections = @('Introduction', 'Related Work', 'Method', 'Experiments', 'Conclusion')
|
|
210
|
+
foreach ($section in $requiredSections) {
|
|
211
|
+
if ($content -notmatch "\\section\{$section\}") {
|
|
212
|
+
Write-Host "FAIL: Missing required section: $section"
|
|
213
|
+
$passed = $false
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
# Gate 3: Diff verification (only wording changed)
|
|
219
|
+
$diffFile = "C:\PythonProject\research_copilot\.rc\polish\diff.txt"
|
|
220
|
+
if (Test-Path $diffFile) {
|
|
221
|
+
$diff = Get-Content $diffFile -Raw
|
|
222
|
+
|
|
223
|
+
# Check that no numbers were modified
|
|
224
|
+
$numberChanges = [regex]::Matches($diff, '-.*\d+.*\n\+.*\d+')
|
|
225
|
+
if ($numberChanges.Count -gt 0) {
|
|
226
|
+
Write-Host "WARNING: Numbers may have been modified - manual review needed"
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
# Check that no formulas were modified
|
|
230
|
+
$formulaChanges = [regex]::Matches($diff, '-.*\$.*\$.*\n\+.*\$.*\$')
|
|
231
|
+
if ($formulaChanges.Count -gt 0) {
|
|
232
|
+
Write-Host "WARNING: Formulas may have been modified - manual review needed"
|
|
233
|
+
}
|
|
234
|
+
} else {
|
|
235
|
+
Write-Host "WARNING: No diff file found"
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
if ($passed) {
|
|
239
|
+
Write-Host "All quality gates passed"
|
|
240
|
+
} else {
|
|
241
|
+
Write-Host "Quality gates failed - review needed"
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Report Format
|
|
246
|
+
|
|
247
|
+
Generate final report:
|
|
248
|
+
|
|
249
|
+
```markdown
|
|
250
|
+
# Paper Polish Report
|
|
251
|
+
|
|
252
|
+
**Paper**: {paper_file}
|
|
253
|
+
**Date**: {date}
|
|
254
|
+
**AI Patterns Removed**: {pattern_count}
|
|
255
|
+
**Changes Made**: {change_count}
|
|
256
|
+
|
|
257
|
+
## AI Patterns Removed
|
|
258
|
+
|
|
259
|
+
- Excessive adjectives: {count} instances
|
|
260
|
+
- Mechanical transitions: {count} instances
|
|
261
|
+
- Bullet lists in prose: {count} instances
|
|
262
|
+
- Hedging phrases: {count} instances
|
|
263
|
+
|
|
264
|
+
## Venue Style Compliance
|
|
265
|
+
|
|
266
|
+
✓ Citation format: {venue.citation_style}
|
|
267
|
+
✓ Section structure: {venue.required_sections}
|
|
268
|
+
✓ Page limit: {current_pages}/{venue.page_limit}
|
|
269
|
+
|
|
270
|
+
## Diff Verification
|
|
271
|
+
|
|
272
|
+
✓ Only wording changed
|
|
273
|
+
✓ No numbers modified
|
|
274
|
+
✓ No formulas modified
|
|
275
|
+
✓ No citations removed
|
|
276
|
+
|
|
277
|
+
## Key Changes
|
|
278
|
+
|
|
279
|
+
1. Changed "very important" → "critical"
|
|
280
|
+
2. Removed "It is worth noting that"
|
|
281
|
+
3. Simplified "Furthermore, we observe" → "We observe"
|
|
282
|
+
|
|
283
|
+
## Files Generated
|
|
284
|
+
|
|
285
|
+
- `paper_polished.tex`: Polished version
|
|
286
|
+
- `paper_draft.backup.tex`: Original backup
|
|
287
|
+
- `.rc/polish/diff.txt`: Detailed changes
|
|
288
|
+
- `.rc/polish/report.md`: This report
|
|
289
|
+
|
|
290
|
+
## Next Steps
|
|
291
|
+
|
|
292
|
+
- [ ] Review polished version
|
|
293
|
+
- [ ] Compile LaTeX to verify formatting
|
|
294
|
+
- [ ] Run sanity-check before submission
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
## Error Recovery
|
|
298
|
+
|
|
299
|
+
If polishing fails:
|
|
300
|
+
|
|
301
|
+
```powershell
|
|
302
|
+
# Restore from backup
|
|
303
|
+
$backupFile = "paper_draft.backup.tex"
|
|
304
|
+
if (Test-Path $backupFile) {
|
|
305
|
+
Copy-Item $backupFile $paperFile -Force
|
|
306
|
+
Write-Host "Restored from backup"
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
# Check agent error log
|
|
310
|
+
$errorLog = "C:\PythonProject\research_copilot\.rc\polish\error.log"
|
|
311
|
+
if (Test-Path $errorLog) {
|
|
312
|
+
$error = Get-Content $errorLog -Raw
|
|
313
|
+
Write-Host "Agent error: $error"
|
|
314
|
+
}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## Example Usage
|
|
318
|
+
|
|
319
|
+
```
|
|
320
|
+
User: "Polish the paper and remove AI patterns"
|