Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.
Python aianthropicautomationclaude-codeclaude-skillscloudflaredevtoolsproductivityreactskillstailwindvite
feat: add stripe-payments skill + fix argument hints across all commands
Jeremy Dawescc605fc7e6ae
diff --git a/CLAUDE.md b/CLAUDE.mdindex a85b4eaf..d56b4283 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -16,7 +16,7 @@ Production workflow skills for Claude Code CLI. Each skill guides Claude through```claude-skills/-├── plugins/ # 11 plugins, 59 skills+├── plugins/ # 11 plugins, 60 skills│ ├── cloudflare/ # Cloudflare Workers, Hono, D1/Drizzle, Vite, TanStack Start│ │ └── skills/│ │ ├── cloudflare-worker-builder/@@ -55,7 +55,8 @@ claude-skills/│ │ ├── elevenlabs-agents/│ │ ├── mcp-builder/│ │ ├── nemoclaw-setup/-│ │ └── parcel-tracking/+│ │ ├── parcel-tracking/+│ │ └── stripe-payments/│ ├── dev-tools/ # Context, sessions, releases, brains trust, git, browser automation│ │ └── skills/│ │ ├── project-health/diff --git a/README.md b/README.mdindex 4e4dfe7a..e679e7fc 100644--- a/README.md+++ b/README.md@@ -4,7 +4,7 @@Production workflow skills for [Claude Code](https://claude.com/claude-code). Each skill guides Claude through a recipe to produce tangible output — scaffolded projects, generated assets, professional documents, deployed services.-11 plugins. 59 skills. Every one produces something.+11 plugins. 60 skills. Every one produces something.## Quick Start@@ -50,10 +50,10 @@ Then just ask Claude what you need — installed skills trigger automatically fr| Plugin | Skills | What it does ||--------|--------|-------------|| **dev-tools** | project-health, project-docs, app-docs, team-update, github-release, brains-trust, git-workflow, ux-audit, responsiveness-check, agent-browser, deep-research, onboarding-ux, fork-discipline, roadmap | Project config, doc generation, app user guides, team updates, releases, multi-model second opinions, git workflows, UX dogfooding, responsive testing, browser automation, deep research, in-app onboarding, core/client boundary audit, autonomous phased app delivery |-| **integrations** | gws-setup, gws-install, google-chat-messages, google-apps-script, elevenlabs-agents, mcp-builder, nemoclaw-setup, parcel-tracking | Google Workspace MCP setup, Google Chat webhooks, Apps Script automation, ElevenLabs voice agents, MCP server building, NVIDIA NemoClaw agent platform setup, Australian parcel tracking via Gmail |+| **integrations** | gws-setup, gws-install, google-chat-messages, google-apps-script, elevenlabs-agents, mcp-builder, nemoclaw-setup, parcel-tracking, stripe-payments | Google Workspace setup, Google Chat webhooks, Apps Script, ElevenLabs voice agents, MCP servers, NemoClaw, parcel tracking, Stripe payments (checkout, subscriptions, webhooks, billing portal) || **basalt** | basalt-cortex | Mine knowledge from Gmail, Chat, Slack, Drive, local files, MCP, web into an Obsidian-compatible vault (~/.cortex/) |-## All 59 Skills+## All 60 Skills<details><summary>Full skill list with trigger phrases</summary>@@ -89,6 +89,7 @@ Then just ask Claude what you need — installed skills trigger automatically fr| `mcp-builder` | "build mcp server", "fastmcp" || `nemoclaw-setup` | "install nemoclaw", "setup nemoclaw", "nvidia nemoclaw" || `parcel-tracking` | "where's my parcel", "track my order", "tracking number" |+| `stripe-payments` | "add payments", "stripe checkout", "subscription billing" || `project-health` | "project health", "audit permissions" || `project-docs` | "generate docs", "document architecture", "api docs" || `app-docs` | "document the app", "user guide", "screenshot docs" |diff --git a/plugins/basalt/skills/basalt-cortex/SKILL.md b/plugins/basalt/skills/basalt-cortex/SKILL.mdindex e71fbe95..f90d26c8 100644--- a/plugins/basalt/skills/basalt-cortex/SKILL.md+++ b/plugins/basalt/skills/basalt-cortex/SKILL.md@@ -1,12 +1,12 @@---name: basalt-cortex-description: "Mine knowledge from Gmail, Google Chat, Slack, Drive, local files, MCP servers, and web into an Obsidian-compatible vault (~/.cortex/). Basalt format: markdown files with YAML frontmatter for clients, contacts, communications, and knowledge facts. Opens directly in Obsidian, syncs to Frond. Triggers: 'run the cortex', 'mine emails', 'mine slack', 'mine chat', 'cortex init', 'cortex search', 'cortex stats', 'what do I know about', 'set up cortex', 'mine my inbox'."+description: "Mine knowledge from Gmail, Google Chat, Slack, Drive, local files, MCP servers, and web into an Obsidian-compatible vault (~/Documents/basalt-cortex/). Basalt format: markdown files with YAML frontmatter for clients, contacts, communications, and knowledge facts. Opens directly in Obsidian, syncs to basaltcortex.com via CLI daemon. Triggers: 'run the cortex', 'mine emails', 'mine slack', 'mine chat', 'cortex init', 'cortex search', 'cortex stats', 'what do I know about', 'set up cortex', 'mine my inbox'."compatibility: claude-code-only---# Basalt Cortex-Mine knowledge from multiple sources into Obsidian-compatible markdown files stored in `~/.cortex/`. Each file has structured YAML frontmatter. Open `~/.cortex/` in Obsidian at any time — it's a valid vault.+Mine knowledge from multiple sources into Obsidian-compatible markdown files stored in `~/Documents/basalt-cortex/`. Each file has structured YAML frontmatter. Files auto-sync to basaltcortex.com via the `basalt-cortex` CLI tray daemon.**Read [references/basalt-format.md](references/basalt-format.md) before any file operations.**@@ -29,7 +29,7 @@ Create the vault structure. Run once before first mine.### Check for existing vault```bash-ls ~/.cortex/state.json 2>/dev/null && echo "EXISTS" || echo "FRESH"+ls ~/Documents/basalt-cortex/state.json 2>/dev/null && echo "EXISTS" || echo "FRESH"```If EXISTS: ask user — skip, reset (data loss warning), or continue (add missing folders only).@@ -37,7 +37,7 @@ If EXISTS: ask user — skip, reset (data loss warning), or continue (add missin### Create structure```bash-mkdir -p ~/.cortex/{clients,contacts,communications,knowledge,projects,notes,.obsidian}+mkdir -p ~/Documents/basalt-cortex/{clients,contacts,communications,knowledge,projects,notes,.obsidian}```### Write state.json@@ -57,7 +57,7 @@ mkdir -p ~/.cortex/{clients,contacts,communications,knowledge,projects,notes,.ob### Write Obsidian config```json-// ~/.cortex/.obsidian/app.json+// ~/Documents/basalt-cortex/.obsidian/app.json{ "newFileLocation": "folder", "newFileFolderPath": "notes" }```@@ -65,7 +65,7 @@ mkdir -p ~/.cortex/{clients,contacts,communications,knowledge,projects,notes,.obCreate one example client, contact, and knowledge note in Basalt format so the user can see the structure. Use templates from [references/basalt-format.md](references/basalt-format.md).-Report the created structure to the user. Tell them to open `~/.cortex/` in Obsidian.+Report the created structure to the user. Tell them to open `~/Documents/basalt-cortex/` in Obsidian.---@@ -77,80 +77,94 @@ Extract knowledge from a source and write Basalt-format files.Ask or detect which source to mine:-| Source | Prerequisites | Fetch method |-|--------|-------------|-------------|-| **gmail** | `gws` CLI + auth | `gws gmail messages list`, `gws gmail messages get` |-| **google-chat** | `gws` CLI + auth | `gws chat spaces list`, `gws chat messages list` |+| Source | Fetch method | Notes |+|--------|-------------|-------|+| **gmail** (default) | Gmail MCP (`gmail_messages`) | Use `extract_contacts` + `list` + `get` |+| **google-chat** | Google Chat MCP (`chat_messages`) | Mine space-by-space, NOT `search_active` || **slack** | Slack MCP or API token | MCP tools or `curl` with token |-| **google-drive** | `gws` CLI + auth | `gws drive files list`, `gws drive files get` |-| **local** | — | `find` + `cat` on local directories |-| **mcp** | MCP server connected | MCP tool calls (brain_recall, vault recall, etc.) |-| **web** | Web scraper or fetch | WebFetch, Firecrawl, or browser automation |-| **calendar** | `gws` CLI + auth | `gws calendar events list` |-| **obsidian** | Existing vault path | Read `.md` files, normalise frontmatter to Basalt |+| **google-drive** | Drive MCP or `gws` CLI | Metadata + summaries, don't copy full docs |+| **local** | Read tool + Glob | `find` + `cat` on local directories |+| **mcp** | MCP tool calls | brain_recall, vault recall, etc. |+| **web** | WebFetch or browser | Firecrawl, Playwright, or WebFetch |+| **calendar** | Calendar MCP or `gws` CLI | Events, attendees, meeting notes |-Default: `gmail` if no source specified.+### Proven Extraction Workflow (Two-Phase)-### Prerequisites Check+Mining works in two phases. Phase 1 (reconnaissance) uses MCP tools interactively. Phase 2 (batch write) generates a Python script for efficiency.-```bash-# For Gmail/Chat/Drive/Calendar:-which gws || echo "MISSING: npm install -g @googleworkspace/cli"-# For AI extraction:-echo $ANTHROPIC_API_KEY | head -c 5 || echo "MISSING: set ANTHROPIC_API_KEY"-# Vault exists:-ls ~/.cortex/state.json 2>/dev/null || echo "NOT INITIALISED: run cortex init first"-```+#### Phase 1: Reconnaissance via MCP (interactive)-### Extraction Workflow+Use MCP tools to fetch raw data and identify entities. Claude does the AI extraction in-context — no external LLM call needed.-For each source, the pattern is the same:+**Gmail example:**+```+1. extract_contacts — scan 100 recent emails, get deduplicated contacts with names/emails/counts+ - Use `field: "from"` for inbound contacts+ - Use `field: "to"` for outbound contacts (from sent mail)+ - Exclude automated domains: jezweb.net, google.com, github.com, cloudflare.com, etc.-1. **Fetch** raw data (emails, messages, files, pages)-2. **Pre-filter** — skip automated content, check source_id against state.json processed list. See [references/prefilter-patterns.md](references/prefilter-patterns.md).-3. **AI Extract** — send content to an LLM with an extraction prompt (see below)-4. **Write** Basalt files — one `.md` file per entity with YAML frontmatter-5. **Update state** — add source_ids to processed list, update cursors and totals+2. list — fetch 30-50 emails per batch with bodyPreview+ - Query: `in:inbox -category:promotions -category:social -category:updates -category:forums after:YYYY/MM/DD`+ - Format: compact or full, bodyPreview: 1000-2000-### AI Extraction Prompt Pattern+3. get — fetch full content for significant threads (client conversations, support requests, decisions)-Generate a script that sends each piece of raw content to an LLM with this prompt structure:+4. Pre-filter while scanning:+ - Skip: 2FA codes, domain expiry notices, payment receipts, Wordfence alerts, auto top-ups+ - Keep: Real human conversations, support requests, project discussions, business decisions+ - See references/prefilter-patterns.md for full skip/keep rules+```+**Google Chat example:**+```+1. chat_spaces list — get all spaces with lastActiveTime+2. chat_messages list — fetch ONE space at a time, limit 25-50+ - NEVER use search_active for mining (times out on 50+ spaces)+ - Iterate space by space, save progress after each+3. Pre-filter: skip bot messages, join/leave events, webhook posts```-You are extracting structured knowledge from a [source type].-For each item, identify and output JSON for:-1. CONTACTS: people mentioned (name, email, role, company)-2. CLIENTS: businesses/organisations (name, domain, industry)-3. COMMUNICATIONS: the interaction itself (subject, participants, summary, type)-4. KNOWLEDGE: facts, decisions, preferences, commitments extracted from the content+From the fetched data, identify:+- **CLIENTS**: businesses/organisations (name, domain, industry)+- **CONTACTS**: people mentioned (name, email, role, company, phone if visible)+- **COMMUNICATIONS**: the interaction itself (subject, participants, summary, type)+- **KNOWLEDGE**: facts, decisions, preferences, commitments, relationships, deadlines-For each entity, generate a `summary` field: 1-3 sentences, dense with names and context.-This summary is used for semantic search — make it specific and useful.+For each entity, craft a `summary` field: 1-3 sentences, dense with names and context. This is the Vectorize embedding input — make it specific and useful for semantic search.-Output as JSON array of {type, data} objects.-```+#### Phase 2: Batch Write via Python Script-### Basalt File Writing Pattern+Once entities are identified, generate a Python script to write all Basalt files at once. This is dramatically faster than individual Write tool calls (55 files in one execution vs 8 tool calls for 17 files).-For each extracted entity, write a markdown file with YAML frontmatter:+**Script location:** `.jez/scripts/mine-{source}-batch.py`-- **Path**: determined by type (see basalt-format.md)-- **ID**: deterministic — `client_{domain}`, `contact_{email_slug}`, `comm_{timestamp}_{hash}`-- **Upsert**: if file exists, merge (keep earlier `first_seen`, update `last_seen`, increment `thread_count`)-- **Wikilinks**: add `[[related]]` links between connected entities+**Script must include these helper functions:**+- `slugify(text)` — lowercase, hyphens, no special chars, max 60 chars+- `write_client(domain, name, industry, summary, contacts, tags)`+- `write_contact(name, email, role, company, company_domain, summary, phone, tags)`+- `write_communication(date, subject_slug, subject, summary, participants, client_domain, comm_type, body, source_id)`+- `write_knowledge(topic_slug, summary, kind, client_domain, contact_email, body, date)`-See [references/basalt-format.md](references/basalt-format.md) for complete field specs per entity type.+**Key script behaviours:**+- Check `if path.exists(): return` — never overwrite existing files (dedup)+- Use human-readable filenames (see basalt-format.md filename conventions)+- Keep machine IDs in frontmatter (`id` field) for sync+- Update `~/.cortex/state.json` totals and run history at the end+- Print each file written for progress tracking-### Script Generation+**Data goes directly in the script** as Python data structures — not loaded from a JSON file. Claude populates the data arrays from Phase 1 analysis:-**Do NOT look for a pre-built script.** Generate a Python script in `.jez/scripts/` adapted to:-- The user's chosen source-- Their available tools (gws CLI, MCP servers, API keys)-- Their preferred LLM (Anthropic API, local Ollama, Workers AI)-- Batch size and date range from arguments+```python+clients = [+ ("bigcolour.com.au", "Big Colour", "signage",+ "Signage company. Justin is director. Active client with L2Chat agent.",+ [("Justin Big Colour", "Director")]),+ # ... more clients+]-See [references/source-patterns.md](references/source-patterns.md) for per-source fetch + extract patterns.+for domain, name, industry, summary, contacts in clients:+ write_client(domain, name, industry, summary, contacts)+```### Common Arguments@@ -165,10 +179,9 @@ See [references/source-patterns.md](references/source-patterns.md) for per-sourc| Variable | Default | Purpose ||----------|---------|---------|-| `CORTEX_DIR` | `~/.cortex` | Storage root |-| `ANTHROPIC_API_KEY` | — | For AI extraction |-| `CORTEX_BATCH_SIZE` | `50` | Items per run |-| `CORTEX_OWNER_EMAIL` | — | Your email — excluded from contacts |+| `CORTEX_DIR` | `~/Documents/basalt-cortex` | Vault root (syncs to basaltcortex.com) |+| `CORTEX_STATE` | `~/.cortex/state.json` | Cursor + run history |+| `CORTEX_OWNER_EMAIL` | `[email protected]` | Your email — excluded from contacts |---@@ -190,10 +203,10 @@ Search across Basalt files. Claude can do this natively — no script needed.```bash# Keyword search across all Basalt files-grep -rl "QUERY" ~/.cortex/ --include="*.md"+grep -rl "QUERY" ~/Documents/basalt-cortex/ --include="*.md"# Frontmatter field search-grep -rl "client_domain: example.com" ~/.cortex/ --include="*.md"+grep -rl "client_domain: example.com" ~/Documents/basalt-cortex/ --include="*.md"```For structured queries, read frontmatter with Python `frontmatter` library or parse YAML between `---` markers.@@ -203,22 +216,27 @@ For structured queries, read frontmatter with Python `frontmatter` library or pa## Stats Mode```bash-echo "Clients: $(find ~/.cortex/clients -name '*.md' 2>/dev/null | wc -l)"-echo "Contacts: $(find ~/.cortex/contacts -name '*.md' 2>/dev/null | wc -l)"-echo "Communications: $(find ~/.cortex/communications -name '*.md' 2>/dev/null | wc -l)"-echo "Knowledge: $(find ~/.cortex/knowledge -name '*.md' 2>/dev/null | wc -l)"-echo "Notes: $(find ~/.cortex/notes -name '*.md' 2>/dev/null | wc -l)"+echo "Clients: $(find ~/Documents/basalt-cortex/clients -name '*.md' 2>/dev/null | wc -l)"+echo "Contacts: $(find ~/Documents/basalt-cortex/contacts -name '*.md' 2>/dev/null | wc -l)"+echo "Communications: $(find ~/Documents/basalt-cortex/communications -name '*.md' 2>/dev/null | wc -l)"+echo "Knowledge: $(find ~/Documents/basalt-cortex/knowledge -name '*.md' 2>/dev/null | wc -l)"+echo "Notes: $(find ~/Documents/basalt-cortex/notes -name '*.md' 2>/dev/null | wc -l)"```Also read `state.json` for last run date, cursor positions, and run history.----## Sync Mode (Future)+## Sync Mode++Files in `~/Documents/basalt-cortex/` auto-sync to basaltcortex.com via the `basalt-cortex` CLI tray daemon. No manual sync needed.-Push Basalt files to Frond, D1, or Vectorize. See [references/sync-patterns.md](references/sync-patterns.md).+The daemon uses chokidar to watch for file changes and pushes to the API with content hash comparison (skip unchanged files) and last-write-wins conflict resolution.-Not yet built — placeholder for when Frond API token auth is ready.+**Start daemon:** `basalt-cortex tray` (runs in system tray)+**Manual push:** `basalt-cortex push`+**Manual pull:** `basalt-cortex pull`+**Bidirectional:** `basalt-cortex sync` (watches local + polls remote every 30s)---@@ -235,6 +253,7 @@ Not yet built — placeholder for when Frond API token auth is ready.| When | Read ||------|------|| Before any file operations | [references/basalt-format.md](references/basalt-format.md) |+| When extracting semantic fields from threads | [references/field-catalog.md](references/field-catalog.md) || Per-source fetch and extract patterns | [references/source-patterns.md](references/source-patterns.md) || Before processing raw content | [references/prefilter-patterns.md](references/prefilter-patterns.md) || When syncing to Frond/D1/Vectorize | [references/sync-patterns.md](references/sync-patterns.md) |diff --git a/plugins/basalt/skills/basalt-cortex/references/basalt-format.md b/plugins/basalt/skills/basalt-cortex/references/basalt-format.mdindex 11faa18b..5941a1c4 100644--- a/plugins/basalt/skills/basalt-cortex/references/basalt-format.md+++ b/plugins/basalt/skills/basalt-cortex/references/basalt-format.md@@ -20,7 +20,7 @@ Files are the source of truth. D1, Vectorize, and Frond are projections.## Folder Structure```-~/.cortex/ # vault root — open in Obsidian directly+~/Documents/basalt-cortex/ # vault root — syncs to basaltcortex.com via CLI daemon├── .obsidian/ # Obsidian config (can be empty or gitignored)├── clients/│ └── smithholdings.com.au.md@@ -28,9 +28,9 @@ Files are the source of truth. D1, Vectorize, and Frond are projections.│ └── jane-smith.md├── communications/│ └── 2026/03/-│ └── comm_1741824000_a3f2.md+│ └── 2026-03-10-website-redesign-quote.md├── knowledge/-│ └── know_1741824000_b7c1.md+│ └── smith-holdings-prefers-phone.md├── projects/ # future├── notes/ # manual notes, not mined└── state.json # cursor + run history (not a note)@@ -70,7 +70,9 @@ visibility: private # private | team | public### `id` generation rules-| Type | Pattern | Example |+The `id` field is for machine dedup/sync. It stays deterministic and unique.++| Type | ID Pattern | Example ||------|---------|---------|| client | `client_{domain}` | `client_smithholdings.com.au` || contact | `contact_{email_slug}` | `contact_jane-smith-smithholdings.com.au` |@@ -78,6 +80,24 @@ visibility: private # private | team | public| knowledge | `know_{unix_ts}_{4char_hash}` | `know_1741824000_b7c1` || project | `project_{slug}` | `project_smith-redesign-2025` |+### Filename conventions (human-readable)++Filenames are what users see in the sidebar. They should be scannable and descriptive. The `id` in frontmatter handles dedup — the filename is for humans.++| Type | Filename Pattern | Example |+|------|-----------------|---------|+| client | `{domain}.md` | `smithholdings.com.au.md` |+| contact | `{first-last}.md` | `jane-smith.md` |+| communication | `{YYYY-MM-DD}-{subject-slug}.md` | `2026-03-10-website-redesign-quote.md` |+| knowledge | `{topic-slug}.md` | `smith-holdings-prefers-phone.md` |+| project | `{project-slug}.md` | `smith-redesign-2025.md` |++**Rules:**+- Slugify: lowercase, hyphens, no special characters+- Communications: always lead with ISO date for chronological sorting+- Knowledge: lead with the subject/client, describe the fact+- Keep slugs under ~60 chars — long enough to be descriptive, short enough to scan+---## Type: `client`@@ -162,43 +182,106 @@ related: ["[[clients/smithholdings.com.au]]"]## Type: `communication`-File: `communications/{YYYY}/{MM}/{id}.md`+File: `communications/{YYYY}/{MM}/{YYYY-MM-DD}-{subject-slug}.md`++Communications use a **universal header + freeform semantic fields** pattern. The universal fields are always present. Freeform fields are added only when evidenced by the thread content — see [field-catalog.md](field-catalog.md) for the full vocabulary.++### Simple thread (2 messages):```yaml----id: comm_1741824000_a3f2+id: comm_1742352831_novatype: communication-created: 2026-03-10T11:30:00+11:00-updated: 2026-03-10T11:30:00+11:00-tags: [communication, email, quote]+channel: email+subject: "Re: Nova tinting website"+date: 2026-03-19T14:53:51+11:00+direction: inbound+participants:+ - name: Brad Kendall+ email: [email protected]+ - name: Jeremy Dawes+ email: [email protected]+message_count: 2+summary: "Brad Kendall from Nova Pitstop confirmed 1pm meeting at Jezweb office to discuss tinting website. Also trades as Hi-Tech Autoglass Solutions."+tags: [meeting, website-project, automotive]source: gmail-source_id: 18e2a3b4c5d6e7f8-source_url: https://mail.google.com/mail/u/0/#all/18e2a3b4c5d6e7f8-summary: "Client requested full website redesign quote. Agreed to send by end of week."-visibility: private+source_id: 19cade5e9cf2fbc6++# Freeform — only what's in the content+companies: [Nova Pitstop, Hi-Tech Autoglass Solutions]+phone: "02 4954 6828"+website: www.novapitstop.com.au/book-online+meeting_time: "1pm"+meeting_location: "Jeremy's office"+primary_intent: scheduling+----channel: email # email | google_chat | calendar | phone | note-subject: Website redesign quote-participants: [[email protected], [email protected]]-communication_type: quote # quote | support | onboarding | billing | general-significance: 4-client_domain: smithholdings.com.au-project: ~-thread_date: 2026-03-10T11:30:00+11:00+# Nova tinting website — 19 Mar 2026-related: ["[[clients/smithholdings.com.au]]"]+Brad Kendall confirmed 1pm meeting at Jezweb office to discuss the tinting website project. Also trades as Hi-Tech Autoglass Solutions.+```++### Complex thread (8 messages):++```yaml---+id: comm_1740182400_skin+type: communication+channel: email+subject: Micro Skin Website+date: 2026-02-19T00:00:00+10:00+direction: bidirectional+participants:+ - name: Justin+ email: [email protected]+ company: Big Colour+ - name: Belinda+ email: [email protected]+ company: Big Colour+ - name: Jeremy Dawes+ email: [email protected]+ company: Jezweb+ - name: Marianne Boughton+ email: [email protected]+ company: Jezweb+ role: accounts+ - name: Karen Irvine+ email: [email protected]+ company: Jezweb+message_count: 8+summary: "Big Colour commissioning Micro Skin product website. Justin requesting design iterations including darker grey and white outline changes. Multi-week back-and-forth."+tags: [website-design, design-feedback, micro-skin]+source: gmail+source_id: 19c972f9c508ab2f++# Freeform — richer because thread is richer+companies: [Big Colour, Jezweb]+project: micro-skin-website+product: Micro Skin+primary_intent: project_feedback+client_lifecycle_stage: active_project+design_changes: [darker grey, white outline adjustment]+business_relationship: client-vendor+---++# Micro Skin Website — 19 Feb to 3 Mar 2026++Big Colour (signage company) working with Jezweb on a website for the Micro Skin product line. Justin from Big Colour drove the design feedback, requesting specific changes including making the grey darker and adjusting the white outline. Jeremy forwarded feedback internally to Marianne and Karen. Multiple rounds of iteration over two weeks as the design was refined to Big Colour's requirements.+```-# Website redesign quote — 10 Mar 2026+### Key principles:-Client asked about full redesign. Discussed timeline and budget. Agreed to send formal quote by Friday.+- **Summary length is proportional** to thread complexity+- **Freeform fields vary** per thread — a bug report looks different from a pricing dispute+- **No empty fields** — if it's not in the content, don't add it+- See [field-catalog.md](field-catalog.md) for the full vocabulary of discoverable fields```---## Type: `knowledge`-File: `knowledge/{id}.md`+File: `knowledge/{topic-slug}.md````yaml---diff --git a/plugins/basalt/skills/basalt-cortex/references/extraction-prompt.md b/plugins/basalt/skills/basalt-cortex/references/extraction-prompt.mdnew file mode 100644index 00000000..b5fbd0bf--- /dev/null+++ b/plugins/basalt/skills/basalt-cortex/references/extraction-prompt.md@@ -0,0 +1,357 @@+# Extraction Prompt Toolkit++The complete prompt for extracting structured knowledge from email threads and chat conversations into Basalt format notes. This prompt + the field catalog + the few-shot examples form the "schema" that makes extraction consistent and rich.++## When to use++This prompt is used by Claude Code agents (or any LLM) when processing raw email threads or chat conversations into Basalt communication notes. It can be:+- Embedded in a Claude Code agent's system prompt+- Sent as context with each thread to an external API (Gemini, GPT)+- Used by Claude in-context during interactive mining sessions++---++## System Prompt++```+You are a knowledge extraction specialist converting email threads and chat conversations into structured markdown notes for a personal knowledge vault called Basalt Cortex.++Your job is to produce a markdown file with YAML frontmatter and a prose body that captures everything meaningful in the conversation.++## Output Format++The output is a single markdown file with two parts:++1. YAML frontmatter between --- markers+2. Prose body below the frontmatter++## Universal Fields (always include)++Every note MUST have these fields:++- id: comm_{unix_timestamp}_{4char_slug_from_subject}+- type: communication+- channel: email | chat | sms | call | meeting | note+- subject: the thread subject line (quote if it contains special chars)+- date: ISO 8601 with timezone (use the latest message date)+- direction: inbound (they initiated) | outbound (you initiated) | bidirectional (back-and-forth)+- participants: array of {name, email} objects. Add company and role fields to participants ONLY when clearly stated in the thread (signature, context, CC patterns)+- message_count: number of messages in the thread+- summary: 1-3 sentences. Dense with names, companies, and specifics. This field is used for semantic search — make it useful for someone searching "what happened with HV Tours pricing" or "when did Brad confirm the meeting"+- tags: keyword array for filtering. Use lowercase-hyphenated format+- source: gmail | google_chat | slack | etc+- source_id: thread ID for deduplication++## Freeform Semantic Fields (add when evidenced)++Consult the field catalog for a vocabulary of ~50 discoverable fields. Only add fields that are EVIDENCED by the thread content. Never add empty fields.++### How to decide which fields to add++Read the thread and ask yourself these questions:+- What is the PRIMARY PURPOSE of this conversation? → primary_intent+- Is there urgency or a deadline? → urgency_indicator, deadline+- What is the emotional tone? → client_sentiment (only if notable — skip for neutral)+- Was a task handed off from one person to another? → internal_delegation+- Was a decision made? → decision+- Did someone commit to doing something? → action+- Is money discussed? → amount, financial_document, pricing_model+- Are specific companies or products mentioned? → companies, product+- Is there a project this belongs to? → project+- Is there a blocker? → project_blocker+- Is there a bug or issue? → issue, bug_report+- Is there a notable quote? → key_quote (only truly memorable/useful ones)+- Are there contact details in signatures? → phone, website, role_title+- Does someone go by a different name? → real_name, also_known_as+- Does one person run multiple businesses? → multi_entity_portfolio+- Is someone being referred or introduced? → referral_chain+- Where is this person in the client lifecycle? → client_lifecycle_stage (only when clearly changing stages)++If a field doesn't apply, DON'T ADD IT. A simple "confirmed meeting" thread might only have 2-3 freeform fields. A complex multi-party dispute might have 10+.++## Prose Body Rules++### Length is proportional to substance++- 1-2 message "thanks/confirmed" thread → 1-2 sentences+- 3-5 message back-and-forth → short paragraph (3-5 sentences)+- 6+ message project thread → full paragraph(s) with key points++### What to include++- WHO did WHAT — use names, not "the client" or "the team"+- Direct quotes when they capture tone, decisions, or personality+- The narrative arc: what triggered the thread → what happened → what's the outcome/next step+- Contextual insight when you can infer it (but flag inferences)++### What NOT to include++- Don't list every message chronologically — synthesise+- Don't repeat what's already in the YAML fields+- Don't add section headers (## Decisions, ## Actions) — weave them into prose+- Don't pad short threads with filler++## Reasoning About Relationships++### Internal delegation++When someone assigns or hands off work, capture WHO initiated the handoff:++CORRECT:+- Karen flags the issue → Jeremy escalates → Stefan volunteers to handle+- internal_delegation: [{assignor: "Karen/Jeremy", assignee: "Stefan Endt", task: "call Julie about pricing"}]++WRONG:+- Stefan says "I will manage her" → internal_delegation: [{assignor: "Stefan", assignee: "Stefan"}]+ (Stefan didn't assign to himself — the team identified the issue and Stefan volunteered)++### Participant roles++Add company and role to participants ONLY when explicitly stated:+- In email signatures ("Director", "Events & Placement Coordinator")+- In CC patterns (accounts@ email suggests accounts role)+- In context ("Rabin is on leave" tells you Rabin is staff)++DON'T guess roles. If you don't know, leave the participant as just {name, email}.++### Direction++- inbound: the first message came TO the vault owner (someone wrote to you)+- outbound: the first message came FROM the vault owner (you wrote to them)+- bidirectional: meaningful back-and-forth (not just "thanks" reply)++A newsletter response is inbound (they responded to your newsletter).+A support request is inbound (they asked for help).+You forwarding something internally is outbound.++### Client lifecycle++Only add client_lifecycle_stage when the thread SHOWS a stage transition or makes the stage explicit:+- "I would like to cancel" → churning+- "Can you remove my web page" → churned+- "Here's the signed agreement" → active_onboarding+- Routine support request → don't add (it's just maintenance, not a stage change)++## Anti-Patterns (things that make bad extractions)++1. GENERIC SUMMARIES: "Discussion about website" → BAD. "Justin from Big Colour requested darker grey and white outline changes on Micro Skin website" → GOOD+2. EMPTY FIELDS: sentiment: neutral, amount: ~, project: ~ → never add these+3. OVER-EXTRACTION: Adding 15 fields to a 2-message "thanks" thread → too much+4. MISSING THE POINT: Capturing metadata but missing that the client is frustrated, or that someone just sold their business, or that a $500 amount was mentioned+5. WRONG DELEGATION: Person volunteering ≠ person being assigned. Read the thread flow.+6. DUPLICATE INFO: Don't put the same information in both YAML and prose. YAML is for searchable structured data, prose is for narrative context.+```++---++## Few-Shot Examples++### Example 1: Simple confirmation (2 messages)++INPUT:+```+Subject: Re: Nova tinting website+From: Nova Pitstop <[email protected]> → [email protected]+Date: Thu, 19 Mar 2026 14:53:51 +1100+Thread: 19cade5e9cf2fbc6 (2 messages)++Brad: "Hi Jeremy, 1pm at your office works. Thanks, Brad Kendall, Nova Pitstop, Ph: 02 4954 6828, www.novapitstop.com.au/book-online, Hi-Tech Autoglass Solutions"+(Jeremy's prior message invited Brad to discuss a tinting website project)+```++OUTPUT:+```yaml+---+id: comm_1742607231_nova+type: communication+channel: email+subject: "Re: Nova tinting website"+date: 2026-03-19T14:53:51+11:00+direction: inbound+participants:+ - name: Brad Kendall+ email: [email protected]+ - name: Jeremy Dawes+ email: [email protected]+message_count: 2+summary: "Brad Kendall from Nova Pitstop confirmed 1pm meeting at Jezweb office to discuss tinting website. Also trades as Hi-Tech Autoglass Solutions."+tags: [meeting, website-project, automotive]+source: gmail+source_id: 19cade5e9cf2fbc6+companies: [Nova Pitstop, Hi-Tech Autoglass Solutions]+phone: "02 4954 6828"+website: www.novapitstop.com.au/book-online+meeting_time: "1pm"+meeting_location: "Jezweb office"+primary_intent: scheduling+---++# Nova tinting website — 19 Mar 2026++Brad Kendall confirmed 1pm meeting at Jezweb office to discuss the tinting website project. His signature reveals he also trades as Hi-Tech Autoglass Solutions, with phone 02 4954 6828.+```++WHY THIS IS GOOD:+- Short summary matches short thread+- Freeform fields are only what's in the content (phone, website, meeting details, companies)+- No forced sections, no empty fields+- Prose adds the signature detail without repeating YAML++---++### Example 2: Newsletter response with SEO data (2 messages)++INPUT:+```+Subject: Re: Google already answered the question+From: Amanda Hinds <[email protected]> → [email protected]+Date: Mon, 9 Mar 2026 23:18:46 +0000+Thread: 19cd4e563d346411 (2 messages)++Amanda: "Hey Jez, I haven't checked my website or ranking in ages so this was a good exercise - thanks :) I searched under: Heritage Architect Newcastle (Result - 4th listing on the first page, after 2 paid for positions), Heritage Impact Statement Newcastle (Result - not on the first page), Statement of Heritage Impact Newcastle (Result - not on the first page), Heritage Advice Newcastle (Result - 5th listing on the first page). I think the 2nd and 3rd search terms definitely need some attention."+Context: Amanda is a heritage architect in Newcastle responding to a Jezweb newsletter.+```++OUTPUT:+```yaml+---+id: comm_1741564726_goog+type: communication+channel: email+subject: "Re: Google already answered the question"+date: 2026-03-09T23:18:46+00:00+direction: inbound+participants:+ - name: Amanda Hinds+ email: [email protected]+ - name: Jez+ email: [email protected]+message_count: 2+summary: "Heritage architect Amanda Hinds reports Google ranking results after Jezweb newsletter prompted her to check. 4th for 'Heritage Architect Newcastle', not on page 1 for impact statement terms."+tags: [seo, rankings, newsletter-response, heritage-architect, newcastle]+source: gmail+source_id: 19cd4e563d346411+primary_intent: newsletter_response+client_sentiment: appreciative+newsletter_edition: "Google already answered the question"+seo_rankings:+ - term: "Heritage Architect Newcastle"+ position: 4+ page: 1+ notes: "after 2 paid positions"+ - term: "Heritage Impact Statement Newcastle"+ position: not_page_1+ - term: "Statement of Heritage Impact Newcastle"+ position: not_page_1+ - term: "Heritage Advice Newcastle"+ position: 5+ page: 1+opportunity: "SEO work needed on heritage impact statement keywords"+user_testing_queries: ["Heritage Architect Newcastle", "Heritage Impact Statement Newcastle", "Statement of Heritage Impact Newcastle", "Heritage Advice Newcastle"]+---++# Google already answered the question — response from Amanda Hinds, 9 Mar 2026++Amanda Hinds, a heritage architect in Newcastle, responded to the Jezweb newsletter by checking her own Google rankings — something she admitted she "hasn't done in ages." She found mixed results: 4th for "Heritage Architect Newcastle" (after two paid positions) and 5th for "Heritage Advice Newcastle," but not on page one at all for the impact statement terms. Her conclusion: "I think the 2nd and 3rd search terms definitely need some attention" — a potential SEO engagement opportunity.+```++WHY THIS IS GOOD:+- Completely different freeform fields from Example 1 (SEO rankings, newsletter, opportunity)+- The seo_rankings structure captures each term with position and page+- Prose captures her personality ("hasn't done in ages") and the business opportunity+- No generic fields forced in — only what's in this specific thread++---++### Example 3: Multi-party pricing dispute (4 messages)++INPUT:+```+Subject: Re: HVTours prices+Participants: Stefan Endt (Adenium), Jeremy Dawes (Jezweb), Karen Irvine (Jezweb), Daniel Leary (Jezweb), Julie (HV Tours), Aaron (Aspire Financial)+Date: Tue, 10 Mar 2026 09:58:53 +1100+Thread: 19cc5f6267eaec07 (4 messages)++Message flow: Karen flagged pricing discrepancy → Jeremy escalated to Stefan → Stefan responded:+"AGREED...what is going on here lol. I will manage her...calling her this arvo to discuss."+Julie at HV Tours set prices that don't match marketing materials. Aaron handles their books.+```++OUTPUT:+```yaml+---+id: comm_1741563533_hvtp+type: communication+channel: email+subject: "Re: HVTours prices"+date: 2026-03-10T09:58:53+11:00+direction: bidirectional+participants:+ - name: Stefan Endt+ email: [email protected]+ company: Adenium+ role: digital marketing+ - name: Jeremy Dawes+ email: [email protected]+ company: Jezweb+ - name: Karen Irvine+ email: [email protected]+ company: Jezweb+ - name: Daniel Leary+ email: [email protected]+ company: Jezweb+ - name: Julie+ email: [email protected]+ company: HV Tours+ - name: Aaron+ email: [email protected]+ company: Aspire Financial+ role: accountant+message_count: 4+summary: "Jezweb flagged pricing discrepancy on HV Tours website. Stefan Endt (Adenium) volunteered to call Julie this afternoon to resolve. Aaron from Aspire Financial in the loop as HV Tours' accountant."+tags: [pricing, client-management, multi-vendor, hvtours]+source: gmail+source_id: 19cc5f6267eaec07+primary_intent: issue_resolution+companies: [HV Tours, Adenium, Jezweb, Aspire Financial]+issue: "Website prices don't match marketing materials — Julie setting prices independently"+internal_delegation:+ - assignor: Karen Irvine+ assignee: Stefan Endt+ task: "Call Julie to resolve pricing discrepancy"+ context: "Karen flagged → Jeremy escalated → Stefan volunteered"+action: "Stefan calling Julie this arvo"+key_quote: "AGREED...what is going on here lol. I will manage her...calling her this arvo to discuss."+client_sentiment: frustrated+business_relationship: multi_vendor_partnership+---++# HV Tours pricing dispute — 10 Mar 2026++Karen Irvine spotted that prices on the HV Tours website didn't match the marketing materials — Julie at HV Tours appears to be updating prices independently without coordinating with either the web team (Jezweb) or the marketing team (Adenium). Jeremy escalated to Stefan Endt at Adenium, who handles HV Tours' digital campaigns.++Stefan's response captured both the frustration and the resolution: "AGREED...what is going on here lol. I will manage her...calling her this arvo to discuss." He volunteered to handle the client conversation directly. Aaron from Aspire Financial, who manages HV Tours' books, was kept in the loop — pricing changes affect their financial reporting too.+```++WHY THIS IS GOOD:+- internal_delegation correctly shows Karen flagged → Stefan volunteered (not Stefan self-assigning)+- Participant roles added only where known (Stefan = digital marketing, Aaron = accountant)+- Julie identified by first name only (no last name available) with the generic info@ email+- Prose explains the multi-vendor dynamic without over-explaining+- key_quote captures personality and Australian slang++---++## Quality Checklist++Before finalising an extraction, verify:++- [ ] Summary is specific enough to find via search (names, companies, what happened)+- [ ] Freeform fields vary based on content (no default set applied to every thread)+- [ ] No empty or placeholder fields (no `~`, no `null`, no empty arrays)+- [ ] Participant roles only added when explicitly known+- [ ] Direction is correct (who initiated the thread, not the latest message)+- [ ] internal_delegation tracks the flow (who identified → who volunteered/was assigned)+- [ ] Prose length matches thread complexity+- [ ] Direct quotes used when they capture tone or decisions+- [ ] No duplicate info between YAML and prosediff --git a/plugins/basalt/skills/basalt-cortex/references/field-catalog.md b/plugins/basalt/skills/basalt-cortex/references/field-catalog.mdnew file mode 100644index 00000000..300dc16c--- /dev/null+++ b/plugins/basalt/skills/basalt-cortex/references/field-catalog.md@@ -0,0 +1,126 @@+# Basalt Field Catalog++Discovered from 80+ real email threads across 2015-2026 by Gemini 3.1 Pro. This catalog is the **springboard** for per-thread extraction — the AI selects relevant fields from this list AND can add new ones it discovers.++## How to use this catalog++When extracting metadata from an email thread or chat conversation:+1. Read the thread content+2. Scan this catalog for fields that match what's in the conversation+3. Add only the fields that are **evidenced by the content** — never add empty fields+4. If you discover something new that isn't in this catalog, add it anyway and note it as a new field+5. The universal fields (type, channel, subject, date, direction, participants, summary, tags) are always present++---++## Universal Fields (always present)++| Field | Type | Description |+|-------|------|-------------|+| `id` | string | Deterministic ID: `comm_{unix_ts}_{4char_slug}` |+| `type` | string | Always `communication` |+| `channel` | string | `email`, `chat`, `sms`, `call`, `meeting`, `note` |+| `subject` | string | Thread subject line |+| `date` | string | ISO 8601 with timezone |+| `direction` | string | `inbound`, `outbound`, `bidirectional` |+| `participants` | array | List of `{name, email}` objects |+| `message_count` | number | Messages in thread |+| `summary` | string | 1-3 sentences, dense with names. Used for semantic search |+| `tags` | array | Keyword tags for filtering |+| `source` | string | `gmail`, `google_chat`, `slack`, etc. |+| `source_id` | string | Thread ID for idempotency |++---++## Freeform Semantic Fields (add when present in content)++### Intent & Sentiment (any industry)++| Field | Type | When to add | Examples |+|-------|------|------------|---------|+| `primary_intent` | string | Always useful | `support_request`, `sales_inquiry`, `billing_update`, `project_feedback`, `scheduling`, `referral`, `personal`, `legal_notice`, `admin`, `newsletter_response` |+| `urgency_indicator` | string | When urgency is expressed | `critical_outage`, `date_specific_deadline`, `standard`, `low_priority` |+| `client_sentiment` | string | When tone is notable | `frustrated`, `apologetic`, `appreciative`, `neutral`, `disputed`, `enthusiastic` |+| `internal_delegation` | array of objects | When tasks are handed off | `[{assignor: "Natalie", assignee: "Ravelle", task: "follow up with Nick"}]` |++### Client Lifecycle & Relationships++| Field | Type | When to add | Examples |+|-------|------|------------|---------|+| `client_lifecycle_stage` | string | When stage is clear from context | `prospect`, `active_onboarding`, `active_project`, `active_maintenance`, `churning`, `churned` |+| `churn_reason` | string | When client is leaving | "Sold the business", "Migrating to Shopify", "In liquidation" |+| `referral_chain` | object | When someone introduces someone | `{referrer: "Chris Burgess", referee: "Alexander Dark", context: "BNI referral"}` |+| `multi_entity_portfolio` | array | When one person runs multiple businesses | `["Pumping Records", "Pumping Management", "Pumping Entertainment"]` |+| `business_relationship` | string | When the relationship type is notable | `client`, `partner`, `vendor`, `affiliate`, `referrer`, `prospect`, `former_client` |++### Project & Technical++| Field | Type | When to add | Examples |+|-------|------|------------|---------|+| `project` | string | When thread is about a specific project | `micro-skin-website`, `acps-launch`, `vsb-chatbot` |+| `project_blocker` | string | When something is blocking progress | "No payment facility - Eway", "Client can't provide access", "Designer reviewing" |+| `technical_assets` | array | When tech infrastructure is discussed | `["WordPress", "forms plugin"]`, `["Cloudflare DNS"]`, `["Stripe"]` |+| `third_party_platforms` | array | When external platforms are mentioned | `["Shopify"]`, `["Commerce7"]`, `["Eway"]`, `["Rezdy"]` |+| `infrastructure_action` | string | When a technical operation is happening | `provision`, `migrate`, `update`, `debug`, `teardown` |+| `design_changes` | array | When visual changes are requested | `["darker grey", "white outline adjustment"]` |+| `product` | string | When a specific product is being discussed | `L2Chat`, `Flare AI`, `JezPress` |++### Financial & Commercial++| Field | Type | When to add | Examples |+|-------|------|------------|---------|+| `financial_document` | string | When money docs are referenced | `remittance_advice`, `purchase_order`, `invoice`, `quote` |+| `amount` | string | When dollar figures are mentioned | "$500", "$770/month", "PO 4400426649" |+| `pricing_model` | string | When pricing structure is discussed | "Affiliate commission", "Subscription renewal", "One-off project" |++### People & Identity++| Field | Type | When to add | Examples |+|-------|------|------------|---------|+| `real_name` | string | When display name differs from real name | "George Petridis" (display: "George Fuel") |+| `also_known_as` | string | When aliases/brand names exist | "George Fuel", "Nova Pitstop" |+| `phone` | string | When phone numbers appear in content | "02 4954 6828", "+61 414 232 794" |+| `companies` | array | When multiple companies are involved | `["Verge Safety Barriers", "Uni-Fit", "Adenium"]` |+| `role_title` | string | When job title is mentioned | "Events & Placement Coordinator", "Director" |++### Community & Networking++| Field | Type | When to add | Examples |+|-------|------|------------|---------|+| `community_affiliation` | string | When networking/community groups are involved | "BNI Sunrisers", "Maryland Shortland Scouts" |+| `mass_broadcast` | string | When email is one-to-many | `security_alert`, `newsletter`, `event_invite` |++### Content-Specific (emergent)++| Field | Type | When to add | Examples |+|-------|------|------------|---------|+| `seo_rankings` | array of objects | When search rankings are discussed | `[{term: "Heritage Architect Newcastle", position: 4}]` |+| `newsletter_edition` | string | When responding to a newsletter | "Google already answered the question" |+| `issue` | string | When a bug/problem is reported | "Wrong phone number in chatbot", "Forms not working" |+| `bug_report` | boolean | When it's a product bug report | `true` |+| `meeting_time` | string | When a meeting is scheduled | "1pm", "Wednesday 10am" |+| `meeting_location` | string | When a meeting place is specified | "Jeremy's office", "Zoom" |+| `deadline` | string | When a date constraint exists | "Wednesday night launch", "COB Friday 6th March" |+| `decision` | string | When something was decided | "Launch rescheduled", "Landing page approved" |+| `action` | string | When someone committed to doing something | "Stefan calling Julie this arvo" |+| `website` | string | When a URL is shared | "www.novapitstop.com.au/book-online" |+| `domain` | string | When a domain name is the topic | "peece.com.au", "bluewaterelectricalservices.com.au" |+| `ai_context` | string | When AI is part of the discussion | `client_deployment`, `product_demo`, `product_ideation` |+| `user_testing_queries` | array | When someone reports search/AI test results | `["Heritage Architect Newcastle", "recliner repairs near me"]` |+| `key_quote` | string | When a quote captures the essence | "Did you just bang that out in a casual afternoon?" |++---++## Adding New Fields++This catalog is a living document. When extracting from a new thread, if you encounter metadata that doesn't fit any existing field:++1. Add it with a descriptive `lowercase_snake_case` name+2. Use the simplest appropriate type (string > array > object)+3. The field will naturally join the catalog as more threads are processed++Examples of fields that might emerge in other industries:+- A tradie: `site_address`, `materials_list`, `safety_requirements`+- A lawyer: `case_number`, `court_date`, `opposing_party`, `statute_reference`+- A recruiter: `candidate_name`, `role_applied`, `salary_range`, `interview_stage`+- A property manager: `property_address`, `tenant_name`, `lease_expiry`, `maintenance_type`diff --git a/plugins/basalt/skills/basalt-cortex/references/source-patterns.md b/plugins/basalt/skills/basalt-cortex/references/source-patterns.mdindex 43e1fe4e..eb315687 100644--- a/plugins/basalt/skills/basalt-cortex/references/source-patterns.md+++ b/plugins/basalt/skills/basalt-cortex/references/source-patterns.md@@ -6,57 +6,91 @@ Per-source patterns for fetching, pre-filtering, and extracting knowledge into B## Gmail-**Prerequisites**: `gws` CLI authenticated (`gws auth login -s gmail`)+**Prerequisites**: Gmail MCP connected (`google-gmail-jez` or `google-gmail`)-**Fetch pattern**:-```bash-# List threads (newest first, batch of 50)-gws gmail messages list --query "newer_than:30d" --max-results 50 --format json+**Fetch pattern (MCP — preferred)**:++```+# Phase 1a: Extract contacts (quick scan, 100 emails)+gmail_messages({ action: "extract_contacts", query: "in:inbox after:YYYY/MM/DD", field: "from",+ excludeDomains: ["jezweb.net", "google.com", "github.com", "cloudflare.com", ...], maxResults: 100 })-# Get full thread content-gws gmail messages get MESSAGE_ID --format json+# Phase 1a (sent): Who Jez emails+gmail_messages({ action: "extract_contacts", query: "in:sent after:YYYY/MM/DD", field: "to",+ excludeDomains: [...], maxResults: 100 })++# Phase 1b: List emails in monthly batches+gmail_messages({ action: "list",+ query: "in:inbox -category:promotions -category:social -category:updates -category:forums after:YYYY/MM/DD before:YYYY/MM/DD",+ maxResults: 50, format: "compact", bodyPreview: 1000 })++# Phase 1c: Get full content for significant threads+gmail_messages({ action: "get", messageId: "...", bodyFormat: "text" })```-**Pre-filter**: See prefilter-patterns.md. Skip automated senders, marketing emails, notifications.+**Pre-filter**: See prefilter-patterns.md. From the `list` results, skip:+- Synergy Wholesale 2FA, eligibility reports, transaction statements+- CrazyTel auto top-ups+- Domain expiry/transfer/registration notifications+- Wordfence login alerts+- L2Chat/Bot notification emails+- Payment receipts from automated systems-**Extract**: Send thread body to LLM. Extract contacts, client info, communication summary, knowledge facts.+**Extract**: Claude does AI extraction in-context while scanning list results. No external LLM call needed. Identify clients, contacts, communications, and knowledge facts from snippets + full bodies.**Basalt mapping**:-- Each unique sender domain → `clients/{domain}.md`-- Each unique email address → `contacts/{slug}.md`-- Each thread → `communications/{YYYY}/{MM}/comm_{ts}_{hash}.md`-- Each extracted fact → `knowledge/know_{ts}_{hash}.md`+- Each unique business domain → `clients/{domain}.md`+- Each unique person → `contacts/{first-last}.md`+- Each significant thread → `communications/{YYYY}/{MM}/{YYYY-MM-DD}-{subject-slug}.md`+- Each extracted fact → `knowledge/{topic-slug}.md`**Idempotency**: Use Gmail thread ID as `source_id`. Check `state.json` processed list before processing.-**Cursor**: Store the newest thread timestamp in `state.json` cursors.gmail. Next run starts from there.+**Cursor**: Store the newest thread timestamp in `state.json` cursors.gmail.++**Batch strategy**: Process one month at a time. For large mines (full year), fetch 50 emails per month-batch, process, then move to the next month. Generate a single Python script with all extracted entities at the end.---## Google Chat-**Prerequisites**: `gws` CLI authenticated with chat scope (`gws auth login -s chat`)+**Prerequisites**: Google Chat MCP connected (`google-chat`)-**Fetch pattern**:-```bash-# List spaces-gws chat spaces list --format json+**Fetch pattern (MCP)**:-# List messages in a space (newest first)-gws chat messages list SPACE_NAME --max-results 50 --format json```+# List all spaces+chat_spaces({ action: "list", filter: "all", limit: 50 })-**Pre-filter**: Skip bot messages, join/leave events, reactions.+# Categorise spaces — skip bot-only spaces:+# SKIP: Email Copilot, Coffee, Chat Copilot, Flux Copilot, Paste Bin+# MINE: Client spaces, business ops, team discussions-**Extract**: Group messages into conversation threads (by time proximity or explicit threads). Extract decisions, action items, knowledge.+# Fetch messages ONE SPACE AT A TIME+chat_messages({ action: "list", spaceId: "ABC123", range: "month", limit: 50 })++# NEVER use search_active for mining — it fires all spaces in parallel+# and times out on accounts with 50+ spaces (Jezweb has 57)+```++**Pre-filter**: Skip bot messages (`senderType: "BOT"`), join/leave events, webhook posts, reactions-only messages, messages under 20 chars.++**Extract**: Group messages into conversation threads (by `threadId`). Extract decisions, action items, knowledge. Claude does extraction in-context.**Basalt mapping**:-- Each conversation thread → `communications/{YYYY}/{MM}/comm_{ts}_{hash}.md` with `channel: google_chat`-- Decisions and facts → `knowledge/know_{ts}_{hash}.md`-- New participants → `contacts/{slug}.md`+- Each conversation thread → `communications/{YYYY}/{MM}/{YYYY-MM-DD}-{subject-slug}.md` with `channel: google_chat`+- Decisions and facts → `knowledge/{topic-slug}.md`+- New participants → `contacts/{first-last}.md`**Idempotency**: Use message ID as `source_id`.+**Space-by-space iteration**: Process spaces in order of business value:+1. Client spaces (Verge, ACPS, Procool, etc.)+2. Business ops (Help Desk, Website Sales, Accounts Receivable)+3. Team/internal (Team Jezweb, HR, Finances)+4. Dev/AI (Claude Code, MCP Servers, AI Agents)+Save progress after each space so failures are resumable.+---## Slackdiff --git a/plugins/design-assets/commands/image-processing.md b/plugins/design-assets/commands/image-processing.mdindex d0460f48..ae37d555 100644--- a/plugins/design-assets/commands/image-processing.md+++ b/plugins/design-assets/commands/image-processing.md@@ -1,6 +1,6 @@---description: Resize, convert, or optimise images for web-argument-hint: "[image-path] [operation]"+argument-hint: "[resize|convert|trim|optimise] [path-or-description]"---Load the `image-processing` skill.diff --git a/plugins/dev-tools/commands/agent-browser.md b/plugins/dev-tools/commands/agent-browser.mdindex 93911692..4816564d 100644--- a/plugins/dev-tools/commands/agent-browser.md+++ b/plugins/dev-tools/commands/agent-browser.md@@ -1,6 +1,6 @@---description: Browser automation for web interaction and testing-argument-hint: "[url]"+argument-hint: "[navigate|screenshot|fill|click|test] [target]"---Load the `agent-browser` skill.diff --git a/plugins/dev-tools/commands/app-docs.md b/plugins/dev-tools/commands/app-docs.mdindex 2cd7810e..bc9c78cd 100644--- a/plugins/dev-tools/commands/app-docs.md+++ b/plugins/dev-tools/commands/app-docs.md@@ -1,6 +1,6 @@---description: Generate a user guide with screenshots from a running app-argument-hint: "[quick|standard|thorough] [url]"+argument-hint: "[quick: key screens | standard: all pages | thorough: every state]"---Load the `app-docs` skill.diff --git a/plugins/dev-tools/commands/onboarding-ux.md b/plugins/dev-tools/commands/onboarding-ux.mdindex fb739af7..b80ba4ec 100644--- a/plugins/dev-tools/commands/onboarding-ux.md+++ b/plugins/dev-tools/commands/onboarding-ux.md@@ -1,6 +1,6 @@---description: Audit and generate in-app user guidance — onboarding, empty states, tours, help content-argument-hint: "[audit|generate|both] [url]"+argument-hint: "[audit: find gaps | generate: produce code | both: audit then generate]"---Load the `onboarding-ux` skill.diff --git a/plugins/dev-tools/commands/responsiveness-check.md b/plugins/dev-tools/commands/responsiveness-check.mdindex eb7f3d9f..44d5399a 100644--- a/plugins/dev-tools/commands/responsiveness-check.md+++ b/plugins/dev-tools/commands/responsiveness-check.md@@ -1,6 +1,6 @@---description: Test responsive layout across viewport widths-argument-hint: "[url]"+argument-hint: "[desktop|tablet|mobile|all] [url-if-not-auto-detected]"---Load the `responsiveness-check` skill.diff --git a/plugins/dev-tools/commands/ux-audit.md b/plugins/dev-tools/commands/ux-audit.mdindex dfc19f86..177afd4a 100644--- a/plugins/dev-tools/commands/ux-audit.md+++ b/plugins/dev-tools/commands/ux-audit.md@@ -1,6 +1,6 @@---description: Run a UX walkthrough and QA sweep on a live web app-argument-hint: "[quick|standard|thorough] [url]"+argument-hint: "[quick: spot check | standard: full walkthrough | thorough: overnight]"allowed-tools: "*"---diff --git a/plugins/frontend/commands/design-review.md b/plugins/frontend/commands/design-review.mdindex 6d5f1026..5b73b1e0 100644--- a/plugins/frontend/commands/design-review.md+++ b/plugins/frontend/commands/design-review.md@@ -1,6 +1,6 @@---description: Review visual design quality — layout, typography, spacing, colour, consistency-argument-hint: "[url]"+argument-hint: "[layout|typography|colour|consistency|all]"---Load the `design-review` skill.diff --git a/plugins/frontend/commands/product-showcase.md b/plugins/frontend/commands/product-showcase.mdindex 69cbc334..acf787d7 100644--- a/plugins/frontend/commands/product-showcase.md+++ b/plugins/frontend/commands/product-showcase.md@@ -1,8 +1,12 @@---description: Generate a marketing site from a running app with real screenshots-argument-hint: "[url]"+argument-hint: "[quick: hero + features | standard: full showcase | thorough: every screen] [url]"---Load the `product-showcase` skill.-If $ARGUMENTS contains a URL, use it as the app to showcase. Otherwise check for a running dev server or ask.+Parse $ARGUMENTS for:+- **Depth**: `quick` (hero + 3-4 feature screenshots, single page), `standard` (full showcase with how-it-works, feature grid, CTAs), `thorough` (every screen captured, comprehensive multi-section site). Default: standard+- **URL**: app to showcase. If not provided, check wrangler.jsonc for deployed URL, then running dev server, then ask.++Examples: `/product-showcase thorough https://app.example.com`, `/product-showcase quick`, `/product-showcase`diff --git a/plugins/integrations/commands/stripe-payments.md b/plugins/integrations/commands/stripe-payments.mdnew file mode 100644index 00000000..39c08130--- /dev/null+++ b/plugins/integrations/commands/stripe-payments.md@@ -0,0 +1,17 @@+---+description: Add Stripe payments to a web app — checkout, subscriptions, webhooks, billing portal+argument-hint: "[checkout: one-time payment | subscription: recurring billing | webhook: event handler | portal: customer self-service | pricing: pricing page]"+---++Load the `stripe-payments` skill.++Parse $ARGUMENTS for what to build:+- `checkout` — one-time payment via Checkout Sessions+- `subscription` — recurring billing via Checkout Sessions + subscription mode+- `webhook` — webhook handler with signature verification+- `portal` — customer billing portal (manage subscriptions)+- `pricing` — pricing page that reads from Stripe products++Default: ask what they need, or detect from the project (if Stripe is already installed, probably adding a webhook or subscription).++Examples: `/stripe-payments checkout`, `/stripe-payments subscription`, `/stripe-payments webhook`diff --git a/plugins/integrations/skills/stripe-payments/SKILL.md b/plugins/integrations/skills/stripe-payments/SKILL.mdnew file mode 100644index 00000000..7c2f65a1--- /dev/null+++ b/plugins/integrations/skills/stripe-payments/SKILL.md@@ -0,0 +1,340 @@+---+name: stripe-payments+description: "Add Stripe payments to a web app — Checkout Sessions, Payment Intents, subscriptions, webhooks, customer portal, and pricing pages. Covers the decision of which Stripe API to use, produces working integration code, and handles webhook verification. No MCP server needed — uses Stripe npm package directly. Triggers: 'add payments', 'stripe', 'checkout', 'subscription', 'payment form', 'pricing page', 'billing', 'accept payments', 'stripe webhook', 'customer portal'."+compatibility: claude-code-only+allowed-tools:+ - Read+ - Write+ - Edit+ - Bash+ - Glob+ - Grep+---++# Stripe Payments++Add Stripe payments to a web app. Covers the common patterns — one-time payments, subscriptions, webhooks, customer portal — with working code. No MCP server needed.++## Which Stripe API Do I Need?++| You want to... | Use | Complexity |+|----------------|-----|-----------|+| Accept a one-time payment | Checkout Sessions | Low — Stripe hosts the payment page |+| Embed a payment form in your UI | Payment Element + Payment Intents | Medium — you build the form, Stripe handles the card |+| Recurring billing / subscriptions | Checkout Sessions (subscription mode) | Low-Medium |+| Save a card for later | Setup Intents | Low |+| Marketplace / platform payments | Stripe Connect | High |+| Let customers manage billing | Customer Portal | Low — Stripe hosts it |++**Default recommendation**: Start with Checkout Sessions. It's the fastest path to accepting money. You can always add embedded forms later.++## Setup++### Install++```bash+npm install stripe @stripe/stripe-js+```++### API Keys++```bash+# Get keys from: https://dashboard.stripe.com/apikeys+# Test keys start with sk_test_ and pk_test_+# Live keys start with sk_live_ and pk_live_++# For Cloudflare Workers — store as secrets:+npx wrangler secret put STRIPE_SECRET_KEY+npx wrangler secret put STRIPE_WEBHOOK_SECRET++# For local dev — .dev.vars:+STRIPE_SECRET_KEY=sk_test_...+STRIPE_WEBHOOK_SECRET=whsec_...+STRIPE_PUBLISHABLE_KEY=pk_test_...+```++### Server-Side Client++```typescript+import Stripe from 'stripe';++// Cloudflare Workers+const stripe = new Stripe(c.env.STRIPE_SECRET_KEY);++// Node.js+const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);+```++## One-Time Payment (Checkout Sessions)++The fastest way to accept payment. Stripe hosts the entire checkout page.++### Create a Checkout Session (Server)++```typescript+app.post('/api/checkout', async (c) => {+ const { priceId, successUrl, cancelUrl } = await c.req.json();++ const session = await stripe.checkout.sessions.create({+ mode: 'payment',+ line_items: [{ price: priceId, quantity: 1 }],+ success_url: successUrl || `${new URL(c.req.url).origin}/success?session_id={CHECKOUT_SESSION_ID}`,+ cancel_url: cancelUrl || `${new URL(c.req.url).origin}/pricing`,+ });++ return c.json({ url: session.url });+});+```++### Redirect to Checkout (Client)++```typescript+async function handleCheckout(priceId: string) {+ const res = await fetch('/api/checkout', {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({ priceId }),+ });+ const { url } = await res.json();+ window.location.href = url;+}+```++### Create Products and Prices++```bash+# Via Stripe CLI (recommended for setup)+stripe products create --name="Pro Plan" --description="Full access"+stripe prices create --product=prod_XXX --unit-amount=2900 --currency=aud --recurring[interval]=month++# Or via Dashboard: https://dashboard.stripe.com/products+```++**Hardcode price IDs** in your code (they don't change):+```typescript+const PRICES = {+ pro_monthly: 'price_1234567890',+ pro_yearly: 'price_0987654321',+} as const;+```++## Subscriptions++Same as one-time but with `mode: 'subscription'`:++```typescript+const session = await stripe.checkout.sessions.create({+ mode: 'subscription',+ line_items: [{ price: PRICES.pro_monthly, quantity: 1 }],+ success_url: `${origin}/dashboard?session_id={CHECKOUT_SESSION_ID}`,+ cancel_url: `${origin}/pricing`,+ // Link to existing customer if known:+ customer: customerId, // or customer_email: '[email protected]'+});+```++### Check Subscription Status++```typescript+async function hasActiveSubscription(customerId: string): Promise<boolean> {+ const subs = await stripe.subscriptions.list({+ customer: customerId,+ status: 'active',+ limit: 1,+ });+ return subs.data.length > 0;+}+```++## Webhooks++Stripe sends events to your server when things happen (payment succeeded, subscription cancelled, etc.). **You must verify the webhook signature.**++### Webhook Handler (Cloudflare Workers / Hono)++```typescript+app.post('/api/webhooks/stripe', async (c) => {+ const body = await c.req.text();+ const sig = c.req.header('stripe-signature')!;++ let event: Stripe.Event;+ try {+ // Use constructEventAsync for Workers (no Node crypto)+ event = await stripe.webhooks.constructEventAsync(+ body,+ sig,+ c.env.STRIPE_WEBHOOK_SECRET+ );+ } catch (err) {+ console.error('Webhook signature verification failed:', err);+ return c.json({ error: 'Invalid signature' }, 400);+ }++ switch (event.type) {+ case 'checkout.session.completed': {+ const session = event.data.object as Stripe.Checkout.Session;+ // Fulfill the order — update database, send email, grant access+ await handleCheckoutComplete(session);+ break;+ }+ case 'customer.subscription.updated': {+ const sub = event.data.object as Stripe.Subscription;+ await handleSubscriptionChange(sub);+ break;+ }+ case 'customer.subscription.deleted': {+ const sub = event.data.object as Stripe.Subscription;+ await handleSubscriptionCancelled(sub);+ break;+ }+ case 'invoice.payment_failed': {+ const invoice = event.data.object as Stripe.Invoice;+ await handlePaymentFailed(invoice);+ break;+ }+ }++ return c.json({ received: true });+});+```++### Register Webhook++```bash+# Local testing with Stripe CLI:+stripe listen --forward-to http://localhost:8787/api/webhooks/stripe++# Production — register via Dashboard:+# https://dashboard.stripe.com/webhooks+# URL: https://yourapp.com/api/webhooks/stripe+# Events: checkout.session.completed, customer.subscription.updated,+# customer.subscription.deleted, invoice.payment_failed+```++### Cloudflare Workers Gotcha++`constructEvent` (synchronous) uses Node.js `crypto` which doesn't exist in Workers. Use `constructEventAsync` instead — it uses the Web Crypto API.++## Customer Portal++Let customers manage their own subscriptions (upgrade, downgrade, cancel, update payment method):++```typescript+app.post('/api/billing/portal', async (c) => {+ const { customerId } = await c.req.json();++ const session = await stripe.billingPortal.sessions.create({+ customer: customerId,+ return_url: `${new URL(c.req.url).origin}/dashboard`,+ });++ return c.json({ url: session.url });+});+```++Configure the portal in Dashboard: https://dashboard.stripe.com/settings/billing/portal++## Pricing Page Pattern++Generate a pricing page that reads from Stripe products:++```typescript+// Server: fetch products and prices+app.get('/api/pricing', async (c) => {+ const prices = await stripe.prices.list({+ active: true,+ expand: ['data.product'],+ type: 'recurring',+ });++ return c.json(prices.data.map(price => ({+ id: price.id,+ name: (price.product as Stripe.Product).name,+ description: (price.product as Stripe.Product).description,+ amount: price.unit_amount,+ currency: price.currency,+ interval: price.recurring?.interval,+ })));+});+```++Or hardcode if you only have 2-3 plans — simpler and no API call on every page load.++## Stripe CLI (Local Development)++```bash+# Install+brew install stripe/stripe-cli/stripe++# Login+stripe login++# Listen for webhooks locally+stripe listen --forward-to http://localhost:8787/api/webhooks/stripe++# Trigger test events+stripe trigger checkout.session.completed+stripe trigger customer.subscription.created+stripe trigger invoice.payment_failed+```++## Common Patterns++### Link Stripe Customer to Your User++```typescript+// On first checkout, create or find customer:+const session = await stripe.checkout.sessions.create({+ customer_email: user.email, // Creates new customer if none exists+ // OR+ customer: user.stripeCustomerId, // Use existing+ metadata: { userId: user.id }, // Link back to your user+ // ...+});++// In webhook, save the customer ID:+case 'checkout.session.completed': {+ const session = event.data.object;+ await db.update(users)+ .set({ stripeCustomerId: session.customer as string })+ .where(eq(users.id, session.metadata.userId));+}+```++### Free Trial++```typescript+const session = await stripe.checkout.sessions.create({+ mode: 'subscription',+ line_items: [{ price: PRICES.pro_monthly, quantity: 1 }],+ subscription_data: {+ trial_period_days: 14,+ },+ // ...+});+```++### Australian Dollars++```typescript+// Set currency when creating prices+const price = await stripe.prices.create({+ product: 'prod_XXX',+ unit_amount: 2900, // $29.00 in cents+ currency: 'aud',+ recurring: { interval: 'month' },+});+```++## Gotchas++| Gotcha | Fix |+|--------|-----|+| `constructEvent` fails on Workers | Use `constructEventAsync` (Web Crypto API) |+| Webhook fires but handler not called | Check the endpoint URL matches exactly (trailing slash matters) |+| Test mode payments not appearing | Make sure you're using `sk_test_` key, not `sk_live_` |+| Price amounts are in cents | `2900` = $29.00. Always divide by 100 for display |+| Customer email doesn't match user | Use `customer` (existing ID) not `customer_email` for returning users |+| Subscription status stale | Don't cache — check via API or trust webhook events |+| Webhook retries | Stripe retries failed webhooks for up to 3 days. Return 200 quickly. |+| CORS on checkout redirect | Checkout URL is on stripe.com — use `window.location.href`, not fetch |