Agent Skillsnodetool-ai/nodetool › sandbox-dates

sandbox-dates

GitHub

提供沙箱环境内的日期解析、格式化及算术运算能力,基于date-fns库。适用于需要在代码节点中处理时间逻辑的场景,支持UTC模式下的日期计算与字符串转换。

packages/sandbox-packs/sandbox-dates/SKILL.md nodetool-ai/nodetool

Trigger Scenarios

需要解析ISO日期字符串 进行日期加减或比较运算 将Date对象格式化为特定文本

Install

npx skills add nodetool-ai/nodetool --skill sandbox-dates -g -y
More Options

Non-standard path

npx skills add https://github.com/nodetool-ai/nodetool/tree/main/packages/sandbox-packs/sandbox-dates -g -y

Use without installing

npx skills use nodetool-ai/nodetool@sandbox-dates

指定 Agent (Claude Code)

npx skills add nodetool-ai/nodetool --skill sandbox-dates -a claude-code -g -y

安装 repo 全部 skill

npx skills add nodetool-ai/nodetool --all -g -y

预览 repo 内 skill

npx skills add nodetool-ai/nodetool --list

SKILL.md

Frontmatter
{
    "name": "sandbox-dates",
    "description": "Date arithmetic, parsing and formatting inside a Code node or CodeAct action, with date-fns running in the guest"
}

Dates in the sandbox

Specifier: @nodetool-ai/sandbox-dates. One module, date-fns's root export — around 250 named functions. There is no default export, so import the names you use.

Arithmetic and comparison

import { addDays, differenceInCalendarDays, isBefore } from "@nodetool-ai/sandbox-dates";

const due = addDays(new Date(inputs.startedAt), 30);
return { due: due.toISOString(), overdue: isBefore(due, new Date()), days: differenceInCalendarDays(due, new Date()) };

Parsing and formatting

import { parseISO, format, isValid } from "@nodetool-ai/sandbox-dates";

const when = parseISO(inputs.timestamp);
if (!isValid(when)) return { label: "unknown" };
return { label: format(when, "EEEE, d MMMM yyyy") };

format uses date-fns's own English locale tables, not Intl — which the guest does not have. That is why formatting works here at all, and it is also the limit: another language means another locale, and locales live at date-fns/locale, a subpath this pack does not publish.

Gotchas

  • UTC only. The guest runs with no time-zone database, so new Date() and every conversion behave as UTC. Anything zone-aware — "9 am in Berlin" — belongs on the host, not here.
  • Named imports only. import dates from "@nodetool-ai/sandbox-dates" gets you nothing; date-fns is pure ESM with no default export.
  • Import what you use. The bundle is about 176 KB and loads as one module per invocation, so a node that needs one comparison pays for all of it. For a single Date subtraction, plain arithmetic is cheaper.
  • No timers. setTimeout does not exist in the guest. date-fns needs none, but code around it must not either.

Version History

  • a6a7e57 Current 2026-08-20 09:52

Same Skill Collection

.claude/skills/ask-matt/SKILL.md
.claude/skills/ast-grep-outline/SKILL.md
.claude/skills/ast-grep/SKILL.md
.claude/skills/codebase-design/SKILL.md
.claude/skills/companion-clis/SKILL.md
.claude/skills/diagnosing-bugs/SKILL.md
.claude/skills/domain-modeling/SKILL.md
.claude/skills/flash/SKILL.md
.claude/skills/implement/SKILL.md
.claude/skills/improve-codebase-architecture/SKILL.md
.claude/skills/nodetool-api-reference/SKILL.md
.claude/skills/nodetool-browser-agent/SKILL.md
.claude/skills/nodetool-chat-cli/SKILL.md
.claude/skills/nodetool-custom-node-developer/SKILL.md
.claude/skills/nodetool-deployment/SKILL.md
.claude/skills/nodetool-model-provider-config/SKILL.md
.claude/skills/nodetool-rag-indexing/SKILL.md
.claude/skills/nodetool-troubleshooter/SKILL.md
.claude/skills/nodetool-workflow-builder/SKILL.md
.claude/skills/prototype/SKILL.md
.claude/skills/research/SKILL.md
.claude/skills/resolving-merge-conflicts/SKILL.md
.claude/skills/setup-matt-pocock-skills/SKILL.md
.claude/skills/tdd/SKILL.md
.claude/skills/to-spec/SKILL.md
.claude/skills/to-tickets/SKILL.md
.claude/skills/triage/SKILL.md
.claude/skills/wayfinder/SKILL.md
.claude/skills/wizard/SKILL.md
.claude/skills/yts806379-everything-claude-code-e2e-testing/SKILL.md
packages/sandbox-packs/sandbox-aws/SKILL.md
packages/sandbox-packs/sandbox-chrono/SKILL.md
packages/sandbox-packs/sandbox-color/SKILL.md
packages/sandbox-packs/sandbox-csv/SKILL.md
packages/sandbox-packs/sandbox-decimal/SKILL.md
packages/sandbox-packs/sandbox-diff/SKILL.md
packages/sandbox-packs/sandbox-docx/SKILL.md
packages/sandbox-packs/sandbox-dsl/SKILL.md
packages/sandbox-packs/sandbox-epub/SKILL.md
packages/sandbox-packs/sandbox-exif/SKILL.md
packages/sandbox-packs/sandbox-expr/SKILL.md
packages/sandbox-packs/sandbox-fabric/SKILL.md
packages/sandbox-packs/sandbox-flow/SKILL.md
packages/sandbox-packs/sandbox-gif/SKILL.md
packages/sandbox-packs/sandbox-html/SKILL.md
packages/sandbox-packs/sandbox-ics/SKILL.md
packages/sandbox-packs/sandbox-jmespath/SKILL.md
packages/sandbox-packs/sandbox-mammoth/SKILL.md
packages/sandbox-packs/sandbox-markdown/SKILL.md

Metadata

Files
0
Version
a6a7e57
Hash
91eb4caa
Indexed
2026-08-20 09:52

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-25 11:25
浙ICP备14020137号-1 $방문자$