An intelligent news search and summarization tool that helps you quickly obtain and analyze the latest news.
Core Features
1. Search News
- Ask the user for the search topic
- Search 12-25 related news items from the past 3-5 days
- Search tool: Prefer WebSearch; when unavailable, use Brave Search MCP
- Brave Search limit: after each call, must
sleep 1seconds to prevent rate limiting - Search optimization:
- Use multiple keyword combinations for searching
- Search in batches to ensure sufficient results
- Automatic deduplication (title/URL)
- If results are fewer than 12, expand the time range or keywords
2. Analyze News
For each news item, extract:
- Title
- Source website
- Publish time
- Authority assessment (high/medium/low)
- Summary (100-200 characters)
- Original link
3. Generate HTML Page
- Output directory:
<当前工作目录>/news-summary/<timestamp>_<topic>/- Through
pwdget the absolute path of the current working directory <timestamp>Format:YYYYMMDD_HHMM(e.g.:20260111_1145), ensuring each search has a unique directory<topic>Extract keywords from the user query (e.g.:AI、deepseek), when unable to extract, usenews- Example:
/path/to/work/news-summary/20260111_1145_AI/
- Through
- File name:
news_summary_<topic>.html - AI interpretation directory:
<当前工作目录>/news-summary/<timestamp>_<topic>/analysis/ - Interpretation file name:
news_analysis_<newsId>.md - Page features:
- Beautiful responsive design
- Card-style news display
- Each news item includes: title, source, time, authority label, summary
- Two buttons: "View Original" and "AI Interpretation"
- Must be included before:
<script src="/news-ai.js"></script>
4. AI Interpretation Feature
- Server: Node.js HTTP server (lib/server.js, port 3456)
- Real AI analysis: Generate in-depth interpretation through Claude Code CLI
- Output format: complete HTML page
- Storage location:
<工作目录>/news-summary/<timestamp_topic>/analysis/news_analysis_<id>.html - Contains complete HTML structure (,,, etc.)
- Uses modern CSS styles, responsive design
- Color theme uses #667eea and #764ba2 gradient
- Contains complete structure including news information, analysis content, footer copyright, etc.
- Storage location:
- Custom Prompt: After clicking the "AI Interpretation" button, you can enter a custom analysis angle
- Blocking and timeout:
- Display a loading modal during generation
- Automatically abort after a 120-second timeout
- File management:
- Generated: display "View AI Interpretation" and "Delete Interpretation" buttons
- Not generated: display "AI Interpretation" button
- Supports deletion and regeneration
- Service endpoint:
GET /check-analysis?newsId=<id>×tamp=<timestamp_topic>- Check whether the interpretation file existsPOST /analyze- Generate AI interpretation (supports customPrompt, outputs complete HTML)DELETE /delete-analysis?newsId=<id>×tamp=<timestamp_topic>- Delete interpretationGET /view-analysis?newsId=<id>×tamp=<timestamp_topic>- View interpretation (directly returns HTML)GET /news-summary/<timestamp_topic>/<filename>- Static file serviceGET /news-ai.js- Frontend script
5. Restart the server and open the browser
- Steps to restart the server(must be executed after each generation):
- Check whether port 3456 is occupied:
- Windows:
netstat -ano | findstr 3456 - macOS/Linux:
lsof -ti:3456ornetstat -ano | grep 3456
- Windows:
- If the port is occupied, stop the old server:
- Windows:
taskkill /F /PID <进程ID> - macOS/Linux:
kill -9 <进程ID>
- Windows:
- Restart the server:
- Windows:
start /B node <skill目录>/lib/server.js - macOS/Linux:
node <skill目录>/lib/server.js &
- Windows:
- Wait 2 seconds to ensure the server has started
- Verify startup: visit
http://localhost:3456/news-ai.jsshould return JavaScript code
- Check whether port 3456 is occupied:
- After generating the HTML, open the browser via HTTP
- Browser command:
- 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"
- Windows:
- Important: must be accessed via HTTP, cannot use the file:// protocol
Workflow
- Ask the user for the search topic
- Generate a unique identifier:
- Extract keywords from the query as
<topic>(if unable to extract, usenews) - Generate timestamp:
<timestamp>=YYYYMMDD_HHMMformat - Combine as:
<timestamp>_<topic>(e.g.:20260111_1145_AI)
- Extract keywords from the query as
- Search news (WebSearch preferred; Brave Search requires a 1-second interval)
- Analyze and organize news information
- Get the current working directory: use the Bash command
pwdto get the absolute path - Create directory:
<当前工作目录>/news-summary/<timestamp>_<topic>/ - Generate HTML:
- File path:
<当前工作目录>/news-summary/<timestamp>_<topic>/news_summary_<topic>.html - Must be added before:
<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)
- File path:
- Restart the server:
- Check whether port 3456 is occupied
- If occupied, stop the old server
- Start a new server:
node <skill目录>/lib/server.js & - Wait 2 seconds and verify
- Open the browser:
http://localhost:3456/news-summary/<timestamp>_<topic>/news_summary_<topic>.html
HTML template requirements
- Modern and clean 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 linkdata-news-source: sourcedata-news-time: publish timedata-news-title: news titledata-news-summary: news summary
- Authority labels: high (green), medium (yellow), low (gray)
- Relative time display (e.g.: 2 days ago)
- Must be introduced before:
<script src="/news-ai.js"></script>(use absolute path) - Initially only includes the "View original" button, the AI interpretation button is dynamically added by news-ai.js after the page loads
Notes
- Use absolute paths (via
pwdto get the current working directory) - Create the necessary directory structure
- Handle network request failures
- Verify the reliability of news sources
- Must be included in the HTML
<script src="/news-ai.js"></script>, otherwise the AI interpretation feature is unavailable - Timestamp format: must use
YYYYMMDD_HHMMformat, ensuring each search has a unique directory - The server must be restarted: the server must be restarted after each news generation to ensure WORK_DIR points to the current working directory