@hailer/mcp 1.1.11 → 1.1.13

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 (252) hide show
  1. package/dist/app.js +18 -5
  2. package/dist/bot/bot-config.d.ts +12 -1
  3. package/dist/bot/bot-config.js +98 -14
  4. package/dist/bot/bot-manager.d.ts +13 -3
  5. package/dist/bot/bot-manager.js +80 -25
  6. package/dist/bot/bot.d.ts +46 -0
  7. package/dist/bot/bot.js +542 -166
  8. package/dist/bot/services/message-classifier.js +17 -0
  9. package/dist/bot/services/permission-guard.d.ts +52 -0
  10. package/dist/bot/services/permission-guard.js +149 -0
  11. package/dist/bot/services/types.d.ts +5 -0
  12. package/dist/bot/services/typing-indicator.d.ts +6 -1
  13. package/dist/bot/services/typing-indicator.js +19 -3
  14. package/dist/config.d.ts +6 -1
  15. package/dist/config.js +43 -0
  16. package/dist/core.js +3 -6
  17. package/dist/mcp/UserContextCache.d.ts +5 -0
  18. package/dist/mcp/UserContextCache.js +51 -19
  19. package/dist/mcp/hailer-clients.d.ts +19 -1
  20. package/dist/mcp/hailer-clients.js +157 -20
  21. package/dist/mcp/session-store.d.ts +68 -0
  22. package/dist/mcp/session-store.js +169 -0
  23. package/dist/mcp/signal-handler.js +12 -12
  24. package/dist/mcp/tool-registry.d.ts +17 -4
  25. package/dist/mcp/tool-registry.js +37 -7
  26. package/dist/mcp/tools/activity.js +99 -7
  27. package/dist/mcp/tools/app-scaffold.js +304 -336
  28. package/dist/mcp/tools/company.d.ts +9 -0
  29. package/dist/mcp/tools/company.js +88 -0
  30. package/dist/mcp/tools/discussion.js +68 -0
  31. package/dist/mcp/tools/workflow-permissions.d.ts +15 -0
  32. package/dist/mcp/tools/workflow-permissions.js +204 -0
  33. package/dist/mcp/tools/workflow.js +57 -18
  34. package/dist/mcp/utils/index.d.ts +2 -0
  35. package/dist/mcp/utils/index.js +12 -1
  36. package/dist/mcp/utils/role-utils.d.ts +74 -0
  37. package/dist/mcp/utils/role-utils.js +151 -0
  38. package/dist/mcp/utils/types.d.ts +43 -1
  39. package/dist/mcp/utils/types.js +14 -0
  40. package/dist/mcp/webhook-handler.d.ts +6 -0
  41. package/dist/mcp/webhook-handler.js +11 -0
  42. package/dist/mcp-server.d.ts +23 -2
  43. package/dist/mcp-server.js +639 -111
  44. package/dist/plugins/vipunen/client.d.ts +150 -0
  45. package/dist/plugins/vipunen/client.js +535 -0
  46. package/dist/plugins/vipunen/config/schema-config.json +19 -0
  47. package/dist/plugins/vipunen/config/schema-doc.json +22 -0
  48. package/dist/plugins/vipunen/index.d.ts +41 -0
  49. package/dist/plugins/vipunen/index.js +88 -0
  50. package/dist/plugins/vipunen/tools.d.ts +26 -0
  51. package/dist/plugins/vipunen/tools.js +501 -0
  52. package/package.json +2 -1
  53. package/.claude/.context-watchdog.json +0 -1
  54. package/.claude/.session-checked +0 -1
  55. package/.claude/CLAUDE.md +0 -370
  56. package/.claude/agents/agent-ada-skill-builder.md +0 -94
  57. package/.claude/agents/agent-alejandro-function-fields.md +0 -342
  58. package/.claude/agents/agent-bjorn-config-audit.md +0 -103
  59. package/.claude/agents/agent-builder-agent-creator.md +0 -130
  60. package/.claude/agents/agent-code-simplifier.md +0 -53
  61. package/.claude/agents/agent-dmitri-activity-crud.md +0 -159
  62. package/.claude/agents/agent-giuseppe-app-builder.md +0 -247
  63. package/.claude/agents/agent-gunther-mcp-tools.md +0 -39
  64. package/.claude/agents/agent-helga-workflow-config.md +0 -204
  65. package/.claude/agents/agent-igor-activity-mover-automation.md +0 -125
  66. package/.claude/agents/agent-ingrid-doc-templates.md +0 -261
  67. package/.claude/agents/agent-ivan-monolith.md +0 -154
  68. package/.claude/agents/agent-kenji-data-reader.md +0 -86
  69. package/.claude/agents/agent-lars-code-inspector.md +0 -102
  70. package/.claude/agents/agent-marco-mockup-builder.md +0 -110
  71. package/.claude/agents/agent-marcus-api-documenter.md +0 -323
  72. package/.claude/agents/agent-marketplace-publisher.md +0 -280
  73. package/.claude/agents/agent-marketplace-reviewer.md +0 -309
  74. package/.claude/agents/agent-permissions-handler.md +0 -208
  75. package/.claude/agents/agent-simple-writer.md +0 -48
  76. package/.claude/agents/agent-svetlana-code-review.md +0 -171
  77. package/.claude/agents/agent-tanya-test-runner.md +0 -333
  78. package/.claude/agents/agent-ui-designer.md +0 -100
  79. package/.claude/agents/agent-viktor-sql-insights.md +0 -212
  80. package/.claude/agents/agent-web-search.md +0 -55
  81. package/.claude/agents/agent-yevgeni-discussions.md +0 -45
  82. package/.claude/agents/agent-zara-zapier.md +0 -159
  83. package/.claude/commands/app-squad.md +0 -135
  84. package/.claude/commands/audit-squad.md +0 -158
  85. package/.claude/commands/autoplan.md +0 -563
  86. package/.claude/commands/cleanup-squad.md +0 -98
  87. package/.claude/commands/config-squad.md +0 -106
  88. package/.claude/commands/crud-squad.md +0 -87
  89. package/.claude/commands/data-squad.md +0 -97
  90. package/.claude/commands/debug-squad.md +0 -303
  91. package/.claude/commands/doc-squad.md +0 -65
  92. package/.claude/commands/handoff.md +0 -137
  93. package/.claude/commands/health.md +0 -49
  94. package/.claude/commands/help.md +0 -29
  95. package/.claude/commands/help:agents.md +0 -151
  96. package/.claude/commands/help:commands.md +0 -78
  97. package/.claude/commands/help:faq.md +0 -79
  98. package/.claude/commands/help:plugins.md +0 -50
  99. package/.claude/commands/help:skills.md +0 -93
  100. package/.claude/commands/help:tools.md +0 -75
  101. package/.claude/commands/hotfix-squad.md +0 -112
  102. package/.claude/commands/integration-squad.md +0 -82
  103. package/.claude/commands/janitor-squad.md +0 -167
  104. package/.claude/commands/learn-auto.md +0 -120
  105. package/.claude/commands/learn.md +0 -120
  106. package/.claude/commands/mcp-list.md +0 -27
  107. package/.claude/commands/onboard-squad.md +0 -140
  108. package/.claude/commands/plan-workspace.md +0 -732
  109. package/.claude/commands/prd.md +0 -130
  110. package/.claude/commands/project-status.md +0 -82
  111. package/.claude/commands/publish.md +0 -138
  112. package/.claude/commands/recap.md +0 -69
  113. package/.claude/commands/restore.md +0 -64
  114. package/.claude/commands/review-squad.md +0 -152
  115. package/.claude/commands/save.md +0 -24
  116. package/.claude/commands/stats.md +0 -19
  117. package/.claude/commands/swarm.md +0 -210
  118. package/.claude/commands/tool-builder.md +0 -39
  119. package/.claude/commands/ws-pull.md +0 -44
  120. package/.claude/hooks/_shared-memory.cjs +0 -305
  121. package/.claude/hooks/_utils.cjs +0 -108
  122. package/.claude/hooks/agent-failure-detector.cjs +0 -383
  123. package/.claude/hooks/agent-usage-logger.cjs +0 -204
  124. package/.claude/hooks/app-edit-guard.cjs +0 -494
  125. package/.claude/hooks/auto-learn.cjs +0 -304
  126. package/.claude/hooks/bash-guard.cjs +0 -272
  127. package/.claude/hooks/builder-mode-manager.cjs +0 -354
  128. package/.claude/hooks/bulk-activity-guard.cjs +0 -271
  129. package/.claude/hooks/context-watchdog.cjs +0 -230
  130. package/.claude/hooks/delegation-reminder.cjs +0 -465
  131. package/.claude/hooks/design-system-lint.cjs +0 -271
  132. package/.claude/hooks/post-scaffold-hook.cjs +0 -181
  133. package/.claude/hooks/prompt-guard.cjs +0 -354
  134. package/.claude/hooks/publish-template-guard.cjs +0 -147
  135. package/.claude/hooks/session-start.cjs +0 -35
  136. package/.claude/hooks/shared-memory-writer.cjs +0 -147
  137. package/.claude/hooks/skill-injector.cjs +0 -140
  138. package/.claude/hooks/skill-usage-logger.cjs +0 -258
  139. package/.claude/hooks/src-edit-guard.cjs +0 -240
  140. package/.claude/hooks/sync-marketplace-agents.cjs +0 -346
  141. package/.claude/settings.json +0 -257
  142. package/.claude/skills/SDK-activity-patterns/SKILL.md +0 -428
  143. package/.claude/skills/SDK-document-templates/SKILL.md +0 -1033
  144. package/.claude/skills/SDK-function-fields/SKILL.md +0 -542
  145. package/.claude/skills/SDK-generate-skill/SKILL.md +0 -92
  146. package/.claude/skills/SDK-init-skill/SKILL.md +0 -127
  147. package/.claude/skills/SDK-insight-queries/SKILL.md +0 -787
  148. package/.claude/skills/SDK-ws-config-skill/SKILL.md +0 -1139
  149. package/.claude/skills/agent-structure/SKILL.md +0 -98
  150. package/.claude/skills/api-documentation-patterns/SKILL.md +0 -474
  151. package/.claude/skills/chrome-mcp-reference/SKILL.md +0 -370
  152. package/.claude/skills/delegation-routing/SKILL.md +0 -202
  153. package/.claude/skills/frontend-design/SKILL.md +0 -254
  154. package/.claude/skills/hailer-activity-mover/SKILL.md +0 -213
  155. package/.claude/skills/hailer-api-client/SKILL.md +0 -518
  156. package/.claude/skills/hailer-app-builder/SKILL.md +0 -1434
  157. package/.claude/skills/hailer-apps-pictures/SKILL.md +0 -269
  158. package/.claude/skills/hailer-design-system/SKILL.md +0 -235
  159. package/.claude/skills/hailer-monolith-automations/SKILL.md +0 -686
  160. package/.claude/skills/hailer-permissions-system/SKILL.md +0 -121
  161. package/.claude/skills/hailer-project-protocol/SKILL.md +0 -488
  162. package/.claude/skills/hailer-rest-api/SKILL.md +0 -61
  163. package/.claude/skills/hailer-rest-api/hailer-activities.md +0 -184
  164. package/.claude/skills/hailer-rest-api/hailer-admin.md +0 -473
  165. package/.claude/skills/hailer-rest-api/hailer-calendar.md +0 -256
  166. package/.claude/skills/hailer-rest-api/hailer-feed.md +0 -249
  167. package/.claude/skills/hailer-rest-api/hailer-insights.md +0 -195
  168. package/.claude/skills/hailer-rest-api/hailer-messaging.md +0 -276
  169. package/.claude/skills/hailer-rest-api/hailer-workflows.md +0 -283
  170. package/.claude/skills/insight-join-patterns/SKILL.md +0 -174
  171. package/.claude/skills/integration-patterns/SKILL.md +0 -421
  172. package/.claude/skills/json-only-output/SKILL.md +0 -72
  173. package/.claude/skills/lsp-setup/SKILL.md +0 -160
  174. package/.claude/skills/mcp-direct-tools/SKILL.md +0 -153
  175. package/.claude/skills/optional-parameters/SKILL.md +0 -72
  176. package/.claude/skills/publish-hailer-app/SKILL.md +0 -244
  177. package/.claude/skills/testing-patterns/SKILL.md +0 -630
  178. package/.claude/skills/tool-builder/SKILL.md +0 -250
  179. package/.claude/skills/tool-parameter-usage/SKILL.md +0 -126
  180. package/.claude/skills/tool-response-verification/SKILL.md +0 -92
  181. package/.claude/skills/zapier-hailer-patterns/SKILL.md +0 -581
  182. package/.hailer-mcp-port +0 -1
  183. package/.mcp.json +0 -13
  184. package/.opencode/agent/agent-ada-skill-builder.md +0 -35
  185. package/.opencode/agent/agent-alejandro-function-fields.md +0 -39
  186. package/.opencode/agent/agent-bjorn-config-audit.md +0 -36
  187. package/.opencode/agent/agent-builder-agent-creator.md +0 -39
  188. package/.opencode/agent/agent-code-simplifier.md +0 -31
  189. package/.opencode/agent/agent-dmitri-activity-crud.md +0 -40
  190. package/.opencode/agent/agent-giuseppe-app-builder.md +0 -37
  191. package/.opencode/agent/agent-gunther-mcp-tools.md +0 -39
  192. package/.opencode/agent/agent-helga-workflow-config.md +0 -204
  193. package/.opencode/agent/agent-igor-activity-mover-automation.md +0 -46
  194. package/.opencode/agent/agent-ingrid-doc-templates.md +0 -39
  195. package/.opencode/agent/agent-ivan-monolith.md +0 -46
  196. package/.opencode/agent/agent-kenji-data-reader.md +0 -53
  197. package/.opencode/agent/agent-lars-code-inspector.md +0 -28
  198. package/.opencode/agent/agent-marco-mockup-builder.md +0 -42
  199. package/.opencode/agent/agent-marcus-api-documenter.md +0 -53
  200. package/.opencode/agent/agent-marketplace-publisher.md +0 -44
  201. package/.opencode/agent/agent-marketplace-reviewer.md +0 -42
  202. package/.opencode/agent/agent-permissions-handler.md +0 -50
  203. package/.opencode/agent/agent-simple-writer.md +0 -45
  204. package/.opencode/agent/agent-svetlana-code-review.md +0 -39
  205. package/.opencode/agent/agent-tanya-test-runner.md +0 -57
  206. package/.opencode/agent/agent-ui-designer.md +0 -56
  207. package/.opencode/agent/agent-viktor-sql-insights.md +0 -34
  208. package/.opencode/agent/agent-web-search.md +0 -42
  209. package/.opencode/agent/agent-yevgeni-discussions.md +0 -37
  210. package/.opencode/agent/agent-zara-zapier.md +0 -53
  211. package/.opencode/commands/app-squad.md +0 -135
  212. package/.opencode/commands/audit-squad.md +0 -158
  213. package/.opencode/commands/autoplan.md +0 -563
  214. package/.opencode/commands/cleanup-squad.md +0 -98
  215. package/.opencode/commands/config-squad.md +0 -106
  216. package/.opencode/commands/crud-squad.md +0 -87
  217. package/.opencode/commands/data-squad.md +0 -97
  218. package/.opencode/commands/debug-squad.md +0 -303
  219. package/.opencode/commands/doc-squad.md +0 -65
  220. package/.opencode/commands/handoff.md +0 -137
  221. package/.opencode/commands/health.md +0 -49
  222. package/.opencode/commands/help-agents.md +0 -151
  223. package/.opencode/commands/help-commands.md +0 -32
  224. package/.opencode/commands/help-faq.md +0 -29
  225. package/.opencode/commands/help-plugins.md +0 -28
  226. package/.opencode/commands/help-skills.md +0 -7
  227. package/.opencode/commands/help-tools.md +0 -40
  228. package/.opencode/commands/help.md +0 -28
  229. package/.opencode/commands/hotfix-squad.md +0 -112
  230. package/.opencode/commands/integration-squad.md +0 -82
  231. package/.opencode/commands/janitor-squad.md +0 -167
  232. package/.opencode/commands/learn-auto.md +0 -120
  233. package/.opencode/commands/learn.md +0 -120
  234. package/.opencode/commands/mcp-list.md +0 -27
  235. package/.opencode/commands/onboard-squad.md +0 -140
  236. package/.opencode/commands/plan-workspace.md +0 -732
  237. package/.opencode/commands/prd.md +0 -131
  238. package/.opencode/commands/project-status.md +0 -82
  239. package/.opencode/commands/publish.md +0 -138
  240. package/.opencode/commands/recap.md +0 -69
  241. package/.opencode/commands/restore.md +0 -64
  242. package/.opencode/commands/review-squad.md +0 -152
  243. package/.opencode/commands/save.md +0 -24
  244. package/.opencode/commands/stats.md +0 -19
  245. package/.opencode/commands/swarm.md +0 -210
  246. package/.opencode/commands/tool-builder.md +0 -39
  247. package/.opencode/commands/ws-pull.md +0 -44
  248. package/.opencode/opencode.json +0 -21
  249. package/inbox/failures.log +0 -1
  250. package/inbox/usage.jsonl +0 -4
  251. package/scripts/postinstall.cjs +0 -64
  252. package/scripts/test-hal-tools.ts +0 -154
