@bgicli/bgicli 2.2.7 → 2.2.9
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/data/skills/anthropic-algorithmic-art/SKILL.md +405 -0
- package/data/skills/anthropic-canvas-design/SKILL.md +130 -0
- package/data/skills/anthropic-claude-api/SKILL.md +243 -0
- package/data/skills/anthropic-doc-coauthoring/SKILL.md +375 -0
- package/data/skills/anthropic-docx/SKILL.md +590 -0
- package/data/skills/anthropic-frontend-design/SKILL.md +42 -0
- package/data/skills/anthropic-internal-comms/SKILL.md +32 -0
- package/data/skills/anthropic-mcp-builder/SKILL.md +236 -0
- package/data/skills/anthropic-pdf/SKILL.md +314 -0
- package/data/skills/anthropic-pptx/SKILL.md +232 -0
- package/data/skills/anthropic-skill-creator/SKILL.md +485 -0
- package/data/skills/anthropic-webapp-testing/SKILL.md +96 -0
- package/data/skills/anthropic-xlsx/SKILL.md +292 -0
- package/data/skills/arxiv-database/SKILL.md +362 -0
- package/data/skills/astropy/SKILL.md +329 -0
- package/data/skills/ctx-advanced-evaluation/SKILL.md +402 -0
- package/data/skills/ctx-bdi-mental-states/SKILL.md +311 -0
- package/data/skills/ctx-context-compression/SKILL.md +272 -0
- package/data/skills/ctx-context-degradation/SKILL.md +206 -0
- package/data/skills/ctx-context-fundamentals/SKILL.md +201 -0
- package/data/skills/ctx-context-optimization/SKILL.md +195 -0
- package/data/skills/ctx-evaluation/SKILL.md +251 -0
- package/data/skills/ctx-filesystem-context/SKILL.md +287 -0
- package/data/skills/ctx-hosted-agents/SKILL.md +260 -0
- package/data/skills/ctx-memory-systems/SKILL.md +225 -0
- package/data/skills/ctx-multi-agent-patterns/SKILL.md +257 -0
- package/data/skills/ctx-project-development/SKILL.md +291 -0
- package/data/skills/ctx-tool-design/SKILL.md +271 -0
- package/data/skills/dhdna-profiler/SKILL.md +162 -0
- package/data/skills/generate-image/SKILL.md +183 -0
- package/data/skills/geomaster/SKILL.md +365 -0
- package/data/skills/get-available-resources/SKILL.md +275 -0
- package/data/skills/hamelsmu-build-review-interface/SKILL.md +96 -0
- package/data/skills/hamelsmu-error-analysis/SKILL.md +164 -0
- package/data/skills/hamelsmu-eval-audit/SKILL.md +183 -0
- package/data/skills/hamelsmu-evaluate-rag/SKILL.md +177 -0
- package/data/skills/hamelsmu-generate-synthetic-data/SKILL.md +131 -0
- package/data/skills/hamelsmu-validate-evaluator/SKILL.md +212 -0
- package/data/skills/hamelsmu-write-judge-prompt/SKILL.md +144 -0
- package/data/skills/hf-cli/SKILL.md +174 -0
- package/data/skills/hf-mcp/SKILL.md +178 -0
- package/data/skills/hugging-face-dataset-viewer/SKILL.md +121 -0
- package/data/skills/hugging-face-datasets/SKILL.md +542 -0
- package/data/skills/hugging-face-evaluation/SKILL.md +651 -0
- package/data/skills/hugging-face-jobs/SKILL.md +1042 -0
- package/data/skills/hugging-face-model-trainer/SKILL.md +717 -0
- package/data/skills/hugging-face-paper-pages/SKILL.md +239 -0
- package/data/skills/hugging-face-paper-publisher/SKILL.md +624 -0
- package/data/skills/hugging-face-tool-builder/SKILL.md +110 -0
- package/data/skills/hugging-face-trackio/SKILL.md +115 -0
- package/data/skills/hugging-face-vision-trainer/SKILL.md +593 -0
- package/data/skills/huggingface-gradio/SKILL.md +245 -0
- package/data/skills/matlab/SKILL.md +376 -0
- package/data/skills/modal/SKILL.md +381 -0
- package/data/skills/openai-cloudflare-deploy/SKILL.md +224 -0
- package/data/skills/openai-develop-web-game/SKILL.md +149 -0
- package/data/skills/openai-doc/SKILL.md +80 -0
- package/data/skills/openai-figma/SKILL.md +42 -0
- package/data/skills/openai-figma-implement-design/SKILL.md +264 -0
- package/data/skills/openai-gh-address-comments/SKILL.md +25 -0
- package/data/skills/openai-gh-fix-ci/SKILL.md +69 -0
- package/data/skills/openai-imagegen/SKILL.md +174 -0
- package/data/skills/openai-jupyter-notebook/SKILL.md +107 -0
- package/data/skills/openai-linear/SKILL.md +87 -0
- package/data/skills/openai-netlify-deploy/SKILL.md +247 -0
- package/data/skills/openai-notion-knowledge-capture/SKILL.md +56 -0
- package/data/skills/openai-notion-meeting-intelligence/SKILL.md +60 -0
- package/data/skills/openai-notion-research-documentation/SKILL.md +59 -0
- package/data/skills/openai-notion-spec-to-implementation/SKILL.md +58 -0
- package/data/skills/openai-openai-docs/SKILL.md +69 -0
- package/data/skills/openai-pdf/SKILL.md +67 -0
- package/data/skills/openai-playwright/SKILL.md +147 -0
- package/data/skills/openai-render-deploy/SKILL.md +479 -0
- package/data/skills/openai-screenshot/SKILL.md +267 -0
- package/data/skills/openai-security-best-practices/SKILL.md +86 -0
- package/data/skills/openai-security-ownership-map/SKILL.md +206 -0
- package/data/skills/openai-security-threat-model/SKILL.md +81 -0
- package/data/skills/openai-sentry/SKILL.md +123 -0
- package/data/skills/openai-sora/SKILL.md +178 -0
- package/data/skills/openai-speech/SKILL.md +144 -0
- package/data/skills/openai-spreadsheet/SKILL.md +145 -0
- package/data/skills/openai-transcribe/SKILL.md +81 -0
- package/data/skills/openai-vercel-deploy/SKILL.md +77 -0
- package/data/skills/openai-yeet/SKILL.md +28 -0
- package/data/skills/pennylane/SKILL.md +224 -0
- package/data/skills/polars-bio/SKILL.md +374 -0
- package/data/skills/primekg/SKILL.md +97 -0
- package/data/skills/pymatgen/SKILL.md +689 -0
- package/data/skills/qiskit/SKILL.md +273 -0
- package/data/skills/qutip/SKILL.md +316 -0
- package/data/skills/recursive-decomposition/SKILL.md +185 -0
- package/data/skills/rowan/SKILL.md +427 -0
- package/data/skills/scholar-evaluation/SKILL.md +298 -0
- package/data/skills/sentry-create-alert/SKILL.md +210 -0
- package/data/skills/sentry-fix-issues/SKILL.md +126 -0
- package/data/skills/sentry-pr-code-review/SKILL.md +105 -0
- package/data/skills/sentry-python-sdk/SKILL.md +317 -0
- package/data/skills/sentry-setup-ai-monitoring/SKILL.md +217 -0
- package/data/skills/stable-baselines3/SKILL.md +297 -0
- package/data/skills/sympy/SKILL.md +498 -0
- package/data/skills/trailofbits-ask-questions-if-underspecified/SKILL.md +85 -0
- package/data/skills/trailofbits-audit-context-building/SKILL.md +302 -0
- package/data/skills/trailofbits-differential-review/SKILL.md +220 -0
- package/data/skills/trailofbits-insecure-defaults/SKILL.md +117 -0
- package/data/skills/trailofbits-modern-python/SKILL.md +333 -0
- package/data/skills/trailofbits-property-based-testing/SKILL.md +123 -0
- package/data/skills/trailofbits-semgrep-rule-creator/SKILL.md +172 -0
- package/data/skills/trailofbits-sharp-edges/SKILL.md +292 -0
- package/data/skills/trailofbits-variant-analysis/SKILL.md +142 -0
- package/data/skills/transformers.js/SKILL.md +637 -0
- package/data/skills/writing/SKILL.md +419 -0
- package/data/workflows/survival-analysis-clinical/SKILL.md +348 -0
- package/data/workflows/survival-analysis-clinical/scripts/full_workflow.R +95 -0
- package/data/workflows/survival-analysis-clinical/scripts/load_example_data.R +65 -0
- package/data/workflows/survival-analysis-clinical/scripts/plot_forest.R +46 -0
- package/dist/bgi.js +1608 -233
- package/package.json +45 -45
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: xlsx
|
|
3
|
+
description: "Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like \"the xlsx in my downloads\") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved."
|
|
4
|
+
license: Proprietary. LICENSE.txt has complete terms
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Requirements for Outputs
|
|
8
|
+
|
|
9
|
+
## All Excel files
|
|
10
|
+
|
|
11
|
+
### Professional Font
|
|
12
|
+
- Use a consistent, professional font (e.g., Arial, Times New Roman) for all deliverables unless otherwise instructed by the user
|
|
13
|
+
|
|
14
|
+
### Zero Formula Errors
|
|
15
|
+
- Every Excel model MUST be delivered with ZERO formula errors (#REF!, #DIV/0!, #VALUE!, #N/A, #NAME?)
|
|
16
|
+
|
|
17
|
+
### Preserve Existing Templates (when updating templates)
|
|
18
|
+
- Study and EXACTLY match existing format, style, and conventions when modifying files
|
|
19
|
+
- Never impose standardized formatting on files with established patterns
|
|
20
|
+
- Existing template conventions ALWAYS override these guidelines
|
|
21
|
+
|
|
22
|
+
## Financial models
|
|
23
|
+
|
|
24
|
+
### Color Coding Standards
|
|
25
|
+
Unless otherwise stated by the user or existing template
|
|
26
|
+
|
|
27
|
+
#### Industry-Standard Color Conventions
|
|
28
|
+
- **Blue text (RGB: 0,0,255)**: Hardcoded inputs, and numbers users will change for scenarios
|
|
29
|
+
- **Black text (RGB: 0,0,0)**: ALL formulas and calculations
|
|
30
|
+
- **Green text (RGB: 0,128,0)**: Links pulling from other worksheets within same workbook
|
|
31
|
+
- **Red text (RGB: 255,0,0)**: External links to other files
|
|
32
|
+
- **Yellow background (RGB: 255,255,0)**: Key assumptions needing attention or cells that need to be updated
|
|
33
|
+
|
|
34
|
+
### Number Formatting Standards
|
|
35
|
+
|
|
36
|
+
#### Required Format Rules
|
|
37
|
+
- **Years**: Format as text strings (e.g., "2024" not "2,024")
|
|
38
|
+
- **Currency**: Use $#,##0 format; ALWAYS specify units in headers ("Revenue ($mm)")
|
|
39
|
+
- **Zeros**: Use number formatting to make all zeros "-", including percentages (e.g., "$#,##0;($#,##0);-")
|
|
40
|
+
- **Percentages**: Default to 0.0% format (one decimal)
|
|
41
|
+
- **Multiples**: Format as 0.0x for valuation multiples (EV/EBITDA, P/E)
|
|
42
|
+
- **Negative numbers**: Use parentheses (123) not minus -123
|
|
43
|
+
|
|
44
|
+
### Formula Construction Rules
|
|
45
|
+
|
|
46
|
+
#### Assumptions Placement
|
|
47
|
+
- Place ALL assumptions (growth rates, margins, multiples, etc.) in separate assumption cells
|
|
48
|
+
- Use cell references instead of hardcoded values in formulas
|
|
49
|
+
- Example: Use =B5*(1+$B$6) instead of =B5*1.05
|
|
50
|
+
|
|
51
|
+
#### Formula Error Prevention
|
|
52
|
+
- Verify all cell references are correct
|
|
53
|
+
- Check for off-by-one errors in ranges
|
|
54
|
+
- Ensure consistent formulas across all projection periods
|
|
55
|
+
- Test with edge cases (zero values, negative numbers)
|
|
56
|
+
- Verify no unintended circular references
|
|
57
|
+
|
|
58
|
+
#### Documentation Requirements for Hardcodes
|
|
59
|
+
- Comment or in cells beside (if end of table). Format: "Source: [System/Document], [Date], [Specific Reference], [URL if applicable]"
|
|
60
|
+
- Examples:
|
|
61
|
+
- "Source: Company 10-K, FY2024, Page 45, Revenue Note, [SEC EDGAR URL]"
|
|
62
|
+
- "Source: Company 10-Q, Q2 2025, Exhibit 99.1, [SEC EDGAR URL]"
|
|
63
|
+
- "Source: Bloomberg Terminal, 8/15/2025, AAPL US Equity"
|
|
64
|
+
- "Source: FactSet, 8/20/2025, Consensus Estimates Screen"
|
|
65
|
+
|
|
66
|
+
# XLSX creation, editing, and analysis
|
|
67
|
+
|
|
68
|
+
## Overview
|
|
69
|
+
|
|
70
|
+
A user may ask you to create, edit, or analyze the contents of an .xlsx file. You have different tools and workflows available for different tasks.
|
|
71
|
+
|
|
72
|
+
## Important Requirements
|
|
73
|
+
|
|
74
|
+
**LibreOffice Required for Formula Recalculation**: You can assume LibreOffice is installed for recalculating formula values using the `scripts/recalc.py` script. The script automatically configures LibreOffice on first run, including in sandboxed environments where Unix sockets are restricted (handled by `scripts/office/soffice.py`)
|
|
75
|
+
|
|
76
|
+
## Reading and analyzing data
|
|
77
|
+
|
|
78
|
+
### Data analysis with pandas
|
|
79
|
+
For data analysis, visualization, and basic operations, use **pandas** which provides powerful data manipulation capabilities:
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
import pandas as pd
|
|
83
|
+
|
|
84
|
+
# Read Excel
|
|
85
|
+
df = pd.read_excel('file.xlsx') # Default: first sheet
|
|
86
|
+
all_sheets = pd.read_excel('file.xlsx', sheet_name=None) # All sheets as dict
|
|
87
|
+
|
|
88
|
+
# Analyze
|
|
89
|
+
df.head() # Preview data
|
|
90
|
+
df.info() # Column info
|
|
91
|
+
df.describe() # Statistics
|
|
92
|
+
|
|
93
|
+
# Write Excel
|
|
94
|
+
df.to_excel('output.xlsx', index=False)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Excel File Workflows
|
|
98
|
+
|
|
99
|
+
## CRITICAL: Use Formulas, Not Hardcoded Values
|
|
100
|
+
|
|
101
|
+
**Always use Excel formulas instead of calculating values in Python and hardcoding them.** This ensures the spreadsheet remains dynamic and updateable.
|
|
102
|
+
|
|
103
|
+
### ❌ WRONG - Hardcoding Calculated Values
|
|
104
|
+
```python
|
|
105
|
+
# Bad: Calculating in Python and hardcoding result
|
|
106
|
+
total = df['Sales'].sum()
|
|
107
|
+
sheet['B10'] = total # Hardcodes 5000
|
|
108
|
+
|
|
109
|
+
# Bad: Computing growth rate in Python
|
|
110
|
+
growth = (df.iloc[-1]['Revenue'] - df.iloc[0]['Revenue']) / df.iloc[0]['Revenue']
|
|
111
|
+
sheet['C5'] = growth # Hardcodes 0.15
|
|
112
|
+
|
|
113
|
+
# Bad: Python calculation for average
|
|
114
|
+
avg = sum(values) / len(values)
|
|
115
|
+
sheet['D20'] = avg # Hardcodes 42.5
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### ✅ CORRECT - Using Excel Formulas
|
|
119
|
+
```python
|
|
120
|
+
# Good: Let Excel calculate the sum
|
|
121
|
+
sheet['B10'] = '=SUM(B2:B9)'
|
|
122
|
+
|
|
123
|
+
# Good: Growth rate as Excel formula
|
|
124
|
+
sheet['C5'] = '=(C4-C2)/C2'
|
|
125
|
+
|
|
126
|
+
# Good: Average using Excel function
|
|
127
|
+
sheet['D20'] = '=AVERAGE(D2:D19)'
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
This applies to ALL calculations - totals, percentages, ratios, differences, etc. The spreadsheet should be able to recalculate when source data changes.
|
|
131
|
+
|
|
132
|
+
## Common Workflow
|
|
133
|
+
1. **Choose tool**: pandas for data, openpyxl for formulas/formatting
|
|
134
|
+
2. **Create/Load**: Create new workbook or load existing file
|
|
135
|
+
3. **Modify**: Add/edit data, formulas, and formatting
|
|
136
|
+
4. **Save**: Write to file
|
|
137
|
+
5. **Recalculate formulas (MANDATORY IF USING FORMULAS)**: Use the scripts/recalc.py script
|
|
138
|
+
```bash
|
|
139
|
+
python scripts/recalc.py output.xlsx
|
|
140
|
+
```
|
|
141
|
+
6. **Verify and fix any errors**:
|
|
142
|
+
- The script returns JSON with error details
|
|
143
|
+
- If `status` is `errors_found`, check `error_summary` for specific error types and locations
|
|
144
|
+
- Fix the identified errors and recalculate again
|
|
145
|
+
- Common errors to fix:
|
|
146
|
+
- `#REF!`: Invalid cell references
|
|
147
|
+
- `#DIV/0!`: Division by zero
|
|
148
|
+
- `#VALUE!`: Wrong data type in formula
|
|
149
|
+
- `#NAME?`: Unrecognized formula name
|
|
150
|
+
|
|
151
|
+
### Creating new Excel files
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
# Using openpyxl for formulas and formatting
|
|
155
|
+
from openpyxl import Workbook
|
|
156
|
+
from openpyxl.styles import Font, PatternFill, Alignment
|
|
157
|
+
|
|
158
|
+
wb = Workbook()
|
|
159
|
+
sheet = wb.active
|
|
160
|
+
|
|
161
|
+
# Add data
|
|
162
|
+
sheet['A1'] = 'Hello'
|
|
163
|
+
sheet['B1'] = 'World'
|
|
164
|
+
sheet.append(['Row', 'of', 'data'])
|
|
165
|
+
|
|
166
|
+
# Add formula
|
|
167
|
+
sheet['B2'] = '=SUM(A1:A10)'
|
|
168
|
+
|
|
169
|
+
# Formatting
|
|
170
|
+
sheet['A1'].font = Font(bold=True, color='FF0000')
|
|
171
|
+
sheet['A1'].fill = PatternFill('solid', start_color='FFFF00')
|
|
172
|
+
sheet['A1'].alignment = Alignment(horizontal='center')
|
|
173
|
+
|
|
174
|
+
# Column width
|
|
175
|
+
sheet.column_dimensions['A'].width = 20
|
|
176
|
+
|
|
177
|
+
wb.save('output.xlsx')
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Editing existing Excel files
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
# Using openpyxl to preserve formulas and formatting
|
|
184
|
+
from openpyxl import load_workbook
|
|
185
|
+
|
|
186
|
+
# Load existing file
|
|
187
|
+
wb = load_workbook('existing.xlsx')
|
|
188
|
+
sheet = wb.active # or wb['SheetName'] for specific sheet
|
|
189
|
+
|
|
190
|
+
# Working with multiple sheets
|
|
191
|
+
for sheet_name in wb.sheetnames:
|
|
192
|
+
sheet = wb[sheet_name]
|
|
193
|
+
print(f"Sheet: {sheet_name}")
|
|
194
|
+
|
|
195
|
+
# Modify cells
|
|
196
|
+
sheet['A1'] = 'New Value'
|
|
197
|
+
sheet.insert_rows(2) # Insert row at position 2
|
|
198
|
+
sheet.delete_cols(3) # Delete column 3
|
|
199
|
+
|
|
200
|
+
# Add new sheet
|
|
201
|
+
new_sheet = wb.create_sheet('NewSheet')
|
|
202
|
+
new_sheet['A1'] = 'Data'
|
|
203
|
+
|
|
204
|
+
wb.save('modified.xlsx')
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Recalculating formulas
|
|
208
|
+
|
|
209
|
+
Excel files created or modified by openpyxl contain formulas as strings but not calculated values. Use the provided `scripts/recalc.py` script to recalculate formulas:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
python scripts/recalc.py <excel_file> [timeout_seconds]
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Example:
|
|
216
|
+
```bash
|
|
217
|
+
python scripts/recalc.py output.xlsx 30
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
The script:
|
|
221
|
+
- Automatically sets up LibreOffice macro on first run
|
|
222
|
+
- Recalculates all formulas in all sheets
|
|
223
|
+
- Scans ALL cells for Excel errors (#REF!, #DIV/0!, etc.)
|
|
224
|
+
- Returns JSON with detailed error locations and counts
|
|
225
|
+
- Works on both Linux and macOS
|
|
226
|
+
|
|
227
|
+
## Formula Verification Checklist
|
|
228
|
+
|
|
229
|
+
Quick checks to ensure formulas work correctly:
|
|
230
|
+
|
|
231
|
+
### Essential Verification
|
|
232
|
+
- [ ] **Test 2-3 sample references**: Verify they pull correct values before building full model
|
|
233
|
+
- [ ] **Column mapping**: Confirm Excel columns match (e.g., column 64 = BL, not BK)
|
|
234
|
+
- [ ] **Row offset**: Remember Excel rows are 1-indexed (DataFrame row 5 = Excel row 6)
|
|
235
|
+
|
|
236
|
+
### Common Pitfalls
|
|
237
|
+
- [ ] **NaN handling**: Check for null values with `pd.notna()`
|
|
238
|
+
- [ ] **Far-right columns**: FY data often in columns 50+
|
|
239
|
+
- [ ] **Multiple matches**: Search all occurrences, not just first
|
|
240
|
+
- [ ] **Division by zero**: Check denominators before using `/` in formulas (#DIV/0!)
|
|
241
|
+
- [ ] **Wrong references**: Verify all cell references point to intended cells (#REF!)
|
|
242
|
+
- [ ] **Cross-sheet references**: Use correct format (Sheet1!A1) for linking sheets
|
|
243
|
+
|
|
244
|
+
### Formula Testing Strategy
|
|
245
|
+
- [ ] **Start small**: Test formulas on 2-3 cells before applying broadly
|
|
246
|
+
- [ ] **Verify dependencies**: Check all cells referenced in formulas exist
|
|
247
|
+
- [ ] **Test edge cases**: Include zero, negative, and very large values
|
|
248
|
+
|
|
249
|
+
### Interpreting scripts/recalc.py Output
|
|
250
|
+
The script returns JSON with error details:
|
|
251
|
+
```json
|
|
252
|
+
{
|
|
253
|
+
"status": "success", // or "errors_found"
|
|
254
|
+
"total_errors": 0, // Total error count
|
|
255
|
+
"total_formulas": 42, // Number of formulas in file
|
|
256
|
+
"error_summary": { // Only present if errors found
|
|
257
|
+
"#REF!": {
|
|
258
|
+
"count": 2,
|
|
259
|
+
"locations": ["Sheet1!B5", "Sheet1!C10"]
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Best Practices
|
|
266
|
+
|
|
267
|
+
### Library Selection
|
|
268
|
+
- **pandas**: Best for data analysis, bulk operations, and simple data export
|
|
269
|
+
- **openpyxl**: Best for complex formatting, formulas, and Excel-specific features
|
|
270
|
+
|
|
271
|
+
### Working with openpyxl
|
|
272
|
+
- Cell indices are 1-based (row=1, column=1 refers to cell A1)
|
|
273
|
+
- Use `data_only=True` to read calculated values: `load_workbook('file.xlsx', data_only=True)`
|
|
274
|
+
- **Warning**: If opened with `data_only=True` and saved, formulas are replaced with values and permanently lost
|
|
275
|
+
- For large files: Use `read_only=True` for reading or `write_only=True` for writing
|
|
276
|
+
- Formulas are preserved but not evaluated - use scripts/recalc.py to update values
|
|
277
|
+
|
|
278
|
+
### Working with pandas
|
|
279
|
+
- Specify data types to avoid inference issues: `pd.read_excel('file.xlsx', dtype={'id': str})`
|
|
280
|
+
- For large files, read specific columns: `pd.read_excel('file.xlsx', usecols=['A', 'C', 'E'])`
|
|
281
|
+
- Handle dates properly: `pd.read_excel('file.xlsx', parse_dates=['date_column'])`
|
|
282
|
+
|
|
283
|
+
## Code Style Guidelines
|
|
284
|
+
**IMPORTANT**: When generating Python code for Excel operations:
|
|
285
|
+
- Write minimal, concise Python code without unnecessary comments
|
|
286
|
+
- Avoid verbose variable names and redundant operations
|
|
287
|
+
- Avoid unnecessary print statements
|
|
288
|
+
|
|
289
|
+
**For Excel files themselves**:
|
|
290
|
+
- Add comments to cells with complex formulas or important assumptions
|
|
291
|
+
- Document data sources for hardcoded values
|
|
292
|
+
- Include notes for key calculations and model sections
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: arxiv-database
|
|
3
|
+
description: Search and retrieve preprints from arXiv via the Atom API. Use this skill when searching for papers in physics, mathematics, computer science, quantitative biology, quantitative finance, statistics, electrical engineering, or economics by keywords, authors, arXiv IDs, date ranges, or categories.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
skill-author: Orchestra Research
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# arXiv Database
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
This skill provides Python tools for searching and retrieving preprints from arXiv.org via its public Atom API. It supports keyword search, author search, category filtering, arXiv ID lookup, and PDF download. Results are returned as structured JSON with titles, abstracts, authors, categories, and links.
|
|
14
|
+
|
|
15
|
+
## When to Use This Skill
|
|
16
|
+
|
|
17
|
+
Use this skill when:
|
|
18
|
+
- Searching for preprints in CS, ML, AI, physics, math, statistics, q-bio, q-fin, or economics
|
|
19
|
+
- Looking up specific papers by arXiv ID (e.g., `2309.10668`)
|
|
20
|
+
- Tracking an author's recent preprints
|
|
21
|
+
- Filtering papers by arXiv category (e.g., `cs.LG`, `cs.CL`, `stat.ML`)
|
|
22
|
+
- Downloading PDFs for full-text analysis
|
|
23
|
+
- Building literature review datasets for AI/ML research
|
|
24
|
+
- Monitoring new submissions in a subfield
|
|
25
|
+
|
|
26
|
+
Consider alternatives when:
|
|
27
|
+
- Searching for biomedical literature specifically -> Use **pubmed-database** or **biorxiv-database**
|
|
28
|
+
- You need citation counts or impact metrics -> Use **openalex-database**
|
|
29
|
+
- You need peer-reviewed journal articles only -> Use **pubmed-database**
|
|
30
|
+
|
|
31
|
+
## Core Search Capabilities
|
|
32
|
+
|
|
33
|
+
### 1. Keyword Search
|
|
34
|
+
|
|
35
|
+
Search for papers by keywords in titles, abstracts, or all fields.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
python scripts/arxiv_search.py \
|
|
39
|
+
--keywords "sparse autoencoders" "mechanistic interpretability" \
|
|
40
|
+
--max-results 20 \
|
|
41
|
+
--output results.json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
With category filter:
|
|
45
|
+
```bash
|
|
46
|
+
python scripts/arxiv_search.py \
|
|
47
|
+
--keywords "transformer" "attention mechanism" \
|
|
48
|
+
--category cs.LG \
|
|
49
|
+
--max-results 50 \
|
|
50
|
+
--output transformer_papers.json
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Search specific fields:
|
|
54
|
+
```bash
|
|
55
|
+
# Title only
|
|
56
|
+
python scripts/arxiv_search.py \
|
|
57
|
+
--keywords "GRPO" \
|
|
58
|
+
--search-field ti \
|
|
59
|
+
--max-results 10
|
|
60
|
+
|
|
61
|
+
# Abstract only
|
|
62
|
+
python scripts/arxiv_search.py \
|
|
63
|
+
--keywords "reward model" "RLHF" \
|
|
64
|
+
--search-field abs \
|
|
65
|
+
--max-results 30
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 2. Author Search
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
python scripts/arxiv_search.py \
|
|
72
|
+
--author "Anthropic" \
|
|
73
|
+
--max-results 50 \
|
|
74
|
+
--output anthropic_papers.json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
python scripts/arxiv_search.py \
|
|
79
|
+
--author "Ilya Sutskever" \
|
|
80
|
+
--category cs.LG \
|
|
81
|
+
--max-results 20
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 3. arXiv ID Lookup
|
|
85
|
+
|
|
86
|
+
Retrieve metadata for specific papers:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
python scripts/arxiv_search.py \
|
|
90
|
+
--ids 2309.10668 2406.04093 2310.01405 \
|
|
91
|
+
--output sae_papers.json
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Full arXiv URLs also accepted:
|
|
95
|
+
```bash
|
|
96
|
+
python scripts/arxiv_search.py \
|
|
97
|
+
--ids "https://arxiv.org/abs/2309.10668"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 4. Category Browsing
|
|
101
|
+
|
|
102
|
+
List recent papers in a category:
|
|
103
|
+
```bash
|
|
104
|
+
python scripts/arxiv_search.py \
|
|
105
|
+
--category cs.AI \
|
|
106
|
+
--max-results 100 \
|
|
107
|
+
--sort-by submittedDate \
|
|
108
|
+
--output recent_cs_ai.json
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### 5. PDF Download
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
python scripts/arxiv_search.py \
|
|
115
|
+
--ids 2309.10668 \
|
|
116
|
+
--download-pdf papers/
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Batch download from search results:
|
|
120
|
+
```python
|
|
121
|
+
import json
|
|
122
|
+
from scripts.arxiv_search import ArxivSearcher
|
|
123
|
+
|
|
124
|
+
searcher = ArxivSearcher()
|
|
125
|
+
|
|
126
|
+
# Search first
|
|
127
|
+
results = searcher.search(query="ti:sparse autoencoder", max_results=5)
|
|
128
|
+
|
|
129
|
+
# Download all
|
|
130
|
+
for paper in results:
|
|
131
|
+
arxiv_id = paper["arxiv_id"]
|
|
132
|
+
searcher.download_pdf(arxiv_id, f"papers/{arxiv_id.replace('/', '_')}.pdf")
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## arXiv Categories
|
|
136
|
+
|
|
137
|
+
### Computer Science (cs.*)
|
|
138
|
+
| Category | Description |
|
|
139
|
+
|----------|-------------|
|
|
140
|
+
| `cs.AI` | Artificial Intelligence |
|
|
141
|
+
| `cs.CL` | Computation and Language (NLP) |
|
|
142
|
+
| `cs.CV` | Computer Vision |
|
|
143
|
+
| `cs.LG` | Machine Learning |
|
|
144
|
+
| `cs.NE` | Neural and Evolutionary Computing |
|
|
145
|
+
| `cs.RO` | Robotics |
|
|
146
|
+
| `cs.CR` | Cryptography and Security |
|
|
147
|
+
| `cs.DS` | Data Structures and Algorithms |
|
|
148
|
+
| `cs.IR` | Information Retrieval |
|
|
149
|
+
| `cs.SE` | Software Engineering |
|
|
150
|
+
|
|
151
|
+
### Statistics & Math
|
|
152
|
+
| Category | Description |
|
|
153
|
+
|----------|-------------|
|
|
154
|
+
| `stat.ML` | Machine Learning (Statistics) |
|
|
155
|
+
| `stat.ME` | Methodology |
|
|
156
|
+
| `math.OC` | Optimization and Control |
|
|
157
|
+
| `math.ST` | Statistics Theory |
|
|
158
|
+
|
|
159
|
+
### Other Relevant Categories
|
|
160
|
+
| Category | Description |
|
|
161
|
+
|----------|-------------|
|
|
162
|
+
| `q-bio.BM` | Biomolecules |
|
|
163
|
+
| `q-bio.GN` | Genomics |
|
|
164
|
+
| `q-bio.QM` | Quantitative Methods |
|
|
165
|
+
| `q-fin.ST` | Statistical Finance |
|
|
166
|
+
| `eess.SP` | Signal Processing |
|
|
167
|
+
| `physics.comp-ph` | Computational Physics |
|
|
168
|
+
|
|
169
|
+
Full list: see [references/api_reference.md](references/api_reference.md).
|
|
170
|
+
|
|
171
|
+
## Query Syntax
|
|
172
|
+
|
|
173
|
+
The arXiv API uses prefix-based field searches combined with Boolean operators.
|
|
174
|
+
|
|
175
|
+
**Field prefixes:**
|
|
176
|
+
- `ti:` - Title
|
|
177
|
+
- `au:` - Author
|
|
178
|
+
- `abs:` - Abstract
|
|
179
|
+
- `cat:` - Category
|
|
180
|
+
- `all:` - All fields (default)
|
|
181
|
+
- `co:` - Comment
|
|
182
|
+
- `jr:` - Journal reference
|
|
183
|
+
- `id:` - arXiv ID
|
|
184
|
+
|
|
185
|
+
**Boolean operators** (must be UPPERCASE):
|
|
186
|
+
```
|
|
187
|
+
ti:transformer AND abs:attention
|
|
188
|
+
au:bengio OR au:lecun
|
|
189
|
+
cat:cs.LG ANDNOT cat:cs.CV
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Grouping with parentheses:**
|
|
193
|
+
```
|
|
194
|
+
(ti:sparse AND ti:autoencoder) AND cat:cs.LG
|
|
195
|
+
au:anthropic AND (abs:interpretability OR abs:alignment)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Examples:**
|
|
199
|
+
```python
|
|
200
|
+
from scripts.arxiv_search import ArxivSearcher
|
|
201
|
+
|
|
202
|
+
searcher = ArxivSearcher()
|
|
203
|
+
|
|
204
|
+
# Papers about SAEs in ML
|
|
205
|
+
results = searcher.search(
|
|
206
|
+
query="ti:sparse autoencoder AND cat:cs.LG",
|
|
207
|
+
max_results=50,
|
|
208
|
+
sort_by="submittedDate"
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
# Specific author in specific field
|
|
212
|
+
results = searcher.search(
|
|
213
|
+
query="au:neel nanda AND cat:cs.LG",
|
|
214
|
+
max_results=20
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
# Complex boolean query
|
|
218
|
+
results = searcher.search(
|
|
219
|
+
query="(abs:RLHF OR abs:reinforcement learning from human feedback) AND cat:cs.CL",
|
|
220
|
+
max_results=100
|
|
221
|
+
)
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Output Format
|
|
225
|
+
|
|
226
|
+
All searches return structured JSON:
|
|
227
|
+
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"query": "ti:sparse autoencoder AND cat:cs.LG",
|
|
231
|
+
"result_count": 15,
|
|
232
|
+
"results": [
|
|
233
|
+
{
|
|
234
|
+
"arxiv_id": "2309.10668",
|
|
235
|
+
"title": "Towards Monosemanticity: Decomposing Language Models With Dictionary Learning",
|
|
236
|
+
"authors": ["Trenton Bricken", "Adly Templeton", "..."],
|
|
237
|
+
"abstract": "Full abstract text...",
|
|
238
|
+
"categories": ["cs.LG", "cs.AI"],
|
|
239
|
+
"primary_category": "cs.LG",
|
|
240
|
+
"published": "2023-09-19T17:58:00Z",
|
|
241
|
+
"updated": "2023-10-04T14:22:00Z",
|
|
242
|
+
"doi": "10.48550/arXiv.2309.10668",
|
|
243
|
+
"pdf_url": "http://arxiv.org/pdf/2309.10668v1",
|
|
244
|
+
"abs_url": "http://arxiv.org/abs/2309.10668v1",
|
|
245
|
+
"comment": "42 pages, 30 figures",
|
|
246
|
+
"journal_ref": ""
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## Common Usage Patterns
|
|
253
|
+
|
|
254
|
+
### Literature Review Workflow
|
|
255
|
+
|
|
256
|
+
```python
|
|
257
|
+
from scripts.arxiv_search import ArxivSearcher
|
|
258
|
+
import json
|
|
259
|
+
|
|
260
|
+
searcher = ArxivSearcher()
|
|
261
|
+
|
|
262
|
+
# 1. Broad search
|
|
263
|
+
results = searcher.search(
|
|
264
|
+
query="abs:mechanistic interpretability AND cat:cs.LG",
|
|
265
|
+
max_results=200,
|
|
266
|
+
sort_by="submittedDate"
|
|
267
|
+
)
|
|
268
|
+
|
|
269
|
+
# 2. Save results
|
|
270
|
+
with open("interp_papers.json", "w") as f:
|
|
271
|
+
json.dump({"result_count": len(results), "results": results}, f, indent=2)
|
|
272
|
+
|
|
273
|
+
# 3. Filter and analyze
|
|
274
|
+
import pandas as pd
|
|
275
|
+
df = pd.DataFrame(results)
|
|
276
|
+
print(f"Total papers: {len(df)}")
|
|
277
|
+
print(f"Date range: {df['published'].min()} to {df['published'].max()}")
|
|
278
|
+
print(f"\nTop categories:")
|
|
279
|
+
print(df["primary_category"].value_counts().head(10))
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Track a Research Group
|
|
283
|
+
|
|
284
|
+
```python
|
|
285
|
+
searcher = ArxivSearcher()
|
|
286
|
+
|
|
287
|
+
groups = {
|
|
288
|
+
"anthropic": "au:anthropic AND (cat:cs.LG OR cat:cs.CL)",
|
|
289
|
+
"openai": "au:openai AND cat:cs.CL",
|
|
290
|
+
"deepmind": "au:deepmind AND cat:cs.LG",
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
for name, query in groups.items():
|
|
294
|
+
results = searcher.search(query=query, max_results=50, sort_by="submittedDate")
|
|
295
|
+
print(f"{name}: {len(results)} recent papers")
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Monitor New Submissions
|
|
299
|
+
|
|
300
|
+
```python
|
|
301
|
+
searcher = ArxivSearcher()
|
|
302
|
+
|
|
303
|
+
# Most recent ML papers
|
|
304
|
+
results = searcher.search(
|
|
305
|
+
query="cat:cs.LG",
|
|
306
|
+
max_results=50,
|
|
307
|
+
sort_by="submittedDate",
|
|
308
|
+
sort_order="descending"
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
for paper in results[:10]:
|
|
312
|
+
print(f"[{paper['published'][:10]}] {paper['title']}")
|
|
313
|
+
print(f" {paper['abs_url']}\n")
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## Python API
|
|
317
|
+
|
|
318
|
+
```python
|
|
319
|
+
from scripts.arxiv_search import ArxivSearcher
|
|
320
|
+
|
|
321
|
+
searcher = ArxivSearcher(verbose=True)
|
|
322
|
+
|
|
323
|
+
# Free-form query (uses arXiv query syntax)
|
|
324
|
+
results = searcher.search(query="...", max_results=50)
|
|
325
|
+
|
|
326
|
+
# Lookup by ID
|
|
327
|
+
papers = searcher.get_by_ids(["2309.10668", "2406.04093"])
|
|
328
|
+
|
|
329
|
+
# Download PDF
|
|
330
|
+
searcher.download_pdf("2309.10668", "paper.pdf")
|
|
331
|
+
|
|
332
|
+
# Build query from components
|
|
333
|
+
query = ArxivSearcher.build_query(
|
|
334
|
+
title="sparse autoencoder",
|
|
335
|
+
author="anthropic",
|
|
336
|
+
category="cs.LG"
|
|
337
|
+
)
|
|
338
|
+
results = searcher.search(query=query, max_results=20)
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## Best Practices
|
|
342
|
+
|
|
343
|
+
1. **Respect rate limits**: The API requests 3-second delays between calls. The script handles this automatically.
|
|
344
|
+
2. **Use category filters**: Dramatically reduces noise. `cs.LG` is where most ML papers live.
|
|
345
|
+
3. **Cache results**: Save to JSON to avoid re-fetching.
|
|
346
|
+
4. **Use `sort_by=submittedDate`** for recent papers, `relevance` for keyword searches.
|
|
347
|
+
5. **Max 300 results per query**: arXiv API caps at this. For larger sets, paginate with `start` parameter.
|
|
348
|
+
6. **arXiv IDs**: Use bare IDs (`2309.10668`), not full URLs, in programmatic code.
|
|
349
|
+
7. **Combine with openalex-database**: For citation counts and impact metrics arXiv doesn't provide.
|
|
350
|
+
|
|
351
|
+
## Limitations
|
|
352
|
+
|
|
353
|
+
- **No full-text search**: Only searches metadata (title, abstract, authors, comments)
|
|
354
|
+
- **No citation data**: Use openalex-database or Semantic Scholar for citations
|
|
355
|
+
- **Max 300 results**: Per query. Use pagination for larger sets.
|
|
356
|
+
- **Rate limited**: ~1 request per 3 seconds recommended
|
|
357
|
+
- **Atom XML responses**: The script parses these into JSON automatically
|
|
358
|
+
- **Search lag**: New papers may take hours to appear in API results
|
|
359
|
+
|
|
360
|
+
## Reference Documentation
|
|
361
|
+
|
|
362
|
+
- **API Reference**: See [references/api_reference.md](references/api_reference.md) for full endpoint specs, all categories, and response schemas
|