@hailer/mcp 1.1.13 → 1.1.15

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.
Files changed (176) hide show
  1. package/.claude/.context-watchdog.json +1 -0
  2. package/.claude/.session-checked +1 -0
  3. package/.claude/CLAUDE.md +370 -0
  4. package/.claude/agents/agent-ada-skill-builder.md +94 -0
  5. package/.claude/agents/agent-alejandro-function-fields.md +342 -0
  6. package/.claude/agents/agent-bjorn-config-audit.md +103 -0
  7. package/.claude/agents/agent-builder-agent-creator.md +130 -0
  8. package/.claude/agents/agent-code-simplifier.md +53 -0
  9. package/.claude/agents/agent-dmitri-activity-crud.md +159 -0
  10. package/.claude/agents/agent-giuseppe-app-builder.md +208 -0
  11. package/.claude/agents/agent-gunther-mcp-tools.md +39 -0
  12. package/.claude/agents/agent-helga-workflow-config.md +204 -0
  13. package/.claude/agents/agent-igor-activity-mover-automation.md +125 -0
  14. package/.claude/agents/agent-ingrid-doc-templates.md +261 -0
  15. package/.claude/agents/agent-ivan-monolith.md +154 -0
  16. package/.claude/agents/agent-kenji-data-reader.md +86 -0
  17. package/.claude/agents/agent-lars-code-inspector.md +102 -0
  18. package/.claude/agents/agent-marco-mockup-builder.md +110 -0
  19. package/.claude/agents/agent-marcus-api-documenter.md +323 -0
  20. package/.claude/agents/agent-marketplace-publisher.md +280 -0
  21. package/.claude/agents/agent-marketplace-reviewer.md +309 -0
  22. package/.claude/agents/agent-permissions-handler.md +208 -0
  23. package/.claude/agents/agent-simple-writer.md +48 -0
  24. package/.claude/agents/agent-svetlana-code-review.md +171 -0
  25. package/.claude/agents/agent-tanya-test-runner.md +333 -0
  26. package/.claude/agents/agent-ui-designer.md +100 -0
  27. package/.claude/agents/agent-viktor-sql-insights.md +212 -0
  28. package/.claude/agents/agent-web-search.md +55 -0
  29. package/.claude/agents/agent-yevgeni-discussions.md +45 -0
  30. package/.claude/agents/agent-zara-zapier.md +159 -0
  31. package/.claude/agents/ragnar.md +68 -0
  32. package/.claude/commands/app-squad.md +135 -0
  33. package/.claude/commands/audit-squad.md +158 -0
  34. package/.claude/commands/autoplan.md +563 -0
  35. package/.claude/commands/cleanup-squad.md +98 -0
  36. package/.claude/commands/config-squad.md +106 -0
  37. package/.claude/commands/crud-squad.md +87 -0
  38. package/.claude/commands/data-squad.md +97 -0
  39. package/.claude/commands/debug-squad.md +303 -0
  40. package/.claude/commands/doc-squad.md +65 -0
  41. package/.claude/commands/handoff.md +137 -0
  42. package/.claude/commands/health.md +49 -0
  43. package/.claude/commands/help.md +29 -0
  44. package/.claude/commands/help:agents.md +151 -0
  45. package/.claude/commands/help:commands.md +78 -0
  46. package/.claude/commands/help:faq.md +79 -0
  47. package/.claude/commands/help:plugins.md +50 -0
  48. package/.claude/commands/help:skills.md +93 -0
  49. package/.claude/commands/help:tools.md +75 -0
  50. package/.claude/commands/hotfix-squad.md +112 -0
  51. package/.claude/commands/integration-squad.md +82 -0
  52. package/.claude/commands/janitor-squad.md +167 -0
  53. package/.claude/commands/learn-auto.md +120 -0
  54. package/.claude/commands/learn.md +120 -0
  55. package/.claude/commands/mcp-list.md +27 -0
  56. package/.claude/commands/onboard-squad.md +140 -0
  57. package/.claude/commands/plan-workspace.md +732 -0
  58. package/.claude/commands/prd.md +130 -0
  59. package/.claude/commands/project-status.md +82 -0
  60. package/.claude/commands/publish.md +138 -0
  61. package/.claude/commands/recap.md +69 -0
  62. package/.claude/commands/restore.md +64 -0
  63. package/.claude/commands/review-squad.md +152 -0
  64. package/.claude/commands/save.md +24 -0
  65. package/.claude/commands/stats.md +19 -0
  66. package/.claude/commands/swarm.md +210 -0
  67. package/.claude/commands/tool-builder.md +39 -0
  68. package/.claude/commands/ws-pull.md +44 -0
  69. package/.claude/skills/SDK-activity-patterns/SKILL.md +428 -0
  70. package/.claude/skills/SDK-document-templates/SKILL.md +1033 -0
  71. package/.claude/skills/SDK-function-fields/SKILL.md +542 -0
  72. package/.claude/skills/SDK-generate-skill/SKILL.md +92 -0
  73. package/.claude/skills/SDK-init-skill/SKILL.md +127 -0
  74. package/.claude/skills/SDK-insight-queries/SKILL.md +787 -0
  75. package/.claude/skills/SDK-ws-config-skill/SKILL.md +1139 -0
  76. package/.claude/skills/agent-structure/SKILL.md +98 -0
  77. package/.claude/skills/api-documentation-patterns/SKILL.md +474 -0
  78. package/.claude/skills/chrome-mcp-reference/SKILL.md +370 -0
  79. package/.claude/skills/delegation-routing/SKILL.md +202 -0
  80. package/.claude/skills/frontend-design/SKILL.md +254 -0
  81. package/.claude/skills/hailer-activity-mover/SKILL.md +213 -0
  82. package/.claude/skills/hailer-api-client/SKILL.md +518 -0
  83. package/.claude/skills/hailer-app-builder/SKILL.md +1440 -0
  84. package/.claude/skills/hailer-apps-pictures/SKILL.md +269 -0
  85. package/.claude/skills/hailer-design-system/SKILL.md +231 -0
  86. package/.claude/skills/hailer-monolith-automations/SKILL.md +686 -0
  87. package/.claude/skills/hailer-permissions-system/SKILL.md +121 -0
  88. package/.claude/skills/hailer-project-protocol/SKILL.md +488 -0
  89. package/.claude/skills/hailer-rest-api/SKILL.md +61 -0
  90. package/.claude/skills/hailer-rest-api/hailer-activities.md +184 -0
  91. package/.claude/skills/hailer-rest-api/hailer-admin.md +473 -0
  92. package/.claude/skills/hailer-rest-api/hailer-calendar.md +256 -0
  93. package/.claude/skills/hailer-rest-api/hailer-feed.md +249 -0
  94. package/.claude/skills/hailer-rest-api/hailer-insights.md +195 -0
  95. package/.claude/skills/hailer-rest-api/hailer-messaging.md +276 -0
  96. package/.claude/skills/hailer-rest-api/hailer-workflows.md +283 -0
  97. package/.claude/skills/insight-join-patterns/SKILL.md +174 -0
  98. package/.claude/skills/integration-patterns/SKILL.md +421 -0
  99. package/.claude/skills/json-only-output/SKILL.md +72 -0
  100. package/.claude/skills/lsp-setup/SKILL.md +160 -0
  101. package/.claude/skills/mcp-direct-tools/SKILL.md +153 -0
  102. package/.claude/skills/optional-parameters/SKILL.md +72 -0
  103. package/.claude/skills/publish-hailer-app/SKILL.md +221 -0
  104. package/.claude/skills/testing-patterns/SKILL.md +630 -0
  105. package/.claude/skills/tool-builder/SKILL.md +250 -0
  106. package/.claude/skills/tool-parameter-usage/SKILL.md +126 -0
  107. package/.claude/skills/tool-response-verification/SKILL.md +92 -0
  108. package/.claude/skills/zapier-hailer-patterns/SKILL.md +581 -0
  109. package/.opencode/agent/agent-ada-skill-builder.md +35 -0
  110. package/.opencode/agent/agent-alejandro-function-fields.md +39 -0
  111. package/.opencode/agent/agent-bjorn-config-audit.md +36 -0
  112. package/.opencode/agent/agent-builder-agent-creator.md +39 -0
  113. package/.opencode/agent/agent-code-simplifier.md +31 -0
  114. package/.opencode/agent/agent-dmitri-activity-crud.md +40 -0
  115. package/.opencode/agent/agent-giuseppe-app-builder.md +37 -0
  116. package/.opencode/agent/agent-gunther-mcp-tools.md +39 -0
  117. package/.opencode/agent/agent-helga-workflow-config.md +204 -0
  118. package/.opencode/agent/agent-igor-activity-mover-automation.md +46 -0
  119. package/.opencode/agent/agent-ingrid-doc-templates.md +39 -0
  120. package/.opencode/agent/agent-ivan-monolith.md +46 -0
  121. package/.opencode/agent/agent-kenji-data-reader.md +53 -0
  122. package/.opencode/agent/agent-lars-code-inspector.md +28 -0
  123. package/.opencode/agent/agent-marco-mockup-builder.md +42 -0
  124. package/.opencode/agent/agent-marcus-api-documenter.md +53 -0
  125. package/.opencode/agent/agent-marketplace-publisher.md +44 -0
  126. package/.opencode/agent/agent-marketplace-reviewer.md +42 -0
  127. package/.opencode/agent/agent-permissions-handler.md +50 -0
  128. package/.opencode/agent/agent-simple-writer.md +45 -0
  129. package/.opencode/agent/agent-svetlana-code-review.md +39 -0
  130. package/.opencode/agent/agent-tanya-test-runner.md +57 -0
  131. package/.opencode/agent/agent-ui-designer.md +56 -0
  132. package/.opencode/agent/agent-viktor-sql-insights.md +34 -0
  133. package/.opencode/agent/agent-web-search.md +42 -0
  134. package/.opencode/agent/agent-yevgeni-discussions.md +37 -0
  135. package/.opencode/agent/agent-zara-zapier.md +53 -0
  136. package/.opencode/commands/app-squad.md +135 -0
  137. package/.opencode/commands/audit-squad.md +158 -0
  138. package/.opencode/commands/autoplan.md +563 -0
  139. package/.opencode/commands/cleanup-squad.md +98 -0
  140. package/.opencode/commands/config-squad.md +106 -0
  141. package/.opencode/commands/crud-squad.md +87 -0
  142. package/.opencode/commands/data-squad.md +97 -0
  143. package/.opencode/commands/debug-squad.md +303 -0
  144. package/.opencode/commands/doc-squad.md +65 -0
  145. package/.opencode/commands/handoff.md +137 -0
  146. package/.opencode/commands/health.md +49 -0
  147. package/.opencode/commands/help-agents.md +151 -0
  148. package/.opencode/commands/help-commands.md +32 -0
  149. package/.opencode/commands/help-faq.md +29 -0
  150. package/.opencode/commands/help-plugins.md +28 -0
  151. package/.opencode/commands/help-skills.md +7 -0
  152. package/.opencode/commands/help-tools.md +40 -0
  153. package/.opencode/commands/help.md +28 -0
  154. package/.opencode/commands/hotfix-squad.md +112 -0
  155. package/.opencode/commands/integration-squad.md +82 -0
  156. package/.opencode/commands/janitor-squad.md +167 -0
  157. package/.opencode/commands/learn-auto.md +120 -0
  158. package/.opencode/commands/learn.md +120 -0
  159. package/.opencode/commands/mcp-list.md +27 -0
  160. package/.opencode/commands/onboard-squad.md +140 -0
  161. package/.opencode/commands/plan-workspace.md +732 -0
  162. package/.opencode/commands/prd.md +131 -0
  163. package/.opencode/commands/project-status.md +82 -0
  164. package/.opencode/commands/publish.md +138 -0
  165. package/.opencode/commands/recap.md +69 -0
  166. package/.opencode/commands/restore.md +64 -0
  167. package/.opencode/commands/review-squad.md +152 -0
  168. package/.opencode/commands/save.md +24 -0
  169. package/.opencode/commands/stats.md +19 -0
  170. package/.opencode/commands/swarm.md +210 -0
  171. package/.opencode/commands/tool-builder.md +39 -0
  172. package/.opencode/commands/ws-pull.md +44 -0
  173. package/.opencode/opencode.json +21 -0
  174. package/package.json +1 -1
  175. package/scripts/postinstall.cjs +64 -0
  176. package/scripts/test-hal-tools.ts +154 -0
