@output.ai/cli 0.5.6 → 0.7.0
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.
- package/README.md +1 -0
- package/dist/api/generated/api.d.ts +25 -0
- package/dist/api/generated/api.js +11 -0
- package/dist/commands/agents/init.d.ts +0 -1
- package/dist/commands/agents/init.js +9 -16
- package/dist/commands/agents/init.spec.js +49 -224
- package/dist/commands/workflow/generate.js +2 -2
- package/dist/commands/workflow/plan.js +3 -3
- package/dist/commands/workflow/plan.spec.js +13 -13
- package/dist/commands/workflow/terminate.d.ts +13 -0
- package/dist/commands/workflow/terminate.js +39 -0
- package/dist/services/claude_client.d.ts +4 -4
- package/dist/services/claude_client.integration.test.js +2 -2
- package/dist/services/claude_client.js +7 -7
- package/dist/services/claude_client.spec.js +3 -3
- package/dist/services/coding_agents.d.ts +10 -24
- package/dist/services/coding_agents.js +112 -368
- package/dist/services/coding_agents.spec.js +101 -290
- package/dist/services/project_scaffold.js +3 -3
- package/dist/services/workflow_builder.d.ts +1 -1
- package/dist/services/workflow_builder.js +1 -1
- package/dist/services/workflow_planner.js +5 -3
- package/dist/services/workflow_planner.spec.js +4 -5
- package/dist/templates/agent_instructions/dotclaude/settings.json.template +29 -0
- package/dist/templates/agent_instructions/{AGENTS.md.template → dotoutputai/AGENTS.md.template} +12 -10
- package/dist/utils/claude.d.ts +5 -0
- package/dist/utils/claude.js +19 -0
- package/dist/utils/claude.spec.d.ts +1 -0
- package/dist/utils/claude.spec.js +119 -0
- package/dist/utils/paths.d.ts +0 -4
- package/dist/utils/paths.js +0 -6
- package/package.json +3 -3
- package/dist/templates/agent_instructions/agents/workflow_context_fetcher.md.template +0 -82
- package/dist/templates/agent_instructions/agents/workflow_debugger.md.template +0 -98
- package/dist/templates/agent_instructions/agents/workflow_planner.md.template +0 -113
- package/dist/templates/agent_instructions/agents/workflow_prompt_writer.md.template +0 -595
- package/dist/templates/agent_instructions/agents/workflow_quality.md.template +0 -244
- package/dist/templates/agent_instructions/commands/build_workflow.md.template +0 -290
- package/dist/templates/agent_instructions/commands/debug_workflow.md.template +0 -198
- package/dist/templates/agent_instructions/commands/plan_workflow.md.template +0 -261
- package/dist/templates/agent_instructions/meta/post_flight.md.template +0 -94
- package/dist/templates/agent_instructions/meta/pre_flight.md.template +0 -60
- package/dist/templates/agent_instructions/skills/output-error-direct-io/SKILL.md.template +0 -249
- package/dist/templates/agent_instructions/skills/output-error-http-client/SKILL.md.template +0 -298
- package/dist/templates/agent_instructions/skills/output-error-missing-schemas/SKILL.md.template +0 -265
- package/dist/templates/agent_instructions/skills/output-error-nondeterminism/SKILL.md.template +0 -252
- package/dist/templates/agent_instructions/skills/output-error-try-catch/SKILL.md.template +0 -226
- package/dist/templates/agent_instructions/skills/output-error-zod-import/SKILL.md.template +0 -209
- package/dist/templates/agent_instructions/skills/output-services-check/SKILL.md.template +0 -128
- package/dist/templates/agent_instructions/skills/output-workflow-list/SKILL.md.template +0 -117
- package/dist/templates/agent_instructions/skills/output-workflow-result/SKILL.md.template +0 -199
- package/dist/templates/agent_instructions/skills/output-workflow-run/SKILL.md.template +0 -228
- package/dist/templates/agent_instructions/skills/output-workflow-runs-list/SKILL.md.template +0 -141
- package/dist/templates/agent_instructions/skills/output-workflow-start/SKILL.md.template +0 -201
- package/dist/templates/agent_instructions/skills/output-workflow-status/SKILL.md.template +0 -151
- package/dist/templates/agent_instructions/skills/output-workflow-stop/SKILL.md.template +0 -164
- package/dist/templates/agent_instructions/skills/output-workflow-trace/SKILL.md.template +0 -134
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: output-error-try-catch
|
|
3
|
-
description: Fix try-catch anti-pattern in Output SDK workflows. Use when retries aren't working, errors are being swallowed, seeing unexpected FatalError wrapping, or when step failures don't trigger retry policies.
|
|
4
|
-
allowed-tools: [Bash, Read]
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Fix Try-Catch Anti-Pattern
|
|
8
|
-
|
|
9
|
-
## Overview
|
|
10
|
-
|
|
11
|
-
This skill helps diagnose and fix a common anti-pattern where step calls are wrapped in try-catch blocks. This prevents Output SDK's retry mechanism from working properly and can lead to confusing error behavior.
|
|
12
|
-
|
|
13
|
-
## When to Use This Skill
|
|
14
|
-
|
|
15
|
-
You're seeing:
|
|
16
|
-
- Retries not working as expected
|
|
17
|
-
- Errors being swallowed silently
|
|
18
|
-
- Unexpected FatalError wrapping
|
|
19
|
-
- Step failures not triggering retry policies
|
|
20
|
-
- Errors being caught and re-thrown incorrectly
|
|
21
|
-
|
|
22
|
-
## Root Cause
|
|
23
|
-
|
|
24
|
-
When you wrap step calls in try-catch blocks, you intercept errors before the Output SDK retry mechanism can handle them. This defeats the built-in retry logic and can cause:
|
|
25
|
-
|
|
26
|
-
1. **Retries not happening**: The error is caught, so the framework doesn't know to retry
|
|
27
|
-
2. **Wrong error classification**: Re-throwing as FatalError prevents retries entirely
|
|
28
|
-
3. **Lost error context**: Original error details may be lost in the catch block
|
|
29
|
-
|
|
30
|
-
## Symptoms
|
|
31
|
-
|
|
32
|
-
### Pattern 1: Errors Swallowed
|
|
33
|
-
|
|
34
|
-
```typescript
|
|
35
|
-
// WRONG: Error is silently ignored
|
|
36
|
-
try {
|
|
37
|
-
const result = await myStep(input);
|
|
38
|
-
} catch (error) {
|
|
39
|
-
console.log('Step failed'); // Swallowed!
|
|
40
|
-
return { success: false };
|
|
41
|
-
}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### Pattern 2: FatalError Wrapping
|
|
45
|
-
|
|
46
|
-
```typescript
|
|
47
|
-
// WRONG: Turns retryable errors into fatal errors
|
|
48
|
-
try {
|
|
49
|
-
const result = await myStep(input);
|
|
50
|
-
} catch (error) {
|
|
51
|
-
throw new FatalError(error.message); // Prevents retries!
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Pattern 3: Re-throwing Generic Errors
|
|
56
|
-
|
|
57
|
-
```typescript
|
|
58
|
-
// WRONG: Loses error context and may affect retry behavior
|
|
59
|
-
try {
|
|
60
|
-
const result = await myStep(input);
|
|
61
|
-
} catch (error) {
|
|
62
|
-
throw new Error(`Step failed: ${error.message}`);
|
|
63
|
-
}
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Solution
|
|
67
|
-
|
|
68
|
-
**Let failures propagate naturally.** Remove try-catch blocks around step calls and let the Output SDK handle errors:
|
|
69
|
-
|
|
70
|
-
### Before (Wrong)
|
|
71
|
-
|
|
72
|
-
```typescript
|
|
73
|
-
export default workflow({
|
|
74
|
-
fn: async (input) => {
|
|
75
|
-
try {
|
|
76
|
-
const data = await fetchDataStep(input);
|
|
77
|
-
const result = await processDataStep(data);
|
|
78
|
-
return result;
|
|
79
|
-
} catch (error) {
|
|
80
|
-
throw new FatalError(error.message);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### After (Correct)
|
|
87
|
-
|
|
88
|
-
```typescript
|
|
89
|
-
export default workflow({
|
|
90
|
-
fn: async (input) => {
|
|
91
|
-
const data = await fetchDataStep(input);
|
|
92
|
-
const result = await processDataStep(data);
|
|
93
|
-
return result;
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## When Try-Catch IS Appropriate
|
|
99
|
-
|
|
100
|
-
There are limited cases where catching errors in workflows is valid:
|
|
101
|
-
|
|
102
|
-
### 1. Optional/Fallback Steps
|
|
103
|
-
|
|
104
|
-
When a step failure should trigger an alternative path:
|
|
105
|
-
|
|
106
|
-
```typescript
|
|
107
|
-
export default workflow({
|
|
108
|
-
fn: async (input) => {
|
|
109
|
-
let data;
|
|
110
|
-
try {
|
|
111
|
-
data = await fetchFromPrimarySource(input);
|
|
112
|
-
} catch {
|
|
113
|
-
// Fallback to secondary source
|
|
114
|
-
data = await fetchFromSecondarySource(input);
|
|
115
|
-
}
|
|
116
|
-
return await processData(data);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### 2. Aggregate Results with Partial Failures
|
|
122
|
-
|
|
123
|
-
When processing multiple items where some may fail:
|
|
124
|
-
|
|
125
|
-
```typescript
|
|
126
|
-
export default workflow({
|
|
127
|
-
fn: async (input) => {
|
|
128
|
-
const results = [];
|
|
129
|
-
for (const item of input.items) {
|
|
130
|
-
try {
|
|
131
|
-
const result = await processItem(item);
|
|
132
|
-
results.push({ item, result, success: true });
|
|
133
|
-
} catch (error) {
|
|
134
|
-
results.push({ item, error: error.message, success: false });
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return results; // Contains both successes and failures
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
**Note**: Even in these cases, be careful not to swallow errors that should cause the whole workflow to fail.
|
|
143
|
-
|
|
144
|
-
## Finding Try-Catch Around Steps
|
|
145
|
-
|
|
146
|
-
Search for the pattern:
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
# Find try blocks in workflow files
|
|
150
|
-
grep -rn "try {" src/workflows/
|
|
151
|
-
|
|
152
|
-
# Look for FatalError usage
|
|
153
|
-
grep -rn "FatalError" src/workflows/
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
Then review each match to see if it's wrapping step calls.
|
|
157
|
-
|
|
158
|
-
## How Retries Work
|
|
159
|
-
|
|
160
|
-
When you DON'T catch errors:
|
|
161
|
-
|
|
162
|
-
1. Step throws an error
|
|
163
|
-
2. Output SDK receives the error
|
|
164
|
-
3. SDK checks retry policy (configured per step)
|
|
165
|
-
4. If retries remain, step is re-executed
|
|
166
|
-
5. If retries exhausted, workflow fails with full error context
|
|
167
|
-
|
|
168
|
-
When you DO catch errors:
|
|
169
|
-
|
|
170
|
-
1. Step throws an error
|
|
171
|
-
2. Your catch block handles it
|
|
172
|
-
3. Output SDK never sees the original error
|
|
173
|
-
4. Retry logic is bypassed
|
|
174
|
-
5. You control what happens (often incorrectly)
|
|
175
|
-
|
|
176
|
-
## Configuring Retry Behavior
|
|
177
|
-
|
|
178
|
-
Instead of try-catch, configure retry policies on steps:
|
|
179
|
-
|
|
180
|
-
```typescript
|
|
181
|
-
export const fetchData = step({
|
|
182
|
-
name: 'fetchData',
|
|
183
|
-
retry: {
|
|
184
|
-
maxAttempts: 3,
|
|
185
|
-
initialInterval: '1s',
|
|
186
|
-
maxInterval: '30s',
|
|
187
|
-
backoffCoefficient: 2
|
|
188
|
-
},
|
|
189
|
-
fn: async (input) => {
|
|
190
|
-
// If this fails, it will be retried according to policy
|
|
191
|
-
return await callApi(input);
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
## Using FatalError Correctly
|
|
197
|
-
|
|
198
|
-
FatalError is for errors that should NEVER be retried:
|
|
199
|
-
|
|
200
|
-
```typescript
|
|
201
|
-
export const validateInput = step({
|
|
202
|
-
name: 'validateInput',
|
|
203
|
-
fn: async (input) => {
|
|
204
|
-
if (!input.userId) {
|
|
205
|
-
// This will never succeed on retry
|
|
206
|
-
throw new FatalError('userId is required');
|
|
207
|
-
}
|
|
208
|
-
return input;
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
Do NOT use FatalError to wrap other errors unless you're certain they shouldn't retry.
|
|
214
|
-
|
|
215
|
-
## Verification
|
|
216
|
-
|
|
217
|
-
After removing try-catch:
|
|
218
|
-
|
|
219
|
-
1. **Test normal operation**: `npx output workflow run <name> '<valid-input>'`
|
|
220
|
-
2. **Test failure scenarios**: Use input that causes step failures
|
|
221
|
-
3. **Check retry behavior**: Look for retry attempts in `npx output workflow debug <id>`
|
|
222
|
-
|
|
223
|
-
## Related Issues
|
|
224
|
-
|
|
225
|
-
- For configuring retry policies, see step definition documentation
|
|
226
|
-
- For handling expected failures gracefully, consider using conditional logic instead of try-catch
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: output-error-zod-import
|
|
3
|
-
description: Fix Zod schema import issues in Output SDK workflows. Use when seeing "incompatible schema" errors, type errors at step boundaries, schema validation failures, or when schemas don't match between steps.
|
|
4
|
-
allowed-tools: [Bash, Read]
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Fix Zod Import Source Issues
|
|
8
|
-
|
|
9
|
-
## Overview
|
|
10
|
-
|
|
11
|
-
This skill helps diagnose and fix a common issue where Zod schemas are imported from the wrong source. Output SDK requires schemas to be imported from `@output.ai/core`, not directly from `zod`.
|
|
12
|
-
|
|
13
|
-
## When to Use This Skill
|
|
14
|
-
|
|
15
|
-
You're seeing:
|
|
16
|
-
- "incompatible schema" errors
|
|
17
|
-
- Type errors at step boundaries
|
|
18
|
-
- Schema validation failures when passing data between steps
|
|
19
|
-
- Errors mentioning Zod types not matching
|
|
20
|
-
- "Expected ZodObject but received..." errors
|
|
21
|
-
|
|
22
|
-
## Root Cause
|
|
23
|
-
|
|
24
|
-
The issue occurs when you import `z` from `zod` instead of `@output.ai/core`. While both provide Zod schemas, they create different schema instances that aren't compatible with each other within the Output SDK context.
|
|
25
|
-
|
|
26
|
-
**Why this matters**: Output SDK uses a specific version of Zod internally for serialization and validation. When you use a different Zod instance, the schemas are technically different objects even if they define the same shape.
|
|
27
|
-
|
|
28
|
-
## Symptoms
|
|
29
|
-
|
|
30
|
-
### Error Messages
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
Error: Incompatible schema types
|
|
34
|
-
Error: Schema validation failed: expected compatible Zod instance
|
|
35
|
-
TypeError: Cannot read property 'parse' of undefined
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Code Patterns That Cause This
|
|
39
|
-
|
|
40
|
-
```typescript
|
|
41
|
-
// WRONG: Importing from 'zod' directly
|
|
42
|
-
import { z } from 'zod';
|
|
43
|
-
|
|
44
|
-
const inputSchema = z.object({
|
|
45
|
-
name: z.string(),
|
|
46
|
-
});
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Solution
|
|
50
|
-
|
|
51
|
-
### Step 1: Find All Zod Imports
|
|
52
|
-
|
|
53
|
-
Search your codebase for incorrect imports:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
grep -r "from 'zod'" src/
|
|
57
|
-
grep -r 'from "zod"' src/
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
### Step 2: Update Imports
|
|
61
|
-
|
|
62
|
-
Change all imports from:
|
|
63
|
-
|
|
64
|
-
```typescript
|
|
65
|
-
// Wrong
|
|
66
|
-
import { z } from 'zod';
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
To:
|
|
70
|
-
|
|
71
|
-
```typescript
|
|
72
|
-
// Correct
|
|
73
|
-
import { z } from '@output.ai/core';
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Step 3: Verify No Direct Zod Dependencies
|
|
77
|
-
|
|
78
|
-
Check your imports don't accidentally use zod elsewhere:
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
grep -r "import.*zod" src/
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
All matches should show `@output.ai/core`, not `zod`.
|
|
85
|
-
|
|
86
|
-
## Complete Example
|
|
87
|
-
|
|
88
|
-
### Before (Wrong)
|
|
89
|
-
|
|
90
|
-
```typescript
|
|
91
|
-
// src/workflows/my-workflow/steps/process.ts
|
|
92
|
-
import { z } from 'zod'; // Wrong!
|
|
93
|
-
import { step } from '@output.ai/core';
|
|
94
|
-
|
|
95
|
-
export const processStep = step({
|
|
96
|
-
name: 'processData',
|
|
97
|
-
inputSchema: z.object({
|
|
98
|
-
id: z.string(),
|
|
99
|
-
}),
|
|
100
|
-
outputSchema: z.object({
|
|
101
|
-
result: z.string(),
|
|
102
|
-
}),
|
|
103
|
-
fn: async (input) => {
|
|
104
|
-
return { result: `Processed ${input.id}` };
|
|
105
|
-
},
|
|
106
|
-
});
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### After (Correct)
|
|
110
|
-
|
|
111
|
-
```typescript
|
|
112
|
-
// src/workflows/my-workflow/steps/process.ts
|
|
113
|
-
import { z, step } from '@output.ai/core'; // Correct!
|
|
114
|
-
|
|
115
|
-
export const processStep = step({
|
|
116
|
-
name: 'processData',
|
|
117
|
-
inputSchema: z.object({
|
|
118
|
-
id: z.string(),
|
|
119
|
-
}),
|
|
120
|
-
outputSchema: z.object({
|
|
121
|
-
result: z.string(),
|
|
122
|
-
}),
|
|
123
|
-
fn: async (input) => {
|
|
124
|
-
return { result: `Processed ${input.id}` };
|
|
125
|
-
},
|
|
126
|
-
});
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
## Verification Steps
|
|
130
|
-
|
|
131
|
-
### 1. Check for remaining wrong imports
|
|
132
|
-
|
|
133
|
-
```bash
|
|
134
|
-
# Should return no results
|
|
135
|
-
grep -r "from 'zod'" src/
|
|
136
|
-
grep -r 'from "zod"' src/
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### 2. Build the project
|
|
140
|
-
|
|
141
|
-
```bash
|
|
142
|
-
npm run output:workflow:build
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### 3. Run the workflow
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
npx output workflow run <workflowName> '<input>'
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
## Prevention
|
|
152
|
-
|
|
153
|
-
### ESLint Rule (if using ESLint)
|
|
154
|
-
|
|
155
|
-
Add a rule to prevent direct zod imports:
|
|
156
|
-
|
|
157
|
-
```javascript
|
|
158
|
-
// .eslintrc.js
|
|
159
|
-
module.exports = {
|
|
160
|
-
rules: {
|
|
161
|
-
'no-restricted-imports': ['error', {
|
|
162
|
-
paths: [{
|
|
163
|
-
name: 'zod',
|
|
164
|
-
message: "Import { z } from '@output.ai/core' instead of 'zod'"
|
|
165
|
-
}]
|
|
166
|
-
}]
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### IDE Settings
|
|
172
|
-
|
|
173
|
-
Configure your editor to auto-import from `@output.ai/core`:
|
|
174
|
-
|
|
175
|
-
For VS Code, add to settings.json:
|
|
176
|
-
```json
|
|
177
|
-
{
|
|
178
|
-
"typescript.preferences.autoImportFileExcludePatterns": ["zod"]
|
|
179
|
-
}
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
## Common Gotchas
|
|
183
|
-
|
|
184
|
-
### Mixed Imports in Same File
|
|
185
|
-
Even one wrong import can cause issues:
|
|
186
|
-
```typescript
|
|
187
|
-
import { z } from '@output.ai/core';
|
|
188
|
-
import { z as zod } from 'zod'; // This causes problems!
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
### Indirect Dependencies
|
|
192
|
-
If a utility file uses the wrong import and is shared:
|
|
193
|
-
```typescript
|
|
194
|
-
// utils/schemas.ts
|
|
195
|
-
import { z } from 'zod'; // Wrong! This affects all files using these schemas
|
|
196
|
-
export const idSchema = z.string().uuid();
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
### Third-Party Libraries
|
|
200
|
-
If using external Zod schemas, you may need to recreate them:
|
|
201
|
-
```typescript
|
|
202
|
-
// Don't use: externalLibrary.schema
|
|
203
|
-
// Instead: recreate the schema with @output.ai/core's z
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
## Related Issues
|
|
207
|
-
|
|
208
|
-
- If schemas are correct but you still see type errors, check `output-error-missing-schemas`
|
|
209
|
-
- For validation failures with correct imports, verify schema definitions match actual data
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: output-services-check
|
|
3
|
-
description: Verify Output SDK development services are running. Use when debugging workflows, starting development, encountering connection errors, services may be down, or when you see "ECONNREFUSED" or timeout errors.
|
|
4
|
-
allowed-tools: [Bash, Read]
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Output Services Health Check
|
|
8
|
-
|
|
9
|
-
## Overview
|
|
10
|
-
|
|
11
|
-
This skill verifies that all required Output SDK development services are running and healthy. The Output SDK requires three services for local development: Docker containers, the API server, and the Temporal server with its UI.
|
|
12
|
-
|
|
13
|
-
## When to Use This Skill
|
|
14
|
-
|
|
15
|
-
- Starting a debugging session
|
|
16
|
-
- Encountering connection refused errors (ECONNREFUSED)
|
|
17
|
-
- Workflows failing to start or connect
|
|
18
|
-
- Timeout errors when running workflows
|
|
19
|
-
- Before running any workflow commands
|
|
20
|
-
- When the development environment seems unresponsive
|
|
21
|
-
|
|
22
|
-
## Instructions
|
|
23
|
-
|
|
24
|
-
### Step 1: Check Docker Containers
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
docker ps | grep output
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
**Expected**: You should see containers related to `output` running. If no containers appear, Docker may not be running or the services haven't been started.
|
|
31
|
-
|
|
32
|
-
### Step 2: Check API Server Health
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
curl -s http://localhost:3001/health
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
**Expected**: Returns a health status response. If this fails with "Connection refused", the API server is not running.
|
|
39
|
-
|
|
40
|
-
### Step 3: Check Temporal UI Accessibility
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
curl -s http://localhost:8080 > /dev/null && echo "Temporal UI accessible" || echo "Temporal UI not accessible"
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
**Expected**: "Temporal UI accessible". If not accessible, Temporal server may not be running.
|
|
47
|
-
|
|
48
|
-
## Remediation Steps
|
|
49
|
-
|
|
50
|
-
### If Docker is not running:
|
|
51
|
-
1. Start Docker Desktop (macOS/Windows) or the Docker daemon (Linux)
|
|
52
|
-
2. Wait for Docker to fully initialize
|
|
53
|
-
3. Re-run the checks
|
|
54
|
-
|
|
55
|
-
### If services are not running:
|
|
56
|
-
```bash
|
|
57
|
-
# Start all development services
|
|
58
|
-
npx output dev
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Wait 30-60 seconds for all services to initialize, then re-run the checks.
|
|
62
|
-
|
|
63
|
-
### If only some services are down:
|
|
64
|
-
```bash
|
|
65
|
-
# Restart all services using Docker Compose
|
|
66
|
-
docker compose down
|
|
67
|
-
docker compose up -d
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### If services fail to start:
|
|
71
|
-
1. Check for port conflicts: `lsof -i :3001` and `lsof -i :8080`
|
|
72
|
-
2. Check Docker logs: `docker compose logs`
|
|
73
|
-
3. Ensure you have sufficient system resources (memory, disk space)
|
|
74
|
-
|
|
75
|
-
## Decision Tree
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
IF docker_not_running:
|
|
79
|
-
ACTION: Start Docker Desktop/daemon
|
|
80
|
-
WAIT: for Docker to initialize
|
|
81
|
-
|
|
82
|
-
IF no_output_containers:
|
|
83
|
-
RUN: npx output dev
|
|
84
|
-
WAIT: 30-60 seconds for services
|
|
85
|
-
|
|
86
|
-
IF api_not_responding:
|
|
87
|
-
CHECK: port 3001 for conflicts
|
|
88
|
-
RUN: output dev (if not already running)
|
|
89
|
-
|
|
90
|
-
IF temporal_not_accessible:
|
|
91
|
-
CHECK: port 8080 for conflicts
|
|
92
|
-
CHECK: docker compose logs for Temporal errors
|
|
93
|
-
|
|
94
|
-
IF all_services_healthy:
|
|
95
|
-
PROCEED: with workflow debugging
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## Examples
|
|
99
|
-
|
|
100
|
-
**Scenario**: User reports "connection refused" when running a workflow
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
# First, check if services are running
|
|
104
|
-
docker ps | grep output
|
|
105
|
-
# Output: (empty - no containers)
|
|
106
|
-
|
|
107
|
-
# Start services
|
|
108
|
-
npx output dev
|
|
109
|
-
|
|
110
|
-
# Wait and verify
|
|
111
|
-
sleep 60
|
|
112
|
-
curl -s http://localhost:3001/health
|
|
113
|
-
# Output: {"status":"healthy"}
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
**Scenario**: Partial service failure
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
# API responds but Temporal doesn't
|
|
120
|
-
curl -s http://localhost:3001/health # Works
|
|
121
|
-
curl -s http://localhost:8080 # Fails
|
|
122
|
-
|
|
123
|
-
# Check Temporal logs
|
|
124
|
-
docker compose logs temporal
|
|
125
|
-
|
|
126
|
-
# Restart just Temporal
|
|
127
|
-
docker compose restart temporal
|
|
128
|
-
```
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: output-workflow-list
|
|
3
|
-
description: List all available Output SDK workflows in the project. Use when discovering what workflows exist, checking workflow names, exploring the project's workflow structure, or when unsure which workflows are available to run.
|
|
4
|
-
allowed-tools: [Bash]
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# List Available Workflows
|
|
8
|
-
|
|
9
|
-
## Overview
|
|
10
|
-
|
|
11
|
-
This skill helps you discover all available workflows in an Output SDK project. Workflows are the main execution units that orchestrate steps to accomplish tasks.
|
|
12
|
-
|
|
13
|
-
## When to Use This Skill
|
|
14
|
-
|
|
15
|
-
- Discovering what workflows exist in a project
|
|
16
|
-
- Verifying a workflow name before running it
|
|
17
|
-
- Exploring a new or unfamiliar codebase
|
|
18
|
-
- Checking if a specific workflow has been created
|
|
19
|
-
- Getting an overview of project capabilities
|
|
20
|
-
|
|
21
|
-
## Instructions
|
|
22
|
-
|
|
23
|
-
### List All Workflows
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
npx output workflow list
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
This command scans the project and displays all available workflows.
|
|
30
|
-
|
|
31
|
-
### Understanding the Output
|
|
32
|
-
|
|
33
|
-
The command outputs a table with workflow information:
|
|
34
|
-
|
|
35
|
-
| Column | Description |
|
|
36
|
-
|--------|-------------|
|
|
37
|
-
| Name | The workflow identifier used in commands |
|
|
38
|
-
| Description | Brief description of what the workflow does |
|
|
39
|
-
| Location | File path where the workflow is defined |
|
|
40
|
-
|
|
41
|
-
### Finding Workflow Files
|
|
42
|
-
|
|
43
|
-
Workflows are typically located in:
|
|
44
|
-
```
|
|
45
|
-
src/workflows/*/
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Each workflow directory usually contains:
|
|
49
|
-
- `workflow.ts` or `index.ts` - The main workflow definition
|
|
50
|
-
- Step files - Individual steps used by the workflow
|
|
51
|
-
- Schema files - Input/output type definitions
|
|
52
|
-
|
|
53
|
-
### Inspecting a Workflow
|
|
54
|
-
|
|
55
|
-
After finding a workflow, you can examine its code:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
# Read the workflow file
|
|
59
|
-
cat src/workflows/<workflowName>/workflow.ts
|
|
60
|
-
|
|
61
|
-
# Or examine the entire workflow directory
|
|
62
|
-
ls -la src/workflows/<workflowName>/
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Examples
|
|
66
|
-
|
|
67
|
-
**Scenario**: Discover available workflows in a project
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
npx output workflow list
|
|
71
|
-
|
|
72
|
-
# Example output:
|
|
73
|
-
# Name Description Location
|
|
74
|
-
# ----------- --------------------------- --------------------------------
|
|
75
|
-
# simple Simple workflow example src/workflows/simple/workflow.ts
|
|
76
|
-
# data-pipeline Process and transform data src/workflows/data-pipeline/workflow.ts
|
|
77
|
-
# user-signup Handle user registration src/workflows/user-signup/workflow.ts
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
**Scenario**: Verify a workflow exists before running
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
# Check if "email-sender" workflow exists
|
|
84
|
-
npx output workflow list | grep email-sender
|
|
85
|
-
|
|
86
|
-
# If no output, the workflow doesn't exist
|
|
87
|
-
# If found, proceed with running it
|
|
88
|
-
npx output workflow run email-sender '{"to": "user@example.com"}'
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
**Scenario**: Explore workflow implementation
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
# List workflows
|
|
95
|
-
npx output workflow list
|
|
96
|
-
|
|
97
|
-
# Find the location and examine it
|
|
98
|
-
cat src/workflows/simple/workflow.ts
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
## Troubleshooting
|
|
102
|
-
|
|
103
|
-
### No workflows found
|
|
104
|
-
- Ensure you're in the project root directory
|
|
105
|
-
- Check that workflows are in `src/workflows/*/`
|
|
106
|
-
- Verify workflow files export a default workflow
|
|
107
|
-
|
|
108
|
-
### Workflow not showing
|
|
109
|
-
- Check the file exports a valid workflow definition
|
|
110
|
-
- Ensure the workflow file compiles without errors
|
|
111
|
-
- Run `npm run output:workflow:build` to check for TypeScript errors
|
|
112
|
-
|
|
113
|
-
## Related Commands
|
|
114
|
-
|
|
115
|
-
- `npx output workflow run <name>` - Execute a workflow synchronously
|
|
116
|
-
- `npx output workflow start <name>` - Start a workflow asynchronously
|
|
117
|
-
- `npx output workflow runs list` - View execution history
|