@zibby/skills 0.1.27 → 0.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,93 @@
1
+ ---
2
+ sidebar_position: 3
3
+ title: Sentry triage recipe
4
+ ---
5
+
6
+ # `sentry-triage` — agent-driven Sentry triage
7
+
8
+ An hourly Sentry triage workflow that fetches unresolved issues, classifies them by severity, and **routes them to the right human**. Three nodes, end-to-end agent-driven, deployed from the marketplace in one click.
9
+
10
+ ```
11
+ fetch_issues → classify → dispatch_alerts
12
+ (deterministic (LLM — (LLM —
13
+ + Sentry API) severity) Slack/Lark, agent-driven routing)
14
+ ```
15
+
16
+ ## What it does
17
+
18
+ 1. **fetch_issues** — calls Sentry's REST API for issues unresolved + unassigned + `lastSeen:-60m`. Hydrates each with `suspectCommits[]` (author email from Sentry's GitHub integration) for downstream routing.
19
+ 2. **classify** — labels each issue `NOISE | LOW | MEDIUM | HIGH | CRITICAL` based on a configurable rubric (impact metric, surface area, payment paths, security tags). Skips below-threshold issues.
20
+ 3. **dispatch_alerts** — the routing brain. Three layers of decisioning:
21
+ - **Free-form `DISPATCH_RULES`** in env (highest priority) — natural language like *"send to Sam for billing issues"*
22
+ - **Structured env vars** — `SLACK_CHANNEL`, `ROUTING_PREFER_AUTHOR`, `ROUTING_HIGH_SEVERITY_GROUP`
23
+ - **Defaults** — channel-only post, threshold `MEDIUM`
24
+
25
+ The agent uses [`slack_lookup_user_by_email`](../skills/slack), [`slack_list_usergroups`](../skills/slack), [`slack_search_users`](../skills/slack) (or the Lark equivalents) to resolve names → IDs, then `slack_post_message` / `lark_send_message` to deliver. Channel post, user DM, usergroup mention — same agent decides per-issue based on what you wrote in the rules.
26
+
27
+ ## Deploy from the marketplace
28
+
29
+ ```bash
30
+ zibby workflow templates deploy sentry-triage --project <project-id>
31
+ ```
32
+
33
+ Or via the dashboard: `/marketplace/workflows` → Sentry Triage → Deploy.
34
+
35
+ After deploy, configure ENV (Apps → workflow → ENV tab):
36
+
37
+ | Env var | Required? | Default | What it does |
38
+ |---|---|---|---|
39
+ | `SLACK_CHANNEL` *or* `LARK_RECEIVE_ID` | Yes (one of) | — | Channel id (Slack `C…`) / chat id (Lark `oc_…`) for fallback posts |
40
+ | `SEVERITY_THRESHOLD` | No | `MEDIUM` | Skip anything below: `NOISE` / `LOW` / `MEDIUM` / `HIGH` / `CRITICAL` |
41
+ | `ROUTING_PREFER_AUTHOR` | No | `false` | If `true`, when a suspect commit author is known, DM them |
42
+ | `ROUTING_HIGH_SEVERITY_GROUP` | No | — | Slack usergroup handle (`@oncall`) mentioned on CRITICAL/HIGH |
43
+ | `SLACK_MENTIONS` *or* `LARK_MENTIONS` | No | `[]` | JSON array of mentions prepended on CRITICAL only |
44
+ | `DISPATCH_RULES` | No | — | Free-form natural-language override (see below) |
45
+
46
+ ## DISPATCH_RULES — natural-language routing
47
+
48
+ When you set `DISPATCH_RULES`, the agent treats it as **authoritative**; the structured env vars become fallbacks for things the rules don't cover.
49
+
50
+ ```
51
+ DISPATCH_RULES="
52
+ - CRITICAL bugs in /payment/ → DM Sam and post to #incidents
53
+ - HIGH severity → DM the suspect commit author if known, else post to #engineering
54
+ - Anything mentioning 'security' → also mention the @security usergroup
55
+ - Frontend bugs (zibby-frontend project) → only Sarah, never page on-call
56
+ - NOISE → skip entirely
57
+ "
58
+ ```
59
+
60
+ The agent reads issue metadata (severity, message, tags, suspectCommit author email, project name) and applies rules in order. **Same rule + same issue is deterministic** — temperature 0, schema-enforced output, every dispatch records who got it and why under `dispatched[].recipient.{kind,id,label}`.
61
+
62
+ ## Author-DM path
63
+
64
+ When `ROUTING_PREFER_AUTHOR=true` and Sentry has a `suspectCommits[0].author.email`:
65
+
66
+ ```
67
+ 1. agent reads issue.suspectCommits[0].authorEmail
68
+ 2. → slack_lookup_user_by_email(email)
69
+ 3a. ✓ returns {id, name} → slack_post_message(channel: <user-id>, text: …)
70
+ 3b. ✗ users_not_found → channel fallback
71
+ ```
72
+
73
+ Requires the [Sentry → GitHub integration](https://sentry.io/settings/integrations/github/) installed and Code Mappings configured. Without it, `suspectCommits[]` is empty and the agent falls back to channel-only routing automatically.
74
+
75
+ If you deployed your backend with `RELEASE_SHA` Sentry release-tracking on, suspect commits populate within ~minutes of new issues being created. (The platform-side wiring — `Sentry.init({release})` + `sentry-cli releases set-commits --auto` at deploy time — is what makes per-issue blame work; without it, every issue lands with `suspectCommits: []`.)
76
+
77
+ ## Customize the prompts
78
+
79
+ Each node's prompt lives in its own module — fork the template, edit, redeploy:
80
+
81
+ ```bash
82
+ zibby workflow download <uuid>
83
+ # edit nodes/dispatch-node.js
84
+ zibby workflow deploy ./sentry-triage # same UUID, new version
85
+ ```
86
+
87
+ Or fork the whole template repo if you want long-term divergence — it's just a `@zibby/workflow-templates/sentry-triage/` directory in the published package.
88
+
89
+ ## Cadence
90
+
91
+ Default: hourly cron, fires `sinceMinutes=60`. Change in the trigger config (Apps → workflow → Triggers) — keep the SQL safe `since` between 5 and 1440 minutes (`inputSchema` enforces this).
92
+
93
+ → Next: [`zibby test`](./test) (the browser-testing recipe) or [Build your own workflow](../get-started/your-first-workflow).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zibby/skills",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "description": "Built-in skill definitions for Zibby test automation framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",