@output.ai/cli 0.4.2 → 0.5.1

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 (31) hide show
  1. package/README.md +6 -8
  2. package/dist/assets/docker/docker-compose-dev.yml +9 -1
  3. package/dist/services/coding_agents.js +180 -8
  4. package/dist/services/coding_agents.spec.js +54 -11
  5. package/dist/templates/agent_instructions/AGENTS.md.template +20 -14
  6. package/dist/templates/agent_instructions/agents/{context_fetcher.md.template → workflow_context_fetcher.md.template} +1 -1
  7. package/dist/templates/agent_instructions/agents/workflow_debugger.md.template +98 -0
  8. package/dist/templates/agent_instructions/agents/workflow_planner.md.template +3 -3
  9. package/dist/templates/agent_instructions/agents/{prompt_writer.md.template → workflow_prompt_writer.md.template} +1 -1
  10. package/dist/templates/agent_instructions/agents/workflow_quality.md.template +2 -2
  11. package/dist/templates/agent_instructions/commands/build_workflow.md.template +2 -2
  12. package/dist/templates/agent_instructions/commands/debug_workflow.md.template +198 -0
  13. package/dist/templates/agent_instructions/commands/plan_workflow.md.template +3 -3
  14. package/dist/templates/agent_instructions/skills/output-error-direct-io/SKILL.md.template +249 -0
  15. package/dist/templates/agent_instructions/skills/output-error-http-client/SKILL.md.template +298 -0
  16. package/dist/templates/agent_instructions/skills/output-error-missing-schemas/SKILL.md.template +265 -0
  17. package/dist/templates/agent_instructions/skills/output-error-nondeterminism/SKILL.md.template +252 -0
  18. package/dist/templates/agent_instructions/skills/output-error-try-catch/SKILL.md.template +226 -0
  19. package/dist/templates/agent_instructions/skills/output-error-zod-import/SKILL.md.template +209 -0
  20. package/dist/templates/agent_instructions/skills/output-services-check/SKILL.md.template +128 -0
  21. package/dist/templates/agent_instructions/skills/output-workflow-list/SKILL.md.template +117 -0
  22. package/dist/templates/agent_instructions/skills/output-workflow-result/SKILL.md.template +199 -0
  23. package/dist/templates/agent_instructions/skills/output-workflow-run/SKILL.md.template +228 -0
  24. package/dist/templates/agent_instructions/skills/output-workflow-runs-list/SKILL.md.template +141 -0
  25. package/dist/templates/agent_instructions/skills/output-workflow-start/SKILL.md.template +201 -0
  26. package/dist/templates/agent_instructions/skills/output-workflow-status/SKILL.md.template +151 -0
  27. package/dist/templates/agent_instructions/skills/output-workflow-stop/SKILL.md.template +164 -0
  28. package/dist/templates/agent_instructions/skills/output-workflow-trace/SKILL.md.template +134 -0
  29. package/dist/templates/project/README.md.template +2 -2
  30. package/dist/templates/project/package.json.template +3 -2
  31. package/package.json +1 -1
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: output-workflow-trace
3
+ description: Analyze Output SDK workflow execution traces. Use when debugging a specific workflow, examining step failures, analyzing input/output data, understanding execution flow, or when you have a workflow ID to investigate.
4
+ allowed-tools: [Bash, Read]
5
+ ---
6
+
7
+ # Workflow Trace Analysis
8
+
9
+ ## Overview
10
+
11
+ This skill provides guidance on retrieving and analyzing workflow execution traces using the Output CLI. Traces show the complete execution history including step inputs, outputs, errors, and timing information.
12
+
13
+ ## When to Use This Skill
14
+
15
+ - You have a workflow ID and need to understand what happened
16
+ - A workflow failed and you need to identify which step failed
17
+ - You need to examine the input/output data at each step
18
+ - You want to understand the execution flow and timing
19
+ - You need to find error messages and stack traces
20
+ - Debugging retry behavior or unexpected results
21
+
22
+ ## Instructions
23
+
24
+ ### Step 1: Retrieve the Execution Trace
25
+
26
+ **Basic trace (text format, may be truncated):**
27
+ ```bash
28
+ npx output workflow debug <workflowId>
29
+ ```
30
+
31
+ **Full trace (JSON format, recommended for detailed analysis):**
32
+ ```bash
33
+ npx output workflow debug <workflowId> --format json
34
+ ```
35
+
36
+ **Tip**: Always use `--format json` when you need complete trace data. The text format truncates long values which can hide important debugging information.
37
+
38
+ ### Step 2: Analyze the Trace
39
+
40
+ Follow this checklist when examining a trace:
41
+
42
+ 1. **Identify the failed step**: Look for steps with error status or failure indicators
43
+ 2. **Examine error messages**: Find the exact error message and stack trace
44
+ 3. **Check step inputs**: Verify the data passed to the failing step was correct
45
+ 4. **Check step outputs**: Look at outputs from preceding steps
46
+ 5. **Review retry attempts**: Note how many retries occurred and their outcomes
47
+ 6. **Check timing**: Look for unusual delays that might indicate timeouts
48
+
49
+ ### Step 3: Use the Temporal UI for Visual Analysis
50
+
51
+ Open **http://localhost:8080** in your browser for a visual workflow inspection:
52
+
53
+ 1. Search for your workflow by ID
54
+ 2. View the event history timeline
55
+ 3. Click on individual events to see details
56
+ 4. Inspect step inputs and outputs
57
+ 5. See retry attempts and timing information
58
+ 6. Export trace data if needed
59
+
60
+ ## What to Look For in Traces
61
+
62
+ ### Error Patterns
63
+
64
+ | Error Message | Likely Cause |
65
+ |---------------|--------------|
66
+ | "incompatible schema" | Zod import issue - using `zod` instead of `@output.ai/core` |
67
+ | "non-deterministic" | Using Math.random(), Date.now(), etc. in workflow code |
68
+ | "FatalError" with retry context | Try-catch wrapping step calls |
69
+ | "undefined is not a function" | Missing schema definitions |
70
+ | "workflow must be deterministic" | Direct I/O in workflow function |
71
+ | "ECONNREFUSED" or timeout | Services not running or network issues |
72
+
73
+ ### Step Status Values
74
+
75
+ - **COMPLETED**: Step finished successfully
76
+ - **FAILED**: Step threw an error (may retry)
77
+ - **RETRYING**: Step is being retried after a failure
78
+ - **TIMED_OUT**: Step exceeded its timeout
79
+ - **CANCELLED**: Workflow was stopped before step completed
80
+
81
+ ### Key Trace Fields
82
+
83
+ When examining JSON traces, focus on these fields:
84
+
85
+ - `steps[].name`: Step identifier
86
+ - `steps[].status`: Execution result
87
+ - `steps[].input`: Data passed to the step
88
+ - `steps[].output`: Data returned from the step
89
+ - `steps[].error`: Error details if failed
90
+ - `steps[].attempts`: Number of execution attempts
91
+ - `steps[].duration`: How long the step took
92
+
93
+ ## Examples
94
+
95
+ **Scenario**: Debug a failed workflow
96
+
97
+ ```bash
98
+ # Get the workflow ID from runs list
99
+ npx output workflow runs list --limit 5 --format json
100
+
101
+ # Get detailed trace
102
+ npx output workflow debug abc123xyz --format json
103
+
104
+ # Look for the failing step in the output
105
+ # Example output structure:
106
+ # {
107
+ # "workflowId": "abc123xyz",
108
+ # "status": "FAILED",
109
+ # "steps": [
110
+ # { "name": "fetchData", "status": "COMPLETED", ... },
111
+ # { "name": "processData", "status": "FAILED", "error": "..." }
112
+ # ]
113
+ # }
114
+ ```
115
+
116
+ **Scenario**: Investigate retry behavior
117
+
118
+ ```bash
119
+ npx output workflow debug abc123xyz --format json | jq '.steps[] | select(.attempts > 1)'
120
+ ```
121
+
122
+ **Scenario**: Check inputs to a specific step
123
+
124
+ ```bash
125
+ npx output workflow debug abc123xyz --format json | jq '.steps[] | select(.name == "processData") | .input'
126
+ ```
127
+
128
+ ## Next Steps After Analysis
129
+
130
+ 1. Match the error to common patterns (see error skills)
131
+ 2. Consult the `workflow-quality` subagent for best practices
132
+ 3. Make code fixes based on identified issues
133
+ 4. Re-run the workflow: `npx output workflow run <workflowName> <input>`
134
+ 5. Verify the fix with a new trace
@@ -30,7 +30,7 @@ Edit `.env` to add:
30
30
  ### 3. Start Output Services
