# Arxiv To Skill Research Workflow

> Lightweight research workflow: search arXiv papers, select valuable ones, generate skills, sync to ai_collection, and update Obsidian wiki. No knowledge graph required. Use for: automated paper research, skill generation from academic papers, research note management, lightweight literature review. Keywords: arxiv research, paper to skill, research automation, skill generation, obsidian research notes, ai_collection sync.

- Skill: `hiyenwong/arxiv-to-skill-research-workflow` (Agent Skill, multi-file: 5 files)
- Install (CLI): `npx get-skill add hiyenwong/arxiv-to-skill-research-workflow`
- Raw SKILL.md: https://api.skillmd.com/api/skills/hiyenwong/arxiv-to-skill-research-workflow/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: hiyenwong (https://skillmd.com/u/hiyenwong)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/hiyenwong/arxiv-to-skill-research-workflow

---


# arXiv to Skill Research Workflow

Lightweight end-to-end workflow for researching arXiv papers, extracting valuable insights, generating skills, and documenting findings in Obsidian.

## Overview

This workflow provides a streamlined alternative to knowledge graph-based research:
- No KG database setup required
- Direct arXiv API access
- Manual paper selection based on value criteria
- Direct skill creation from paper analysis
- Multi-format documentation (skills + Obsidian wiki)

## Trigger Conditions

- Scheduled cron job for neuroscience paper monitoring
- User requests arXiv paper research and skill creation
- Keywords: arxiv, paper search, skill generation, research automation, obsidian wiki update

## Workflow Steps

### Step 1: Search arXiv

**PRIMARY METHOD: Browser-based extraction (Recommended for API rate limits)**

When arXiv API returns HTTP 429 (rate limit) or fails, use browser navigation to access category listing pages directly:

```python
from hermes_tools import browser_navigate, browser_click, browser_snapshot

# Navigate to category recent submissions page
browser_navigate(url="https://arxiv.org/list/q-bio.NC/recent")

# Get structured paper list from snapshot
snapshot = browser_snapshot(full=True)
# Parse entries from DescriptionList elements
# Each entry contains: arXiv ID, title, authors, subjects

# Click specific paper for details
browser_navigate(url="https://arxiv.org/abs/XXXX.XXXXX")
detailed_snapshot = browser_snapshot(full=True)
# Extract abstract, metadata from full page
```

**CRITICAL (2026-05-05)**: `browser_navigate` to arxiv.org URLs now fails with `net::ERR_CONNECTION_CLOSED`. arXiv.org direct navigation is unreliable. **Discovery strategy**: (1) `web_search` for Google-indexed arXiv links, (2) GitHub SNN-Daily-Arxiv (`https://github.com/SpikingChen/SNN-Daily-Arxiv/`) for SNN papers via table JS extraction, (3) Individual `browser_navigate` to `https://arxiv.org/abs/XXXX.XXXXX` for abstracts (single-paper pages work when category listings fail).

**Category pages to use:**
- `https://arxiv.org/list/q-bio.NC/new` - Neurons and Cognition (shows FULL abstracts in snapshot — preferred over `/recent`)
**Category pages to use:**
- `https://arxiv.org/list/q-bio.NC/recent` - Neurons and Cognition
- `https://arxiv.org/list/cs.NE/recent` - Neural and Evolutionary Computing
- `https://arxiv.org/list/cs.LG/recent` - Machine Learning (broad)
- `https://arxiv.org/list/quant-ph/recent` - Quantum Physics
- `https://arxiv.org/list/stat.ML/recent` - Statistics ML (emerging methods)

**WARNING**: Cross-category keyword search via `/search/?query=...` is broken (HTTP 400) as of 2026-05-05. Only use category listing pages.

**IMPORTANT: `/new` vs `/recent`**: The `/new` pages show complete abstracts directly in the `browser_snapshot` text (as `<paragraph>` elements under each entry), while `/recent` pages only show titles/authors/subjects. Use `/new` for paper assessment without needing to navigate to individual `/abs/` pages.

**Multiple sessions per day**: arXiv only updates once daily (new papers appear at ~14:00 ET / ~02:00 UTC). Running multiple cron sessions on the same calendar day yields diminishing returns — afternoon/evening sessions will find the same papers as morning sessions. Consider skipping evening sessions unless monitoring for rapid cross-lists or replacements.
**WARNING (2026-05-04)**: arXiv `/search/?query=...` URLs with multi-term queries (using `+` separators) now return HTTP 400 "Bad Request". The cross-category keyword search URL pattern is **broken**. Use category listing pages exclusively — they remain fully functional.

**Advantage**: Pre-structured, chronological listings with direct links to PDF and HTML versions — more reliable than API when rate-limited.

**CRITICAL (2026-05-03)**: arXiv `/search/?query=...` browser pages now return **400 Bad Request** even for simple queries. Combined with HTTP 429 rate limits on the API, browser-based search is ALSO unreliable. The ONLY reliable discovery method is direct category page browsing (`/list/{category}/recent`). Do NOT waste time on `/search/?query=...` pages or API queries — go straight to category listing pages.

