Hacker new

v1.0.0

Fetch and analyze Hacker News (HN) content - the premier tech community for developers, AI researchers, and software engineers. Use when users need: (1) HN t...

0· 119·0 current·0 all-time
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (fetch and analyze Hacker News) match the instructions which call an x-cmd 'hn' command and use standard UNIX tools (jq/sed/sort). The declared file requirement (~/.x-cmd.root/X) aligns with the SKILL.md's explicit need to source the x-cmd environment.
Instruction Scope
Instructions are narrowly focused on fetching HN data and filtering it with x jq and standard shell tools. However, the skill requires you to source ~/.x-cmd.root/X before use — sourcing executes that file in your shell, so you must trust that file (and the x-cmd installation) because it can run arbitrary commands and affect your environment.
Install Mechanism
No install spec or code files are included; this is instruction-only and does not download or install artifacts. Lower-risk in that nothing is written/executed by the skill itself, but it relies on an external tool (x-cmd) which must be obtained separately.
Credentials
The skill requests no environment variables, credentials, or unrelated config paths. The single required path is the x-cmd initialization script which is reasonable for a wrapper that delegates work to x-cmd.
Persistence & Privilege
The skill is not always-on and does not request elevated or persistent privileges. It does not modify other skills or system-wide settings per the provided content.
Assessment
This skill is coherent for fetching and filtering Hacker News via the x-cmd tool. Before using it: (1) ensure x-cmd is installed from a source you trust; (2) inspect ~/.x-cmd.root/X before sourcing it (sourcing runs arbitrary code in your shell); (3) verify you have or install safe tools used by the examples (jq, sed, sort); (4) if you prefer to avoid sourcing a third-party init script, use the Hacker News API or hn.algolia.com directly or run equivalent commands only after reviewing x-cmd's installation instructions. No credentials are requested by this skill.

Like a lobster shell, security has layers — review code before you run it.

latestvk97880kkrrk4cf0zfd5jxrxah983p13t
119downloads
0stars
1versions
Updated 3w ago
v1.0.0
MIT-0

x-hacker-news

Fetch and analyze Hacker News content - the premier tech community for developers, AI researchers, and software engineers

IMPORTANT: Before using any x hn command, you MUST load x-cmd first: . ~/.x-cmd.root/X


Cost

[OK] Free - No API key required


Loading x-cmd

Not installed? -> Search and use the x-cmd skill to install x-cmd first

Installed? -> Load x-cmd:

. ~/.x-cmd.root/X

Non-Interactive Usage

Use x hn for direct non-interactive calls:

# Get top stories JSON data
x hn top --json 1,10

# Get specific post details
x hn item --json 43701153

Note: x hn is non-interactive, suitable for scripts and automation. For interactive browsing, use x hn after loading . ~/.x-cmd.root/X.


AI and Machine Learning Discussions

Filter top stories for AI/ML topics using x jq:

# Filter top stories for AI-related titles
x hn top --json 1,100 | x jq '[.[] | select(.title | test("AI|artificial intelligence|machine learning|LLM|ChatGPT"; "i"))]'

# Filter for LLM and model discussions
x hn top --json 1,100 | x jq '[.[] | select(.title | test("GPT|Claude|Llama|neural|model"; "i"))]'

# Filter for AI safety and alignment discussions
x hn top --json 1,100 | x jq '[.[] | select(.title | test("AI safety|alignment|AGI"; "i"))]'

Programming and Development

Filter top stories for programming topics:

# Filter for programming language discussions
x hn top --json 1,100 | x jq '[.[] | select(.title | test("Rust|Go|Python|TypeScript|JavaScript"; "i"))]'

# Filter for web development
x hn top --json 1,100 | x jq '[.[] | select(.title | test("React|Vue|frontend|backend|web"; "i"))]'

# Filter for DevOps and infrastructure
x hn top --json 1,100 | x jq '[.[] | select(.title | test("Kubernetes|Docker|DevOps|cloud"; "i"))]'

# Filter for software engineering topics
x hn top --json 1,100 | x jq '[.[] | select(.title | test("programming|coding|developer|software|GitHub|open source"; "i"))]'

Software Engineering News

Get software engineering and tech industry discussions:

# Filter for startup and business discussions
x hn top --json 1,100 | x jq '[.[] | select(.title | test("startup|Y Combinator|funding|business"; "i"))]'

