@exaudeus/workrail 0.8.5 → 0.9.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.
Files changed (424) hide show
  1. package/README.md +157 -403
  2. package/dist/application/services/enhanced-loop-validator.d.ts +2 -2
  3. package/dist/application/services/enhanced-loop-validator.js +12 -2
  4. package/dist/application/services/validation-engine.d.ts +8 -29
  5. package/dist/application/services/validation-engine.js +38 -21
  6. package/dist/application/services/workflow-compiler.d.ts +18 -0
  7. package/dist/application/services/workflow-compiler.js +79 -0
  8. package/dist/application/services/workflow-interpreter.d.ts +31 -0
  9. package/dist/application/services/workflow-interpreter.js +280 -0
  10. package/dist/application/services/workflow-service.d.ts +34 -32
  11. package/dist/application/services/workflow-service.js +93 -425
  12. package/dist/application/use-cases/get-next-step.d.ts +6 -10
  13. package/dist/application/use-cases/get-next-step.js +2 -6
  14. package/dist/application/use-cases/get-workflow.d.ts +8 -6
  15. package/dist/application/use-cases/get-workflow.js +42 -33
  16. package/dist/application/use-cases/list-workflows.d.ts +3 -3
  17. package/dist/application/use-cases/validate-step-output.d.ts +4 -4
  18. package/dist/application/use-cases/validate-workflow-file.d.ts +46 -0
  19. package/dist/application/use-cases/validate-workflow-file.js +57 -0
  20. package/dist/cli/commands/cleanup.d.ts +8 -0
  21. package/dist/cli/commands/cleanup.js +20 -0
  22. package/dist/cli/commands/index.d.ts +7 -0
  23. package/dist/cli/commands/index.js +21 -0
  24. package/dist/cli/commands/init.d.ts +11 -0
  25. package/dist/cli/commands/init.js +49 -0
  26. package/dist/cli/commands/list.d.ts +9 -0
  27. package/dist/cli/commands/list.js +34 -0
  28. package/dist/cli/commands/migrate.d.ts +78 -0
  29. package/dist/cli/commands/migrate.js +248 -0
  30. package/dist/cli/commands/sources.d.ts +21 -0
  31. package/dist/cli/commands/sources.js +87 -0
  32. package/dist/cli/commands/start.d.ts +8 -0
  33. package/dist/cli/commands/start.js +16 -0
  34. package/dist/cli/commands/validate.d.ts +6 -0
  35. package/dist/cli/commands/validate.js +55 -0
  36. package/dist/cli/interpret-result.d.ts +4 -0
  37. package/dist/cli/interpret-result.js +24 -0
  38. package/dist/cli/output-formatter.d.ts +10 -0
  39. package/dist/cli/output-formatter.js +97 -0
  40. package/dist/cli/types/cli-result.d.ts +23 -0
  41. package/dist/cli/types/cli-result.js +30 -0
  42. package/dist/cli/types/exit-code.d.ts +13 -0
  43. package/dist/cli/types/exit-code.js +23 -0
  44. package/dist/cli/types/index.d.ts +4 -0
  45. package/dist/cli/types/index.js +11 -0
  46. package/dist/cli.js +84 -278
  47. package/dist/config/app-config.d.ts +40 -0
  48. package/dist/config/app-config.js +58 -0
  49. package/dist/config/feature-flags.d.ts +10 -2
  50. package/dist/config/feature-flags.js +74 -12
  51. package/dist/core/error-handler.d.ts +18 -27
  52. package/dist/core/error-handler.js +24 -218
  53. package/dist/di/container.d.ts +12 -0
  54. package/dist/di/container.js +244 -0
  55. package/dist/di/tokens.d.ts +40 -0
  56. package/dist/di/tokens.js +42 -0
  57. package/dist/domain/execution/error.d.ts +32 -0
  58. package/dist/domain/execution/error.js +24 -0
  59. package/dist/domain/execution/event.d.ts +7 -0
  60. package/dist/domain/execution/event.js +11 -0
  61. package/dist/domain/execution/ids.d.ts +9 -0
  62. package/dist/domain/execution/ids.js +9 -0
  63. package/dist/domain/execution/result.d.ts +3 -0
  64. package/dist/domain/execution/result.js +10 -0
  65. package/dist/domain/execution/state.d.ts +57 -0
  66. package/dist/domain/execution/state.js +28 -0
  67. package/dist/errors/app-error.d.ts +23 -0
  68. package/dist/errors/factories.d.ts +6 -0
  69. package/dist/errors/factories.js +21 -0
  70. package/dist/errors/formatter.d.ts +2 -0
  71. package/dist/errors/formatter.js +32 -0
  72. package/dist/errors/index.d.ts +3 -0
  73. package/dist/errors/index.js +7 -0
  74. package/dist/index.d.ts +6 -1
  75. package/dist/index.js +10 -25
  76. package/dist/infrastructure/index.d.ts +0 -1
  77. package/dist/infrastructure/index.js +0 -1
  78. package/dist/infrastructure/session/DashboardHeartbeat.d.ts +8 -0
  79. package/dist/infrastructure/session/DashboardHeartbeat.js +39 -0
  80. package/dist/infrastructure/session/DashboardLockRelease.d.ts +2 -0
  81. package/dist/infrastructure/session/DashboardLockRelease.js +29 -0
  82. package/dist/infrastructure/session/HttpServer.d.ts +25 -6
  83. package/dist/infrastructure/session/HttpServer.js +245 -90
  84. package/dist/infrastructure/session/SessionDataNormalizer.js +12 -2
  85. package/dist/infrastructure/session/SessionDataValidator.js +12 -2
  86. package/dist/infrastructure/session/SessionManager.d.ts +5 -3
  87. package/dist/infrastructure/session/SessionManager.js +52 -6
  88. package/dist/infrastructure/storage/caching-workflow-storage.d.ts +30 -6
  89. package/dist/infrastructure/storage/caching-workflow-storage.js +105 -23
  90. package/dist/infrastructure/storage/enhanced-multi-source-workflow-storage.d.ts +13 -9
  91. package/dist/infrastructure/storage/enhanced-multi-source-workflow-storage.js +80 -54
  92. package/dist/infrastructure/storage/file-workflow-storage.d.ts +10 -8
  93. package/dist/infrastructure/storage/file-workflow-storage.js +48 -56
  94. package/dist/infrastructure/storage/git-workflow-storage.d.ts +7 -22
  95. package/dist/infrastructure/storage/git-workflow-storage.js +48 -103
  96. package/dist/infrastructure/storage/in-memory-storage.d.ts +10 -6
  97. package/dist/infrastructure/storage/in-memory-storage.js +18 -13
  98. package/dist/infrastructure/storage/plugin-workflow-storage.d.ts +6 -18
  99. package/dist/infrastructure/storage/plugin-workflow-storage.js +29 -51
  100. package/dist/infrastructure/storage/remote-workflow-storage.d.ts +8 -17
  101. package/dist/infrastructure/storage/remote-workflow-storage.js +33 -156
  102. package/dist/infrastructure/storage/schema-validating-workflow-storage.d.ts +21 -13
  103. package/dist/infrastructure/storage/schema-validating-workflow-storage.js +86 -24
  104. package/dist/infrastructure/storage/storage.d.ts +7 -5
  105. package/dist/infrastructure/storage/storage.js +7 -6
  106. package/dist/manifest.json +1093 -0
  107. package/dist/mcp/error-mapper.d.ts +9 -0
  108. package/dist/mcp/error-mapper.js +66 -0
  109. package/dist/mcp/handlers/session.d.ts +34 -0
  110. package/dist/mcp/handlers/session.js +135 -0
  111. package/dist/mcp/handlers/v2-workflow.d.ts +4 -0
  112. package/dist/mcp/handlers/v2-workflow.js +112 -0
  113. package/dist/mcp/handlers/workflow.d.ts +45 -0
  114. package/dist/mcp/handlers/workflow.js +167 -0
  115. package/dist/mcp/index.d.ts +16 -0
  116. package/dist/mcp/index.js +51 -0
  117. package/dist/mcp/output-schemas.d.ts +317 -0
  118. package/dist/mcp/output-schemas.js +91 -0
  119. package/dist/mcp/server.d.ts +3 -0
  120. package/dist/mcp/server.js +258 -0
  121. package/dist/mcp/tool-description-provider.d.ts +16 -0
  122. package/dist/mcp/tool-description-provider.js +43 -0
  123. package/dist/mcp/tool-descriptions.d.ts +2 -0
  124. package/dist/mcp/tool-descriptions.js +109 -0
  125. package/dist/mcp/tool-factory.d.ts +23 -0
  126. package/dist/mcp/tool-factory.js +14 -0
  127. package/dist/mcp/tools.d.ts +156 -0
  128. package/dist/mcp/tools.js +196 -0
  129. package/dist/mcp/types/tool-description-types.d.ts +8 -0
  130. package/dist/mcp/types/tool-description-types.js +24 -0
  131. package/dist/mcp/types.d.ts +25 -0
  132. package/dist/mcp/types.js +15 -0
  133. package/dist/mcp/v2/tool-registry.d.ts +11 -0
  134. package/dist/mcp/v2/tool-registry.js +26 -0
  135. package/dist/mcp/v2/tools.d.ts +20 -0
  136. package/dist/mcp/v2/tools.js +17 -0
  137. package/dist/mcp/validation/bounded-json.d.ts +3 -0
  138. package/dist/mcp/validation/bounded-json.js +22 -0
  139. package/dist/mcp/validation/workflow-next-prevalidate.d.ts +9 -0
  140. package/dist/mcp/validation/workflow-next-prevalidate.js +83 -0
  141. package/dist/mcp/zod-to-json-schema.d.ts +17 -0
  142. package/dist/mcp/zod-to-json-schema.js +134 -0
  143. package/dist/mcp-server.d.ts +1 -1
  144. package/dist/mcp-server.js +6 -424
  145. package/dist/runtime/adapters/in-memory-shutdown-events.d.ts +6 -0
  146. package/dist/runtime/adapters/in-memory-shutdown-events.js +20 -0
  147. package/dist/runtime/adapters/node-process-signals.d.ts +4 -0
  148. package/dist/runtime/adapters/node-process-signals.js +11 -0
  149. package/dist/runtime/adapters/node-process-terminator.d.ts +4 -0
  150. package/dist/runtime/adapters/node-process-terminator.js +17 -0
  151. package/dist/runtime/adapters/noop-process-signals.d.ts +4 -0
  152. package/dist/runtime/adapters/noop-process-signals.js +8 -0
  153. package/dist/runtime/adapters/throwing-process-terminator.d.ts +4 -0
  154. package/dist/runtime/adapters/throwing-process-terminator.js +9 -0
  155. package/dist/runtime/assert-never.d.ts +1 -0
  156. package/dist/runtime/assert-never.js +6 -0
  157. package/dist/runtime/brand.d.ts +5 -0
  158. package/dist/runtime/ports/process-signals.d.ts +4 -0
  159. package/dist/runtime/ports/process-signals.js +2 -0
  160. package/dist/runtime/ports/process-terminator.d.ts +8 -0
  161. package/dist/runtime/ports/process-terminator.js +2 -0
  162. package/dist/runtime/ports/shutdown-events.d.ts +11 -0
  163. package/dist/runtime/ports/shutdown-events.js +2 -0
  164. package/dist/runtime/process-lifecycle-policy.d.ts +5 -0
  165. package/dist/runtime/process-lifecycle-policy.js +2 -0
  166. package/dist/runtime/result.d.ts +17 -0
  167. package/dist/runtime/result.js +31 -0
  168. package/dist/runtime/runtime-mode.d.ts +9 -0
  169. package/dist/runtime/runtime-mode.js +2 -0
  170. package/dist/types/storage.d.ts +16 -5
  171. package/dist/types/storage.js +8 -0
  172. package/dist/types/validation.d.ts +27 -0
  173. package/dist/types/validation.js +10 -0
  174. package/dist/types/workflow-definition.d.ts +63 -0
  175. package/dist/types/workflow-definition.js +33 -0
  176. package/dist/types/workflow-source.d.ts +51 -0
  177. package/dist/types/workflow-source.js +128 -0
  178. package/dist/types/workflow.d.ts +28 -0
  179. package/dist/types/workflow.js +96 -0
  180. package/dist/utils/workflow-init.d.ts +1 -0
  181. package/dist/utils/workflow-init.js +38 -0
  182. package/dist/v2/durable-core/canonical/hashing.d.ts +11 -0
  183. package/dist/v2/durable-core/canonical/hashing.js +13 -0
  184. package/dist/v2/durable-core/canonical/jcs.d.ts +11 -0
  185. package/dist/v2/durable-core/canonical/jcs.js +65 -0
  186. package/dist/v2/durable-core/canonical/json-types.d.ts +6 -0
  187. package/dist/v2/durable-core/canonical/json-types.js +2 -0
  188. package/dist/v2/durable-core/canonical/json-zod.d.ts +2 -0
  189. package/dist/v2/durable-core/canonical/json-zod.js +7 -0
  190. package/dist/v2/durable-core/canonical/jsonl.d.ts +4 -0
  191. package/dist/v2/durable-core/canonical/jsonl.js +13 -0
  192. package/dist/v2/durable-core/ids/index.d.ts +23 -0
  193. package/dist/v2/durable-core/ids/index.js +46 -0
  194. package/dist/v2/durable-core/schemas/compiled-workflow/index.d.ts +47 -0
  195. package/dist/v2/durable-core/schemas/compiled-workflow/index.js +17 -0
  196. package/dist/v2/durable-core/schemas/session/events.d.ts +1812 -0
  197. package/dist/v2/durable-core/schemas/session/events.js +328 -0
  198. package/dist/v2/durable-core/schemas/session/index.d.ts +2 -0
  199. package/dist/v2/durable-core/schemas/session/index.js +8 -0
  200. package/dist/v2/durable-core/schemas/session/manifest.d.ts +57 -0
  201. package/dist/v2/durable-core/schemas/session/manifest.js +30 -0
  202. package/dist/v2/infra/local/crypto/index.d.ts +5 -0
  203. package/dist/v2/infra/local/crypto/index.js +12 -0
  204. package/dist/v2/infra/local/data-dir/index.d.ts +13 -0
  205. package/dist/v2/infra/local/data-dir/index.js +69 -0
  206. package/dist/v2/infra/local/fs/index.d.ts +26 -0
  207. package/dist/v2/infra/local/fs/index.js +156 -0
  208. package/dist/v2/infra/local/pinned-workflow-store/index.d.ts +11 -0
  209. package/dist/v2/infra/local/pinned-workflow-store/index.js +85 -0
  210. package/dist/v2/infra/local/session-lock/index.d.ts +12 -0
  211. package/dist/v2/infra/local/session-lock/index.js +44 -0
  212. package/dist/v2/infra/local/session-store/index.d.ts +22 -0
  213. package/dist/v2/infra/local/session-store/index.js +358 -0
  214. package/dist/v2/infra/local/sha256/index.d.ts +5 -0
  215. package/dist/v2/infra/local/sha256/index.js +12 -0
  216. package/dist/v2/ports/data-dir.port.d.ts +9 -0
  217. package/dist/v2/ports/data-dir.port.js +2 -0
  218. package/dist/v2/ports/fs.port.d.ts +41 -0
  219. package/dist/v2/ports/fs.port.js +2 -0
  220. package/dist/v2/ports/pinned-workflow-store.port.d.ts +11 -0
  221. package/dist/v2/ports/pinned-workflow-store.port.js +2 -0
  222. package/dist/v2/ports/session-event-log-store.port.d.ts +37 -0
  223. package/dist/v2/ports/session-event-log-store.port.js +2 -0
  224. package/dist/v2/ports/session-lock.port.d.ts +23 -0
  225. package/dist/v2/ports/session-lock.port.js +2 -0
  226. package/dist/v2/ports/sha256.port.d.ts +4 -0
  227. package/dist/v2/ports/sha256.port.js +2 -0
  228. package/dist/v2/projections/advance-outcomes.d.ts +23 -0
  229. package/dist/v2/projections/advance-outcomes.js +23 -0
  230. package/dist/v2/projections/capabilities.d.ts +27 -0
  231. package/dist/v2/projections/capabilities.js +33 -0
  232. package/dist/v2/projections/gaps.d.ts +29 -0
  233. package/dist/v2/projections/gaps.js +49 -0
  234. package/dist/v2/projections/node-outputs.d.ts +34 -0
  235. package/dist/v2/projections/node-outputs.js +73 -0
  236. package/dist/v2/projections/preferences.d.ts +28 -0
  237. package/dist/v2/projections/preferences.js +50 -0
  238. package/dist/v2/projections/run-dag.d.ts +42 -0
  239. package/dist/v2/projections/run-dag.js +186 -0
  240. package/dist/v2/projections/run-status-signals.d.ts +26 -0
  241. package/dist/v2/projections/run-status-signals.js +49 -0
  242. package/dist/v2/projections/session-health.d.ts +18 -0
  243. package/dist/v2/projections/session-health.js +15 -0
  244. package/dist/v2/read-only/v1-to-v2-shim.d.ts +3 -0
  245. package/dist/v2/read-only/v1-to-v2-shim.js +38 -0
  246. package/package.json +35 -10
  247. package/spec/mcp-api-v1.0.md +5 -5
  248. package/web/assets/services/data-normalizer.js +17 -2
  249. package/web/assets/services/pattern-recognizer.js +3 -1
  250. package/web/assets/services/session-data.js +13 -8
  251. package/web/assets/utils/formatters.js +34 -23
  252. package/workflows/CHANGELOG-bug-investigation.md +4 -4
  253. package/workflows/bug-investigation.agentic.json +156 -56
  254. package/workflows/coding-task-workflow-agentic.json +262 -0
  255. package/workflows/design-thinking-workflow-autonomous.agentic.json +215 -0
  256. package/workflows/design-thinking-workflow.json +198 -0
  257. package/workflows/mr-review-workflow.agentic.json +538 -0
  258. package/workflows/routines/context-gathering.json +0 -4
  259. package/workflows/routines/ideation.json +73 -0
  260. package/dist/application/app.d.ts +0 -29
  261. package/dist/application/app.d.ts.map +0 -1
  262. package/dist/application/app.js +0 -114
  263. package/dist/application/app.js.map +0 -1
  264. package/dist/application/decorators/simple-output-decorator.d.ts +0 -8
  265. package/dist/application/decorators/simple-output-decorator.js +0 -89
  266. package/dist/application/services/classification-engine.d.ts +0 -33
  267. package/dist/application/services/classification-engine.js +0 -258
  268. package/dist/application/services/compression-service.d.ts +0 -20
  269. package/dist/application/services/compression-service.js +0 -312
  270. package/dist/application/services/context-management-service.d.ts +0 -38
  271. package/dist/application/services/context-management-service.js +0 -301
  272. package/dist/application/services/context-optimizer.d.ts +0 -11
  273. package/dist/application/services/context-optimizer.js +0 -62
  274. package/dist/application/services/context-persistence-service.d.ts +0 -45
  275. package/dist/application/services/context-persistence-service.js +0 -273
  276. package/dist/application/services/documentation-service.d.ts +0 -20
  277. package/dist/application/services/documentation-service.js +0 -155
  278. package/dist/application/services/enhanced-error-service.d.ts.map +0 -1
  279. package/dist/application/services/enhanced-error-service.js.map +0 -1
  280. package/dist/application/services/loop-context-optimizer.d.ts +0 -8
  281. package/dist/application/services/loop-context-optimizer.js +0 -114
  282. package/dist/application/services/loop-execution-context.d.ts +0 -23
  283. package/dist/application/services/loop-execution-context.js +0 -188
  284. package/dist/application/services/loop-step-resolver.d.ts +0 -11
  285. package/dist/application/services/loop-step-resolver.js +0 -70
  286. package/dist/application/services/validation-engine.d.ts.map +0 -1
  287. package/dist/application/services/validation-engine.js.map +0 -1
  288. package/dist/application/services/workflow-service.d.ts.map +0 -1
  289. package/dist/application/services/workflow-service.js.map +0 -1
  290. package/dist/application/use-cases/get-next-step.d.ts.map +0 -1
  291. package/dist/application/use-cases/get-next-step.js.map +0 -1
  292. package/dist/application/use-cases/get-workflow-docs.d.ts +0 -4
  293. package/dist/application/use-cases/get-workflow-docs.js +0 -12
  294. package/dist/application/use-cases/get-workflow.d.ts.map +0 -1
  295. package/dist/application/use-cases/get-workflow.js.map +0 -1
  296. package/dist/application/use-cases/get-workrail-help.d.ts +0 -4
  297. package/dist/application/use-cases/get-workrail-help.js +0 -12
  298. package/dist/application/use-cases/list-workflows.d.ts.map +0 -1
  299. package/dist/application/use-cases/list-workflows.js.map +0 -1
  300. package/dist/application/use-cases/validate-step-output.d.ts.map +0 -1
  301. package/dist/application/use-cases/validate-step-output.js.map +0 -1
  302. package/dist/application/use-cases/validate-workflow-json.d.ts.map +0 -1
  303. package/dist/application/use-cases/validate-workflow-json.js.map +0 -1
  304. package/dist/application/validation.d.ts.map +0 -1
  305. package/dist/application/validation.js.map +0 -1
  306. package/dist/cli/migrate-workflow.d.ts +0 -22
  307. package/dist/cli/migrate-workflow.js +0 -196
  308. package/dist/cli.d.ts.map +0 -1
  309. package/dist/cli.js.map +0 -1
  310. package/dist/container.d.ts +0 -15
  311. package/dist/container.d.ts.map +0 -1
  312. package/dist/container.js +0 -25
  313. package/dist/container.js.map +0 -1
  314. package/dist/core/error-handler.d.ts.map +0 -1
  315. package/dist/core/error-handler.js.map +0 -1
  316. package/dist/domain/index.d.ts +0 -2
  317. package/dist/domain/index.d.ts.map +0 -1
  318. package/dist/domain/index.js +0 -18
  319. package/dist/domain/index.js.map +0 -1
  320. package/dist/index.d.ts.map +0 -1
  321. package/dist/index.js.map +0 -1
  322. package/dist/infrastructure/index.d.ts.map +0 -1
  323. package/dist/infrastructure/index.js.map +0 -1
  324. package/dist/infrastructure/rpc/handler.d.ts +0 -17
  325. package/dist/infrastructure/rpc/handler.d.ts.map +0 -1
  326. package/dist/infrastructure/rpc/handler.js +0 -78
  327. package/dist/infrastructure/rpc/handler.js.map +0 -1
  328. package/dist/infrastructure/rpc/index.d.ts +0 -1
  329. package/dist/infrastructure/rpc/index.d.ts.map +0 -1
  330. package/dist/infrastructure/rpc/index.js +0 -17
  331. package/dist/infrastructure/rpc/index.js.map +0 -1
  332. package/dist/infrastructure/rpc/server.d.ts +0 -3
  333. package/dist/infrastructure/rpc/server.d.ts.map +0 -1
  334. package/dist/infrastructure/rpc/server.js +0 -37
  335. package/dist/infrastructure/rpc/server.js.map +0 -1
  336. package/dist/infrastructure/storage/caching-workflow-storage.d.ts.map +0 -1
  337. package/dist/infrastructure/storage/caching-workflow-storage.js.map +0 -1
  338. package/dist/infrastructure/storage/context-storage.d.ts +0 -150
  339. package/dist/infrastructure/storage/context-storage.js +0 -40
  340. package/dist/infrastructure/storage/file-workflow-storage.d.ts.map +0 -1
  341. package/dist/infrastructure/storage/file-workflow-storage.js.map +0 -1
  342. package/dist/infrastructure/storage/filesystem-blob-storage.d.ts +0 -27
  343. package/dist/infrastructure/storage/filesystem-blob-storage.js +0 -363
  344. package/dist/infrastructure/storage/git-workflow-storage.d.ts.map +0 -1
  345. package/dist/infrastructure/storage/git-workflow-storage.js.map +0 -1
  346. package/dist/infrastructure/storage/hybrid-context-storage.d.ts +0 -29
  347. package/dist/infrastructure/storage/hybrid-context-storage.js +0 -400
  348. package/dist/infrastructure/storage/in-memory-storage.d.ts.map +0 -1
  349. package/dist/infrastructure/storage/in-memory-storage.js.map +0 -1
  350. package/dist/infrastructure/storage/index.d.ts.map +0 -1
  351. package/dist/infrastructure/storage/index.js.map +0 -1
  352. package/dist/infrastructure/storage/migrations/001_initial_schema.sql +0 -38
  353. package/dist/infrastructure/storage/migrations/002_context_concurrency_enhancements.sql +0 -234
  354. package/dist/infrastructure/storage/migrations/003_classification_overrides.sql +0 -20
  355. package/dist/infrastructure/storage/multi-directory-workflow-storage.d.ts +0 -32
  356. package/dist/infrastructure/storage/multi-directory-workflow-storage.d.ts.map +0 -1
  357. package/dist/infrastructure/storage/multi-directory-workflow-storage.js +0 -184
  358. package/dist/infrastructure/storage/multi-directory-workflow-storage.js.map +0 -1
  359. package/dist/infrastructure/storage/plugin-workflow-storage.d.ts.map +0 -1
  360. package/dist/infrastructure/storage/plugin-workflow-storage.js.map +0 -1
  361. package/dist/infrastructure/storage/remote-workflow-storage.d.ts.map +0 -1
  362. package/dist/infrastructure/storage/remote-workflow-storage.js.map +0 -1
  363. package/dist/infrastructure/storage/schema-validating-workflow-storage.d.ts.map +0 -1
  364. package/dist/infrastructure/storage/schema-validating-workflow-storage.js.map +0 -1
  365. package/dist/infrastructure/storage/sqlite-metadata-storage.d.ts +0 -35
  366. package/dist/infrastructure/storage/sqlite-metadata-storage.js +0 -410
  367. package/dist/infrastructure/storage/sqlite-migrator.d.ts +0 -46
  368. package/dist/infrastructure/storage/sqlite-migrator.js +0 -293
  369. package/dist/infrastructure/storage/storage.d.ts.map +0 -1
  370. package/dist/infrastructure/storage/storage.js.map +0 -1
  371. package/dist/mcp-server.d.ts.map +0 -1
  372. package/dist/mcp-server.js.map +0 -1
  373. package/dist/tools/mcp_initialize.d.ts +0 -2
  374. package/dist/tools/mcp_initialize.d.ts.map +0 -1
  375. package/dist/tools/mcp_initialize.js +0 -45
  376. package/dist/tools/mcp_initialize.js.map +0 -1
  377. package/dist/tools/mcp_shutdown.d.ts +0 -2
  378. package/dist/tools/mcp_shutdown.d.ts.map +0 -1
  379. package/dist/tools/mcp_shutdown.js +0 -10
  380. package/dist/tools/mcp_shutdown.js.map +0 -1
  381. package/dist/tools/mcp_tools_list.d.ts +0 -2
  382. package/dist/tools/mcp_tools_list.d.ts.map +0 -1
  383. package/dist/tools/mcp_tools_list.js +0 -60
  384. package/dist/tools/mcp_tools_list.js.map +0 -1
  385. package/dist/tools/session-tools.d.ts +0 -5
  386. package/dist/tools/session-tools.js +0 -270
  387. package/dist/types/context-types.d.ts +0 -236
  388. package/dist/types/context-types.js +0 -10
  389. package/dist/types/documentation-types.d.ts +0 -37
  390. package/dist/types/loop-context-optimizer.d.ts +0 -7
  391. package/dist/types/mcp-types.d.ts +0 -273
  392. package/dist/types/mcp-types.d.ts.map +0 -1
  393. package/dist/types/mcp-types.js +0 -19
  394. package/dist/types/mcp-types.js.map +0 -1
  395. package/dist/types/server.d.ts.map +0 -1
  396. package/dist/types/server.js.map +0 -1
  397. package/dist/types/storage.d.ts.map +0 -1
  398. package/dist/types/storage.js.map +0 -1
  399. package/dist/types/workflow-types.d.ts +0 -336
  400. package/dist/types/workflow-types.d.ts.map +0 -1
  401. package/dist/types/workflow-types.js +0 -20
  402. package/dist/types/workflow-types.js.map +0 -1
  403. package/dist/utils/condition-evaluator.d.ts.map +0 -1
  404. package/dist/utils/condition-evaluator.js.map +0 -1
  405. package/dist/utils/config.d.ts +0 -149
  406. package/dist/utils/config.d.ts.map +0 -1
  407. package/dist/utils/config.js +0 -251
  408. package/dist/utils/config.js.map +0 -1
  409. package/dist/utils/storage-security.d.ts.map +0 -1
  410. package/dist/utils/storage-security.js.map +0 -1
  411. package/dist/validation/request-validator.d.ts +0 -8
  412. package/dist/validation/request-validator.d.ts.map +0 -1
  413. package/dist/validation/request-validator.js +0 -32
  414. package/dist/validation/request-validator.js.map +0 -1
  415. package/dist/validation/response-validator.d.ts +0 -8
  416. package/dist/validation/response-validator.d.ts.map +0 -1
  417. package/dist/validation/response-validator.js +0 -110
  418. package/dist/validation/response-validator.js.map +0 -1
  419. package/dist/validation/schemas.d.ts +0 -1
  420. package/dist/validation/schemas.d.ts.map +0 -1
  421. package/dist/validation/schemas.js +0 -53
  422. package/dist/validation/schemas.js.map +0 -1
  423. /package/dist/{types/documentation-types.js → errors/app-error.js} +0 -0
  424. /package/dist/{types/loop-context-optimizer.js → runtime/brand.js} +0 -0
