From kirei
Set up production-ready Sentry error + performance monitoring for a project. Detects the framework (Electron, Next.js, Vite/React SPA, Node/Nest, React Native), asks the consent + scope + region decisions, verifies the current SDK API via Ref, then spawns the kirei-sentry agent to produce a framework-specific plan and kirei-forge to implement it — with consent gating, recursive PII scrubbing, CI-only source-map upload, region handling, and the exact CI secrets. Use whenever a user wants to add Sentry, set up error tracking / crash reporting, wire production monitoring, add performance tracing, or integrate Sentry into a new or existing project — even if they don't say "kirei". Invoke with /kirei-sentry; the skill asks the key decisions before working.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kirei:kirei-sentryThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You have been invoked via `/kirei-sentry`. Follow this workflow precisely.
You have been invoked via /kirei-sentry. Follow this workflow precisely.
You orchestrate the kirei-sentry research agent (which designs a production-ready, privacy-respecting Sentry integration for the detected framework) and then kirei-forge (which implements it). The hard-won lessons — init timing, consent gating, PII scrubbing, source-map region handling, CI secrets — live in the agent; this skill gathers the few decisions only the user can make, then drives the flow.
You do not write integration code yourself, and you do not touch the user's Sentry dashboard or CI secrets — those are the user's steps. The agent prescribes; kirei-forge implements; the user finishes the SaaS/infra side.
Strip these before proceeding:
| Flag | Meaning |
|---|---|
--research-only | Skip Step 5 (the execute agent). Deliver the plan only. |
--framework <fw> | Override framework detection. Valid: electron, nextjs, vite, node, nest, react-native. |
--self-hosted | Target a self-hosted Sentry instead of the cloud SaaS. |
--default-on | Skip the consent question — use default-ON-with-disclosure (server/SaaS). Otherwise the default recommendation is opt-in/default-OFF. |
--scope <s> | Skip the scope question. Valid: errors, errors+perf, full (incl. Session Replay). |
Any flag the user passes must reach the spawned agent's prompt verbatim.
Skip any question already answered by a flag. Otherwise use AskUserQuestion (these change the whole shape of the integration, so ask intentionally):
sentry.io / EU de.sentry.io / self-hosted URL). The region matters for source-map upload — getting it wrong 404s in CI.If the user says "just use sensible defaults", proceed with opt-in/default-OFF · errors+perf (perf as separate opt-in) · cloud, ask region from the DSN later and say so.
One line:
"Running kirei-sentry to design a [framework] Sentry setup ([consent] · [scope] · [hosting/region]) → kirei-forge to implement. Findings to
docs/sentry/."
Variants:
--research-only: "… (research only — no implementation)."Spawn the kirei-sentry agent with the Agent tool. It has no session context — include everything.
Prompt structure:
Task: Set up production-ready Sentry for this project. [Plus any extra detail the user gave beyond /kirei-sentry.]
Working directory: [current working directory]
Decisions:
- Consent model: [opt-in default-off | default-on with disclosure]
- Scope: [errors | errors+perf | full incl. replay]
- Hosting / region: [cloud US | cloud EU | self-hosted <url>]
Flags: [--framework <fw> if set] [--self-hosted if set]
Context:
[Framework if known, build tooling, monorepo layout, existing settings/store mechanism, CI release workflow, any DSN already present (region hint), constraints the user mentioned.]
Verify the current SDK API via Ref MCP before prescribing — the API drifts across versions.
Deliver: structured KIREI-SENTRY HANDOFF block + write findings to docs/sentry/ in this repo.
Run in the foreground — you need the plan before implementing.
When the agent completes, read its KIREI-SENTRY HANDOFF:
docs/sentry/*.md for today. If missing (look for FINDINGS FILE NOT WRITTEN), write it yourself from the handoff via the Write tool at docs/sentry/YYYY-MM-DD-sentry-setup.md.build.If the agent returned no handoff at all (errored / ran out of budget): tell the user in one sentence, point to anything partial, and offer to retry with a narrower scope. Do not fabricate a plan.
Skip if --research-only was passed.
Spawn kirei-forge (or kirei-build only if the handoff is genuinely SIMPLE):
Prompt structure:
Working directory: [current working directory]
Here is the KIREI-SENTRY HANDOFF:
[paste full handoff block]
Findings doc: docs/sentry/[filename]
Implement the setup following the fix order. Critical rules:
- Branch first (never the default branch). Small conventional commits.
- Use the project's package manager to add the Sentry packages into the correct workspace(s).
- The PII scrubber is privacy-critical — write a unit test proving it strips the OS username / home paths from event frames, nested breadcrumb data, and extra/contexts.
- The code must work with the DSN/secrets ABSENT (no init, no crash) — verify that gating.
- Do NOT create the Sentry project, set CI secrets, or touch the Sentry dashboard — those are out of scope (list them for the user).
- Run typecheck + lint + the relevant tests and report results. Do NOT push or open a PR.
Run in the foreground.
Summarize:
org:ci scope) and set CI secrets: SENTRY_AUTH_TOKEN, SENTRY_ORG, SENTRY_PROJECT, SENTRY_DSN (+ SENTRY_URL for EU/self-hosted). SENTRY_DSN is required for production telemetry to initialize at all.docs/sentry/[filename].SENTRY_DSN is the one secret that gates everything. Make sure the final report flags that production builds ship dead without it.url/SENTRY_URL.sendDefaultPii: false, a recursive scrubber with a test, no Session Replay unless explicitly requested. If the plan is missing any of these, fix the plan before implementing.npx claudepluginhub shironex/kirei --plugin kireiProvides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.