@codemcp/workflows 6.14.2 → 6.15.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 (77) hide show
  1. package/package.json +2 -2
  2. package/packages/cli/dist/{chunk-SB3HRQCH.js → chunk-4TXLRBGW.js} +2 -0
  3. package/packages/cli/dist/{cli-RLPVHRTE.js → cli-MNJS4MGX.js} +3 -3
  4. package/packages/cli/dist/{dist-ARC6LWFF.js → dist-MBA7OLZA.js} +2 -0
  5. package/packages/cli/dist/{dist-FTEFRIPR.js → dist-WS5DFBKD.js} +1 -1
  6. package/packages/cli/dist/index.js +2 -2
  7. package/packages/cli/package.json +1 -1
  8. package/packages/cli/resources/workflows/epcc.yaml +1 -0
  9. package/packages/cli/resources/workflows/pr-review.yaml +177 -0
  10. package/packages/core/dist/instruction-generator.js +2 -0
  11. package/packages/core/dist/instruction-generator.js.map +1 -1
  12. package/packages/core/package.json +1 -1
  13. package/packages/core/resources/workflows/epcc.yaml +1 -0
  14. package/packages/core/resources/workflows/pr-review.yaml +177 -0
  15. package/packages/docs/.vitepress/dist/404.html +2 -2
  16. package/packages/docs/.vitepress/dist/assets/{app.DCKDzGKW.js → app.CAEWYLPb.js} +1 -1
  17. package/packages/docs/.vitepress/dist/assets/chunks/{theme.D_Ip3oEh.js → theme.CshoOl3e.js} +1 -1
  18. package/packages/docs/.vitepress/dist/assets/workflows_pr-review.md.CdYxJ5Yu.js +1 -0
  19. package/packages/docs/.vitepress/dist/assets/workflows_pr-review.md.CdYxJ5Yu.lean.js +1 -0
  20. package/packages/docs/.vitepress/dist/dev/ARCHITECTURE.html +3 -3
  21. package/packages/docs/.vitepress/dist/dev/DEVELOPMENT.html +3 -3
  22. package/packages/docs/.vitepress/dist/dev/LOGGING.html +3 -3
  23. package/packages/docs/.vitepress/dist/dev/PUBLISHING.html +3 -3
  24. package/packages/docs/.vitepress/dist/hashmap.json +1 -1
  25. package/packages/docs/.vitepress/dist/index.html +3 -3
  26. package/packages/docs/.vitepress/dist/user/advanced-engineering.html +3 -3
  27. package/packages/docs/.vitepress/dist/user/agent-setup.html +3 -3
  28. package/packages/docs/.vitepress/dist/user/beads-integration.html +3 -3
  29. package/packages/docs/.vitepress/dist/user/crowd-mcp-integration.html +3 -3
  30. package/packages/docs/.vitepress/dist/user/custom-workflows.html +3 -3
  31. package/packages/docs/.vitepress/dist/user/git-commit-feature.html +3 -3
  32. package/packages/docs/.vitepress/dist/user/how-it-works.html +3 -3
  33. package/packages/docs/.vitepress/dist/user/long-term-memory.html +3 -3
  34. package/packages/docs/.vitepress/dist/user/packaged-workflows.html +3 -3
  35. package/packages/docs/.vitepress/dist/user/tutorial.html +3 -3
  36. package/packages/docs/.vitepress/dist/user/workflow-selection.html +3 -3
  37. package/packages/docs/.vitepress/dist/workflows/adr.html +3 -3
  38. package/packages/docs/.vitepress/dist/workflows/big-bang-conversion.html +3 -3
  39. package/packages/docs/.vitepress/dist/workflows/boundary-testing.html +3 -3
  40. package/packages/docs/.vitepress/dist/workflows/bugfix.html +3 -3
  41. package/packages/docs/.vitepress/dist/workflows/business-analysis.html +3 -3
  42. package/packages/docs/.vitepress/dist/workflows/c4-analysis.html +3 -3
  43. package/packages/docs/.vitepress/dist/workflows/epcc.html +3 -3
  44. package/packages/docs/.vitepress/dist/workflows/epcc.yaml +1 -0
  45. package/packages/docs/.vitepress/dist/workflows/game-beginner.html +3 -3
  46. package/packages/docs/.vitepress/dist/workflows/greenfield.html +3 -3
  47. package/packages/docs/.vitepress/dist/workflows/minor.html +3 -3
  48. package/packages/docs/.vitepress/dist/workflows/posts.html +3 -3
  49. package/packages/docs/.vitepress/dist/workflows/pr-review.html +26 -0
  50. package/packages/docs/.vitepress/dist/workflows/pr-review.yaml +177 -0
  51. package/packages/docs/.vitepress/dist/workflows/sdd-bugfix-crowd.html +3 -3
  52. package/packages/docs/.vitepress/dist/workflows/sdd-bugfix.html +3 -3
  53. package/packages/docs/.vitepress/dist/workflows/sdd-feature-crowd.html +3 -3
  54. package/packages/docs/.vitepress/dist/workflows/sdd-feature.html +3 -3
  55. package/packages/docs/.vitepress/dist/workflows/sdd-greenfield-crowd.html +3 -3
  56. package/packages/docs/.vitepress/dist/workflows/sdd-greenfield.html +3 -3
  57. package/packages/docs/.vitepress/dist/workflows/skilled-bugfix.html +3 -3
  58. package/packages/docs/.vitepress/dist/workflows/skilled-epcc.html +3 -3
  59. package/packages/docs/.vitepress/dist/workflows/skilled-greenfield.html +3 -3
  60. package/packages/docs/.vitepress/dist/workflows/slides.html +3 -3
  61. package/packages/docs/.vitepress/dist/workflows/tdd.html +3 -3
  62. package/packages/docs/.vitepress/dist/workflows/waterfall.html +3 -3
  63. package/packages/docs/.vitepress/dist/workflows.html +3 -3
  64. package/packages/docs/package.json +1 -1
  65. package/packages/mcp-server/dist/index.js +2 -0
  66. package/packages/mcp-server/package.json +1 -1
  67. package/packages/mcp-server/resources/workflows/epcc.yaml +1 -0
  68. package/packages/mcp-server/resources/workflows/pr-review.yaml +177 -0
  69. package/packages/opencode-plugin/dist/index.js +6006 -15661
  70. package/packages/opencode-plugin/package.json +2 -2
  71. package/packages/opencode-plugin/resources/workflows/epcc.yaml +1 -0
  72. package/packages/opencode-plugin/resources/workflows/pr-review.yaml +177 -0
  73. package/packages/opencode-tui-plugin/package.json +1 -1
  74. package/packages/visualizer/dist/services/workflow-list.ts +1 -0
  75. package/packages/visualizer/package.json +1 -1
  76. package/resources/workflows/epcc.yaml +1 -0
  77. package/resources/workflows/pr-review.yaml +177 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows",
3
- "version": "6.14.2",
3
+ "version": "6.15.0",
4
4
  "description": "A Model Context Protocol server that acts as an intelligent conversation state manager and development guide for LLMs, featuring comprehensive long-term memory with persistent project artifacts",
5
5
  "type": "module",
6
6
  "main": "packages/cli/dist/index.js",
