# linkslibrary

Adopt this skill: https://proskills.md/skills/other/guidovezzoni-links-library-skill

Page: https://proskills.md/skills/other/guidovezzoni-links-library-skill
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: SKILL.md
size: 2897
upstream: https://github.com/guidovezzoni/links-library-skill/blob/HEAD/SKILL.md

````text
---
name: linkslibrary
description: Archive and categorize web links sent by the user. Triggers whenever a message contains one or more URLs (http:// or https:// links). Saves links to the personal links library with a timestamp, optional fetched title, and category. Use this skill any time the user sends a URL or a message that includes one or more web links — even when no explicit archiving request is made.
---

# Links Library

## Library File

`<workspace>/linkslibrary/linkslibrary.md`

Resolve `<workspace>` from runtime context (`repo=...`). Currently: `~/.openclaw/workspace/linkslibrary/linkslibrary.md`

## Workflow

For each URL detected in the message, execute these steps in order. Process all URLs before replying.

### 1. Fetch the page title

Use `web_fetch` on the URL. Extract the page `<title>` or the first H1 from the rendered content. If the fetch fails or no title is found, proceed with an empty title — do **not** skip the URL.

### 2. Read existing categories

Parse the `## ` headers from `linkslibrary.md` (skip this read if the file does not exist yet — the script will create it with defaults).

### 3. Determine category

- If the user provided a category in their message, use it (even if it's new).
- Otherwise, use your judgment to match the URL + title against the existing categories. Choose the best fit. If no category clearly fits, use `Unknown`.

### 4. Add the link

Run the script with the resolved arguments:

```bash
python3 <skill_dir>/scripts/add_link.py \
  --url "<URL>" \
  --title "<title or empty>" \
  --category "<category>" \
  --file "<workspace>/linkslibrary/linkslibrary.md"
```

`<skill_dir>` is the directory containing this SKILL.md.

Script output:
- `OK:<category>` — link was added, category shows where it was stored (may differ from input if case-normalized).
- `SKIP:duplicate` — URL already in the library; skip silently or note it in the reply.

### 5. Reply

After processing all URLs, send a **single** confirmation reply in the **same channel** where the message arrived.

Format:
```
✅ Saved [Title](url) → **Category**
✅ Saved [Another Title](url2) → **Category2**
```

- Start every line with `✅`
- One line per URL
- If the title is empty, use just the URL as the link text
- If a URL was a duplicate, include it as: `⚠️ Already saved: <url>`
- Keep the message to one line per link — no extra explanation needed

## Rules

- **Never modify existing entries.** Only append.
- **One entry per URL.** The script handles deduplication.
- **Create the file if absent.** The script initializes it with default categories.
- **Multiple URLs in one message** → process each separately, confirm all in one reply.
- **Do not ask questions.** Make a best-effort categorization and confirm.
- **Local time** is used for timestamps (system clock, Europe/Madrid). The script applies this automatically.
````

## File: README.md
upstream: https://github.com/guidovezzoni/links-library-skill/blob/HEAD/README.md

````text
# linkslibrary skill

A personal link archiving skill for OpenClaw. Triggered automatically whenever a URL appears in a message, it fetches the page title, categorizes the link, and appends it to a local markdown library.

## Library file

```
<workspace>/linkslibrary/linkslibrary.md
```

Created automatically on first use. Never overwritten if it already exists.

## Library format

```markdown
## Development
* 2026-04-10 14:33 - [React Native Expo Documentation](https://docs.expo.dev/)

## Fun Stuff

## Homelab
* 2026-04-26 16:31 - [I over-engineered my home lab on purpose, and it's the best decision I've made](https://www.xda-developers.com/...)

## IA

## Second Brain

## Unknown
* 2026-04-10 14:33 - [Duck Duck Go](https://duckduckgo.com)
```

- **Categories** → `## ` H2 headers, always alpha-sorted
- **Entries** → bullet points with timestamp + markdown link, time-sorted (newest at bottom)
- **Timestamps** → local time (Europe/Madrid), 24h format `YYYY-MM-DD HH:MM`
- **Title** → fetched from the page; omitted if unavailable

## Default categories

Development, Fun Stuff, Homelab, IA, Second Brain, Unknown

New categories are created automatically when you specify one that doesn't exist yet. `Unknown` is always present as a fallback.

## How to use

Just send a URL — no command needed:

```
https://example.com
```

Optionally hint the category in the same message:

```
homelab: https://example.com
```

Multiple URLs in one message are all processed and confirmed in a single reply.

## Confirmation format

```
✅ Saved [Title](url) → **Category**
```

One line per URL. Duplicate URLs are noted with ⚠️ and skipped.

## Rules

- **Never modifies existing entries** — append-only
- **One entry per URL** — duplicates are detected and skipped
- **No questions asked** — best-effort categorization, review `Unknown` later

## Files

```
skills/linkslibrary/
├── SKILL.md           ← skill definition + workflow instructions
├── README.md          ← this file
└── scripts/
    └── add_link.py    ← handles file I/O (create, parse, append, deduplicate)
```

### add_link.py usage

```bash
python3 scripts/add_link.py \
  --url "https://example.com" \
  --title "Page Title"        \   # optional
  --category "Homelab"        \   # optional, default: Unknown
  --timestamp "2026-04-26 16:31"  # optional, default: now
  --file "/path/to/linkslibrary.md"
```

Output: `OK:<category>` or `SKIP:duplicate`
````
