本文へ移動
cccskills
無料GitHub で公開

reddit

Interact with Reddit — browse subreddits, read posts and comments, search content, view user profiles, post comments, vote, save posts, subscribe to subreddits. Use this skill whenever the user mentions Reddit, r/, subreddit, wants to browse Reddit posts, read Reddit discussions, search Reddit, look up Reddit users, or interact with Reddit content. Also trigger when the user pastes a Reddit URL (e.g. reddit.com/r/programming/...) or mentions a subreddit name.

インストール方法を見る

含まれるファイル(31)

  • SKILL.md12.2 KB
  • references/provider-config.yaml693 B
  • scripts/reddit_client.py7.9 KB
  • scripts/reddit_comment.py2.0 KB
  • scripts/reddit_hot.py1.7 KB
  • scripts/reddit_manage.py2.7 KB
  • scripts/reddit_new.py1.8 KB
  • scripts/reddit_popular.py1.4 KB
  • scripts/reddit_post.py2.4 KB
  • scripts/reddit_save.py1.7 KB
  • scripts/reddit_search.py2.4 KB
  • scripts/reddit_submit.py2.6 KB
  • scripts/reddit_subreddit.py1.1 KB
  • scripts/reddit_subscribe.py1.6 KB
  • scripts/reddit_top.py2.0 KB
  • scripts/reddit_user.py2.7 KB
  • scripts/reddit_vote.py1.7 KB
  • tests/test_reddit_comment.py1.7 KB
  • tests/test_reddit_hot.py3.7 KB
  • tests/test_reddit_manage.py2.2 KB
  • tests/test_reddit_new.py1.7 KB
  • tests/test_reddit_popular.py1.5 KB
  • tests/test_reddit_post.py6.2 KB
  • tests/test_reddit_save.py1.2 KB
  • tests/test_reddit_search.py2.8 KB
  • tests/test_reddit_submit.py1.9 KB
  • tests/test_reddit_subreddit.py2.6 KB
  • tests/test_reddit_subscribe.py1.0 KB
  • tests/test_reddit_top.py2.7 KB
  • tests/test_reddit_user.py4.7 KB
  • tests/test_reddit_vote.py1.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Reddit

Browse subreddits, read posts and comments, search content, view user profiles, and interact with Reddit.

Skill Directory

<SKILL_DIR> is the directory containing this SKILL.md file. Determine it ONCE at the start and reuse it.

Setup (run FIRST — every time, before any operation)

You MUST complete this setup before running any script. Do NOT skip this step.

sig status reddit 2>&1

Check the JSON output fields configured and valid:

  • configured: false → run Provider Setup below. Do NOT proceed without completing it.
  • valid: false (but configured: true) → run sig login reddit, then re-check.
  • valid: true → detect proxy (see below), then execute the user's request.

Provider Setup

  1. Read <SKILL_DIR>/references/provider-config.yaml
  2. Append the provider block to ~/.sig/config.yaml under providers:
  3. Ask the user: "Do you need a proxy to access this site?" — if yes, add networkProxy: <url> under the provider in config.yaml
  4. Run sig login reddit (with --network-proxy <url> if proxy was specified)
  5. Verify: run sig status reddit again — must show valid: true before proceeding

Proxy Detection (after provider is valid)

grep -A15 "^\s*reddit:" ~/.sig/config.yaml | grep networkProxy | awk '{print $2}'