**CRITICAL (2026-05-05)**: arXiv search forms are BROKEN — `/search/?query=...` returns HTTP 400 Bad Request and `/search/advanced` returns "Whoops! Something went wrong" even with valid parameters. Do NOT waste time on arXiv search pages. **Only category listing pages work reliably**: `/list/{category}/recent` (e.g., `/list/q-bio.NC/recent`, `/list/cs.NE/recent`).

**CRITICAL (2026-05-07)**: JS extraction on category listing pages (`/list/{category}/recent`) with dt/dd selectors returns **empty strings** for titles and authors — the `dd.childNodes[0].textContent` is empty in the DOM. Do NOT use JS extraction on category pages at all. Use `browser_snapshot(full=True)` which correctly captures all paper titles, IDs, authors, and subjects as structured text. JS extraction is ONLY reliable on `/search/?query=...` pages (li.arxiv-result elements), but even that can be intermittent — always verify results.

**CRITICAL (2026-05-06)**: JS extraction on search result pages (`/search/?query=...`) is **INTERMITTENTLY UNRELIABLE**. The `li.arxiv-result` DOM sometimes produces incorrect titles or empty fields. When it works, the improved recipe below extracts IDs, titles, authors, AND abstracts — but fallback to `browser_snapshot(full=True)` if results look garbled. Category pages (`/list/{category}/recent`) remain the most reliable method.

**Improved JS extraction recipe** (verified working 2026-05-06 on search result pages — use if snapshot parsing is insufficient):
```javascript
(() => {
  const results = document.querySelectorAll('li.arxiv-result');
  const papers = [];
  results.forEach(li => {
    const idEl = li.querySelector('a[href*="abs/"]');
    const id = idEl ? idEl.href.split('/').pop() : '';
    const allP = li.querySelectorAll('p');
    let title = '', authors = '', abstract = '';
    allP.forEach(p => {
      const t = p.textContent.trim().replace(/\s+/g, ' ');
      if (!t.startsWith('Authors:') && !t.startsWith('Submitted') && !t.startsWith('Abstract:') && !title) { title = t; }
      if (t.startsWith('Authors:')) { authors = t.replace('Authors:', '').trim().substring(0, 150); }
      if (t.startsWith('Abstract:')) { abstract = t.substring(9).trim().substring(0, 300); }
    });
    papers.push({ id, title, authors, abstract });
  });
  return JSON.stringify(papers);
})()
```
**NOTE**: This improved recipe extracts abstracts in addition to IDs/titles/authors, which is critical for coverage analysis. The older recipe only extracted titles/authors.

**Search URL format**: Use `?query=term1+term2&start=0&order=-announced_date_first`. Avoid `searchtype=all` and `size=20` params — these cause 400 Bad Request errors.

**FALLBACK METHOD: Python urllib** — Only if browser navigation fails (rare):

**CRITICAL: Use `execute_code` with Python `urllib.request` — `web_extract` was historically unreliable for arXiv `/abs/` URLs but **now works reliably** (verified 2026-05-06). Use `web_extract` first; fall back to `urllib` only if it returns empty/blocked content.**

```python
from hermes_tools import terminal
import urllib.request, urllib.parse, ssl, xml.etree.ElementTree as ET, json, time

ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE

def search_arxiv(query, max_results=30):
    params = urllib.parse.urlencode({
        "search_query": query,
        "sortBy": "submittedDate",
        "sortOrder": "descending",
        "max_results": max_results
    })
    url = f"https://export.arxiv.org/api/query?{params}"
    req = urllib.request.Request(url)
    resp = urllib.request.urlopen(req, context=ctx, timeout=30)
    return resp.read().decode("utf-8")
```

**IMPORTANT**: Use `urllib.parse.urlencode()` — manual URL construction with spaces causes "Malformed or illegal URL" errors. XML namespaces: `{"atom": "http://www.w3.org/2005/Atom", "arxiv": "http://arxiv.org/schemas/atom"}`.

**Multiple keyword searches recommended** — run 2-3 queries with different term combinations:
- `all:"neuroscience" AND all:"brain network"`
- `all:"spiking neural network" AND all:"computational"`
- `all:"neural dynamics" AND all:"brain"`

**Important**: Add `time.sleep(3)` between requests to respect arXiv API rate limits.

### Step 1b: Pre-Flight Same-Day Dedup (CRITICAL 2026-05)

**Before running the full workflow, check if today's papers were already scanned in an earlier cron session.** At 738+ skills with multiple daily cron runs, same-day paper batches are frequently rescanned, producing zero-new-skills sessions that waste resources.

