@exaudeus/workrail 0.8.6 → 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 +45 -39
- 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/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/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
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "coding-task-workflow-agentic",
|
|
3
|
+
"name": "Agentic Task Dev Workflow (Invariants • Architecture • Vertical Slices • PR Sizing • Subagent Audits)",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "A less-restrictive, reflection-heavy task development workflow aligned with WorkRail’s agentic philosophy: create invariants, capture architecture decisions, plan vertical slices, right-size PRs, iterate via audits (plan/context/validation), and implement slice-by-slice with checkpoints and resume support.",
|
|
6
|
+
"preconditions": [
|
|
7
|
+
"User provides a task description (ticket text or equivalent) and success criteria (even if partial).",
|
|
8
|
+
"Agent has read access to the codebase and can use tools (search/read/edit/terminal).",
|
|
9
|
+
"A validation path exists (tests, build, or a deterministic verification strategy).",
|
|
10
|
+
"If the task touches production or critical paths, rollback/flag strategy can be defined."
|
|
11
|
+
],
|
|
12
|
+
"clarificationPrompts": [
|
|
13
|
+
"What are the acceptance criteria and explicit non-goals?",
|
|
14
|
+
"What are the key invariants? (backwards compatibility, API contracts, data correctness, performance budgets, security constraints)",
|
|
15
|
+
"Any rollout constraints? (feature flags, staged rollout, migrations, telemetry requirements)",
|
|
16
|
+
"Any constraints on tooling? (can/can’t run tests locally, CI only, limited environment access)",
|
|
17
|
+
"Any preferred code patterns/examples in this repo that should be followed?"
|
|
18
|
+
],
|
|
19
|
+
"metaGuidance": [
|
|
20
|
+
"DEFAULT BEHAVIOR: self-execute with tools. Only ask the user for (a) business decisions, (b) missing external artifacts, or (c) permissions/constraints you cannot resolve.",
|
|
21
|
+
"ARCHITECTURE OVER PATCHES: prefer structural fixes that eliminate whole classes of issues; avoid local patches unless they are explicitly intended.",
|
|
22
|
+
"INVARIANTS FIRST: define constraints before designing or coding; use invariants to evaluate plan/slices/PR size.",
|
|
23
|
+
"CONTEXT DOC: For non-small tasks, create a base CONTEXT.md early (chat-first; write the file if possible). Never commit documentation files unless the user explicitly asks.",
|
|
24
|
+
"USER RULES: Capture user rules/preferences early as `userRules` (in CONTEXT.md). When ideating and planning, explicitly apply `userRules` and call out deviations with rationale + approval request.",
|
|
25
|
+
"VERTICAL SLICES: plan and implement as independently testable, reviewable slices; each slice should be mergeable and ideally shippable behind a flag.",
|
|
26
|
+
"PR/MR SIZING: avoid monster PRs; if scope is large, split into multiple PRs by slices with explicit dependencies.",
|
|
27
|
+
"REFLECTION LOOPS: iterate on context and plan with bounded loops; audit yourself before coding and before finalizing.",
|
|
28
|
+
"SUBAGENTS: delegate ONLY when a step explicitly instructs delegation; prefer auditor-style delegation (challenge/audit/validate) over executor-style delegation.",
|
|
29
|
+
"VALIDATION: prefer compile-time safety and deterministic tests; verify each slice before moving on; fail fast with meaningful errors."
|
|
30
|
+
],
|
|
31
|
+
"steps": [
|
|
32
|
+
{
|
|
33
|
+
"id": "phase-0-triage-and-mode",
|
|
34
|
+
"title": "Phase 0: Triage (Complexity • Risk • Automation • Doc Depth • PR Strategy)",
|
|
35
|
+
"prompt": "**ANALYZE** the task and classify with deterministic criteria.\n\n## 0) Rigor mode (deterministic)\nSelect **rigorMode**: QUICK / STANDARD / THOROUGH.\n\nScore each criterion 0–2 and sum. Use the table:\n- **Scope breadth** (files/areas touched): 0=1–2 files, 1=multi-file but single area, 2=multi-area\n- **Risk level**: 0=low, 1=moderate, 2=high (security/auth/data loss/release pipeline/perf critical)\n- **Uncertainty**: 0=clear requirements + known code path, 1=some ambiguity, 2=unknowns/missing acceptance criteria\n- **Repro difficulty**: 0=deterministic + local, 1=some async/edge cases, 2=flaky/CI-only/racy\n- **Externalities**: 0=internal-only, 1=some external deps, 2=publishing/infra/3rd-party integration\n\nDecision:\n- 0–2 → **QUICK**\n- 3–5 → **STANDARD**\n- 6–10 → **THOROUGH**\n\nAlso set:\n- QUICK: `auditDepth=light`, `maxQuestions=1`, `maxParallelism=0`\n- STANDARD: `auditDepth=normal`, `maxQuestions=3`, `maxParallelism=1`\n- THOROUGH: `auditDepth=deep`, `maxQuestions=5`, `maxParallelism=3`\n\n## 1) taskComplexity\nSmall / Medium / Large\n- Small: 1–2 files, low risk, clear change, minimal ambiguity\n- Medium: multi-file, moderate risk, some ambiguity, needs planning\n- Large: architectural impact, multiple systems, high risk/unknowns\n\n## 2) riskLevel\nLow / Medium / High\n- High if: auth/payments/security/data integrity/perf-sensitive/production incident/release pipeline\n\n## 3) automationLevel\nHigh / Medium / Low\n- High: proceed autonomously; ask only for real decisions\n- Medium: normal confirmations at gates\n- Low: extra confirmations and explicit checklists\n\n## 4) docDepth (chat artifacts only; no auto-committed docs)\nNone / Light / Full\n- None: concise plan artifact only\n- Light: plan artifact + checkpoint/resume summary\n- Full: plan artifact + risk register + verification matrix + checkpoint/resume summary\n\n## 5) prStrategy\nSinglePR / MultiPR\n- MultiPR if Large or diff is broad (many files/domains)\n\n**Set context variables**: `rigorMode`, `auditDepth`, `maxQuestions`, `maxParallelism`, `taskComplexity`, `riskLevel`, `automationLevel`, `docDepth`, `prStrategy`.\n\n**VERIFY (minimal questions)**: ask the user to confirm or override `rigorMode` and `prStrategy` only if it impacts delivery expectations.",
|
|
36
|
+
"requireConfirmation": true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "phase-0b-minimum-context-request",
|
|
40
|
+
"title": "Phase 0b: Minimum Inputs Gate (Only Ask What You Truly Need)",
|
|
41
|
+
"prompt": "If any critical information is missing, request ONLY the minimum needed to proceed.\n\n**Ask for:**\n- Ticket text / requirements (if not provided)\n- Success criteria / expected behavior\n- Constraints (permissions, environment, deadlines)\n- Pointers to relevant code areas (if user has them)\n\n**Do NOT ask** questions you can answer via tools.\n\n**Output:** a short list of missing inputs (if any) and proceed once answered.",
|
|
42
|
+
"requireConfirmation": {
|
|
43
|
+
"or": [
|
|
44
|
+
{ "var": "automationLevel", "equals": "Low" },
|
|
45
|
+
{ "var": "automationLevel", "equals": "Medium" }
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "phase-0c-base-context-doc",
|
|
51
|
+
"title": "Phase 0c: Base Context Doc (Non-Small)",
|
|
52
|
+
"runCondition": { "var": "taskComplexity", "not_equals": "Small" },
|
|
53
|
+
"prompt": "Create a base `CONTEXT.md` as the durable artifact for this workflow run.\n\n**Rules:**\n- Default deliverable is **chat-first** (pasteable content).\n- If the agent can write files, also write/update `CONTEXT.md`.\n- Do NOT commit documentation files unless the user explicitly asks.\n\n**CONTEXT.md structure (must include):**\n1) **Task Summary** (1 paragraph)\n2) **Triage**: rigorMode, taskComplexity, riskLevel, automationLevel, docDepth, prStrategy\n3) **Inputs & Sources**: ticket links/text pointers; any user-provided file paths\n4) **User Rules & Preferences (`userRules`)**:\n - Extract relevant user rules/preferences from user instructions + repo docs/patterns.\n - Keep this focused and actionable.\n - Set context variable `userRules` as a bulleted list.\n5) **Open Questions**: only those that require user decisions (cap at `maxQuestions`)\n6) **Assumptions**: explicitly labeled\n7) **Placeholders**:\n - Invariants\n - Architecture decision\n - Slice/PR plan\n - Plan findings / follow-up tickets\n - Verification notes\n8) **Resumption Instructions**:\n - `workflow_get` id: `coding-task-workflow-agentic`\n - `workflow_next` with completedSteps + key context vars\n\n**Output:** the full content for `CONTEXT.md` (or confirm file written).",
|
|
54
|
+
"requireConfirmation": false
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "phase-1-context-gathering",
|
|
58
|
+
"title": "Phase 1: Context Gathering (Main Agent, Tool-Driven)",
|
|
59
|
+
"runCondition": { "var": "taskComplexity", "not_equals": "Small" },
|
|
60
|
+
"prompt": "Gather enough context to design and plan correctly.\n\n**Rules:**\n- Do this yourself (no delegation in this step).\n- Use tools to verify everything.\n- Prefer matching existing patterns over inventing new ones.\n- Prefer answering your own questions with tools; only keep true human-decision questions.\n\n**Deliverable (in chat, concise):**\n- Entry points and call chain sketch (file references)\n- Key modules/classes/functions involved\n- Existing patterns that apply (with 2–3 concrete examples)\n- Testing approach found in repo (where tests live; key helpers)\n- Risks/unknowns list\n\n**Question resolution pass (required):**\n- For uncertainties you encounter, attempt resolution via tools/code first.\n- Only add to `openQuestions` if it is a true business/product decision.\n- Enforce: `openQuestions.length <= maxQuestions`.\n\n**Set context variables:**\n- `contextSummary` (short)\n- `candidateFiles` (list of key file paths)\n- `openQuestions` (true human decisions only)\n\nAlso keep `userRules` in mind: if you discover a conflict between repo patterns and `userRules`, note it explicitly for planning."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"id": "phase-1b-context-audit-mode-adaptive",
|
|
64
|
+
"title": "Phase 1b: Context Audit (Mode-Adaptive, Subagent-Friendly)",
|
|
65
|
+
"runCondition": {
|
|
66
|
+
"or": [
|
|
67
|
+
{ "var": "rigorMode", "equals": "THOROUGH" },
|
|
68
|
+
{
|
|
69
|
+
"and": [
|
|
70
|
+
{ "var": "rigorMode", "equals": "STANDARD" },
|
|
71
|
+
{ "var": "riskLevel", "equals": "High" }
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"prompt": "Audit your context understanding before designing.\n\nMode behavior:\n- **QUICK**: skip this step (should not run)\n- **STANDARD**: do a self-audit; delegate at most once if you have subagent support\n- **THOROUGH**: delegate in parallel if you have subagent support\n\n**If subagent support is available and `rigorMode=THOROUGH`:**\n- Delegate to the WorkRail Executor **TWICE SIMULTANEOUSLY** using the **Context Gathering Routine** in **audit mode**:\n 1) Focus: COMPLETENESS (what did I miss?)\n 2) Focus: DEPTH (what did I misunderstand or stay too shallow on?)\n\n**If `rigorMode=STANDARD`:**\n- Prefer self-audit. Optionally delegate ONCE focusing on COMPLETENESS.\n\n**If no subagents:** do a self-audit using the two lenses.\n\n**SYNTHESIZE** audit findings:\n- Update `contextSummary` with gaps filled\n- Update `openQuestions` but keep it <= `maxQuestions` and only for true user decisions\n\n**Quality gate:** proceed only if you can explain the relevant flow end-to-end.",
|
|
77
|
+
"prompt": "Audit your context understanding before designing.\n\nMode behavior:\n- **QUICK**: skip this step (should not run)\n- **STANDARD**: do a self-audit; delegate at most once if you have subagent support\n- **THOROUGH**: delegate in parallel if you have subagent support\n\n**If subagent support is available and `rigorMode=THOROUGH`:**\n- Delegate to the WorkRail Executor **TWICE SIMULTANEOUSLY** using the **Context Gathering Routine** in **audit mode**:\n 1) Focus: COMPLETENESS (what did I miss?)\n 2) Focus: DEPTH (what did I misunderstand or stay too shallow on?)\n\n**If `rigorMode=STANDARD`:**\n- Prefer self-audit. Optionally delegate ONCE focusing on COMPLETENESS.\n\n**If no subagents:** do a self-audit using the two lenses.\n\n**SYNTHESIZE** audit findings:\n- Update `contextSummary` with gaps filled\n- Resolve uncertainties with tools when possible\n- Update `openQuestions` but keep it <= `maxQuestions` and only for true human decisions\n\n**Quality gate:** proceed only if you can explain the relevant flow end-to-end.",
|
|
78
|
+
"requireConfirmation": false
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"id": "phase-2-invariants-and-nongoals",
|
|
82
|
+
"title": "Phase 2: Invariants (Contracts, Constraints, Non-Goals)",
|
|
83
|
+
"prompt": "Create explicit invariants and non-goals.\n\n**Include (as applicable):**\n- API/behavior contracts that must not change\n- Data invariants (schema constraints, idempotency, ordering)\n- Performance budgets (latency, allocations, query counts)\n- Security/privacy constraints\n- Rollout invariants (flagging, migration safety, rollback)\n- Non-goals (explicitly out of scope)\n\n**Output:** a numbered list of invariants + non-goals.\n\n**Set context variables:** `invariants`, `nonGoals`.\n\n**VERIFY:** ask the user to confirm only if any invariant is a product decision.",
|
|
84
|
+
"requireConfirmation": {
|
|
85
|
+
"or": [
|
|
86
|
+
{ "var": "automationLevel", "equals": "Low" },
|
|
87
|
+
{ "var": "riskLevel", "equals": "High" }
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"id": "phase-3-architecture-capture",
|
|
93
|
+
"title": "Phase 3: Architecture Capture (Options → Recommendation → Risks)",
|
|
94
|
+
"runCondition": { "var": "taskComplexity", "not_equals": "Small" },
|
|
95
|
+
"prompt": "Propose architecture options and choose a recommendation.\n\n**Do:**\n1) Identify 2–3 viable approaches (including a conservative one)\n2) Evaluate trade-offs against `invariants`\n3) Recommend one approach\n4) Identify risks and mitigations\n5) Identify what must be proven early (spikes / thin slices)\n\n**If `rigorMode=THOROUGH` and subagents are available:**\n- Delegate to the WorkRail Executor for **parallel ideation** (2–3 perspectives) using **Ideation Routine** (e.g., simplicity / maintainability / performance).\n\n**Output:**\n- Selected approach + rationale\n- “Architecture delta” (what changes structurally)\n- Risks + mitigations\n\n**Set context variables:** `architectureDecision`, `architectureRisks`.",
|
|
96
|
+
"requireConfirmation": {
|
|
97
|
+
"or": [
|
|
98
|
+
{ "var": "automationLevel", "equals": "Low" },
|
|
99
|
+
{ "var": "taskComplexity", "equals": "Large" }
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "phase-4-vertical-slices-and-pr-plan",
|
|
105
|
+
"title": "Phase 4: Vertical Slices + PR Plan (Avoid Monster PRs)",
|
|
106
|
+
"prompt": "Create a vertical-slice plan and PR strategy.\n\n**Define `slices`** as an ordered list where each slice is:\n- Independently testable\n- Reviewable within a small PR\n- Compatible with `invariants`\n\nEach slice must include:\n- Name\n- Scope summary\n- Key files/components\n- Verification plan (tests/build/manual)\n- Rollout considerations (if any)\n\n**PR sizing gate:**\n- If `prStrategy = MultiPR`, map slices to PRs.\n- If `prStrategy = SinglePR` but the plan implies broad changes, recommend switching to MultiPR.\n\n**Set context variables:**\n- `slices` (array)\n- `estimatedPRCount` (number)\n- `prStrategyRationale` (short)\n\n**VERIFY:** user confirms PR strategy if it affects delivery expectations.",
|
|
107
|
+
"requireConfirmation": true
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"id": "phase-4b-locks-compliance-audit",
|
|
111
|
+
"title": "Phase 4b: Locks Compliance Audit (Canonical Docs → Slices Matrix)",
|
|
112
|
+
"runCondition": {
|
|
113
|
+
"and": [
|
|
114
|
+
{ "var": "taskComplexity", "not_equals": "Small" },
|
|
115
|
+
{ "var": "riskLevel", "equals": "High" }
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
"prompt": "Audit your slice plan against canonical lock documents to ensure no locked requirements are accidentally omitted.\n\n**This step exists to prevent the planning gap we just encountered (abstracting \"projections\" without enumerating all locked event schemas + idempotency enforcement).**\n\n**Do:**\n\n1) **Identify canonical docs** referenced in context/invariants (e.g., ADRs, `*-locks.md`, contract specs).\n - If none exist, skip this audit (no canonical locks to check).\n\n2) **Extract locked items** from those docs:\n - Search for: \"MUST\", \"locked\", \"required\", \"invariant\", closed-set enums, explicit schema lists, enforcement rules.\n - List each as a distinct **lock ID** with a short description.\n\n3) **Map locks to slices** (create a matrix table):\n - For each lock, identify which slice covers it.\n - If a lock is not covered, either:\n - add it to an existing slice (update `slices`), or\n - add a new slice, or\n - mark \"Deferred to [next phase/PR]\" with explicit reasoning.\n\n4) **Output the locks-to-slices matrix** (table format):\n\n| Lock ID | Lock Description | Mapped Slice | Status | Notes |\n|---------|------------------|--------------|--------|-------|\n| L1 | Idempotency via dedupeKey | Slice 2 | ✅ Mapped | enforced in append() |\n| L2 | Event schema closed set (12 kinds) | Multiple slices | ✅ Mapped | incremental |\n| L3 | Preferred tip last-activity | Projections | ⚠️ GAP | add to run DAG slice |\n\n**Set context variable:**\n- `locksMatrix` (the table for later reference)\n\n**VERIFY (if gaps detected):**\n- Require user confirmation to either: update slices to cover gaps, or explicitly defer with reasoning.\n- Do not proceed with unmapped locks unless user approves the deferral.",
|
|
119
|
+
"requireConfirmation": {
|
|
120
|
+
"or": [
|
|
121
|
+
{ "var": "automationLevel", "equals": "Low" }
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": "phase-5-plan-iteration-init",
|
|
127
|
+
"title": "Phase 5: Plan Iteration Init (Bounded Loop Setup)",
|
|
128
|
+
"runCondition": { "var": "taskComplexity", "not_equals": "Small" },
|
|
129
|
+
"prompt": "Initialize a bounded plan-iteration loop.\n\n**Set:** `continuePlanning = true`.\n\nRule: max 3 iterations. Stop early when audits find no Major risks/gaps.",
|
|
130
|
+
"requireConfirmation": false
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"id": "phase-5-plan-iterations",
|
|
134
|
+
"type": "loop",
|
|
135
|
+
"title": "Phase 5: Plan Iteration Loop (Draft → Audit → Refocus)",
|
|
136
|
+
"runCondition": { "var": "taskComplexity", "not_equals": "Small" },
|
|
137
|
+
"loop": {
|
|
138
|
+
"type": "while",
|
|
139
|
+
"condition": { "var": "continuePlanning", "equals": true },
|
|
140
|
+
"maxIterations": 3
|
|
141
|
+
},
|
|
142
|
+
"body": [
|
|
143
|
+
{
|
|
144
|
+
"id": "phase-5a-draft-implementation-plan",
|
|
145
|
+
"title": "Plan Artifact Draft/Update (Strict Schema)",
|
|
146
|
+
"prompt": "Create or update the **Plan Artifact**. This is a deterministic, WorkRail-friendly contract that reduces variance.\n\n**Output the Plan Artifact in chat** using these exact headings (keep concise, but complete):\n\n1) **Problem statement**\n2) **Acceptance criteria** (bullets)\n3) **Non-goals** (bullets)\n4) **User rules/preferences applied**\n - Summarize relevant `userRules` and state how the plan respects them.\n - If any rule cannot be followed, document rationale + mitigation + add a user decision to `openQuestions` (counts toward `maxQuestions`).\n5) **Invariants** (bullets; must reference `invariants`)\n6) **Proposed approach** (1–2 paragraphs)\n7) **Alternatives considered** (at least 1 for STANDARD/THOROUGH) + why rejected\n8) **Vertical slices** (must match `slices`; each slice must include: scope, done-definition, key files/components, verification)\n9) **Test plan** (unit/integration/e2e/manual; reference repo patterns found)\n10) **Risk register** (top risks + mitigation + rollback/flag if relevant)\n11) **PR packaging** (SinglePR vs MultiPR; if MultiPR, state the rule: “package a PR at the end of each slice”)\n\n**Set context variables:**\n- `planArtifact` (the structured artifact)\n- `implementationPlan` (slice-by-slice actionable steps derived from the artifact)\n\n**VERIFY:** the artifact is concrete enough that another engineer could implement it without guessing.",
|
|
147
|
+
"requireConfirmation": false
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"id": "phase-5b-plan-audit-mode-adaptive",
|
|
151
|
+
"title": "Plan Audit (Subagent-Friendly)",
|
|
152
|
+
"prompt": "Audit the current `planArtifact` / `implementationPlan`.\n\nMode behavior:\n- **QUICK**: self-audit only (no delegation)\n- **STANDARD**: self-audit; delegate at most once if subagents exist\n- **THOROUGH**: parallel delegation if subagents exist\n\n**If subagents available and `rigorMode=THOROUGH`:**\n- Delegate **THREE TIMES SIMULTANEOUSLY** to WorkRail Executor:\n 1) **Plan Analysis Routine**: completeness/pattern adherence/risks\n 2) **Hypothesis Challenge Routine (rigor=3)**: try to find holes / missed edge cases\n 3) **Execution Simulation Routine**: simulate the riskiest slice and likely failure modes\n\n**If subagents available and `rigorMode=STANDARD`:**\n- Delegate **ONCE** using **Plan Analysis Routine** focusing on completeness.\n\n**Otherwise:** do a self-audit using the same three lenses.\n\n**Output:**\n- Findings grouped by severity: Critical / Major / Minor\n- Concrete plan amendments\n\n**Set context variables:**\n- `planFindings`\n- `planAmendments`\n- `planConfidence` (1–10)",
|
|
153
|
+
"requireConfirmation": false
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"id": "phase-5c-refocus-and-ticket-extraction",
|
|
157
|
+
"title": "Refocus: Incorporate Findings + Extract Follow-Up Tickets",
|
|
158
|
+
"prompt": "Apply valid amendments, and refocus.\n\n**Do:**\n- Update `planArtifact` and `implementationPlan` to incorporate `planAmendments`.\n- Extract valuable-but-out-of-scope work into `followUpTickets`.\n- Ensure plan still follows `invariants` and stays slice-oriented.\n\n**Set context variables:**\n- `followUpTickets`\n\n**VERIFY:** the plan is coherent and still PR-sized by slice.",
|
|
159
|
+
"requireConfirmation": {
|
|
160
|
+
"or": [
|
|
161
|
+
{ "var": "automationLevel", "equals": "Low" },
|
|
162
|
+
{ "var": "planConfidence", "lt": 8 }
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"id": "phase-5d-loop-exit-decision",
|
|
168
|
+
"title": "Loop Exit Decision (Fail-Safe): Set continuePlanning",
|
|
169
|
+
"prompt": "This step is **non-optional** and exists to prevent the common failure mode of forgetting to set `continuePlanning`.\n\n**You MUST output exactly:**\n- `continuePlanning`: true|false\n- `reason`: one sentence\n- `whatChangedSinceLastIteration`: 1–3 bullets\n\n**DEFAULT RULE:** set `continuePlanning=false` unless one of these is true:\n1) Any **Critical** finding remains unresolved\n2) Any **Major** finding remains unresolved\n3) `planConfidence < 8`\n4) A user decision in `openQuestions` blocks correctness\n5) A high-risk invariant has no test/verification path\n\nIf you set `continuePlanning=true`, name which condition(s) triggered it and what you will change in the next iteration.\n\n**Set context variables:** `continuePlanning`.",
|
|
170
|
+
"requireConfirmation": false
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"id": "phase-5e-doc-artifacts",
|
|
176
|
+
"title": "Phase 5e: Plan Artifact Output (Mode-Dependent, Chat-First)",
|
|
177
|
+
"runCondition": {
|
|
178
|
+
"or": [
|
|
179
|
+
{ "var": "docDepth", "equals": "Light" },
|
|
180
|
+
{ "var": "docDepth", "equals": "Full" }
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
"prompt": "Produce mode-appropriate, **chat-first** artifacts derived from `planArtifact`.\n\n- If `docDepth = Light`: output `planArtifact` + a short **Checkpoint/Resume** section (current state + next slice).\n- If `docDepth = Full`: output `planArtifact` + a concise **Risk register** + **Verification matrix** + **Checkpoint/Resume**.\n\n**Rule:** do not create or commit documentation files unless the user explicitly asks. The default deliverable is in-chat text that the user can save.\n\n**Save/resume support:** include a concise checkpoint section describing current state and next slice.",
|
|
184
|
+
"requireConfirmation": false
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"id": "phase-6-test-strategy-optional",
|
|
188
|
+
"title": "Phase 6 (Optional): Separate Test Strategy & Scaffolding",
|
|
189
|
+
"runCondition": {
|
|
190
|
+
"and": [
|
|
191
|
+
{ "var": "taskComplexity", "not_equals": "Small" },
|
|
192
|
+
{ "var": "riskLevel", "equals": "High" }
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
"prompt": "Optionally do a test-first slice when risk is high.\n\n**Do:**\n- Define the minimal test harness needed to validate invariants.\n- Implement scaffolding/tests for the riskiest slice first (without finishing all features).\n- Ensure tests fail for the right reason before implementing the behavior.\n\n**VERIFY:** tests meaningfully protect the invariants and the intended behavior.",
|
|
196
|
+
"requireConfirmation": true
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"id": "phase-7-implement-slices",
|
|
200
|
+
"type": "loop",
|
|
201
|
+
"title": "Phase 7: Implement Slice-by-Slice (PREP → IMPLEMENT → VERIFY → CHECKPOINT)",
|
|
202
|
+
"runCondition": {
|
|
203
|
+
"and": [
|
|
204
|
+
{ "var": "taskComplexity", "not_equals": "Small" }
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
"loop": {
|
|
208
|
+
"type": "forEach",
|
|
209
|
+
"items": "slices",
|
|
210
|
+
"itemVar": "currentSlice",
|
|
211
|
+
"indexVar": "sliceIndex",
|
|
212
|
+
"maxIterations": 20
|
|
213
|
+
},
|
|
214
|
+
"body": [
|
|
215
|
+
{
|
|
216
|
+
"id": "phase-7a-prep",
|
|
217
|
+
"title": "PREP: Prepare Slice {{sliceIndex}}",
|
|
218
|
+
"prompt": "Prepare to implement the slice `{{currentSlice.name}}`.\n\n**Do:**\n- Re-state slice goal and verification\n- Identify exact files/components to change\n- Re-check invariants impacted by this slice\n- Match existing patterns (find 1–3 relevant exemplars)\n- Apply `userRules` (if any rule affects this slice, call it out)\n\n**Pre-change sanity check (required, grouped):**\n- Existence check: key files/symbols referenced by the slice exist\n- Signature/contract check: confirm any key function/type signatures the slice assumes\n- Bounded impact scan: find 1–2 hop callers/callees for the primary touchpoints\n- Scope reconciliation: if you discover additional required touchpoints beyond the slice plan, update the slice scope (or stop and re-plan)\n\n**Stop and ask** only if a business decision is required or a prerequisite is missing.",
|
|
219
|
+
"requireConfirmation": false
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"id": "phase-7b-implement",
|
|
223
|
+
"title": "IMPLEMENT: Slice {{sliceIndex}}",
|
|
224
|
+
"prompt": "Implement ONLY the current slice `{{currentSlice.name}}`.\n\n**Constraints:**\n- Keep the diff PR-sized\n- Prefer architectural moves that reduce future work\n- No drive-by refactors unless required by invariants\n\n**Self-execute** with tools; do not delegate implementation unless explicitly directed by the user.",
|
|
225
|
+
"requireConfirmation": false
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"id": "phase-7c-verify",
|
|
229
|
+
"title": "VERIFY: Slice {{sliceIndex}}",
|
|
230
|
+
"prompt": "Verify the slice.\n\n**Do:**\n- Run the relevant tests/build\n- Add/adjust tests if needed to cover behavior\n- Ensure invariants still hold\n\n**If verification fails:** debug and fix deterministically; if blocked by environment constraints, request the user to run the necessary command and share output.",
|
|
231
|
+
"requireConfirmation": false
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"id": "phase-7d-checkpoint",
|
|
235
|
+
"title": "CHECKPOINT: Save/Resume + PR Packaging Notes",
|
|
236
|
+
"prompt": "Checkpoint after slice completion.\n\n**Record:**\n- What changed (high level)\n- How it was verified\n- What remains (next slice)\n- Any follow-up tickets discovered\n- PR notes: if `prStrategy=MultiPR`, propose which slice(s) form the next PR.\n\nIf using docs, update the checkpoint/resume section.",
|
|
237
|
+
"requireConfirmation": false
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"id": "phase-7e-multi-pr-packaging-gate",
|
|
241
|
+
"title": "PR Packaging Gate (Hard Stop when MultiPR)",
|
|
242
|
+
"runCondition": { "var": "prStrategy", "equals": "MultiPR" },
|
|
243
|
+
"prompt": "This is a **hard gate** to prevent PR size drift.\n\n**If `prStrategy=MultiPR`, you must stop here and package a PR before proceeding to the next slice.**\n\n**Output (PR-ready):**\n- Proposed PR title\n- 3–6 bullet summary (why, not what)\n- Test plan (what you ran)\n- Rollout/risks (if any)\n- What remains (next slice)\n\n**Then stop and wait for user confirmation** to proceed to the next slice.\n\n(Do not actually merge; do not assume permissions to push/create PR unless the user requests.)",
|
|
244
|
+
"requireConfirmation": true
|
|
245
|
+
}
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"id": "phase-8-small-task-fast-path",
|
|
250
|
+
"title": "Phase 8 (Small Only): Fast Path (Minimal Ceremony)",
|
|
251
|
+
"runCondition": { "var": "taskComplexity", "equals": "Small" },
|
|
252
|
+
"prompt": "For Small tasks, do:\n\n1) Confirm target locations with tools (existence + pattern match)\n2) Implement the smallest correct change\n3) Verify (tests/build or deterministic check)\n4) Provide a concise PR-ready summary\n\nAvoid heavy docs unless risk unexpectedly increases.",
|
|
253
|
+
"requireConfirmation": false
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"id": "phase-9-final-validation-and-handoff",
|
|
257
|
+
"title": "Phase 9: Final Validation + PR/MR Handoff (No Auto-Merge)",
|
|
258
|
+
"prompt": "Final validation and handoff.\n\n**Do:**\n- Verify acceptance criteria and invariants\n- Confirm test/build status and coverage gaps (if any)\n- Summarize slice completion and PR strategy outcome\n- Provide a PR/MR description draft (concise): summary + test plan + rollout notes\n- Provide follow-up tickets list (if any)\n\n**Important:** do not auto-merge, squash-merge, or delete branches as part of this workflow.",
|
|
259
|
+
"requireConfirmation": true
|
|
260
|
+
}
|
|
261
|
+
]
|
|
262
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "design-thinking-workflow-autonomous-agentic",
|
|
3
|
+
"name": "Design Thinking Workflow (Autonomous, Tiered Agent Cascade)",
|
|
4
|
+
"description": "Autonomous design thinking: minimal human input; doc-first execution; supports Agent Cascade Protocol tiers (Solo/Proxy/Delegation) with explicit fallbacks.",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"preconditions": [
|
|
7
|
+
"User can provide a short problem/opportunity statement and constraints",
|
|
8
|
+
"Agent can create and update a single canonical design doc file for resumption"
|
|
9
|
+
],
|
|
10
|
+
"clarificationPrompts": [
|
|
11
|
+
"What problem/opportunity are we addressing (1–3 paragraphs)?",
|
|
12
|
+
"What constraints matter (hard vs soft)?",
|
|
13
|
+
"What are the non-negotiable principles and anti-goals?",
|
|
14
|
+
"What is the intended deliverable (proposal, spec, roadmap, prototype API, etc.)?"
|
|
15
|
+
],
|
|
16
|
+
"metaGuidance": [
|
|
17
|
+
"AUTONOMOUS: Minimize human input. If information is missing, create explicit assumptions and a validation plan; do not invent facts silently.",
|
|
18
|
+
"DOC-FIRST: `designDocPath` is the canonical source of truth. Keep chat output short; write the real work into the doc.",
|
|
19
|
+
"AGENT CASCADE PROTOCOL: Use the highest tier available and fall back explicitly:",
|
|
20
|
+
"- Tier 3 (Delegation / Gold): Subagents can call WorkRail MCP tools → delegate full routines/work packages.",
|
|
21
|
+
"- Tier 2 (Proxy / Silver): Subagents exist but cannot call WorkRail tools → delegate the work via natural language; you (main agent) write/synthesize.",
|
|
22
|
+
"- Tier 1 (Solo / Bronze): No subagents → you simulate specialization via persona instructions.",
|
|
23
|
+
"VERIFY THEN DELEGATE: Never assume subagent/tool availability. If uncertain, default to Tier 1.",
|
|
24
|
+
"SUBAGENT PRINCIPLES: Subagents are stateless cognitive specialists. Provide a complete work package. Prefer auditor model when possible.",
|
|
25
|
+
"PARALLELISM: Only run subagents in parallel when their work is independent (e.g., persona interviews, ideation perspectives, audits).",
|
|
26
|
+
"QUALITY GATES: If a deliverable is weak, record gaps in the doc and iterate. Do not pretend it is complete.",
|
|
27
|
+
"DT IDs: Maintain an append-only Idea Backlog with DT-### IDs tracked in the design doc Counters section."
|
|
28
|
+
],
|
|
29
|
+
"functionDefinitions": [
|
|
30
|
+
{
|
|
31
|
+
"name": "ideaEntryTemplate",
|
|
32
|
+
"definition": "Use this template for each idea entry:\n- Idea ID: DT-###\n- Title: …\n- One-liner: …\n- Category: protocol | UX | authoring | observability | reliability | tooling | packaging | policy | other\n- Addresses: (pain/insight/constraint this targets)\n- Inspiration: (what prompted it)\n- Why it might work: …\n- Key risks: …\n- Notes: …\n\nID rule: Allocate the next DT-### from the design doc section `## Counters` (e.g., `Next DT ID: DT-001`) and increment it after each new idea."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "clusterTemplate",
|
|
36
|
+
"definition": "Use this template for each cluster/theme:\n- Theme name: …\n- Why these ideas belong together (1 line): …\n- Member idea IDs: DT-…\n- What it enables: …\n- Biggest risk/unknown: …"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "prototypeSpecTemplate",
|
|
40
|
+
"definition": "Use this template for a minimal prototype spec:\n## Goal\n## Non-goals\n## Prototype learning question\n## Prototype artifact (what you built)\n## Proposed API / Interface (if applicable)\n- Inputs\n- Outputs\n- Invariants\n- Error cases (as data)\n## Migration strategy\n## Pre-mortem (how this fails)\n## Falsification criteria\n## Test plan\n"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "testPlanTemplate",
|
|
44
|
+
"definition": "Use this template for the test/dogfood plan:\n## Scenarios to run\n## Agents/models/IDEs to test\n## Pass/fail metrics\n## Instrumentation needed\n## Rollback/contingency\n"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "personaInterviewTemplate",
|
|
48
|
+
"definition": "Use this template for each persona interview (real or simulated):\n## Persona\n- Name: …\n- Context: …\n- Goals: …\n- Pains: …\n- Constraints: …\n\n## Interview (Q → A)\n- Q: What does success look like?\n A: …\n- Q: What would make you reject this direction?\n A: …\n- Q: What is your biggest fear/risk?\n A: …\n- Q: What tradeoff do you care about most?\n A: …\n- Q: What would delight you?\n A: …\n\n## Notes\n- …\n\nLabel: If simulated, state clearly: `Evidence Type: Simulated`."
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"steps": [
|
|
52
|
+
{
|
|
53
|
+
"id": "phase-0-triage",
|
|
54
|
+
"title": "Phase 0: Minimal Intake (Autonomous)",
|
|
55
|
+
"prompt": "Capture the minimal human input needed to run autonomously.\n\nDeliverable (bullets under headings):\n## Problem / Opportunity\n- …\n## Constraints\n- Hard: …\n- Soft: …\n## Non-negotiable principles\n- …\n## Anti-goals / out-of-scope\n- …\n## Intended deliverable\n- …\n\nAutonomy rule: If something is missing, write it as an explicit assumption with a validation plan (do not invent).\n\nEnd with 'Next Input' checklist (only items truly required to proceed).",
|
|
56
|
+
"agentRole": "You are a product/engineering facilitator. Keep intake minimal and make assumptions explicit.",
|
|
57
|
+
"requireConfirmation": true
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "phase-0a-init-design-doc",
|
|
61
|
+
"title": "Phase 0A: Initialize Canonical Design Doc (Resumption Anchor)",
|
|
62
|
+
"prompt": "Create a single canonical design doc that will be the source of truth for the rest of this workflow.\n\nDeliverable:\n1) Choose and confirm a file path: `designDocPath`\n - Default suggestion: `ideas/<short-slug>-design-thinking.md`\n2) Create the file (if missing) and write the initial skeleton sections:\n - Context / Problem\n - Constraints / Principles / Anti-goals\n - Execution Tier\n - Assumption Register\n - Persona Bank\n - Empathy Findings (Observations / Insights)\n - POV + HMW\n - Success Criteria\n - Idea Backlog (append-only)\n - Clusters + Scoring\n - Decision Log\n - Pre-mortem + Falsification\n - Prototype Spec\n - Test Plan\n - Iteration Notes\n - Counters (DT IDs)\n3) Persist Phase 0 outputs into the doc under the appropriate sections.\n\nIn `Counters`, initialize:\n- Next DT ID: DT-001\n\nState (must be explicit):\n- Set `designDocPath` to the chosen path.\n\nChat output: only confirm `designDocPath` and list any missing inputs before proceeding.",
|
|
63
|
+
"agentRole": "You create a resumption-proof anchor artifact and ensure all future work is doc-first.",
|
|
64
|
+
"requireConfirmation": true
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"id": "phase-0b-environment-handshake",
|
|
68
|
+
"title": "Phase 0B: Agent Cascade Boot Check (Tier 1/2/3)",
|
|
69
|
+
"prompt": "Determine which execution tier you can use (Agent Cascade Protocol).\n\nDoc-first: In `designDocPath`, fill `## Execution Tier` with:\n- Tier chosen: 1 (Solo) | 2 (Proxy) | 3 (Delegation)\n- Evidence: what you observed\n- Constraints: what you cannot do\n\nBoot check procedure:\n1) Check if subagents exist in your environment.\n - If none: Tier 1.\n2) If subagents exist, ask one subagent to call `workflow_list`.\n - If they can call WorkRail MCP tools: Tier 3.\n - If they cannot: Tier 2.\n\nRule: If anything is uncertain, default to Tier 1.\n\nChat: one line stating Tier chosen.",
|
|
70
|
+
"agentRole": "You are verifying capabilities before using them. Prevent hallucinated delegation.",
|
|
71
|
+
"requireConfirmation": false
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": "phase-1a-plan-personas",
|
|
75
|
+
"title": "Phase 1A: Plan Empathy via Persona Simulation",
|
|
76
|
+
"prompt": "Plan how you will gather empathy signals with minimal human input.\n\nDoc-first: In `designDocPath`, update `## Persona Bank` with 3–5 personas you will interview (real or simulated).\nFor each persona: name, why it matters, what it can falsify.\n\nRequired personas (minimum):\n- Primary User\n- Power User\n- Skeptic (Stakeholder / Risk owner)\n- Operator (maintenance/support)\n\nEnd with a short plan: which 3 questions matter most for this problem.",
|
|
77
|
+
"agentRole": "You plan a structured empathy strategy. No ideation yet.",
|
|
78
|
+
"requireConfirmation": false
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"id": "phase-1b-persona-interviews",
|
|
82
|
+
"title": "Phase 1B: Conduct Persona Interviews (Tiered)",
|
|
83
|
+
"prompt": "Conduct persona interviews and capture results. Label simulated evidence clearly.\n\nTiered execution:\n\nIF Tier 3 (Delegation):\n- Spawn 4 persona interviewers SIMULTANEOUSLY (Primary User, Power User, Skeptic, Operator).\n- Provide each a complete work package including: problem, constraints, intended deliverable, and the personaInterviewTemplate.\n- Each must return a structured deliverable with the template and `Evidence Type: Simulated` unless you have real quotes.\n\nIF Tier 2 (Proxy):\n- Ask subagents to roleplay each persona via natural language.\n- You (main agent) transcribe results into the doc using personaInterviewTemplate and label as simulated.\n\nIF Tier 1 (Solo):\n- ACT AS each persona sequentially. Use personaInterviewTemplate. Label as simulated.\n\nDoc-first: Append interviews under `## Persona Bank` (or a `## Persona Interviews` section).\nChat: short recap + 'Next Input' checklist.",
|
|
84
|
+
"agentRole": "You are gathering empathy signals via structured interviews. Be explicit about what is simulated.",
|
|
85
|
+
"requireConfirmation": false,
|
|
86
|
+
"functionReferences": ["personaInterviewTemplate()"]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "phase-1c-synthesize-empathy",
|
|
90
|
+
"title": "Phase 1C: Synthesize Empathy (Observations → Insights)",
|
|
91
|
+
"prompt": "Synthesize persona interviews into grounded observations and insights.\n\nDoc-first: Update `## Empathy Findings` with:\n- Observations (5–10)\n- Insights (5–10), each tied to at least one observation\n- Unknowns\n- Assumption Register updates (explicit)\n\nAdversarial/self-reflection (required):\n- What might we be misreading?\n- What evidence would contradict the top insight?\n- What could be \"working as designed\" (not actually a problem)?\n\nOptional Tier 3 audit (recommended for important decisions):\n- Spawn 2 auditors simultaneously (Completeness focus, Depth focus) to audit your empathy synthesis and call out gaps/assumptions.\n- If Tier 2/1: self-audit with the same questions.\n\nChat: short recap + 'Next Input' checklist.",
|
|
92
|
+
"agentRole": "You converge empathy into actionable insights and explicit assumptions.",
|
|
93
|
+
"requireConfirmation": false
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "phase-2-define",
|
|
97
|
+
"title": "Phase 2: Define (POV + HMW + Success Criteria)",
|
|
98
|
+
"prompt": "Turn empathy into a precise definition.\n\nDoc-first: Update `## POV + HMW` and `## Success Criteria` with:\n## POV\n- [Persona] needs [need] because [insight].\n\n## Problem statement (2–4 lines)\n- …\n\n## Alternative framings (2)\n- If we are wrong about the core problem, what else could it be?\n- What would be a radically simpler interpretation?\n\nAnchoring check: If you cannot produce two plausible alternative framings, say so explicitly and go back to Empathy Findings to improve them.\n\n## How might we… (3–7)\n- …\n\n## Success criteria\n- …\n\n## Key tensions / tradeoffs\n- …\n\n## Riskiest assumption\n- …\n\n## What would change our mind?\n- …\n\nChat: short recap + 'Next Input' checklist.",
|
|
99
|
+
"agentRole": "You create a crisp, testable framing and protect against anchoring.",
|
|
100
|
+
"requireConfirmation": false
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "phase-2b-challenge-framing",
|
|
104
|
+
"title": "Phase 2B: Adversarial Challenge the Framing (Tiered)",
|
|
105
|
+
"prompt": "Challenge your own framing before ideation.\n\nIF Tier 3 (Delegation):\n- Delegate to the **WorkRail Executor** to run `routine-hypothesis-challenge` at rigor=3.\n- Mission: Attack POV, HMW, riskiest assumption, and success criteria.\n- Provide complete context: paste the relevant doc sections.\n- Incorporate valid critique into the doc.\n\nIF Tier 2 (Proxy):\n- Ask a subagent to act as an adversarial critic (no WorkRail tools).\n- You synthesize their critique and update the doc.\n\nIF Tier 1 (Solo):\n- ACT AS a skeptical reviewer. Try to prove the framing is wrong.\n\nDoc-first: append a short `## Framing Challenge` section with findings and changes made.",
|
|
106
|
+
"agentRole": "You are preventing premature convergence by adversarially testing the framing.",
|
|
107
|
+
"requireConfirmation": false
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"id": "phase-3-ideation-loop",
|
|
111
|
+
"type": "loop",
|
|
112
|
+
"title": "Phase 3: Ideation (4 Rounds)",
|
|
113
|
+
"loop": { "type": "for", "count": 4, "maxIterations": 4, "iterationVar": "ideationRound" },
|
|
114
|
+
"body": [
|
|
115
|
+
{
|
|
116
|
+
"id": "ideation-round-1",
|
|
117
|
+
"title": "Ideation Round 1: General Divergence",
|
|
118
|
+
"runCondition": { "var": "ideationRound", "equals": 1 },
|
|
119
|
+
"prompt": "Generate a broad set of ideas directly relevant to the defined problem.\n\nDoc-first: Append ideas to Idea Backlog in `designDocPath` using ideaEntryTemplate.\nDT IDs: allocate next DT-### from `## Counters`.\n\nTiered execution:\n- Tier 3: Spawn 2–3 ideators SIMULTANEOUSLY with different perspectives (Simplicity, Maintainability, Pragmatic). Synthesize into one backlog.\n- Tier 2: Ask subagents to brainstorm per perspective; you curate into the backlog.\n- Tier 1: ACT AS each perspective sequentially; then curate.\n\nReflection (brief, required):\n- Which category is underrepresented?\n- What is the simplest idea we are dismissing too quickly?\n- What assumption seems to be driving most ideas?",
|
|
120
|
+
"agentRole": "Divergent ideation with explicit perspective diversity.",
|
|
121
|
+
"functionReferences": ["ideaEntryTemplate()"]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "ideation-round-2",
|
|
125
|
+
"title": "Ideation Round 2: Orthogonal / Unrelated Inspiration",
|
|
126
|
+
"runCondition": { "var": "ideationRound", "equals": 2 },
|
|
127
|
+
"prompt": "Generate ideas that are intentionally NOT obvious extensions of Round 1.\n\nDoc-first: Append ideas with DT IDs.\nTechniques: analogies, inversions, constraint creativity.\n\nConstraint inversion (required): add 5 ideas that assume a hard constraint and explain why it changes the solution.\n\nTiered execution:\n- Tier 3: Spawn 2 ideators SIMULTANEOUSLY (Contrarian, Analogist). Synthesize.\n- Tier 2: Proxy brainstorm via subagents; you curate.\n- Tier 1: Do it yourself, explicitly switching personas.\n\nReflection (brief, required):\n- Which analogy created the most leverage?\n- What is the simplest idea we are dismissing too quickly?\n- What assumption seems to be driving most ideas?",
|
|
128
|
+
"agentRole": "Break local maxima with orthogonal ideation.",
|
|
129
|
+
"functionReferences": ["ideaEntryTemplate()"]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"id": "ideation-round-3",
|
|
133
|
+
"title": "Ideation Round 3: Combine / Mutate / Package",
|
|
134
|
+
"runCondition": { "var": "ideationRound", "equals": 3 },
|
|
135
|
+
"prompt": "Generate ideas that combine and strengthen the existing backlog.\n\nDoc-first: Append derived ideas with DT IDs.\nAlso produce 5 concept packages referencing member DT-IDs.\n\nTiered execution:\n- Tier 3: Spawn 2 ideators SIMULTANEOUSLY (Systems, Pragmatic). Synthesize.\n- Tier 2: Proxy brainstorm; you curate.\n- Tier 1: Do it yourself.\n\nReflection (brief, required):\n- What critical primitive is missing?\n- What is the simplest idea we are dismissing too quickly?\n- What assumption seems to be driving most ideas?",
|
|
136
|
+
"agentRole": "Converge divergent ideas into packages without prematurely selecting.",
|
|
137
|
+
"functionReferences": ["ideaEntryTemplate()"]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"id": "ideation-round-4",
|
|
141
|
+
"title": "Ideation Round 4: Coverage Sweep & Blind Spots",
|
|
142
|
+
"runCondition": { "var": "ideationRound", "equals": 4 },
|
|
143
|
+
"prompt": "Audit the idea space for blind spots and fill gaps.\n\nChecklist: protocol, resumption, authoring UX, validation, dashboard/observability, model variability, external workflow packaging, loops correctness, capability negotiation.\n\nDoc-first: Add 10–15 missing ideas with DT IDs.\nAdd Coverage Map: Dimension | coverage (low/med/high) | top DT-IDs.\n\nTiered execution:\n- Tier 3: Optional parallel audit: one ideator does blind spots; another acts as skeptic.\n- Tier 2: Proxy.\n- Tier 1: Solo.\n\nReflection (brief, required):\n- Where would we regret not exploring further?\n- What category did we avoid because it felt uncomfortable or \"too big\"?\n- What assumption seems to be driving most ideas?",
|
|
144
|
+
"agentRole": "Ensure coverage and surface blind spots.",
|
|
145
|
+
"functionReferences": ["ideaEntryTemplate()"]
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"id": "phase-4-synthesize",
|
|
151
|
+
"title": "Phase 4: Synthesize (Cluster + Prioritize)",
|
|
152
|
+
"prompt": "Synthesize the backlog into themes and a shortlist.\n\nDoc-first: Update `## Clusters + Scoring` with:\n- 5–10 clusters (use clusterTemplate)\n- Candidate directions (top 3–7) with North Star + scoring (Impact/Confidence/Migration/Model-robustness/Time-to-value)\n- Shortlist (2–3)\n\nAdversarial challenge (brief):\n- Argue the top direction is wrong. What would a skeptic say?\n- What is the strongest alternative and why might it win?\n\nTiered optional validation:\n- Tier 3: Spawn **two WorkRail Executor delegations** in parallel:\n - WorkRail Executor #1: run `routine-plan-analysis` to audit shortlist completeness, scoring, and migration risk.\n - WorkRail Executor #2: run `routine-hypothesis-challenge` at rigor=3 to adversarially challenge the top direction.\n- Tier 2/1: self-audit using the same prompts.\n\nEnd with a short Decision Log entry: what you chose and why.",
|
|
153
|
+
"agentRole": "You converge and make tradeoffs explicit.",
|
|
154
|
+
"requireConfirmation": false,
|
|
155
|
+
"functionReferences": ["clusterTemplate()"]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"id": "phase-4a-quality-gate",
|
|
159
|
+
"title": "Phase 4A: Synthesis Quality Gate",
|
|
160
|
+
"prompt": "Verify readiness to prototype.\n\nDoc-first: Add `## Synthesis Quality Gate` checklist with ✅/❌:\n- POV exists\n- 3–7 HMW exist\n- Success criteria exist\n- Key tensions exist\n- Idea Backlog has breadth\n- Shortlist (2–3) exists\n- Top direction has at least one falsifiable learning question\n\nIf FAIL: list what is missing and fix it before proceeding.",
|
|
161
|
+
"agentRole": "You enforce blueprint quality.",
|
|
162
|
+
"requireConfirmation": false
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"id": "phase-4b-premortem-falsification",
|
|
166
|
+
"title": "Phase 4B: Pre-mortem & Falsification",
|
|
167
|
+
"prompt": "Before prototyping, add a pre-mortem and explicit falsification criteria for the top direction. Treat directions as hypotheses; tests exist to falsify.\n\nDoc-first: Update `## Pre-mortem + Falsification` with:\n- Pre-mortem (top 5): failure mode | why | mitigation\n- Falsification criteria (1–3): if X happens, we pivot/stop because…\n\nReflection (brief):\n- What second-order effect is most dangerous?\n- What would we regret not testing?",
|
|
168
|
+
"agentRole": "You pressure-test before investing in a prototype.",
|
|
169
|
+
"requireConfirmation": false
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"id": "phase-5-prototype",
|
|
173
|
+
"title": "Phase 5: Prototype (Learning Artifact)",
|
|
174
|
+
"prompt": "Build a low-fidelity prototype intended to answer one learning question.\n\nChoose ONE prototype artifact:\n- Storyboard (6 panels)\n- Concierge script (manual end-to-end flow)\n- API sketch (request/response examples + mocked outputs)\n- Wireframe (markdown screens + interactions)\n\nDoc-first: Write the full prototype spec and artifact into `designDocPath` using prototypeSpecTemplate.\nInclude falsification criteria (copy verbatim, then refine).\n\nReflection (brief):\n- What is the smallest slice that still proves/disproves the concept?\n- If falsified, what is the next-best direction from the shortlist?",
|
|
175
|
+
"agentRole": "You create a falsifiable learning prototype.",
|
|
176
|
+
"requireConfirmation": false,
|
|
177
|
+
"functionReferences": ["prototypeSpecTemplate()"]
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"id": "phase-6-test-plan",
|
|
181
|
+
"title": "Phase 6: Test Plan (Dogfood + Validation)",
|
|
182
|
+
"prompt": "Define how to test the prototype with real usage constraints.\n\nDoc-first: Write the test plan into `designDocPath` using testPlanTemplate.\nMust include: Claude + one weaker model (GPT/Grok/Gemini) in the model/IDE matrix.\n\nReflection (brief):\n- If the test fails, what do we do next (iterate, pivot, stop)?",
|
|
183
|
+
"agentRole": "You design an evidence-producing test plan.",
|
|
184
|
+
"requireConfirmation": false,
|
|
185
|
+
"functionReferences": ["testPlanTemplate()"]
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"id": "phase-7-iterate-loop",
|
|
189
|
+
"type": "loop",
|
|
190
|
+
"title": "Phase 7: Iterate (Test → Learn → Refine)",
|
|
191
|
+
"loop": { "type": "for", "count": 2, "maxIterations": 2, "iterationVar": "iteration" },
|
|
192
|
+
"body": [
|
|
193
|
+
{
|
|
194
|
+
"id": "iteration-test",
|
|
195
|
+
"title": "Iteration {{iteration}}: Dogfood Test & Capture Feedback",
|
|
196
|
+
"prompt": "Run a lightweight dogfood test of the prototype (thought experiment, adversarial critique, stakeholder Q&A simulation).\n\nDoc-first: Append to `## Iteration Notes`:\n- What we tried\n- What worked\n- What failed\n- Confusions/friction\n- New insights\n\nChat: short recap only.",
|
|
197
|
+
"agentRole": "You generate learning signals cheaply."
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"id": "iteration-learn-update",
|
|
201
|
+
"title": "Iteration {{iteration}}: Learn & Update Artifacts",
|
|
202
|
+
"prompt": "Based on feedback, update the key artifacts in `designDocPath` and add `## Iteration {{iteration}}: Updates`.\n\nDeliverable:\n- Changes made (POV/HMW/shortlist/prototype/test plan)\n- Rationale\n\nReflection (brief):\n- What surprised us?\n- What did we previously believe that is now false?",
|
|
203
|
+
"agentRole": "You update artifacts based on learning."
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"id": "phase-8-handoff",
|
|
209
|
+
"title": "Phase 8: Final Summary & Handoff",
|
|
210
|
+
"prompt": "Finalize the design doc and produce a crisp handoff.\n\nDoc-first: Add `## Final Summary` with:\n- Problem statement\n- POV/HMW\n- Chosen direction + why\n- Falsification criteria\n- Prototype artifact summary\n- Test plan summary\n- What we learned across iterations\n- Next actions\n\nChat: one-paragraph summary + path to `designDocPath`.",
|
|
211
|
+
"agentRole": "You conclude the autonomous design thinking cycle with a handoff.",
|
|
212
|
+
"requireConfirmation": false
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
}
|