@exaudeus/workrail 3.65.0 → 3.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/console-ui/assets/{index-DmFHE8v_.js → index-BynU38Vu.js} +1 -1
  2. package/dist/console-ui/index.html +1 -1
  3. package/dist/manifest.json +11 -11
  4. package/dist/types/workflow-definition.d.ts +1 -0
  5. package/dist/v2/durable-core/domain/prompt-renderer.d.ts +1 -0
  6. package/dist/v2/durable-core/domain/prompt-renderer.js +40 -0
  7. package/docs/authoring-v2.md +30 -7
  8. package/docs/authoring.md +28 -0
  9. package/package.json +1 -1
  10. package/spec/authoring-spec.json +37 -0
  11. package/spec/workflow.schema.json +5 -0
  12. package/workflows/adaptive-ticket-creation.json +2 -1
  13. package/workflows/architecture-scalability-audit.json +1 -0
  14. package/workflows/bug-investigation.agentic.v2.json +1 -0
  15. package/workflows/classify-task-workflow.json +1 -0
  16. package/workflows/coding-task-workflow-agentic.json +1 -0
  17. package/workflows/cross-platform-code-conversion.v2.json +8 -7
  18. package/workflows/document-creation-workflow.json +2 -1
  19. package/workflows/documentation-update-workflow.json +2 -1
  20. package/workflows/intelligent-test-case-generation.json +2 -1
  21. package/workflows/learner-centered-course-workflow.json +2 -1
  22. package/workflows/mr-review-workflow.agentic.v2.json +1 -0
  23. package/workflows/personal-learning-materials-creation-branched.json +1 -0
  24. package/workflows/presentation-creation.json +2 -1
  25. package/workflows/production-readiness-audit.json +1 -0
  26. package/workflows/relocation-workflow-us.json +1 -0
  27. package/workflows/routines/context-gathering.json +2 -1
  28. package/workflows/routines/design-review.json +1 -0
  29. package/workflows/routines/execution-simulation.json +2 -1
  30. package/workflows/routines/feature-implementation.json +4 -3
  31. package/workflows/routines/final-verification.json +1 -0
  32. package/workflows/routines/hypothesis-challenge.json +13 -3
  33. package/workflows/routines/ideation.json +1 -1
  34. package/workflows/routines/parallel-work-partitioning.json +1 -0
  35. package/workflows/routines/philosophy-alignment.json +2 -1
  36. package/workflows/routines/plan-analysis.json +2 -1
  37. package/workflows/routines/plan-generation.json +2 -1
  38. package/workflows/routines/tension-driven-design.json +1 -0
  39. package/workflows/scoped-documentation-workflow.json +2 -1
  40. package/workflows/test-artifact-loop-control.json +8 -2
  41. package/workflows/test-session-persistence.json +1 -0
  42. package/workflows/ui-ux-design-workflow.json +1 -0
  43. package/workflows/workflow-diagnose-environment.json +1 -0
  44. package/workflows/workflow-for-workflows.json +1 -0
  45. package/workflows/workflow-for-workflows.v2.json +28 -0
  46. package/workflows/wr.discovery.json +1 -0
  47. package/workflows/wr.shaping.json +21 -6
@@ -2,6 +2,7 @@
2
2
  "id": "routine-feature-implementation",
3
3
  "name": "Feature Implementation Routine",
4
4
  "version": "1.0.0",
5
+ "metricsProfile": "none",
5
6
  "description": "Implements code precisely according to a detailed approved plan within a bounded scope. Follows existing patterns, writes tests, and maintains code quality. Intended as an optional execution utility, not the default strategy for the main coding workflow.",