@@ -51,7 +51,7 @@
51
51
  "typescript": "^5.9.3",
52
52
  "vitepress": "^1.6.4",
53
53
  "vitest": "4.0.18",
54
- "@codemcp/workflows-core": "6.14.2"
54
+ "@codemcp/workflows-core": "6.15.0"
55
55
  },
56
56
  "lint-staged": {
57
57
  "*.{ts,js,mts,cts,tsx,jsx}": [
@@ -6596,6 +6596,8 @@ var InstructionGenerator = class {
6596
6596
 
6597
6597
  **ACTION REQUIRED: Focus on "${phaseName}" tasks** and log decisions in "Key Decisions"
6598
6598
 
6599
+ **When all tasks are completed**: Make sure that all insights and decisions are captured in \`${conversationContext.planFilePath}\`. Then call proceed_to_phase to move to the next phase.
6600
+
6599
6601
  **CRITICAL: Do NOT use other task/todo tools** - use only the plan file for task tracking`;
6600
6602
  if (allowedFilePatterns && allowedFilePatterns.length > 0 && !allowedFilePatterns.includes("**/*") && !allowedFilePatterns.includes("*")) {
6601
6603
  workflowSection += `
@@ -2,7 +2,7 @@ import {
2
2
  StateMachineLoader,
3
3
  WorkflowManager,
4
4
  generateSystemPrompt
5
- } from "./chunk-SB3HRQCH.js";
5
+ } from "./chunk-4TXLRBGW.js";
6
6
  import "./chunk-R5U7XKVJ.js";
7
7
 
8
8
  // src/cli.ts
@@ -998,11 +998,11 @@ var isLocal = existsSync3(join5(__dirname3, "../../core/dist/index.js"));
998
998
  var generateSystemPrompt2;
999
999
  var StateMachineLoader2;
1000
1000
  if (isLocal) {
1001
- const coreModule = await import("./dist-FTEFRIPR.js");
1001
+ const coreModule = await import("./dist-WS5DFBKD.js");
1002
1002
  generateSystemPrompt2 = coreModule.generateSystemPrompt;
1003
1003
  StateMachineLoader2 = coreModule.StateMachineLoader;
1004
1004
  } else {
1005
- const coreModule = await import("./dist-FTEFRIPR.js");
1005
+ const coreModule = await import("./dist-WS5DFBKD.js");
1006
1006
  generateSystemPrompt2 = coreModule.generateSystemPrompt;
1007
1007
  StateMachineLoader2 = coreModule.StateMachineLoader;
1008
1008
  }
@@ -10212,6 +10212,8 @@ var InstructionGenerator = class {
10212
10212
 
10213
10213
  **ACTION REQUIRED: Focus on "${phaseName}" tasks** and log decisions in "Key Decisions"
10214
10214
 
10215
+ **When all tasks are completed**: Make sure that all insights and decisions are captured in \`${conversationContext.planFilePath}\`. Then call proceed_to_phase to move to the next phase.
10216
+
10215
10217
  **CRITICAL: Do NOT use other task/todo tools** - use only the plan file for task tracking`;
10216
10218
  if (allowedFilePatterns && allowedFilePatterns.length > 0 && !allowedFilePatterns.includes("**/*") && !allowedFilePatterns.includes("*")) {
10217
10219
  workflowSection += `
@@ -32,7 +32,7 @@ import {
32
32
  registerLogSink,
33
33
  setLoggingLevel,
34
34
  setLoggingLevelFromString
35
- } from "./chunk-SB3HRQCH.js";
35
+ } from "./chunk-4TXLRBGW.js";
36
36
  import "./chunk-R5U7XKVJ.js";
37
37
  export {
38
38
  BeadsIntegration,
@@ -10,7 +10,7 @@ var args = process.argv.slice(2);
10
10
  if (args.length === 0) {
11
11
  const isLocal = existsSync(join(__dirname, "../../mcp-server/dist/index.js"));
12
12
  if (isLocal) {
13
- const { startMcpServer } = await import("./dist-ARC6LWFF.js");
13
+ const { startMcpServer } = await import("./dist-MBA7OLZA.js");
14
14
  await startMcpServer();
15
15
  } else {
16
16
  const mcpServerModule = "@codemcp/workflows-server";
@@ -18,6 +18,6 @@ if (args.length === 0) {
18
18
  await startMcpServer();
19
19
  }
20
20
  } else {
21
- const { runCli } = await import("./cli-RLPVHRTE.js");
21
+ const { runCli } = await import("./cli-MNJS4MGX.js");
22
22
  await runCli();
23
23
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-cli",
3
- "version": "6.14.2",
3
+ "version": "6.15.0",
4
4
  "description": "CLI tools for responsible-vibe development workflows",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -31,6 +31,7 @@ states:
31
31
  - '**/*.txt'
32
32
  - '**/*.adoc'
33
33
  default_instructions: |
34
+ Figure out the INTENT of the users instructions.
34
35
  Research the codebase to understand existing patterns and gather context about the problem space.
35
36
 
36
37
  - If uncertain about conventions or rules, ask the user about them
@@ -0,0 +1,177 @@
1
+ # yaml-language-server: $schema=../state-machine-schema.json
2
+ ---
3
+ name: 'pr-review'
4
+ description: 'A tech-agnostic PR or code diff review workflow: determine intent, review architecture, correctness, and quality — hierarchically gated, with findings posted inline.'
5
+ initial_state: 'determine_intent'
6
+
7
+ metadata:
8
+ domain: 'code'
9
+ complexity: 'medium'
10
+ bestFor:
11
+ - 'Pull request reviews'
12
+ - 'Merge request reviews'
13
+ - 'Code review'
14
+ useCases:
15
+ - 'Reviewing a feature branch before merge'
16
+ - 'Reviewing a bug fix'
17
+ - 'Reviewing a refactoring'
18
+ examples:
19
+ - 'Review PR #42'
20
+ - 'Review the feature/login-refactor branch'
21
+
22
+ states:
23
+ determine_intent:
24
+ description: 'Derive the intent of the PR from the diff and present it to the user for confirmation'
25
+ default_instructions: |
26
+ Fetch the diff (stat and full diff) for the PR or branch under review.
27
+ Retrieve the PR description and any linked issue descriptions. Use gh or glab CLI tools as needed. Fallback: Read using http.
28
+
29
+ From the diff and any available PR description, derive in your own words:
30
+ - What problem does this change solve? What does the user intend to achieve?
31
+ - What is the mechanism used to solve it?
32
+
33
+ Present your derived intent to the user and wait for explicit confirmation before proceeding.
34
+ If your derived intent contradicts the PR description or what the user responds to you, flag that explicitly — it is itself a finding.
35
+
36
+ Respond in the user's language.
37
+
38
+ transitions:
39
+ - trigger: 'intent_confirmed'
40
+ to: 'orient'
41
+ transition_reason: 'Intent confirmed by user, ready to map the change'
42
+
43
+ orient:
44
+ description: 'Build a structural map of the change before any judgment'
45
+ default_instructions: |
46
+ Map the change without evaluating it yet:
47
+ - Which files changed, and what kind of change is each (new logic, refactor, configuration, tests, fixtures)?
48
+ - What are the entry points of the data or control flow affected by this change?
49
+ - Which existing boundaries or components does the change touch?
50
+
51
+ Document this map. It will be the reference for all subsequent review phases.
52
+
53
+ transitions:
54
+ - trigger: 'oriented'
55
+ to: 'review_architecture'
56
+ transition_reason: 'Structural map complete, ready to review architecture'
57
+
58
+ review_architecture:
59
+ description: 'Review whether the change is in the right place and respects existing structure'
60
+ default_instructions: |
61
+ Evaluate the structural decisions in the change against the confirmed intent:
62
+
63
+ - Is the change located in the right place, or does it belong elsewhere?
64
+ - Does it respect the existing boundaries and separation of responsibilities?
65
+ - Does it introduce the right abstraction, or does it over- or under-abstract?
66
+ - Does it follow the patterns already established in the codebase?
67
+ - If an architecture document exists ($ARCHITECTURE_DOC), verify the change is consistent with it.
68
+
69
+ For each finding, classify it immediately:
70
+ - **Bug**: incorrect behavior or data loss
71
+ - **Design issue**: correct but wrong structure, will cause pain later
72
+ - **Performance**: correct but unnecessarily costly at the expected scale
73
+ - **Minor**: small violations, naming, unnecessary indirection
74
+ - **Nit**: style, redundant comments, cosmetics
75
+
76
+ Bugs and design issues are major flaws. If major flaws are found, proceed to publish_review immediately.
77
+
78
+ transitions:
79
+ - trigger: 'no_major_flaws'
80
+ to: 'review_correctness'
81
+ transition_reason: 'No major architectural flaws, proceeding to correctness review'
82
+
83
+ - trigger: 'major_flaws_found'
84
+ to: 'publish_review'
85
+ additional_instructions: |
86
+ Major architectural flaws were found. Do not proceed to correctness or quality review —
87
+ reviewing correctness on a structurally wrong solution is wasted effort.
88
+
89
+ Communicate clearly to the user:
90
+ - Which findings are blockers and why
91
+ - What rework is expected before the review can continue
92
+ transition_reason: 'Major architectural flaws found, stopping for rework before continuing'
93
+
94
+ review_correctness:
95
+ description: 'Review whether the logic correctly achieves the confirmed intent'
96
+ default_instructions: |
97
+ Evaluate the logic of the change against the confirmed intent:
98
+
99
+ - Does the code do what the intent requires, for all inputs and states?
100
+ - Are edge cases handled — boundary conditions, empty inputs, missing data?
101
+ - Are things that must stay consistent changed together? Can partial updates occur?
102
+ - Are error paths handled, or silently swallowed?
103
+ - Do resources that grow over time have a defined cleanup strategy?
104
+ - If a design document or specification exists ($DESIGN_DOC), verify the change is consistent with it.
105
+
106
+ For each finding, classify it immediately (same scale as review_architecture).
107
+
108
+ Bugs and design issues are major flaws. If major flaws are found, proceed to publish_review immediately.
109
+
110
+ transitions:
111
+ - trigger: 'no_major_flaws'
112
+ to: 'review_quality'
113
+ transition_reason: 'No major correctness flaws, proceeding to quality review'
114
+
115
+ - trigger: 'major_flaws_found'
116
+ to: 'publish_review'
117
+ additional_instructions: |
118
+ Major correctness flaws were found. Do not proceed to quality review —
119
+ polishing incorrect code is wasted effort.
120
+
121
+ Communicate clearly to the user:
122
+ - Which findings are blockers and why
123
+ - What rework is expected before the review can continue
124
+ Proceed to publish_review to deliver these findings.
125
+ transition_reason: 'Major correctness flaws found, stopping for rework before continuing'
126
+
127
+ review_quality:
128
+ description: 'Review code quality, completeness, and good practices'
129
+ default_instructions: |
130
+ Evaluate the quality of the change:
131
+
132
+ - Is the code DRY, or is logic duplicated that should be shared?
133
+ - Does the code do unnecessary work — reimplementing what the platform already provides,
134
+ or repeating expensive operations that could be done once?
135
+ - Is naming self-explanatory at the right level of abstraction?
136
+ - Do comments explain *why*, not *what*? Are there comments that merely restate the code?
137
+ - Is what's absent a problem: missing tests, missing error handling, missing observability?
138
+ - Are there conventions in the codebase that this change violates?
139
+
140
+ For each finding, classify it immediately (same scale as previous phases).
141
+
142
+ transitions:
143
+ - trigger: 'quality_reviewed'
144
+ to: 'summarize'
145
+ transition_reason: 'Quality review complete, ready to summarize'
146
+
147
+ summarize:
148
+ description: 'Compose a concise overall summary of the review'
149
+ default_instructions: |
150
+ Write a top-level review summary:
151
+ - Restate the confirmed intent in one sentence
152
+ - List blocking findings (bugs, design issues) if any remain
153
+ - List non-blocking suggestions briefly — the inline comments carry the detail
154
+ - State your overall recommendation: approve / request changes / comment
155
+
156
+ Keep it short. The inline comments are the substance; this is the orientation.
157
+
158
+ transitions:
159
+ - trigger: 'summary_ready'
160
+ to: 'publish_review'
161
+ transition_reason: 'Summary ready, proceed to publish'
162
+
163
+ publish_review:
164
+ description: 'Ask the user how to deliver the review findings'
165
+ default_instructions: |
166
+ Ask the user how they want the review delivered:
167
+ - Post inline comments directly to the PR/MR via VCS tooling (e.g. glab, gh)?
168
+ - Present findings as a structured summary in the chat?
169
+ - Both?
170
+
171
+ Once confirmed, deliver accordingly. For inline comments, attach each finding to the
172
+ specific file and line it refers to. For cross-cutting findings, use a top-level comment.
173
+
174
+ transitions:
175
+ - trigger: 'review_published'
176
+ to: 'determine_intent'
177
+ transition_reason: 'Review delivered, ready for next PR'
@@ -71,6 +71,8 @@ export class InstructionGenerator {
71
71
 
72
72
  **ACTION REQUIRED: Focus on "${phaseName}" tasks** and log decisions in "Key Decisions"
73
73
 
74
+ **When all tasks are completed**: Make sure that all insights and decisions are captured in \`${conversationContext.planFilePath}\`. Then call proceed_to_phase to move to the next phase.
75
+
74
76
  **CRITICAL: Do NOT use other task/todo tools** - use only the plan file for task tracking`;
75
77
  // Add file restriction guidance if patterns are restricted
76
78
  if (allowedFilePatterns &&
@@ -1 +1 @@
1
- {"version":3,"file":"instruction-generator.js","sourceRoot":"","sources":["../src/instruction-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAG/D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOpD,MAAM,OAAO,oBAAoB;IACvB,kBAAkB,CAAqB;IAE/C,YAAY,SAAkB,YAAY,CAAC,sBAAsB,CAAC;QAChE,IAAI,CAAC,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,aAA+B;QAC7C,OAAO;IACT,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,oBAAoB,CACxB,gBAAwB,EACxB,OAA2B;QAE3B,mDAAmD;QACnD,MAAM,uBAAuB,GAAG,IAAI,CAAC,yBAAyB,CAC5D,gBAAgB,EAChB,OAAO,CAAC,mBAAmB,CAAC,WAAW,EACvC,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAC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YAAY;;0FAEtC,CAAC;QAEvF,2DAA2D;QAC3D,IACE,mBAAmB;YACnB,mBAAmB,CAAC,MAAM,GAAG,CAAC;YAC9B,CAAC,mBAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC;YACrC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAClC,CAAC;YACD,eAAe,IAAI,wBAAwB,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAClF,CAAC;QAED,eAAe,IAAI,8CAA8C,CAAC;QAElE,OAAO,MAAM,SAAS,aAAa,gBAAgB,OAAO,eAAe,EAAE,CAAC;IAC9E,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-core",
3
- "version": "6.14.2",
3
+ "version": "6.15.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -31,6 +31,7 @@ states:
31
31
  - '**/*.txt'
32
32
  - '**/*.adoc'
33
33
  default_instructions: |
34
+ Figure out the INTENT of the users instructions.
34
35
  Research the codebase to understand existing patterns and gather context about the problem space.
35
36
 
36
37
  - If uncertain about conventions or rules, ask the user about them
@@ -0,0 +1,177 @@
1
+ # yaml-language-server: $schema=../state-machine-schema.json
2
+ ---
3
+ name: 'pr-review'
4
+ description: 'A tech-agnostic PR or code diff review workflow: determine intent, review architecture, correctness, and quality — hierarchically gated, with findings posted inline.'
5
+ initial_state: 'determine_intent'
6
+
7
+ metadata:
8
+ domain: 'code'
9
+ complexity: 'medium'
10
+ bestFor:
11
+ - 'Pull request reviews'
12
+ - 'Merge request reviews'
13
+ - 'Code review'
14
+ useCases:
15
+ - 'Reviewing a feature branch before merge'
16
+ - 'Reviewing a bug fix'
17
+ - 'Reviewing a refactoring'
18
+ examples:
19
+ - 'Review PR #42'
20
+ - 'Review the feature/login-refactor branch'
21
+
22
+ states:
23
+ determine_intent:
24
+ description: 'Derive the intent of the PR from the diff and present it to the user for confirmation'
25
+ default_instructions: |
26
+ Fetch the diff (stat and full diff) for the PR or branch under review.
27
+ Retrieve the PR description and any linked issue descriptions. Use gh or glab CLI tools as needed. Fallback: Read using http.
28
+
29
+ From the diff and any available PR description, derive in your own words:
30
+ - What problem does this change solve? What does the user intend to achieve?
31
+ - What is the mechanism used to solve it?
32
+
33
+ Present your derived intent to the user and wait for explicit confirmation before proceeding.
34
+ If your derived intent contradicts the PR description or what the user responds to you, flag that explicitly — it is itself a finding.
35
+
36
+ Respond in the user's language.
37
+
38
+ transitions:
39
+ - trigger: 'intent_confirmed'
40
+ to: 'orient'
41
+ transition_reason: 'Intent confirmed by user, ready to map the change'
42
+
43
+ orient:
44
+ description: 'Build a structural map of the change before any judgment'
45
+ default_instructions: |
46
+ Map the change without evaluating it yet:
47
+ - Which files changed, and what kind of change is each (new logic, refactor, configuration, tests, fixtures)?
48
+ - What are the entry points of the data or control flow affected by this change?
49
+ - Which existing boundaries or components does the change touch?
50
+
51
+ Document this map. It will be the reference for all subsequent review phases.
52
+
53
+ transitions:
54
+ - trigger: 'oriented'
55
+ to: 'review_architecture'
56
+ transition_reason: 'Structural map complete, ready to review architecture'
57
+
58
+ review_architecture:
59
+ description: 'Review whether the change is in the right place and respects existing structure'
60
+ default_instructions: |
61
+ Evaluate the structural decisions in the change against the confirmed intent:
62
+
63
+ - Is the change located in the right place, or does it belong elsewhere?
64
+ - Does it respect the existing boundaries and separation of responsibilities?
65
+ - Does it introduce the right abstraction, or does it over- or under-abstract?
66
+ - Does it follow the patterns already established in the codebase?
67
+ - If an architecture document exists ($ARCHITECTURE_DOC), verify the change is consistent with it.
68
+
69
+ For each finding, classify it immediately:
70
+ - **Bug**: incorrect behavior or data loss
71
+ - **Design issue**: correct but wrong structure, will cause pain later
72
+ - **Performance**: correct but unnecessarily costly at the expected scale
73
+ - **Minor**: small violations, naming, unnecessary indirection
74
+ - **Nit**: style, redundant comments, cosmetics
75
+
76
+ Bugs and design issues are major flaws. If major flaws are found, proceed to publish_review immediately.
77
+
78
+ transitions:
79
+ - trigger: 'no_major_flaws'
80
+ to: 'review_correctness'
81
+ transition_reason: 'No major architectural flaws, proceeding to correctness review'
82
+
83
+ - trigger: 'major_flaws_found'
84
+ to: 'publish_review'
85
+ additional_instructions: |
86
+ Major architectural flaws were found. Do not proceed to correctness or quality review —
87
+ reviewing correctness on a structurally wrong solution is wasted effort.
88
+
89
+ Communicate clearly to the user:
90
+ - Which findings are blockers and why
91
+ - What rework is expected before the review can continue
92
+ transition_reason: 'Major architectural flaws found, stopping for rework before continuing'
93
+
94
+ review_correctness:
95
+ description: 'Review whether the logic correctly achieves the confirmed intent'
96
+ default_instructions: |
97
+ Evaluate the logic of the change against the confirmed intent:
98
+
99
+ - Does the code do what the intent requires, for all inputs and states?
100
+ - Are edge cases handled — boundary conditions, empty inputs, missing data?
101
+ - Are things that must stay consistent changed together? Can partial updates occur?
102
+ - Are error paths handled, or silently swallowed?
103
+ - Do resources that grow over time have a defined cleanup strategy?
104
+ - If a design document or specification exists ($DESIGN_DOC), verify the change is consistent with it.
105
+
106
+ For each finding, classify it immediately (same scale as review_architecture).
107
+
108
+ Bugs and design issues are major flaws. If major flaws are found, proceed to publish_review immediately.
109
+
110
+ transitions:
111
+ - trigger: 'no_major_flaws'
112
+ to: 'review_quality'
113
+ transition_reason: 'No major correctness flaws, proceeding to quality review'
114
+
115
+ - trigger: 'major_flaws_found'
116
+ to: 'publish_review'
117
+ additional_instructions: |
118
+ Major correctness flaws were found. Do not proceed to quality review —
119
+ polishing incorrect code is wasted effort.
120
+
121
+ Communicate clearly to the user:
122
+ - Which findings are blockers and why
123
+ - What rework is expected before the review can continue
124
+ Proceed to publish_review to deliver these findings.
125
+ transition_reason: 'Major correctness flaws found, stopping for rework before continuing'
126
+
127
+ review_quality:
128
+ description: 'Review code quality, completeness, and good practices'
129
+ default_instructions: |
130
+ Evaluate the quality of the change:
131
+
132
+ - Is the code DRY, or is logic duplicated that should be shared?
133
+ - Does the code do unnecessary work — reimplementing what the platform already provides,
134
+ or repeating expensive operations that could be done once?
135
+ - Is naming self-explanatory at the right level of abstraction?
136
+ - Do comments explain *why*, not *what*? Are there comments that merely restate the code?
137
+ - Is what's absent a problem: missing tests, missing error handling, missing observability?
138
+ - Are there conventions in the codebase that this change violates?
139
+
140
+ For each finding, classify it immediately (same scale as previous phases).
141
+
142
+ transitions:
143
+ - trigger: 'quality_reviewed'
144
+ to: 'summarize'
145
+ transition_reason: 'Quality review complete, ready to summarize'
146
+
147
+ summarize:
148
+ description: 'Compose a concise overall summary of the review'
149
+ default_instructions: |
150
+ Write a top-level review summary:
151
+ - Restate the confirmed intent in one sentence
152
+ - List blocking findings (bugs, design issues) if any remain
153
+ - List non-blocking suggestions briefly — the inline comments carry the detail
154
+ - State your overall recommendation: approve / request changes / comment
155
+
156
+ Keep it short. The inline comments are the substance; this is the orientation.
157
+
158
+ transitions:
159
+ - trigger: 'summary_ready'
160
+ to: 'publish_review'
161
+ transition_reason: 'Summary ready, proceed to publish'
162
+
163
+ publish_review:
164
+ description: 'Ask the user how to deliver the review findings'
165
+ default_instructions: |
166
+ Ask the user how they want the review delivered:
167
+ - Post inline comments directly to the PR/MR via VCS tooling (e.g. glab, gh)?
168
+ - Present findings as a structured summary in the chat?
169
+ - Both?
170
+
171
+ Once confirmed, deliver accordingly. For inline comments, attach each finding to the
172
+ specific file and line it refers to. For cross-cutting findings, use a top-level comment.
173
+
174
+ transitions:
175
+ - trigger: 'review_published'
176
+ to: 'determine_intent'
177
+ transition_reason: 'Review delivered, ready for next PR'
@@ -9,7 +9,7 @@
9
9
  <link rel="preload stylesheet" href="/workflows/assets/style.DfNfC54K.css" as="style">
10
10
  <link rel="preload stylesheet" href="/workflows/vp-icons.css" as="style">
11
11
 
12
- <script type="module" src="/workflows/assets/app.DCKDzGKW.js"></script>
12
+ <script type="module" src="/workflows/assets/app.CAEWYLPb.js"></script>
13
13
  <link rel="preload" href="/workflows/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
14
14
  <link rel="icon" href="/workflows/favicon.ico">
15
15
  <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
@@ -17,7 +17,7 @@
17
17
  </head>
18
18
  <body>
19
19
  <div id="app"></div>
20
- <script>window.__VP_HASH_MAP__=JSON.parse("{\"dev_architecture.md\":\"CvNKCNdN\",\"dev_development.md\":\"D_3UnLYh\",\"dev_logging.md\":\"ChgMzoxk\",\"dev_publishing.md\":\"9HHCKtL4\",\"index.md\":\"BqtGZhQl\",\"user_advanced-engineering.md\":\"DSy0uwWe\",\"user_agent-setup.md\":\"Cgzr8dYa\",\"user_beads-integration.md\":\"CB1VJJCp\",\"user_crowd-mcp-integration.md\":\"DPSO9u7p\",\"user_custom-workflows.md\":\"CtvQt5R0\",\"user_git-commit-feature.md\":\"IwIx6MMR\",\"user_how-it-works.md\":\"08ZFhWmJ\",\"user_long-term-memory.md\":\"Tss4q2DM\",\"user_packaged-workflows.md\":\"D8DLEuhH\",\"user_tutorial.md\":\"BTP4OqKB\",\"user_workflow-selection.md\":\"G8vSc8iy\",\"workflows.md\":\"B6jknRdS\",\"workflows_adr.md\":\"DQ73iGUh\",\"workflows_big-bang-conversion.md\":\"BgV6R1KI\",\"workflows_boundary-testing.md\":\"RwhcIDcf\",\"workflows_bugfix.md\":\"sZNWPjvx\",\"workflows_business-analysis.md\":\"C3FBbsiu\",\"workflows_c4-analysis.md\":\"MVyWuWSL\",\"workflows_epcc.md\":\"1mWsuIIR\",\"workflows_game-beginner.md\":\"J4UOyAAT\",\"workflows_greenfield.md\":\"DzJ6V7lb\",\"workflows_minor.md\":\"dYZlfSHT\",\"workflows_posts.md\":\"BrkDZjGs\",\"workflows_sdd-bugfix-crowd.md\":\"BQH-LJXS\",\"workflows_sdd-bugfix.md\":\"CoPY5TS6\",\"workflows_sdd-feature-crowd.md\":\"CCj9xqan\",\"workflows_sdd-feature.md\":\"Dy8SNaX8\",\"workflows_sdd-greenfield-crowd.md\":\"_lPEQnGj\",\"workflows_sdd-greenfield.md\":\"KStU-OJS\",\"workflows_skilled-bugfix.md\":\"CvCekIa2\",\"workflows_skilled-epcc.md\":\"D7Kg_U7p\",\"workflows_skilled-greenfield.md\":\"C_R8GafG\",\"workflows_slides.md\":\"CScRnwcC\",\"workflows_tdd.md\":\"C_hC07yu\",\"workflows_waterfall.md\":\"nMkWHPRt\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Responsible Vibe MCP\",\"description\":\"Model Context Protocol server for intelligent conversation state management and development guidance\",\"base\":\"/workflows/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"nav\":[{\"text\":\"Documentation\",\"link\":\"/\"},{\"text\":\"Workflows\",\"link\":\"/workflows\"},{\"text\":\"Github\",\"link\":\"https://github.com/codemcp/workflows\"}],\"sidebar\":[{\"text\":\"User Guide\",\"items\":[{\"text\":\"Overview\",\"link\":\"/\"},{\"text\":\"How It Works\",\"link\":\"/user/how-it-works\"},{\"text\":\"Agent Setup\",\"link\":\"/user/agent-setup\"},{\"text\":\"Vibe Engineering\",\"link\":\"/user/advanced-engineering\"},{\"text\":\"Long-Term Memory\",\"link\":\"/user/long-term-memory\"},{\"text\":\"Beads-Integration\",\"link\":\"/user/beads-integration\"},{\"text\":\"Tutorial\",\"link\":\"/user/tutorial\"}]},{\"text\":\"Workflows\",\"items\":[{\"text\":\"Workflow-Selection\",\"link\":\"/user/workflow-selection\"},{\"text\":\"Packaged Workflows\",\"link\":\"/user/packaged-workflows\"},{\"text\":\"Custom Workflows\",\"link\":\"/user/custom-workflows\"},{\"text\":\"Explore All Workflows\",\"link\":\"/workflows\"},{\"text\":\"Crowd MCP Integration\",\"link\":\"/user/crowd-mcp-integration\"}]}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
20
+ <script>window.__VP_HASH_MAP__=JSON.parse("{\"dev_architecture.md\":\"CvNKCNdN\",\"dev_development.md\":\"D_3UnLYh\",\"dev_logging.md\":\"ChgMzoxk\",\"dev_publishing.md\":\"9HHCKtL4\",\"index.md\":\"BqtGZhQl\",\"user_advanced-engineering.md\":\"DSy0uwWe\",\"user_agent-setup.md\":\"Cgzr8dYa\",\"user_beads-integration.md\":\"CB1VJJCp\",\"user_crowd-mcp-integration.md\":\"DPSO9u7p\",\"user_custom-workflows.md\":\"CtvQt5R0\",\"user_git-commit-feature.md\":\"IwIx6MMR\",\"user_how-it-works.md\":\"08ZFhWmJ\",\"user_long-term-memory.md\":\"Tss4q2DM\",\"user_packaged-workflows.md\":\"D8DLEuhH\",\"user_tutorial.md\":\"BTP4OqKB\",\"user_workflow-selection.md\":\"G8vSc8iy\",\"workflows.md\":\"B6jknRdS\",\"workflows_adr.md\":\"DQ73iGUh\",\"workflows_big-bang-conversion.md\":\"BgV6R1KI\",\"workflows_boundary-testing.md\":\"RwhcIDcf\",\"workflows_bugfix.md\":\"sZNWPjvx\",\"workflows_business-analysis.md\":\"C3FBbsiu\",\"workflows_c4-analysis.md\":\"MVyWuWSL\",\"workflows_epcc.md\":\"1mWsuIIR\",\"workflows_game-beginner.md\":\"J4UOyAAT\",\"workflows_greenfield.md\":\"DzJ6V7lb\",\"workflows_minor.md\":\"dYZlfSHT\",\"workflows_posts.md\":\"BrkDZjGs\",\"workflows_pr-review.md\":\"CdYxJ5Yu\",\"workflows_sdd-bugfix-crowd.md\":\"BQH-LJXS\",\"workflows_sdd-bugfix.md\":\"CoPY5TS6\",\"workflows_sdd-feature-crowd.md\":\"CCj9xqan\",\"workflows_sdd-feature.md\":\"Dy8SNaX8\",\"workflows_sdd-greenfield-crowd.md\":\"_lPEQnGj\",\"workflows_sdd-greenfield.md\":\"KStU-OJS\",\"workflows_skilled-bugfix.md\":\"CvCekIa2\",\"workflows_skilled-epcc.md\":\"D7Kg_U7p\",\"workflows_skilled-greenfield.md\":\"C_R8GafG\",\"workflows_slides.md\":\"CScRnwcC\",\"workflows_tdd.md\":\"C_hC07yu\",\"workflows_waterfall.md\":\"nMkWHPRt\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Responsible Vibe MCP\",\"description\":\"Model Context Protocol server for intelligent conversation state management and development guidance\",\"base\":\"/workflows/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"nav\":[{\"text\":\"Documentation\",\"link\":\"/\"},{\"text\":\"Workflows\",\"link\":\"/workflows\"},{\"text\":\"Github\",\"link\":\"https://github.com/codemcp/workflows\"}],\"sidebar\":[{\"text\":\"User Guide\",\"items\":[{\"text\":\"Overview\",\"link\":\"/\"},{\"text\":\"How It Works\",\"link\":\"/user/how-it-works\"},{\"text\":\"Agent Setup\",\"link\":\"/user/agent-setup\"},{\"text\":\"Vibe Engineering\",\"link\":\"/user/advanced-engineering\"},{\"text\":\"Long-Term Memory\",\"link\":\"/user/long-term-memory\"},{\"text\":\"Beads-Integration\",\"link\":\"/user/beads-integration\"},{\"text\":\"Tutorial\",\"link\":\"/user/tutorial\"}]},{\"text\":\"Workflows\",\"items\":[{\"text\":\"Workflow-Selection\",\"link\":\"/user/workflow-selection\"},{\"text\":\"Packaged Workflows\",\"link\":\"/user/packaged-workflows\"},{\"text\":\"Custom Workflows\",\"link\":\"/user/custom-workflows\"},{\"text\":\"Explore All Workflows\",\"link\":\"/workflows\"},{\"text\":\"Crowd MCP Integration\",\"link\":\"/user/crowd-mcp-integration\"}]}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
21
21
 
22
22
  </body>
23
23
  </html>
@@ -1 +1 @@
1
- import{R as p}from"./chunks/theme.D_Ip3oEh.js";import{R as s,a2 as i,a3 as u,a4 as c,a5 as l,a6 as f,a7 as d,a8 as m,a9 as h,aa as g,ab as A,d as v,u as R,v as w,s as y,ac as C,ad as P,ae as b,a1 as E}from"./chunks/framework.FdfEk_gD.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=v({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=R();return w(()=>{y(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),P(),b(),n.setup&&n.setup(),()=>E(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function D(){return A(S)}function _(){let e=s;return h(a=>{let t=g(a),o=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),o=import(t)),s&&(e=!1),o},n.NotFound)}s&&T().then(({app:e,router:a,data:t})=>{a.go().then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp};
1
+ import{R as p}from"./chunks/theme.CshoOl3e.js";import{R as s,a2 as i,a3 as u,a4 as c,a5 as l,a6 as f,a7 as d,a8 as m,a9 as h,aa as g,ab as A,d as v,u as R,v as w,s as y,ac as C,ad as P,ae as b,a1 as E}from"./chunks/framework.FdfEk_gD.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=v({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=R();return w(()=>{y(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),P(),b(),n.setup&&n.setup(),()=>E(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function D(){return A(S)}function _(){let e=s;return h(a=>{let t=g(a),o=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),o=import(t)),s&&(e=!1),o},n.NotFound)}s&&T().then(({app:e,router:a,data:t})=>{a.go().then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp};
@@ -203,4 +203,4 @@ Please report this to https://github.com/markedjs/marked.`,e){let i="<p>An error
203
203
  `).join("")}
204
204
  </div>
205
205
  `:""}
206
- `)}function y(){r.parentState?(r.selectedElement={type:"state",id:r.parentState.id,data:r.parentState.data},r.parentState=null,f()):C()}function C(){if(r.selectedElement=null,r.parentState=null,typeof document>"u")return;const w=document.querySelector(".side-panel-header");w&&(w.innerHTML="<h2>Details</h2>"),f()}return ue(async()=>{try{const w=new fu,k=document.querySelector("#workflow-selector"),I=document.querySelector("#file-upload"),N=gu("#diagram-canvas"),z=document.querySelector(".side-panel-content"),Y=document.querySelector(".side-panel-header"),q=new mu(N);q.setClickHandler((U,te,W)=>{U==="state"?s({elementType:"node",elementId:te,data:W}):U==="transition"?s({elementType:"transition",elementId:te,data:W}):U==="clear-selection"&&c()});const Ve=async U=>{const te=n.workflows.find(ye=>ye.name===U);if(!te)throw new Error(`Workflow '${U}' not found`);const W=await fetch(te.path);if(!W.ok)throw new Error(`Failed to load workflow: ${W.statusText}`);const Z=await W.text();return en(Z)};let J=null;if(I&&(J={setupEventListeners:()=>{I.addEventListener("change",async U=>{const te=U.target,W=te.files;if(!W||W.length===0)return;const Z=W[0];try{const ie=[".yaml",".yml"],ye=Z.name.toLowerCase();if(!ie.some(rt=>ye.endsWith(rt)))throw new Error("Invalid file type. Please select a .yaml or .yml file.");const Ht=1024*1024;if(Z.size>Ht)throw new Error(`File too large. Maximum size is ${Ht/1024/1024}MB.`);if(Z.size===0)throw new Error("File is empty.");const zt=await new Promise((rt,Dt)=>{const it=new FileReader;it.onload=qt=>{var jt;(jt=qt.target)!=null&&jt.result?rt(qt.target.result):Dt(new Error("Failed to read file content"))},it.onerror=()=>Dt(new Error("Error reading file")),it.readAsText(Z)});if(!zt.trim())throw new Error("Uploaded file is empty");N.innerHTML='<div class="loading-message">Loading uploaded workflow...</div>';const nt=en(zt);r.currentWorkflow=nt,r.selectedElement=null,r.highlightedPath=null,await q.renderWorkflow(nt),k&&(k.value=""),f(),console.log(`Successfully loaded uploaded workflow: ${nt.name||"Unnamed"}`)}catch(ie){console.error("Failed to load uploaded workflow:",ie),N.innerHTML=`<div class="loading-message">Failed to load workflow: ${ie.message}</div>`}finally{te.value=""}})}},J.setupEventListeners()),k&&(console.log("Setting up workflow selector, workflows:",n.workflows),o(),k.addEventListener("change",async U=>{const W=U.target.value;if(!W){N.innerHTML='<div class="loading-message">Select a workflow to visualize</div>';return}try{N.innerHTML='<div class="loading-message">Loading workflow...</div>';const Z=await Ve(W);r.currentWorkflow=Z,r.selectedElement=null,r.highlightedPath=null,await q.renderWorkflow(Z),f()}catch(Z){console.error("Failed to load workflow:",Z),N.innerHTML='<div class="loading-message">Failed to load workflow</div>'}})),n.initialWorkflow)try{const U=await Ve(n.initialWorkflow);r.currentWorkflow=U,r.selectedElement=null,r.highlightedPath=null,await q.renderWorkflow(U),k&&(k.value=n.initialWorkflow),f()}catch(U){console.error("Failed to load initial workflow:",U),N.innerHTML='<div class="loading-message">Failed to load workflow</div>'}i={plantUMLRenderer:q,fileUploadHandler:J,errorHandler:w}}catch(w){console.error("Failed to load WorkflowVisualizerApp:",w);const k=document.getElementById("error-container"),I=document.querySelector(".error-text");k&&I&&(I.textContent="Failed to load workflow visualizer",k.classList.remove("hidden"))}}),Ge(()=>{i=null}),(w,k)=>(u(),g("div",{id:"workflow-visualizer-app",class:O({fullscreen:!e.showSidebar})},[e.hideHeader?$("",!0):(u(),g("header",vu,[...k[0]||(k[0]=[sr('<h1>Workflow Visualizer</h1><div class="workflow-controls"><select id="workflow-selector" class="workflow-selector"><option value="">Select a workflow...</option></select><input type="file" id="file-upload" accept=".yaml,.yml" class="file-upload"><label for="file-upload" class="file-upload-label">Upload YAML</label></div>',2)])])),v("main",{class:O(["app-main",{"no-sidebar":!e.showSidebar}])},[v("div",ku,[v("div",bu,[v("div",xu,H(e.initialWorkflow?"Loading workflow...":"Select a workflow to visualize"),1)])]),e.showSidebar?(u(),g("aside",wu,[...k[1]||(k[1]=[v("div",{class:"side-panel-header"},[v("h2",null,"Details")],-1),v("div",{class:"side-panel-content"},[v("div",{class:"empty-state"}," Click on a state or transition to see details ")],-1)])])):$("",!0)],2),k[2]||(k[2]=v("div",{id:"error-container",class:"error-container hidden"},[v("div",{class:"error-message"},[v("span",{class:"error-text"}),v("button",{class:"error-close"},"×")])],-1))],2))}}),an=["adr","big-bang-conversion","boundary-testing","bugfix","business-analysis","c4-analysis","epcc","game-beginner","greenfield","minor","posts","sdd-bugfix-crowd","sdd-bugfix","sdd-feature-crowd","sdd-feature","sdd-greenfield-crowd","sdd-greenfield","skilled-bugfix","skilled-epcc","skilled-greenfield","slides","tdd","waterfall"],_u={key:1,class:"loading-message"},$u=S({__name:"WorkflowVisualizerWithData",props:{showSidebar:{type:Boolean,default:!0},hideHeader:{type:Boolean,default:!1},initialWorkflow:{default:""}},setup(e){const t=B(an.map(n=>({name:n,displayName:n.charAt(0).toUpperCase()+n.slice(1).replace(/-/g," "),path:`/workflows/workflows/${n}.yaml`})));return ue(()=>{console.log("WorkflowVisualizerWithData mounted"),console.log("AVAILABLE_WORKFLOWS:",an),console.log("workflows.value:",t.value),console.log("workflows.value length:",t.value.length),console.log("First workflow:",t.value[0]),window.debugWorkflows=t.value}),(n,i)=>t.value.length>0?(u(),T(h(yu),{key:0,workflows:t.value,"show-sidebar":e.showSidebar,"hide-header":e.hideHeader,"initial-workflow":e.initialWorkflow},null,8,["workflows","show-sidebar","hide-header","initial-workflow"])):(u(),g("div",_u,"Loading workflows..."))}}),Su=P($u,[["__scopeId","data-v-7fa343e6"]]),Pu={extends:Ut,Layout:()=>lr(Ut.Layout,null,{}),enhanceApp({app:e,router:t,siteData:n}){e.component("WorkflowVisualizer",Su)}};export{Pu as R};
206
+ `)}function y(){r.parentState?(r.selectedElement={type:"state",id:r.parentState.id,data:r.parentState.data},r.parentState=null,f()):C()}function C(){if(r.selectedElement=null,r.parentState=null,typeof document>"u")return;const w=document.querySelector(".side-panel-header");w&&(w.innerHTML="<h2>Details</h2>"),f()}return ue(async()=>{try{const w=new fu,k=document.querySelector("#workflow-selector"),I=document.querySelector("#file-upload"),N=gu("#diagram-canvas"),z=document.querySelector(".side-panel-content"),Y=document.querySelector(".side-panel-header"),q=new mu(N);q.setClickHandler((U,te,W)=>{U==="state"?s({elementType:"node",elementId:te,data:W}):U==="transition"?s({elementType:"transition",elementId:te,data:W}):U==="clear-selection"&&c()});const Ve=async U=>{const te=n.workflows.find(ye=>ye.name===U);if(!te)throw new Error(`Workflow '${U}' not found`);const W=await fetch(te.path);if(!W.ok)throw new Error(`Failed to load workflow: ${W.statusText}`);const Z=await W.text();return en(Z)};let J=null;if(I&&(J={setupEventListeners:()=>{I.addEventListener("change",async U=>{const te=U.target,W=te.files;if(!W||W.length===0)return;const Z=W[0];try{const ie=[".yaml",".yml"],ye=Z.name.toLowerCase();if(!ie.some(rt=>ye.endsWith(rt)))throw new Error("Invalid file type. Please select a .yaml or .yml file.");const Ht=1024*1024;if(Z.size>Ht)throw new Error(`File too large. Maximum size is ${Ht/1024/1024}MB.`);if(Z.size===0)throw new Error("File is empty.");const zt=await new Promise((rt,Dt)=>{const it=new FileReader;it.onload=qt=>{var jt;(jt=qt.target)!=null&&jt.result?rt(qt.target.result):Dt(new Error("Failed to read file content"))},it.onerror=()=>Dt(new Error("Error reading file")),it.readAsText(Z)});if(!zt.trim())throw new Error("Uploaded file is empty");N.innerHTML='<div class="loading-message">Loading uploaded workflow...</div>';const nt=en(zt);r.currentWorkflow=nt,r.selectedElement=null,r.highlightedPath=null,await q.renderWorkflow(nt),k&&(k.value=""),f(),console.log(`Successfully loaded uploaded workflow: ${nt.name||"Unnamed"}`)}catch(ie){console.error("Failed to load uploaded workflow:",ie),N.innerHTML=`<div class="loading-message">Failed to load workflow: ${ie.message}</div>`}finally{te.value=""}})}},J.setupEventListeners()),k&&(console.log("Setting up workflow selector, workflows:",n.workflows),o(),k.addEventListener("change",async U=>{const W=U.target.value;if(!W){N.innerHTML='<div class="loading-message">Select a workflow to visualize</div>';return}try{N.innerHTML='<div class="loading-message">Loading workflow...</div>';const Z=await Ve(W);r.currentWorkflow=Z,r.selectedElement=null,r.highlightedPath=null,await q.renderWorkflow(Z),f()}catch(Z){console.error("Failed to load workflow:",Z),N.innerHTML='<div class="loading-message">Failed to load workflow</div>'}})),n.initialWorkflow)try{const U=await Ve(n.initialWorkflow);r.currentWorkflow=U,r.selectedElement=null,r.highlightedPath=null,await q.renderWorkflow(U),k&&(k.value=n.initialWorkflow),f()}catch(U){console.error("Failed to load initial workflow:",U),N.innerHTML='<div class="loading-message">Failed to load workflow</div>'}i={plantUMLRenderer:q,fileUploadHandler:J,errorHandler:w}}catch(w){console.error("Failed to load WorkflowVisualizerApp:",w);const k=document.getElementById("error-container"),I=document.querySelector(".error-text");k&&I&&(I.textContent="Failed to load workflow visualizer",k.classList.remove("hidden"))}}),Ge(()=>{i=null}),(w,k)=>(u(),g("div",{id:"workflow-visualizer-app",class:O({fullscreen:!e.showSidebar})},[e.hideHeader?$("",!0):(u(),g("header",vu,[...k[0]||(k[0]=[sr('<h1>Workflow Visualizer</h1><div class="workflow-controls"><select id="workflow-selector" class="workflow-selector"><option value="">Select a workflow...</option></select><input type="file" id="file-upload" accept=".yaml,.yml" class="file-upload"><label for="file-upload" class="file-upload-label">Upload YAML</label></div>',2)])])),v("main",{class:O(["app-main",{"no-sidebar":!e.showSidebar}])},[v("div",ku,[v("div",bu,[v("div",xu,H(e.initialWorkflow?"Loading workflow...":"Select a workflow to visualize"),1)])]),e.showSidebar?(u(),g("aside",wu,[...k[1]||(k[1]=[v("div",{class:"side-panel-header"},[v("h2",null,"Details")],-1),v("div",{class:"side-panel-content"},[v("div",{class:"empty-state"}," Click on a state or transition to see details ")],-1)])])):$("",!0)],2),k[2]||(k[2]=v("div",{id:"error-container",class:"error-container hidden"},[v("div",{class:"error-message"},[v("span",{class:"error-text"}),v("button",{class:"error-close"},"×")])],-1))],2))}}),an=["adr","big-bang-conversion","boundary-testing","bugfix","business-analysis","c4-analysis","epcc","game-beginner","greenfield","minor","posts","pr-review","sdd-bugfix-crowd","sdd-bugfix","sdd-feature-crowd","sdd-feature","sdd-greenfield-crowd","sdd-greenfield","skilled-bugfix","skilled-epcc","skilled-greenfield","slides","tdd","waterfall"],_u={key:1,class:"loading-message"},$u=S({__name:"WorkflowVisualizerWithData",props:{showSidebar:{type:Boolean,default:!0},hideHeader:{type:Boolean,default:!1},initialWorkflow:{default:""}},setup(e){const t=B(an.map(n=>({name:n,displayName:n.charAt(0).toUpperCase()+n.slice(1).replace(/-/g," "),path:`/workflows/workflows/${n}.yaml`})));return ue(()=>{console.log("WorkflowVisualizerWithData mounted"),console.log("AVAILABLE_WORKFLOWS:",an),console.log("workflows.value:",t.value),console.log("workflows.value length:",t.value.length),console.log("First workflow:",t.value[0]),window.debugWorkflows=t.value}),(n,i)=>t.value.length>0?(u(),T(h(yu),{key:0,workflows:t.value,"show-sidebar":e.showSidebar,"hide-header":e.hideHeader,"initial-workflow":e.initialWorkflow},null,8,["workflows","show-sidebar","hide-header","initial-workflow"])):(u(),g("div",_u,"Loading workflows..."))}}),Su=P($u,[["__scopeId","data-v-7fa343e6"]]),Pu={extends:Ut,Layout:()=>lr(Ut.Layout,null,{}),enhanceApp({app:e,router:t,siteData:n}){e.component("WorkflowVisualizer",Su)}};export{Pu as R};
@@ -0,0 +1 @@
1
+ import{u as r,C as a,c as t,o as s,G as l,k as i}from"./chunks/framework.FdfEk_gD.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":false},"headers":[],"params":{"workflow":"pr-review"},"relativePath":"workflows/pr-review.md","filePath":"workflows/[workflow].md"}'),n={name:"workflows/pr-review.md"},_=Object.assign(n,{setup(w){const{params:e}=r();return(f,c)=>{const o=a("WorkflowVisualizer");return s(),t("div",null,[l(o,{showSidebar:!0,hideHeader:!0,initialWorkflow:i(e).workflow},null,8,["initialWorkflow"])])}}});export{u as __pageData,_ as default};
@@ -0,0 +1 @@
1
+ import{u as r,C as a,c as t,o as s,G as l,k as i}from"./chunks/framework.FdfEk_gD.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{"layout":false},"headers":[],"params":{"workflow":"pr-review"},"relativePath":"workflows/pr-review.md","filePath":"workflows/[workflow].md"}'),n={name:"workflows/pr-review.md"},_=Object.assign(n,{setup(w){const{params:e}=r();return(f,c)=>{const o=a("WorkflowVisualizer");return s(),t("div",null,[l(o,{showSidebar:!0,hideHeader:!0,initialWorkflow:i(e).workflow},null,8,["initialWorkflow"])])}}});export{u as __pageData,_ as default};