@@ -0,0 +1,581 @@
1
+ ---
2
+ name: zapier-hailer-patterns
3
+ description: Patterns for building Zapier integrations with Hailer REST API
4
+ version: 1.0.1
5
+ triggers: When building Zapier automations, webhook triggers, or API integrations
6
+ ---
7
+
8
+ # Zapier-Hailer Integration Patterns
9
+
10
+ Use this skill when building Zapier automations that integrate with Hailer.
11
+
12
+ ## Key Insight: Zapier + Any REST API
13
+
14
+ Zapier doesn't have a native Hailer integration, but **Webhooks by Zapier** can connect to ANY REST API. This means:
15
+ - Hailer's full REST API is available via Zapier
16
+ - Same pattern works for any external system with REST API
17
+
18
+ ---
19
+
20
+ ## CRITICAL: Custom Request Configuration
21
+
22
+ **#1 Zapier mistake: Not setting `return_raw_response`**
23
+
24
+ Every Custom Request step MUST set `return_raw_response: true` (or `"yes"` in JSON).
25
+
26
+ Without this parameter:
27
+ - Zapier returns only HTTP status (200 OK), not the response body
28
+ - You can't get created activity IDs
29
+ - You can't parse API responses in Code steps
30
+ - You can't chain API calls using returned data
31
+
32
+ **Always include this:**
33
+ ```json
34
+ {
35
+ "method": "POST",
36
+ "url": "https://api.hailer.com/api/v3/activity/create",
37
+ "return_raw_response": "yes" // ← ESSENTIAL - Enables access to response body
38
+ }
39
+ ```
40
+
41
+ This single parameter fixes 90% of "Zap runs but I can't access the data" issues.
42
+
43
+ ---
44
+
45
+ ## Knowledge Sources
46
+
47
+ **Always query NotebookLM first** for detailed patterns and examples:
48
+
49
+ ```
50
+ Notebook: "Zapier-opas Haileriin: Automaatio, AI-orkestointi ja yritysratkaisut"
51
+ ID: 2d93afb6-6378-45e7-b380-3ee3c235244f
52
+ ```
53
+
54
+ This notebook contains:
55
+ - Hailer REST API documentation
56
+ - Authentication patterns
57
+ - Field type formats
58
+ - Example zaps with annotations
59
+ - Webhook configuration guides
60
+
61
+ **Also check:** "Hailer REST-api" notebook (ID: `68e4e3fd-6ed6-4e0b-b624-672773ba4142`) for API endpoint details.
62
+
63
+ ## Quick Reference
64
+
65
+ ### Authentication
66
+ ```
67
+ POST https://api.hailer.com/api/login
68
+ Body: {"0": "email", "1": "password"}
69
+ Returns: Session key → use as "hlrkey" header
70
+ ```
71
+
72
+ ### Webhook Triggers
73
+ - Configured per-phase in Hailer (not per-workflow)
74
+ - Set `webhooksEnabled: true` and `webhookUrl` on phase
75
+
76
+ **CRITICAL: Webhook Payload Structure**
77
+ ```typescript
78
+ {
79
+ _id: string; // Activity ID (MongoDB ObjectId)
80
+ name: string; // Activity name
81
+ currentPhase: string; // Phase ID (MongoDB ObjectId)
82
+ process: string; // Workflow ID (MongoDB ObjectId)
83
+ fields: Array<{
84
+ id: string; // Field ID (MongoDB ObjectId)
85
+ type: string; // Field type
86
+ value: any; // Field value
87
+ key?: string; // Optional field key (human-readable)
88
+ }>;
89
+ }
90
+ ```
91
+
92
+ **Finding field values - two methods:**
93
+ ```javascript
94
+ // Method 1: By key (if field has key property - preferred when available)
95
+ const tagValue = fields.find(f => f.key === 'tag')?.value;
96
+
97
+ // Method 2: By fieldId (always works - use real MongoDB IDs)
98
+ const tagValue = fields.find(f => f.id === '507f1f77bcf86cd799439011')?.value;
99
+ ```
100
+
101
+ **⚠️ NEVER use SDK enums in automations.** Webhooks receive raw MongoDB ObjectIds, not SDK enum names. Use real IDs from the workspace or extract from payload.
102
+
103
+ ### Activity Creation
104
+ ```
105
+ POST https://api.hailer.com/api/v3/activity/create
106
+ Headers: Content-Type: application/json, hlrkey: <session_key>
107
+ Body: {
108
+ "0": "workflowId",
109
+ "1": {
110
+ "name": "Activity name",
111
+ "phaseId": "phaseId",
112
+ "teamId": "teamId",
113
+ "fields": { "fieldId": "value" }
114
+ }
115
+ }
116
+ ```
117
+
118
+ ### Field Types
119
+ | Type | Format |
120
+ |------|--------|
121
+ | text/textarea | String |
122
+ | date | Timestamp in milliseconds |
123
+ | users | 24-char userId |
124
+ | activitylink | 24-char activityId |
125
+ | textpredefinedoptions | Exact option string |
126
+
127
+ ### Zapier Tips
128
+ - **Always set `return_raw_response: true`** in Custom Request steps - this gives you the full JSON response for parsing in subsequent code steps
129
+ - Webhook payloads use `id` (not `_id`) for field identifiers
130
+ - Use Code steps to parse and transform data between API calls
131
+ - Search fields by `key` property when available (e.g., `f.key === 'user'`) for more readable code
132
+ - **For Dataset workflows:** `phaseId` must be in the OPTIONS object (third parameter "2"), not in the activity object
133
+
134
+ ### Zapier Import/Export JSON Format
135
+
136
+ Zaps can be exported and imported as JSON files. This is useful for:
137
+ - Version controlling automations in git
138
+ - Sharing zap templates between projects
139
+ - Backing up zap configurations
140
+
141
+ **Top-level structure:**
142
+ ```json
143
+ {
144
+ "metadata": { "version": 2 },
145
+ "zaps": [{
146
+ "id": 1,
147
+ "title": "Zap name",
148
+ "nodes": {
149
+ "1": { /* trigger */ },
150
+ "2": { /* action 1 */ },
151
+ "3": { /* action 2 */ }
152
+ }
153
+ }]
154
+ }
155
+ ```
156
+
157
+ **Node structure:**
158
+ ```json
159
+ {
160
+ "id": 1,
161
+ "paused": false,
162
+ "type_of": "read", // "read" = trigger, "write" = action
163
+ "params": {}, // Step-specific parameters
164
+ "meta": { "$editor": { "has_automatic_issues": false }, "timezone": "Europe/Helsinki" },
165
+ "triple_stores": { "copied_from": null, "created_by": null, "polling_interval_override": 0, "block_and_release_limit_override": 0, "spread_tasks": 1 },
166
+ "parent_id": null, // null for trigger, previous node id for actions
167
+ "root_id": null, // null for trigger, 1 for all actions
168
+ "action": "hook_raw", // Action type (see below)
169
+ "selected_api": "WebHookCLIAPI@1.0.29",
170
+ "title": "Step title",
171
+ "authentication_id": null
172
+ }
173
+ ```
174
+
175
+ **Action types:**
176
+ | action | selected_api | Purpose |
177
+ |--------|--------------|---------|
178
+ | `hook_raw` | WebHookCLIAPI@1.0.29 | Catch Webhook trigger |
179
+ | `post` | WebHookCLIAPI@1.0.29 | POST request |
180
+ | `custom` | WebHookCLIAPI@1.0.29 | Custom Request (GET/POST/PUT) |
181
+ | `01929fad-d3dd-...` | CodeCLIAPI@1.0.1 | Run JavaScript code |
182
+
183
+ **Data references between steps:**
184
+ Use `{{node_id__field}}` syntax:
185
+ - `{{1__raw_body}}` - Raw body from trigger
186
+ - `{{2__results}}` - Results from node 2 (e.g., session key from login)
187
+ - `{{3__payload}}` - Output field from code step
188
+
189
+ **Example: Webhook → Login → Code → Create Activity**
190
+ ```json
191
+ {
192
+ "metadata": { "version": 2 },
193
+ "zaps": [{
194
+ "id": 1,
195
+ "title": "Phase webhook → Create task",
196
+ "nodes": {
197
+ "1": {
198
+ "id": 1, "type_of": "read", "action": "hook_raw",
199
+ "selected_api": "WebHookCLIAPI@1.0.29",
200
+ "title": "Catch webhook", "parent_id": null, "root_id": null,
201
+ "params": {}, "paused": false, "authentication_id": null,
202
+ "meta": { "$editor": { "has_automatic_issues": false }, "timezone": "Europe/Helsinki" },
203
+ "triple_stores": { "copied_from": null, "created_by": null, "polling_interval_override": 0, "block_and_release_limit_override": 0, "spread_tasks": 1 }
204
+ },
205
+ "2": {
206
+ "id": 2, "type_of": "write", "action": "post",
207
+ "selected_api": "WebHookCLIAPI@1.0.29",
208
+ "title": "Login to Hailer", "parent_id": 1, "root_id": 1,
209
+ "params": {
210
+ "payload_type": "json", "wrap_in_array": "no", "unflatten": "yes",
211
+ "url": "https://api.hailer.com/api/login",
212
+ "data": { "0": "user@example.com", "1": "PASSWORD" },
213
+ "headers": { "Content-Type": "application/json" }
214
+ },
215
+ "paused": false, "authentication_id": null,
216
+ "meta": { "$editor": { "has_automatic_issues": false }, "parammap": {} },
217
+ "triple_stores": { "copied_from": null, "created_by": null, "polling_interval_override": 0, "block_and_release_limit_override": 0, "spread_tasks": 1 }
218
+ },
219
+ "3": {
220
+ "id": 3, "type_of": "write", "action": "01929fad-d3dd-62c2-52ed-7868d5fcc691",
221
+ "selected_api": "CodeCLIAPI@1.0.1",
222
+ "title": "Build payload", "parent_id": 2, "root_id": 1,
223
+ "params": {
224
+ "code": "const body = JSON.parse(inputData.rawBody);\\nconst payload = { \"0\": \"workflowId\", \"1\": { ... } };\\nreturn { payload: JSON.stringify(payload) };",
225
+ "input": { "rawBody": "{{1__raw_body}}" }
226
+ },
227
+ "paused": false, "authentication_id": null,
228
+ "meta": { "$editor": { "has_automatic_issues": false }, "parammap": {} },
229
+ "triple_stores": { "copied_from": null, "created_by": null, "polling_interval_override": 0, "block_and_release_limit_override": 0, "spread_tasks": 1 }
230
+ },
231
+ "4": {
232
+ "id": 4, "type_of": "write", "action": "custom",
233
+ "selected_api": "WebHookCLIAPI@1.0.29",
234
+ "title": "Create activity", "parent_id": 3, "root_id": 1,
235
+ "params": {
236
+ "method": "POST", "unflatten": "yes", "return_raw_response": "no",
237
+ "url": "https://api.hailer.com/api/v3/activity/create",
238
+ "headers": { "Content-Type": "application/json", "hlrkey": "{{2__results}}" },
239
+ "data": "{{3__payload}}"
240
+ },
241
+ "paused": false, "authentication_id": null,
242
+ "meta": { "$editor": { "has_automatic_issues": false }, "parammap": {} },
243
+ "triple_stores": { "copied_from": null, "created_by": null, "polling_interval_override": 0, "block_and_release_limit_override": 0, "spread_tasks": 1 }
244
+ }
245
+ }
246
+ }]
247
+ }
248
+ ```
249
+
250
+ **See also:** `sdk-projects/pohjaset/automations/` for real-world examples with annotations
251
+
252
+ ---
253
+
254
+ ## Zapier Built-in Tools Reference
255
+
256
+ These are Zapier's native apps - no external service needed. Essential for Hailer integrations.
257
+
258
+ ### Webhooks by Zapier
259
+ **API:** `WebHookCLIAPI@1.0.29`
260
+
261
+ | Trigger/Action | Purpose | Key Params |
262
+ |----------------|---------|------------|
263
+ | **Catch Hook** (trigger) | Receive webhook from Hailer phase | `action: "hook_raw"` |
264
+ | **Catch Raw Hook** (trigger) | Same, preserves raw body | `action: "hook_raw"` |
265
+ | **Custom Request** (action) | Any HTTP request | `action: "custom"`, `method`, `url`, `headers`, `data` |
266
+ | **POST** (action) | Simple POST | `action: "post"`, `url`, `data` |
267
+ | **GET** (action) | Simple GET | `action: "get"`, `url` |
268
+ | **PUT** (action) | Simple PUT | `action: "put"`, `url`, `data` |
269
+
270
+ **Custom Request params:**
271
+ ```json
272
+ {
273
+ "method": "POST",
274
+ "url": "https://api.hailer.com/api/v3/activity/create",
275
+ "headers": { "Content-Type": "application/json", "hlrkey": "{{2__results}}" },
276
+ "data": "{{3__payload}}",
277
+ "unflatten": "yes",
278
+ "return_raw_response": "yes"
279
+ }
280
+ ```
281
+
282
+ ### Code by Zapier
283
+ **API:** `CodeCLIAPI@1.0.1`
284
+
285
+ | Action | Purpose | Key Params |
286
+ |--------|---------|------------|
287
+ | **Run JavaScript** | Transform data, build payloads | `action: "01929fad-d3dd-62c2-52ed-7868d5fcc691"` |
288
+ | **Run Python** | Same, Python syntax | Different action UUID |
289
+
290
+ **JavaScript params:**
291
+ ```json
292
+ {
293
+ "code": "const data = JSON.parse(inputData.rawBody);\\nreturn { result: data.field };",
294
+ "input": { "rawBody": "{{1__raw_body}}", "sessionKey": "{{2__results}}" }
295
+ }
296
+ ```
297
+
298
+ **Code tips:**
299
+ - Access inputs via `inputData.variableName`
300
+ - Return object with named outputs: `return { payload, email, id };`
301
+ - Can use `fetch` for additional API calls (async supported)
302
+ - Output fields available as `{{node__fieldname}}`
303
+
304
+ ### Filter by Zapier
305
+ **API:** `FilterAPI` (legacy, still works)
306
+
307
+ Conditionally continue or stop the Zap. Note: `type_of` is `"filter"` (not "write").
308
+
309
+ | Action | Purpose |
310
+ |--------|---------|
311
+ | `filter` | Only continue if conditions match |
312
+
313
+ **Params:**
314
+ ```json
315
+ {
316
+ "selected_api": "FilterAPI",
317
+ "action": "filter",
318
+ "type_of": "filter",
319
+ "params": {
320
+ "filter_criteria": [
321
+ {
322
+ "id": 4699009700892223,
323
+ "group": 4153161264351725,
324
+ "key": "{{1__status}}",
325
+ "value": "approved",
326
+ "match": "icontains",
327
+ "action": "continue"
328
+ }
329
+ ]
330
+ }
331
+ }
332
+ ```
333
+
334
+ **Match types:** `icontains`, `inot_contains`, `iexact`, `inot_exact`, `is_set`, `not_set`, `greater_than`, `less_than`
335
+
336
+ ### Paths by Zapier
337
+ **API:** `BranchingAPI` (419 uses found)
338
+
339
+ Conditional branching - different actions based on conditions. Note: Uses `BranchingAPI` not `PathsCLIAPI`.
340
+
341
+ ```json
342
+ {
343
+ "selected_api": "BranchingAPI",
344
+ "action": "branch",
345
+ "type_of": "branching",
346
+ "params": {
347
+ "branches": [
348
+ {
349
+ "name": "Path A - Approved",
350
+ "filter_criteria": [
351
+ { "key": "{{1__status}}", "value": "approved", "match": "iexact" }
352
+ ]
353
+ },
354
+ {
355
+ "name": "Path B - Rejected",
356
+ "filter_criteria": [
357
+ { "key": "{{1__status}}", "value": "rejected", "match": "iexact" }
358
+ ]
359
+ }
360
+ ]
361
+ }
362
+ }
363
+ ```
364
+
365
+ ### Formatter by Zapier
366
+ **API:** `ZapierFormatterCLIAPI@1.0.7`
367
+
368
+ Transform text, dates, numbers without code.
369
+
370
+ | Action | Purpose |
371
+ |--------|---------|
372
+ | `datetime_line_item` | Format dates |
373
+ | `text_line_item` | Manipulate strings |
374
+ | `util_line_item` | Utilities (lookup, pick) |
375
+
376
+ **Date format (useful for Hailer timestamps):**
377
+ ```json
378
+ {
379
+ "selected_api": "ZapierFormatterCLIAPI@1.0.7",
380
+ "action": "datetime_line_item",
381
+ "type_of": "write",
382
+ "params": {
383
+ "transform": "date.formatting",
384
+ "to_timezone": "UTC",
385
+ "from_timezone": "UTC",
386
+ "inputs": "{{1__timestamp}}",
387
+ "to_format": "YYYY-MM-DD"
388
+ }
389
+ }
390
+ ```
391
+
392
+ **Text transform:**
393
+ ```json
394
+ {
395
+ "selected_api": "ZapierFormatterCLIAPI@1.0.7",
396
+ "action": "text_line_item",
397
+ "type_of": "write",
398
+ "params": {
399
+ "transform": "text.replace",
400
+ "inputs": "{{1__email}}",
401
+ "find": "@old-domain.com",
402
+ "replace": "@new-domain.com"
403
+ }
404
+ }
405
+ ```
406
+ Note: Hailer uses milliseconds, Zapier's `X` is seconds - divide by 1000 in Code step or use date formatting.
407
+
408
+ ### Delay by Zapier
409
+ **API:** `DelayCLIAPI@1.1.1`
410
+
411
+ Pause execution.
412
+
413
+ | Action | Purpose |
414
+ |--------|---------|
415
+ | `delay_for` | Wait specific duration |
416
+
417
+ ```json
418
+ {
419
+ "selected_api": "DelayCLIAPI@1.1.1",
420
+ "action": "delay_for",
421
+ "type_of": "write",
422
+ "params": {
423
+ "delay_for_value": "5",
424
+ "delay_for_unit": "minutes"
425
+ }
426
+ }
427
+ ```
428
+
429
+ ### Looping by Zapier
430
+ **API:** `ZapierLoopingCLIAPI@1.2.6`
431
+
432
+ Iterate over arrays (e.g., process multiple activities).
433
+
434
+ | Action | Purpose |
435
+ |--------|---------|
436
+ | `loop_values_line_items` | Loop over line items (objects) |
437
+ | `loop_values_numbers` | Loop over number range |
438
+ | `loop_values_text` | Loop over text items |
439
+
440
+ ```json
441
+ {
442
+ "selected_api": "ZapierLoopingCLIAPI@1.2.6",
443
+ "action": "loop_values_line_items",
444
+ "type_of": "write",
445
+ "params": {
446
+ "trim_whitespace": "True",
447
+ "iteration_start": "1",
448
+ "iteration_limit": "500",
449
+ "loop_values": {
450
+ "activityId": "{{1__activities[]_id}}",
451
+ "name": "{{1__activities[]name}}",
452
+ "status": "{{1__activities[]currentPhase}}"
453
+ }
454
+ }
455
+ }
456
+ ```
457
+
458
+ Access loop outputs: `{{node__activityId}}`, `{{node__name}}`, etc.
459
+
460
+ ### Sub-Zap by Zapier
461
+ **API:** `SubZapCLIAPI@0.11.2`
462
+
463
+ Call another Zap as a subroutine.
464
+
465
+ | Action | Purpose |
466
+ |--------|---------|
467
+ | `start_subzap` | Trigger (receives call from parent) |
468
+ | `call_subzap` | Call another Zap, wait for response |
469
+ | `return_subzap` | Return data to caller |
470
+
471
+ **Trigger (in sub-zap):**
472
+ ```json
473
+ {
474
+ "selected_api": "SubZapCLIAPI@0.11.2",
475
+ "action": "start_subzap",
476
+ "type_of": "read",
477
+ "params": {
478
+ "input_list": ["activityId", "sessionKey", "workflowId"]
479
+ }
480
+ }
481
+ ```
482
+
483
+ **Call (from parent zap):**
484
+ ```json
485
+ {
486
+ "selected_api": "SubZapCLIAPI@0.11.2",
487
+ "action": "call_subzap",
488
+ "type_of": "write",
489
+ "params": {
490
+ "account_id": "5024683",
491
+ "zap_id": "202514585",
492
+ "activityId": "{{1__activityId}}",
493
+ "sessionKey": "{{2__results}}",
494
+ "workflowId": "{{3__workflowId}}"
495
+ }
496
+ }
497
+ ```
498
+
499
+ Useful for reusable logic (e.g., "Login to Hailer" sub-zap).
500
+
501
+ ### Storage by Zapier
502
+ **API:** `StorageCLIAPI@1.2.1`
503
+
504
+ Store and retrieve values across Zap runs.
505
+
506
+ | Action | Purpose |
507
+ |--------|---------|
508
+ | `get_multiple_values` | Retrieve stored values |
509
+ | `list_push` | Add to list |
510
+ | `set_value` | Store key-value pair |
511
+
512
+ **Get values:**
513
+ ```json
514
+ {
515
+ "selected_api": "StorageCLIAPI@1.2.1",
516
+ "action": "get_multiple_values",
517
+ "type_of": "search",
518
+ "params": {
519
+ "_zap_search_success_on_miss": true,
520
+ "keys": ["{{1__activityId}}", "lastSyncTimestamp"]
521
+ }
522
+ }
523
+ ```
524
+
525
+ **Push to list:**
526
+ ```json
527
+ {
528
+ "selected_api": "StorageCLIAPI@1.2.1",
529
+ "action": "list_push",
530
+ "type_of": "write",
531
+ "params": {
532
+ "key": "processedIds",
533
+ "value": "{{1__activityId}}",
534
+ "location": "tail"
535
+ }
536
+ }
537
+ ```
538
+
539
+ Useful for: tracking last sync timestamp, deduplication, counters.
540
+
541
+ ---
542
+
543
+ ## Common Tool Combinations for Hailer
544
+
545
+ | Pattern | Tools Used |
546
+ |---------|------------|
547
+ | **Webhook → Create Activity** | Catch Hook → Code → Custom Request |
548
+ | **Conditional Processing** | Catch Hook → Filter → Code → Custom Request |
549
+ | **Branching Logic** | Catch Hook → Paths → (different actions per path) |
550
+ | **Batch Processing** | Catch Hook → Looping → Custom Request |
551
+ | **Scheduled Sync** | Schedule trigger → Custom Request (list) → Looping → Custom Request (update) |
552
+ | **Date Formatting** | Catch Hook → Formatter (date) → Code → Custom Request |
553
+ | **Reusable Auth** | Sub-Zap for login → Return session key |
554
+
555
+ ---
556
+
557
+ ## Workflow for Building Zaps
558
+
559
+ 1. **Query NotebookLM** for API patterns and field formats
560
+ 2. **Get workspace IDs** using Kenji agent (workflow, phase, field, team IDs)
561
+ 3. **Design the zap flow**: Trigger → (optional code step) → API action
562
+ 4. **Create annotated documentation** for future reference
563
+ 5. **Store zap JSON** in project's `automations/` folder
564
+
565
+ ## Common Zap Patterns
566
+
567
+ ### Hailer Webhook → Hailer Action
568
+ 1. Catch Hook (webhook from Hailer phase)
569
+ 2. Login to get session key
570
+ 3. Code step to build payload
571
+ 4. Custom Request to Hailer API
572
+
573
+ ### External Trigger → Hailer
574
+ 1. Trigger from external app (Gmail, Slack, etc.)
575
+ 2. Login to Hailer
576
+ 3. Create/Update activity via API
577
+
578
+ ### Hailer → External Action
579
+ 1. Catch Hook from Hailer
580
+ 2. Transform data if needed
581
+ 3. Send to external API (Slack, Email, etc.)
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: Creates skills and updates agents based on failure patterns
3
+ mode: subagent
4
+ model: anthropic/claude-sonnet-4-5
5
+ tools:
6
+ read: true
7
+ glob: true
8
+ write: true
9
+ edit: true
10
+ ---
11
+
12
+ I am Ada. Every failure is a lesson waiting to be documented. Output JSON. Full stop.
13
+
14
+ ## Handles
15
+ - Detect agent failure patterns
16
+ - Create skills in .claude/skills/
17
+ - Update agent definitions with skill references
18
+ - Document niche workflows
19
+
20
+ ## Rules
21
+ 1. **NEVER FABRICATE** - Must call tools.
22
+ 2. **Keep agents LEAN** - Add skill references, not documentation.
23
+ 3. **Minimal skills** - Focus on specific issue.
24
+ 4. **Preserve personality** - Never change agent character.
25
+ 5. **JSON ONLY** - Output closing brace, then STOP.
26
+
27
+ ## Skill Location
28
+ .claude/skills/[skill-name]/SKILL.md
29
+
30
+ ## Agent Update
31
+ Add ONE LINE to agent's skills section:
32
+ Load `skill-name` for [pattern description].
33
+
34
+ ## Protocol
35
+ Output: { "status": "success|error", "result": { "skill_path": "", "agent_updated": "", "pattern": "" }, "summary": "" }
@@ -0,0 +1,39 @@
1
+ ---
2
+ description: Creates calculated function fields in Hailer workflows
3
+ mode: subagent
4
+ model: anthropic/claude-sonnet-4-5
5
+ tools:
6
+ read: true
7
+ glob: true
8
+ write: true
9
+ edit: true
10
+ bash: true
11
+ ---
12
+
13
+ I am Alejandro, master of calculated fields. Every formula must be elegant, tested, and version controlled. SDK v0.8.4.
14
+
15
+ ## Handles
16
+ - Create calculated function fields (arithmetic, conditionals, dates)
17
+ - Edit existing function field formulas
18
+ - Field dependency mapping with functionVariables (=, >, <, ?)
19
+ - Testing functions locally before deployment
20
+
21
+ **DOES NOT HANDLE:** nameField, nameFunction - That's NORA's domain.
22
+
23
+ ## Rules
24
+ 1. **NEVER FABRICATE** - Must call tools.
25
+ 2. **CRITICAL: Pull OVERWRITES local changes** - Push before pulling.
26
+ 3. **Add to fields.ts** - Use "function" and "functionVariables".
27
+ 4. **NEVER run fields-push** - Return command for orchestrator.
28
+ 5. **Use enums from enums.ts** - Never hardcode field IDs.
29
+ 6. **Vanilla JS only** - No TypeScript syntax in function body.
30
+ 7. **NEVER return null/undefined** - Always return valid value.
31
+ 8. **JSON ONLY** - Output closing brace, then STOP.
32
+
33
+ ## Variable Types
34
+ - "=" - Current activity field → data: [FieldId]
35
+ - ">" - Forward link → data: [LinkFieldId, TargetFieldId]
36
+ - "<" - Backlink → data: [WorkflowId, TargetFieldId] (returns ARRAY)
37
+
38
+ ## Protocol
39
+ Output: { "status": "success|error|ready_to_push", "result": { "function_created": true, "variables": 0 }, "commands": [], "summary": "" }
@@ -0,0 +1,36 @@
1
+ ---
2
+ description: Audits SDK codebase configuration - docs, agents, hooks, settings
3
+ mode: subagent
4
+ model: anthropic/claude-haiku-4-5
5
+ tools:
6
+ read: true
7
+ glob: true
8
+ bash: true
9
+ write: false
10
+ edit: false
11
+ ---
12
+
13
+ I am Bjorn, the Watchman. Trust nothing. Verify everything. SDK v0.8.4. Output JSON. Full stop.
14
+
15
+ ## Handles
16
+ - docs/CLAUDE.md audit (agent table vs actual agents)
17
+ - Agent definition validation (frontmatter, XML tags, tools)
18
+ - Hook configuration verification (settings.json vs hook files)
19
+ - Cross-reference integrity (skills, commands)
20
+ - Workspace structure validation
21
+ - Documentation alignment
22
+
23
+ ## Rules
24
+ 1. **NEVER FABRICATE** - Must call tools.
25
+ 2. **Read files before claims** - Verify everything.
26
+ 3. **Enable edit mode first**: node .claude/hooks/src-edit-guard.cjs --on
27
+ 4. **Disable after**: node .claude/hooks/src-edit-guard.cjs --off
28
+ 5. **JSON ONLY** - Output closing brace, then STOP.
29
+
30
+ ## Severity
31
+ - CRITICAL: Will cause failures
32
+ - WARNING: Should fix
33
+ - INFO: Recommendations
34
+
35
+ ## Protocol
36
+ Output: { "status": "success|error", "result": { "agents_found": 0, "agents_documented": 0, "issues": [] }, "summary": "" }