6
7
  "clarificationPrompts": [
7
8
  "What plan file should I implement? (e.g., implementation-plan.md)",
@@ -67,7 +68,7 @@
67
68
  {
68
69
  "id": "step-2-verify-acceptance-criteria",
69
70
  "title": "Step 2: Verify Acceptance Criteria",
70
- "prompt": "**VERIFY ALL ACCEPTANCE CRITERIA ARE MET**\n\nNow verify that your implementation meets all acceptance criteria.\n\n**YOUR MISSION:** Systematically check each acceptance criterion and verify it's met.\n\n**PLAN YOUR APPROACH:**\nBefore verifying, think:\n- How will I test each criterion?\n- What evidence proves each criterion is met?\n- Are there any criteria I might have missed?\n- What manual testing should I do?\n\n**EXECUTE:**\nFor each acceptance criterion:\n\n1. **State the Criterion**\n - Quote the exact criterion from the plan\n\n2. **Verify It's Met**\n - Run relevant tests\n - Perform manual testing if needed\n - Check code implementation\n - Gather evidence\n\n3. **Mark Status**\n - \u2705 Met (with evidence)\n - \u274c Not Met (with reason)\n - \u26a0\ufe0f Partially Met (with details)\n\n4. **Provide Evidence**\n - Test results\n - Code references (file:line)\n - Manual test outcomes\n - Metrics or measurements\n\n**REFLECT:**\nAs you verify, ask yourself:\n- Did I test each criterion thoroughly?\n- Is my evidence convincing?\n- Are there edge cases I should test?\n- Did I miss any criteria?\n\n**WORKING NOTES:**\nCapture your verification:\n- Acceptance criteria checklist (with status)\n- Evidence for each criterion\n- Test results\n- Manual testing performed\n- Edge cases tested\n- Any criteria not met (with reasons)",
71
+ "prompt": "**VERIFY ALL ACCEPTANCE CRITERIA ARE MET**\n\nNow verify that your implementation meets all acceptance criteria.\n\n**YOUR MISSION:** Systematically check each acceptance criterion and verify it's met.\n\n**PLAN YOUR APPROACH:**\nBefore verifying, think:\n- How will I test each criterion?\n- What evidence proves each criterion is met?\n- Are there any criteria I might have missed?\n- What manual testing should I do?\n\n**EXECUTE:**\nFor each acceptance criterion:\n\n1. **State the Criterion**\n - Quote the exact criterion from the plan\n\n2. **Verify It's Met**\n - Run relevant tests\n - Perform manual testing if needed\n - Check code implementation\n - Gather evidence\n\n3. **Mark Status**\n - Met (with evidence)\n - Not Met (with reason)\n - ⚠️ Partially Met (with details)\n\n4. **Provide Evidence**\n - Test results\n - Code references (file:line)\n - Manual test outcomes\n - Metrics or measurements\n\n**REFLECT:**\nAs you verify, ask yourself:\n- Did I test each criterion thoroughly?\n- Is my evidence convincing?\n- Are there edge cases I should test?\n- Did I miss any criteria?\n\n**WORKING NOTES:**\nCapture your verification:\n- Acceptance criteria checklist (with status)\n- Evidence for each criterion\n- Test results\n- Manual testing performed\n- Edge cases tested\n- Any criteria not met (with reasons)",
71
72
  "agentRole": "You are a quality assurance specialist verifying that all requirements are met. Be thorough and provide evidence.",
72
73
  "requireConfirmation": false,
73
74
  "guidance": [
@@ -100,7 +101,7 @@
100
101
  {
101
102
  "id": "step-4-synthesize-deliverable",
102
103
  "title": "Step 4: Synthesize & Deliver Implementation Report",
103
- "prompt": "**DELIVER YOUR IMPLEMENTATION REPORT**\n\nNow compile your work into a clear, comprehensive deliverable.\n\n**YOUR MISSION:** Create an implementation report that documents all changes, tests, and verification.\n\n**PLAN YOUR APPROACH:**\nBefore writing, think:\n- Who will read this and what do they need?\n- How can I make it easy to review?\n- What's the most important information?\n- How can I prove I met all criteria?\n\n**EXECUTE:**\nCreate your implementation report with these sections:\n\n1. **Summary** (3-5 bullets)\n - What was implemented\n - Key changes made\n - Test coverage added\n - Any deviations from plan\n\n2. **Implementation Details**\n - Files modified (with summary of changes and code snippets)\n - Files created (with purpose and key code)\n - Files deleted (if any)\n - Pattern adherence notes\n\n3. **Tests Added/Updated**\n - New tests (with descriptions)\n - Updated tests (with reasons)\n - Test results (pass/fail counts)\n - Test coverage metrics (if available)\n\n4. **Verification Steps**\n - How to run tests\n - How to check linter\n - How to manually verify\n - How to check metrics (if applicable)\n\n5. **Deviations from Plan**\n - Any deviations (with reasons and impact)\n - Approval status (needed/not needed)\n\n6. **Acceptance Criteria Status**\n - Checklist of all criteria (\u2705/\u274c/\u26a0\ufe0f)\n - Evidence for each\n - Overall status\n\n7. **Known Issues / TODOs**\n - Issues encountered\n - TODOs for future work\n - Blockers (if any)\n\n8. **Build & Lint Status**\n - Build results\n - Linter results\n - Overall quality status\n\n**REFLECT:**\nBefore delivering, ask yourself:\n- Is my report complete and accurate?\n- Did I document all changes?\n- Can someone review this easily?\n- Did I provide enough evidence?\n- Are there any issues I should flag?\n\n**DELIVERABLE:**\nA comprehensive implementation report (markdown format) with all sections above.",
104
+ "prompt": "**DELIVER YOUR IMPLEMENTATION REPORT**\n\nNow compile your work into a clear, comprehensive deliverable.\n\n**YOUR MISSION:** Create an implementation report that documents all changes, tests, and verification.\n\n**PLAN YOUR APPROACH:**\nBefore writing, think:\n- Who will read this and what do they need?\n- How can I make it easy to review?\n- What's the most important information?\n- How can I prove I met all criteria?\n\n**EXECUTE:**\nCreate your implementation report with these sections:\n\n1. **Summary** (3-5 bullets)\n - What was implemented\n - Key changes made\n - Test coverage added\n - Any deviations from plan\n\n2. **Implementation Details**\n - Files modified (with summary of changes and code snippets)\n - Files created (with purpose and key code)\n - Files deleted (if any)\n - Pattern adherence notes\n\n3. **Tests Added/Updated**\n - New tests (with descriptions)\n - Updated tests (with reasons)\n - Test results (pass/fail counts)\n - Test coverage metrics (if available)\n\n4. **Verification Steps**\n - How to run tests\n - How to check linter\n - How to manually verify\n - How to check metrics (if applicable)\n\n5. **Deviations from Plan**\n - Any deviations (with reasons and impact)\n - Approval status (needed/not needed)\n\n6. **Acceptance Criteria Status**\n - Checklist of all criteria (✅/❌/⚠️)\n - Evidence for each\n - Overall status\n\n7. **Known Issues / TODOs**\n - Issues encountered\n - TODOs for future work\n - Blockers (if any)\n\n8. **Build & Lint Status**\n - Build results\n - Linter results\n - Overall quality status\n\n**REFLECT:**\nBefore delivering, ask yourself:\n- Is my report complete and accurate?\n- Did I document all changes?\n- Can someone review this easily?\n- Did I provide enough evidence?\n- Are there any issues I should flag?\n\n**DELIVERABLE:**\nA comprehensive implementation report (markdown format) with all sections above.",
104
105
  "agentRole": "You are a technical writer synthesizing your implementation work into a clear, reviewable report. Make it easy to understand and verify.",
105
106
  "requireConfirmation": false,
106
107
  "guidance": [
@@ -117,4 +118,4 @@
117
118
  ]
118
119
  }
119
120
  ]
120
- }
121
+ }
@@ -2,6 +2,7 @@
2
2
  "id": "routine-final-verification",
