@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.
- package/README.md +157 -403
- package/dist/application/services/enhanced-loop-validator.d.ts +2 -2
- package/dist/application/services/enhanced-loop-validator.js +12 -2
- package/dist/application/services/validation-engine.d.ts +8 -29
- package/dist/application/services/validation-engine.js +38 -21
- package/dist/application/services/workflow-compiler.d.ts +18 -0
- package/dist/application/services/workflow-compiler.js +79 -0
- package/dist/application/services/workflow-interpreter.d.ts +31 -0
- package/dist/application/services/workflow-interpreter.js +280 -0
- package/dist/application/services/workflow-service.d.ts +34 -32
- package/dist/application/services/workflow-service.js +93 -425
- package/dist/application/use-cases/get-next-step.d.ts +6 -10
- package/dist/application/use-cases/get-next-step.js +2 -6
- package/dist/application/use-cases/get-workflow.d.ts +8 -6
- package/dist/application/use-cases/get-workflow.js +42 -33
- package/dist/application/use-cases/list-workflows.d.ts +3 -3
- package/dist/application/use-cases/validate-step-output.d.ts +4 -4
- package/dist/application/use-cases/validate-workflow-file.d.ts +46 -0
- package/dist/application/use-cases/validate-workflow-file.js +57 -0
- package/dist/cli/commands/cleanup.d.ts +8 -0
- package/dist/cli/commands/cleanup.js +20 -0
- package/dist/cli/commands/index.d.ts +7 -0
- package/dist/cli/commands/index.js +21 -0
- package/dist/cli/commands/init.d.ts +11 -0
- package/dist/cli/commands/init.js +49 -0
- package/dist/cli/commands/list.d.ts +9 -0
- package/dist/cli/commands/list.js +34 -0
- package/dist/cli/commands/migrate.d.ts +78 -0
- package/dist/cli/commands/migrate.js +248 -0
- package/dist/cli/commands/sources.d.ts +21 -0
- package/dist/cli/commands/sources.js +87 -0
- package/dist/cli/commands/start.d.ts +8 -0
- package/dist/cli/commands/start.js +16 -0
- package/dist/cli/commands/validate.d.ts +6 -0
- package/dist/cli/commands/validate.js +55 -0
- package/dist/cli/interpret-result.d.ts +4 -0
- package/dist/cli/interpret-result.js +24 -0
- package/dist/cli/output-formatter.d.ts +10 -0
- package/dist/cli/output-formatter.js +97 -0
- package/dist/cli/types/cli-result.d.ts +23 -0
- package/dist/cli/types/cli-result.js +30 -0
- package/dist/cli/types/exit-code.d.ts +13 -0
- package/dist/cli/types/exit-code.js +23 -0
- package/dist/cli/types/index.d.ts +4 -0
- package/dist/cli/types/index.js +11 -0
- package/dist/cli.js +84 -278
- package/dist/config/app-config.d.ts +40 -0
- package/dist/config/app-config.js +58 -0
- package/dist/config/feature-flags.d.ts +10 -2
- package/dist/config/feature-flags.js +74 -12
- package/dist/core/error-handler.d.ts +18 -27
- package/dist/core/error-handler.js +24 -218
- package/dist/di/container.d.ts +12 -0
- package/dist/di/container.js +244 -0
- package/dist/di/tokens.d.ts +40 -0
- package/dist/di/tokens.js +42 -0
- package/dist/domain/execution/error.d.ts +32 -0
- package/dist/domain/execution/error.js +24 -0
- package/dist/domain/execution/event.d.ts +7 -0
- package/dist/domain/execution/event.js +11 -0
- package/dist/domain/execution/ids.d.ts +9 -0
- package/dist/domain/execution/ids.js +9 -0
- package/dist/domain/execution/result.d.ts +3 -0
- package/dist/domain/execution/result.js +10 -0
- package/dist/domain/execution/state.d.ts +57 -0
- package/dist/domain/execution/state.js +28 -0
- package/dist/errors/app-error.d.ts +23 -0
- package/dist/errors/factories.d.ts +6 -0
- package/dist/errors/factories.js +21 -0
- package/dist/errors/formatter.d.ts +2 -0
- package/dist/errors/formatter.js +32 -0
- package/dist/errors/index.d.ts +3 -0
- package/dist/errors/index.js +7 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +10 -25
- package/dist/infrastructure/index.d.ts +0 -1
- package/dist/infrastructure/index.js +0 -1
- package/dist/infrastructure/session/DashboardHeartbeat.d.ts +8 -0
- package/dist/infrastructure/session/DashboardHeartbeat.js +39 -0
- package/dist/infrastructure/session/DashboardLockRelease.d.ts +2 -0
- package/dist/infrastructure/session/DashboardLockRelease.js +29 -0
- package/dist/infrastructure/session/HttpServer.d.ts +25 -6
- package/dist/infrastructure/session/HttpServer.js +245 -90
- package/dist/infrastructure/session/SessionDataNormalizer.js +12 -2
- package/dist/infrastructure/session/SessionDataValidator.js +12 -2
- package/dist/infrastructure/session/SessionManager.d.ts +5 -3
- package/dist/infrastructure/session/SessionManager.js +52 -6
- package/dist/infrastructure/storage/caching-workflow-storage.d.ts +30 -6
- package/dist/infrastructure/storage/caching-workflow-storage.js +105 -23
- package/dist/infrastructure/storage/enhanced-multi-source-workflow-storage.d.ts +13 -9
- package/dist/infrastructure/storage/enhanced-multi-source-workflow-storage.js +80 -54
- package/dist/infrastructure/storage/file-workflow-storage.d.ts +10 -8
- package/dist/infrastructure/storage/file-workflow-storage.js +48 -56
- package/dist/infrastructure/storage/git-workflow-storage.d.ts +7 -22
- package/dist/infrastructure/storage/git-workflow-storage.js +48 -103
- package/dist/infrastructure/storage/in-memory-storage.d.ts +10 -6
- package/dist/infrastructure/storage/in-memory-storage.js +18 -13
- package/dist/infrastructure/storage/plugin-workflow-storage.d.ts +6 -18
- package/dist/infrastructure/storage/plugin-workflow-storage.js +29 -51
- package/dist/infrastructure/storage/remote-workflow-storage.d.ts +8 -17
- package/dist/infrastructure/storage/remote-workflow-storage.js +33 -156
- package/dist/infrastructure/storage/schema-validating-workflow-storage.d.ts +21 -13
- package/dist/infrastructure/storage/schema-validating-workflow-storage.js +86 -24
- package/dist/infrastructure/storage/storage.d.ts +7 -5
- package/dist/infrastructure/storage/storage.js +7 -6
- package/dist/manifest.json +1093 -0
- package/dist/mcp/error-mapper.d.ts +9 -0
- package/dist/mcp/error-mapper.js +66 -0
- package/dist/mcp/handlers/session.d.ts +34 -0
- package/dist/mcp/handlers/session.js +135 -0
- package/dist/mcp/handlers/v2-workflow.d.ts +4 -0
- package/dist/mcp/handlers/v2-workflow.js +112 -0
- package/dist/mcp/handlers/workflow.d.ts +45 -0
- package/dist/mcp/handlers/workflow.js +167 -0
- package/dist/mcp/index.d.ts +16 -0
- package/dist/mcp/index.js +51 -0
- package/dist/mcp/output-schemas.d.ts +317 -0
- package/dist/mcp/output-schemas.js +91 -0
- package/dist/mcp/server.d.ts +3 -0
- package/dist/mcp/server.js +258 -0
- package/dist/mcp/tool-description-provider.d.ts +16 -0
- package/dist/mcp/tool-description-provider.js +43 -0
- package/dist/mcp/tool-descriptions.d.ts +2 -0
- package/dist/mcp/tool-descriptions.js +109 -0
- package/dist/mcp/tool-factory.d.ts +23 -0
- package/dist/mcp/tool-factory.js +14 -0
- package/dist/mcp/tools.d.ts +156 -0
- package/dist/mcp/tools.js +196 -0
- package/dist/mcp/types/tool-description-types.d.ts +8 -0
- package/dist/mcp/types/tool-description-types.js +24 -0
- package/dist/mcp/types.d.ts +25 -0
- package/dist/mcp/types.js +15 -0
- package/dist/mcp/v2/tool-registry.d.ts +11 -0
- package/dist/mcp/v2/tool-registry.js +26 -0
- package/dist/mcp/v2/tools.d.ts +20 -0
- package/dist/mcp/v2/tools.js +17 -0
- package/dist/mcp/validation/bounded-json.d.ts +3 -0
- package/dist/mcp/validation/bounded-json.js +22 -0
- package/dist/mcp/validation/workflow-next-prevalidate.d.ts +9 -0
- package/dist/mcp/validation/workflow-next-prevalidate.js +83 -0
- package/dist/mcp/zod-to-json-schema.d.ts +17 -0
- package/dist/mcp/zod-to-json-schema.js +134 -0
- package/dist/mcp-server.d.ts +1 -1
- package/dist/mcp-server.js +6 -424
- package/dist/runtime/adapters/in-memory-shutdown-events.d.ts +6 -0
- package/dist/runtime/adapters/in-memory-shutdown-events.js +20 -0
- package/dist/runtime/adapters/node-process-signals.d.ts +4 -0
- package/dist/runtime/adapters/node-process-signals.js +11 -0
- package/dist/runtime/adapters/node-process-terminator.d.ts +4 -0
- package/dist/runtime/adapters/node-process-terminator.js +17 -0
- package/dist/runtime/adapters/noop-process-signals.d.ts +4 -0
- package/dist/runtime/adapters/noop-process-signals.js +8 -0
- package/dist/runtime/adapters/throwing-process-terminator.d.ts +4 -0
- package/dist/runtime/adapters/throwing-process-terminator.js +9 -0
- package/dist/runtime/assert-never.d.ts +1 -0
- package/dist/runtime/assert-never.js +6 -0
- package/dist/runtime/brand.d.ts +5 -0
- package/dist/runtime/ports/process-signals.d.ts +4 -0
- package/dist/runtime/ports/process-signals.js +2 -0
- package/dist/runtime/ports/process-terminator.d.ts +8 -0
- package/dist/runtime/ports/process-terminator.js +2 -0
- package/dist/runtime/ports/shutdown-events.d.ts +11 -0
- package/dist/runtime/ports/shutdown-events.js +2 -0
- package/dist/runtime/process-lifecycle-policy.d.ts +5 -0
- package/dist/runtime/process-lifecycle-policy.js +2 -0
- package/dist/runtime/result.d.ts +17 -0
- package/dist/runtime/result.js +31 -0
- package/dist/runtime/runtime-mode.d.ts +9 -0
- package/dist/runtime/runtime-mode.js +2 -0
- package/dist/types/storage.d.ts +16 -5
- package/dist/types/storage.js +8 -0
- package/dist/types/validation.d.ts +27 -0
- package/dist/types/validation.js +10 -0
- package/dist/types/workflow-definition.d.ts +63 -0
- package/dist/types/workflow-definition.js +33 -0
- package/dist/types/workflow-source.d.ts +51 -0
- package/dist/types/workflow-source.js +128 -0
- package/dist/types/workflow.d.ts +28 -0
- package/dist/types/workflow.js +96 -0
- package/dist/utils/workflow-init.d.ts +1 -0
- package/dist/utils/workflow-init.js +38 -0
- package/dist/v2/durable-core/canonical/hashing.d.ts +11 -0
- package/dist/v2/durable-core/canonical/hashing.js +13 -0
- package/dist/v2/durable-core/canonical/jcs.d.ts +11 -0
- package/dist/v2/durable-core/canonical/jcs.js +65 -0
- package/dist/v2/durable-core/canonical/json-types.d.ts +6 -0
- package/dist/v2/durable-core/canonical/json-types.js +2 -0
- package/dist/v2/durable-core/canonical/json-zod.d.ts +2 -0
- package/dist/v2/durable-core/canonical/json-zod.js +7 -0
- package/dist/v2/durable-core/canonical/jsonl.d.ts +4 -0
- package/dist/v2/durable-core/canonical/jsonl.js +13 -0
- package/dist/v2/durable-core/ids/index.d.ts +23 -0
- package/dist/v2/durable-core/ids/index.js +46 -0
- package/dist/v2/durable-core/schemas/compiled-workflow/index.d.ts +47 -0
- package/dist/v2/durable-core/schemas/compiled-workflow/index.js +17 -0
- package/dist/v2/durable-core/schemas/session/events.d.ts +1812 -0
- package/dist/v2/durable-core/schemas/session/events.js +328 -0
- package/dist/v2/durable-core/schemas/session/index.d.ts +2 -0
- package/dist/v2/durable-core/schemas/session/index.js +8 -0
- package/dist/v2/durable-core/schemas/session/manifest.d.ts +57 -0
- package/dist/v2/durable-core/schemas/session/manifest.js +30 -0
- package/dist/v2/infra/local/crypto/index.d.ts +5 -0
- package/dist/v2/infra/local/crypto/index.js +12 -0
- package/dist/v2/infra/local/data-dir/index.d.ts +13 -0
- package/dist/v2/infra/local/data-dir/index.js +69 -0
- package/dist/v2/infra/local/fs/index.d.ts +26 -0
- package/dist/v2/infra/local/fs/index.js +156 -0
- package/dist/v2/infra/local/pinned-workflow-store/index.d.ts +11 -0
- package/dist/v2/infra/local/pinned-workflow-store/index.js +85 -0
- package/dist/v2/infra/local/session-lock/index.d.ts +12 -0
- package/dist/v2/infra/local/session-lock/index.js +44 -0
- package/dist/v2/infra/local/session-store/index.d.ts +22 -0
- package/dist/v2/infra/local/session-store/index.js +358 -0
- package/dist/v2/infra/local/sha256/index.d.ts +5 -0
- package/dist/v2/infra/local/sha256/index.js +12 -0
- package/dist/v2/ports/data-dir.port.d.ts +9 -0
- package/dist/v2/ports/data-dir.port.js +2 -0
- package/dist/v2/ports/fs.port.d.ts +41 -0
- package/dist/v2/ports/fs.port.js +2 -0
- package/dist/v2/ports/pinned-workflow-store.port.d.ts +11 -0
- package/dist/v2/ports/pinned-workflow-store.port.js +2 -0
- package/dist/v2/ports/session-event-log-store.port.d.ts +37 -0
- package/dist/v2/ports/session-event-log-store.port.js +2 -0
- package/dist/v2/ports/session-lock.port.d.ts +23 -0
- package/dist/v2/ports/session-lock.port.js +2 -0
- package/dist/v2/ports/sha256.port.d.ts +4 -0
- package/dist/v2/ports/sha256.port.js +2 -0
- package/dist/v2/projections/advance-outcomes.d.ts +23 -0
- package/dist/v2/projections/advance-outcomes.js +23 -0
- package/dist/v2/projections/capabilities.d.ts +27 -0
- package/dist/v2/projections/capabilities.js +33 -0
- package/dist/v2/projections/gaps.d.ts +29 -0
- package/dist/v2/projections/gaps.js +49 -0
- package/dist/v2/projections/node-outputs.d.ts +34 -0
- package/dist/v2/projections/node-outputs.js +73 -0
- package/dist/v2/projections/preferences.d.ts +28 -0
- package/dist/v2/projections/preferences.js +50 -0
- package/dist/v2/projections/run-dag.d.ts +42 -0
- package/dist/v2/projections/run-dag.js +186 -0
- package/dist/v2/projections/run-status-signals.d.ts +26 -0
- package/dist/v2/projections/run-status-signals.js +49 -0
- package/dist/v2/projections/session-health.d.ts +18 -0
- package/dist/v2/projections/session-health.js +15 -0
- package/dist/v2/read-only/v1-to-v2-shim.d.ts +3 -0
- package/dist/v2/read-only/v1-to-v2-shim.js +38 -0
- package/package.json +35 -10
- package/spec/mcp-api-v1.0.md +5 -5
- package/web/assets/services/data-normalizer.js +17 -2
- package/web/assets/services/pattern-recognizer.js +3 -1
- package/web/assets/services/session-data.js +13 -8
- package/web/assets/utils/formatters.js +34 -23
- package/workflows/CHANGELOG-bug-investigation.md +4 -4
- package/workflows/bug-investigation.agentic.json +156 -56
- package/workflows/coding-task-workflow-agentic.json +262 -0
- package/workflows/design-thinking-workflow-autonomous.agentic.json +215 -0
- package/workflows/design-thinking-workflow.json +198 -0
- package/workflows/mr-review-workflow.agentic.json +538 -0
- package/workflows/routines/context-gathering.json +0 -4
- package/workflows/routines/ideation.json +73 -0
- package/dist/application/app.d.ts +0 -29
- package/dist/application/app.d.ts.map +0 -1
- package/dist/application/app.js +0 -114
- package/dist/application/app.js.map +0 -1
- package/dist/application/decorators/simple-output-decorator.d.ts +0 -8
- package/dist/application/decorators/simple-output-decorator.js +0 -89
- package/dist/application/services/classification-engine.d.ts +0 -33
- package/dist/application/services/classification-engine.js +0 -258
- package/dist/application/services/compression-service.d.ts +0 -20
- package/dist/application/services/compression-service.js +0 -312
- package/dist/application/services/context-management-service.d.ts +0 -38
- package/dist/application/services/context-management-service.js +0 -301
- package/dist/application/services/context-optimizer.d.ts +0 -11
- package/dist/application/services/context-optimizer.js +0 -62
- package/dist/application/services/context-persistence-service.d.ts +0 -45
- package/dist/application/services/context-persistence-service.js +0 -273
- package/dist/application/services/documentation-service.d.ts +0 -20
- package/dist/application/services/documentation-service.js +0 -155
- package/dist/application/services/enhanced-error-service.d.ts.map +0 -1
- package/dist/application/services/enhanced-error-service.js.map +0 -1
- package/dist/application/services/loop-context-optimizer.d.ts +0 -8
- package/dist/application/services/loop-context-optimizer.js +0 -114
- package/dist/application/services/loop-execution-context.d.ts +0 -23
- package/dist/application/services/loop-execution-context.js +0 -188
- package/dist/application/services/loop-step-resolver.d.ts +0 -11
- package/dist/application/services/loop-step-resolver.js +0 -70
- package/dist/application/services/validation-engine.d.ts.map +0 -1
- package/dist/application/services/validation-engine.js.map +0 -1
- package/dist/application/services/workflow-service.d.ts.map +0 -1
- package/dist/application/services/workflow-service.js.map +0 -1
- package/dist/application/use-cases/get-next-step.d.ts.map +0 -1
- package/dist/application/use-cases/get-next-step.js.map +0 -1
- package/dist/application/use-cases/get-workflow-docs.d.ts +0 -4
- package/dist/application/use-cases/get-workflow-docs.js +0 -12
- package/dist/application/use-cases/get-workflow.d.ts.map +0 -1
- package/dist/application/use-cases/get-workflow.js.map +0 -1
- package/dist/application/use-cases/get-workrail-help.d.ts +0 -4
- package/dist/application/use-cases/get-workrail-help.js +0 -12
- package/dist/application/use-cases/list-workflows.d.ts.map +0 -1
- package/dist/application/use-cases/list-workflows.js.map +0 -1
- package/dist/application/use-cases/validate-step-output.d.ts.map +0 -1
- package/dist/application/use-cases/validate-step-output.js.map +0 -1
- package/dist/application/use-cases/validate-workflow-json.d.ts.map +0 -1
- package/dist/application/use-cases/validate-workflow-json.js.map +0 -1
- package/dist/application/validation.d.ts.map +0 -1
- package/dist/application/validation.js.map +0 -1
- package/dist/cli/migrate-workflow.d.ts +0 -22
- package/dist/cli/migrate-workflow.js +0 -196
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/container.d.ts +0 -15
- package/dist/container.d.ts.map +0 -1
- package/dist/container.js +0 -25
- package/dist/container.js.map +0 -1
- package/dist/core/error-handler.d.ts.map +0 -1
- package/dist/core/error-handler.js.map +0 -1
- package/dist/domain/index.d.ts +0 -2
- package/dist/domain/index.d.ts.map +0 -1
- package/dist/domain/index.js +0 -18
- package/dist/domain/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/infrastructure/index.d.ts.map +0 -1
- package/dist/infrastructure/index.js.map +0 -1
- package/dist/infrastructure/rpc/handler.d.ts +0 -17
- package/dist/infrastructure/rpc/handler.d.ts.map +0 -1
- package/dist/infrastructure/rpc/handler.js +0 -78
- package/dist/infrastructure/rpc/handler.js.map +0 -1
- package/dist/infrastructure/rpc/index.d.ts +0 -1
- package/dist/infrastructure/rpc/index.d.ts.map +0 -1
- package/dist/infrastructure/rpc/index.js +0 -17
- package/dist/infrastructure/rpc/index.js.map +0 -1
- package/dist/infrastructure/rpc/server.d.ts +0 -3
- package/dist/infrastructure/rpc/server.d.ts.map +0 -1
- package/dist/infrastructure/rpc/server.js +0 -37
- package/dist/infrastructure/rpc/server.js.map +0 -1
- package/dist/infrastructure/storage/caching-workflow-storage.d.ts.map +0 -1
- package/dist/infrastructure/storage/caching-workflow-storage.js.map +0 -1
- package/dist/infrastructure/storage/context-storage.d.ts +0 -150
- package/dist/infrastructure/storage/context-storage.js +0 -40
- package/dist/infrastructure/storage/file-workflow-storage.d.ts.map +0 -1
- package/dist/infrastructure/storage/file-workflow-storage.js.map +0 -1
- package/dist/infrastructure/storage/filesystem-blob-storage.d.ts +0 -27
- package/dist/infrastructure/storage/filesystem-blob-storage.js +0 -363
- package/dist/infrastructure/storage/git-workflow-storage.d.ts.map +0 -1
- package/dist/infrastructure/storage/git-workflow-storage.js.map +0 -1
- package/dist/infrastructure/storage/hybrid-context-storage.d.ts +0 -29
- package/dist/infrastructure/storage/hybrid-context-storage.js +0 -400
- package/dist/infrastructure/storage/in-memory-storage.d.ts.map +0 -1
- package/dist/infrastructure/storage/in-memory-storage.js.map +0 -1
- package/dist/infrastructure/storage/index.d.ts.map +0 -1
- package/dist/infrastructure/storage/index.js.map +0 -1
- package/dist/infrastructure/storage/migrations/001_initial_schema.sql +0 -38
- package/dist/infrastructure/storage/migrations/002_context_concurrency_enhancements.sql +0 -234
- package/dist/infrastructure/storage/migrations/003_classification_overrides.sql +0 -20
- package/dist/infrastructure/storage/multi-directory-workflow-storage.d.ts +0 -32
- package/dist/infrastructure/storage/multi-directory-workflow-storage.d.ts.map +0 -1
- package/dist/infrastructure/storage/multi-directory-workflow-storage.js +0 -184
- package/dist/infrastructure/storage/multi-directory-workflow-storage.js.map +0 -1
- package/dist/infrastructure/storage/plugin-workflow-storage.d.ts.map +0 -1
- package/dist/infrastructure/storage/plugin-workflow-storage.js.map +0 -1
- package/dist/infrastructure/storage/remote-workflow-storage.d.ts.map +0 -1
- package/dist/infrastructure/storage/remote-workflow-storage.js.map +0 -1
- package/dist/infrastructure/storage/schema-validating-workflow-storage.d.ts.map +0 -1
- package/dist/infrastructure/storage/schema-validating-workflow-storage.js.map +0 -1
- package/dist/infrastructure/storage/sqlite-metadata-storage.d.ts +0 -35
- package/dist/infrastructure/storage/sqlite-metadata-storage.js +0 -410
- package/dist/infrastructure/storage/sqlite-migrator.d.ts +0 -46
- package/dist/infrastructure/storage/sqlite-migrator.js +0 -293
- package/dist/infrastructure/storage/storage.d.ts.map +0 -1
- package/dist/infrastructure/storage/storage.js.map +0 -1
- package/dist/mcp-server.d.ts.map +0 -1
- package/dist/mcp-server.js.map +0 -1
- package/dist/tools/mcp_initialize.d.ts +0 -2
- package/dist/tools/mcp_initialize.d.ts.map +0 -1
- package/dist/tools/mcp_initialize.js +0 -45
- package/dist/tools/mcp_initialize.js.map +0 -1
- package/dist/tools/mcp_shutdown.d.ts +0 -2
- package/dist/tools/mcp_shutdown.d.ts.map +0 -1
- package/dist/tools/mcp_shutdown.js +0 -10
- package/dist/tools/mcp_shutdown.js.map +0 -1
- package/dist/tools/mcp_tools_list.d.ts +0 -2
- package/dist/tools/mcp_tools_list.d.ts.map +0 -1
- package/dist/tools/mcp_tools_list.js +0 -60
- package/dist/tools/mcp_tools_list.js.map +0 -1
- package/dist/tools/session-tools.d.ts +0 -5
- package/dist/tools/session-tools.js +0 -270
- package/dist/types/context-types.d.ts +0 -236
- package/dist/types/context-types.js +0 -10
- package/dist/types/documentation-types.d.ts +0 -37
- package/dist/types/loop-context-optimizer.d.ts +0 -7
- package/dist/types/mcp-types.d.ts +0 -273
- package/dist/types/mcp-types.d.ts.map +0 -1
- package/dist/types/mcp-types.js +0 -19
- package/dist/types/mcp-types.js.map +0 -1
- package/dist/types/server.d.ts.map +0 -1
- package/dist/types/server.js.map +0 -1
- package/dist/types/storage.d.ts.map +0 -1
- package/dist/types/storage.js.map +0 -1
- package/dist/types/workflow-types.d.ts +0 -336
- package/dist/types/workflow-types.d.ts.map +0 -1
- package/dist/types/workflow-types.js +0 -20
- package/dist/types/workflow-types.js.map +0 -1
- package/dist/utils/condition-evaluator.d.ts.map +0 -1
- package/dist/utils/condition-evaluator.js.map +0 -1
- package/dist/utils/config.d.ts +0 -149
- package/dist/utils/config.d.ts.map +0 -1
- package/dist/utils/config.js +0 -251
- package/dist/utils/config.js.map +0 -1
- package/dist/utils/storage-security.d.ts.map +0 -1
- package/dist/utils/storage-security.js.map +0 -1
- package/dist/validation/request-validator.d.ts +0 -8
- package/dist/validation/request-validator.d.ts.map +0 -1
- package/dist/validation/request-validator.js +0 -32
- package/dist/validation/request-validator.js.map +0 -1
- package/dist/validation/response-validator.d.ts +0 -8
- package/dist/validation/response-validator.d.ts.map +0 -1
- package/dist/validation/response-validator.js +0 -110
- package/dist/validation/response-validator.js.map +0 -1
- package/dist/validation/schemas.d.ts +0 -1
- package/dist/validation/schemas.d.ts.map +0 -1
- package/dist/validation/schemas.js +0 -53
- package/dist/validation/schemas.js.map +0 -1
- /package/dist/{types/documentation-types.js → errors/app-error.js} +0 -0
- /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="
|
|
3
|
-
<h1>WorkRail
|
|
4
|
-
<p
|
|
5
|
-
|
|
6
|
-
[](https://modelcontextprotocol.org)
|
|
7
|
-
[](https://www.npmjs.com/package/@exaudeus/workrail)
|
|
8
|
-
[](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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
+
[](https://www.npmjs.com/package/@exaudeus/workrail)
|
|
7
|
+
[](https://modelcontextprotocol.org)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
</div>
|
|
33
10
|
|
|
34
11
|
---
|
|
35
12
|
|
|
36
|
-
##
|
|
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
|
-
|
|
15
|
+
AI agents are eager to help. Too eager.
|
|
49
16
|
|
|
50
|
-
|
|
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
|
-
|
|
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
|
-
**
|
|
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
|
-
##
|
|
71
|
-
|
|
72
|
-
WorkRail exposes 6 core tools through the Model Context Protocol:
|
|
29
|
+
## How WorkRail Works
|
|
73
30
|
|
|
74
|
-
|
|
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
|
-
|
|
37
|
+
**The agent can't skip to implementation because it doesn't know those steps exist yet.**
|
|
84
38
|
|
|
85
|
-
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
-
###
|
|
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
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
113
|
+
Each step follows a pattern that prevents common AI failure modes:
|
|
184
114
|
|
|
185
|
-
|
|
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
|
-
###
|
|
121
|
+
### Why This Beats System Prompts
|
|
197
122
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
-
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
251
|
-
workrail list
|
|
149
|
+
> "Use the bug-investigation workflow to debug this auth issue"
|
|
252
150
|
|
|
253
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
284
|
-
-
|
|
285
|
-
-
|
|
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
|
-
##
|
|
165
|
+
## Included Workflows
|
|
290
166
|
|
|
291
|
-
|
|
167
|
+
20+ workflows included for development, debugging, review, documentation, and more:
|
|
292
168
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
-
|
|
296
|
-
-
|
|
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
|
-
|
|
177
|
+
Workflows adapt to complexity - simple tasks get fast-tracked, complex tasks get full rigor.
|
|
299
178
|
|
|
300
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
###
|
|
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
|
-
|
|
344
|
-
|
|
345
|
-
|
|
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
|
-
|
|
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
|
-
|
|
361
|
-
|
|
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
|
-
##
|
|
207
|
+
## Create Your Own
|
|
369
208
|
|
|
370
|
-
|
|
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
|
-
"
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
241
|
+
## Documentation
|
|
447
242
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
-
|
|
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
|
-
|
|
250
|
+
[GitHub](https://github.com/EtienneBBeaulac/workrail) · MIT License
|