31
31
 
32
32
  ```bash
33
- npx output dev
33
+ npm run dev
34
34
  ```
35
35
 
36
36
  This starts:
@@ -49,7 +49,7 @@ npx output workflow run simple --input '{"question": "who really is ada lovelace
49
49
 
50
50
  ### 5. Stop Services
51
51
 
52
- Press `Ctrl+C` in the terminal running `output dev` to stop all services gracefully.
52
+ Press `Ctrl+C` in the terminal running `npm run dev` to stop all services gracefully.
53
53
 
54
54
  ### 6. View Logs
55
55
 
@@ -5,8 +5,9 @@
5
5
  "type": "module",
6
6
  "main": "dist/worker.js",
7
7
  "scripts": {
8
- "build": "rm -rf dist/* && tsc -p ./ && copyfiles -u 1 './src/**/*.prompt' dist",
9
- "start-worker": "npm install && npm run build && output-worker",
8
+ "output:worker:install": "npm install",
9
+ "output:worker:build": "rm -rf dist/* && tsc -p ./ && copyfiles -u 1 './src/**/*.prompt' dist",
10
+ "output:worker:start": "output-worker",
10
11
  "dev": "output dev"
11
12
  },
12
13
  "dependencies": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@output.ai/cli",
3
- "version": "0.4.2",
3
+ "version": "0.5.1",
4
4
  "description": "CLI for Output.ai workflow generation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",