3
3
  "name": "Final Verification Routine",
4
4
  "version": "1.0.0",
5
+ "metricsProfile": "none",
5
6
  "description": "Performs reusable final verification over acceptance criteria, invariants, validation evidence, regressions, cumulative drift, and philosophy alignment. Produces a proof-oriented verification artifact built around claim -> evidence -> gap -> severity -> readiness verdict.",
6
7
  "clarificationPrompts": [
7
8
  "What implementation or slices should I verify?",
@@ -2,6 +2,7 @@
2
2
  "id": "routine-hypothesis-challenge",
3
3
  "name": "Hypothesis Challenge Routine",
4
4
  "version": "1.0.0",
5
+ "metricsProfile": "none",
5
6
  "description": "Lean adversarial review of a hypothesis, recommendation, or diagnosis. Produces the strongest counter-argument, exposes weak assumptions and evidence gaps, identifies likely failure modes, and defines the critical tests needed to keep, revise, or reject the current claim.",
6
7
  "clarificationPrompts": [
7
8
  "What hypothesis, recommendation, or diagnosis should I challenge?",
@@ -49,9 +50,18 @@
49
50
  "title": "Step 4: Generate Alternative Explanations and Critical Tests",
50
51
  "runCondition": {
51
52
  "or": [
52
- { "var": "depth", "equals": "THOROUGH" },
53
- { "var": "rigorMode", "equals": "THOROUGH" },
54
- { "var": "rigor", "gte": 5 }
53
+ {
54
+ "var": "depth",
55
+ "equals": "THOROUGH"
56
+ },
57
+ {
58
+ "var": "rigorMode",
59
+ "equals": "THOROUGH"
60
+ },
61
+ {
62
+ "var": "rigor",
63
+ "gte": 5
64
+ }
55
65
  ]
56
66
  },
57
67
  "prompt": "For THOROUGH review, go beyond the primary counter-argument into alternatives and discrimination strategy.\n\nProduce:\n- the 1-2 strongest alternative explanations or competing hypotheses\n- why each might beat the current claim\n- the critical tests, observations, or traces that would discriminate between them\n- what result would cause you to keep, revise, or reject the current claim\n\nThis step exists to make THOROUGH meaningfully deeper than STANDARD, not just wordier.",
@@ -2,6 +2,7 @@
2
2
  "id": "routine-ideation",
3
3
  "name": "Ideation Routine",
4
4
  "version": "1.0.0",
5
+ "metricsProfile": "none",
5
6
  "description": "Systematic idea generation routine for exploring solution spaces and generating diverse approaches to problems. Supports different perspectives (simplicity, performance, maintainability, etc.) for parallel ideation. Expected inputs: problem, constraints, context, perspective (optional), quantity, deliverable name.",
6
7
  "steps": [
7
8
  {
@@ -70,4 +71,3 @@
70
71
  }
71
72
  ]
72
73
  }
73
-
@@ -2,6 +2,7 @@
2
2
  "id": "routine-parallel-work-partitioning",
3
3
  "name": "Parallel Work Partitioning Routine",
4
4
  "version": "0.1.0",
5
+ "metricsProfile": "none",
5
6
  "description": "Analyzes a set of work items and their dependencies, partitions them into independent batches that can be safely parallelized across subagents, and produces a sorted execution plan. Flags items with cross-dependencies for sequential handling by the main agent.",
6
7
  "metaGuidance": [
7
8
  "INDEPENDENCE IS THE PRIORITY: a batch is only parallel-safe if no item in it depends on any other item in any concurrent batch.",
@@ -2,6 +2,7 @@
2
2
  "id": "routine-philosophy-alignment",
3
3
  "name": "Philosophy Alignment Routine",
4
4
  "version": "1.0.0",
5
+ "metricsProfile": "none",
5
6
  "description": "Independently evaluates a plan or implementation artifact against the user's coding philosophy. Produces findings by principle name and distinguishes blocking violations from acceptable tensions.",
6
7
  "clarificationPrompts": [
7
8
  "What artifact should I review? (plan, architecture summary, implementation diff, files)",
@@ -59,4 +60,4 @@
59
60
  "requireConfirmation": false
60
61
  }
61
62
  ]
62
- }
63
+ }
@@ -2,6 +2,7 @@
2
2
  "id": "routine-plan-analysis",
