← Back to Skills Marketplace
ababen

Add Pi Events D1

by Alexander Babenchuk · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
79
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install add-pi-events-d1
Description
Add or update PI events in the Cloudflare D1 mb-events database using parsed details, ISO 8601 dates, and SQL insert commands executed remotely.
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install add-pi-events-d1
  3. After installation, invoke the skill by name or use /add-pi-events-d1
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug add-pi-events-d1
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is 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. It is an AI Agent Skill for Claude Code / OpenClaw, with 79 downloads so far.

How do I install Add Pi Events D1?

Run "/install add-pi-events-d1" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Add Pi Events D1 free?

Yes, Add Pi Events D1 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Add Pi Events D1 support?

Add Pi Events D1 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Add Pi Events D1?

It is built and maintained by Alexander Babenchuk (@ababen); the current version is v1.0.0.

💬 Comments