当前位置: 首页 > Skill >

lastXdays

lastXdays

1.0.2 2026.11.23 浏览:212
获取Skill文件查看使用说明
作者:顾澄许可证:
本文目录展开

lastXdays Skill

Summarize what happened in the last N days (or a specific YYYY-MM-DD → YYYY-MM-DD range) about a user-provided topic.

Default behavior is web-first (web_search + selective web_fetch). If optional credentials/data are available, you may ingest Reddit via API and X via x-cli (preferred), API, or local archive, falling back to web search if unavailable.

Trigger Patterns

Activate when the user message contains any of:

  • lastXdays / lastxdays
  • last x days
  • A question like: "what happened in the last N days" (optionally followed by a topic)

Default Model

Default to sonnet (anthropic/claude-sonnet-4-6) when spawning as a subagent.

Use flash (openrouter/google/gemini-2.0-flash-001) only for simple single-source lookups (one topic, one platform, straightforward synthesis with no file reading required). Flash is unreliable for multi-step agentic work requiring tool chaining (search → fetch → read files → synthesize → report). When in doubt, use sonnet.

Input Parsing

Parse from the user message:

1) Date range (preferred if explicit)

If the user supplies a range like:

  • from 2026-01-10 to 2026-02-08
  • 2026-01-10 → 2026-02-08

Then:

  • start = YYYY-MM-DD
  • end = YYYY-MM-DD
  • Ignore N if both are present.

2) Days (N)

Otherwise, infer N:

  • Look for an integer N associated with the request, e.g.:
    • lastxdays 7 <topic>
    • 7 lastxdays <topic>
    • what happened in the last 14 days (about|re:) <topic>
  • Default: N = 30
  • Clamp: N = min(max(N, 1), 365)

3) Sources (optional)

Supported: web|reddit|x|all.

Accept any of:

  • for web / sources web
  • for reddit / sources reddit
  • for x / sources x
  • for all / sources all

If unspecified: sources = all.

4) Topic

  • The remaining text (after removing trigger words, N/range, and source phrases) is the topic.
  • If topic is empty/unclear, ask exactly one clarifying question and stop.

Date Range (freshness)

Use an inclusive range in local time:

  • freshness = start + "to" + end (e.g., 2026-01-10to2026-02-08)

Helper for “last N days”:

  • node scripts/lastxdays_range.js <N>

Optional non-web ingestion (Reddit/X)

Use this helper to ingest Reddit/X when possible:

  • node scripts/lastxdays_ingest.js --source=reddit|x --topic "..." --start YYYY-MM-DD --end YYYY-MM-DD --limit 40

The script attempts:

  • Reddit: official API via OAuth (if credentials exist), else returns fallback:true
  • X: x-cli search first (if installed/configured), then Twitter API v2 recent search (if bearer token + range <= ~7 days), then local archive at ~/clawd/data/x-archive/, else returns fallback:true

Required environment variables (if you want API mode):

  • Reddit:

    • REDDIT_CLIENT_ID
    • REDDIT_CLIENT_SECRET
    • either REDDIT_REFRESH_TOKEN (recommended) or REDDIT_USERNAME + REDDIT_PASSWORD
    • optional: REDDIT_USER_AGENT
  • X API (optional; only works for recent ranges on most tiers):

    • X_BEARER_TOKEN (also accepts TWITTER_BEARER_TOKEN)
  • x-cli (optional, preferred for agent use):

    • Install: uv tool install x-cli (or from source)
    • Configure credentials in ~/.config/x-cli/.env (supports shared setup with x-mcp)
    • If present, lastxdays_ingest.js uses it before raw API/archive for X search

Credentials loader:

  • Reads ~/.config/last30days/.env if present (does not hard-fail if missing)
  • Environment variables override .env values (file only fills blanks)

Research Procedure

  1. Compute start/end/freshness.

  2. For each requested source:

Web

  • Query: <topic>
  • Run web_search with freshness (count 5–8)
  • Optionally web_fetch 2–6 best links

Reddit

Preferred:

  • Run node scripts/lastxdays_ingest.js --source=reddit ...
  • If it returns fallback:false, treat returned items[] as “Notable links” (each has a Reddit permalink URL).
  • If items[] is empty / too small to be useful (e.g., <3), you may also run the web fallback to broaden coverage.