3
3
  "name": "Plan Analysis Routine",
4
4
  "version": "1.1.0",
5
+ "metricsProfile": "none",
5
6
  "description": "Validates implementation plans using an Ideate -> Plan -> Execute strategy. Checks for completeness, pattern adherence, and risk. Designed for delegation to Plan Analyzer subagent.",
6
7
  "clarificationPrompts": [
7
8
  "What plan file should I analyze? (e.g., implementation-plan.md)",
@@ -97,4 +98,4 @@
97
98
  ]
98
99
  }
99
100
  ]
100
- }
101
+ }
@@ -2,6 +2,7 @@
2
2
  "id": "routine-plan-generation",
3
3
  "name": "Plan Generation Routine",
4
4
  "version": "1.0.0",
5
+ "metricsProfile": "none",
5
6
  "description": "Generates a complete candidate implementation plan from a neutral fact packet. Designed for parallel use across multiple perspectives so the main agent can compare or synthesize plans.",
6
7
  "clarificationPrompts": [
7
8
  "What problem should this plan solve?",
@@ -60,4 +61,4 @@
60
61
  "requireConfirmation": false
61
62
  }
62
63
  ]
63
- }
64
+ }
@@ -2,6 +2,7 @@
2
2
  "id": "routine-tension-driven-design",
3
3
  "name": "Tension-Driven Design Generation",
4
4
  "version": "1.0.0",
5
+ "metricsProfile": "none",
5
6
  "description": "Generates design candidates by deeply understanding a problem, identifying real tensions and constraints (including the dev's philosophy), and producing candidates that resolve those tensions differently. Each candidate includes explicit tradeoffs, failure modes, and philosophy alignment. Replaces perspective-based generation with constraint-driven generation for higher-quality, genuinely diverse candidates.",
6
7
  "clarificationPrompts": [
7
8
  "What problem should this design solve?",
@@ -2,6 +2,7 @@
2
2
  "id": "scoped-documentation-workflow",
3
3
  "name": "Scoped Documentation Workflow",
4
4
  "version": "2.0.0",
5
+ "metricsProfile": "coding",
5
6
  "description": "Use this to create documentation for a single, bounded subject — one class, one integration point, one mechanism, or one architecture decision. Enforces strict scope discipline to prevent documentation sprawl.",
6
7
  "about": "## Scoped Documentation Workflow\n\nUse this when you need to document **one specific, bounded subject** -- a single class, one integration contract, a particular algorithm, an architecture decision, or a single workflow step. The defining feature of this workflow is strict scope discipline: it explicitly defines what is \"in scope\" (explained in detail) vs. \"out of scope\" (referenced only, never explained), and enforces that boundary throughout analysis and writing.\n\n### What it produces\n\n- A focused documentation file covering the subject in depth.\n- A `SCOPE_MAP.md` that shows what is documented here vs. referenced elsewhere.\n- An optional `MAINTENANCE_NOTES.md` with guidance on when to update.\n\n### When to use it\n\n- You want docs for one class, module, mechanism, or concept -- not a whole system.\n- You've had documentation sprawl problems before and want enforced boundaries.\n- You're building a documentation set incrementally, one subject at a time.\n- The subject has clear integration points with other systems that should be referenced, not re-explained.\n\n### When NOT to use it\n\n- You need documentation that intentionally spans multiple components -- use the Document Creation workflow instead.\n- You're updating an existing doc -- use the Documentation Update workflow.\n\n### How to get good results\n\n- The first step asks you to review and approve a scope contract. Be precise here -- the whole workflow defends this boundary.\n- Out-of-scope items should already have their own documentation. If they don't, note that so the scope map can reflect it.\n- If you find the approved scope was too narrow or too broad during the workflow, you can request a scope renegotiation.",
7
8
  "examples": [
@@ -185,4 +186,4 @@
185
186
  "hasValidation": true
186
187
  }
187
188
  ]
188
- }
189
+ }
@@ -3,6 +3,7 @@
3
3
  "name": "Test Artifact Loop Control",
4
4
  "description": "Test workflow demonstrating typed artifact loop control (Phase 3 migration pattern)",
5
5
  "version": "1.0.0",
