@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,160 @@
1
+ ---
2
+ name: lsp-setup
3
+ description: How to set up LSP (Language Server Protocol) for Claude Code - enables code intelligence for Lars and other agents
4
+ version: 1.0.0
5
+ triggers:
6
+ - LSP not available
7
+ - typescript-language-server
8
+ - code intelligence setup
9
+ - Lars can't find unused code
10
+ ---
11
+
12
+ # LSP Setup for Claude Code
13
+
14
+ LSP (Language Server Protocol) enables code intelligence features like go-to-definition, find-references, and accurate dead code detection.
15
+
16
+ ## Why LSP?
17
+
18
+ Without LSP, agents like Lars must guess about code usage via grep/file reads. With LSP:
19
+ - **Accurate dead code detection** - knows if exports are used elsewhere
20
+ - **Type error detection** - without running compiler
21
+ - **Find all references** - across entire codebase
22
+ - **Go to definition** - jump to where symbols are defined
23
+
24
+ ## Requirements
25
+
26
+ Three things needed for LSP to work:
27
+
28
+ | Requirement | How to Check | How to Install |
29
+ |-------------|--------------|----------------|
30
+ | `ENABLE_LSP_TOOL=1` | Check `.claude/settings.json` | Add to env section |
31
+ | `typescript-lsp` plugin | `claude plugin list` | `claude plugin install typescript-lsp@claude-plugins-official` |
32
+ | Language server binary | `which typescript-language-server` | `npm install -g typescript-language-server typescript` |
33
+
34
+ ## Setup Steps
35
+
36
+ ### Step 1: Install the language server binary
37
+
38
+ ```bash
39
+ npm install -g typescript-language-server typescript
40
+ ```
41
+
42
+ Verify:
43
+ ```bash
44
+ typescript-language-server --version
45
+ # Should show version like: 5.1.3
46
+ ```
47
+
48
+ ### Step 2: Install Claude Code plugin
49
+
50
+ ```bash
51
+ claude plugin install typescript-lsp@claude-plugins-official
52
+ ```
53
+
54
+ Verify:
55
+ ```bash
56
+ claude plugin list
57
+ # Should show: typescript-lsp@claude-plugins-official ✔ enabled
58
+ ```
59
+
60
+ ### Step 3: Ensure settings.json has LSP enabled
61
+
62
+ Check `.claude/settings.json` (project) or `~/.claude/settings.json` (global):
63
+
64
+ ```json
65
+ {
66
+ "env": {
67
+ "ENABLE_LSP_TOOL": "1"
68
+ }
69
+ }
70
+ ```
71
+
72
+ ### Step 4: Restart Claude
73
+
74
+ LSP plugin activates on Claude restart:
75
+ ```bash
76
+ claude -c
77
+ ```
78
+
79
+ ### Step 5: Test
80
+
81
+ Ask Lars to find unused code in a TypeScript file:
82
+ ```
83
+ Find unused code in src/App.tsx
84
+ ```
85
+
86
+ Or test LSP directly:
87
+ ```
88
+ Use LSP documentSymbol on src/App.tsx
89
+ ```
90
+
91
+ ## Supported File Types
92
+
93
+ The `typescript-lsp` plugin supports:
94
+ - `.ts`, `.tsx` - TypeScript + React
95
+ - `.js`, `.jsx` - JavaScript + React
96
+ - `.mts`, `.cts` - TypeScript ES modules / CommonJS
97
+ - `.mjs`, `.cjs` - JavaScript ES modules / CommonJS
98
+
99
+ ## LSP Operations Available
100
+
101
+ | Operation | Purpose |
102
+ |-----------|---------|
103
+ | `documentSymbol` | List all symbols in a file |
104
+ | `findReferences` | Find all usages of a symbol |
105
+ | `goToDefinition` | Jump to where symbol is defined |
106
+ | `hover` | Get type info and documentation |
107
+ | `goToImplementation` | Find implementations of interface |
108
+ | `incomingCalls` | What calls this function |
109
+ | `outgoingCalls` | What this function calls |
110
+ | `prepareCallHierarchy` | Get call hierarchy at position |
111
+
112
+ ## Agents That Use LSP
113
+
114
+ | Agent | How They Use LSP |
115
+ |-------|------------------|
116
+ | **Lars** | Primary user - dead code, unused imports, type errors |
117
+ | **Svetlana** | Type checking during code review (optional) |
118
+ | **Giuseppe** | Verify code compiles before build (optional) |
119
+
120
+ ## Troubleshooting
121
+
122
+ ### "No LSP server available"
123
+
124
+ 1. Check binary is installed: `which typescript-language-server`
125
+ 2. Check plugin is installed: `claude plugin list`
126
+ 3. Restart Claude: `claude -c`
127
+
128
+ ### LSP times out on first query
129
+
130
+ Normal - language server is indexing the project. Wait a few seconds and retry.
131
+
132
+ ### LSP works for .ts but not .tsx
133
+
134
+ Check `typescript` is installed alongside `typescript-language-server`:
135
+ ```bash
136
+ npm install -g typescript-language-server typescript
137
+ ```
138
+
139
+ ### "Executable not found in $PATH"
140
+
141
+ The binary isn't in your PATH. Either:
142
+ - Install globally: `npm install -g typescript-language-server`
143
+ - Or add npm global bin to PATH: `export PATH="$PATH:$(npm bin -g)"`
144
+
145
+ ## Without LSP (Fallback)
146
+
147
+ If LSP isn't available, agents can fall back to:
148
+
149
+ ```bash
150
+ # Type errors
151
+ npx tsc --noEmit 2>&1
152
+
153
+ # Unused variables (requires eslint config)
154
+ npx eslint --rule '@typescript-eslint/no-unused-vars: error' src/
155
+
156
+ # Find references (grep-based, less accurate)
157
+ grep -r "functionName" src/
158
+ ```
159
+
160
+ This is less accurate but works without setup.
@@ -0,0 +1,153 @@
1
+ ---
2
+ name: mcp-direct-tools
3
+ description: Reference for MCP tools not assigned to agents
4
+ version: 1.0.0
5
+ ---
6
+
7
+ # MCP Direct Tools
8
+
9
+ <purpose>
10
+ Reference for MCP tools not assigned to agents. Load this skill when user requests direct tool usage or needs capabilities not covered by standard agents.
11
+ </purpose>
12
+
13
+ ---
14
+
15
+ ## When to Load This Skill
16
+
17
+ - User asks "can you use the bug fixer tools?"
18
+ - User needs capabilities not covered by agents
19
+ - Direct MCP tool access requested
20
+ - Debugging/testing MCP tools
21
+
22
+ ---
23
+
24
+ ## Bug Fixer Tools (16 tools)
25
+
26
+ Automated bug fixing suite for Hailer apps. Use these for automated debugging workflows.
27
+
28
+ ### Discovery & Analysis
29
+
30
+ | Tool | Description | Parameters |
31
+ |------|-------------|------------|
32
+ | `bug_fixer_find_app` | Locate app by name | `{ appName }` |
33
+ | `bug_fixer_analyze_bug` | Classify bug report | `{ bugReport, appId }` |
34
+
35
+ ### File Operations
36
+
37
+ | Tool | Description | Parameters |
38
+ |------|-------------|------------|
39
+ | `bug_fixer_list_files` | List project files | `{ appId, path? }` |
40
+ | `bug_fixer_read_file` | Read file content | `{ appId, filePath }` |
41
+ | `bug_fixer_write_file` | Modify file content | `{ appId, filePath, content }` |
42
+ | `bug_fixer_apply_fix` | Apply code patch | `{ appId, filePath, patch }` |
43
+
44
+ ### Build & Test
45
+
46
+ | Tool | Description | Parameters |
47
+ |------|-------------|------------|
48
+ | `bug_fixer_run_build` | Execute build command | `{ appId }` |
49
+
50
+ ### Git Operations
51
+
52
+ | Tool | Description | Parameters |
53
+ |------|-------------|------------|
54
+ | `bug_fixer_git_status` | Check git status | `{ appId }` |
55
+ | `bug_fixer_git_pull` | Fetch latest code | `{ appId }` |
56
+ | `bug_fixer_git_commit` | Commit changes | `{ appId, message }` |
57
+ | `bug_fixer_git_push` | Push to remote | `{ appId }` |
58
+ | `bug_fixer_git_revert` | Undo changes | `{ appId }` |
59
+
60
+ ### Workflow Management
61
+
62
+ | Tool | Description | Parameters |
63
+ |------|-------------|------------|
64
+ | `bug_fixer_start_fix` | Begin fix workflow | `{ bugId, appId }` |
65
+ | `bug_fixer_mark_declined` | Close as not-a-bug | `{ bugId, reason }` |
66
+ | `bug_fixer_publish_fix` | Deploy to production | `{ appId, version }` |
67
+ | `bug_fixer_retry_fix` | Attempt with new context | `{ bugId, newContext }` |
68
+
69
+ ### Bug Fixer Workflow
70
+
71
+ ```
72
+ 1. bug_fixer_find_app → Get app ID
73
+ 2. bug_fixer_analyze_bug → Classify issue
74
+ 3. bug_fixer_start_fix → Begin workflow
75
+ 4. bug_fixer_list_files → Find relevant files
76
+ 5. bug_fixer_read_file → Understand current code
77
+ 6. bug_fixer_write_file / bug_fixer_apply_fix → Make changes
78
+ 7. bug_fixer_run_build → Verify fix
79
+ 8. bug_fixer_git_commit → Save changes
80
+ 9. bug_fixer_publish_fix → Deploy
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Insight Tools (Not in Viktor)
86
+
87
+ Viktor uses `preview_insight` and `get_insight_data`. These additional tools are available:
88
+
89
+ | Tool | Description | When to Use |
90
+ |------|-------------|-------------|
91
+ | `list_insights` | List all insights in workspace | Discovery, cleanup |
92
+ | `update_insight` | Modify existing insight | Query changes |
93
+ | `remove_insight` | Delete insight (NUCLEAR) | Cleanup |
94
+
95
+ **Note:** SDK has equivalents via insights.ts push. Use SDK for version-controlled changes, MCP for quick fixes.
96
+
97
+ ---
98
+
99
+ ## Workflow Tools (PLAYGROUND/NUCLEAR)
100
+
101
+ Direct workflow manipulation. Normally use Helga + SDK, but these exist for quick operations:
102
+
103
+ | Tool | Description | Group |
104
+ |------|-------------|-------|
105
+ | `install_workflow` | Create workflow via MCP | PLAYGROUND |
106
+ | `remove_workflow` | Delete workflow | NUCLEAR |
107
+ | `update_workflow_field` | Modify field config | PLAYGROUND |
108
+ | `update_workflow_phase` | Modify phase config | PLAYGROUND |
109
+ | `test_function_field` | Test JS function | PLAYGROUND |
110
+
111
+ **Warning:** NUCLEAR tools require `ENABLE_NUCLEAR_TOOLS=true` in MCP config.
112
+
113
+ ---
114
+
115
+ ## Tool Groups Reference
116
+
117
+ | Group | Risk Level | Examples |
118
+ |-------|------------|----------|
119
+ | READ | Safe | list_activities, get_workflow_schema |
120
+ | WRITE | Updates data | create_activity, add_discussion_message |
121
+ | PLAYGROUND | Admin ops | install_workflow, update_workflow_field |
122
+ | NUCLEAR | Destructive | remove_workflow, remove_app |
123
+ | BOT_INTERNAL | Bots only | Not exposed to MCP clients |
124
+
125
+ ---
126
+
127
+ ## Usage Pattern
128
+
129
+ When user requests direct tool usage:
130
+
131
+ ```
132
+ User: "Use the bug fixer to fix this app"
133
+
134
+ Orchestrator:
135
+ 1. Load this skill
136
+ 2. Call tools directly via mcp__hailer__<tool_name>
137
+ 3. Follow workflow patterns above
138
+ 4. Report results
139
+ ```
140
+
141
+ ---
142
+
143
+ ## Tools NOT Covered Here
144
+
145
+ These are assigned to agents - use the agent instead:
146
+
147
+ | Tool | Agent |
148
+ |------|-------|
149
+ | Activity CRUD | Dmitri |
150
+ | Discussions | Yevgeni |
151
+ | App scaffold/create | Giuseppe |
152
+ | Insights preview/data | Viktor |
153
+ | User search | Permissions Handler |
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: optional-parameters
3
+ description: Omit optional parameters instead of passing empty values
4
+ version: 1.0.0
5
+ triggers: Tool error about empty array/string when parameter should be omitted
6
+ ---
7
+
8
+ # Optional Parameters
9
+
10
+ <purpose>
11
+ Teach correct handling of optional tool parameters - OMIT them entirely when not needed, rather than passing empty arrays, strings, or null values.
12
+ </purpose>
13
+
14
+ <patterns>
15
+ ## Pattern 1: Omit vs Empty Value
16
+
17
+ **Key distinction:**
18
+ - **OMIT parameter**: Don't include it in the function call at all
19
+ - **NOT same as empty value**: `[]`, `""`, `null`, `undefined` are NOT valid replacements for omission
20
+
21
+ ## Pattern 2: When to Omit
22
+
23
+ - Updating insight public/name but NOT sources → omit sources
24
+ - Updating activity field but NOT name → omit name
25
+ - Any "required" schema parameter that's not relevant to current operation
26
+
27
+ ## Pattern 3: Rule of Thumb
28
+
29
+ If you're not changing/using a value, OMIT the parameter entirely rather than passing empty/null.
30
+ </patterns>
31
+
32
+ <examples>
33
+ ## Example 1: Correct - Omitting Unused Parameters
34
+
35
+ ```typescript
36
+ // Update insight - only changing public flag
37
+ // sources parameter exists in schema but NOT needed for this update
38
+ update_insight({
39
+ insightId: "abc123",
40
+ public: false
41
+ // sources: NOT included - omit entirely
42
+ });
43
+
44
+ // Update insight - changing sources
45
+ update_insight({
46
+ insightId: "abc123",
47
+ sources: [{
48
+ name: 'tasks',
49
+ workflowId: 'wf123',
50
+ fields: [{ name: 'title', meta: 'name' }]
51
+ }]
52
+ // Include sources when actually updating them
53
+ });
54
+ ```
55
+
56
+ ## Example 2: Wrong - Passing Empty Values
57
+
58
+ ```typescript
59
+ // WRONG - Passing empty array when parameter should be omitted
60
+ update_insight({
61
+ insightId: "abc123",
62
+ public: false,
63
+ sources: [] // Error: sources must contain at least 1 items
64
+ });
65
+
66
+ // WRONG - Passing empty string
67
+ update_activity({
68
+ activityId: "xyz",
69
+ name: "" // Error: name cannot be empty
70
+ });
71
+ ```
72
+ </examples>
@@ -0,0 +1,221 @@
1
+ ---
2
+ name: publish-hailer-app
3
+ description: Guide for publishing Hailer apps to production
4
+ version: 1.3.0
5
+ triggers:
6
+ - publish app
7
+ - deploy app
8
+ - production app
9
+ ---
10
+
11
+ # Publish Hailer App Skill
12
+
13
+ Guide for publishing Hailer apps to production using MCP tools.
14
+
15
+ <warning>
16
+ ## ⚠️ Publishing Requires Explicit User Request
17
+
18
+ **Default is local development** — scaffold creates a dev app at `http://localhost:3000` automatically.
19
+
20
+ **Only use this skill when the user explicitly asks to publish or deploy to production.**
21
+
22
+ Before publishing: validate manifest.json (see below), then `publish_hailer_app` (auto-updates URL to production).
23
+ </warning>
24
+
25
+ <critical>
26
+ ## MANDATORY: Validate Before Publishing
27
+
28
+ The `publish_hailer_app` tool will SILENTLY FAIL if manifest.json is misconfigured.
29
+
30
+ **YOU MUST validate these before calling publish_hailer_app:**
31
+
32
+ 1. Read `public/manifest.json` in the project
33
+ 2. Check `appId` exists and is 24 characters
34
+ 3. Check `version` exists and is NOT empty (e.g., "1.0.0")
35
+ 4. Check `versionDescription` exists and is NOT empty
36
+
37
+ If ANY are missing/empty, FIX THEM FIRST before publishing.
38
+ </critical>
39
+
40
+ <validation-code>
41
+ ## Validation Steps (DO THIS FIRST)
42
+
43
+ ```
44
+ 1. Read({file_path: "{projectDir}/public/manifest.json"})
45
+
46
+ 2. Verify JSON contains:
47
+ - "appId": "24-char-id" ← If missing: use create_app first
48
+ - "version": "1.0.0" ← If empty: set to "1.0.0"
49
+ - "versionDescription": "..." ← If empty: set to "Initial release"
50
+
51
+ 3. If any field missing/empty → Edit manifest.json to fix
52
+
53
+ 4. ONLY THEN call publish_hailer_app
54
+ ```
55
+ </validation-code>
56
+
57
+ <workflow>
58
+ ## Full Publishing Workflow
59
+
60
+ ### Step 1: Validate & Fix manifest.json
61
+
62
+ Read the manifest:
63
+ ```javascript
64
+ Read({file_path: "{projectDir}/public/manifest.json"})
65
+ ```
66
+
67
+ Required structure:
68
+ ```json
69
+ {
70
+ "appId": "695816e2ba1d8bef3af7e018",
71
+ "version": "1.0.0",
72
+ "versionDescription": "Initial production release"
73
+ }
74
+ ```
75
+
76
+ **If appId missing:** Add the ID from Step 2
77
+ **If version empty:** Set to "1.0.0"
78
+ **If versionDescription empty:** Set to "Initial release"
79
+
80
+ ### Step 2: Publish
81
+
82
+ ```javascript
83
+ publish_hailer_app({
84
+ projectDirectory: "/path/to/app"
85
+ })
86
+ ```
87
+
88
+ This does everything in one call:
89
+ - Copies manifest.json into dist/
90
+ - Creates .tgz with `package/` prefix (matches npm pack format)
91
+ - Uploads to S3 via POST /app/publish
92
+ - **Auto-updates app URL** to `https://apps.hailer.com/{workspaceId}/{appId}/`
93
+
94
+ ### Step 3: Verify
95
+
96
+ ```javascript
97
+ list_apps()
98
+ ```
99
+ Confirm URL is `https://apps.hailer.com/...` (not localhost).
100
+ </workflow>
101
+
102
+ <silent-failure>
103
+ ## Why Silent Failures Happen
104
+
105
+ The SDK publish script requires `version` and `versionDescription` in manifest.json.
106
+ If missing/empty, the tool returns "Success" but files are NOT uploaded.
107
+
108
+ **Symptoms of silent failure:**
109
+ - Tool says "App Published Successfully!"
110
+ - But app URL is still `http://localhost:3000`
111
+ - Or production URL returns 403/404
112
+
113
+ **Always validate manifest BEFORE publishing.**
114
+ </silent-failure>
115
+
116
+ <dev-vs-prod>
117
+ ## Dev vs Production Apps
118
+
119
+ | Type | URL | Created By | Purpose |
120
+ |------|-----|------------|---------|
121
+ | Dev | `http://localhost:3000` | `scaffold_hailer_app` (reuses existing) | Local development, always stays at localhost |
122
+ | Prod | `https://apps.hailer.com/{workspaceId}/{appId}/` | `publish_hailer_app` (auto-created) | Published production app |
123
+
124
+ **Flow:**
125
+ 1. `scaffold_hailer_app` checks for existing dev app at localhost:3000 — reuses it instead of creating duplicates
126
+ 2. Dev app stays at localhost forever — it's your development slot
127
+ 3. When user says "publish": `publish_hailer_app` detects the dev app URL, auto-creates a NEW production app entry, publishes to it, and updates the URL
128
+
129
+ **No manual `update_app` or `create_app` needed.** The publish tool handles everything automatically.
130
+ </dev-vs-prod>
131
+
132
+ <updating>
133
+ ## Updating Published Apps
134
+
135
+ 1. Bump version in manifest.json:
136
+ ```json
137
+ {
138
+ "version": "1.0.1",
139
+ "versionDescription": "Fixed data loading bug"
140
+ }
141
+ ```
142
+
143
+ 2. Publish:
144
+ ```javascript
145
+ publish_hailer_app({
146
+ projectDirectory: "/path/to/app"
147
+ })
148
+ ```
149
+
150
+ New version replaces old at same URL.
151
+ </updating>
152
+
153
+ <sharing>
154
+ ## Sharing Apps
155
+
156
+ ```javascript
157
+ // Entire workspace
158
+ add_app_member({ appId: "...", member: "network_{workspaceId}" })
159
+
160
+ // Team
161
+ add_app_member({ appId: "...", member: "team_{teamId}" })
162
+
163
+ // User
164
+ add_app_member({ appId: "...", member: "user_{userId}" })
165
+ ```
166
+ </sharing>
167
+
168
+ <vite-config>
169
+ ## CRITICAL: Vite Base Path
170
+
171
+ Vite apps MUST have `base: './'` in vite.config.ts for production deployment.
172
+
173
+ ```typescript
174
+ // vite.config.ts
175
+ export default defineConfig({
176
+ base: './', // REQUIRED for production
177
+ // ... other config
178
+ });
179
+ ```
180
+
181
+ **Without this:**
182
+ - Asset paths resolve to root domain instead of app folder
183
+ - Production app returns 403/404 errors
184
+ - Works in localhost but fails in production
185
+
186
+ **Also verify:** The .tgz package must have files at `package/dist/` path structure.
187
+ </vite-config>
188
+
189
+ <cache-busting>
190
+ ## CRITICAL: Browser Cache for Published Apps
191
+
192
+ Published Hailer apps serve stale versions from browser cache. Vite's hashed JS/CSS filenames handle asset cache-busting, but `index.html` itself needs no-cache headers.
193
+
194
+ **Add these meta tags to `index.html` `<head>` before publishing:**
195
+
196
+ ```html
197
+ <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
198
+ <meta http-equiv="Pragma" content="no-cache" />
199
+ <meta http-equiv="Expires" content="0" />
200
+ ```
201
+
202
+ **Without these:**
203
+ - Users see old app version after publish
204
+ - Hard refresh (Ctrl+Shift+R) works but users won't know to do it
205
+ - Particularly bad for bug fix deploys where users expect changes immediately
206
+
207
+ **Why meta tags not server headers?**
208
+ Hailer apps are served from `apps.hailer.com` static hosting - we can't control server headers. Meta tags are the only client-side cache control available.
209
+ </cache-busting>
210
+
211
+ <checklist>
212
+ ## Pre-Publish Checklist
213
+
214
+ - [ ] manifest.json `appId` is 24 chars (dev app ID is fine — publish auto-creates prod app)
215
+ - [ ] manifest.json `version` is set (e.g., "1.0.0")
216
+ - [ ] manifest.json `versionDescription` is set (not empty)
217
+ - [ ] vite.config.ts has `base: './'`
218
+ - [ ] index.html has no-cache meta tags (see cache-busting section)
219
+ - [ ] node_modules exists (dependencies installed)
220
+ - [ ] After publish: verify URL auto-updated to production format (check with `list_apps`)
221
+ </checklist>