```python
import os, re
from datetime import datetime

today = datetime.now().strftime("%Y-%m-%d")
vault = os.environ.get("OBSIDIAN_VAULT_PATH", "/Users/hiyenwong/Documents/Obsidian Vault")
ai_notes = os.path.join(vault, "ai_collection")

# Find all today's research notes
today_notes = [f for f in os.listdir(ai_notes) if f.endswith('.md') and today in f.lower() and 'research' in f.lower()]
if today_notes:
    # Collect all arXiv IDs already documented today
    documented_ids = set()
    for note in today_notes:
        with open(os.path.join(ai_notes, note)) as fh:
            content = fh.read()
        ids = re.findall(r'26\d{2}\.\d{5}', content)
        documented_ids.update(ids)
    
    print(f"Existing same-day sessions: {len(today_notes)}")
    print(f"arXiv IDs already documented today: {len(documented_ids)}")
    
    # After scraping, compare:
    # new_ids = scraped_ids - documented_ids
    # if not new_ids:
    #     print("[SILENT] — all papers already covered in earlier session")
    #     # Skip the rest of the workflow
```

**Decision rule**: If `len(new_ids) == 0` after comparing scraped papers against same-day notes, respond with `[SILENT]` and skip skill creation, Obsidian updates, and report generation entirely.

### Step 2: Filter and Select Papers

From the search results:
1. Deduplicate by arXiv ID (papers appear across multiple queries)
2. **Deduplicate against same-day session notes** (Step 1b above) — if all papers already documented today, output `[SILENT]` and stop
3. Cross-reference paper titles against existing skill directory names in `~/.hermes/skills/ai_collection/` — list directories, normalize names (lowercase, strip hyphens), check for substring matches. This catches papers already covered under different naming conventions.
3. Filter to target date range (e.g., papers from the last 24-48 hours)
### Coverage Analysis** — Calculate coverage metrics:

**CRITICAL (2026-05-05)**: The word-overlap matching alone misses exact-match skills. Use a two-tier approach:

```python
def normalize_for_matching(text):
    stop_words = {'the', 'a', 'an', 'and', 'or', 'but', 'in', 'on', 'at', 'to', 'for', 'of', 'with', 'by', 'using', 'based'}
    words = [w for w in text.lower().replace('-', ' ').replace('_', ' ').split() if w not in stop_words]
    return set(words)

# TIER 1: Direct substring / acronym matching (highest priority)
# Check if paper title contains skill name tokens or vice versa
def direct_match(title, skill_name):
    title_lower = title.lower()
    skill_lower = skill_name.lower().replace('-', ' ').replace('_', ' ')
    # Check for key acronyms or exact phrases
    for token in skill_lower.split():
        if len(token) > 3 and token in title_lower:
            # Also check reverse: title key terms in skill name
            return True
    # Check for known acronyms (e.g., "UniBCI" in skill name "unibci-invasive-foundation-model")
    import re
    title_acronyms = re.findall(r'\b[A-Z]{2,}\b', title)
    for acronym in title_acronyms:
        if acronym.lower() in skill_lower:
            return True
    return False

# TIER 2: Word overlap (for when direct match fails)
for paper in papers:
    title_words = normalize_for_matching(paper['title'])
    matched_skill = None
    
    # Try direct match first
    for skill in existing_skills:
        if direct_match(paper['title'], skill):
            matched_skill = skill
            break
    
    # Fall back to word overlap
    if not matched_skill:
        for skill in existing_skills:
            skill_words = normalize_for_matching(skill)
            # Weight key neuroscience terms higher
            key_terms = {'spiking','brain','neural','network','hopfield','attractor',
                        'reservoir','free','energy','criticality','quantum','modality','bci'}
            common = title_words & skill_words
            key_matches = common & key_terms
            if len(key_matches) >= 2 or len(common) >= 3:
                matched_skill = skill
                break

coverage_rate = already_covered / len(papers) * 100
# >90% = high maturity, >98% = extreme maturity
```

**Observed misses from word-overlap-only matching** (2026-05-05):
- "UniBCI: Towards a Unified Pretrained Model for Invasive BCI" → missed `unibci-invasive-foundation-model` (acronym mismatch)
- "Geometric analysis of attractor boundaries in kernel Hopfield networks" → missed `kernel-hopfield-associative-memory` (word order differs)
- "Attractor FCM" → missed `attractor-fcm-gradient-descent` (too short for 2-word overlap)
       elif best_overlap >= 2:
           # Verify with manual substring check
           covered = any(kw in paper['title'].lower() for kw in matched_skill.replace('-', ' ').split() if len(kw) > 3)
   
   coverage_rate = already_covered / len(papers) * 100
   # >90% = high maturity, >95% = extreme maturity, >98% = near-saturation
   ```
5. **Value-Based Prioritization** — For uncovered papers, implement scoring:
   ```python
   value_factors = []
   if 'brain' in paper['title'].lower(): value_factors.append("Brain focus")
   if 'spiking' in paper['abstract'].lower(): value_factors.append("Neural dynamics")
   if 'digital twin' in paper['title'].lower(): value_factors.append("Digital twins")
   
   score = len(value_factors) * 10
   # Bonus for interdisciplinary/high-impact topics
   if 'digital twin' in paper['title'].lower(): score += 30
   if 'active inference' in paper['abstract'].lower(): score += 25
   
   # Priority: HIGH (>=50), MEDIUM (30-49), LOW (<30)
   ```
6. Select top 8-12 papers based on priority score and coverage analysis

### Step 3: Extract Paper Content

For each selected paper:
1. Use `web_extract` with the arXiv abstract page (`https://arxiv.org/abs/XXXX.XXXXX`)
2. Also try the PDF if abstract is insufficient: `https://arxiv.org/pdf/XXXX.XXXXX`
3. Extract: title, authors, key methodology, core contribution, practical applications

