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.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- templates/AGENTS.mdAGENTS.md
- inbox/CLAUDE.mdCLAUDE.md
- pages/CLAUDE.mdCLAUDE.md
- projects/CLAUDE.mdCLAUDE.md
- tasks/CLAUDE.mdCLAUDE.md
- workspace/CLAUDE.mdCLAUDE.md
- briefingSkill
- closeSkill
- distillSkill
- evalSkill
- focusSkill
- inspectSkill
- maintainSkill
- morningSkill
- newsletterSkill
- onboardingSkill
- pageSkill
- pluginSkill
- projectSkill
- pulseSkill
- refresh-decisionsSkill
- refresh-projectSkill
- repairSkill
- retrospectiveSkill
- solveSkill
- syncSkill
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
- Distinctive: line 22
If the argument is empty, display "Please specify a tweet URL" and exit
- Very specific: line 29
If a file with the same tweet-id already exists in inbox/tweets/, report the duplicate and skip
- Very specific: line 30
Create the file with rill mkfile (to guarantee timestamp accuracy):
- Distinctive: line 36
Use the output path in subsequent steps
- Distinctive: line 40
Run the following in a shell:
- Distinctive: line 48
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 …
- Very specific: line 55
Only run this if the Step 3 output has urls: and it is not an empty array [].
- Distinctive: line 62
If the description makes sense as a summary (non-empty, not generic) → use it as-is
- Distinctive: line 63
If the description is empty or insufficient → use WebFetch to retrieve the linked page body and create a 3-5 line summary.
- Very specific: line 84
Read taxonomy.md to check existing tags
- Distinctive: line 122
If urls exist, append:
- Distinctive: line 129
If urls exist and Step 3.5 enrichment was retrieved, append after "## Links":
- Distinctive: line 138
If media exist, append:
- Distinctive: line 146
If a quote exists, append:
≈ “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.
Files
/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 usesapply_patch/ shell /--searchetc. 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
- If the argument is empty, display "Please specify a tweet URL" and exit
- Confirm the URL matches the pattern
https://(x.com|twitter.com)/*/status/* - Strip tracking parameters (
?s=,&t=,&ref_src=, etc.) - Extract
screen_nameandtweet_idfrom the URL
Step 2: Create File in inbox/tweets/
- If a file with the same
tweet-idalready exists ininbox/tweets/, report the duplicate and skip - 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}"'- 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} skippedso /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 [].
- For each URL in the urls list, run the following in a shell:
bash plugins/twitter/fetch-url-meta.sh "{url}" - The script returns
titleanddescriptionas YAML - If the description makes sense as a summary (non-empty, not generic) → use it as-is
- 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
- 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 Japanesetweet-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/
- Read
taxonomy.mdto check existing tags - 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)stylesBold→**{text}**,Italic→*{text}*(applied to the range specified by offset/length)entity-mapLINKtype → convert to[text](url)entity-mapTWEETtype → record as> [Embedded tweet](https://x.com/i/status/{tweet-id})
Step 5: Update .processed
- Append
{filename}:organizedtoinbox/tweets/.processed - 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.mdwhen assigning tags - Division of responsibility with
/distill:/distillbatch-processes unprocessed files;/clip-tweetimmediately processes a single tweet
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
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.

