agentleFS
rillmdrillmd/rill/skills/clip-tweet/SKILL.md

clip-tweet

Skill9 starsChanged 42 days agoMITView on GitHub

Ingest a single Twitter/X tweet URL into inbox/tweets/, fetch its content via fetch-tweet.sh, and generate an organized version with frontmatter and Markdown body in _organized/. Combines `rill clip` with the tweet branch of /distill Phase 2 in one shot. Use when the user supplies a single tweet URL to capture.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 10 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the argument is empty, display "Please specify a tweet URL" and exit

    line 22
  2. Very specific:

    If a file with the same tweet-id already exists in inbox/tweets/, report the duplicate and skip

    line 29
  3. Very specific:

    Create the file with rill mkfile (to guarantee timestamp accuracy):

    line 30
  4. Distinctive:

    Use the output path in subsequent steps

    line 36
  5. Distinctive:

    Run the following in a shell:

    line 40
  6. Distinctive:

    If the script fails (exit code ≠ 0), report the error message from stderr, leave the file created in Step 2, and stop (skip the remaining …

    line 48
  7. Very specific:

    Only run this if the Step 3 output has urls: and it is not an empty array [].

    line 55
  8. Distinctive:

    If the description makes sense as a summary (non-empty, not generic) → use it as-is

    line 62
  9. Distinctive:

    If the description is empty or insufficient → use WebFetch to retrieve the linked page body and create a 3-5 line summary.

    line 63
  10. Very specific:

    Read taxonomy.md to check existing tags

    line 84
  11. Distinctive:

    If urls exist, append:

    line 122
  12. Distinctive:

    If urls exist and Step 3.5 enrichment was retrieved, append after "## Links":

    line 129
  13. Distinctive:

    If media exist, append:

    line 138
  14. Distinctive:

    If a quote exists, append:

    line 146

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/clip-tweet — Tweet Ingestion

Conduct all conversation with the user — and write all generated output — in the language defined by .claude/rules/personal-language.md (or the user's input language if that file is absent). Follow the language rules in full — exceptions and translation quality are defined in the Language Rules of .claude/rules/rill-core.md and the vault's personal-*.md overrides, never restated per skill. The English instructions below are for skill clarity, not for output style.

Tool references in this skill (shell, WebFetch) describe intent, not Claude-specific tool calls. Each harness should map them to its native equivalent — Claude Code uses its built-in tools as named; Codex CLI uses apply_patch / shell / --search etc. as appropriate.

Ingests a Twitter/X tweet URL into inbox/tweets/, fetches the content via fetch-tweet.sh, and generates an organized version in _organized/. A skill that runs rill clip + /distill Phase 2 (tweet) in one shot.

Arguments

$ARGUMENTS — Tweet URL (e.g. https://x.com/user/status/12345)

Steps

Step 1: URL Validation and Normalization

  1. If the argument is empty, display "Please specify a tweet URL" and exit
  2. Confirm the URL matches the pattern https://(x.com|twitter.com)/*/status/*
  3. Strip tracking parameters (?s=, &t=, &ref_src=, etc.)
  4. Extract screen_name and tweet_id from the URL

Step 2: Create File in inbox/tweets/

  1. If a file with the same tweet-id already exists in inbox/tweets/, report the duplicate and skip
  2. Create the file with rill mkfile (to guarantee timestamp accuracy):
rill mkfile inbox/tweets --slug {screen_name} --field "source-type=tweet" --field 'url="{normalized URL}"' --field 'tweet-id="{tweet_id}"'
  1. Use the output path in subsequent steps

Step 3: Fetch Tweet Data (Script Execution)

Run the following in a shell:

bash plugins/twitter/fetch-tweet.sh "{normalized URL}"

The script outputs structured YAML to stdout. Use this output in subsequent steps.

If the script fails (exit code ≠ 0), report the error message from stderr, leave the file created in Step 2, and stop (skip the remaining steps). Branch on the exit code:

  • Exit code 4 (tweet unavailable — deleted or private, a retry cannot succeed): run rill processed set inbox/tweets/.processed {filename} skipped so /distill does not re-queue it on every run, and tell the user the tweet is no longer available
  • Any other non-zero exit code (transient or unknown failure): do not record anything in .processed — the file can be reprocessed by /distill

Step 3.5: URL Enrichment (only if urls is non-empty)

Only run this if the Step 3 output has urls: and it is not an empty array [].

  1. For each URL in the urls list, run the following in a shell:
    bash plugins/twitter/fetch-url-meta.sh "{url}"
  2. The script returns title and description as YAML
  3. If the description makes sense as a summary (non-empty, not generic) → use it as-is
  4. If the description is empty or insufficient → use WebFetch to retrieve the linked page body and create a 3-5 line summary. If WebFetch also fails, record only the title
  5. Save the result and use it in Step 4 under "## Linked Content"

Step 3.7: Language and Relevance Detection

Language Rules

  • tweet-lang: ja → Both the body and AI-generated text (summary, linked content) are in Japanese
  • tweet-lang: en → Record the tweet body in English. AI-generated text (summary, linked content) follows the system output language
  • Other / mixed → Preserve the original language; AI-generated text follows the system output language

Engagement Signal

Interpret engagement-save-ratio and engagement-rate from the script output and add engagement-signal to the frontmatter:

  • engagement-save-ratio ≥ 1.0 → high-save (bookmarks ≥ likes; practical tools / reference content)
  • engagement-rate ≥ 5.0 → viral (engagement rate over 5%; viral content)
  • Neither applies → omit engagement-signal

Related Projects

Match the tweet content against projects in projects/*/_project.md (ADR-080: projects moved from the old knowledge/projects/ flat layout), and if related project IDs exist, add relevance-to: [id1, id2] to the frontmatter (max 2). Use the directory names (= IDs) under projects/ and the name field in each projects/{slug}/_project.md as references. Omit if none apply.

Step 4: Generate Organized Version in _organized/

  1. Read taxonomy.md to check existing tags
  2. Write to inbox/tweets/_organized/{same filename}

frontmatter

---
created: {same as Step 2}
source-type: tweet
original-file: inbox/tweets/{filename}
url: "{normalized URL}"
tweet-id: "{tweet_id}"
tweet-author: {tweet-author from script output}
tweet-author-name: {tweet-author-name from script output}
tweet-date: {tweet-date from script output}
tweet-likes: {number}
tweet-retweets: {number}
tweet-bookmarks: {number}
tweet-views: {number}
tweet-type: {article | tweet}
tags: [{up to 3, selected from taxonomy.md}]
engagement-signal: {high-save | viral — only if applicable}
relevance-to: [{project ID — only if applicable}]
---

Body (for normal tweets)

{the text content as-is}

---

**{tweet-author-name} ({tweet-author})** · {tweet-date}

👍 {tweet-likes} · 🔁 {tweet-retweets} · 🔖 {tweet-bookmarks} · 👁 {tweet-views}

If urls exist, append:

## Links
- [{display}]({url})

If urls exist and Step 3.5 enrichment was retrieved, append after "## Links":

## Linked Content

### [{title}]({url})
{description or WebFetch-based summary}

If media exist, append:

## Media
- 📷 Image ({width}×{height})
- 🎥 Video ({duration}s, {width}×{height})

If a quote exists, append:

## Quoted Tweet
> {quote.text}
>
> — {quote.author-name} ({quote.author}) [original]({quote.url})

Body (for Articles)

# {article.title}

by {tweet-author-name} ({tweet-author}) — {tweet-date}

## Summary

{AI-generated summary: 3-5 key points}

## Body

{full text converted from article.blocks to Markdown}

Article block conversion rules:

  • type: "header-two" → ## {text}
  • type: "unstyled" → paragraph (separated by blank lines)
  • type: "ordered-list-item" → 1. {text}
  • type: "unordered-list-item" → - {text}
  • type: "blockquote" → > {text}
  • type: "atomic" → --- (horizontal rule)
  • styles Bold → **{text}**, Italic → *{text}* (applied to the range specified by offset/length)
  • entity-map LINK type → convert to [text](url)
  • entity-map TWEET type → record as > [Embedded tweet](https://x.com/i/status/{tweet-id})

Step 5: Update .processed

  1. Append {filename}:organized to inbox/tweets/.processed
  2. Report the result:
    • Path of the created file
    • Tweet type (normal / Article)
    • Number of links and media
    • Body summary (first 1-2 sentences)

Rules

  • Do not modify the original file in inbox/tweets/ (create a thin file with frontmatter only, and expand the full text in _organized/)
  • Reference taxonomy.md when assigning tags
  • Division of responsibility with /distill: /distill batch-processes unprocessed files; /clip-tweet immediately processes a single tweet

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.