# Send lastXdays to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "lastxdays",
    "name": "lastXdays",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/levineam/lastxdays",
    "canonicalUrl": "https://clawhub.ai/levineam/lastxdays",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/lastxdays",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=lastxdays",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-07T17:22:31.273Z",
      "expiresAt": "2026-05-14T17:22:31.273Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=afrexai-annual-report",
        "contentDisposition": "attachment; filename=\"afrexai-annual-report-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/lastxdays"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/lastxdays",
    "downloadUrl": "https://openagent3.xyz/downloads/lastxdays",
    "agentUrl": "https://openagent3.xyz/skills/lastxdays/agent",
    "manifestUrl": "https://openagent3.xyz/skills/lastxdays/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/lastxdays/agent.md"
  }
}
```
## Documentation

### 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

Compute start/end/freshness.


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

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:

Date range used

YYYY-MM-DD → YYYY-MM-DD (and optionally the freshness string)

Top themes

3–7 bullets summarizing the dominant storylines/trends

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

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
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: levineam
- Version: 1.0.2
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-05-07T17:22:31.273Z
- Expires at: 2026-05-14T17:22:31.273Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/lastxdays)
- [Send to Agent page](https://openagent3.xyz/skills/lastxdays/agent)
- [JSON manifest](https://openagent3.xyz/skills/lastxdays/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/lastxdays/agent.md)
- [Download page](https://openagent3.xyz/downloads/lastxdays)