@@ -1,106 +0,0 @@
1
- ---
2
- description: Set up workflow config with Helga, Alejandro, and Viktor
3
- argument-hint: "workflow/config description"
4
- allowed-tools: Task, Bash, Read
5
- ---
6
- # Config Squad
7
-
8
- Sequential pipeline: Create workflow infrastructure, then calculated fields, then insights.
9
-
10
- **Agents:**
11
- 1. **Helga** - Workflow config (fields, phases, teams, groups)
12
- 2. **Alejandro** - Function fields and nameFunction
13
- 3. **Viktor** - SQL insights for reporting
14
-
15
- **Goal:** $ARGUMENTS
16
-
17
- ## Protocol
18
-
19
- ### Step 1: Understand Scope
20
-
21
- Parse `$ARGUMENTS` to determine what's needed:
22
-
23
- | Keyword | Agents to Use |
24
- |---------|---------------|
25
- | "workflow", "fields", "phases" | Helga (+ Alejandro if function fields mentioned) |
26
- | "insight", "report", "dashboard" | Viktor (may need Kenji first for schema) |
27
- | "function", "calculated", "nameFunction" | Alejandro only |
28
- | General description | All three in sequence |
29
-
30
- If scope is unclear, use AskUserQuestion:
31
- - What workflow(s) does this involve?
32
- - Do you need calculated fields?
33
- - Do you need reports/insights?
34
-
35
- If `$ARGUMENTS` contains `--skip-insights`: skip Viktor.
36
- If `$ARGUMENTS` contains `--skip-functions`: skip Alejandro.
37
-
38
- ### Step 2: Helga (Workflow Config)
39
-
40
- Spawn Helga:
41
-
42
- ```
43
- Task(subagent_type="agent-helga-workflow-config", prompt="$ARGUMENTS")
44
- ```
45
-
46
- Wait for result. If Helga returns `"status": "ready_to_push"`:
47
- - Run the push commands she provides (e.g., `npm run fields-push:force`)
48
- - Then run `npm run pull` to refresh local workspace with new IDs
49
-
50
- **Important:** Helga ALWAYS spawns Alejandro for nameFunction after creating a workflow. Check Helga's result - if she reports Alejandro created the nameFunction and all needed function fields, skip Step 3. Only proceed to Step 3 if additional function fields are needed beyond what Helga+Alejandro already created.
51
-
52
- ### Step 3: Alejandro (Function Fields)
53
-
54
- Only if function fields or nameFunction are needed and weren't handled by Helga.
55
-
56
- Spawn Alejandro:
57
-
58
- ```
59
- Task(subagent_type="agent-alejandro-function-fields", prompt="Create function fields for: $ARGUMENTS. Helga created these workflows: [SUMMARIZE HELGA'S RESULT - workflow names and any IDs she returned]. Read workspace/ to discover field IDs and types. New fields created by Helga: [LIST FROM HELGA'S RESULT IF ANY].")
60
- ```
61
-
62
- Wait for result. If `"status": "ready_to_push"`:
63
- - Run the push commands
64
-
65
- ### Step 4: Viktor (Insights)
66
-
67
- Only if reporting/insights are needed.
68
-
69
- Spawn Viktor:
70
-
71
- ```
72
- Task(subagent_type="agent-viktor-sql-insights", prompt="Create insights for: $ARGUMENTS. Read workspace/ to discover workflow IDs and field IDs for SQL queries. Helga created: [SUMMARIZE HELGA'S RESULT].")
73
- ```
74
-
75
- Wait for result. If `"status": "ready_to_push"`:
76
- - Run the push commands (e.g., `npm run insights-push:force`)
77
-
78
- ### Step 5: Report
79
-
80
- ```markdown
81
- ## Config Squad Complete
82
-
83
- ### Helga (Workflow Config)
84
- - Workflows: [created/modified]
85
- - Fields: [count]
86
- - Phases: [count]
87
- - Commands run: [list]
88
-
89
- ### Alejandro (Function Fields)
90
- - Function fields: [list with formulas]
91
- - Name function: [pattern]
92
- - Skipped: [reason if skipped]
93
-
94
- ### Viktor (Insights)
95
- - Insights: [list with descriptions]
96
- - Skipped: [reason if skipped]
97
-
98
- ### Workspace State
99
- Run `npm run pull` to ensure workspace/ is up to date.
100
- ```
101
-
102
- ## Notes
103
-
104
- - Each agent in the pipeline needs IDs from the previous step. Always `npm run pull` between steps.
105
- - Helga auto-spawns Alejandro for nameFunction - check her output before spawning Alejandro again.
106
- - Viktor needs real field IDs for SQL queries - never let him guess.
@@ -1,87 +0,0 @@
1
- ---
2
- description: Create, update, or manage activities with Kenji and Dmitri
3
- argument-hint: "what to create/update and in which workflow"
4
- allowed-tools: Task, Bash, Read
5
- ---
6
- # CRUD Squad
7
-
8
- Sequential pipeline: Discover schema, execute CRUD operations, verify results.
9
-
10
- **Agents:**
11
- 1. **Kenji** - Schema discovery + pre-read existing data
12
- 2. **Dmitri** - Create/update activities
13
- 3. **Kenji** - Verify results (count/list after changes)
14
-
15
- **Goal:** $ARGUMENTS
16
-
17
- ## Protocol
18
-
19
- ### Step 1: Kenji (Schema Discovery + Pre-Read)
20
-
21
- Discover workflow schema and existing data relevant to the task:
22
-
23
- ```
24
- Task(subagent_type="agent-kenji-data-reader", prompt="For this task: $ARGUMENTS\n\n1. List the relevant workflow(s) with field IDs, types, and dropdown/enum options\n2. List phases and their IDs\n3. If updating existing activities: list the activities that match (include their IDs)\n4. If creating new activities: show a sample existing activity so we know the expected field format")
25
- ```
26
-
27
- Wait for result. This gives Dmitri the real IDs and field formats.
28
-
29
- ### Step 2: Dmitri (Create/Update Activities)
30
-
31
- Spawn Dmitri with full schema context from Kenji:
32
-
33
- ```
34
- Task(subagent_type="agent-dmitri-activity-crud", prompt="Task: $ARGUMENTS\n\nWorkflow schema from Kenji:\n[PASTE KENJI'S OUTPUT - workflow ID, field IDs, types, phase IDs, enum options]\n\n[IF UPDATING: Target activities:\nPASTE ACTIVITY IDs AND CURRENT VALUES]\n\nExecute the CRUD operations using the correct field IDs and value formats.")
35
- ```
36
-
37
- Wait for result. Check for errors - if Dmitri reports validation failures, review field formats and retry once.
38
-
39
- ### Step 3: Kenji (Verify Results)
40
-
41
- Skip if `--skip-verify` flag is set.
42
-
43
- Verify the operations succeeded:
44
-
45
- ```
46
- Task(subagent_type="agent-kenji-data-reader", prompt="Verify CRUD operations for: $ARGUMENTS\n\nExpected changes:\n[PASTE DMITRI'S OUTPUT - created/updated activity IDs]\n\nCount activities in the workflow and list the recently created/modified ones to confirm they exist with correct values.")
47
- ```
48
-
49
- ### Step 4: Report
50
-
51
- ```markdown
52
- ## CRUD Squad Complete
53
-
54
- ### Kenji (Schema Discovery)
55
- - Workflow: [name] ([id])
56
- - Fields mapped: [count]
57
- - Existing activities found: [count or "N/A"]
58
-
59
- ### Dmitri (CRUD Operations)
60
- - Created: [count] activities
61
- - Updated: [count] activities
62
- - Errors: [count or "none"]
63
-
64
- ### Kenji (Verification)
65
- - Activities confirmed: [count]
66
- - Discrepancies: [list or "none"]
67
-
68
- ### Summary
69
- [Brief description of what was done]
70
- ```
71
-
72
- ## Options
73
-
74
- | Flag | Effect |
75
- |------|--------|
76
- | `--skip-verify` | Skip verification Kenji (trust Dmitri's response) |
77
- | `--skip-discovery` | Skip schema discovery (when you already know the workflow schema) |
78
- | `--dry-run` | Run Kenji discovery only, show what Dmitri would do, but don't execute |
79
-
80
- ## Difference from Direct Dmitri
81
-
82
- | | Direct Dmitri | CRUD Squad |
83
- |---|---|---|
84
- | **Schema context** | You must provide IDs manually | Kenji discovers IDs automatically |
85
- | **Verification** | Trust Dmitri's response | Kenji independently verifies |
86
- | **Bulk ops** | Single prompt | Discovery → execute → verify pipeline |
87
- | **Use when** | You already know exact IDs and format | "Create 5 customers" or "Update all overdue tasks" |
@@ -1,97 +0,0 @@
1
- ---
2
- description: Build reports with Kenji, Alejandro, and Viktor
3
- argument-hint: "report/dashboard description"
4
- allowed-tools: Task, Bash, Read
5
- ---
6
- # Data Squad
7
-
8
- Sequential pipeline: Discover schema, create calculated fields if needed, then build insights.
9
-
10
- **Agents:**
11
- 1. **Kenji** - Schema discovery (workflow fields, types, IDs)
12
- 2. **Alejandro** - Function fields (if calculated values needed)
13
- 3. **Viktor** - SQL insights (queries, aggregations, reports)
14
-
15
- **Goal:** $ARGUMENTS
16
-
17
- ## Protocol
18
-
19
- ### Step 1: Kenji (Schema Discovery)
20
-
21
- Always start with Kenji to get real IDs and field types:
22
-
23
- ```
24
- Task(subagent_type="agent-kenji-data-reader", prompt="List all workflows and their fields relevant to: $ARGUMENTS. Include field IDs, types, and dropdown options. Also list existing insights if any.")
25
- ```
26
-
27
- Wait for result. This gives Viktor and Alejandro the real IDs they need.
28
-
29
- ### Step 2: Check if Function Fields Needed
30
-
31
- Review Kenji's output. Alejandro is needed when:
32
- - The report needs **calculated values** not already in the schema (totals, percentages, date diffs)
33
- - An existing function field needs modification
34
- - A **nameFunction** is missing or needs updating
35
-
36
- If no calculated fields needed, skip to Step 3.
37
-
38
- If needed, spawn Alejandro:
39
-
40
- ```
41
- Task(subagent_type="agent-alejandro-function-fields", prompt="Create function fields for: $ARGUMENTS.\n\nWorkflow schema from Kenji:\n[PASTE KENJI'S OUTPUT - workflow IDs, field IDs, types]\n\nCreate the calculated fields needed for this report.")
42
- ```
43
-
44
- Wait for result. If `"status": "ready_to_push"`:
45
- - Run the push commands
46
- - Run `npm run pull` to get new field IDs
47
-
48
- ### Step 3: Viktor (SQL Insights)
49
-
50
- Spawn Viktor with full schema context:
51
-
52
- ```
53
- Task(subagent_type="agent-viktor-sql-insights", prompt="Create insights for: $ARGUMENTS.\n\nWorkflow schema:\n[Kenji found these workflows and fields: SUMMARIZE KENJI'S RESULT.]\n\n[IF ALEJANDRO RAN: Alejandro created these function fields: SUMMARIZE ALEJANDRO'S RESULT.]\n\nBuild SQL queries with correct field IDs. Never guess IDs.")
54
- ```
55
-
56
- Wait for result. If `"status": "ready_to_push"`:
57
- - Run the push commands (e.g., `npm run insights-push:force`)
58
-
59
- ### Step 4: Report
60
-
61
- ```markdown
62
- ## Data Squad Complete
63
-
64
- ### Kenji (Schema Discovery)
65
- - Workflows found: [list]
66
- - Fields mapped: [count]
67
- - Existing insights: [list or "none"]
68
-
69
- ### Alejandro (Function Fields)
70
- - Created: [list with formulas]
71
- - Skipped: [reason if not needed]
72
-
73
- ### Viktor (Insights)
74
- - Insights created: [list]
75
- - Query summary: [brief description of each]
76
- - Public: [yes/no for each]
77
-
78
- ### Next Steps
79
- - Preview insights in Hailer
80
- - Use insights as data source for apps (if needed)
81
- ```
82
-
83
- ## Options
84
-
85
- | Flag | Effect |
86
- |------|--------|
87
- | `--skip-functions` | Skip Alejandro (when function fields not needed) |
88
- | `--skip-insights` | Skip Viktor (when insights not needed) |
89
-
90
- ## Difference from Config Squad
91
-
92
- | | Config Squad | Data Squad |
93
- |---|---|---|
94
- | **Starting point** | New workflow needed | Workflow already exists |
95
- | **First agent** | Helga (create workflow) | Kenji (read existing schema) |
96
- | **Focus** | Infrastructure setup | Reporting and analytics |
97
- | **Use when** | "Create a Tasks workflow with..." | "Build a report showing..." |
@@ -1,303 +0,0 @@
1
- ---
2
- description: Parallel investigation squad for diagnosing bugs and incidents
3
- argument-hint: "bug or incident description"
4
- allowed-tools: Task, Bash, Read
5
- ---
6
-
7
- # Debug Squad
8
-
9
- Parallel investigation squad: diagnose bugs by examining data state, query patterns, code logic, and test reproduction simultaneously.
10
-
11
- **Agents:**
12
- - **Kenji** - Data state (check relevant activities, field values, phases, linked records)
13
- - **Viktor** - Query patterns (is this isolated or widespread? run insights to find anomalies)
14
- - **Svetlana** - Code review (logic errors, missing validations, race conditions)
15
- - **Tanya** - Test reproduction (create failing test to isolate the bug)
16
-
17
- **Goal:** $ARGUMENTS
18
-
19
- ## Protocol
20
-
21
- ### Step 1: Parse Bug Description
22
-
23
- Extract from `$ARGUMENTS`:
24
- - What is the reported issue?
25
- - Which workflow/activities/features are affected?
26
- - When was it first noticed?
27
- - What's the impact (severity)?
28
-
29
- Set `iteration = 1` and `max_iterations = 2`.
30
-
31
- ### Step 2: Launch All 4 Agents in Parallel
32
-
33
- Spawn all agents simultaneously using multiple Task tool calls in a single message:
34
-
35
- **Kenji (Data State):**
36
- ```
37
- Task(subagent_type="agent-kenji-data-reader", prompt="Investigate the data state for this bug: $ARGUMENTS.\n\nYour job:\n1. Identify the affected workflow(s) and activities\n2. Look up the relevant activity records, field values, phases\n3. Check linked activities and relationships\n4. Compare expected vs actual data state\n5. Report any anomalies, missing data, or unexpected values\n\nReturn:\n- What the data SHOULD look like\n- What it ACTUALLY looks like\n- Which fields/relationships are affected")
38
- ```
39
-
40
- **Viktor (Query Patterns):**
41
- ```
42
- Task(subagent_type="agent-viktor-sql-insights", prompt="Find patterns for this bug: $ARGUMENTS.\n\nYour job:\n1. Run insight queries to determine: is this isolated to one activity or widespread?\n2. Query for similar data anomalies across the workflow\n3. Look for patterns: does it affect specific phases, teams, date ranges, field values?\n4. Check for recent changes that could correlate with the bug\n\nReturn:\n- Is this isolated or widespread? (scope)\n- Pattern: what data characteristics trigger it?\n- How many records/activities affected?\n- Timeline: when did anomalies start appearing?")
43
- ```
44
-
45
- **Svetlana (Code Review):**
46
- ```
47
- Task(subagent_type="agent-svetlana-code-review", prompt="Review the code for this bug: $ARGUMENTS.\n\nYour job:\n1. Identify the relevant code sections (workflow logic, activity creation, field updates, phase transitions)\n2. Inspect for logic errors, missing validations, race conditions, null checks\n3. Look for assumptions that might break in edge cases\n4. Check for recent changes that could have introduced the bug\n\nReturn:\n- Suspected code sections with issues\n- Specific logic problems (race conditions, wrong field access, missing validation)\n- Edge cases not handled\n- Security implications if any")
48
- ```
49
-
50
- **Tanya (Test Reproduction):**
51
- ```
52
- Task(subagent_type="agent-tanya-test-runner", prompt="Create a failing test for this bug: $ARGUMENTS.\n\nYour job:\n1. Write a minimal test that reproduces the bug\n2. Set up the preconditions (data state, workflow, etc)\n3. Execute the action that triggers the bug\n4. Assert the bug is present (test FAILS with current code)\n5. Do NOT fix the bug - just demonstrate it\n\nReturn:\n- The failing test code\n- What the test proves about the bug\n- Failure output showing the bug is real")
53
- ```
54
-
55
- If `$ARGUMENTS` contains `--skip-data`, skip Kenji.
56
- If `$ARGUMENTS` contains `--skip-queries`, skip Viktor.
57
-
58
- ### Step 3: Collect Results and Synthesize Root Cause
59
-
60
- Wait for all agents to complete. Aggregate findings:
61
-
62
- **From Kenji:** What data is wrong?
63
- **From Viktor:** How widespread is it? What pattern triggers it?
64
- **From Svetlana:** What code is broken?
65
- **From Tanya:** Can we reproduce it consistently?
66
-
67
- Look for convergence:
68
- - Does data anomaly match code logic error?
69
- - Does Svetlana's suspected code section align with Viktor's pattern?
70
- - Does Tanya's test reproduce the exact issue Kenji found?
71
-
72
- If **clear root cause** emerges → proceed to Step 4 (report).
73
-
74
- If **inconclusive** (no agent found clear cause OR agents disagree):
75
- - If `iteration < max_iterations`: Increment `iteration`, go to **Step 2b** (narrow scope)
76
- - If `iteration >= max_iterations`: Proceed to Step 4 with partial findings
77
-
78
- ### Step 2b: Re-Investigation (Narrowed Scope)
79
-
80
- If first iteration was inconclusive, re-run agents with narrowed focus:
81
-
82
- ```
83
- Task(subagent_type="agent-kenji-data-reader", prompt="Re-investigate (iteration [iteration]): $ARGUMENTS\n\nBased on initial findings:\n[SUMMARIZE WHAT FIRST PASS FOUND]\n\nNarrow your focus to: [MOST LIKELY AFFECTED AREA]\n\nDig deeper into the data state. Look for subtle issues.")
84
- ```
85
-
86
- Similar narrowed prompts for Viktor, Svetlana, Tanya.
87
-
88
- ### Step 4: Report
89
-
90
- ```markdown
91
- ## Debug Squad Investigation
92
-
93
- ### Summary
94
- **Bug:** [Description]
95
- **Iterations:** [count] of [max_iterations]
96
- **Root Cause Status:** IDENTIFIED / INCONCLUSIVE
97
-
98
- ---
99
-
100
- ### Kenji (Data State)
101
- **Affected Records:** [count/scope]
102
- - Expected state: [description]
103
- - Actual state: [description]
104
- - Anomalies found: [list]
105
-
106
- ### Viktor (Query Patterns)
107
- **Scope:** Isolated / Widespread (X records affected)
108
- **Pattern:** [What triggers the bug]
109
- **Timeline:** [When did it start]
110
- - Similar anomalies detected: [yes/no, details]
111
-
112
- ### Svetlana (Code Review)
113
- **Suspected Code:** [files and line numbers]
114
- **Issues Found:**
115
- - [Issue 1]: [file:line] - [description]
116
- - [Issue 2]: [file:line] - [description]
117
- **Risk Level:** [LOW/MEDIUM/HIGH]
118
-
119
- ### Tanya (Reproduction)
120
- **Test Status:** CREATED / FAILED TO REPRODUCE
121
- **Reproducibility:** Consistent / Intermittent / Cannot reproduce
122
- - Test file: [path]
123
- - Failure output: [snippet]
124
-
125
- ---
126
-
127
- ### Root Cause Analysis
128
- [Synthesize findings from all 4 agents]
129
-
130
- **Primary Cause:** [What's broken]
131
- **Contributing Factors:** [Secondary issues]
132
- **Why It Happens:** [Mechanism]
133
-
134
- ### Recommended Fix
135
- [Based on root cause, what needs to be fixed]
136
- - File: [path]
137
- - Change: [description]
138
- - Rationale: [why this fixes it]
139
-
140
- ### Next Steps
141
- 1. [Fix applied by Svetlana/Simple Writer]
142
- 2. [Test to verify fix]
143
- 3. [Deploy and monitor]
144
- ```
145
-
146
- If any agent fails or times out, report partial results, note which failed, and offer to re-run individually.
147
-
148
- ## Options
149
-
150
- | Flag | Effect |
151
- |------|--------|
152
- | `--skip-data` | Skip Kenji (when data investigation not needed) |
153
- | `--skip-queries` | Skip Viktor (when pattern analysis not needed) |
154
- | `--bg` | Run all agents in background mode |
155
- | `--debate` | Debate mode: competing hypotheses instead of domain-split investigation |
156
-
157
- If `--bg` is present, launch all agents with `run_in_background: true` and tell the user they'll be notified when complete.
158
-
159
- ---
160
-
161
- ## Debate Mode (`--debate`)
162
-
163
- When `--debate` flag is present, the squad switches from domain-split investigation to **competing hypothesis investigation**. Instead of each agent checking their domain, agents are assigned competing theories and must find evidence for/against their hypothesis.
164
-
165
- ### How It Differs from Normal Mode
166
-
167
- | Aspect | Normal Mode | Debate Mode |
168
- |--------|-------------|-------------|
169
- | Assignment | Each agent checks their domain (data, queries, code, tests) | Each agent investigates a specific hypothesis |
170
- | Evidence | Agents report what they find in their area | Agents argue FOR their hypothesis using any evidence |
171
- | Synthesis | Look for convergence across domains | Compare evidence strength, pick winner |
172
- | Best for | Well-scoped bugs with clear domain | Ambiguous problems with multiple plausible causes |
173
-
174
- ### Debate Protocol
175
-
176
- **Replaces Steps 2-3 of the normal protocol.**
177
-
178
- #### Step D1: Generate Hypotheses
179
-
180
- Analyze the problem description and generate **2-3 competing hypotheses** about the root cause. Each hypothesis should be:
181
- - **Specific**: Not "something is wrong" but "the phase transition hook doesn't fire when..."
182
- - **Testable**: An agent can find evidence for or against it
183
- - **Distinct**: Hypotheses should point to genuinely different root causes
184
-
185
- Example for "Orders aren't syncing to Netvisor":
186
- - H1: "The activity mover trigger condition is wrong - it fires on the wrong phase"
187
- - H2: "The Netvisor API integration is failing silently - auth or payload issue"
188
- - H3: "The data is incomplete - required fields for Netvisor export are missing"
189
-
190
- If user provided their own hypotheses in `$ARGUMENTS`, use those instead of generating.
191
-
192
- #### Step D2: Assign Agents to Hypotheses
193
-
194
- Pick the best-fit agent for each hypothesis:
195
-
196
- | Hypothesis Type | Best Agent |
197
- |----------------|-----------|
198
- | Data integrity / missing values | **Kenji** |
199
- | Query / pattern / scope issue | **Viktor** |
200
- | Code logic / validation / race condition | **Svetlana** |
201
- | Reproducibility / environment | **Tanya** |
202
- | External integration / API | **Ivan** (monolith) or **Web Search** (research) |
203
- | Activity mover / phase cascade | **Igor** |
204
- | Zapier integration / external sync | **Zara** |
205
-
206
- Each agent gets:
207
- - The full problem description
208
- - Their assigned hypothesis
209
- - Instruction: "Find evidence that supports OR refutes this hypothesis. Be honest - if evidence points away from your hypothesis, report that."
210
-
211
- ```
212
- Task(subagent_type="[best-fit-agent]", prompt="DEBATE MODE investigation for: $ARGUMENTS
213
-
214
- YOUR HYPOTHESIS: [H1 description]
215
-
216
- Your job is to investigate whether this hypothesis explains the bug. Be thorough and honest:
217
-
218
- 1. What evidence SUPPORTS this hypothesis?
219
- 2. What evidence REFUTES this hypothesis?
220
- 3. Confidence level: STRONG / MODERATE / WEAK
221
- 4. If your hypothesis is wrong, what does the evidence actually point to?
222
-
223
- Do NOT assume your hypothesis is correct. Follow the evidence.")
224
- ```
225
-
226
- Launch all hypothesis agents in parallel.
227
-
228
- #### Step D3: Score and Synthesize
229
-
230
- Collect results. For each hypothesis, assess:
231
-
232
- | Hypothesis | Supporting Evidence | Refuting Evidence | Confidence | Agent |
233
- |-----------|-------------------|-------------------|------------|-------|
234
- | H1 | [list] | [list] | STRONG/MODERATE/WEAK | [agent] |
235
- | H2 | [list] | [list] | STRONG/MODERATE/WEAK | [agent] |
236
- | H3 | [list] | [list] | STRONG/MODERATE/WEAK | [agent] |
237
-
238
- **Verdict rules:**
239
- - If one hypothesis has STRONG confidence and others are WEAK → **clear winner**
240
- - If multiple have MODERATE+ confidence → **compound issue** (multiple causes)
241
- - If all are WEAK → **inconclusive**, escalate to user with what was learned
242
-
243
- #### Step D4: Debate Report
244
-
245
- ```markdown
246
- ## Debug Squad Investigation (Debate Mode)
247
-
248
- ### Problem
249
- [Description]
250
-
251
- ### Hypotheses Tested
252
-
253
- #### H1: [Hypothesis description]
254
- **Assigned to:** [Agent name]
255
- **Confidence:** STRONG / MODERATE / WEAK
256
- **Supporting evidence:**
257
- - [Evidence 1]
258
- - [Evidence 2]
259
- **Refuting evidence:**
260
- - [Evidence 1]
261
-
262
- #### H2: [Hypothesis description]
263
- ...
264
-
265
- #### H3: [Hypothesis description]
266
- ...
267
-
268
- ---
269
-
270
- ### Verdict
271
- **Winner:** H[N] - [hypothesis description]
272
- **Confidence:** [STRONG/MODERATE/WEAK]
273
-
274
- [If compound:] **Multiple causes identified:**
275
- 1. H[X]: [description] (MODERATE confidence)
276
- 2. H[Y]: [description] (MODERATE confidence)
277
-
278
- [If inconclusive:] **No clear root cause found.** Most promising lead: H[N].
279
-
280
- ### Dissenting Evidence
281
- [Evidence that doesn't fit the winning hypothesis - important to surface]
282
-
283
- ### Recommended Fix
284
- [Based on winning hypothesis]
285
-
286
- ### Next Steps
287
- 1. [Fix the identified cause]
288
- 2. [Verify dissenting evidence doesn't indicate a secondary issue]
289
- 3. [Run /hotfix-squad if fix is straightforward]
290
- ```
291
-
292
- ---
293
-
294
- ## Notes
295
-
296
- - Parallel execution: all agents run simultaneously for speed
297
- - Max 2 iterations prevents infinite loops while allowing scope refinement
298
- - Convergence is key: when 3+ agents point to the same root cause, confidence is high
299
- - Each re-investigation iteration gets narrowed scope from first pass results
300
- - Report synthesizes findings, not just concatenates them
301
- - **Debate mode** costs more tokens (2-3 full agent calls) but excels at ambiguous, hard-to-diagnose problems
302
- - Debate agents are told to be honest about refuting evidence - this prevents confirmation bias
303
- - Users can supply their own hypotheses to test specific theories
@@ -1,65 +0,0 @@
1
- ---
2
- description: Document API endpoints with Lars and Marcus
3
- argument-hint: "endpoint or module to document"
4
- allowed-tools: Task, Bash
5
- ---
6
- # Doc Squad
7
-
8
- Sequential pipeline: Code analysis, then generate documentation.
9
-
10
- **Agents:**
11
- 1. **Lars** - LSP code analysis (inspect types, schemas, function signatures)
12
- 2. **Marcus** - API documentation (generate endpoint docs from analysis)
13
-
14
- **Goal:** $ARGUMENTS
15
-
16
- ## Protocol
17
-
18
- ### Step 1: Lars (LSP Analysis)
19
-
20
- Spawn Lars to analyze code and extract types/schemas:
21
-
22
- ```
23
- Task(subagent_type="agent-lars-code-inspector", prompt="Inspect code for: $ARGUMENTS. Extract:\n- Function signatures\n- Type definitions\n- Return types\n- Parameter schemas\n- Joi/Zod validation rules\n\nUse LSP if available. Return structured analysis with types and schemas.")
24
- ```
25
-
26
- Wait for result. Save the analysis output - Marcus needs these type definitions.
27
-
28
- ### Step 2: Marcus (API Documentation)
29
-
30
- Spawn Marcus with the code analysis from Lars:
31
-
32
- ```
33
- Task(subagent_type="agent-marcus-api-documenter", prompt="Generate API documentation for: $ARGUMENTS.\n\nCode analysis from Lars:\n[PASTE LARS'S OUTPUT - types, schemas, function signatures]\n\nCreate comprehensive endpoint documentation including:\n- Endpoint path and method\n- Description\n- Parameters and types\n- Request/response examples\n- Error codes and handling\n- Usage examples with @hailer/cli")
34
- ```
35
-
36
- Wait for result. If `"status": "ready_to_push"`:
37
- - Run the push commands Marcus provides
38
-
39
- ### Step 3: Report
40
-
41
- ```markdown
42
- ## Doc Squad Complete
43
-
44
- ### Lars (Code Analysis)
45
- - Files analyzed: [count]
46
- - Functions found: [count]
47
- - Types extracted: [count]
48
- - Schemas identified: [list]
49
-
50
- ### Marcus (Documentation)
51
- - Endpoints documented: [count]
52
- - Examples created: [count]
53
- - Files generated: [list]
54
-
55
- ### Next Steps
56
- - Review generated documentation
57
- - Add to API reference
58
- - Test examples with @hailer/cli
59
- ```
60
-
61
- ## Notes
62
-
63
- - Lars runs first to extract accurate types - never guess schemas
64
- - Marcus creates human-friendly docs from the type analysis
65
- - Documentation stays in sync with actual code signatures