document-inventory
Scan and catalog document collections with metadata extraction, categorization, and statistics. Use for auditing document libraries, preparing for knowledge base creation, or understanding large file collections.
Best use case
document-inventory is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Scan and catalog document collections with metadata extraction, categorization, and statistics. Use for auditing document libraries, preparing for knowledge base creation, or understanding large file collections.
Teams using document-inventory should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/document-inventory/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How document-inventory Compares
| Feature / Agent | document-inventory | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Scan and catalog document collections with metadata extraction, categorization, and statistics. Use for auditing document libraries, preparing for knowledge base creation, or understanding large file collections.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Document Inventory
## Overview
This skill scans document collections (PDFs, Word docs, text files) and creates a structured inventory with metadata, automatic categorization, and collection statistics. Essential first step before building knowledge bases.
## Quick Start
```python
from pathlib import Path
import sqlite3
# Scan directory
documents = []
for filepath in Path("/path/to/docs").rglob("*.pdf"):
documents.append({
'filename': filepath.name,
'size': filepath.stat().st_size,
'path': str(filepath)
})
# Store in database
conn = sqlite3.connect("inventory.db")
cursor = conn.cursor()
cursor.execute("CREATE TABLE IF NOT EXISTS docs (name TEXT, size INTEGER, path TEXT)")
for doc in documents:
cursor.execute("INSERT INTO docs VALUES (?, ?, ?)",
(doc['filename'], doc['size'], doc['path']))
conn.commit()
print(f"Inventoried {len(documents)} documents")
```
## When to Use
- Auditing large document libraries before processing
- Understanding the scope of a document collection
- Categorizing documents by type, source, or content
- Preparing inventories for knowledge base creation
- Generating reports on document collections
- Identifying duplicates or organizing files
## Features
- **Recursive scanning** - Process nested directories
- **Metadata extraction** - Size, dates, page counts
- **Auto-categorization** - Pattern-based classification
- **Statistics generation** - Collection summaries
- **SQLite storage** - Queryable inventory database
- **Multiple formats** - PDF, DOCX, TXT, and more
## Implementation
### Core Inventory Builder
```python
#!/usr/bin/env python3
"""Document inventory builder."""
import sqlite3
import os
from pathlib import Path
from datetime import datetime
import logging
*See sub-skills for full details.*
### CLI Interface
```python
#!/usr/bin/env python3
"""Document Inventory CLI."""
import argparse
import json
def main():
parser = argparse.ArgumentParser(description='Document Inventory Tool')
subparsers = parser.add_subparsers(dest='command', help='Commands')
*See sub-skills for full details.*
### Report Generator
```python
def generate_report(db_path, output_path):
"""Generate HTML inventory report."""
inventory = DocumentInventory(db_path)
stats = inventory.get_statistics()
html = f"""
<!DOCTYPE html>
<html>
<head>
*See sub-skills for full details.*
## Custom Categorization
### Extend with Your Patterns
```python
# Add custom patterns for your domain
CUSTOM_PATTERNS = {
'SPEC': 'Specifications',
'DWG': 'Drawings',
'REV': 'Revisions',
'APPROVED': 'Approved',
'DRAFT': 'Draft',
'SUPERSEDED': 'Superseded',
}
*See sub-skills for full details.*
### Multi-Level Categories
```python
def categorize_hierarchical(filepath):
"""Create hierarchical categories."""
name = filepath.name.upper()
# Primary category
primary = 'General'
if 'API' in name:
primary = 'API Standards'
elif 'ISO' in name:
*See sub-skills for full details.*
## Example Usage
```bash
# Scan directory
python inventory.py scan /path/to/documents --db inventory.db
# View statistics
python inventory.py stats --db inventory.db
# Search
python inventory.py search "API" --category "Standards"
# Export to CSV
python inventory.py export inventory.csv --db inventory.db
```
## Related Skills
- `knowledge-base-builder` - Build searchable database after inventory
- `pdf/text-extractor` - Extract text from inventoried PDFs
- `semantic-search-setup` - Add AI search capabilities
## Version History
- **1.1.0** (2026-01-02): Added Quick Start, Execution Checklist, Error Handling, Metrics sections; updated frontmatter with version, category, related_skills
- **1.0.0** (2024-10-15): Initial release with SQLite storage, auto-categorization, CLI interface
## Sub-Skills
- [Best Practices](best-practices/SKILL.md)
## Sub-Skills
- [Execution Checklist](execution-checklist/SKILL.md)
- [Error Handling](error-handling/SKILL.md)
- [Metrics](metrics/SKILL.md)
- [Dependencies](dependencies/SKILL.md)Related Skills
multi-source-tax-document-reconciliation
Verify generated tax forms against source documents by line-by-line comparison, not just totals
metadata-only-inventory-sweep
Execute constrained file inventory sweeps with metadata-only stubs and validation, useful for staged documentation work on large file sets
documentation-contract-plan-hardening
Harden a documentation/contract plan before adversarial review by mapping every issue-scope requirement to independent acceptance criteria and tests, especially for routing/indexing contracts.
ocr-and-documents
Extract text from PDFs and scanned documents. Use web_extract for remote URLs, pymupdf for local text-based PDFs, marker-pdf for OCR/scanned docs. For DOCX use python-docx, for PPTX see the powerpoint skill.
gmail-attachment-to-document
Download attachments from Gmail threads, parse their content (Excel, PDF), extract structured data, and save to target repos with proper legal scanning.
document-rag-pipeline
Build complete document knowledge bases with PDF text extraction, OCR for scanned documents, vector embeddings, and semantic search. Use this for creating searchable document libraries from folders of PDFs, technical standards, or any document collection.
document-index-pipeline
Orchestrate the 7-phase document indexing pipeline (A→G) for the 1M+ document corpus. Use when running batch extraction, classification, or gap analysis on og_standards, ace_standards, or workspace_spec sources.
modular-architecture-documentation
Systematically document multi-module system architectures including module boundaries, CLI commands, and architecture decisions.
inventory-readiness-provider-dispatch
Build and operate a computable readiness matrix that connects raw-data-to-GTM package stages with Codex/Codex/Gemini dispatch lanes and weekly credit pacing.
hidden-folder-audit-step-1-inventory-all-hidden-folders
Sub-skill of hidden-folder-audit: Step 1: Inventory All Hidden Folders (+4).
clinical-trial-protocol-fda-guidance-documents
Sub-skill of clinical-trial-protocol: FDA Guidance Documents.
hardware-assessment-workflow-multi-machine-inventory
Sub-skill of hardware-assessment: Workflow: Multi-Machine Inventory.