### Step 4: Check for Existing Skills

Before creating, check if a skill already exists:
- Search `~/.hermes/skills/ai_collection/` for similar topics
- Use `skills_list` to check registered skills
- Skip papers that map to existing skills (note them in the report)

### Step 5: Create Hermes Skills

**Decide skill placement** before creating:
- **ai_collection domain**: Neuroscience, SNN, brain networks, computational neuroscience → `~/.hermes/skills/ai_collection/<skill-name>/`
- **Standalone domain**: Quantum computing, control systems, systems engineering, or other distinct fields → `~/.hermes/skills/<skill-name>/` (top-level)
### Step 5: Create Hermes Skills

**PREFERRED: `skill_manage(action="create")`** — auto-creates directories, validates structure.
**ALTERNATIVE: `write_file`** directly at `/Users/hiyenwong/.openclaw/workspace/ai_collection/<skill-name>/SKILL.md` — reliable, direct. The ai_collection is at `.openclaw/workspace/ai_collection/`, NOT `~/.hermes/skills/ai_collection/`.
**ALTERNATIVE: `delegate_task`** — works for parallel skill creation when multiple skills needed simultaneously (confirmed working 2026-05-05). Provide the target skill path and full SKILL.md content in the task context.

For each new skill, create a SKILL.md with this structure:

1. **YAML frontmatter MUST include `description`**:
   ```yaml
   ---
   name: skill-name
   description: "Short description of what the skill does."
   version: 1.0.0
   ---
   ```

2. **Paper-based skills MUST include `**arXiv ID:**` format** (not `**arXiv:**`):
   ```markdown
   **arXiv ID:** 2604.20209 | **Code:** https://github.com/...
   ```

3. **Paper-based skills MUST have `## Abstract` and `## Key Contributions` sections**

4. **No line exceeding 120 characters** — break long lines

5. **Location**: `ai_collection/collection/skills/<skill-name>/SKILL.md` (note: `collection/skills/` not just `skills/`)
   - The root `skills/` directory exists but the validator checks `collection/skills/`
   - After creating in `skills/`, copy to `collection/skills/` for validation

For each new skill, create a SKILL.md with this structure:

```markdown
---
name: skill-name
description: "Short description of the methodology. Activation triggers: keyword1, keyword2, keyword3."
---

# Skill Title

> One-line summary of the paper's contribution and methodology.

## Metadata
- **Source**: arXiv:XXXX.XXXXX
- **Authors**: Author names
- **Published**: YYYY-MM-DD

## Core Methodology

### Key Innovation
Description of what's novel.

### Technical Framework
Step-by-step technical description.

## Implementation Guide

### Prerequisites
- Required tools/libraries

### Step-by-Step
1. Concrete implementation steps

### Code Example
\`\`\`python
# Minimal working example
\`\`\`

## Applications
- Use case 1
- Use case 2

## Pitfalls
- Known limitations

## Related Skills
- related-skill-1
- related-skill-2
```

**Naming convention**: Use lowercase, hyphenated names: `topic-method-detail`
**Location**: `~/.hermes/skills/ai_collection/<skill-name>/SKILL.md`

### Step 6: Update Obsidian Wiki

**Vault paths to check** (in priority order):
1. `/Users/hiyenwong/obsidian_notes/neuroscience/` — neuroscience weekly reports (Chinese format)
2. `OBSIDIAN_VAULT_PATH` env var
3. `/Users/hiyenwong/Documents/Obsidian Vault` — default fallback
4. `/Users/hiyenwong/Workspace/obsidian/` — alternative workspace

**Weekly Chinese Report Format** (established pattern at `/Users/hiyenwong/obsidian_notes/neuroscience/神经科学研究周报-YYYY-MM-DD.md`):
- YAML frontmatter: `date`, `type: weekly-report`, `area: neuroscience`, `source: arxiv`
- Sections: 概览 (overview with stats), 精选论文 (detailed paper analysis, 6-7 papers), 其他值得关注论文 (3-4 shorter summaries), 本周技能更新汇总 (table), 趋势观察 (6 numbered trends)
- Each paper entry: arXiv ID, date, category, authors, 研究问题, 核心贡献, 关键发现/方法学, 对应技能
- Language: Chinese for report content, English for technical terms, code, and equations
- `Quantum Computing Research/Quantum Computing Index.md` — domain index
- `Skills/Quantum/<skill-name>.md` — domain-specific skill notes
- `Research Logs/Quantum Computing Research - YYYY-MM-DD.md` — daily logs

