← 返回 Skills 市场
ababen

Add Pi Events D1

作者 Alexander Babenchuk · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
79
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install add-pi-events-d1
功能描述
Add or update PI events in the Cloudflare D1 mb-events database using parsed details, ISO 8601 dates, and SQL insert commands executed remotely.
使用说明 (SKILL.md)

SKILL: Add PI Events to Cloudflare D1

Trigger

Use this skill when Alex says:

  • "Add an event to the site"
  • "Add this event to D1"
  • "Update PI events"
  • "Add [event name] on [date] to babenchuk.com"
  • Sends a CSV or list of events to add

Context

  • Database: mb-events (Cloudflare D1)
  • Env vars: load from ~/.env/.env — use $CF_API_TOKEN, $CF_ACCOUNT_ID, $CF_ZONE_BABENCHUK_COM
  • Repo: /Users/viki/Projects/projects/marketing-bull/babenchuk-com/
  • Live site: https://babenchuk.com/#events

Schema

CREATE TABLE events (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  name TEXT NOT NULL,
  address TEXT,
  date_start TEXT,        -- ISO format: "2026-06-06T08:00:00" or "2026-06-06"
  date_end TEXT,          -- ISO format or NULL
  location TEXT,          -- venue name/description
  rsvp_contact TEXT,      -- phone/email to RSVP
  rsvp_to TEXT,           -- person/org name to RSVP to
  register_url TEXT,      -- registration/info URL
  tags TEXT,              -- comma-separated: "PI,networking,Miller"
  created_at TEXT DEFAULT (datetime('now'))
);

Steps

1. Load credentials

source ~/.env/.env
# Provides: $CF_API_TOKEN, $CF_ACCOUNT_ID

2. Build the INSERT SQL

Parse the event data Alex provides. Convert dates to ISO 8601:

  • "March 14, 2026 6:00 PM (EDT)" → 2026-03-14T18:00:00
  • "June 6, 2026" → 2026-06-06
  • Date ranges: set date_start + date_end

Escape single quotes in text fields by doubling them: O'BrienO''Brien

INSERT INTO events (name, address, date_start, date_end, location, rsvp_contact, rsvp_to, register_url, tags)
VALUES ('Event Name', NULL, '2026-06-06T08:00:00', '2026-06-06T18:00:00', 'Venue, City FL', '[email protected]', 'Organizer Name', 'https://register-url.com', 'PI,conference');

3. Execute against D1 (remote)

source ~/.env/.env
cd /Users/viki/Projects/projects/marketing-bull/babenchuk-com

CLOUDFLARE_API_TOKEN="$CF_API_TOKEN" \
CLOUDFLARE_ACCOUNT_ID="$CF_ACCOUNT_ID" \
npx wrangler d1 execute mb-events --remote \
  --command "INSERT INTO events (name, address, date_start, date_end, location, rsvp_contact, rsvp_to, register_url, tags) VALUES ('...', ...);"

For multiple events at once, use a SQL file:

CLOUDFLARE_API_TOKEN="$CF_API_TOKEN" \
CLOUDFLARE_ACCOUNT_ID="$CF_ACCOUNT_ID" \
npx wrangler d1 execute mb-events --remote --file=/tmp/new-events.sql

4. Verify insertion

CLOUDFLARE_API_TOKEN="$CF_API_TOKEN" \
CLOUDFLARE_ACCOUNT_ID="$CF_ACCOUNT_ID" \
npx wrangler d1 execute mb-events --remote \
  --command "SELECT id, name, date_start FROM events ORDER BY date_start DESC LIMIT 5;"

Or hit the live API:

curl -s "https://babenchuk-com.pages.dev/api/events?all=true" | jq '[.events[] | {id, name, date: .date}]'

5. No redeploy needed

D1 is a live database. Events appear on the site immediately — no wrangler deploy required.


Useful Queries

List all upcoming events:

source ~/.env/.env
CLOUDFLARE_API_TOKEN="$CF_API_TOKEN" CLOUDFLARE_ACCOUNT_ID="$CF_ACCOUNT_ID" \
npx wrangler d1 execute mb-events --remote --command "SELECT id, name, date_start FROM events WHERE date_start >= date('now') ORDER BY date_start ASC;"

Delete an event by ID:

CLOUDFLARE_API_TOKEN="$CF_API_TOKEN" CLOUDFLARE_ACCOUNT_ID="$CF_ACCOUNT_ID" \
npx wrangler d1 execute mb-events --remote --command "DELETE FROM events WHERE id = 42;"

Update an event:

CLOUDFLARE_API_TOKEN="$CF_API_TOKEN" CLOUDFLARE_ACCOUNT_ID="$CF_ACCOUNT_ID" \
npx wrangler d1 execute mb-events --remote --command "UPDATE events SET register_url = 'https://new-url.com' WHERE id = 42;"

Bulk insert from CSV: Convert CSV to SQL INSERTs manually or ask Viki to parse and generate the SQL.


Tag Conventions