Fallback (if fallback:true):

  • Run web_search with query site:reddit.com/r <topic> and the same freshness

X

Preferred:

  • Run node scripts/lastxdays_ingest.js --source=x ...
  • If mode=x-cli, mode=api, or mode=archive, treat returned items[] as “Notable links” (each has a URL)
    • If mode=x-cli, note that X results came from local x-cli execution
    • If mode=archive, note that links come from the local X archive
  • If items[] is empty / too small to be useful (e.g., <3), you may also run the web fallback to broaden coverage.

Fallback (if fallback:true):

  • Run web_search with query site:x.com <topic> and the same freshness
  • Expect web_fetch to fail often on x.com; rely on snippets when needed
  1. Select and deduplicate links/items:
  • Prefer authoritative sources for Web
  • Prefer high-engagement or highly-informative posts for Reddit/X
  • Keep total links/items shown to ~10–20 max

Output Format (Markdown)

Title:

  • ## lastXdays — <N> days — <topic>
    • If an explicit range was used, you may replace <N> days with YYYY-MM-DD → YYYY-MM-DD.

Then include sections in this order:

  1. Date range used
  • YYYY-MM-DD → YYYY-MM-DD (and optionally the freshness string)
  1. Top themes
  • 3–7 bullets summarizing the dominant storylines/trends
  1. Notable links Group by platform in this order, including only platforms actually searched:
  • Web
  • Reddit
  • X

For each link/item:

  • Markdown link
  • One line: why it matters
  • If snippet-only (fetch failed/unavailable), say so
  1. What to follow up on
  • 3 copy/pasteable next searches

Smoke tests (local)

Date range helper:

  • node scripts/lastxdays_range.js 7

Reddit ingest (requires creds or it will return fallback=true):

  • node scripts/lastxdays_ingest.js --source=reddit --topic "OpenClaw security vulnerability CVE" --start 2026-02-07 --end 2026-02-08 --limit 20 --pretty

X ingest (x-cli if installed; else API if bearer token + <=7 days; else local archive; else fallback=true):

  • node scripts/lastxdays_ingest.js --source=x --topic "OpenClaw" --start 2026-02-07 --end 2026-02-08 --limit 20 --pretty

Optional x-cli direct smoke test:

  • x-cli -v -j tweet search "OpenClaw since:2026-02-07 until:2026-02-09" --max 20

Examples

  • lastxdays AI agents for web
  • last x days 10 bitcoin ETF flows
  • what happened in the last 7 days about OpenAI for reddit
  • 14 lastXdays Apple Vision Pro for web
  • lastxdays 30 OpenAI sources all
  • lastxdays from 2026-01-01 to 2026-01-15 about Anthropic sources reddit

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,031
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,029
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,017
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,014
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,011
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,011
Skill 文件
  • SKILL.md
    • lastXdays Skill
    • Trigger Patterns
    • Default Model
    • Input Parsing
      • 1) Date range (preferred if explicit)
      • 2) Days (N)
      • 3) Sources (optional)
      • 4) Topic
    • Date Range (freshness)
    • Optional non-web ingestion (Reddit/X)
    • Research Procedure
      • Web
      • Reddit
      • X
    • Output Format (Markdown)
    • Smoke tests (local)
    • Examples
  • 项目或源文件

相关 Skill

更多
Reddit Reddit 通过 Reddit API 管理帖子、评论、子版块、用户、审核及社区工作流。适用于用户搜索子版块、检查帖子等场景。
Reddit API Reddit API 使用单一 API 密钥拉取 Reddit 数据(子版块、帖子及社区信息),用于代理、自动化和数据分析。返回结构化 JSON,按积分计费,无需额外设置。
Fapi Reddit Fapi Reddit 通过自然语言调用 fapi.uk 提供的 Reddit API,实现用户、子版块帖子查询和搜索等功能,无需手动组装参数。
Reddit Search Reddit Search Reddit 搜索 — 搜索超 1 亿条索引 Reddit 数据,涵盖帖子、评论、用户及子版块。查找讨论、追踪话题、发现社区并分析互动。无需 Reddit API 密钥,通过 Xpoz MCP 支持自然语言查询。
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.