This keeps the vault organized by research domain. The ai_collection folder remains neuroscience-focused.

**Vault path**: Check `OBSIDIAN_VAULT_PATH` env var. Also check these common locations in order: `/Users/hiyenwong/obsidian_notes/` (actual vault, 2026-05 confirmed), `/Users/hiyenwong/obsidian-vault/`, `/Users/hiyenwong/Workspace/obsidian/`, `/Users/hiyenwong/ai_github/obsidian_wiki/`, then default `/Users/hiyenwong/Documents/Obsidian Vault`. Verify by checking for `.obsidian/` directory inside.

**Use `execute_code` with Python** for vault file operations — cleaner string handling than terminal commands.

#### 6a: Create Daily Research Note
- Path: `ai_collection/neuroscience-research-YYYY-MM-DD[-session].md`
- Content: Date, scan summary, paper list with links, key findings, trends
- Use `-late` or `-morning` suffix if multiple sessions per day
- **Include coverage analysis**: Papers scanned, recent papers count, coverage rate, new skills created, covered papers list, research trends

#### 6b: Create Individual Skill Notes
- Path: `ai_collection/<skill-name>.md`
- Content: Skill metadata, methodology summary, links to arXiv and SKILL.md
- **Structure**: Include YAML frontmatter with tags, source arXiv link, core methodology summary, applications list, implementation link, and related skills wikilinks
- **Purpose**: Quick reference notes that link to full skill implementation and daily research notes

**Example Skill Note Structure**:
```markdown
---
tags: [brain-digital-twins, execution-semantics, arxiv-XXXX.XXXXX]
---

# Skill Title

> One-line summary

## Source
- **arXiv**: [XXXX.XXXXX](https://arxiv.org/abs/XXXX.XXXXX)
- **Published**: YYYY-MM-DD

## Core Methodology
Brief description...

## Applications
- App 1
- App 2

## Implementation
See full guide in: `~/.hermes/skills/ai_collection/<skill-name>/SKILL.md`

## Related
- [[related-skill-1]]
- [[Neuroscience Research - YYYY-MM-DD - Cron Job Update]]
```

#### 6c: Update INDEX.md
- Increment total skill count
- Update timestamp
- Add new entries to the skills list

#### 6d: Update Neuroscience Research MOC
- Add session row to the session history table
- Add new papers to relevant thematic sections
- Create new thematic sections if needed (e.g., "Neuromorphic Hardware & Devices")
- Update trend analysis

**MOC Update Pattern (3 separate patches required):**
1. Daily table row: Insert `| [[daily-note-name|YYYY-MM-DD]] | N | N | themes |` into the **Research Sessions** table (NOT the Research Statistics table). The MOC has TWO tables — the Statistics table (lines ~10-17) has a different column structure. The Sessions table has columns `| Date | Papers | New Skills | Key Themes |`. Find the `|------|--------|------------|------------|` separator and insert the new row immediately after it.
2. Thematic section: Add bullet entry under the matching `### Theme Name` section with wikilink to daily note
3. Latest Skills section: Add `#### skill-name` header + summary entry at the end of the file

**MOC structure** (800+ line file as of 2026-05, ~56KB):
- Lines 1-5: Frontmatter
- Lines 7-17: Title + Research Statistics table (2-column: Metric | Count)
- Lines 19-43: Research Sessions table (4-column: Date | Papers | New Skills | Key Themes)
- Lines 45-800+: Research Themes sections by topic
- Final section: Latest Skills

**CRITICAL**: Do NOT insert daily rows into the Statistics table (2-column) — it will corrupt the MOC layout. Always target the Sessions table (4-column with `| Date | Papers | New Skills | Key Themes |` header).

## Support Files

- **references/arxiv-browser-parsing-patterns.md** — Confirmed parsing patterns for arXiv browser_snapshot output on category and search pages (updated 2026-05-06)

## Key Learnings (from production runs)

### ai_collection CI Validation (2026-05-04)
The CI pipeline (`validate.yml`) enforces strict validation on new skills. See `references/ai-collection-ci-validation.md` for full details. Key requirements:
- `description` in YAML frontmatter (required, causes failure if missing)
- `**arXiv ID:**` format in body (not `**arXiv:**`)
- `## Abstract` and `## Key Contributions` sections for paper skills
- Line length < 120 characters
- File must be in `collection/skills/` (not root `skills/`)

**Note**: CI has pre-existing lint failures in older Python scripts — new markdown-only skills don't cause these. If CI fails on `Lint Python Scripts`, it's likely a pre-existing issue, not your change.