6
+ "metricsProfile": "none",
6
7
  "metaGuidance": [
7
8
  "This workflow demonstrates the new artifact-based loop control pattern.",
8
9
  "Instead of prose validation (checking for 'continuePlanning = true' in text),",
@@ -55,7 +56,9 @@
55
56
  "title": "Complete",
56
57
  "prompt": "The iteration loop has completed. Assess whether the loop result is ready to publish.\n\nProvide an assessment artifact for readiness.",
57
58
  "requireConfirmation": false,
58
- "assessmentRefs": ["readiness_gate"],
59
+ "assessmentRefs": [
60
+ "readiness_gate"
61
+ ],
59
62
  "assessmentConsequences": [
60
63
  {
61
64
  "when": {
@@ -77,7 +80,10 @@
77
80
  {
78
81
  "id": "confidence",
79
82
  "purpose": "How confident the agent is that the loop result is complete and correct.",
80
- "levels": ["low", "high"]
83
+ "levels": [
84
+ "low",
85
+ "high"
86
+ ]
81
87
  }
82
88
  ]
83
89
  }
@@ -3,6 +3,7 @@
3
3
  "name": "Session Persistence Test",
4
4
  "description": "Purpose-built workflow for testing v2 session persistence, cross-chat resume, and checkpoint mechanics. Has 5 simple steps that agents can complete quickly with unique marker outputs.",
5
5
  "version": "1.0.0",
6
+ "metricsProfile": "none",
6
7
  "steps": [
7
8
  {
8
9
  "id": "step-1-alpha",
@@ -2,6 +2,7 @@
2
2
  "id": "ui-ux-design-workflow",
3
3
  "name": "UI/UX Design Workflow",
4
4
  "version": "0.1.0",
5
+ "metricsProfile": "design",
5
6
  "description": "Design UI/UX from scratch with enforced process. Makes problem framing structurally required before solution proposals, forces exploration of multiple design directions before convergence, and applies reviewer families for information architecture, UX laws, accessibility, edge cases, and content. Output: a design spec concrete enough to implement or review.",
6
7
  "about": "## UI/UX Design Workflow\n\nThis workflow produces a design spec for a new feature, screen, component, or interaction. It is built around a single principle: problem framing must happen before any solutions are proposed. The workflow makes this structurally impossible to skip, which prevents the most common failure mode in AI-assisted design -- going straight from \"I need a settings screen\" to a layout without ever asking who uses it or what they are trying to do.\n\n**What it does:**\nPhase 0 frames the problem by reading existing code patterns and asking only what tools cannot answer. Phase 1 generates 2-3 genuinely different design directions before any one is chosen. Phases 2-5 run parallel reviewer families -- information architecture, UX laws (Hick's Law, Miller's Law, Fitts's Law, and others), accessibility (specific WCAG requirements, not just \"follow WCAG\"), edge cases (empty, error, loading, first-use), and content quality -- then synthesize their findings, resolve contradictions, and write a spec only after all hard quality gates pass.\n\n**When to use it:**\n- You need to design a new screen, feature, or non-trivial component\n- You want explicit coverage of accessibility, edge states, and UX laws, not just a layout sketch\n- You need a spec concrete enough for an engineer to implement or a designer to review\n- Simple single-component changes also work through a lighter direct-spec path\n\n**What it produces:**\nA design spec with 8 sections: design decision, information architecture, interaction design, all element states, specific accessibility requirements, content copy, reviewer findings with citations, and open questions that still require human visual review.\n\n**How to get good results:**\nPoint the workflow to your codebase so it can read existing components and patterns. Provide the design system location if it is not in the repo. Share any known user pain points or research. The workflow will surface what it cannot determine on its own.",
7
8
  "examples": [
@@ -2,6 +2,7 @@
2
2
  "id": "workflow-diagnose-environment",
3
3
  "name": "Diagnostic: Environment & Subagents",
4
4
  "version": "1.0.0",
5
+ "metricsProfile": "none",
5
6
  "description": "Use this to diagnose MCP server, tool availability, or environment configuration issues. Probes for subagent access and generates a local configuration file.",
6
7
  "about": "## Environment Diagnostic Workflow\n\nThis is a short, self-contained diagnostic that checks what capabilities are actually available in the current workspace -- specifically whether subagent delegation works and whether WorkRail tools are accessible to those subagents.\n\n**What it does:**\nThe workflow actively probes for subagent access by attempting to contact a subagent and have it list available tools. Based on the result, it classifies the environment into one of three tiers: full delegation (Tier 3), proxy mode where subagents exist but lack tool access (Tier 2), or solo mode with no subagents available (Tier 1). It then writes a `.workrail/config.json` file recording the detected capability tier so other workflows can make informed delegation decisions.\n\n**When to use it:**\n- You are setting up WorkRail in a new workspace for the first time\n- A workflow that relies on subagent delegation is not working as expected\n- You suspect MCP server configuration is wrong but are not sure what tier you are in\n- You want a persistent record of what the current environment can actually do\n\n**What it produces:**\nA `.workrail/config.json` file with the detected mode (`delegate`, `proxy`, or `solo`) and subagent names if discovered. A summary of what capabilities were found.\n\n**How to get good results:**\nRun this workflow before starting complex multi-agent workflows. It takes only two steps and requires no input from you beyond starting it.",
7
8
  "examples": [
@@ -2,6 +2,7 @@
2
2
  "id": "workflow-for-workflows",
3
3
  "name": "Workflow Authoring Workflow",
4
4
  "version": "2.4.0",
5
+ "metricsProfile": "design",
5
6
  "description": "Use this to author or modernize a WorkRail workflow. Guides through understanding the task, defining effectiveness targets, designing architecture and quality gates, drafting, validating, assigning tags, and handing off.",
6
7
  "about": "## Workflow Authoring Workflow\n\nThis is the standard WorkRail workflow for creating a new workflow from scratch or modernizing an existing one. It is the trust gate for all other workflows: a workflow is not considered production-ready until it has passed through here.\n\n**What it does:**\nThe workflow walks through the full authoring lifecycle: understanding the task, choosing the right baseline and archetype, designing the phase and quality-gate architecture, drafting the workflow JSON, running structural validators, auditing state fields for bloat, simulating execution against real scenarios, running an adversarial quality review, and producing a final trust handoff. For modernization tasks it builds a value inventory first to ensure enforcement mechanisms, domain knowledge, and behavioral rules are preserved or equivalently replaced.\n\n**When to use it:**\n- You want to author a new WorkRail workflow for a recurring task or problem\n- You have an existing workflow that is outdated, uses legacy patterns (pseudo-DSL, regex validation, satisfaction-score loops), or produces shallow results\n- You want a workflow that will pass the WorkRail quality bar and be trusted to run in production\n\n**What it produces:**\nA validated, tagged workflow JSON file with a `validatedAgainstSpecVersion` stamp. A final trust handoff with readiness verdict, known failure modes, residual weaknesses, and testing guidance.\n\n**How to get good results:**\nDescribe the recurring task the workflow should solve, who will run it, and what a satisfying result looks like. For modernization, point to the existing workflow file. The workflow reads the schema and authoring spec itself -- you do not need to know the JSON format in advance.",
7
8
  "examples": [
@@ -2,6 +2,7 @@
2
2
  "id": "workflow-for-workflows",
3
3
  "name": "Workflow Authoring Workflow",
4
4
  "version": "2.5.0",
5
+ "metricsProfile": "design",
5
6
  "description": "Use this to author or modernize a WorkRail workflow. Guides through understanding the task, defining effectiveness targets, designing architecture and quality gates, drafting, validating, assigning tags, and handing off.",
6
7
  "about": "## Workflow Authoring Workflow\n\nThis is the standard WorkRail workflow for creating a new workflow from scratch or modernizing an existing one. It is the trust gate for all other workflows: a workflow is not considered production-ready until it has passed through here.\n\n**What it does:**\nThe workflow walks through the full authoring lifecycle: understanding the task, choosing the right baseline and archetype, designing the phase and quality-gate architecture, drafting the workflow JSON, running structural validators, auditing state fields for bloat, simulating execution against real scenarios, running an adversarial quality review, and producing a final trust handoff. For modernization tasks it builds a value inventory first to ensure enforcement mechanisms, domain knowledge, and behavioral rules are preserved or equivalently replaced.\n\n**When to use it:**\n- You want to author a new WorkRail workflow for a recurring task or problem\n- You have an existing workflow that is outdated, uses legacy patterns (pseudo-DSL, regex validation, satisfaction-score loops), or produces shallow results\n- You want a workflow that will pass the WorkRail quality bar and be trusted to run in production\n\n**What it produces:**\nA validated, tagged workflow JSON file with a `validatedAgainstSpecVersion` stamp. A final trust handoff with readiness verdict, known failure modes, residual weaknesses, and testing guidance.\n\n**How to get good results:**\nDescribe the recurring task the workflow should solve, who will run it, and what a satisfying result looks like. For modernization, point to the existing workflow file. The workflow reads the schema and authoring spec itself -- you do not need to know the JSON format in advance.",
7
8
  "examples": [
@@ -670,6 +671,33 @@
670
671
  },
671
672
  "requireConfirmation": false
672
673
  },
674
+ {
675
+ "id": "phase-7b-declare-metrics-profile",
676
+ "title": "Phase 7b: Declare metricsProfile",
677
+ "promptBlocks": {
678
+ "goal": "Declare the metricsProfile field in the authored workflow JSON, or explicitly justify omitting it. The metricsProfile field enables engine-injected metrics instrumentation footers in step prompts. When set, the engine injects context key accumulation reminders into every step prompt -- guiding compliant agents to report outcome, commit SHAs, PR numbers, and diff stats at session completion. Without this field, captureConfidence is always 'none' and no session metrics are collected.",
679
+ "procedure": [
680
+ "Choose the correct profile based on what the workflow produces:",
681
+ " - 'coding': produces code commits. Use for implementation, refactoring, bug-fix, migration, and documentation-writing workflows.",
682
+ " - 'review': produces a review decision on a PR or MR. Use for code review, audit, and change validation workflows.",
683
+ " - 'research': produces a finding or recommendation but no commits. Use for investigation, diagnosis, and analysis workflows.",
684
+ " - 'design': produces a design artifact (pitch, spec, ADR, architecture doc) but no commits.",
685
+ " - 'ticket': creates or updates work items in an external system (Jira, GitHub Issues, Linear).",
686
+ " - 'none': meta-workflow, authoring tool, utility routine, or no measurable outcome. Set explicitly and document the reason.",
687
+ "Add `\"metricsProfile\": \"<profile>\"` as a top-level field in the workflow JSON, after `recommendedPreferences` if that field exists.",
688
+ "If choosing 'none', record the justification in your notes so the decision is auditable."
689
+ ],
690
+ "constraints": [
691
+ "Do not invent a new profile value. The closed set is: 'coding', 'review', 'research', 'design', 'ticket', 'none'.",
692
+ "The engine does NOT derive the profile from tags automatically. You must set it explicitly.",
693
+ "workflow-for-workflows itself produces a workflow JSON artifact (a design output) -- use 'design'. It does not commit code."
694
+ ],
695
+ "outputRequired": {
696
+ "notesMarkdown": "State the chosen metricsProfile and a one-line justification. If omitting, explain why."
697
+ }
698
+ },
699
+ "requireConfirmation": false
700
+ },
673
701
  {
674
702
  "id": "phase-7-final-trust-handoff",
675
703
  "title": "Phase 7: Final Trust Handoff",
@@ -2,6 +2,7 @@
2
2
  "id": "wr.discovery",
3
3
  "name": "Discovery Workflow",
4
4
  "version": "3.2.0",
5
+ "metricsProfile": "research",
5
6
  "validatedAgainstSpecVersion": 3,
6
7
  "description": "Use this to explore and think through a problem end-to-end. Moves between landscape exploration, problem framing, candidate generation, adversarial challenge, and uncertainty resolution.",
7
8
  "about": "## Discovery Workflow\n\nThis workflow is for structured thinking through an ambiguous problem, opportunity, or decision -- the kind where you are not sure of the right answer yet and jumping straight to solutions would be premature.\n\n**What it does:**\nBefore starting any research, the workflow challenges the stated goal: it determines whether you handed it a problem or a solution, surfaces hidden assumptions, and defines what success looks like in concrete observable terms. It then selects one of three emphasis paths based on your actual need: `landscape_first` for understanding the current state and comparing options, `full_spectrum` for important or ambiguous problems where both landscape grounding and reframing are needed, and `design_first` when the dominant risk is solving the wrong problem. The workflow moves through landscape research, stakeholder and problem framing, candidate direction generation, adversarial challenge, and an uncertainty-resolution stage that can close with a recommendation, a targeted research follow-up, or a prototype/test plan. A design document is maintained throughout as the human-facing artifact.\n\n**When to use it:**\n- You face a decision, architectural question, or design problem with no obvious right answer\n- You want to explore an opportunity space before committing to a direction\n- You suspect the stated problem might not be the real problem\n- You need a structured recommendation with explicit tradeoffs and alternatives rather than the first plausible answer\n- You want to make sure you are solving the right problem, not just the one you described\n\n**What it produces:**\nA design document covering: the reframed problem (if the original was solution-framed), the selected path and framing, landscape takeaways, chosen direction and why it won, the strongest alternative and why it lost, confidence band, residual risks, and next actions.\n\n**How to get good results:**\nDescribe the problem, opportunity, or decision you want help thinking through -- or describe the solution you are considering, and let the workflow figure out the underlying problem. State what outcome you want (a recommendation, a comparison, a research plan, a prototype direction). The more context you provide upfront about constraints and anti-goals, the sharper the framing will be.",
@@ -2,6 +2,7 @@
2
2
  "id": "wr.shaping",
3
3
  "name": "Shaping Workflow",
4
4
  "version": "1.0.0",
5
+ "metricsProfile": "design",
5
6
  "description": "Faithful Shape Up product shaping. Converts a fuzzy problem into a bounded, implementation-ready pitch (pitch.md). Tech-agnostic -- works for any language, platform, framework, or non-software work. Produces a product-level pitch, not an engineering spec.",
6
7
  "about": "## Shaping Workflow\n\nTakes a fuzzy problem and produces a shaped pitch: a specific problem story, a fixed appetite, a fat-marker solution sketch, rabbit holes patched at the product level, and explicit no-gos.\n\n### What this is\n\nFaithful Shape Up shaping. The output is a **product-level pitch** -- it describes what the feature does and what it explicitly does not do, at a level a human engineering team or an AI pipeline can execute against.\n\nThis is not an engineering spec. It does not contain file paths, function signatures, test commands, or implementation plans. Those belong in the engineering phase that follows.\n\n### Tech-agnostic\n\nThis workflow works for any context: web, mobile, backend, data, embedded, or non-software product work. There are no references to specific tools, languages, frameworks, or platforms.\n\n### What it produces\n\n- `pitch.md` at `.workrail/current-pitch.md` -- the shaped pitch\n\n### Two mandatory human gates\n\n1. **Frame gate (Step 2):** confirm the problem statement and appetite before design work begins -- a wrong frame wastes everything downstream\n2. **Approval gate (Step 8):** review the complete pitch before implementation starts\n\nBoth gates self-resolve with low-confidence defaults when running autonomously.\n\n### When to use this\n\n- After `wr.discovery` when you have a direction and need to translate it into a bounded task\n- Before `coding-task-workflow-agentic` when a task is fuzzy, could sprawl, or needs appetite-setting\n- When multiple people need to agree on what is being built before engineering starts\n- Any time you want the Shape Up circuit breaker: fixed time, variable scope, kill if it doesn't fit\n\n### When to skip this\n\n- The task is small, concrete, and clearly scoped -- go straight to Coding\n- Discovery already produced a bounded, implementable direction\n- You have a pre-written ticket or spec",
7
8
  "examples": [
@@ -21,7 +22,10 @@
21
22
  {
22
23
  "id": "frame_soundness",
23
24
  "purpose": "Problem names a specific person/role, describes a specific situation, states what they need, and states what fails today.",
24
- "levels": ["low", "high"]
25
+ "levels": [
26
+ "low",
27
+ "high"
28
+ ]
25
29
  }
26
30
  ]
27
31
  },
@@ -32,7 +36,10 @@
32
36
  {
33
37
  "id": "solution_roughness",
34
38
  "purpose": "Elements describe user-visible surfaces, flows, and behavioral constraints -- not function signatures, data models, or implementation patterns.",
35
- "levels": ["low", "high"]
39
+ "levels": [
40
+ "low",
41
+ "high"
42
+ ]
36
43
  }
37
44
  ]
38
45
  }
@@ -65,10 +72,14 @@
65
72
  "not_equals": true
66
73
  },
67
74
  "prompt": "Present the extracted problem framings and confirm the frame before any design work begins.\n\nShow:\n1. The candidate problem framings from Step 1\n2. Suggested appetite: xs (hours), s (1-2 days), m (3-7 days), l (1-2 weeks), xl (3-4 weeks)\n3. Open questions that need resolution\n\nAsk the user to:\n- Select or rewrite the problem statement as a specific story\n- Confirm the appetite\n- Answer critical open questions\n\n**Structural validation for frame_soundness=high:** the problem statement must name a specific person or role, describe a specific situation, state what they need, AND state what fails today. Abstract statements ('users want better X') are always frame_soundness=low.\n\nDo NOT proceed until the user confirms a specific-story problem statement.\n\n**If running autonomously with no user available:** pick the most specific candidate framing, set appetite to 's' as a safe default, record both in assumptionsLog with confidence 0.4, and advance. Flag for human review.\n\nCapture:\n- `problemStatement` (confirmed specific story)\n- `appetite` (object: {sizingBucket: 'xs'|'s'|'m'|'l'|'xl'} -- xs=hours, s=1-2 days, m=3-7 days, l=1-2 weeks, xl=3-4 weeks)\n- `resolvedQuestions`",
68
- "assessmentRefs": ["frame-soundness"],
75
+ "assessmentRefs": [
76
+ "frame-soundness"
77
+ ],
69
78
  "assessmentConsequences": [
70
79
  {
71
- "when": {"anyEqualsLevel": "low"},
80
+ "when": {
81
+ "anyEqualsLevel": "low"
82
+ },
72
83
  "effect": {
73
84
  "kind": "require_followup",
74
85
  "guidance": "The problem statement is still abstract or solution-framed. It must name a specific person/role in a specific situation with a specific failure. Do not advance until confirmed."
@@ -105,10 +116,14 @@
105
116
  "not_equals": true
106
117
  },
107
118
  "prompt": "Expand the chosen shape into a breadboard and element list. Stay at the product level throughout.\n\n**Breadboard (words only):**\n- **Places** -- screens, dialogs, states, endpoints (from the user's perspective)\n- **Affordances** -- buttons, fields, actions -- listed under their place\n- **Connections** -- 'Place A → Place B when [user action]'\n\nNo visual layout. No code. No system internals. Words and arrows only.\n\n**Element list:**\nFor each element, one sentence classified as:\n- **Interface** -- something the user sees or interacts with (a surface, a flow, a visible state)\n- **Invariant** -- a behavioral constraint (a policy, a rule, what must always be true)\n- **Exclusion** -- functionality explicitly NOT included\n\nReject any element that:\n- Describes HOW to build something (implementation detail)\n- Uses vague modifiers without a concrete noun ('improve', 'better', 'scalable')\n\n**Structural validation for solution_roughness=high:** every element must be Interface, Invariant, or Exclusion describing product behavior -- not code structure, not technical implementation.\n\nCapture:\n- `breadboardMd` (breadboard in markdown)\n- `elements` (array: {name, description, classification: 'interface'|'invariant'|'exclusion'})",
108
- "assessmentRefs": ["solution-roughness"],
119
+ "assessmentRefs": [
120
+ "solution-roughness"
121
+ ],
109
122
  "assessmentConsequences": [
110
123
  {
111
- "when": {"anyEqualsLevel": "low"},
124
+ "when": {
125
+ "anyEqualsLevel": "low"
126
+ },
112
127
  "effect": {
113
128
  "kind": "require_followup",
114
129
  "guidance": "One or more elements describe implementation details or contain vague modifiers. Rewrite: every element must describe what the feature does (Interface, Invariant, or Exclusion), not how it is built."