news-summary

Original🇨🇳 Chinese
Translated
4 scripts

News search, news summarization, news aggregation, hot news, latest news, news organization, news collection. Helps you search for relevant news from the past few days (12-25 articles), generate a beautiful HTML summary page, each news article has a summary and AI in-depth interpretation function, and automatically opens the browser to display it

7installs
Added on

NPX Install

npx skill4agent add zjfls/zhoujie-claude-skills news-summary

Tags

Translated version includes tags in frontmatter

SKILL.md Content (Chinese)

View Translation Comparison →

News Search Summary Skill

An intelligent news search and summarization tool that helps you quickly obtain and analyze the latest news.

Core Features

1. News Search

  • Ask the user for a search topic
  • Search for 12-25 relevant news articles from the past 3-5 days
  • Search Tools: Prioritize using WebSearch, use Brave Search MCP when unavailable
  • Brave Search Restrictions: Must
    sleep 1
    second after each call to prevent rate limiting
  • Search Optimization:
    • Use multiple keyword combinations for search
    • Search in batches to ensure sufficient results
    • Automatic deduplication (title/URL)
    • If fewer than 12 results are obtained, expand the time range or keywords

2. News Analysis

Extract the following information for each news article:
  • Title
  • Source website
  • Publication time
  • Authority assessment (High/Medium/Low)
  • Summary (100-200 words)
  • Original link

3. Generate HTML Page

  • Output Directory:
    <current working directory>/news-summary/<timestamp>_<topic>/
    • Get the absolute path of the current working directory via
      pwd
    • <timestamp>
      format:
      YYYYMMDD_HHMM
      (e.g.:
      20260111_1145
      ), ensuring a unique directory for each search
    • <topic>
      extracts keywords from the user's query (e.g.:
      AI
      ,
      deepseek
      ), use
      news
      if extraction fails
    • Example:
      /path/to/work/news-summary/20260111_1145_AI/
  • File Name:
    news_summary_<topic>.html
  • AI Interpretation Directory:
    <current working directory>/news-summary/<timestamp>_<topic>/analysis/
  • Interpretation File Name:
    news_analysis_<newsId>.md
  • Page Features:
    • Beautiful responsive design
    • Card-style news display
    • Each news article includes: title, source, time, authority label, summary
    • Two buttons: "View Original" and "AI Interpretation"
    • Must include before </body>:
      <script src="/news-ai.js"></script>

4. AI Interpretation Function

  • Server: Node.js HTTP server (lib/server.js, port 3456)
  • Real AI Analysis: Generate in-depth interpretations via Claude Code CLI
  • Output Format: Complete HTML page
    • Storage location:
      <working directory>/news-summary/<timestamp_topic>/analysis/news_analysis_<id>.html
    • Contains complete HTML structure (<!DOCTYPE html>, <html>, <head>, <body>, etc.)
    • Uses modern CSS styles and responsive design
    • Color theme uses gradient of #667eea and #764ba2
    • Contains complete structure including news information, analysis content, bottom copyright, etc.
  • Custom Prompt: Enter a custom analysis angle after clicking the "AI Interpretation" button
  • Blocking and Timeout:
    • Display loading modal during generation
    • Automatically abort after 120 seconds timeout
  • File Management:
    • Generated: Display "View AI Interpretation" and "Delete Interpretation" buttons
    • Not generated: Display "AI Interpretation" button
    • Support deletion and regeneration
  • Service Endpoints:
    • GET /check-analysis?newsId=<id>&timestamp=<timestamp_topic>
      - Check if the interpretation file exists
    • POST /analyze
      - Generate AI interpretation (supports customPrompt, outputs complete HTML)
    • DELETE /delete-analysis?newsId=<id>&timestamp=<timestamp_topic>
      - Delete interpretation
    • GET /view-analysis?newsId=<id>&timestamp=<timestamp_topic>
      - View interpretation (directly returns HTML)
    • GET /news-summary/<timestamp_topic>/<filename>
      - Static file service
    • GET /news-ai.js
      - Frontend script