### Tool Selection
### Tool Selection
- **write_file** for skill creation at `~/.hermes/skills/<skill-name>/SKILL.md` — reliable, direct
- **execute_code** for Obsidian vault manipulation — Python's string operations handle markdown cleanly
- **terminal** for file discovery, reading existing content, and git operations
- **web_search** for initial paper discovery — NOTE: Increasingly returns empty results for academic queries (e.g., "arxiv neuroscience brain network" returned 0 results on 2026-05-04). Still worth trying as first-pass, but do NOT rely on it. Browser category page scraping (`/list/{category}/recent`) remains the most reliable discovery method
- **web_extract** for arXiv content — NOTE: Returns "Blocked: URL targets a private or internal network" for many arXiv URLs (new failure mode observed 2026-05). Also returns empty content for `/abs/` URLs. When web_extract fails, fall back to browser navigation
- **browser_navigate + browser_snapshot** for arXiv scraping — `browser_snapshot(full=True)` is the ONLY reliable method for arXiv content. Returns structured text with arXiv IDs, titles, authors, and subjects. JS extraction via `browser_console` is UNRELIABLE on both category pages AND search result pages (confirmed 2026-05-06) — do NOT use it. **Parallel browser_navigate**: Launch for multiple category pages (q-bio.NC + cs.NE) simultaneously before snapshotting — both load concurrently, cutting discovery time in half.
- **Parallel browser_navigate**: Launch `browser_navigate` for multiple category pages (e.g., q-bio.NC + cs.NE) simultaneously before snapshotting — both pages load concurrently, cutting discovery time in half
- **cp -r with mkdir -p** for syncing skills to ai_collection — cp -r silently fails on some directories; always `mkdir -p` target first
- See `references/arxiv-access-failure-modes.md` for comprehensive list of all documented arXiv access failure modes (429, Blocked, 400 Bad Request, empty httpx responses)

### Common Pitfalls
1. **delegate_task for skill creation**: Does NOT work reliably — use `skill_manage(action="create")` (preferred, auto-creates directories) or `write_file` directly
2. **arXiv rate limits**: Worsened significantly (2026-04+). **Minimum 15-second delay** between sequential API queries is required — 5-second delays produce consistent 429 errors. For cron/bulk scans: use `time.sleep(15)` between queries. If using Python `httpx` in `execute_code`, add 15s delay AND `timeout=30`. If rate-limited, switch to browser-based scraping (see Step 1 browser method). Some query patterns may permanently fail during high-traffic periods — implement 3 retries with 30s backoff, then fall back to broader queries or browser navigation.. **2026-05 update**: All 5 queries in a single batch can hit 429 simultaneously. Use `wait = 4 * (attempt + 1)` (4s, 8s, 12s) between retries. When ALL queries are rate-limited, wait 60+ seconds before retrying the entire batch.
3. **web_extract "Blocked" error**: `web_extract` consistently returns "Blocked: URL targets a private or internal network" for arXiv URLs since 2026-05. This is a new failure mode beyond rate limits. When this happens, use `browser_navigate` + `browser_snapshot` + `browser_console` (JS extraction) instead — this is the most reliable method for arXiv content
4. **`httpx` in `execute_code` returns empty responses INTERMITTENTLY**: `httpx.get()` against arXiv API from within `execute_code` sandbox sometimes returns 0-byte responses (no error, just empty) — but it ALSO works reliably on many sessions (2026-05-05: full data for 11 papers). Always try `httpx` first (fastest when it works), but have `web_search` → `terminal` + `curl` + HTTPS fallback ready. If `httpx` response length < 100, immediately switch to fallback.
4. **curl requires HTTPS for arXiv API**: Terminal `curl` to `http://export.arxiv.org/api/query` triggers security scan approval prompt. Always use `https://export.arxiv.org/api/query` to avoid interactive approval blocking cron jobs.
3. **arXiv search URL 400 errors**: The `/search/?query=...` endpoint frequently returns "400 Bad Request" for complex multi-term queries. Category listing pages (`/list/{category}/recent`) are **always more reliable** — use them as the primary discovery method. Only use search pages for targeted keyword exploration when category pages don't surface relevant papers.
3. **Deduplication**: Papers appear in multiple keyword searches; dedupe by arXiv ID
4. **execute_code state persistence**: State does NOT persist between `execute_code` calls. Save intermediate data to `/tmp/` files (e.g., `papers_data.json`, `paper_details.json`) and reload in subsequent calls. Without this, accumulated search results will be lost between steps.
4. **Vault path**: Always check env var first; don't hardcode
5. **Session naming**: Use time-of-day suffix when running multiple sessions per day
6. **Existing skills**: Always check before creating — some papers were already covered. Use `ls ~/.hermes/skills/ai_collection/` and normalize names for coverage detection
7. **INDEX.md corruption**: INDEX.md can silently corrupt during writes — skill count can drift by 200+ from actual (observed: INDEX.md said 477, actual was 697). Always verify count with Python before reporting. See `references/index-rebuild-utility.py` for automated rebuild script.
8. **`read_file` unreliability**: Hermes `read_file` returns double-numbered lines (`     1|     1|content`) — unreliable for parsing. Use Python `open()` directly for file content manipulation
9. **Cron execution pattern**: When running as scheduled job, use `execute_code` with Python (not terminal+curl) for better reliability. Save state to `/tmp/` between steps. Handle partial failures gracefully — if some queries fail, continue with successful ones.
10. **MOC patching requires 3 separate operations**: (1) Daily table row insertion, (2) Thematic section bullet addition, (3) Latest Skills section header+summary append. Each requires reading current content and precise positioning.
11. **Mature collection adaptation**: When >90% papers have existing skills (typical after 90+ skills), expand keyword scope or add new domains rather than expecting many new skills per session.
12. **Date filtering**: Papers returned may have dates in the future relative to system time. Use flexible date ranges (30 days) and sort by published date to get truly recent papers.
13. **Empty search results**: If queries return 0 papers in target date range, expand search to all recent papers regardless of date and filter post-hoc.
- **Standalone neuroscience skills fully synced** (2026-05-05): All neuroscience standalone skills have been synced to ai_collection (0 remaining). Earlier notes about "~130 pending neuroscience skills" are obsolete. The 142 remaining standalone skills are non-neuroscience (devops, quantum, control systems, web dev, etc.).
- **Leverage cached search results**: Previous cron runs may have saved papers to `/tmp/` files (e.g., `/tmp/arxiv_papers.json`, `/tmp/neuro_papers_v3.json`). If arXiv API is rate-limited or failing, scan `/tmp/*.json` for existing paper data before attempting new queries — this can save significant time and avoid API blocks.
15. **Coverage detection via title normalization**: When checking if papers are already covered, normalize both paper titles AND skill names by removing punctuation, lowercasing, and splitting into word sets. Check for intersection of 2+ common words between title and skill name for robust matching across naming conventions. **CRITICAL FIX (2026-05-06)**: At 700+ skills, word-overlap alone returns FALSE 0% coverage because paper titles use natural language while skill names use abbreviated hyphenated identifiers. MUST implement a second tier: regex keyword mapping (paper title patterns → skill names) to catch these mismatches. Without Tier 2, coverage check reports 0% even when 100% of papers are covered. **CAUTION at 700+ skills**: Word-overlap matching produces false positives (e.g., ShiftLIF paper matched to `neuron-photonic-spiking-laser` because both share 'spiking' + 'neural' keywords). Always do a second pass with exact keyword matching (e.g., `shiftlif` in skill name → `shiftlif-power-of-two-quantization`). Priority order: (1) exact arXiv ID match in existing skill, (2) exact keyword match (unique term from title present in skill name), (3) word-overlap matching.
16. **Paper scoring for selection**: Implement relevance scoring based on keyword frequency weighted by importance. Example scoring for neuroscience:
    ```python
    keywords = {'spiking neural network': 5, 'brain network': 4, 'neural dynamics': 4}
    score = sum(text.count(kw) * weight for kw, weight in keywords.items())
    ```
    This helps prioritize high-value papers when collection is mature.