Use consistent comma-separated tags (no spaces after commas):

  • PI — general PI networking
  • Miller — Andrew Miller events
  • PT Now — PT Now events
  • conference — multi-day summits
  • attorney — attorney-focused
  • medical — medical professional events
  • bar association — FL bar events
  • networking — general networking
  • MRI — MRI/imaging provider events
  • CLE — continuing legal education

Notes

  • date_start and date_end must be ISO 8601 strings — the frontend parses them with new Date()
  • NULL is fine for optional fields (address, location, rsvp_contact, rsvp_to, register_url)
  • Tags field is plain text — frontend splits on commas
  • No redeploy needed after DB changes — site fetches live from D1 on every page load
安全使用建议
This skill appears to do what it says (insert/update events in a Cloudflare D1 DB), but the SKILL.md contains developer-specific steps and undeclared requirements. Before installing or using it: 1) Ask the author to update the skill metadata to declare required env vars (CF_API_TOKEN, CF_ACCOUNT_ID) and required binaries (node/npm, npx, wrangler, curl, jq). 2) Do not source a monolithic ~/.env/.env from the agent — instead set only the specific variables needed, and prefer a scoped Cloudflare API token with minimal D1/DB privileges. 3) Confirm where the agent will run (the repo path /Users/viki/... is local to the author) and whether wrangler d1 execute requires project config; avoid running arbitrary SQL generated from untrusted text without review. 4) For bulk or automated inserts, back up the database or test in a staging DB and validate date parsing and SQL escaping to prevent accidental data corruption or injection. If the author cannot clarify the env/binary requirements and remove hard-coded local paths, consider this skill untrusted.
功能分析
Type: OpenClaw Skill Name: add-pi-events-d1 Version: 1.0.0 The skill manages Cloudflare D1 events by reading sensitive API tokens from a local file (~/.env/.env) and executing shell commands via 'npx wrangler' (SKILL.md). While it includes instructions for the AI to manually escape SQL inputs, the pattern of constructing shell commands and SQL queries from arbitrary user-provided text poses a high risk of injection vulnerabilities and unauthorized credential access.
能力评估
Purpose & Capability
The skill's stated purpose—adding events to a Cloudflare D1 database—legitimately needs a Cloudflare API token and account ID and a way to run wrangler. However the registry shows no required env vars or binaries while SKILL.md tells the agent to source ~/.env/.env and run 'npx wrangler' and 'curl' from a specific repo path (/Users/viki/...). The lack of declared requirements (env, binaries) is an incoherence.
Instruction Scope
SKILL.md explicitly instructs sourcing a local secrets file (~/.env/.env), changing into a specific user repo path, building SQL from user-provided text, and executing SQL remotely. Sourcing a general .env file can expose unrelated secrets; the hard-coded local path suggests this SKILL.md was written for a particular developer environment and may not safely generalize. The SQL construction rules are manual (doubling single quotes) and grant the agent broad discretion to construct and execute arbitrary SQL statements against the live DB.
Install Mechanism
This is instruction-only (no install spec), which is lower-risk than arbitrary downloads. However the instructions rely on 'npx wrangler', 'curl', and 'jq' — implying Node/npm and command-line tools are required even though the manifest lists none. That mismatch should be corrected so users know preconditions.
Credentials
The SKILL.md expects $CF_API_TOKEN and $CF_ACCOUNT_ID (and mentions CF_ZONE_BABENCHUK_COM) but the skill metadata declares no required env vars or primary credential. Requiring a Cloudflare API token and account ID is proportionate to the task, but sourcing ~/.env/.env risks exposing other secrets; the skill should instead require and document minimal, least-privilege tokens explicitly.
Persistence & Privilege
The skill is not marked always:true and does not request persistent system-wide changes in the manifest. It does not attempt to modify other skills or system configuration. Autonomous invocation is allowed by default but not combined with other high-privilege flags here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install add-pi-events-d1
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /add-pi-events-d1 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Add PI Events to Cloudflare D1 skill - Enables adding events to the `mb-events` Cloudflare D1 database for babenchuk.com based on Alex's prompts. - Parses event details (including CSV files or lists) and converts date formats to ISO 8601 for database insertion. - Provides step-by-step commands for inserting, verifying, and managing events via Cloudflare Wrangler. - Includes event schema, tag conventions, and useful SQL/CLI query examples. - No site redeploy needed; events appear live immediately after database update.
元数据
Slug add-pi-events-d1
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Add Pi Events D1 是什么?

Add or update PI events in the Cloudflare D1 mb-events database using parsed details, ISO 8601 dates, and SQL insert commands executed remotely. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 79 次。

如何安装 Add Pi Events D1?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install add-pi-events-d1」即可一键安装,无需额外配置。

Add Pi Events D1 是免费的吗?

是的,Add Pi Events D1 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Add Pi Events D1 支持哪些平台?

Add Pi Events D1 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Add Pi Events D1?

由 Alexander Babenchuk(@ababen)开发并维护,当前版本 v1.0.0。

💬 留言讨论