Download docs

From olorehq/olore · View interactive version

Download docs is an AI agent skill from the GitHub repository olorehq/olore. Download and filter documentation from source configs. Use standalone to re-download without rebuilding artifacts.

How to use this skill

Skill file

Download Docs

Download documentation files from a source config and filter non-useful files.

Usage

/download-docs prisma@latest         # Download specific version
/download-docs prisma@latest --force  # Re-download even if exists

Input

$ARGUMENTS format: {config_name}@{version} (e.g., prisma@latest, nextjs@16.1.3)

Optional flags:

Execution Steps

Step 1: Parse Arguments and Load Config

Parse $ARGUMENTS:

Load config file:

cat vault/configs/{config_name}.json

Extract:

Step 2: Check if Already Built

test -f vault/packages/{config_name}/{version}/olore-lock.json && echo "EXISTS" || echo "NOT_FOUND"

If exists and no --force flag:

skip: {config_name}@{version} already built (use --force to rebuild)

Return early.

Step 3: Download Documentation

For GitHub sources:

bash -c 'source .claude/skills/build-docs/scripts/github.sh && download_from_github "vault/configs/{config_name}.json" "vault/packages" "{version}"'

For URL sources:

bash -c 'source .claude/skills/build-docs/scripts/url.sh && download_from_urls "vault/configs/{config_name}.json" "vault/packages" "{version}"'

With --force: pass "true" (or "--force") as the 4th argument, otherwise an already-built version is skipped:

bash -c 'source .claude/skills/build-docs/scripts/github.sh && download_from_github "vault/configs/{config_name}.json" "vault/packages" "{version}" true'

(Same for download_from_urls.)

Verify download succeeded:

test -f vault/packages/{config_name}/{version}/olore-lock.json && echo "OK" || echo "FAILED"

If download failed, return error:

error: {config_name}@{version} download failed

Step 4: Count Files and Determine Tier

file_count=$(find vault/packages/{config_name}/{version}/contents -type f \( -name "*.md" -o -name "*.mdx" \) | wc -l)
total_size=$(du -sk vault/packages/{config_name}/{version}/contents | cut -f1)

| Tier | Criteria |

|------|----------|

| 1 | < 30 files AND < 500KB |

| 2 | 30-100 files OR 500KB-2MB |

| 3 | > 100 files OR > 2MB |

Step 5: Filter Files (GitHub sources with >50 files only)

Skip this step if:

For GitHub sources with >50 files:

  1. For each file, read only the first 20-30 lines to make filtering decisions:

This is sufficient to identify file type (changelog, RFC, API doc, tutorial, etc.).

Do NOT read entire files for filtering - it wastes tokens on large repos.

  1. Evaluate each file against criteria:

KEEP - Files that help developers USE the library:

DELETE - Files NOT useful for using the library:

  1. Delete files that should be removed:
rm "vault/packages/{config_name}/{version}/contents/{path_to_delete}"
  1. Remove empty directories:
find vault/packages/{config_name}/{version}/contents -type d -empty -delete

Step 6: Update olore-lock.json

Update the lock file with final file count:

# Get final count
final_count=$(find vault/packages/{config_name}/{version}/contents -type f \( -name "*.md" -o -name "*.mdx" \) | wc -l)

Update files field in olore-lock.json if filtering occurred.

Step 7: Return Summary

Return ONLY a brief summary:

done: {config_name}@{version} downloaded, {final_count} files{filtered_info}, tier {tier}

Examples:

Outputs

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.