@zibby/skills 0.1.26 → 0.1.28

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.
@@ -265,6 +265,111 @@ Templates are starter workflow scaffolds. `add` overwrites existing files in pla
265
265
  Options on `add`:
266
266
  - `--skip-memory` — strip `SKILLS.MEMORY` from copied `execute-live.mjs` (browser-test template only)
267
267
 
268
+ ## App commands {#app-commands}
269
+
270
+ `zibby app` manages [Managed App instances](./apps/) — hosted open-source tools (n8n, Grafana, …) with an autonomous agent-ops sidecar. Each verb is keyed by **instance ID** (`a1b2c3d4`-style); `zibby app list` shows IDs alongside display names.
271
+
272
+ | Command | What it does |
273
+ |---|---|
274
+ | [`zibby app templates`](#app-templates) | Browse the catalog (n8n, grafana, gas-town, drawio, open-webui, …) |
275
+ | [`zibby app list`](#app-list) | List deployed instances under your account |
276
+ | [`zibby app deploy <appType>`](#app-deploy) | Deploy an app from the catalog |
277
+ | [`zibby app status <id>`](#app-status) | One-screen summary: status, resources, URL, last agent-ops run |
278
+ | [`zibby app logs <id>`](#app-logs) | Logs from app + agent-ops, with `-t` tail mode |
279
+ | [`zibby app upgrade <id>`](#app-upgrade) | Zero-downtime roll to the catalog's current image |
280
+ | [`zibby app restart <id>`](#app-restart) | Force ECS service to roll the running tasks |
281
+ | [`zibby app update-credential <id>`](#app-update-credential) | Rotate a BYOK credential and restart |
282
+ | [`zibby app destroy <id>`](#app-destroy) | Tear down service + volume (data permanently deleted) |
283
+
284
+ ### app templates {#app-templates}
285
+
286
+ ```bash
287
+ zibby app templates
288
+ ```
289
+
290
+ Print the live catalog — id, display name, tier, hourly rate, one-line description.
291
+
292
+ ### app list {#app-list}
293
+
294
+ ```bash
295
+ zibby app list # all instances under your account
296
+ zibby app list --project <id> # scope to one project
297
+ ```
298
+
299
+ Options:
300
+ - `--project <id>` — project to scope the listing to (default: all projects your account owns)
301
+ - `--api-key <key>` — API key (or `ZIBBY_API_KEY` env)
302
+
303
+ ### app deploy {#app-deploy}
304
+
305
+ ```bash
306
+ zibby app deploy n8n --project <project-id> --name automations
307
+ ```
308
+
309
+ Options:
310
+ - `--project <id>` — interactive picker if omitted
311
+ - `--name <name>` — display name in the dashboard / `zibby app list` (defaults to `appType`)
312
+ - `--cpu <units>` — Fargate CPU units (e.g. `1024` for 1 vCPU; default from tier)
313
+ - `--memory <mb>` — Fargate memory in MB (e.g. `2048` for 2 GB; default from tier)
314
+ - `--api-key <key>` — API key (or `ZIBBY_API_KEY` env)
315
+
316
+ Returns an `instanceId` and the public URL.
317
+
318
+ ### app status {#app-status}
319
+
320
+ ```bash
321
+ zibby app status a1b2c3d4
322
+ ```
323
+
324
+ Prints status, resources, hourly rate, public URL, and the latest agent-ops run summary.
325
+
326
+ ### app logs {#app-logs}
327
+
328
+ ```bash
329
+ zibby app logs a1b2c3d4 # last 200 lines
330
+ zibby app logs a1b2c3d4 -t # tail mode, polls every 3s, SSE auto-reconnect
331
+ zibby app logs a1b2c3d4 --lines 1000 # bigger window
332
+ zibby app logs a1b2c3d4 --json # raw JSON lines
333
+ zibby app logs a1b2c3d4 --verbose # full line including JSON body
334
+ ```
335
+
336
+ Logs cover **both** containers — the app and the agent-ops sidecar — prefixed by source. Default output is the parsed `<time> <msg>` summary.
337
+
338
+ ### app upgrade {#app-upgrade}
339
+
340
+ ```bash
341
+ zibby app upgrade a1b2c3d4
342
+ zibby app upgrade a1b2c3d4 --version 0.1.16 # pin a specific agent-ops version
343
+ zibby app upgrade a1b2c3d4 --yes # skip confirmation
344
+ ```
345
+
346
+ Registers a new task definition revision, updates the ECS service, and lets the ALB drain old tasks before they exit. Zero-downtime for HTTP traffic.
347
+
348
+ ### app restart {#app-restart}
349
+
350
+ ```bash
351
+ zibby app restart a1b2c3d4
352
+ ```
353
+
354
+ Forces the ECS service to roll the current tasks without changing the task definition. Useful when the app gets wedged on a stuck connection.
355
+
356
+ ### app update-credential {#app-update-credential}
357
+
358
+ ```bash
359
+ zibby app update-credential a1b2c3d4
360
+ ```
361
+
362
+ Picks up whatever's currently in your workspace credentials and rolls the task with the new secret env. EFS data is preserved; the task restarts in ~30s. Used by BYOK apps (e.g. Open WebUI pointing at Anthropic via your own key).
363
+
364
+ ### app destroy {#app-destroy}
365
+
366
+ ```bash
367
+ zibby app destroy a1b2c3d4 # interactive confirm
368
+ zibby app destroy a1b2c3d4 --yes # skip the confirmation prompt
369
+ ```
370
+
371
+ Drains the ECS service, deletes the task definition revision, removes the ALB listener rule + target group, releases the EFS access point (**destroying the volume data permanently**), and stops the billing meter immediately. No soft delete.
372
+
268
373
  ## Environment variables
269
374
 
270
375
  | Var | Purpose |
package/docs/intro.md CHANGED
@@ -56,8 +56,20 @@ zibby template add <name> # add a template later (overwrites =
56
56
  - **Run anywhere** — local with hot reload, or cloud with Heroku-style bundles (~3s cold start).
57
57
  - **Session replay** — every run lands as on-disk JSONL + artifacts. Re-run any node via `--session <id> --node <name>`.
58
58
  - **Cloud-native** — SSE log streaming, dedicated egress IPs for firewalled GitLab / GitHub Enterprise / Salesforce.
59
+ - **Hosted apps too** — [Managed Apps](./apps/) host open-source tools (n8n, Grafana, Open WebUI, draw.io) with an autonomous agent-ops sidecar that handles health checks, self-healing, and upgrades.
59
60
  - **Drive it from your AI agent** — [`@zibby/mcp-cli`](./packages/mcp-cli) exposes deploy / trigger / logs / debug as MCP tools. Add one snippet to Claude Code, Cursor, Codex, or Gemini and they call Zibby directly from chat. See [Use from your AI agent](./get-started/use-from-agents).
60
61
 
62
+ ## Two product surfaces
63
+
64
+ | | **Workflows** | **Apps** |
65
+ |---|---|---|
66
+ | Lifetime | Per trigger (seconds-minutes) | Long-lived |
67
+ | Surface | Graph of agent CLI calls | A whole open-source application |
68
+ | Billing | Per execution | Per minute, while running |
69
+ | Best for | "When ticket lands, classify it" | "Host n8n for the team" |
70
+
71
+ Pick by how long the thing needs to run — see [Apps overview](./apps/) for the decision tree.
72
+
61
73
  ## How it compares
62
74
 
63
75
  | | Zibby | Claude Code Agent Teams | Devin | Mastra / LangGraph / CrewAI |
@@ -30,6 +30,7 @@ You don't have to use the recipes. You can build whatever pipeline you want with
30
30
  | Recipe | What it does | Best for |
31
31
  |---|---|---|
32
32
  | [`zibby test`](./test) | Drives a browser via Cursor or Claude, runs assertions, generates a Playwright script + verification video | E2E test generation from plain-English specs |
33
+ | [Sentry Triage](./sentry-triage) | Hourly: fetch unresolved Sentry issues, classify by severity, route via Slack/Lark — author DM + usergroup mention | Automated incident routing without a human triager |
33
34
  | `zibby analyze` | Reads a Jira/Linear ticket, walks the codebase, produces an implementation plan | Pre-implementation planning, ticket triage |
34
35
  | `zibby generate` | Generates test specs from a ticket + codebase | Backfilling test coverage on legacy projects |
35
36
  | `zibby video` | Re-records or organizes verification videos for an existing test | Producing demos, regenerating after code changes |
@@ -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.26",
3
+ "version": "0.1.28",
4
4
  "description": "Built-in skill definitions for Zibby test automation framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -8,6 +8,7 @@
8
8
  ".": "./dist/index.js",
9
9
  "./bin/mcp-sentry.mjs": "./bin/mcp-sentry.mjs",
10
10
  "./bin/mcp-lark.mjs": "./bin/mcp-lark.mjs",
11
+ "./bin/mcp-slack.mjs": "./bin/mcp-slack.mjs",
11
12
  "./browser": "./dist/browser.js",
12
13
  "./jira": "./dist/jira.js",
13
14
  "./github": "./dist/github.js",