# Filter for career and hiring topics
x hn top --json 1,100 | x jq '[.[] | select(.title | test("hiring|interview|career|salary|remote"; "i"))]'

# Show Ask HN posts (often career/business discussions)
x hn ask --json 1,20

# Show Show HN posts (new projects/tools)
x hn show --json 1,20

Story Lists

Get various story lists:

# Get top stories (items 1-10)
x hn top --json 1,10

# Get items 11-20
x hn top --json 11,20

# Other types
x hn new --json 1,10
x hn best --json 1,10
x hn ask --json 1,10
x hn show --json 1,10
x hn job --json 1,10

JSON Fields:

{
  "by": "username",           // Author
  "descendants": 161,         // Comment count
  "id": 47392084,             // Post ID
  "kids": [47393177, ...],    // Comment ID list
  "score": 582,               // Points/upvotes
  "time": 1773609736,         // Unix timestamp (seconds)
  "title": "Post Title",      // Title
  "type": "story",            // Type (story/job/etc)
  "url": "https://..."        // URL
}

x jq Processing Examples:

# Extract title and URL
x hn top --json 1,10 | x jq -r '.[] | "\(.title)\t\(.url)"'

# Calculate average score
x hn top --json 1,30 | x jq '[.[].score] | add / length'

# Sort by score
x hn top --json 1,50 | x jq -r '.[] | "\(.score)\t\(.title)"' | sort -rn | head -10

# Top domains statistics
x hn top --json 1,100 | x jq -r '.[].url // empty' | \
    sed -E 's|https?://||; s|/.*||' | sort | uniq -c | sort -rn | head -10

# Formatted briefing output
x hn top --json 1,5 | x jq -r '.[] | "\n[\(.score) points] \(.title)\nAuthor: @\(.by) | Comments: \(.descendants)\n\(.url)\n"'

# Filter for AI-related stories only
x hn top --json 1,100 | x jq '[.[] | select(.title | test("AI|artificial intelligence|machine learning|LLM|ChatGPT"; "i"))]'

# Filter for programming stories
x hn top --json 1,100 | x jq '[.[] | select(.title | test("programming|coding|developer|software|GitHub"; "i"))]'

Post Details

Get specific post details and comments:

x hn item --json <id>

Examples:

# Get post details
x hn item --json 47392084 | x jq '.[0] | {id, title, by, score, descendants, url}'

# Get comment ID list (first 20)
COMMENT_IDS=$(x hn item --json 47392084 | x jq '.[0].kids[:20] | .[]')

# Fetch each comment content (note: each item request takes time)
for cid in $COMMENT_IDS; do
    x hn item --json "$cid" | x jq -r '[.by, .text[0:100]] | @tsv'
done

Note: Posts with many comments have large data size, consider limiting output or batch processing.


User Info

Get user information:

x hn user --json <username>

Examples:

# Get key user fields (limit output for active users)
x hn user --json dang | x jq '{id, created, karma, submitted: (.submitted | length)}'

# Extract user profile
x hn user --json dang | x jq '{
    username: .id,
    created: .created,
    karma: .karma,
    about: (.about[0:200] // "")
}'

Note: Active users have large data including all submission records, which may cause timeouts. Use x jq to limit output fields.


User hn-index

Calculate user influence metric:

x hn hidx <username>

Output Example:

hn-index: 42

Note: This command fetches all user submissions and may take time for active users.


Caching

x hn module has built-in caching:

# View cache config
x hn cfg cat

# Default cache times
# - Story data: 60 minutes
# - Index data: 30 minutes
# - Cache dir: ~/.x-cmd.root/local/cache/hn/

Command Reference

CommandDescriptionOutput
x hn top --json N,MTop storiesJSON array
x hn new --json N,MNew storiesJSON array
x hn best --json N,MBest storiesJSON array
x hn ask --json N,MAsk HN postsJSON array
x hn show --json N,MShow HN postsJSON array
x hn job --json N,MJob postingsJSON array
x hn item --json <id>Post detailsJSON object
x hn user --json <name>User infoJSON object
x hn hidx <name>hn-indexPlain text

Dependencies

  • x-cmd (required): provides hn module
  • x jq (optional): JSON processing via x-cmd

More: https://x-cmd.com/llms.txt

Entrance for AI agents.

Comments

Loading comments...