package/README.md CHANGED
@@ -1,496 +1,250 @@
1
1
  <div align="center">
2
- <img src="./assets/logo.svg" alt="WorkRail Logo" width="200" />
3
- <h1>WorkRail: Guided Workflow Orchestration for AI Agents</h1>
4
- <p><strong>Transform chaotic AI interactions into structured, reliable workflows</strong></p>
5
-
6
- [![MCP Compatible](https://img.shields.io/badge/MCP-compatible-purple.svg)](https://modelcontextprotocol.org)
7
- [![npm version](https://img.shields.io/npm/v/@exaudeus/workrail.svg)](https://www.npmjs.com/package/@exaudeus/workrail)
8
- [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
- </div>
10
-
11
- ---
2
+ <img src="./assets/logo.svg" alt="WorkRail Logo" width="180" />
3
+ <h1>WorkRail</h1>
4
+ <p>Step-by-step workflow enforcement for AI agents</p>
12
5
 
13
- ## 📑 Table of Contents
14
-
15
- - [The Problem](#-the-problem)
16
- - [The Solution](#-the-solution)
17
- - [MCP Tools](#️-mcp-tools)
18
- - [Installation](#️-installation)
19
- - [External Workflows](#-external-workflows-load-from-git-repositories)
20
- - [Local Workflows](#-using-local-workflows)
21
- - [Available Workflows](#-available-workflows)
22
- - [Loop Support](#-loop-support)
23
- - [Quick Example](#-quick-example)
24
- - [Why Choose WorkRail](#-why-choose-workrail)
25
- - [Environment Variables](#-environment-variables-reference)
26
- - [Workflow Sources](#workflow-sources)
27
- - [External Git Repositories](#external-git-repositories)
28
- - [Cache & Performance](#cache--performance)
29
- - [Debugging & Logging](#debugging--logging)
30
- - [Getting Started](#-getting-started)
31
- - [Planned Features](#-planned-features)
32
- - [Learn More](#-learn-more)
6
+ [![npm version](https://img.shields.io/npm/v/@exaudeus/workrail.svg)](https://www.npmjs.com/package/@exaudeus/workrail)
7
+ [![MCP](https://img.shields.io/badge/MCP-compatible-purple.svg)](https://modelcontextprotocol.org)
8
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
9
+ </div>
33
10
 
34
11
  ---
35
12
 
36
- ## 🤔 The Problem
37
-
38
- Large Language Models are incredibly powerful but suffer from well-documented limitations:
39
-
40
- - **Hallucination** - They confidently generate plausible-sounding but incorrect information
41
- - **Scope Creep** - Given a complex task, they often try to do too much at once, leading to half-baked solutions
42
- - **Context Loss** - They struggle to maintain focus across long conversations
43
- - **Inconsistency** - The same prompt can yield wildly different results based on minor variations
44
- - **Missing Prerequisites** - They often start implementing before gathering necessary context
45
-
46
- Traditional approaches try to solve these through better prompting or more powerful models. WorkRail takes a different approach.
13
+ ## The Problem
47
14
 
48
- ## 💡 The Solution
15
+ AI agents are eager to help. Too eager.
49
16
 
50
- WorkRail guides LLMs through **proven software engineering best practices** via structured workflows, making it much more difficult for the LLM to go off track.
17
+ Ask one to fix a bug and it starts editing code immediately - before understanding the system, before
18
+ considering alternatives, before verifying assumptions. It's not stupid; it's a predictive model
19
+ doing what predictive models do: fill in gaps and race to an answer.
51
20
 
52
- Instead of hoping an LLM will follow best practices, this system **guides them toward** best practices through structured, machine-readable workflows.
21
+ You can add system prompts: "plan before coding," "gather context first." But as conversations grow,
22
+ those instructions fade into the background. The agent reverts to its default: assume, predict, jump
23
+ to conclusions.
53
24
 
54
- **Traditional Approach:**
55
- ```
56
- User: "Help me implement this feature"
57
- AI: [May or may not ask for context, may or may not plan, may or may not test]
58
- ```
59
-
60
- **WorkRail Approach:**
61
- ```
62
- Workflow guides: Context → Clarification → Planning → Implementation → Verification
63
- AI: [Cannot skip steps, must follow proven patterns]
64
- ```
65
-
66
- This creates an enhanced experience where developers are guided through optimal workflows, missing fewer critical steps, while LLMs work within their strengths following proven patterns.
25
+ **The result: inconsistent quality that depends on how much you babysit the agent.**
67
26
 
68
27
  ---
69
28
 
70
- ## 🛠️ MCP Tools
71
-
72
- WorkRail exposes 6 core tools through the Model Context Protocol:
29
+ ## How WorkRail Works
73
30
 
74
- - **`workflow_list`** - Browse available workflows for different task types
75
- - **`workflow_get`** - Get complete workflow details and requirements
76
- - **`workflow_next`** - Get the next step in an active workflow
77
- - **`workflow_validate`** - Validate step outputs against quality criteria
78
- - **`workflow_validate_json`** - Validate and lint workflow JSON files
79
- - **`workflow_get_schema`** - Get the complete workflow JSON schema for workflow creation
31
+ WorkRail replaces the human effort of guiding an agent step-by-step.
80
32
 
81
- ---
33
+ Instead of one system prompt that fades over time, WorkRail drip-feeds instructions through
34
+ the [Model Context Protocol](https://modelcontextprotocol.org). The agent calls `workflow_next`,
35
+ gets ONE step, completes it, calls again. Future steps stay hidden until previous ones are done.
82
36
 
83
- ## ⚙️ Installation
37
+ **The agent can't skip to implementation because it doesn't know those steps exist yet.**
84
38
 
85
- Add WorkRail to your AI agent by configuring the MCP server:
39
+ ### The Mechanism
86
40
 
87
- ### NPX (Recommended)
88
- Add to your agent's `config.json`:
89
- ```json
90
- {
91
- "mcpServers": {
92
- "workrail": {
93
- "command": "npx",
94
- "args": ["-y", "@exaudeus/workrail"]
95
- }
96
- }
97
- }
98
41
  ```
99
-
100
- ### Docker
101
- Add to your agent's `config.json`:
102
- ```json
103
- {
104
- "mcpServers": {
105
- "workrail": {
106
- "command": "docker",
107
- "args": ["run", "--rm", "-i", "workrail-mcp"]
108
- }
109
- }
110
- }
42
+ You Agent WorkRail
43
+ │ │ │
44
+ │ "Fix the auth bug" │ │
45
+ │────────────────────────>│ │
46
+ │ │ │
47
+ │ │ workflow_next() │
48
+ │ │─────────────────────────>│
49
+ │ │ │
50
+ │ │ Step 1: Understand │
51
+ │ │ the problem │
52
+ │ │<─────────────────────────│
53
+ │ │ │
54
+ │ "What error do you │ │
55
+ │ see exactly?" │ │
56
+ │<────────────────────────│ │
57
+ │ │ │
58
+ │ ... │ workflow_next() │
59
+ │ │─────────────────────────>│
60
+ │ │ │
61
+ │ │ Step 2: Plan your │
62
+ │ │ investigation │
63
+ │ │<─────────────────────────│
111
64
  ```
112
65
 
113
- ---
114
-
115
- ## 🌐 External Workflows: Load from Git Repositories
116
-
117
- **NEW in v0.6+**: Load workflows from GitHub, GitLab, Bitbucket, or any Git repository!
66
+ ### Without WorkRail
118
67
 
119
- Perfect for:
120
- - **Team sharing** - Company-wide workflow repositories
121
- - **Community workflows** - Shared across organizations
122
- - **Version control** - Track workflow changes in Git
123
- - **Multi-source** - Combine workflows from multiple repos
124
-
125
- ### Quick Start
126
-
127
- Add to your agent config:
128
-
129
- ```json
130
- {
131
- "mcpServers": {
132
- "workrail": {
133
- "command": "npx",
134
- "args": ["-y", "@exaudeus/workrail"],
135
- "env": {
136
- "WORKFLOW_GIT_REPOS": "https://github.com/your-org/workflows.git",
137
- "GITHUB_TOKEN": "your-github-token"
138
- }
139
- }
140
- }
141
- }
142
68
  ```
69
+ You: "There's a bug in the auth flow"
143
70
 
144
- ### Multiple Repositories
145
-
146
- Load workflows from multiple sources (later repos override earlier ones):
147
-
148
- ```json
149
- "env": {
150
- "WORKFLOW_GIT_REPOS": "https://github.com/company/workflows.git,https://gitlab.com/team/workflows.git",
151
- "GITHUB_TOKEN": "ghp_xxx",
152
- "GITLAB_TOKEN": "glpat_xxx"
153
- }
71
+ Agent: "I see the issue! In auth.js line 42, there's a null check that
72
+ should handle this. Let me fix it..."
73
+
74
+ *edits code based on a 30-second skim*
75
+ *breaks something else*
154
76
  ```
155
77
 
156
- ### Authentication Options
78
+ ### With WorkRail
157
79
 
158
- **Service-Specific Tokens** (Recommended):
159
- ```bash
160
- GITHUB_TOKEN=ghp_xxxx # For github.com
161
- GITLAB_TOKEN=glpat_xxxx # For gitlab.com
162
- BITBUCKET_TOKEN=xxx # For bitbucket.org
163
80
  ```
81
+ You: "There's a bug in the auth flow"
164
82
 
165
- **Self-Hosted Git** (hostname-based):
166
- ```bash
167
- GIT_COMPANY_COM_TOKEN=xxx # For git.company.com
168
- GIT_INTERNAL_GITLAB_IO_TOKEN=xxx # For internal.gitlab.io
83
+ Agent: "I'll use the bug-investigation workflow."
84
+ → workflow_next()
85
+
86
+ Step 1: Investigation Setup
87
+ "Before I investigate, I need to understand the problem.
88
+ What exactly happens when it fails? Can you share the error?"
89
+
90
+ [Documents bug, reproduction steps, environment]
91
+ → workflow_next()
92
+
93
+ Step 2: Plan Investigation
94
+ "I'll trace execution from login through the auth middleware.
95
+ Key areas: token validation, session lookup, error handling."
96
+
97
+ [Creates investigation plan before touching code]
98
+ → workflow_next()
99
+
100
+ Step 3: Form Hypotheses
101
+ "Based on my analysis, three possible causes:
102
+ H1: Clock skew in token validation (7/10)
103
+ H2: Race condition in session lookup (6/10)
104
+ H3: Null check masking the real error (4/10)"
105
+
106
+ [Tests hypotheses systematically, gathers evidence, proves root cause]
169
107
  ```
170
108
 
171
- **SSH Keys** (no token needed):
172
- ```bash
173
- WORKFLOW_GIT_REPOS="git@github.com:company/workflows.git"
174
- # Uses your ~/.ssh/ keys automatically
175
- ```
109
+ Same agent. Same model. But it prepared properly because it had no choice.
176
110
 
177
- **Generic Fallback**:
178
- ```bash
179
- GIT_TOKEN=xxx # Used if no specific token found
180
- WORKFLOW_GIT_AUTH_TOKEN=xxx # Alternative generic token
181
- ```
111
+ ### Why Steps Are Structured This Way
182
112
 
183
- ### Repository Structure
113
+ Each step follows a pattern that prevents common AI failure modes:
184
114
 
185
- Your Git repository should have a `/workflows` directory:
115
+ - **Prep**: Understand before acting - read the code, clarify requirements, confirm approach
116
+ - **Implement**: One focused change - not five things at once
117
+ - **Verify**: Validate before continuing - catch errors before they compound
186
118
 
187
- ```
188
- your-repo/
189
- ├── workflows/
190
- │ ├── custom-workflow.json
191
- │ ├── team-process.json
192
- │ └── company-standard.json
193
- └── README.md (optional)
194
- ```
119
+ This isn't arbitrary structure. It's how experienced developers actually work.
195
120
 
196
- ### Features
121
+ ### Why This Beats System Prompts
197
122
 
198
- - **Auto-sync** - Workflows update automatically (configurable interval)
199
- - ✅ **Caching** - Works offline after initial clone
200
- - **Security** - Path traversal prevention, file size limits, command injection protection
201
- - **Priority system** - Later repos override earlier ones
202
- - **Branch support** - Specify branch in repo config
123
+ | System Prompt | WorkRail |
124
+ |---------------|----------|
125
+ | "Plan first" fades as context grows | Each step is fresh and immediate |
126
+ | Agent decides what to follow | Agent can't skip - next step is hidden |
127
+ | One-size-fits-all instructions | Workflows adapt to task complexity |
128
+ | Inconsistent results | Repeatable, consistent quality |
203
129
 
204
130
  ---
205
131
 
206
- ## 💾 Using Local Workflows
207
-
208
- WorkRail will auto-discover workflows even when added to your agent via JSON config. It searches, in priority order:
132
+ ## Quick Start
209
133
 
210
- - User: `~/.workrail/workflows` (recommended)
211
- - Project: `./workflows` relative to the MCP process `cwd`
212
- - Custom: directories listed in `WORKFLOW_STORAGE_PATH` (colon-separated on macOS/Linux)
213
-
214
- Example agent config passing env and `cwd` so your local workflows are picked up:
134
+ Add to your MCP client config (Claude Code, Cursor, Firebender, Antigravity, etc.):
215
135
 
216
136
  ```json
217
137
  {
218
138
  "mcpServers": {
219
139
  "workrail": {
220
140
  "command": "npx",
221
- "args": ["-y", "@exaudeus/workrail"],
222
- "env": {
223
- "WORKFLOW_STORAGE_PATH": "/absolute/path/my-workflows:/absolute/path/shared-workflows"
224
- },
225
- "cwd": "/absolute/path/my-project"
141
+ "args": ["-y", "@exaudeus/workrail"]
226
142
  }
227
143
  }
228
144
  }
229
145
  ```
230
146
 
231
- WorkRail searches for workflows in this priority order:
232
-
233
- 1. **Bundled** - Built-in workflows (always available)
234
- 2. **User** - `~/.workrail/workflows` (recommended for personal workflows)
235
- 3. **Custom** - Directories in `WORKFLOW_STORAGE_PATH` (team/shared workflows)
236
- 4. **Git Repositories** - External repos via `WORKFLOW_GIT_REPOS` ([see above](#-external-workflows-load-from-git-repositories))
237
- 5. **Project** - `./workflows` relative to process `cwd` (project-specific)
238
-
239
- Later sources override earlier ones when workflow IDs conflict.
240
-
241
- ### Quick Tips
242
-
243
- ```bash
244
- # Initialize your user directory
245
- workrail init
246
-
247
- # Validate a workflow file
248
- workrail validate /path/to/workflow.json
147
+ Then prompt your agent:
249
148
 
250
- # List all discovered workflows
251
- workrail list
149
+ > "Use the bug-investigation workflow to debug this auth issue"
252
150
 
253
- # Get workflow JSON schema
254
- workrail schema
255
- ```
256
-
257
- See `docs/workflow-management.md` for more details.
151
+ The agent will find the workflow, start at step 1, and proceed systematically.
258
152
 
259
153
  ---
260
154
 
261
- ## 📋 Available Workflows
262
-
263
- WorkRail comes with battle-tested workflows for common development tasks:
264
-
265
- ### 🔧 **Development Workflows**
266
- - **`coding-task-workflow-with-loops`** - Enhanced coding workflow with iterative refinement loops, analysis, planning, implementation, and review *(Recommended)*
267
- - **`systematic-bug-investigation-with-loops`** - Enhanced debugging with iterative analysis loops and systematic methodology *(Recommended)*
268
-
269
- #### Deprecated Workflows
270
- - ~~**`coding-task-workflow`** - [DEPRECATED] Use `coding-task-workflow-with-loops` instead~~
271
- - ~~**`systematic-bug-investigation`** - [DEPRECATED] Use `systematic-bug-investigation-with-loops` instead~~
272
-
273
- ### 🚀 **Project Management**
274
- - **`adaptive-ticket-creation`** - Create well-structured tickets with proper requirements
275
- - **`mr-review-workflow`** - Thorough merge request review process
276
-
277
- ### 📚 **Content & Documentation**
278
- - **`document-creation-workflow`** - Structured approach to creating comprehensive documentation
279
- - **`presentation-creation`** - Build engaging presentations with clear narrative flow
280
- - **`personal-learning-course-design`** - Design educational content with learning objectives
281
- - **`personal-learning-materials-creation-branched`** - Create comprehensive learning materials with adaptive complexity
155
+ ## CI & Releases
282
156
 
283
- ### 🔍 **Discovery & Analysis**
284
- - **`exploration-workflow`** - Systematic codebase or domain exploration
285
- - **`workflow-for-workflows`** - Meta-workflow for designing new workflows
157
+ - **Lockfile is enforced**: `package-lock.json` is canonical and CI will fail if `npm ci` would modify it. Commit lockfile changes intentionally.
158
+ - **Release authority**: releases are produced by **semantic-release** in GitHub Actions (don’t bump versions/tags locally).
159
+ - **Preview a release (dry-run)**:
160
+ - **Locally**: `npx semantic-release --dry-run --no-ci`
161
+ - **In Actions**: run the **Release (dry-run)** workflow (`.github/workflows/release-dry-run.yml`).
286
162
 
287
163
  ---
288
164
 
289
- ## 🔄 Loop Support
165
+ ## Included Workflows
290
166
 
291
- WorkRail supports powerful iteration patterns for complex tasks:
167
+ 20+ workflows included for development, debugging, review, documentation, and more:
292
168
 
293
- - **`while`** - Continue while a condition is true
294
- - **`until`** - Continue until a condition is met
295
- - **`for`** - Execute a fixed number of times
296
- - **`forEach`** - Process items in an array
169
+ | Workflow | When to Use |
170
+ |----------|-------------|
171
+ | `coding-task-workflow-with-loops` | Feature development with analysis, planning, and review |
172
+ | `bug-investigation` | Systematic debugging with hypothesis testing |
173
+ | `mr-review-workflow` | Code review with architecture and security checks |
174
+ | `exploration-workflow` | Understanding an unfamiliar codebase |
175
+ | `document-creation-workflow` | Technical documentation with structure |
297
176
 
298
- Perfect for batch operations, retries, polling, and iterative refinement.
177
+ Workflows adapt to complexity - simple tasks get fast-tracked, complex tasks get full rigor.
299
178
 
300
- ### 🚀 v0.2.0: Optimized Loop Execution
301
-
302
- - **60-80% smaller context** after first iteration
303
- - **Progressive disclosure** pattern for loop information
304
- - **Native function DSL** to reduce duplication
305
- - **Automatic empty loop detection** and skipping
306
-
307
- See [Loop Optimization Guide](docs/features/loop-optimization.md) for details.
179
+ [See all workflows →](docs/workflows.md)
308
180
 
309
181
  ---
310
182
 
311
- ## 📖 Quick Example
312
-
313
- Here's what a workflow step looks like:
314
-
315
- ```json
316
- {
317
- "id": "analyze-codebase",
318
- "name": "Deep Codebase Analysis",
319
- "description": "Understand the codebase structure before making changes",
320
- "agentRole": "You are a senior engineer performing careful code analysis",
321
- "runCondition": {
322
- "type": "context",
323
- "key": "taskComplexity",
324
- "operator": "in",
325
- "values": ["Medium", "Large"]
326
- },
327
- "validationCriteria": {
328
- "outputLength": {"min": 200, "max": 2000},
329
- "mustContain": ["file structure", "key components", "dependencies"]
330
- }
331
- }
332
- ```
333
-
334
- The agent receives structured guidance on **what to do**, **how to do it**, and **quality standards to meet**.
183
+ ## The Philosophy
335
184
 
336
- ---
185
+ ### Guardrails Enable Excellence
337
186
 
338
- ## 🌟 Why Choose WorkRail?
187
+ WorkRail doesn't lobotomize your AI. The agent still reasons, explores, and creates - but within a
188
+ structure that ensures it actually prepares, plans, and verifies. Guardrails prevent shortcuts, not
189
+ creativity.
339
190
 
340
- ### Consistency & Reproducibility
341
- One of the biggest challenges with AI-assisted development is inconsistency. The same request can yield wildly different approaches depending on how the prompt is phrased, the LLM's randomness, or the developer's prompting expertise.
191
+ ### Expert Knowledge, Codified
342
192
 
343
- WorkRail reduces these variables:
344
- - **Same Process** - Every developer follows the same workflow
345
- - **Same Quality** - Helps junior developers produce work closer to senior-level quality
346
- - **Same Standards** - Code style and patterns are guided by workflows
347
- - **Audit Trail** - Every decision is logged and reviewable
193
+ Workflows aren't just task checklists. They embed hard-won expertise: "verify understanding before
194
+ implementing," "form multiple hypotheses before concluding," "test assumptions with evidence." This
195
+ is how senior engineers think - now encoded into every workflow.
348
196
 
349
- | Without WorkRail | With WorkRail |
350
- |------------------|---------------|
351
- | "Just fix this bug" → agent makes random changes | Systematic investigation → evidence-based diagnosis → targeted fix |
352
- | "Add a feature" → incomplete implementation | Analysis → planning → implementation → testing → review |
353
- | Inconsistent quality across tasks | Repeatable, high-quality processes |
354
- | Outcome depends on prompting skills | Guided best practices regardless of experience |
197
+ ### Replacing the Human Guide
355
198
 
356
- ---
357
-
358
- ## 🚀 Getting Started
199
+ A skilled developer doesn't let AI run unsupervised on complex tasks. They guide it: "Wait, did you
200
+ check X?" "What about edge case Y?" "Show me your reasoning."
359
201
 
360
- 1. **Install** WorkRail as an MCP server (see installation above)
361
- 2. **Browse workflows** - Use `workflow_list` to see available options
362
- 3. **Start a workflow** - Use `workflow_get` to load a workflow for your task
363
- 4. **Follow the steps** - Use `workflow_next` to get guided, step-by-step instructions
364
- 5. **Validate progress** - Use `workflow_validate` to ensure quality at each step
202
+ WorkRail does this automatically. The workflow asks the questions a senior dev would ask, at the
203
+ moments they'd ask them.
365
204
 
366
205
  ---
367
206
 
368
- ## 🌟 Environment Variables Reference
207
+ ## Create Your Own
369
208
 
370
- Customize WorkRail's behavior with these environment variables:
209
+ Drop a JSON file in `~/.workrail/workflows/`:
371
210
 
372
- ### Workflow Sources
373
- ```bash
374
- WORKFLOW_INCLUDE_BUNDLED=true # Include built-in workflows (default: true)
375
- WORKFLOW_INCLUDE_USER=true # Include ~/.workrail/workflows (default: true)
376
- WORKFLOW_INCLUDE_PROJECT=true # Include ./workflows from cwd (default: true)
377
- WORKFLOW_STORAGE_PATH=/path1:/path2 # Additional directories (colon-separated)
378
- ```
379
-
380
- ### External Git Repositories
381
- ```bash
382
- # Single or multiple repos (comma-separated)
383
- WORKFLOW_GIT_REPOS=https://github.com/org/repo.git
384
- WORKFLOW_GIT_REPOS=repo1.git,repo2.git,repo3.git
385
-
386
- # Authentication
387
- GITHUB_TOKEN=ghp_xxx # GitHub
388
- GITLAB_TOKEN=glpat_xxx # GitLab
389
- BITBUCKET_TOKEN=xxx # Bitbucket
390
- GIT_HOSTNAME_TOKEN=xxx # Self-hosted (replace dots with underscores)
391
- GIT_TOKEN=xxx # Generic fallback
392
- ```
393
-
394
- ### Cache & Performance
395
- ```bash
396
- WORKRAIL_CACHE_DIR=/path/to/cache # Cache location (default: ~/.workrail/cache)
397
- CACHE_TTL=300000 # Cache TTL in ms (default: 5 minutes)
398
- ```
399
-
400
- ### Debugging & Logging
401
- ```bash
402
- # Log levels: DEBUG, INFO, WARN, ERROR, SILENT (default: SILENT)
403
- WORKRAIL_LOG_LEVEL=INFO
404
-
405
- # Log format: 'human' (default) or 'json'
406
- WORKRAIL_LOG_FORMAT=json
407
- ```
408
-
409
- **Log Levels:**
410
- - `DEBUG` - Verbose logging (cloning, pulling, file operations)
411
- - `INFO` - Key operations (initialization, workflows loaded)
412
- - `WARN` - Warnings (branch fallbacks, pull failures)
413
- - `ERROR` - Errors only
414
- - `SILENT` - No logging (default in production)
415
-
416
- **Example MCP Configuration with Logging:**
417
211
  ```json
418
212
  {
419
- "mcpServers": {
420
- "workrail": {
421
- "command": "npx",
422
- "args": ["-y", "@exaudeus/workrail@beta"],
423
- "env": {
424
- "WORKRAIL_LOG_LEVEL": "INFO",
425
- "WORKFLOW_GIT_REPOS": "https://github.com/org/workflows.git"
426
- }
213
+ "id": "my-review-checklist",
214
+ "name": "Team Code Review",
215
+ "version": "1.0.0",
216
+ "description": "Our standard review process",
217
+ "steps": [
218
+ {
219
+ "id": "check-tests",
220
+ "title": "Verify Test Coverage",
221
+ "prompt": "Check that new code has tests. List untested paths.",
222
+ "agentRole": "You are a reviewer focused on test coverage."
223
+ },
224
+ {
225
+ "id": "check-security",
226
+ "title": "Security Review",
227
+ "prompt": "Look for: injection risks, auth issues, data exposure.",
228
+ "agentRole": "You are a security-focused reviewer."
427
229
  }
428
- }
230
+ ]
429
231
  }
430
232
  ```
431
233
 
432
- Logs are written to **stderr** (stdout is reserved for MCP protocol), so they appear in your MCP client's logs (e.g., Firebender, Claude Desktop).
433
-
434
- ### Priority Order
234
+ WorkRail discovers it automatically. This is a minimal example - workflows also
235
+ support [conditions, loops, validation criteria](docs/authoring.md), and more.
435
236
 
436
- Workflows are loaded with this priority (later sources override earlier):
437
- 1. Bundled (built-in workflows)
438
- 2. Plugins (npm packages)
439
- 3. User directory (`~/.workrail/workflows`)
440
- 4. Custom paths (`WORKFLOW_STORAGE_PATH`)
441
- 5. Git repositories (`WORKFLOW_GIT_REPOS`)
442
- 6. Project directory (`./workflows`)
237
+ [Writing workflows →](docs/authoring.md) · [Load from Git →](docs/configuration.md#git-repositories)
443
238
 
444
239
  ---
445
240
 
446
- ## 🚀 Planned Features
241
+ ## Documentation
447
242
 
448
- WorkRail is actively evolving. Here are key enhancements on the roadmap:
449
-
450
- ### **Workflow State Management**
451
- - **Save & Resume** - Generate workflow state summaries for resuming complex workflows in new chat sessions
452
- - **Context Preservation** - Maintain workflow progress across conversation boundaries
453
- - **Checkpoint System** - Save progress at key milestones for easy recovery
454
-
455
- ### **Model Switching Guidance**
456
- Workflows could recommend optimal models for specific steps:
457
- - **Analysis steps** → Tool-use heavy models (Claude) for codebase exploration
458
- - **Planning/design** → Smartest available models for strategic thinking
459
- - **Implementation** → Cost-effective models once requirements are clear
460
-
461
- *Note: WorkRail provides text recommendations to users, not automatic model switching*
462
-
463
- ### **Enhanced Workflow Management**
464
- - ✅ ~~**Dynamic Workflow Loading**~~ - **IMPLEMENTED in v0.6+** (Git repositories)
465
- - **Workflow Categories** - Organize workflows by domain (debugging, planning, review, etc.)
466
- - **Reusable Components** - Plugin system for common workflow patterns (codebase analysis, document creation, etc.)
467
- - **Schema Versioning** - Backwards-compatible workflow schema evolution
468
- - **Workflow Templates** - Create workflows from templates via CLI
469
-
470
- ### **Advanced Validation & Quality**
471
- - **Custom Validation Functions** - Domain-specific output validation beyond basic schema checks
472
- - **Integration Hooks** - Connect with external quality tools and linters
473
- - **Performance Validation** - Ensure workflow outputs meet performance criteria
474
- - **Length Validation Optimization** - Faster validation using terminal commands vs. full content rewrite
475
-
476
- ### **Workflow Discovery & Intelligence**
477
- - **Smart Workflow Suggestions** - Recommend workflows based on task context
478
- - **Pattern Recognition** - Identify when existing codebase patterns should inform workflow steps
243
+ - [All Workflows](docs/workflows.md) Full list with detailed descriptions
244
+ - [Writing Workflows](docs/authoring.md) – Custom workflow creation guide
245
+ - [Configuration](docs/configuration.md) Git repos, environment variables, local paths
246
+ - [Advanced Features](docs/advanced.md) Loops, conditionals, validation
479
247
 
480
248
  ---
481
- *Have ideas for WorkRail? The planned features list helps guide development priorities.*
482
-
483
- ---
484
-
485
- ## 📚 Learn More
486
-
487
- - **[Complete Overview](workrail-mcp-overview.md)** - Deep dive into architecture, philosophy, and detailed examples
488
- - **[Loop Documentation](docs/features/loops.md)** - Advanced iteration patterns
489
- - **[API Specification](spec/mcp-api-v1.0.md)** - Complete MCP API reference
490
- - **[Internal Documentation](docs/README.md)** - Development and architecture guides
491
-
492
- ---
493
-
494
- ## 📄 License
495
249
 
496
- MIT License - see [LICENSE](LICENSE)
250
+ [GitHub](https://github.com/EtienneBBeaulac/workrail) · MIT License