Skip to content
OpenSmartRoute
Skillv1.0.0

setup

Set up Promptbook — connect your account to start tracking builds. Use when the user wants to enable session analytics on promptbook.gg. Trigger with "/setup" or "set up promptbook".

by jeremylongshore(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from jeremylongshore/tons-of-skills-marketplace (skills/.curated/setup/SKILL.md). Install upstream with npx skills add jeremylongshore/tons-of-skills-marketplace --skill setup. Copyright stays with the author (MIT).

Promptbook Setup

Overview

Connect a Promptbook account using the device-code OAuth flow. After consent, the plugin tracks session metrics (prompts, tokens, build time, lines changed) and publishes shareable build cards on promptbook.gg.

Prerequisites

  • Internet access (calls promptbook.gg API)
  • A browser for the sign-in step
  • Node.js installed (used by hook scripts)

Privacy Note

What IS sent to promptbook.gg: session ID, project name, model, timestamps, prompt count, token counts, build time, lines changed, language, file extension counts, and tool usage counts.

What is NEVER sent: source code, prompt content, file contents, file paths, or working directory.

To generate a title and summary for each build, the plugin calls Claude Haiku via the user's own Claude credentials — this data goes to Anthropic (same as normal Claude Code usage), never to Promptbook.

The plugin stays inactive until setup writes consent into ~/.promptbook/config.json. Continuing with setup means the user consents to this data collection. After each session ends, a short background process may continue briefly to submit stats and generate the title/summary.

Instructions

Run all commands via Bash — the user just waits for the browser sign-in.

1. Create a setup session

curl -sL -X POST "https://promptbook.gg/api/auth/setup-session"

Parse the JSON response to extract three values: token, device_code, and setup_url.

2. Open the browser

Use the setup_url value from step 1:

open "<setup_url value>"   # macOS
xdg-open "<setup_url value>"  # Linux

Tell the user: "Opening promptbook.gg — sign in or create an account to continue." If the browser cannot open, show the URL for manual access.

3. Poll for authorization

Check every 2 seconds using the token from step 1:

curl -sL "https://promptbook.gg/api/auth/setup-session/<token value>/status"

Parse the JSON and check whether status equals "authorized". Use a unique variable name like poll_result or auth_status (do NOT use a variable named status). Timeout after 5 minutes.

4. Exchange device code for API key

curl -sL -X POST "https://promptbook.gg/api/auth/setup-session/exchange" \
  -H "Content-Type: application/json" \
  -d "{\"device_code\": \"<device_code value>\"}"

Parse the JSON response to extract api_key.

5. Save the config

Write to ~/.promptbook/config.json — the canonical config location shared by both plugin and bash installs:

mkdir -p "$HOME/.promptbook"
cat > "$HOME/.promptbook/config.json" << 'JSONEOF'
{
  "api_key": "<api_key from step 4>",
  "api_url": "https://promptbook.gg",
  "auto_summary": true,
  "telemetry_consent": true
}
JSONEOF
chmod 600 "$HOME/.promptbook/config.json"

The chmod 600 restricts config access to the owning user only — the file contains the API key.

6. Verify setup

curl -sL -X POST "https://promptbook.gg/api/auth/verify-setup" \
  -H "Authorization: Bearer <api_key value>"

7. Confirm completion

Tell the user:

  • "You're all set! Tracking starts on your next Claude Code session."
  • "By completing setup, you've opted in to Promptbook tracking for this plugin install."
  • "After the session ends, a short background task may continue briefly to submit stats and generate your title/summary."
  • "Run /setup again anytime to reconnect or switch accounts."

8. Offer history backfill

Ask the user: "Want me to scan your Claude Code history for past sessions? I can find builds from the last 90 days and upload them to your profile."

If yes, find the bundled backfill script:

find ~/.claude -path "*/promptbook/scripts/backfill-history.js" -type f 2>/dev/null | head -1

If it does not exist, stop and tell the user the plugin install looks incomplete. Do not download code from the network.

Count matching session files first:

find "$HOME/.claude/projects" -name "*.jsonl" -type f 2>/dev/null | wc -l

Then start in the background:

nohup node <path-to-backfill-history.js> \
  --days 90 \
  --generate-summaries \
  > "$HOME/.promptbook/backfill-history.log" 2>&1 < /dev/null &

Tell the user: "Found session files. History import started in the background. See status at https://promptbook.gg/setup/history"

Output

On success, display:

  • Confirmation that tracking is active
  • Link to the user's promptbook.gg profile
  • Note that the current session is not tracked — start a new one

Error Handling

  • If any curl call fails, show the HTTP status and suggest running /setup again
  • If the browser cannot open, display the URL for manual access
  • If polling times out after 5 minutes, abort and suggest retrying
  • Never display the API key to the user

Examples

User: /setup
Agent: Creating setup session... Opening promptbook.gg — sign in or create an account.
       Waiting for authorization... Authorized! Saving config...
       You're all set! Tracking starts on your next Claude Code session.
       Want me to scan your history for past sessions?

Resources

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/jeremylongshore-tons-of-skills-marketplace-setup/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

jeremylongshore-tons-of-skills-marketplace-setup.ocm.jsonjson
{
  "ocm": "1",
  "id": "jeremylongshore-tons-of-skills-marketplace-setup",
  "kind": "skill",
  "name": "setup",
  "description": "Set up Promptbook — connect your account to start tracking builds. Use when the user wants to enable session analytics on promptbook.gg. Trigger with \"/setup\" or \"set up promptbook\".",
  "publisher": "jeremylongshore",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "analytics",
      "telemetry",
      "setup",
      "onboarding",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Set up Promptbook — connect your account to start tracking builds. Use when the user wants to enable session analytics on promptbook.gg. Trigger with \"/setup\" or \"set up promptbook\"."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/jeremylongshore/tons-of-skills-marketplace",
      "path": "skills/.curated/setup/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/skills/.curated/setup/SKILL.md",
      "key": "jeremylongshore/tons-of-skills-marketplace/skills/.curated/setup/SKILL.md"
    },
    "compatibility": "Designed for Claude Code",
    "allowed_tools": [
      "Bash(curl:*),",
      "Bash(open:*),",
      "Bash(xdg-open:*),",
      "Bash(mkdir:*),",
      "Bash(cat:*),",
      "Bash(chmod:*),",
      "Bash(node:*),",
      "Bash(nohup:*),",
      "Bash(find:*),",
      "Bash(wc:*),",
      "Read"
    ],
    "license": "MIT"
  },
  "instructions": "# Promptbook Setup\n\n## Overview\n\nConnect a Promptbook account using the device-code OAuth flow. After consent, the plugin tracks session metrics (prompts, tokens, build time, lines changed) and publishes shareable build cards on promptbook.gg.\n\n## Prerequisites\n\n- Internet access (calls promptbook.gg API)\n- A browser for the sign-in step\n- Node.js installed (used by hook scripts)\n\n## Privacy Note\n\n**What IS sent to promptbook.gg:** session ID, project name, model, timestamps, prompt count, token counts, build time, lines changed, language, file extension counts, and tool usage counts.\n\n**What ",
  "cost": {
    "context_tokens": 1313
  }
}

Fetch it by URL: GET /api/v1/registry/jeremylongshore-tons-of-skills-marketplace-setup/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.