Maple onboard

From Makisuo/maple · View interactive version

Maple onboard is an AI agent skill from the GitHub repository Makisuo/maple. Set up Maple observability in a project: install OpenTelemetry traces, logs, and metrics across every app and service in the repo, then verify a real trace arrives in Maple. Triggers on requests like 'install Maple', 'set up Maple', 'add Maple telemetry', 'onboard this repo to Maple', 'instrument wi

How to use this skill

Skill file

Maple agent setup guide

Wire OpenTelemetry traces, logs, and metrics into every app and service in the repo so telemetry streams to Maple, then prove it with a real trace. Use native OpenTelemetry APIs and each framework's documented bootstrap. If a stack stumps you, read the OTel docs for that language; don't guess.

Working rules

Companion skills

Read maple-onboarding-style first (span pattern, resource attributes, framework notes, signal quality, verification), then the skill for each stack in the repo: maple-nextjs-style, maple-nodejs-style, maple-python-style, maple-effect-style, maple-go-style, maple-rust-style, maple-java-style, maple-csharp-style, maple-kotlin-style. If they are not installed next to this skill, fetch them from https://raw.githubusercontent.com/MapleTechLabs/maple/main/skills/<skill-name>/SKILL.md, only the ones this repo needs. Stacks without one (Ruby, Elixir, PHP, Deno, ...) use maple-onboarding-style and the upstream OTel docs. A service that calls an LLM also gets maple-agent-tracing; a browser frontend gets maple-frontend-tracing.

Onboarding progress (handoff code)

Skip this section when the prompt has no handoff code (maple_ho_...). With one, Maple shows the user your progress live:

  1. Ask the user before running the install script, then install and sign in with the code and the Maple API from the prompt: curl -fsSL https://maple.dev/cli/install | MAPLE_API_URL=<api> MAPLE_HANDOFF=<code> sh. If maple is already installed, check maple --version first: 0.5.0 or newer signs in with MAPLE_API_URL=<api> MAPLE_HANDOFF=<code> maple auth login; an older one ignores the code, so update it with the install command above (ask first) or skip this section. The code works once, against that API only. Sign-in reports connect_agent itself.
  2. Report each stage as you go with maple onboarding report <stage> <status> [--note "..."]. Status is active, waiting, completed, skipped or failed.
  1. When the prompt has no key, maple onboarding keys prints the ingest endpoint and public key.

If sign-in fails because the code expired or was used, ask the user (question tool) to click Copy prompt in Maple again and paste the new prompt, and keep setting up while you wait. If the CLI can't be installed (no network, or the user declined), skip this section: setup works without it, the user just sees no progress in Maple.

Rules: report silently and never block setup on reporting. Notes are short plain text: no file contents, paths, terminal output, payloads or secrets. Stop reporting once a report says the run is closed (409). Never print or log the handoff code. With the Maple MCP connected you may use its onboarding_status_update tool instead.

Step 0: Region, endpoint, and key

A key only works in the region that issued it; the other region answers 401.

| Region | Ingest endpoint | Dashboard | MCP server |

| --- | --- | --- | --- |

| US (default) | https://ingest.maple.dev | https://app.maple.dev | https://api.maple.dev/mcp |

| EU | https://ingest.eu.maple.dev | https://app.eu.maple.dev | https://api.eu.maple.dev/mcp |

Pick the region in this order: an ingest endpoint in the prompt (use it verbatim), an EU mention or eu.maple.dev URL, otherwise US. <dashboard> and <mcp> below mean that region's hosts.

Inline the endpoint and the ingest key in the bootstrap source. The key is project-scoped and write-only (think Sentry DSN): no .env files, no process.env.OTEL_EXPORTER_OTLP_*, no deploy wiring. The public key (maple_pk_…) is safe everywhere, browser and mobile included. The private key (maple_sk_…) is server-only.

Step 1: Map every service

Enumerate from workspace manifests (pnpm/bun/npm workspaces, go.work, Cargo, Python workspaces) and apps/* / services/*: web frontends, APIs, workers, background jobs, CLIs, demo apps, mobile apps, serverless and edge functions. Skip only packages with no runtime entry point. Instrument everything in this run; there may be no follow-up. Print the list so the user can correct it, then continue without waiting.

Step 2: Install native OTel and bootstrap each service

Use the language's native SDK, at the registry's current version:

Rules:

Per-framework details (browser init and CORS, Expo, Workers, FastAPI) are in maple-onboarding-style "Framework notes" and the stack skills.

Step 3: Business spans, logs, and metrics

Auto-instrumentation is the floor. Read the code and add, per maple-onboarding-style "Business signals":

Step 4: Verify (the done criteria)

The setup is done only when Maple shows a trace from the real bootstrap, or, on the no-tools path in item 4, when the user confirms that trace in the dashboard. Per service:

  1. The project's own dev or build command still starts cleanly. Broken startup is a regression: fix it.
  2. Run the app the normal way: offer to start it, or ask the user how they run it.
  3. Drive one real request through an instrumented route (or a real CLI command) so the trace comes from the real bootstrap. No standalone script that bypasses it. Then identify that request's own trace: its trace id (the traceparent response header, or the exporter's debug output), or else the deployment.environment.name you set for this run, which no other deployment uses. A span from another deployment of the same service.name proves nothing.
  4. Confirm in Maple that this request's trace arrived: a span from the configured service.name that matches the trace ID from item 3 or the deployment.environment.name you set for this run. Use MCP search_traces (filter by that environment) / inspect_trace <trace-id>, or the maple CLI (maple trace <trace-id>, or maple traces -s <service> --env <environment> --since 15m; with a handoff code, maple onboarding verify --service <service> --env <environment>, which also reports the stage). A span from the service alone, without that trace ID or environment, proves nothing. With Maple MCP connected, run audit_setup and fix what it reports; with the CLI only, the audit runs in Step 7 once MCP is connected. With neither MCP nor the CLI, offer the MCP connection from Step 7 now; if the user declines, ask them to confirm the trace in the dashboard (<dashboard>/traces/<trace-id> with the ID from item 3, or the Traces page filtered to the service and that environment) instead of claiming it yourself.
  5. Show the user the link to that trace: <dashboard>/traces/<trace-id> (look it up with MCP inspect_trace or maple trace <trace-id> first; on the no-tools path, use the trace ID or link the user confirmed).

If nothing arrives within about 2 minutes, keep debugging: endpoint region, key, init order, exporter errors (maple-onboarding-style "Verify export" has the per-language diagnostics and what to do on a 401). With MAPLE_TEST nothing is stored: confirm export succeeds with no exporter errors, and tell the user that Maple verification waits for their real key.

Step 5: Production

Agree with the user, briefly:

Step 6: Hand-off

Step 7: Maple MCP

Skip if Maple MCP tools are already connected to <mcp> (a server in the other region answers 401 or reads another organization). Otherwise offer to run, and confirm first: claude mcp add --transport http maple <mcp>. Mention without running: Codex codex mcp add maple --url <mcp>; Cursor and others copy the snippet at <dashboard>/mcp. Once it is connected, run audit_setup if Step 4 could not, and fix what it reports.

Hard rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.