If this outputs a URL, prefix ALL python3 commands with HTTPS_PROXY=<url> HTTP_PROXY=<url>. If using socks5, convert to socks5h for python (e.g. socks5://... → socks5h://...). If empty, no proxy needed.

Running Scripts

All scripts require setup to be completed first (see above).

Read operations — use sig run to inject cookie (enables authenticated features):

sig run reddit -- bash -c 'python3 <SKILL_DIR>/scripts/reddit_hot.py --cookie "$SIG_REDDIT_COOKIE" --subreddit programming --limit 10'

Write operations — require sig run (cookie is mandatory):

sig run reddit -- bash -c 'python3 <SKILL_DIR>/scripts/reddit_comment.py --cookie "$SIG_REDDIT_COOKIE" --parent t3_1abc --text "Great post!"'

Env var: SIG_REDDIT_COOKIE

On auth error (401/403): run sig login reddit automatically (no user prompt), then retry.

Scripts Reference

All scripts are in this skill's scripts/ directory. Run via Bash tool.

Read Operations

ScriptPurposeAuth
reddit_hot.pyHot posts from a subredditNone
reddit_top.pyTop posts from a subredditNone
reddit_new.pyNew or rising postsNone
reddit_popular.pyPopular posts (/r/popular)None
reddit_post.pyPost detail with commentsNone
reddit_search.pySearch Reddit postsNone
reddit_user.pyUser profile and activityNone
reddit_subreddit.pySubreddit infoNone

Write Operations

ScriptPurposeAuth
reddit_submit.pyCreate a new postRequired
reddit_manage.pyEdit or delete postRequired
reddit_comment.pyPost a commentRequired
reddit_vote.pyUpvote/downvote/unvoteRequired
reddit_save.pySave or unsave a postRequired
reddit_subscribe.pySubscribe/unsubscribeRequired

reddit_hot.py

--subreddit NAME      Subreddit name without r/ prefix (default: all)
--limit N             Max posts to return (default: 25)
--after TOKEN         Pagination token from previous response

reddit_top.py

--subreddit NAME      Subreddit name without r/ prefix (default: all)
--time PERIOD         Time period: hour, day, week, month, year, all (default: day)
--limit N             Max posts to return (default: 25)
--after TOKEN         Pagination token from previous response

reddit_new.py

--subreddit NAME      Subreddit name (default: all)
--sort SORT           Sort: new, rising (default: new)
--limit N             Max posts (default: 25)
--after TOKEN         Pagination token

reddit_popular.py

--limit N             Max posts (default: 25)
--after TOKEN         Pagination token

reddit_post.py

--id ID               Post ID, fullname (t3_xxx), or full Reddit URL (required)
--comments-limit N    Max top-level comments (default: 20)
--sort SORT           Comment sort: best, top, new, controversial, old (default: best)
--depth N             Max comment tree depth (0=unlimited, default: 0)

reddit_search.py

--query TEXT          Search query (required)
--subreddit NAME     Search within a specific subreddit (optional)
--sort SORT          Sort: relevance, hot, top, new, comments (default: relevance)
--time PERIOD        Time filter: hour, day, week, month, year, all (default: all)
--limit N            Max results (default: 25)
--after TOKEN        Pagination token

reddit_user.py

--username NAME       Reddit username without u/ prefix (required)
--include-posts       Include user's recent posts
--include-comments    Include user's recent comments

reddit_subreddit.py

--name NAME           Subreddit name without r/ prefix (required)

reddit_submit.py

--cookie COOKIE       Reddit session cookie (required)
--subreddit NAME      Subreddit to post in (required)
--title TEXT          Post title (required)
--kind KIND           Post type: self, link (default: self)
--text TEXT           Post body text (for self posts)
--url URL             URL to share (for link posts)
--flair-id ID         Flair template ID (from subreddit flair list)
--flair-text TEXT     Flair text

reddit_manage.py

--cookie COOKIE       Reddit session cookie (required)
--id ID               Post/comment ID or fullname (required)
--action ACTION       Action: edit, delete (required)
--text TEXT           New text content (required for edit)

reddit_comment.py

--cookie COOKIE       Reddit session cookie (required)
--parent ID           Parent fullname: t3_xxx (reply to post) or t1_xxx (reply to comment)
--text TEXT           Comment text in markdown (required)

reddit_vote.py

--cookie COOKIE       Reddit session cookie (required)
--id ID               Post/comment ID or fullname (t3_xxx / t1_xxx)
--direction DIR       Vote: up, down, or none (required)

reddit_save.py

--cookie COOKIE       Reddit session cookie (required)
--id ID               Post/comment ID or fullname
--undo                Unsave instead of save (flag)

reddit_subscribe.py

--cookie COOKIE       Reddit session cookie (required)
--subreddit NAME      Subreddit name (required)
--undo                Unsubscribe instead of subscribe (flag)

Safety

Always show the user the title/body and get explicit confirmation before calling reddit_submit.py or reddit_comment.py. Posts and comments are public. Posts can be edited/deleted via reddit_manage.py.

reddit_vote.py and reddit_subscribe.py are reversible — use --direction none to remove a vote, --undo to unsubscribe.

Key Concepts

Subreddit names — Always pass without the r/ prefix. Use programming not r/programming.

Post IDs — reddit_post.py accepts: bare ID (1k2x3y), fullname (t3_1k2x3y), full URL (https://www.reddit.com/r/python/comments/1k2x3y/...), or short link (https://redd.it/1k2x3y).

Fullnames — Reddit identifies objects with type prefixes: t1_ (comment), t3_ (post). Write scripts accept bare IDs or fullnames.

OAuth Bearer — Write operations use the token_v2 cookie value as a Bearer token against oauth.reddit.com. The client extracts it automatically from the session cookie.

Time periods — Used by reddit_top.py and reddit_search.py. Valid: hour, day, week, month, year, all.

Pagination — List endpoints return an after token. Pass it as --after on the next call to get the next page.

NSFW content — Posts flagged as NSFW include "over_18": true in the response.

Error Handling

ErrorCauseFix
HTTP_403Subreddit is privateUse a different subreddit
HTTP_404Subreddit/user not foundCheck the name is spelled correctly
HTTP_429Rate limited by RedditWait a few seconds and retry
HTTP_503Reddit is temporarily downWait and retry
TimeoutNetwork blocked or slowCheck proxy config; retry with HTTPS_PROXY
ConnectionErrorCan't reach reddit.comProxy is missing or wrong; check ~/.sig/config.yaml
AUTH_REQUIREDNo cookie for write opAuto-run sig login (no user prompt needed), retry
NO_TOKENNo token_v2 in cookieAuto-run sig login (no user prompt needed), retry
COMMENT_FAILEDComment rejectedCheck error details
SUBMIT_FAILEDPost creation rejectedCheck subreddit rules
EDIT_FAILEDEdit rejectedMust be the author

Workflow Examples

Browse hot posts

  1. sig run reddit -- bash -c 'python3 <SKILL_DIR>/scripts/reddit_hot.py --cookie "$SIG_REDDIT_COOKIE" --subreddit programming --limit 10'
  2. Get next page: sig run reddit -- bash -c 'python3 <SKILL_DIR>/scripts/reddit_hot.py --cookie "$SIG_REDDIT_COOKIE" --subreddit programming --limit 10 --after t3_xxx'

Browse popular posts

  1. sig run reddit -- bash -c 'python3 <SKILL_DIR>/scripts/reddit_popular.py --cookie "$SIG_REDDIT_COOKIE" --limit 10'

Find top posts of the week

  1. sig run reddit -- bash -c 'python3 <SKILL_DIR>/scripts/reddit_top.py --cookie "$SIG_REDDIT_COOKIE" --subreddit python --time week --limit 10'

Read a post with comments

  1. sig run reddit -- bash -c 'python3 <SKILL_DIR>/scripts/reddit_post.py --cookie "$SIG_REDDIT_COOKIE" --id 1k2x3y --comments-limit 30 --sort top'
  2. Or use a full URL: sig run reddit -- bash -c 'python3 <SKILL_DIR>/scripts/reddit_post.py --cookie "$SIG_REDDIT_COOKIE" --id "https://www.reddit.com/r/python/comments/1k2x3y/..." --sort best'

Search for a topic

  1. sig run reddit -- bash -c 'python3 <SKILL_DIR>/scripts/reddit_search.py --cookie "$SIG_REDDIT_COOKIE" --query "machine learning" --sort top --time month'

Create a post

  1. Show title/body to user and get confirmation
  2. sig run reddit -- bash -c 'python3 <SKILL_DIR>/scripts/reddit_submit.py --cookie "$SIG_REDDIT_COOKIE" --subreddit test --title "My Post" --text "Hello world"'

Edit or delete a post

  1. Edit: sig run reddit -- bash -c 'python3 <SKILL_DIR>/scripts/reddit_manage.py --cookie "$SIG_REDDIT_COOKIE" --id t3_abc123 --action edit --text "Updated content"'
  2. Delete: sig run reddit -- bash -c 'python3 <SKILL_DIR>/scripts/reddit_manage.py --cookie "$SIG_REDDIT_COOKIE" --id t3_abc123 --action delete'

Post a comment

  1. Show comment text to user and get confirmation
  2. sig run reddit -- bash -c 'python3 <SKILL_DIR>/scripts/reddit_comment.py --cookie "$SIG_REDDIT_COOKIE" --parent t3_1k2x3y --text "Great post!"'

Upvote a post

  1. sig run reddit -- bash -c 'python3 <SKILL_DIR>/scripts/reddit_vote.py --cookie "$SIG_REDDIT_COOKIE" --id t3_1k2x3y --direction up'

Subscribe to a subreddit

  1. sig run reddit -- bash -c 'python3 <SKILL_DIR>/scripts/reddit_subscribe.py --cookie "$SIG_REDDIT_COOKIE" --subreddit python'

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

bilibili

無料

Interact with Bilibili (B站) — browse trending videos, view video details, read comments, search videos and users, view user profiles, like, coin, and favorite videos. Use this skill whenever the user mentions Bilibili, B站, wants to browse Bilibili content, search Bilibili videos, read Bilibili comments, look up Bilibili users, or interact with Bilibili content. Also trigger when the user pastes a Bilibili URL (e.g. bilibili.com/video/BV...) or mentions a BV ID.

日本語の概要は準備中です。原文の説明を表示しています。

sigcli/sigcli2932026年9月28日 更新

douyin

無料

Provide authenticated cookies for Douyin (抖音/TikTok China) — two providers: douyin (www.douyin.com for scraping) and douyin-live (live.douyin.com for livestream). Use this skill whenever the user needs Douyin cookies for scraping tools like DouYin_Spider, or needs to authenticate with Douyin services. Trigger when the user mentions 抖音, Douyin, TikTok China, douyin cookies, or wants to use tools that require Douyin login cookies.

日本語の概要は準備中です。原文の説明を表示しています。

sigcli/sigcli2932026年9月28日 更新

Interact with Hacker News (news.ycombinator.com) — browse top, new, and best stories, read item details and comment threads, look up user profiles, and search posts via Algolia. Use this skill whenever the user mentions Hacker News, HN, YCombinator news, ycombinator.com, news.ycombinator.com, wants to browse tech news, read HN discussions, search HN posts, or look up HN users. Also trigger when the user pastes an HN URL (e.g. news.ycombinator.com/item?id=12345). Keywords: Hacker News, HN, YC, ycombinator, tech news, Show HN, Ask HN, HN front page.

日本語の概要は準備中です。原文の説明を表示しています。

sigcli/sigcli2932026年9月28日 更新

linkedin

無料

Interact with LinkedIn — view your profile, browse other profiles, read the feed, search jobs/posts/people, get job details, create posts, like/unlike posts, comment, send connection requests, and follow/unfollow users. Use this skill whenever the user mentions LinkedIn, wants to search for jobs or people, read their LinkedIn feed, view a profile, get job details, create a post, like or comment on content, send a connection request, or follow someone. Also trigger when the user pastes a LinkedIn URL (e.g. linkedin.com/in/..., linkedin.com/jobs/view/...) or mentions LinkedIn networking.

日本語の概要は準備中です。原文の説明を表示しています。

sigcli/sigcli2932026年9月28日 更新

msteams

無料

Interact with Microsoft Teams — send and read messages, search conversations, look up people, check calendar, get meeting transcripts, and manage chats. Use this skill whenever the user mentions Teams, MS Teams, Microsoft Teams, wants to send a message, read chat history, search conversations, look up a colleague, check their calendar, find meeting recordings or transcripts, see direct reports or manager, or do anything involving Teams communication. Also trigger when the user asks about scheduling, org chart, people search, or wants to message someone.

日本語の概要は準備中です。原文の説明を表示しています。

sigcli/sigcli2932026年9月28日 更新

outlook

無料

Interact with Outlook email — read inbox, send emails, search messages, reply/forward, manage folders, download attachments. Use this skill whenever the user mentions email, Outlook, inbox, mail, send email, check email, unread messages, email search, attachments, reply to email, forward email, 邮件, 收件箱, or wants to read, send, search, reply to, forward, or manage emails.

日本語の概要は準備中です。原文の説明を表示しています。

sigcli/sigcli2932026年9月28日 更新

sigcli のスキルをすべて見る

このスキルの問題を報告する