17. **Standalone-to-ai_collection sync**: Skills may exist as standalone directories in `~/.hermes/skills/` but not yet in `ai_collection/`. Check both locations. Use `shutil.copytree()` to sync. The INDEX.md entry may reference a standalone skill that hasn't been copied to ai_collection yet.
18. **Standalone duplicate detection pattern**: When standalone skills have names very similar to existing ai_collection skills (e.g., `fc-guided-band-selection-bci` vs `fc-guided-band-selection-mi-bci`, or `saliency-aware-eeg-decoding` vs `simon-saliency-neural-decoding`), they are almost always near-identical duplicates covering the same paper. Check the first 3 lines of both SKILL.md files to confirm. If confirmed, skip the sync — no value in duplicating. At 714+ skills in ai_collection, most remaining standalone neuroscience skills are either duplicates or very tangential topics.

**Dual-directory sync (ai-collection vs ai_collection)**: There are TWO parallel directories:
- `~/.hermes/skills/ai-collection/` (hyphen) — curated subset (~27 skills)
- `~/.hermes/skills/ai_collection/` (underscore) — full collection (700+ skills)
Skills created in one don't appear in the other. `skill_manage(action='create')` targets the MAIN skills dir only. Use `shutil.copytree()` for cross-directory sync. Check both directories when determining if a skill already exists.

18. **`skill_manage` path limitations**: `skill_manage(action='create')` creates skills in `~/.hermes/skills/` (main dir), NOT in `ai_collection/`. When creating skills for the ai_collection, use `write_file` to write directly to `~/.hermes/skills/ai_collection/<name>/SKILL.md`.
18. **Skip evaluation criteria**: At high coverage rates (85%+), not every uncovered paper warrants a skill. Skip papers that are: (a) too narrow/specific (e.g., single-dataset validation, specific neuroanatomy like hippocampal place cells or cerebellar motor learning), (b) conceptually overlapping with existing skills (e.g., new Hamiltonian method when energy-based/physics-guided skills exist), (c) review/perspective papers with no extractable methodology, **(d) empirical/observational studies reporting neural correlates without computational methodology** (e.g., "ACC-Insula connectivity correlates with anxiety severity" — reports findings but introduces no reusable algorithm, framework, or analytical method), **(e) HCI/eye-tracking focused papers when the collection targets computational neuroscience methodology** (e.g., confidence-based line assignment in reading gaze data), **(f) non-neuroscience optimization/multi-agent papers** (e.g., distributed black-box consensus optimization), **(h) incremental robustness fixes** to existing frameworks (e.g., HGF Lambert W function fix to avoid negative posterior precision - a bug fix, not a new methodology), **(i) theoretical/conceptual papers** without concrete methodology (e.g., AGI papers on measuring understanding that propose philosophical frameworks without extractable algorithms), **(j) toy/demo environment papers** — papers demonstrating methodologies in game-like or toy environments (e.g., Minecraft navigation, simple simulations) where the underlying methodology is already covered by existing skills. Document skip reasons in the daily research note.

