sessions
Use aiwg sessions to manage the normalized session catalog, imports, analytics, and authorized forensic evidence with versioned JSON
Acquire research papers from acquisition queue, download PDFs, validate integrity, and organize artifacts
$ npx -y skills add jmagly/aiwg --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
/research-acquireContext preview
What this command does when you run it.
Acquire research papers from acquisition queue, download PDFs, validate integrity, and organize artifacts
description: Acquire research papers from acquisition queue, download PDFs, validate integrity, and organize artifacts category: research-management argument-hint: [--queue <file>] [--doi <identifier>] [--all] [--validate-only] allowed-tools: Bash, Read, Write, Grep, Glob model: claude-sonnet-4-6
Download and validate research papers from acquisition queue. Retrieves PDFs from open access sources, institutional repositories, or DOI resolvers. Validates file integrity and organizes artifacts for documentation.
When invoked with `/research-acquire [options]`:
1. **Load** acquisition queue (from discovery or manual DOI list) 2. **Resolve** DOI URLs to PDF download locations 3. **Download** PDFs with retry logic and validation 4. **Verify** file integrity (checksum, PDF validity) 5. **Organize** files in `.aiwg/research/papers/` 6. **Update** acquisition status and metadata
# Read queue from discovery or custom file
QUEUE_FILE="${1:-.aiwg/research/discovery/acquisition-queue.json}"
if [ ! -f "$QUEUE_FILE" ]; then
echo "Error: Acquisition queue not found: $QUEUE_FILE"
echo "Run /research-discover first to create queue"
exit 1
fi
# Parse paper list
PAPERS=$(jq -r '.papers[] | select(.status == "pending") | .paper_id' "$QUEUE_FILE")
TOTAL=$(echo "$PAPERS" | wc -l)
echo "Acquisition queue: $TOTAL papers pending"// DOI resolution strategy (priority order)
async function resolveDOI(doi: string): Promise<string> {
// 1. Check Unpaywall API for open access PDFs
const unpaywall = await fetchUnpaywall(doi);
if (unpaywall.bestOaLocation?.pdfUrl) {
return unpaywall.bestOaLocation.pdfUrl;
}
// 2. Try DOI.org resolver (may redirect to publisher)
const doiUrl = `https://doi.org/${doi}`;
const response = await fetch(doiUrl, { redirect: 'follow' });
if (response.ok && isPDF(response)) {
return response.url;
}
// 3. Check arXiv if paper has arXiv ID
const arxivId = extractArxivId(doi);
if (arxivId) {
return `https://arxiv.org/pdf/${arxivId}.pdf`;
}
// 4. Check institutional repositories (if configured)
const institutional = await checkInstitutionalRepos(doi);
if (institutional) {
return institutional;
}
throw new Error(`No open access PDF found for DOI: ${doi}`);
}**Security Note**: Download URLs from trusted sources only (Unpaywall, arXiv, DOI.org). Validate file integrity.
bash <<'EOF'
# Download paper PDF
DOI="10.1145/example"
PAPER_ID="abc123def456"
PDF_URL=$(resolve_doi "$DOI")
# Download with retry
for i in {1..3}; do
curl -L -o ".aiwg/research/papers/${PAPER_ID}.pdf" "$PDF_URL" && break
echo "Download failed, retry $i/3..."
sleep 5
done
# Validate PDF integrity
if ! file ".aiwg/research/papers/${PAPER_ID}.pdf" | grep -q "PDF"; then
echo "Error: Downloaded file is not a valid PDF"
rm ".aiwg/research/papers/${PAPER_ID}.pdf"
exit 1
fi
# Compute checksum
sha256sum ".aiwg/research/papers/${PAPER_ID}.pdf" > ".aiwg/research/papers/${PAPER_ID}.sha256"
echo "✓ Acquired: ${PAPER_ID}.pdf"
EOF{
"paper_id": "abc123def456",
"doi": "10.1145/example",
"title": "OAuth 2.0 Security Best Practices",
"authors": ["Smith, J.", "Doe, A."],
"year": 2023,
"venue": "ACM CCS",
"acquired_date": "2026-01-25T10:30:00Z",
"source_url": "https://doi.org/10.1145/example",
"pdf_path": ".aiwg/research/papers/abc123def456.pdf",
"checksum_sha256": "abc123...",
"file_size_bytes": 2048576,
"status": "acquired"
}// Mark paper as acquired in queue
function updateQueue(paperId: string, status: 'acquired' | 'failed') {
const queue = JSON.parse(fs.readFileSync(QUEUE_FILE, 'utf-8'));
const paper = queue.papers.find(p => p.paper_id === paperId);
if (paper) {
paper.status = status;
paper.acquired_date = new Date().toISOString();
}
fs.writeFileSync(QUEUE_FILE, JSON.stringify(queue, null, 2));
}# Download all pending papers aiwg research acquire --all
**Output**:
Acquisition queue: 10 papers pending Acquiring papers... ✓ [1/10] abc123def456 - OAuth 2.0 Security Best Practices ✓ [2/10] def456ghi789 - Token Refresh Vulnerabilities ✗ [3/10] ghi789jkl012 - No open access PDF found ✓ [4/10] jkl012mno345 - PKCE Extension for OAuth 2.0 ... Summary: Acquired: 8 papers Failed: 2 papers (no open access) Total size: 45.2 MB Failed papers: - ghi789jkl012: No open access PDF - xyz789abc123: Publisher paywall Next steps: - Review acquired papers: ls .aiwg/research/papers/ - Document papers: /research-document
# Download specific paper aiwg research acquire --doi 10.1145/3491102.3501874
**Output**:
Resolving DOI: 10.1145/3491102.3501874 ✓ Found open access PDF via Unpaywall ✓ Downloaded: abc123def456.pdf (2.1
Reusable project context and specialist workflows for the AI tools you already use. Plan software, coordinate specialist reviews, prepare campaigns, investigate incidents, organize research, curate media, and maintain operational knowledge.
Repo: jmagly/aiwg
Use aiwg sessions to manage the normalized session catalog, imports, analytics, and authorized forensic evidence with versioned JSON
Route plain-language dataset work to governed AIWG dataset orchestration
Guide schema discovery, authoring, validation, compatibility, and projections
**Date**: 2026-01-25 **Status**: Complete **Owner**: Requirements Analyst **Team**: Research Framework
Package, version, and backup research artifacts following OAIS standards
Format citations, back claims with evidence, and build citation networks