5. Restart Server and Open Browser

  • Server Restart Steps (must be executed after each generation):
    1. Check if port 3456 is occupied:
      • Windows:
        netstat -ano | findstr 3456
      • macOS/Linux:
        lsof -ti:3456
        or
        netstat -ano | grep 3456
    2. If the port is occupied, stop the old server:
      • Windows:
        taskkill /F /PID <process ID>
      • macOS/Linux:
        kill -9 <process ID>
    3. Restart the server:
      • Windows:
        start /B node <skill directory>/lib/server.js
      • macOS/Linux:
        node <skill directory>/lib/server.js &
    4. Wait 2 seconds to ensure the server starts
    5. Verify startup: Access
      http://localhost:3456/news-ai.js
      should return JavaScript code
  • After generating HTML, open the browser via HTTP
  • Browser Commands:
    • Windows:
      Start-Process "http://localhost:3456/news-summary/<timestamp_topic>/news_summary_<topic>.html"
    • macOS:
      open "http://localhost:3456/news-summary/<timestamp_topic>/news_summary_<topic>.html"
    • Linux:
      xdg-open "http://localhost:3456/news-summary/<timestamp_topic>/news_summary_<topic>.html"
  • Important: Must access via HTTP, do not use file:// protocol

Workflow

  1. Ask the user for a search topic
  2. Generate Unique Identifier:
    • Extract keywords from the query as
      <topic>
      (use
      news
      if extraction fails)
    • Generate timestamp:
      <timestamp>
      =
      YYYYMMDD_HHMM
      format
    • Combine as:
      <timestamp>_<topic>
      (e.g.:
      20260111_1145_AI
      )
  3. Search for news (prioritize WebSearch; Brave Search requires 1-second interval)
  4. Analyze and organize news information
  5. Get Current Working Directory: Use Bash command
    pwd
    to get the absolute path
  6. Create Directory:
    <current working directory>/news-summary/<timestamp>_<topic>/
  7. Generate HTML:
    • File path:
      <current working directory>/news-summary/<timestamp>_<topic>/news_summary_<topic>.html
    • Must add before </body>:
      <script src="/news-ai.js"></script>
    • Each news card must include data attributes (data-news-id, data-news-url, data-news-source, data-news-time)
  8. Restart Server:
    • Check if port 3456 is occupied
    • If occupied, stop the old server
    • Start new server:
      node <skill directory>/lib/server.js &
    • Wait 2 seconds and verify
  9. Open browser:
    http://localhost:3456/news-summary/<timestamp_topic>/news_summary_<topic>.html

HTML Template Requirements

  • Modern and concise design, responsive layout
  • Card-style news display
  • Each news card must include data attributes:
    • data-news-id
      : News ID (0, 1, 2...)
    • data-news-url
      : Original link
    • data-news-source
      : Source
    • data-news-time
      : Publication time
    • data-news-title
      : News title
    • data-news-summary
      : News summary
  • Authority labels: High (green), Medium (yellow), Low (gray)
  • Relative time display (e.g.: 2 days ago)
  • Must introduce before </body>:
    <script src="/news-ai.js"></script>
    (use absolute path)
  • Initially only include "View Original" button, AI interpretation button is dynamically added by news-ai.js after page loads

Notes

  • Use absolute paths (get current working directory via
    pwd
    )
  • Create necessary directory structures
  • Handle network request failures
  • Verify news source reliability
  • Must include
    <script src="/news-ai.js"></script>
    in HTML
    , otherwise AI interpretation function will not be available
  • Timestamp Format: Must use
    YYYYMMDD_HHMM
    format to ensure a unique directory for each search
  • Server Must Be Restarted: Must restart the server after each news generation to ensure WORK_DIR points to the current working directory