**Skip taxonomy** (from 2026-05-05 session at 729 skills):
- `too_narrow`: Application-specific with no generalizable method (Minecraft navigation)
- `incremental_fix`: Bug fix or robustness patch to existing framework (HGF volatility fix)
- `review_paper`: Literature review without new methodology (EEG/EMG neural regeneration review)
- `theoretical`: Philosophical/conceptual without extractable algorithms (AGI understanding measurement)
- `too_generic`: Insufficient abstract + generic title, likely covered (generic EEG/ML+neuro papers)
19. **Extreme maturity skip patterns** (700+ skills): At this scale, the skip-to-create ratio approaches 1:1 or higher. In a 57-paper session, expect ~4-8 skippable papers among uncovered ones. Common skip categories: theoretical neurobiology without computational methodology (murburn-thermodynamic), HCI applications (gaze tracking), non-neuroscience optimization (distributed consensus), narrow neuroanatomy without generalizable methodology, and **integration/benchmark papers where ablation shows simpler is better** (MPCS: 11 mechanisms → removing 2 yields best Perf at 4.7x lower compute). When the collection reaches 700+ skills, the workflow should prioritize skip evaluation quality over creation volume. **New skills at 700+ skills primarily come from mathematical formalism papers** (e.g., RG theory, universal approximation theorems) applied to neuroscience rather than domain-specific methodology papers — these cross-domain formalism transfers are the remaining gap.
19. **Same-day category scan coverage**: Scanning q-bio.NC or cs.NE category pages on the day of submission (or within 1-2 days) produces much lower coverage rates (~40-50%) compared to delayed scans (~80-100%). This is expected — same-day scans catch papers before any previous session has filtered them. A low coverage rate on a same-day scan does NOT indicate collection regression; it indicates the scan is catching genuinely fresh papers.
20. **Large file timeouts** (2026-05-05): `execute_code` times out at 300s on large Obsidian files (>50KB, 800+ lines). `read_file` with `limit`/`offset` pagination is slow on large files. **Solution**: Use `patch` for targeted updates — read only the relevant section via `read_file` with small `limit` (10-30 lines), then patch. For statistics updates, read just the frontmatter and first 20 lines. Never load the entire MOC or INDEX.md in a single `execute_code` call.
21. **Browser timeout on arXiv search URL** (2026-05-05): `browser_navigate` to `https://arxiv.org/search/?query=...` can timeout at 60s. **Solution**: Prefer category listing pages (`/list/{category}/recent`) which are faster and more reliable. If search page is needed, reduce `size=25` and retry once on timeout.
18. **Skip evaluation criteria**: At high coverage rates (85%+), not every uncovered paper warrants a skill. Skip papers that are: (a) too narrow/specific (e.g., single-dataset validation), (b) conceptually overlapping with existing skills (e.g., new Hamiltonian method when energy-based/physics-guided skills exist), (c) review/perspective papers with no extractable methodology. Document skip reasons in the daily research note.
19. **cs.NE domain drift** (2026-05 observed): cs.NE category increasingly publishes LLM-related papers (evolutionary optimization, jailbreak generation, explainability) rather than neuroscience-focused work. When scanning cs.NE, filter aggressively — only papers with SNN, neural dynamics, brain-inspired, or neuroscience keywords warrant analysis. Expect 30-50% of cs.NE papers to be non-neuroscience at scale. See `references/cs-ne-domain-drift.md` for detailed analysis and filtering code.
19. **Standalone sync via SKILL.md keyword scanning**: At 700+ skills, name-based matching alone misses standalone skills. Scan `~/.hermes/skills/<skill>/SKILL.md` content for neuroscience-related keywords (neural, brain, spiking, eeg, fmri, synaptic, neuromorphic, oscillation, attractor, hebbian, plasticity, astrocyte, memristive) to find skills that should be synced to ai_collection. Name matching found 0 candidates; keyword scanning found 2 (equation-free-digital-twins, quantum-medical-ai).
20. **Coverage sweet spot at 700-800 skills**: At this scale, coverage typically runs 80-95%. New skills still emerge from interdisciplinary boundaries (math.DS → neuroscience, cs.NE → computer vision, quantum → medical). The standalone sync pipeline (checking for neuroscience keywords in standalone SKILL.md files) becomes as valuable as new paper monitoring.

### Cron Execution Output Format

When runnin

…(truncated)
