Capgo Builder — Contact Support (Simplified)

docs/superpowers/specs/2026-06-03-builder-contact-support-simple-design.md · 2026-06-03
✅ ACTIVE PLAN — local logs file + mailto:, zero backend. Supersedes the shelved backend/bridge design.

1 · Goal

When a builder run fails, save the user's logs to a local file and open a pre-filled email to support@capgo.app. The user attaches the file and sends. Zero backend. That's the whole feature.

2 · Why this is simpler AND more correct

Every hard problem in the shelved design came from us sending a ticket programmatically through the Cap-go/automations bridge (the ownedOutboundCopy heuristic, the double-delivery race, CC/Reply-To threading, a backend proxy, Email Service limits…). When the user sends from their own client, it all evaporates: Only cost: mailto: can't auto-attach, so the user does one "attach + send" — made trivial via save + clipboard + Finder reveal.

3 · Flow

  1. Hidden internal log captured during builder/onboarding (verbose, secret-redacted, CLI-only) — including non-build failures (onboarding errors, raw Apple/Google API errors). Build failures also fold in the captured build log.
  2. On failure → menu offers 📨 Email Capgo support (+ 🤖 Ask AI when a build log exists).
  3. On "Email Capgo support", the CLI first shows a confirmation ("We'll save your logs, reveal them in Finder (macOS), and open a pre-filled email to support@capgo.app — continue?" — the Finder clause shows only on macOS). Only on confirm it:
    • writes ONE combined bundle in both forms: builder-support-<appId>-<ts>.log (readable) and .log.gz (compact), in ~/.capgo-credentials/support/;
    • copies the GZIPPED .log.gz path to the clipboard; on macOS reveals it in Finder (open -R);
    • opens mailto:support@capgo.app with a pre-filled subject + short body;
    • prints: "Opened an email to support@capgo.app and saved your logs to <path>.log.gz (copied to clipboard). Attach that file and send."
  4. Done. No network calls of our own.
mailto:support@capgo.app
  ?subject=Capgo Builder support — <appId> (<platform>)
  &body=<short greeting + 1-line problem + tiny diagnostics summary +
         "Please attach the logs file at <path> (copied to your clipboard).">

Body kept short (mailto URLs ~1.8–2 KB limit); full logs live in the attached file. Opened via the existing open npm package.

4 · Reuse map (all already in cli/src)

NeedReuse
Open mail clientopen npm pkg (used in init/command.ts, bundle/builder-cta.ts, onboarding UIs)
Save file + tell user wherethe .env export pattern in build/credentials-manage.ts
Copy path to clipboardcopyToClipboard() (pbcopy/xclip/wl-copy) in credentials-manage.ts
Write the bundleextend writeOnboardingSupportBundle() in onboarding-support.ts
Gzip variantnode:zlib gzipSync
Verbose log (non-build failures)extend the src/debug.ts / internal-log idea

5 · Internal log

6 · Components to build (CLI only)

7 · Explicitly NOT built (vs shelved design)

Backend /build/support · worker /support · Cloudflare Email Service / send_email · automations-bridge changes · CC/BCC/Reply-To · server-side rate limiting · double-delivery-race handling · Discord threading code. All unnecessary — the user's own client sends the email and the existing bridge handles inbound natively.

8 · Trade-offs

9 · Open items

  1. Final mailto: subject/body + CLI instruction wording.
  2. Bundle filename/format; both .log and .log.gz produced (current plan).
  3. Non-macOS reveal (Linux/Windows: print path + clipboard; no Finder reveal).

Prior exploration (rejected as too complex): 2026-06-03-builder-contact-support-design.md