@exaudeus/workrail 3.27.0 → 3.29.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/dist/console/assets/{index-FtTaDku8.js → index-BZ6HkxGf.js} +1 -1
- package/dist/console/index.html +1 -1
- package/dist/manifest.json +3 -3
- package/docs/README.md +57 -0
- package/docs/adrs/001-hybrid-storage-backend.md +38 -0
- package/docs/adrs/002-four-layer-context-classification.md +38 -0
- package/docs/adrs/003-checkpoint-trigger-strategy.md +35 -0
- package/docs/adrs/004-opt-in-encryption-strategy.md +36 -0
- package/docs/adrs/005-agent-first-workflow-execution-tokens.md +105 -0
- package/docs/adrs/006-append-only-session-run-event-log.md +76 -0
- package/docs/adrs/007-resume-and-checkpoint-only-sessions.md +51 -0
- package/docs/adrs/008-blocked-nodes-architectural-upgrade.md +178 -0
- package/docs/adrs/009-bridge-mode-single-instance-mcp.md +195 -0
- package/docs/adrs/010-release-pipeline.md +89 -0
- package/docs/architecture/README.md +7 -0
- package/docs/architecture/refactor-audit.md +364 -0
- package/docs/authoring-v2.md +527 -0
- package/docs/authoring.md +873 -0
- package/docs/changelog-recent.md +201 -0
- package/docs/configuration.md +505 -0
- package/docs/ctc-mcp-proposal.md +518 -0
- package/docs/design/README.md +22 -0
- package/docs/design/agent-cascade-protocol.md +96 -0
- package/docs/design/autonomous-console-design-candidates.md +253 -0
- package/docs/design/autonomous-console-design-review.md +111 -0
- package/docs/design/autonomous-platform-mvp-discovery.md +525 -0
- package/docs/design/claude-code-source-deep-dive.md +713 -0
- package/docs/design/console-cyberpunk-ui-discovery.md +504 -0
- package/docs/design/console-execution-trace-candidates-final.md +160 -0
- package/docs/design/console-execution-trace-candidates.md +211 -0
- package/docs/design/console-execution-trace-design-candidates-v2.md +113 -0
- package/docs/design/console-execution-trace-design-review.md +74 -0
- package/docs/design/console-execution-trace-discovery.md +394 -0
- package/docs/design/console-execution-trace-final-review.md +77 -0
- package/docs/design/console-execution-trace-review.md +92 -0
- package/docs/design/console-performance-discovery.md +415 -0
- package/docs/design/console-ui-backlog.md +280 -0
- package/docs/design/daemon-architecture-discovery.md +853 -0
- package/docs/design/daemon-design-candidates.md +318 -0
- package/docs/design/daemon-design-review-findings.md +119 -0
- package/docs/design/daemon-engine-design-candidates.md +210 -0
- package/docs/design/daemon-engine-design-review.md +131 -0
- package/docs/design/daemon-execution-engine-discovery.md +280 -0
- package/docs/design/daemon-gap-analysis.md +554 -0
- package/docs/design/daemon-owns-console-plan.md +168 -0
- package/docs/design/daemon-owns-console-review.md +91 -0
- package/docs/design/daemon-owns-console.md +195 -0
- package/docs/design/data-model-erd.md +11 -0
- package/docs/design/design-candidates-consolidate-dev-staleness.md +98 -0
- package/docs/design/design-candidates-walk-cache-depth-limit.md +80 -0
- package/docs/design/design-review-consolidate-dev-staleness.md +54 -0
- package/docs/design/design-review-walk-cache-depth-limit.md +48 -0
- package/docs/design/implementation-plan-consolidate-dev-staleness.md +142 -0
- package/docs/design/implementation-plan-walk-cache-depth-limit.md +141 -0
- package/docs/design/layer3b-ghost-nodes-design-candidates.md +229 -0
- package/docs/design/layer3b-ghost-nodes-design-review.md +93 -0
- package/docs/design/layer3b-ghost-nodes-implementation-plan.md +219 -0
- package/docs/design/list-workflows-latency-fix-plan.md +128 -0
- package/docs/design/list-workflows-latency-fix-review.md +55 -0
- package/docs/design/list-workflows-latency-fix.md +109 -0
- package/docs/design/native-context-management-api.md +11 -0
- package/docs/design/performance-sweep-2026-04.md +96 -0
- package/docs/design/routines-guide.md +219 -0
- package/docs/design/sequence-diagrams.md +11 -0
- package/docs/design/subagent-design-principles.md +220 -0
- package/docs/design/temporal-patterns-design-candidates.md +312 -0
- package/docs/design/temporal-patterns-design-review-findings.md +163 -0
- package/docs/design/test-isolation-from-config-file.md +335 -0
- package/docs/design/v2-core-design-locks.md +2746 -0
- package/docs/design/v2-lock-registry.json +734 -0
- package/docs/design/workflow-authoring-v2.md +1044 -0
- package/docs/design/workflow-docs-spec.md +218 -0
- package/docs/design/workflow-extension-points.md +687 -0
- package/docs/design/workrail-auto-trigger-system.md +359 -0
- package/docs/design/workrail-config-file-discovery.md +513 -0
- package/docs/docker.md +110 -0
- package/docs/generated/v2-lock-closure-plan.md +26 -0
- package/docs/generated/v2-lock-coverage.json +797 -0
- package/docs/generated/v2-lock-coverage.md +177 -0
- package/docs/ideas/backlog.md +3927 -0
- package/docs/ideas/design-candidates-mcp-resilience.md +208 -0
- package/docs/ideas/design-review-findings-mcp-resilience.md +119 -0
- package/docs/ideas/implementation_plan.md +249 -0
- package/docs/ideas/third-party-workflow-setup-design-thinking.md +1948 -0
- package/docs/implementation/02-architecture.md +316 -0
- package/docs/implementation/04-testing-strategy.md +124 -0
- package/docs/implementation/09-simple-workflow-guide.md +835 -0
- package/docs/implementation/13-advanced-validation-guide.md +874 -0
- package/docs/implementation/README.md +21 -0
- package/docs/integrations/claude-code.md +300 -0
- package/docs/integrations/firebender.md +315 -0
- package/docs/migration/v0.1.0.md +147 -0
- package/docs/naming-conventions.md +45 -0
- package/docs/planning/README.md +104 -0
- package/docs/planning/github-ticketing-playbook.md +195 -0
- package/docs/plans/README.md +24 -0
- package/docs/plans/agent-managed-ticketing-design.md +605 -0
- package/docs/plans/agentic-orchestration-roadmap.md +112 -0
- package/docs/plans/assessment-gates-engine-handoff.md +536 -0
- package/docs/plans/content-coherence-and-references.md +151 -0
- package/docs/plans/library-extraction-plan.md +340 -0
- package/docs/plans/mr-review-workflow-redesign.md +1451 -0
- package/docs/plans/native-context-management-epic.md +11 -0
- package/docs/plans/perf-fixes-design-candidates.md +225 -0
- package/docs/plans/perf-fixes-design-review-findings.md +61 -0
- package/docs/plans/perf-fixes-new-issues-candidates.md +264 -0
- package/docs/plans/perf-fixes-new-issues-review.md +110 -0
- package/docs/plans/prompt-fragments.md +53 -0
- package/docs/plans/ui-ux-workflow-design-candidates.md +120 -0
- package/docs/plans/ui-ux-workflow-discovery.md +100 -0
- package/docs/plans/ui-ux-workflow-review.md +48 -0
- package/docs/plans/v2-followup-enhancements.md +587 -0
- package/docs/plans/workflow-categories-candidates.md +105 -0
- package/docs/plans/workflow-categories-discovery.md +110 -0
- package/docs/plans/workflow-categories-review.md +51 -0
- package/docs/plans/workflow-discovery-model-candidates.md +94 -0
- package/docs/plans/workflow-discovery-model-discovery.md +74 -0
- package/docs/plans/workflow-discovery-model-review.md +48 -0
- package/docs/plans/workflow-source-setup-phase-1.md +245 -0
- package/docs/plans/workflow-source-setup-phase-2.md +361 -0
- package/docs/plans/workflow-staleness-detection-candidates.md +104 -0
- package/docs/plans/workflow-staleness-detection-review.md +58 -0
- package/docs/plans/workflow-staleness-detection.md +80 -0
- package/docs/plans/workflow-v2-design.md +69 -0
- package/docs/plans/workflow-v2-roadmap.md +74 -0
- package/docs/plans/workflow-validation-design.md +98 -0
- package/docs/plans/workflow-validation-roadmap.md +108 -0
- package/docs/plans/workrail-platform-vision.md +420 -0
- package/docs/reference/agent-context-cleaner-snippet.md +94 -0
- package/docs/reference/agent-context-guidance.md +140 -0
- package/docs/reference/context-optimization.md +284 -0
- package/docs/reference/example-workflow-repository-template/.github/workflows/validate.yml +125 -0
- package/docs/reference/example-workflow-repository-template/README.md +268 -0
- package/docs/reference/example-workflow-repository-template/workflows/example-workflow.json +80 -0
- package/docs/reference/external-workflow-repositories.md +916 -0
- package/docs/reference/feature-flags-architecture.md +472 -0
- package/docs/reference/feature-flags.md +349 -0
- package/docs/reference/god-tier-workflow-validation.md +272 -0
- package/docs/reference/loop-optimization.md +209 -0
- package/docs/reference/loop-validation.md +176 -0
- package/docs/reference/loops.md +465 -0
- package/docs/reference/mcp-platform-constraints.md +59 -0
- package/docs/reference/recovery.md +88 -0
- package/docs/reference/releases.md +177 -0
- package/docs/reference/troubleshooting.md +105 -0
- package/docs/reference/workflow-execution-contract.md +998 -0
- package/docs/roadmap/README.md +22 -0
- package/docs/roadmap/legacy-planning-status.md +103 -0
- package/docs/roadmap/now-next-later.md +70 -0
- package/docs/roadmap/open-work-inventory.md +389 -0
- package/docs/tickets/README.md +39 -0
- package/docs/tickets/next-up.md +76 -0
- package/docs/workflow-management.md +317 -0
- package/docs/workflow-templates.md +423 -0
- package/docs/workflow-validation.md +184 -0
- package/docs/workflows.md +254 -0
- package/package.json +3 -1
- package/spec/authoring-spec.json +61 -16
- package/workflows/workflow-for-workflows.json +252 -93
- package/workflows/workflow-for-workflows.v2.json +188 -77
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Next Up
|
|
2
|
+
|
|
3
|
+
Groomed near-term tickets. Check `docs/roadmap/now-next-later.md` first for the current priority ordering.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Ticket 1: Execution trace Layer 3b -- ghost nodes (backend required)
|
|
8
|
+
|
|
9
|
+
### What it is
|
|
10
|
+
|
|
11
|
+
Skipped steps shown in the DAG at 0.25 opacity with a `[ SKIPPED ]` badge and dashed border, so users immediately see the scale of what was bypassed without any interaction.
|
|
12
|
+
|
|
13
|
+
### Blocked on
|
|
14
|
+
|
|
15
|
+
`ConsoleDagNode` has no `stepId` field. The backend needs to either:
|
|
16
|
+
- Emit a step_id-to-position mapping in `executionTraceSummary`
|
|
17
|
+
- Or emit synthetic `skipped_step` entries as DAG nodes
|
|
18
|
+
|
|
19
|
+
Confirm whether `selected_next_step` trace refs already include skipped step IDs (check `src/v2/durable-core/domain/decision-trace-builder.ts`).
|
|
20
|
+
|
|
21
|
+
### Design reference
|
|
22
|
+
|
|
23
|
+
`docs/design/console-execution-trace-discovery.md` -- section on ghost nodes
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Ticket 2: Legacy workflow modernization -- exploration-workflow.json
|
|
28
|
+
|
|
29
|
+
### Goal
|
|
30
|
+
|
|
31
|
+
Modernize `workflows/exploration-workflow.json` to current v2/lean authoring patterns. This is the highest-priority candidate among the unmodernized workflows.
|
|
32
|
+
|
|
33
|
+
### What modernization means
|
|
34
|
+
|
|
35
|
+
- Current v2/lean structure where appropriate
|
|
36
|
+
- `metaGuidance` and `recommendedPreferences`
|
|
37
|
+
- `references` for authoritative companion material
|
|
38
|
+
- `templateCall` / routine injection instead of repeating large prompt blocks
|
|
39
|
+
- Tighter loop-control wording and evidence-oriented review structure
|
|
40
|
+
|
|
41
|
+
### Related
|
|
42
|
+
|
|
43
|
+
- `docs/roadmap/open-work-inventory.md` (full prioritized modernization list)
|
|
44
|
+
- `docs/authoring.md` (modern baseline)
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Ticket 3: Design console execution-trace explainability (Layer 3b -- ghost nodes)
|
|
49
|
+
|
|
50
|
+
### Status
|
|
51
|
+
|
|
52
|
+
Blocked on backend confirmation. `ConsoleDagNode` has no `stepId` field. The backend needs to either emit a step_id-to-position mapping or emit synthetic `skipped_step` DAG nodes before this can be built.
|
|
53
|
+
|
|
54
|
+
### What needs backend work
|
|
55
|
+
|
|
56
|
+
- Confirm whether `selected_next_step` trace refs include skipped step IDs
|
|
57
|
+
- Add `stepId` field to `ConsoleDagNode` DTO or a new `skipped_step` event kind
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Recently completed
|
|
62
|
+
|
|
63
|
+
- ~~**Ticket: Execution trace Layer 3a**~~ (done -- edge cause diamonds, loop bracket, CAUSE footer on blocked_attempt nodes, #347)
|
|
64
|
+
- ~~**Ticket: fix-multi-instance-gaps**~~ (done -- three multi-instance HttpServer safety gaps, #346)
|
|
65
|
+
- ~~**Ticket: Console execution trace Layer 1 + 2**~~ (done -- `[ TRACE ]` tab, NodeDetailSection routing sections, condition tracing, #340)
|
|
66
|
+
- ~~**Ticket: Top-level runCondition tracing**~~ (done -- `formatConditionTrace`, `traceStepRunConditionSkipped/Passed`, `nextTopLevel` emits evaluated_condition entries)
|
|
67
|
+
- ~~**Ticket: Filter chips cross-contamination**~~ (done -- `sourceFilteredWorkflows`/`tagFilteredWorkflows` in ViewModel)
|
|
68
|
+
- ~~**Ticket: Windows CI fix**~~ (done -- duplicate createFakeStdout resolved)
|
|
69
|
+
- ~~**Ticket: GitHub branch protection + pre-push hook**~~ (done -- server-side rule + .git-hooks/pre-push, #344)
|
|
70
|
+
- ~~**Ticket: Assessment-gate mr-review adoption**~~ (done -- already had assessmentRefs)
|
|
71
|
+
- ~~**Ticket: Console CPU spiral**~~ (done -- all three fixes shipped)
|
|
72
|
+
- ~~**Ticket: Console MVI architecture**~~ (done -- all 6 views, #332)
|
|
73
|
+
- ~~**Ticket: MCP server stability**~~ (done -- EPIPE, stale lock, double SIGTERM, #332 #335)
|
|
74
|
+
- ~~**Ticket: v2 sign-off and cleanup**~~ (done)
|
|
75
|
+
- ~~**Ticket: Retrieval budget strengthening**~~ (done)
|
|
76
|
+
- ~~**Ticket: Workflow-source setup phase 1**~~ (done, #160–#164)
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
# Workflow Management
|
|
2
|
+
|
|
3
|
+
WorkRail supports loading workflows from multiple directories, making it easy to use both bundled workflows and your own custom workflows simultaneously.
|
|
4
|
+
|
|
5
|
+
## Directory Priority
|
|
6
|
+
|
|
7
|
+
WorkRail loads workflows from multiple sources in the following priority order (later sources override earlier ones with the same ID):
|
|
8
|
+
|
|
9
|
+
1. **Bundled Workflows** - Pre-built workflows included with WorkRail
|
|
10
|
+
2. **User Workflows** - Your personal workflow collection (`~/.workrail/workflows`)
|
|
11
|
+
3. **Project Workflows** - Project-specific workflows (`./workflows`)
|
|
12
|
+
4. **Custom Directories** - Additional directories via environment variables
|
|
13
|
+
|
|
14
|
+
## Getting Started
|
|
15
|
+
|
|
16
|
+
### 1. Initialize User Workflow Directory
|
|
17
|
+
|
|
18
|
+
Create your personal workflow directory with a sample workflow:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
workrail init
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This creates:
|
|
25
|
+
- `~/.workrail/workflows/` directory
|
|
26
|
+
- A sample workflow file to get you started
|
|
27
|
+
- Proper directory permissions
|
|
28
|
+
|
|
29
|
+
### 2. List Available Workflows
|
|
30
|
+
|
|
31
|
+
See all workflows from all sources:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Basic listing
|
|
35
|
+
workrail list
|
|
36
|
+
|
|
37
|
+
# Detailed listing with version info
|
|
38
|
+
workrail list --verbose
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 3. Check Workflow Sources
|
|
42
|
+
|
|
43
|
+
View all workflow directory sources and their status:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
workrail sources
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
This shows:
|
|
50
|
+
- Which directories are being scanned
|
|
51
|
+
- Whether each directory exists
|
|
52
|
+
- How many workflow files are in each directory
|
|
53
|
+
|
|
54
|
+
## Adding Custom Workflows
|
|
55
|
+
|
|
56
|
+
### Method 1: User Directory (Recommended)
|
|
57
|
+
|
|
58
|
+
1. Initialize your user directory:
|
|
59
|
+
```bash
|
|
60
|
+
workrail init
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
2. Create workflow files in `~/.workrail/workflows/`:
|
|
64
|
+
```bash
|
|
65
|
+
cd ~/.workrail/workflows
|
|
66
|
+
# Create your custom workflow
|
|
67
|
+
cat > my-workflow.json << 'EOF'
|
|
68
|
+
{
|
|
69
|
+
"id": "my-custom-workflow",
|
|
70
|
+
"name": "My Custom Workflow",
|
|
71
|
+
"description": "A custom workflow for my specific needs",
|
|
72
|
+
"version": "1.0.0",
|
|
73
|
+
"steps": [
|
|
74
|
+
{
|
|
75
|
+
"id": "step-1",
|
|
76
|
+
"name": "First Step",
|
|
77
|
+
"description": "Custom step description",
|
|
78
|
+
"guidance": "What to do in this step"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
EOF
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Method 2: Project Directory
|
|
86
|
+
|
|
87
|
+
Create a `workflows/` directory in your project:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
mkdir workflows
|
|
91
|
+
cd workflows
|
|
92
|
+
# Add your project-specific workflows here
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Method 3: Environment Variables
|
|
96
|
+
|
|
97
|
+
Set custom directories using environment variables:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# Single custom directory
|
|
101
|
+
export WORKFLOW_STORAGE_PATH="/path/to/my/workflows"
|
|
102
|
+
|
|
103
|
+
# Multiple custom directories (colon-separated)
|
|
104
|
+
export WORKFLOW_STORAGE_PATH="/path/to/workflows1:/path/to/workflows2"
|
|
105
|
+
|
|
106
|
+
# Use with workrail
|
|
107
|
+
workrail list
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Method 4: Temporary Override
|
|
111
|
+
|
|
112
|
+
Use environment variables for one-time usage:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
WORKFLOW_STORAGE_PATH="/tmp/my-workflows" workrail list
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Workflow File Format
|
|
119
|
+
|
|
120
|
+
Workflows must be valid JSON files that conform to the workflow schema:
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"id": "unique-workflow-id",
|
|
125
|
+
"name": "Human Readable Name",
|
|
126
|
+
"description": "What this workflow does",
|
|
127
|
+
"version": "1.0.0",
|
|
128
|
+
"steps": [
|
|
129
|
+
{
|
|
130
|
+
"id": "step-1",
|
|
131
|
+
"title": "Step Name",
|
|
132
|
+
"prompt": "User-facing instructions for this step",
|
|
133
|
+
"agentRole": "Optional: AI agent behavioral guidance (e.g., 'You are a security expert...')",
|
|
134
|
+
"guidance": ["Optional guidance items"],
|
|
135
|
+
"askForFiles": true,
|
|
136
|
+
"requireConfirmation": false,
|
|
137
|
+
"runCondition": {
|
|
138
|
+
"var": "some_variable",
|
|
139
|
+
"equals": "expected_value"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Step Field Reference
|
|
147
|
+
|
|
148
|
+
- **`id`**: Unique step identifier (required)
|
|
149
|
+
- **`title`**: Human-readable step name (required)
|
|
150
|
+
- **`prompt`**: User-facing instructions (required)
|
|
151
|
+
- **`agentRole`**: AI agent behavioral guidance (optional, 10-1024 characters)
|
|
152
|
+
- **`guidance`**: Array of guidance strings (optional)
|
|
153
|
+
- **`askForFiles`**: Whether to request file context (optional, default: false)
|
|
154
|
+
- **`requireConfirmation`**: Whether to pause for user confirmation (optional, default: false)
|
|
155
|
+
- **`runCondition`**: Conditional execution logic (optional)
|
|
156
|
+
|
|
157
|
+
## Validation
|
|
158
|
+
|
|
159
|
+
Validate your workflow files before using them:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
# Validate a specific file
|
|
163
|
+
workrail validate my-workflow.json
|
|
164
|
+
|
|
165
|
+
# Validate all files in a directory
|
|
166
|
+
find ~/.workrail/workflows -name "*.json" -exec workrail validate {} \;
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Loop Optimization (v0.2.0+)
|
|
170
|
+
|
|
171
|
+
WorkRail automatically optimizes loop execution to reduce context size:
|
|
172
|
+
|
|
173
|
+
### Progressive Context Disclosure
|
|
174
|
+
|
|
175
|
+
- **First iteration**: Full loop overview + first step details
|
|
176
|
+
- **Subsequent iterations**: Minimal context with current item only
|
|
177
|
+
- **Context reduction**: 60-80% smaller responses after first iteration
|
|
178
|
+
|
|
179
|
+
### Function DSL
|
|
180
|
+
|
|
181
|
+
Define reusable functions to reduce duplication:
|
|
182
|
+
|
|
183
|
+
```json
|
|
184
|
+
{
|
|
185
|
+
"functionDefinitions": [
|
|
186
|
+
{
|
|
187
|
+
"name": "processItem",
|
|
188
|
+
"definition": "Validates and transforms item data"
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"steps": [{
|
|
192
|
+
"prompt": "Use processItem() to handle the current item",
|
|
193
|
+
"functionReferences": ["processItem()"]
|
|
194
|
+
}]
|
|
195
|
+
}
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Empty Loop Detection
|
|
199
|
+
|
|
200
|
+
Loops with no items are automatically skipped, improving performance.
|
|
201
|
+
|
|
202
|
+
For detailed information, see [Loop Optimization Guide](reference/loop-optimization.md).
|
|
203
|
+
|
|
204
|
+
## Advanced Configuration
|
|
205
|
+
|
|
206
|
+
### Disable Specific Sources
|
|
207
|
+
|
|
208
|
+
You can disable specific workflow sources using environment variables:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
# Disable bundled workflows
|
|
212
|
+
export WORKFLOW_INCLUDE_BUNDLED=false
|
|
213
|
+
|
|
214
|
+
# Disable user workflows
|
|
215
|
+
export WORKFLOW_INCLUDE_USER=false
|
|
216
|
+
|
|
217
|
+
# Disable project workflows
|
|
218
|
+
export WORKFLOW_INCLUDE_PROJECT=false
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Custom File Storage Options
|
|
222
|
+
|
|
223
|
+
Configure workflow storage behavior:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
# Cache workflows for 30 seconds (default: 60 seconds)
|
|
227
|
+
export WORKFLOW_CACHE_TTL=30000
|
|
228
|
+
|
|
229
|
+
# Maximum workflow file size (default: 1MB)
|
|
230
|
+
export WORKFLOW_MAX_FILE_SIZE=2000000
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Workflow Precedence
|
|
234
|
+
|
|
235
|
+
When multiple workflows have the same ID, the one from the highest priority source wins:
|
|
236
|
+
|
|
237
|
+
1. **Custom Directories** (highest priority)
|
|
238
|
+
2. **Project Workflows**
|
|
239
|
+
3. **User Workflows**
|
|
240
|
+
4. **Bundled Workflows** (lowest priority)
|
|
241
|
+
|
|
242
|
+
This means you can override any bundled workflow by creating a custom one with the same ID.
|
|
243
|
+
|
|
244
|
+
## Best Practices
|
|
245
|
+
|
|
246
|
+
### Organization
|
|
247
|
+
|
|
248
|
+
- **User Directory**: Personal workflows you use across projects
|
|
249
|
+
- **Project Directory**: Project-specific workflows
|
|
250
|
+
- **Custom Directories**: Shared team workflows or specialized collections
|
|
251
|
+
|
|
252
|
+
### Naming
|
|
253
|
+
|
|
254
|
+
- Use descriptive, unique IDs: `team-code-review`, `deploy-frontend`
|
|
255
|
+
- Include version numbers for major changes
|
|
256
|
+
- Use consistent naming conventions within your team
|
|
257
|
+
|
|
258
|
+
### Version Control
|
|
259
|
+
|
|
260
|
+
- **Do include**: Project workflows in version control
|
|
261
|
+
- **Don't include**: Personal user workflows in project repos
|
|
262
|
+
- **Consider**: Separate repos for shared workflow collections
|
|
263
|
+
|
|
264
|
+
### Testing
|
|
265
|
+
|
|
266
|
+
- Always validate workflows before using them
|
|
267
|
+
- Test workflows in a development environment first
|
|
268
|
+
- Use the `workrail sources` command to debug loading issues
|
|
269
|
+
|
|
270
|
+
### Advanced Patterns
|
|
271
|
+
|
|
272
|
+
- **Function References**: For complex workflows with repeated instructions, use the function reference pattern to reduce duplication and improve maintainability (see [Function Reference Pattern guide](implementation/09-simple-workflow-guide.md#function-reference-pattern-advanced))
|
|
273
|
+
- **Conditional Logic**: Use `runCondition` for adaptive workflows that branch based on context
|
|
274
|
+
- **Loop Patterns**: Use loop steps for iterative tasks like multi-step implementation
|
|
275
|
+
|
|
276
|
+
## Troubleshooting
|
|
277
|
+
|
|
278
|
+
### Workflow Not Found
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
# Check if your workflow directory exists
|
|
282
|
+
workrail sources
|
|
283
|
+
|
|
284
|
+
# Verify workflow file syntax
|
|
285
|
+
workrail validate your-workflow.json
|
|
286
|
+
|
|
287
|
+
# List all available workflows
|
|
288
|
+
workrail list
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Permission Issues
|
|
292
|
+
|
|
293
|
+
```bash
|
|
294
|
+
# Fix directory permissions
|
|
295
|
+
chmod 755 ~/.workrail/workflows
|
|
296
|
+
|
|
297
|
+
# Fix file permissions
|
|
298
|
+
chmod 644 ~/.workrail/workflows/*.json
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Schema Validation Errors
|
|
302
|
+
|
|
303
|
+
Common issues:
|
|
304
|
+
|
|
305
|
+
1. **Missing required fields**: Ensure `id`, `name`, `description`, `version`, and `steps` are present
|
|
306
|
+
2. **Invalid JSON**: Use a JSON validator to check syntax
|
|
307
|
+
3. **Invalid step structure**: Each step needs `id`, `name`, `description`, and `guidance`
|
|
308
|
+
|
|
309
|
+
## Integration with AI Assistants
|
|
310
|
+
|
|
311
|
+
Once your workflows are set up, they're automatically available to any MCP-enabled AI assistant:
|
|
312
|
+
|
|
313
|
+
1. **Claude Desktop**: Add WorkRail to your MCP configuration
|
|
314
|
+
2. **VS Code**: Configure WorkRail as an MCP server
|
|
315
|
+
3. **Custom Applications**: Connect to WorkRail's MCP interface
|
|
316
|
+
|
|
317
|
+
The AI assistant will automatically have access to all your workflows from all configured sources.
|