@exaudeus/workrail 3.67.0 → 3.68.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 (140) hide show
  1. package/dist/application/services/compiler/template-registry.js +10 -1
  2. package/dist/cli/commands/worktrain-init.js +1 -1
  3. package/dist/console-ui/assets/{index-tOl8Vowf.js → index-CyzltI6D.js} +1 -1
  4. package/dist/console-ui/index.html +1 -1
  5. package/dist/coordinators/modes/full-pipeline.js +4 -4
  6. package/dist/coordinators/modes/implement-shared.js +5 -5
  7. package/dist/coordinators/modes/implement.js +4 -4
  8. package/dist/coordinators/pr-review.js +4 -4
  9. package/dist/daemon/workflow-runner.d.ts +1 -0
  10. package/dist/daemon/workflow-runner.js +1 -0
  11. package/dist/manifest.json +25 -25
  12. package/dist/mcp/handlers/v2-workflow.js +1 -1
  13. package/dist/mcp/workflow-protocol-contracts.js +2 -2
  14. package/docs/authoring-v2.md +4 -4
  15. package/docs/changelog-recent.md +3 -3
  16. package/docs/configuration.md +1 -1
  17. package/docs/design/adaptive-coordinator-context-candidates.md +1 -1
  18. package/docs/design/adaptive-coordinator-context.md +1 -1
  19. package/docs/design/adaptive-coordinator-routing-candidates.md +18 -18
  20. package/docs/design/adaptive-coordinator-routing-review.md +1 -1
  21. package/docs/design/adaptive-coordinator-routing.md +34 -34
  22. package/docs/design/agent-cascade-protocol.md +2 -2
  23. package/docs/design/console-daemon-separation-discovery.md +323 -0
  24. package/docs/design/context-assembly-design-candidates.md +1 -1
  25. package/docs/design/context-assembly-implementation-plan.md +1 -1
  26. package/docs/design/context-assembly-layer.md +2 -2
  27. package/docs/design/context-assembly-review-findings.md +1 -1
  28. package/docs/design/coordinator-access-audit.md +293 -0
  29. package/docs/design/coordinator-architecture-audit.md +62 -0
  30. package/docs/design/coordinator-error-handling-audit.md +240 -0
  31. package/docs/design/coordinator-testability-audit.md +426 -0
  32. package/docs/design/daemon-architecture-discovery.md +1 -1
  33. package/docs/design/daemon-console-separation-discovery.md +242 -0
  34. package/docs/design/daemon-memory-audit.md +203 -0
  35. package/docs/design/design-candidates-console-daemon-separation.md +256 -0
  36. package/docs/design/design-candidates-discovery-loop-fix.md +141 -0
  37. package/docs/design/design-review-findings-console-daemon-separation.md +106 -0
  38. package/docs/design/design-review-findings-discovery-loop-fix.md +81 -0
  39. package/docs/design/discovery-loop-fix-candidates.md +161 -0
  40. package/docs/design/discovery-loop-fix-design-review.md +106 -0
  41. package/docs/design/discovery-loop-fix-validation.md +258 -0
  42. package/docs/design/discovery-loop-investigation-A.md +188 -0
  43. package/docs/design/discovery-loop-investigation-B.md +287 -0
  44. package/docs/design/exploration-workflow-candidates.md +205 -0
  45. package/docs/design/exploration-workflow-design-review.md +166 -0
  46. package/docs/design/exploration-workflow-discovery.md +443 -0
  47. package/docs/design/ide-context-files-candidates.md +231 -0
  48. package/docs/design/ide-context-files-design-review.md +85 -0
  49. package/docs/design/ide-context-files.md +615 -0
  50. package/docs/design/implementation-plan-discovery-loop-fix.md +199 -0
  51. package/docs/design/implementation-plan-queue-poll-rotation.md +102 -0
  52. package/docs/design/in-process-http-audit.md +190 -0
  53. package/docs/design/layer3b-ghost-nodes-design-candidates.md +2 -2
  54. package/docs/design/loadSessionNotes-candidates.md +108 -0
  55. package/docs/design/loadSessionNotes-test-coverage-discovery.md +297 -0
  56. package/docs/design/loadSessionNotes-test-coverage-session4.md +209 -0
  57. package/docs/design/loadSessionNotes-test-coverage-v3.md +321 -0
  58. package/docs/design/probe-session-design-candidates.md +261 -0
  59. package/docs/design/probe-session-phase0.md +490 -0
  60. package/docs/design/routines-guide.md +7 -7
  61. package/docs/design/session-metrics-attribution-candidates.md +250 -0
  62. package/docs/design/session-metrics-attribution-design-review.md +115 -0
  63. package/docs/design/session-metrics-attribution-discovery.md +319 -0
  64. package/docs/design/session-metrics-candidates.md +227 -0
  65. package/docs/design/session-metrics-design-review.md +104 -0
  66. package/docs/design/session-metrics-discovery.md +454 -0
  67. package/docs/design/spawn-session-debug.md +202 -0
  68. package/docs/design/trigger-validator-candidates.md +214 -0
  69. package/docs/design/trigger-validator-review.md +109 -0
  70. package/docs/design/trigger-validator-shaping-phase0.md +239 -0
  71. package/docs/design/trigger-validator.md +454 -0
  72. package/docs/design/v2-core-design-locks.md +2 -2
  73. package/docs/design/workflow-extension-points.md +15 -15
  74. package/docs/design/workflow-id-validation-at-startup.md +1 -1
  75. package/docs/design/workflow-id-validation-implementation-plan.md +2 -2
  76. package/docs/design/workflow-trigger-lifecycle-audit.md +175 -0
  77. package/docs/design/worktrain-task-queue-candidates.md +5 -5
  78. package/docs/design/worktrain-task-queue.md +4 -4
  79. package/docs/discovery/coordinator-script-design.md +1 -1
  80. package/docs/discovery/coordinator-ux-discovery.md +3 -3
  81. package/docs/discovery/simulation-report.md +1 -1
  82. package/docs/discovery/workflow-modernization-discovery.md +326 -0
  83. package/docs/discovery/workflow-selection-for-discovery-tasks.md +33 -33
  84. package/docs/discovery/worktrain-status-briefing.md +1 -1
  85. package/docs/discovery/wr-discovery-goal-reframing.md +1 -1
  86. package/docs/docker.md +1 -1
  87. package/docs/ideas/backlog.md +227 -0
  88. package/docs/ideas/third-party-workflow-setup-design-thinking.md +1 -1
  89. package/docs/integrations/claude-code.md +5 -5
  90. package/docs/integrations/firebender.md +1 -1
  91. package/docs/plans/agentic-orchestration-roadmap.md +2 -2
  92. package/docs/plans/mr-review-workflow-redesign.md +9 -9
  93. package/docs/plans/ui-ux-workflow-design-candidates.md +4 -4
  94. package/docs/plans/ui-ux-workflow-discovery.md +2 -2
  95. package/docs/plans/workflow-categories-candidates.md +8 -8
  96. package/docs/plans/workflow-categories-discovery.md +4 -4
  97. package/docs/plans/workflow-modernization-design.md +430 -0
  98. package/docs/plans/workflow-staleness-detection-candidates.md +11 -11
  99. package/docs/plans/workflow-staleness-detection-review.md +4 -4
  100. package/docs/plans/workflow-staleness-detection.md +9 -9
  101. package/docs/plans/workrail-platform-vision.md +3 -3
  102. package/docs/reference/agent-context-cleaner-snippet.md +1 -1
  103. package/docs/reference/agent-context-guidance.md +4 -4
  104. package/docs/reference/context-optimization.md +2 -2
  105. package/docs/roadmap/now-next-later.md +2 -2
  106. package/docs/roadmap/open-work-inventory.md +16 -16
  107. package/docs/workflows.md +31 -31
  108. package/package.json +1 -1
  109. package/spec/workflow-tags.json +47 -47
  110. package/workflows/adaptive-ticket-creation.json +16 -16
  111. package/workflows/architecture-scalability-audit.json +22 -22
  112. package/workflows/bug-investigation.agentic.v2.json +3 -3
  113. package/workflows/classify-task-workflow.json +1 -1
  114. package/workflows/coding-task-workflow-agentic.json +6 -6
  115. package/workflows/cross-platform-code-conversion.v2.json +8 -8
  116. package/workflows/document-creation-workflow.json +8 -8
  117. package/workflows/documentation-update-workflow.json +8 -8
  118. package/workflows/intelligent-test-case-generation.json +2 -2
  119. package/workflows/learner-centered-course-workflow.json +2 -2
  120. package/workflows/mr-review-workflow.agentic.v2.json +4 -4
  121. package/workflows/personal-learning-materials-creation-branched.json +8 -8
  122. package/workflows/presentation-creation.json +5 -5
  123. package/workflows/production-readiness-audit.json +1 -1
  124. package/workflows/relocation-workflow-us.json +31 -31
  125. package/workflows/routines/context-gathering.json +1 -1
  126. package/workflows/routines/design-review.json +1 -1
  127. package/workflows/routines/execution-simulation.json +1 -1
  128. package/workflows/routines/feature-implementation.json +3 -3
  129. package/workflows/routines/final-verification.json +1 -1
  130. package/workflows/routines/hypothesis-challenge.json +1 -1
  131. package/workflows/routines/ideation.json +1 -1
  132. package/workflows/routines/parallel-work-partitioning.json +3 -3
  133. package/workflows/routines/philosophy-alignment.json +2 -2
  134. package/workflows/routines/plan-analysis.json +1 -1
  135. package/workflows/routines/plan-generation.json +1 -1
  136. package/workflows/routines/tension-driven-design.json +6 -6
  137. package/workflows/scoped-documentation-workflow.json +26 -26
  138. package/workflows/ui-ux-design-workflow.json +14 -14
  139. package/workflows/workflow-diagnose-environment.json +1 -1
  140. package/workflows/workflow-for-workflows.json +1 -1
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "relocation-workflow-us",
2
+ "id": "wr.relocation-us",
3
3
  "name": "US Relocation Decision Workflow",
4
4
  "version": "1.0.0",
5
5
  "metricsProfile": "none",
@@ -28,14 +28,14 @@
28
28
  ],
29
29
  "metaGuidance": [
30
30
  "DEFAULT BEHAVIOR: self-execute with tools. Ask the user only for true preferences, real confirmations, and any external context you cannot find yourself.",
31
- "V2 DURABILITY: use output.notesMarkdown and explicit context variables as the durable record. RELOCATION_DOSSIER.md and profile docs are human-facing artifacts they are NOT required workflow memory and are never read back for routing.",
31
+ "V2 DURABILITY: use output.notesMarkdown and explicit context variables as the durable record. RELOCATION_DOSSIER.md and profile docs are human-facing artifacts \u2014 they are NOT required workflow memory and are never read back for routing.",
32
32
  "ANTI-ANCHORING: generate a broad pool first; screen second; deep-dive only the shortlist. Do not deep-dive a single favorite area early.",
33
33
  "AREA BOUNDARIES: every candidate must have an AreaSpec before entering the pool. Use areaId = <candidateType>-<slug(displayName)>-<sortedStateCodes> (e.g. metro-raleigh-durham-nc). Never switch a candidate's boundary mid-run without logging it.",
34
34
  "CLAIMS LEDGER: every key claim about a location must include source (URL or citation), retrievedAt (date), and confidenceGrade (High/Medium/Low). If a claim cannot be sourced, grade it Low.",
35
35
  "MISSING DATA: when a data point is unavailable, record it as Unknown and apply the chosen missingDataPolicy consistently. Never silently assume a value for an Unknown.",
36
36
  "ARTIFACTS: try to write files (RELOCATION_DOSSIER.md, relocation-profiles/<slug>.md). If file writing is unavailable, paste full canonical content in chat and treat that as the record.",
37
37
  "MODULES: activate only sections relevant to activeModules. Do not include placeholder sections for inactive modules.",
38
- "SCREENING CAPS: first-pass screening must stay fast dealbreakers plus top weighted criteria only, strict claim and time caps. Deep research belongs in Phase 6 deep dives.",
38
+ "SCREENING CAPS: first-pass screening must stay fast \u2014 dealbreakers plus top weighted criteria only, strict claim and time caps. Deep research belongs in Phase 6 deep dives.",
39
39
  "NON-OBVIOUS CANDIDATES: non-obvious = not in userTopOfMind AND not in top-100 US metros. If you cannot map a candidate to the top-100 list deterministically, mark obviousness Unknown and do not count it toward non-obvious requirements."
40
40
  ],
41
41
  "steps": [
@@ -45,18 +45,18 @@
45
45
  "promptBlocks": {
46
46
  "goal": "Establish the scope and structure for this relocation search, then discover calibrated preferences and a stable weight model before any research begins.",
47
47
  "constraints": [
48
- "Do not start researching candidates yet preferences and boundary rules must be locked first.",
48
+ "Do not start researching candidates yet \u2014 preferences and boundary rules must be locked first.",
49
49
  "Activate only modules the user actually needs; do not load everything by default.",
50
50
  "If the user is unsure about weights, offer the MaxDiff helper before finalizing."
51
51
  ],
52
52
  "procedure": [
53
- "Step 1 Confirm scope and initialize artifacts. Confirm this is a US-only v1 relocation search. Ask for userTopOfMind (0-10 areas the user already has in mind; empty is fine). Initialize RELOCATION_DOSSIER.md with sections: User Context & Modules, Boundary & Definitions, Preferences (Draft), Constraints & Dealbreakers, Missing Data Policy, Sources Strategy, Candidate Pool, Screened Candidates, Screening Claims Ledger, Baseline Flags (Not Scored), Red Flag Gate Decisions (append-only), Shortlist, Profiles Index, Comparison & Ranking, Decision Log (append-only). Create the relocation-profiles/ directory.",
54
- "Step 2 Capture user context. Ask about and record: timelineToMove (0-3 months / 3-12 months / 12+ months), householdProfile (single / couple / family with kids / multi-generational), housingPlan (rent/buy/either and budget range), workConstraints (remote/hybrid/onsite; time zones allowed), geoExclusions (states or regions to exclude).",
55
- "Step 3 Select modules. Present the module list and activate all that apply: kids/schools, commute, transit, climate-risk, healthcare-access, career-job-market, outdoors, nightlife-arts, safety, taxes, diversity-community, disability-accessibility, amenities-errands, air-quality, noise, internet-infra. Record as activeModules.",
56
- "Step 4 Lock boundary rules. Set candidateType (default: metro; options: city, county, custom). Record the AreaSpec model: areaId = <candidateType>-<slug(displayName)>-<sortedStateCodes>. For metro candidates, record the definition source and treat the full metro area as the boundary (not just the city). For custom areas (v1), use radius mode: center (place + stateCode) + radiusMiles. Update RELOCATION_DOSSIER.md Boundary & Definitions section.",
57
- "Step 5 Elicit preferences. Ask about: hard constraints (must-have geography, climate, budget, job, family, health), anti-goals (explicit non-goals), dealbreakers. Draft 6-10 weighted criteria across active modules; weights must sum to 100. If the user is unsure, start with equal-weight draft and offer MaxDiff.",
58
- "Step 6 Optional MaxDiff weight derivation. Ask: 'Do you want help deriving weights using Most/Least comparisons?' If yes: build deterministic rotation sets (N<=7: 3 sets of 4; N>=8: 4 sets of 5). For each set ask which criterion is MOST important and which is LEAST. Derive weights: raw[c] = mostCount[c] - leastCount[c]; shifted[c] = raw[c] - min(raw) + 1; weight[c] = round(shifted[c] / sum(shifted) * 100); adjust largest weight so sum = exactly 100. Allow one small tweak pass (up to 2 weights adjusted, then re-normalize).",
59
- "Step 7 Calibration deck. Generate 8-12 diverse US location archetypes (dense transit metro, college town, mountain small city, coastal mid-size, sunbelt suburb, rust-belt revival city, DC-adjacent, etc.). For each: 2-3 sentences on lifestyle and tradeoffs, who it fits, who it frustrates. Ask the user to rank top 3 and bottom 3 and name 1-2 surprises. Update weights and constraints if calibration reveals new signal. Record derivedSignals (densityLeaning, climateLeaning, regionLeaning).",
53
+ "Step 1 \u2014 Confirm scope and initialize artifacts. Confirm this is a US-only v1 relocation search. Ask for userTopOfMind (0-10 areas the user already has in mind; empty is fine). Initialize RELOCATION_DOSSIER.md with sections: User Context & Modules, Boundary & Definitions, Preferences (Draft), Constraints & Dealbreakers, Missing Data Policy, Sources Strategy, Candidate Pool, Screened Candidates, Screening Claims Ledger, Baseline Flags (Not Scored), Red Flag Gate Decisions (append-only), Shortlist, Profiles Index, Comparison & Ranking, Decision Log (append-only). Create the relocation-profiles/ directory.",
54
+ "Step 2 \u2014 Capture user context. Ask about and record: timelineToMove (0-3 months / 3-12 months / 12+ months), householdProfile (single / couple / family with kids / multi-generational), housingPlan (rent/buy/either and budget range), workConstraints (remote/hybrid/onsite; time zones allowed), geoExclusions (states or regions to exclude).",
55
+ "Step 3 \u2014 Select modules. Present the module list and activate all that apply: kids/schools, commute, transit, climate-risk, healthcare-access, career-job-market, outdoors, nightlife-arts, safety, taxes, diversity-community, disability-accessibility, amenities-errands, air-quality, noise, internet-infra. Record as activeModules.",
56
+ "Step 4 \u2014 Lock boundary rules. Set candidateType (default: metro; options: city, county, custom). Record the AreaSpec model: areaId = <candidateType>-<slug(displayName)>-<sortedStateCodes>. For metro candidates, record the definition source and treat the full metro area as the boundary (not just the city). For custom areas (v1), use radius mode: center (place + stateCode) + radiusMiles. Update RELOCATION_DOSSIER.md Boundary & Definitions section.",
57
+ "Step 5 \u2014 Elicit preferences. Ask about: hard constraints (must-have geography, climate, budget, job, family, health), anti-goals (explicit non-goals), dealbreakers. Draft 6-10 weighted criteria across active modules; weights must sum to 100. If the user is unsure, start with equal-weight draft and offer MaxDiff.",
58
+ "Step 6 \u2014 Optional MaxDiff weight derivation. Ask: 'Do you want help deriving weights using Most/Least comparisons?' If yes: build deterministic rotation sets (N<=7: 3 sets of 4; N>=8: 4 sets of 5). For each set ask which criterion is MOST important and which is LEAST. Derive weights: raw[c] = mostCount[c] - leastCount[c]; shifted[c] = raw[c] - min(raw) + 1; weight[c] = round(shifted[c] / sum(shifted) * 100); adjust largest weight so sum = exactly 100. Allow one small tweak pass (up to 2 weights adjusted, then re-normalize).",
59
+ "Step 7 \u2014 Calibration deck. Generate 8-12 diverse US location archetypes (dense transit metro, college town, mountain small city, coastal mid-size, sunbelt suburb, rust-belt revival city, DC-adjacent, etc.). For each: 2-3 sentences on lifestyle and tradeoffs, who it fits, who it frustrates. Ask the user to rank top 3 and bottom 3 and name 1-2 surprises. Update weights and constraints if calibration reveals new signal. Record derivedSignals (densityLeaning, climateLeaning, regionLeaning).",
60
60
  "Capture these context variables: activeModules, candidateType, userTopOfMind, timelineToMove, householdProfile, housingPlan, workConstraints, geoExclusions, dealbreakers, weights (array of {criterion, weight}), weightsCount, derivedSignals."
61
61
  ],
62
62
  "verify": [
@@ -75,17 +75,17 @@
75
75
  "promptBlocks": {
76
76
  "goal": "Lock the decision mechanics and gate parameters before any candidate research begins. These policies govern how ambiguity, missing data, and diversity requirements are handled throughout the workflow.",
77
77
  "constraints": [
78
- "Every policy must be explicit no implicit defaults allowed past this gate.",
78
+ "Every policy must be explicit \u2014 no implicit defaults allowed past this gate.",
79
79
  "The user must confirm these settings before Phase 3 begins."
80
80
  ],
81
81
  "procedure": [
82
- "Step 1 Missing data policy. Ask the user to choose one: (a) neutral Unknown scores 0.5; (b) penalize Unknown scores 0.25; (c) followup_required Unknown scores 0.5 AND candidates with Unknown on any criterion with weight >= 15 are ineligible for the top 3. Record as missingDataPolicy.",
83
- "Step 2 Intake completeness check. Confirm you have enough context to set dealbreakers and weights. If not, note missingInputs and resolve before proceeding.",
84
- "Step 3 Anti-anchoring gate parameters. Propose defaults and ask the user to confirm or adjust: minCandidatePool (default 20), minNonObviousCandidates (default 6), minCoverageRegions (default 3), minCoverageClimateBands (default 2).",
85
- "Step 4 Shortlist range. Propose defaults and ask the user to confirm or adjust: shortlistMin (default 8), shortlistMax (default 12).",
86
- "Step 5 Screening caps. Propose defaults and ask the user to confirm or adjust: screeningTopCriteriaCount (default 3 screen dealbreakers + top N weighted criteria only), screeningMaxClaimsPerCandidate (default 3), screeningTimeboxMinutesPerCandidate (default 5), screeningBatchSize (default 10).",
87
- "Step 6 Discovery caps. Propose defaults and ask the user to confirm or adjust: perSourceCandidateCap (default 8 cap per curated-list source to avoid editorial bias).",
88
- "Step 7 Baseline flags caps. Propose defaults and ask the user to confirm or adjust: baselineMaxFlagsPerCandidate (default 2), baselineMaxSourcesPerFlag (default 1), baselineTimeboxMinutesPerCandidate (default 2).",
82
+ "Step 1 \u2014 Missing data policy. Ask the user to choose one: (a) neutral \u2014 Unknown scores 0.5; (b) penalize \u2014 Unknown scores 0.25; (c) followup_required \u2014 Unknown scores 0.5 AND candidates with Unknown on any criterion with weight >= 15 are ineligible for the top 3. Record as missingDataPolicy.",
83
+ "Step 2 \u2014 Intake completeness check. Confirm you have enough context to set dealbreakers and weights. If not, note missingInputs and resolve before proceeding.",
84
+ "Step 3 \u2014 Anti-anchoring gate parameters. Propose defaults and ask the user to confirm or adjust: minCandidatePool (default 20), minNonObviousCandidates (default 6), minCoverageRegions (default 3), minCoverageClimateBands (default 2).",
85
+ "Step 4 \u2014 Shortlist range. Propose defaults and ask the user to confirm or adjust: shortlistMin (default 8), shortlistMax (default 12).",
86
+ "Step 5 \u2014 Screening caps. Propose defaults and ask the user to confirm or adjust: screeningTopCriteriaCount (default 3 \u2014 screen dealbreakers + top N weighted criteria only), screeningMaxClaimsPerCandidate (default 3), screeningTimeboxMinutesPerCandidate (default 5), screeningBatchSize (default 10).",
87
+ "Step 6 \u2014 Discovery caps. Propose defaults and ask the user to confirm or adjust: perSourceCandidateCap (default 8 \u2014 cap per curated-list source to avoid editorial bias).",
88
+ "Step 7 \u2014 Baseline flags caps. Propose defaults and ask the user to confirm or adjust: baselineMaxFlagsPerCandidate (default 2), baselineMaxSourcesPerFlag (default 1), baselineTimeboxMinutesPerCandidate (default 2).",
89
89
  "Update RELOCATION_DOSSIER.md with all policies and caps. Capture all values as context variables: missingDataPolicy, minCandidatePool, minNonObviousCandidates, minCoverageRegions, minCoverageClimateBands, shortlistMin, shortlistMax, screeningTopCriteriaCount, screeningMaxClaimsPerCandidate, screeningTimeboxMinutesPerCandidate, screeningBatchSize, perSourceCandidateCap, baselineMaxFlagsPerCandidate, baselineMaxSourcesPerFlag, baselineTimeboxMinutesPerCandidate."
90
90
  ],
91
91
  "verify": [
@@ -107,10 +107,10 @@
107
107
  "Do not proceed to screening until the anti-anchoring gate passes."
108
108
  ],
109
109
  "procedure": [
110
- "Step 1 Sources strategy. Before generating candidates, document the sources strategy in RELOCATION_DOSSIER.md: Housing (Zillow + alternative), Taxes (state revenue sites), Climate normals (NOAA), Climate risk (FEMA flood maps), Employment (BLS / state labor stats), Transit/commute (local agencies), Air quality (AirNow/EPA), Noise (airport contour maps), Internet (FCC broadband map). Include only sources for active modules. Use this sources strategy as your research guide throughout candidate generation generate the pool from actual data, not from memory alone.",
111
- "Step 2 Generate candidates. Use the weight model and dealbreakers as the filter. For each candidate: assign a stable areaId, record the full AreaSpec (candidateType, displayName, stateCodes, and boundary definition), record why included, tag with candidateFacets (region, climateBand, sizeTier, taxRegime, airportAccess, outdoorsBiome as applicable). Fill coverage gaps deliberately include a mix of obvious and non-obvious candidates. Include at least minCandidatePool candidates total.",
112
- "Step 3 Anti-anchoring gate. Check: candidatePoolCount >= minCandidatePool, qualifyingNonObviousCandidateCount >= minNonObviousCandidates, coverageRegionsCount >= minCoverageRegions, coverageClimateBandsCount >= minCoverageClimateBands. A 'qualifying non-obvious' candidate is non-obvious AND plausibly passes dealbreakers. Record the top-100 list source used for non-obvious classification. If the gate fails, expand the pool by filling coverage gaps (prefer non-obvious candidates). Repeat until the gate passes.",
113
- "Step 4 Build screening batches. Divide candidatePool into batches of screeningBatchSize, preserving order. Each batch: { batchId, startIndex, endIndexExclusive, candidates }. Record screeningBatches and screeningBatchesCount.",
110
+ "Step 1 \u2014 Sources strategy. Before generating candidates, document the sources strategy in RELOCATION_DOSSIER.md: Housing (Zillow + alternative), Taxes (state revenue sites), Climate normals (NOAA), Climate risk (FEMA flood maps), Employment (BLS / state labor stats), Transit/commute (local agencies), Air quality (AirNow/EPA), Noise (airport contour maps), Internet (FCC broadband map). Include only sources for active modules. Use this sources strategy as your research guide throughout candidate generation \u2014 generate the pool from actual data, not from memory alone.",
111
+ "Step 2 \u2014 Generate candidates. Use the weight model and dealbreakers as the filter. For each candidate: assign a stable areaId, record the full AreaSpec (candidateType, displayName, stateCodes, and boundary definition), record why included, tag with candidateFacets (region, climateBand, sizeTier, taxRegime, airportAccess, outdoorsBiome as applicable). Fill coverage gaps deliberately \u2014 include a mix of obvious and non-obvious candidates. Include at least minCandidatePool candidates total.",
112
+ "Step 3 \u2014 Anti-anchoring gate. Check: candidatePoolCount >= minCandidatePool, qualifyingNonObviousCandidateCount >= minNonObviousCandidates, coverageRegionsCount >= minCoverageRegions, coverageClimateBandsCount >= minCoverageClimateBands. A 'qualifying non-obvious' candidate is non-obvious AND plausibly passes dealbreakers. Record the top-100 list source used for non-obvious classification. If the gate fails, expand the pool by filling coverage gaps (prefer non-obvious candidates). Repeat until the gate passes.",
113
+ "Step 4 \u2014 Build screening batches. Divide candidatePool into batches of screeningBatchSize, preserving order. Each batch: { batchId, startIndex, endIndexExclusive, candidates }. Record screeningBatches and screeningBatchesCount.",
114
114
  "Update RELOCATION_DOSSIER.md: Candidate Pool table (name, candidateType, region, why included, early risks/unknowns). Capture context variables: candidatePool, candidatePoolCount, nonObviousCandidateCount, qualifyingNonObviousCandidateCount, coverageRegionsCount, coverageClimateBandsCount, screeningBatches, screeningBatchesCount, discoverySourcesUsed, nonObviousDefinitionUsed."
115
115
  ],
116
116
  "verify": [
@@ -144,7 +144,7 @@
144
144
  {
145
145
  "id": "phase-4-baseline-flags",
146
146
  "title": "Phase 4b: Baseline Due Diligence (Not Scored)",
147
- "prompt": "Run a lightweight baseline pass on all Pass or Maybe candidates from screenResults.\n\nScope check only:\n- Climate risk (high-level: flood zone, wildfire, extreme heat)\n- Safety and crime (high-level: neighborhood-level variance)\n- Schools and healthcare access only if kids/schools or healthcare-access modules are active\n\nCaps (apply strictly):\n- At most baselineMaxFlagsPerCandidate flags per candidate\n- At most baselineMaxSourcesPerFlag sources per flag\n- At most baselineTimeboxMinutesPerCandidate minutes per candidate\n\nFor each Pass/Maybe candidate, produce 0 to baselineMaxFlagsPerCandidate baseline flags. Each flag: category (climate/safety/schools/healthcare/policy/other), severity (yellow/orange/red), one-sentence summary, source, retrievedAt, confidenceGrade. A red flag has severity = red.\n\nDo NOT compute or modify any scores here. Do NOT silently turn flags into dealbreakers or weights. If evidence is unclear, record Unknown.\n\nUpdate RELOCATION_DOSSIER.md: add Baseline Flags (Not Scored) section with per-candidate table.\n\nCapture context variables: baselineFlags ({ [candidateKey]: { flags: array, unknowns: string[] } }), redFlagCandidates (string[]), redFlagCount (number).",
147
+ "prompt": "Run a lightweight baseline pass on all Pass or Maybe candidates from screenResults.\n\nScope \u2014 check only:\n- Climate risk (high-level: flood zone, wildfire, extreme heat)\n- Safety and crime (high-level: neighborhood-level variance)\n- Schools and healthcare access \u2014 only if kids/schools or healthcare-access modules are active\n\nCaps (apply strictly):\n- At most baselineMaxFlagsPerCandidate flags per candidate\n- At most baselineMaxSourcesPerFlag sources per flag\n- At most baselineTimeboxMinutesPerCandidate minutes per candidate\n\nFor each Pass/Maybe candidate, produce 0 to baselineMaxFlagsPerCandidate baseline flags. Each flag: category (climate/safety/schools/healthcare/policy/other), severity (yellow/orange/red), one-sentence summary, source, retrievedAt, confidenceGrade. A red flag has severity = red.\n\nDo NOT compute or modify any scores here. Do NOT silently turn flags into dealbreakers or weights. If evidence is unclear, record Unknown.\n\nUpdate RELOCATION_DOSSIER.md: add Baseline Flags (Not Scored) section with per-candidate table.\n\nCapture context variables: baselineFlags ({ [candidateKey]: { flags: array, unknowns: string[] } }), redFlagCandidates (string[]), redFlagCount (number).",
148
148
  "requireConfirmation": false
149
149
  },
150
150
  {
@@ -165,7 +165,7 @@
165
165
  "var": "redFlagCount",
166
166
  "gt": 0
167
167
  },
168
- "text": "Red flags were found. Summarize each: candidate name, category, one-line summary, source. Ask the user to choose exactly one action: (a) promote_to_dealbreakers update the `dealbreakers` context variable AND the RELOCATION_DOSSIER.md Constraints section with the new/updated dealbreakers, then re-check screenResults for affected candidates; (b) add_weighted_criterion ask the user how to weight it and which existing weights decrease so the `weights` array still sums to 100; (c) fyi record the decision and move on. Record redFlagDecision and redFlagDecisionNotes. Append to RELOCATION_DOSSIER.md Red Flag Gate Decisions (append-only)."
168
+ "text": "Red flags were found. Summarize each: candidate name, category, one-line summary, source. Ask the user to choose exactly one action: (a) promote_to_dealbreakers \u2014 update the `dealbreakers` context variable AND the RELOCATION_DOSSIER.md Constraints section with the new/updated dealbreakers, then re-check screenResults for affected candidates; (b) add_weighted_criterion \u2014 ask the user how to weight it and which existing weights decrease so the `weights` array still sums to 100; (c) fyi \u2014 record the decision and move on. Record redFlagDecision and redFlagDecisionNotes. Append to RELOCATION_DOSSIER.md Red Flag Gate Decisions (append-only)."
169
169
  }
170
170
  ],
171
171
  "prompt": "Handle baseline red flags before selecting the shortlist.",
@@ -224,16 +224,16 @@
224
224
  "goal": "Produce the final comparison matrix, explainable ranking, and a practical next-steps plan.",
225
225
  "constraints": [
226
226
  "The score formula must be applied consistently to every candidate.",
227
- "Unknowns must be disclosed in the ranking narrative never presented as if they were evidence-backed.",
227
+ "Unknowns must be disclosed in the ranking narrative \u2014 never presented as if they were evidence-backed.",
228
228
  "Baseline flags (not scored) are shown separately and do not change totalScore.",
229
229
  "One re-weight pass is allowed if the user says the ranking direction is wrong."
230
230
  ],
231
231
  "procedure": [
232
- "Step 1 Comparison matrix. Build a table in RELOCATION_DOSSIER.md: rows = shortlisted candidates, columns = weighted criteria. Mark Unknowns explicitly. Add a separate appendix table for baseline flags (Not Scored): red/orange flags per candidate.",
233
- "Step 2 Score each candidate. For each criterion, assign a normalized subscore: Strong fit = 1.0, Mixed/conditional = 0.5, Weak fit = 0.0. For Unknowns: neutral policy 0.5; penalize policy 0.25; followup_required policy 0.5 and flag candidate ineligible for top 3 if Unknown on any criterion with weight >= 15. Compute totalScore = sum(weight_i * subscore_i) for each candidate.",
234
- "Step 3 Ranking narrative. For each candidate write: 'Ranks #k because it wins on X and Y, loses on Z. Biggest tradeoff: ...' Make sure all Unknown subscores are called out explicitly in the narrative.",
235
- "Step 4 Re-weight gate. Ask the user: 'Does this ranking direction feel correct?' If not, allow one re-weight (user adjusts any number of criteria weights; must still sum to 100; re-run scoring). Record reweightUsed (true/false). Update Decision Log with any weight changes and rationale.",
236
- "Step 5 Next steps. Produce: suggested visit plan for top 2-4 candidates (what to validate in person), open questions per candidate (from Unknowns sections), pivot triggers (what evidence would change the ranking), optional neighborhood-level follow-ups if enough evidence exists. Update RELOCATION_DOSSIER.md with Next Steps and Pivot Triggers.",
232
+ "Step 1 \u2014 Comparison matrix. Build a table in RELOCATION_DOSSIER.md: rows = shortlisted candidates, columns = weighted criteria. Mark Unknowns explicitly. Add a separate appendix table for baseline flags (Not Scored): red/orange flags per candidate.",
233
+ "Step 2 \u2014 Score each candidate. For each criterion, assign a normalized subscore: Strong fit = 1.0, Mixed/conditional = 0.5, Weak fit = 0.0. For Unknowns: neutral policy \u2192 0.5; penalize policy \u2192 0.25; followup_required policy \u2192 0.5 and flag candidate ineligible for top 3 if Unknown on any criterion with weight >= 15. Compute totalScore = sum(weight_i * subscore_i) for each candidate.",
234
+ "Step 3 \u2014 Ranking narrative. For each candidate write: 'Ranks #k because it wins on X and Y, loses on Z. Biggest tradeoff: ...' Make sure all Unknown subscores are called out explicitly in the narrative.",
235
+ "Step 4 \u2014 Re-weight gate. Ask the user: 'Does this ranking direction feel correct?' If not, allow one re-weight (user adjusts any number of criteria weights; must still sum to 100; re-run scoring). Record reweightUsed (true/false). Update Decision Log with any weight changes and rationale.",
236
+ "Step 5 \u2014 Next steps. Produce: suggested visit plan for top 2-4 candidates (what to validate in person), open questions per candidate (from Unknowns sections), pivot triggers (what evidence would change the ranking), optional neighborhood-level follow-ups if enough evidence exists. Update RELOCATION_DOSSIER.md with Next Steps and Pivot Triggers.",
237
237
  "Capture context variables: ranking ([{name, totalScore, rank}]), unknownsImpactSummary, reweightUsed."
238
238
  ],
239
239
  "verify": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "routine-context-gathering",
2
+ "id": "wr.routine-context-gathering",
3
3
  "name": "Context Gathering Routine",
4
4
  "version": "2.1.0",
5
5
  "metricsProfile": "none",
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "routine-design-review",
2
+ "id": "wr.routine-design-review",
3
3
  "name": "Design Review Routine",
4
4
  "version": "1.0.0",
5
5
  "metricsProfile": "none",
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "routine-execution-simulation",
2
+ "id": "wr.routine-execution-simulation",
3
3
  "name": "Execution Simulation Routine",
4
4
  "version": "1.1.0",
5
5
  "metricsProfile": "none",
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "routine-feature-implementation",
2
+ "id": "wr.routine-feature-implementation",
3
3
  "name": "Feature Implementation Routine",
4
4
  "version": "1.0.0",
5
5
  "metricsProfile": "none",
@@ -68,7 +68,7 @@
68
68
  {
69
69
  "id": "step-2-verify-acceptance-criteria",
70
70
  "title": "Step 2: Verify Acceptance Criteria",
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
+ "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)",
72
72
  "agentRole": "You are a quality assurance specialist verifying that all requirements are met. Be thorough and provide evidence.",
73
73
  "requireConfirmation": false,
74
74
  "guidance": [
@@ -101,7 +101,7 @@
101
101
  {
102
102
  "id": "step-4-synthesize-deliverable",
103
103
  "title": "Step 4: Synthesize & Deliver Implementation Report",
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
+ "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.",
105
105
  "agentRole": "You are a technical writer synthesizing your implementation work into a clear, reviewable report. Make it easy to understand and verify.",
106
106
  "requireConfirmation": false,
107
107
  "guidance": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "routine-final-verification",
2
+ "id": "wr.routine-final-verification",
3
3
  "name": "Final Verification Routine",
4
4
  "version": "1.0.0",
5
5
  "metricsProfile": "none",
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "routine-hypothesis-challenge",
2
+ "id": "wr.routine-hypothesis-challenge",
3
3
  "name": "Hypothesis Challenge Routine",
4
4
  "version": "1.0.0",
5
5
  "metricsProfile": "none",
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "routine-ideation",
2
+ "id": "wr.routine-ideation",
3
3
  "name": "Ideation Routine",
4
4
  "version": "1.0.0",
5
5
  "metricsProfile": "none",
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "routine-parallel-work-partitioning",
2
+ "id": "wr.routine-parallel-work-partitioning",
3
3
  "name": "Parallel Work Partitioning Routine",
4
4
  "version": "0.1.0",
5
5
  "metricsProfile": "none",
@@ -25,7 +25,7 @@
25
25
  {
26
26
  "id": "step-classify",
27
27
  "title": "Step 3: Classify Parallel vs. Sequential",
28
- "prompt": "Classify each work item into one of two tracks:\n\n**Parallel track** can be delegated to a subagent. ALL of these must be true:\n- No unresolved dependencies on other in-scope items (or all dependencies are already completed/in an earlier batch)\n- Trivial or moderate complexity\n- Does NOT require judgment, design decisions, or cross-cutting context\n- Can be verified independently (build, test, or review in isolation)\n- Failure is cheap to fix (a bad result can be caught and redone)\n\n**Sequential track** must be handled by the main agent. ANY of these makes it sequential:\n- Has dependencies on items that haven't been completed yet\n- Complex or requires design decisions\n- Touches cross-cutting concerns (shared state, configuration, APIs used by many items)\n- Needs context from other items to be done correctly\n- Failure is expensive (wrong output cascades to other items)\n\nWhen in doubt, classify as sequential.\n\nCapture:\n- `parallelItems`\n- `sequentialItems`\n- `classificationRationale` (one line per item explaining the decision)",
28
+ "prompt": "Classify each work item into one of two tracks:\n\n**Parallel track** \u2014 can be delegated to a subagent. ALL of these must be true:\n- No unresolved dependencies on other in-scope items (or all dependencies are already completed/in an earlier batch)\n- Trivial or moderate complexity\n- Does NOT require judgment, design decisions, or cross-cutting context\n- Can be verified independently (build, test, or review in isolation)\n- Failure is cheap to fix (a bad result can be caught and redone)\n\n**Sequential track** \u2014 must be handled by the main agent. ANY of these makes it sequential:\n- Has dependencies on items that haven't been completed yet\n- Complex or requires design decisions\n- Touches cross-cutting concerns (shared state, configuration, APIs used by many items)\n- Needs context from other items to be done correctly\n- Failure is expensive (wrong output cascades to other items)\n\nWhen in doubt, classify as sequential.\n\nCapture:\n- `parallelItems`\n- `sequentialItems`\n- `classificationRationale` (one line per item explaining the decision)",
29
29
  "requireConfirmation": false
30
30
  },
31
31
  {
@@ -37,7 +37,7 @@
37
37
  {
38
38
  "id": "step-plan-delivery",
39
39
  "title": "Step 5: Produce Execution Plan",
40
- "prompt": "Write the final execution plan as a structured artifact in {deliverableName}.\n\nStructure:\n\n```markdown\n# Parallel Work Partitioning Plan\n\n## Summary\n- Total items: [count]\n- Parallel track: [count] items in [N] batches\n- Sequential track: [count] items\n- Cross-cutting items: [list]\n\n## Execution Order\n\n### Wave 1: Parallel Batches (delegate to subagents)\n\n#### Batch 1: [theme/description]\n- [item]: [one-line task]\n- [item]: [one-line task]\n**Subagent instructions**: [what the subagent needs to know]\n\n#### Batch 2: ...\n\n### Wave 2: Sequential Items (main agent)\n1. [item]: [one-line task] depends on: [items]\n2. [item]: [one-line task] depends on: [items]\n\n## Dependency Graph\n[Compact representation of which items depend on which]\n\n## Risk Notes\n- [Any items where classification was uncertain]\n- [Any sync points where parallel work must complete before sequential work starts]\n```\n\nCapture:\n- `planDelivered`",
40
+ "prompt": "Write the final execution plan as a structured artifact in {deliverableName}.\n\nStructure:\n\n```markdown\n# Parallel Work Partitioning Plan\n\n## Summary\n- Total items: [count]\n- Parallel track: [count] items in [N] batches\n- Sequential track: [count] items\n- Cross-cutting items: [list]\n\n## Execution Order\n\n### Wave 1: Parallel Batches (delegate to subagents)\n\n#### Batch 1: [theme/description]\n- [item]: [one-line task]\n- [item]: [one-line task]\n**Subagent instructions**: [what the subagent needs to know]\n\n#### Batch 2: ...\n\n### Wave 2: Sequential Items (main agent)\n1. [item]: [one-line task] \u2014 depends on: [items]\n2. [item]: [one-line task] \u2014 depends on: [items]\n\n## Dependency Graph\n[Compact representation of which items depend on which]\n\n## Risk Notes\n- [Any items where classification was uncertain]\n- [Any sync points where parallel work must complete before sequential work starts]\n```\n\nCapture:\n- `planDelivered`",
41
41
  "requireConfirmation": false
42
42
  }
43
43
  ]
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "routine-philosophy-alignment",
2
+ "id": "wr.routine-philosophy-alignment",
3
3
  "name": "Philosophy Alignment Routine",
4
4
  "version": "1.0.0",
5
5
  "metricsProfile": "none",
@@ -27,7 +27,7 @@
27
27
  {
28
28
  "id": "step-discover-philosophy",
29
29
  "title": "Step 1: Discover the Dev's Philosophy",
30
- "prompt": "Discover the dev's coding philosophy and preferences. Check `philosophySources` context variable first if it contains pointers to rules, Memory entries, or repo files, go read those sources directly.\n\nIf `philosophySources` is empty or unavailable, discover from scratch using this fallback chain:\n1. Memory MCP (if available): call `mcp_memory_conventions`, `mcp_memory_prefer`, `mcp_memory_recall` to retrieve learned preferences\n2. Active session rules / Firebender rules: read any rules or philosophy documents in context\n3. Repo patterns: infer preferences from how the codebase works error handling, mutability, test style, naming, architecture\n\nAlso check `philosophyConflicts` if stated rules conflict with repo patterns, note which apply to this review.\n\nWorking notes:\n- Philosophy sources consulted\n- Key principles discovered\n- Conflicts between stated and practiced philosophy",
30
+ "prompt": "Discover the dev's coding philosophy and preferences. Check `philosophySources` context variable first \u2014 if it contains pointers to rules, Memory entries, or repo files, go read those sources directly.\n\nIf `philosophySources` is empty or unavailable, discover from scratch using this fallback chain:\n1. Memory MCP (if available): call `mcp_memory_conventions`, `mcp_memory_prefer`, `mcp_memory_recall` to retrieve learned preferences\n2. Active session rules / Firebender rules: read any rules or philosophy documents in context\n3. Repo patterns: infer preferences from how the codebase works \u2014 error handling, mutability, test style, naming, architecture\n\nAlso check `philosophyConflicts` \u2014 if stated rules conflict with repo patterns, note which apply to this review.\n\nWorking notes:\n- Philosophy sources consulted\n- Key principles discovered\n- Conflicts between stated and practiced philosophy",
31
31
  "agentRole": "You are discovering what the dev actually cares about before judging their code against it.",
32
32
  "requireConfirmation": false
33
33
  },
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "routine-plan-analysis",
2
+ "id": "wr.routine-plan-analysis",
3
3
  "name": "Plan Analysis Routine",
4
4
  "version": "1.1.0",
5
5
  "metricsProfile": "none",
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "routine-plan-generation",
2
+ "id": "wr.routine-plan-generation",
3
3
  "name": "Plan Generation Routine",
4
4
  "version": "1.0.0",
5
5
  "metricsProfile": "none",
@@ -1,5 +1,5 @@
1
1
  {
2
- "id": "routine-tension-driven-design",
2
+ "id": "wr.routine-tension-driven-design",
3
3
  "name": "Tension-Driven Design Generation",
4
4
  "version": "1.0.0",
5
5
  "metricsProfile": "none",
@@ -28,35 +28,35 @@
28
28
  {
29
29
  "id": "step-discover-philosophy",
30
30
  "title": "Step 1: Discover the Dev's Philosophy",
31
- "prompt": "Discover the dev's coding philosophy and preferences before designing anything.\n\nCheck `philosophySources` context variable first if it contains pointers to rules, Memory entries, or repo files, go read those sources directly.\n\nIf `philosophySources` is empty or unavailable, discover from scratch:\n1. Memory MCP (if available): call `mcp_memory_conventions`, `mcp_memory_prefer`, `mcp_memory_recall` to retrieve learned preferences\n2. Active session rules / Firebender rules: read any rules or philosophy documents in context\n3. Repo patterns: infer preferences from how the codebase works error handling, mutability, test style, architecture\n\nNote any `philosophyConflicts` (stated rules vs actual repo patterns).\n\nWorking notes:\n- Philosophy sources consulted\n- Key principles discovered\n- Conflicts between stated and practiced philosophy\n- Which principles are likely to constrain this design",
31
+ "prompt": "Discover the dev's coding philosophy and preferences before designing anything.\n\nCheck `philosophySources` context variable first \u2014 if it contains pointers to rules, Memory entries, or repo files, go read those sources directly.\n\nIf `philosophySources` is empty or unavailable, discover from scratch:\n1. Memory MCP (if available): call `mcp_memory_conventions`, `mcp_memory_prefer`, `mcp_memory_recall` to retrieve learned preferences\n2. Active session rules / Firebender rules: read any rules or philosophy documents in context\n3. Repo patterns: infer preferences from how the codebase works \u2014 error handling, mutability, test style, architecture\n\nNote any `philosophyConflicts` (stated rules vs actual repo patterns).\n\nWorking notes:\n- Philosophy sources consulted\n- Key principles discovered\n- Conflicts between stated and practiced philosophy\n- Which principles are likely to constrain this design",
32
32
  "agentRole": "You are discovering what the dev actually cares about before designing solutions.",
33
33
  "requireConfirmation": false
34
34
  },
35
35
  {
36
36
  "id": "step-understand-deeply",
37
37
  "title": "Step 2: Understand the Problem Deeply",
38
- "prompt": "Understand the problem before proposing anything.\n\nReason through:\n- What are the core tensions in this problem? (e.g., performance vs simplicity, flexibility vs type safety, backward compatibility vs clean design)\n- How does the codebase already solve similar problems? Study the most relevant existing patterns analyze the architectural decisions and constraints they protect, not just list files.\n- Where does the problem most likely live? Is the requested location the real seam, or just where the symptom appears?\n- What nearby callers, consumers, sibling paths, or contracts must remain consistent if that boundary changes?\n- What's the simplest naive solution? Why is it insufficient? (If it IS sufficient, note that it may be the best candidate.)\n- What makes this problem hard? What would a junior developer miss?\n- Which of the dev's philosophy principles are under pressure from this problem's constraints?\n\nWorking notes:\n- Core tensions (2-4 real tradeoffs, not generic labels)\n- Existing patterns analysis (decisions, invariants they protect)\n- Likely seam / plausible boundaries\n- Nearby impact surface that must stay consistent\n- Naive solution and why it's insufficient (or sufficient)\n- What makes this hard\n- Philosophy principles under pressure",
38
+ "prompt": "Understand the problem before proposing anything.\n\nReason through:\n- What are the core tensions in this problem? (e.g., performance vs simplicity, flexibility vs type safety, backward compatibility vs clean design)\n- How does the codebase already solve similar problems? Study the most relevant existing patterns \u2014 analyze the architectural decisions and constraints they protect, not just list files.\n- Where does the problem most likely live? Is the requested location the real seam, or just where the symptom appears?\n- What nearby callers, consumers, sibling paths, or contracts must remain consistent if that boundary changes?\n- What's the simplest naive solution? Why is it insufficient? (If it IS sufficient, note that \u2014 it may be the best candidate.)\n- What makes this problem hard? What would a junior developer miss?\n- Which of the dev's philosophy principles are under pressure from this problem's constraints?\n\nWorking notes:\n- Core tensions (2-4 real tradeoffs, not generic labels)\n- Existing patterns analysis (decisions, invariants they protect)\n- Likely seam / plausible boundaries\n- Nearby impact surface that must stay consistent\n- Naive solution and why it's insufficient (or sufficient)\n- What makes this hard\n- Philosophy principles under pressure",
39
39
  "agentRole": "You are reasoning deeply about the problem space before generating any solutions.",
40
40
  "requireConfirmation": false
41
41
  },
42
42
  {
43
43
  "id": "step-generate-candidates",
44
44
  "title": "Step 3: Generate Candidates from Tensions",
45
- "prompt": "Generate design candidates that resolve the identified tensions differently.\n\nMANDATORY candidates:\n1. The simplest possible change that satisfies acceptance criteria. If the problem doesn't need an architectural solution, say so.\n2. Follow the existing repo pattern adapt what the codebase already does for similar problems. Don't invent when you can adapt.\n\nAdditional candidates (1-2 more):\n- Each must resolve the identified tensions DIFFERENTLY, not just vary surface details\n- Each must be grounded in a real constraint or tradeoff, not an abstract perspective label\n- Consider philosophy conflicts: if the stated philosophy disagrees with repo patterns, one candidate could follow the stated philosophy and another could follow the established pattern\n\nFor each candidate, produce:\n- One-sentence summary of the approach\n- Which tensions it resolves and which it accepts\n- Boundary solved at, and why that boundary is the best fit\n- The specific failure mode you'd watch for\n- How it relates to existing repo patterns (follows / adapts / departs)\n- What you gain and what you give up\n- Impact surface beyond the immediate task\n- Scope judgment: too narrow / best-fit / too broad, with concrete evidence\n- Which philosophy principles it honors and which it conflicts with (by name)\n\nRules:\n- candidates must be genuinely different in shape, not just wording\n- if all candidates converge on the same approach, that's signal note it honestly rather than manufacturing fake diversity\n- broader scope requires concrete evidence\n- cite specific files or patterns when they materially shape a candidate\n- specify each candidate at the level of concrete shape, not concept labels: 'tags' is not a candidate specification; 'per-workflow multi-labels drawn from a closed 9-value enum' is. If you find yourself using a concept label (tags, categories, events, hooks), you have not yet specified the candidate name the data structure, the vocabulary or value set it uses, who maintains it, and how it is queried",
45
+ "prompt": "Generate design candidates that resolve the identified tensions differently.\n\nMANDATORY candidates:\n1. The simplest possible change that satisfies acceptance criteria. If the problem doesn't need an architectural solution, say so.\n2. Follow the existing repo pattern \u2014 adapt what the codebase already does for similar problems. Don't invent when you can adapt.\n\nAdditional candidates (1-2 more):\n- Each must resolve the identified tensions DIFFERENTLY, not just vary surface details\n- Each must be grounded in a real constraint or tradeoff, not an abstract perspective label\n- Consider philosophy conflicts: if the stated philosophy disagrees with repo patterns, one candidate could follow the stated philosophy and another could follow the established pattern\n\nFor each candidate, produce:\n- One-sentence summary of the approach\n- Which tensions it resolves and which it accepts\n- Boundary solved at, and why that boundary is the best fit\n- The specific failure mode you'd watch for\n- How it relates to existing repo patterns (follows / adapts / departs)\n- What you gain and what you give up\n- Impact surface beyond the immediate task\n- Scope judgment: too narrow / best-fit / too broad, with concrete evidence\n- Which philosophy principles it honors and which it conflicts with (by name)\n\nRules:\n- candidates must be genuinely different in shape, not just wording\n- if all candidates converge on the same approach, that's signal \u2014 note it honestly rather than manufacturing fake diversity\n- broader scope requires concrete evidence\n- cite specific files or patterns when they materially shape a candidate\n- specify each candidate at the level of concrete shape, not concept labels: 'tags' is not a candidate specification; 'per-workflow multi-labels drawn from a closed 9-value enum' is. If you find yourself using a concept label (tags, categories, events, hooks), you have not yet specified the candidate \u2014 name the data structure, the vocabulary or value set it uses, who maintains it, and how it is queried",
46
46
  "agentRole": "You are generating genuinely diverse design candidates grounded in real tensions.",
47
47
  "requireConfirmation": false
48
48
  },
49
49
  {
50
50
  "id": "step-compare-and-recommend",
51
51
  "title": "Step 4: Compare via Tradeoffs and Recommend",
52
- "prompt": "Compare candidates through tradeoff analysis, not checklists.\n\nFor the set of candidates, assess:\n- Which tensions does each resolve best?\n- Which solves the problem at the best-fit boundary?\n- Which has the most manageable failure mode?\n- Which best fits the dev's philosophy? Where are the philosophy conflicts?\n- Which is most consistent with existing repo patterns?\n- Which would be easiest to evolve or reverse if assumptions are wrong?\n- Which is too narrow, best-fit, or too broad and why?\n\nProduce a clear recommendation with rationale tied back to tensions, scope judgment, repo patterns, and philosophy. If two candidates are close, say so and explain what would tip the decision.\n\nSelf-critique your recommendation:\n- What's the strongest argument against your pick?\n- What narrower option might still work, and why did it lose?\n- What broader option might be justified, and what evidence would be required?\n- What assumption, if wrong, would invalidate this design?\n\nWorking notes:\n- Comparison matrix (tensions x candidates)\n- Recommendation and rationale\n- Strongest counter-argument\n- Pivot conditions",
52
+ "prompt": "Compare candidates through tradeoff analysis, not checklists.\n\nFor the set of candidates, assess:\n- Which tensions does each resolve best?\n- Which solves the problem at the best-fit boundary?\n- Which has the most manageable failure mode?\n- Which best fits the dev's philosophy? Where are the philosophy conflicts?\n- Which is most consistent with existing repo patterns?\n- Which would be easiest to evolve or reverse if assumptions are wrong?\n- Which is too narrow, best-fit, or too broad \u2014 and why?\n\nProduce a clear recommendation with rationale tied back to tensions, scope judgment, repo patterns, and philosophy. If two candidates are close, say so and explain what would tip the decision.\n\nSelf-critique your recommendation:\n- What's the strongest argument against your pick?\n- What narrower option might still work, and why did it lose?\n- What broader option might be justified, and what evidence would be required?\n- What assumption, if wrong, would invalidate this design?\n\nWorking notes:\n- Comparison matrix (tensions x candidates)\n- Recommendation and rationale\n- Strongest counter-argument\n- Pivot conditions",
53
53
  "agentRole": "You are comparing candidates honestly and recommending based on tradeoffs, not advocacy.",
54
54
  "requireConfirmation": false
55
55
  },
56
56
  {
57
57
  "id": "step-deliver",
58
58
  "title": "Step 5: Deliver the Design Candidates",
59
- "prompt": "Create `{deliverableName}`.\n\nRequired structure:\n- Problem Understanding (tensions, likely seam, what makes it hard)\n- Philosophy Constraints (which principles matter, any conflicts)\n- Impact Surface (what nearby paths, consumers, or contracts must stay consistent)\n- Candidates (each with: summary, tensions resolved/accepted, boundary solved at, why that boundary is the best fit, failure mode, repo-pattern relationship, gains/losses, scope judgment, philosophy fit)\n- Comparison and Recommendation\n- Self-Critique (strongest counter-argument, pivot conditions)\n- Open Questions for the Main Agent\n\nThe main agent will interrogate this output it is raw investigative material, not a final decision. Optimize for honest, useful analysis over polished presentation.",
59
+ "prompt": "Create `{deliverableName}`.\n\nRequired structure:\n- Problem Understanding (tensions, likely seam, what makes it hard)\n- Philosophy Constraints (which principles matter, any conflicts)\n- Impact Surface (what nearby paths, consumers, or contracts must stay consistent)\n- Candidates (each with: summary, tensions resolved/accepted, boundary solved at, why that boundary is the best fit, failure mode, repo-pattern relationship, gains/losses, scope judgment, philosophy fit)\n- Comparison and Recommendation\n- Self-Critique (strongest counter-argument, pivot conditions)\n- Open Questions for the Main Agent\n\nThe main agent will interrogate this output \u2014 it is raw investigative material, not a final decision. Optimize for honest, useful analysis over polished presentation.",
60
60
  "agentRole": "You are delivering design analysis for the main agent to interrogate and build on.",
61
61
  "requireConfirmation": false
62
62
  }
@@ -1,9 +1,9 @@
1
1
  {
2
- "id": "scoped-documentation-workflow",
2
+ "id": "wr.scoped-documentation",
3
3
  "name": "Scoped Documentation Workflow",
4
4
  "version": "2.0.0",
5
5
  "metricsProfile": "coding",
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
+ "description": "Use this to create documentation for a single, bounded subject \u2014 one class, one integration point, one mechanism, or one architecture decision. Enforces strict scope discipline to prevent documentation sprawl.",
7
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.",
8
8
  "examples": [
9
9
  "Document the RateLimiter class: its API, configuration options, and failure behavior",
@@ -24,18 +24,18 @@
24
24
  "Agent can read files, analyze code, and write documentation"
25
25
  ],
26
26
  "metaGuidance": [
27
- "SCOPE IS LAW: Define a boundary and defend it. REFERENCE out-of-scope items (one sentence + link). Never EXPLAIN them. One violation leads to more protect the boundary.",
28
- "REFERENCE vs EXPLAIN: Good 'This uses CacheManager (see Cache Docs) to store results.' Bad 'CacheManager works by maintaining an LRU cache that...' Never explain out-of-scope internals.",
29
- "TEMPTATION LOGGING: Every time you almost explain an out-of-scope item, log it: 'Almost explained [X] but stopped out of scope.' Zero logs on a complex subject is a red flag.",
30
- "NOTES-FIRST DURABILITY: use output.notesMarkdown as the primary durable record. ANALYSIS.md, OUTLINE.md, SCOPE_CONTRACT.md are optional human-facing artifacts not required workflow memory.",
31
- "RUBRIC OVER VIBES: Score concrete dimensions with evidence sentences. Derive your next action from the rubric result not from a gut feeling about whether things seem okay.",
27
+ "SCOPE IS LAW: Define a boundary and defend it. REFERENCE out-of-scope items (one sentence + link). Never EXPLAIN them. One violation leads to more \u2014 protect the boundary.",
28
+ "REFERENCE vs EXPLAIN: Good \u2014 'This uses CacheManager (see Cache Docs) to store results.' Bad \u2014 'CacheManager works by maintaining an LRU cache that...' Never explain out-of-scope internals.",
29
+ "TEMPTATION LOGGING: Every time you almost explain an out-of-scope item, log it: 'Almost explained [X] but stopped \u2014 out of scope.' Zero logs on a complex subject is a red flag.",
30
+ "NOTES-FIRST DURABILITY: use output.notesMarkdown as the primary durable record. ANALYSIS.md, OUTLINE.md, SCOPE_CONTRACT.md are optional human-facing artifacts \u2014 not required workflow memory.",
31
+ "RUBRIC OVER VIBES: Score concrete dimensions with evidence sentences. Derive your next action from the rubric result \u2014 not from a gut feeling about whether things seem okay.",
32
32
  "DEFAULT BEHAVIOR: self-execute with tools. Only ask the user for approvals at explicit checkpoints or for external knowledge you genuinely cannot determine yourself."
33
33
  ],
34
34
  "steps": [
35
35
  {
36
36
  "id": "phase-0-reconnaissance-and-scope",
37
37
  "title": "Phase 0: Reconnaissance & Scope Definition",
38
- "prompt": "I want to create focused documentation for: \"[user's request]\"\n\n**How I work:** I handle most decisions autonomously and stop only for critical choices like scope approval. You can adjust anytime: say 'check with me more often' to add phase checkpoints, or 'just finish it' to minimize stops.\n\n**Step 1 Reconnaissance (2-3 minutes):**\n\nExplore the subject quickly to understand the landscape before proposing scope:\n\n- Locate the subject (files, system definitions, process docs)\n- Identify primary interfaces and entry points\n- Map immediate dependencies (one level deep)\n- Check for existing documentation to avoid duplication\n- Note related components and assess complexity (simple/moderate/complex)\n\nReconnaissance findings:\n- **Primary Subject:** [what was requested]\n- **Type:** [code/system/concept/process/interaction]\n- **Located at:** [file paths, system names, or description]\n- **Related Components:** [list with brief descriptions]\n- **Dependencies:** [key dependencies identified]\n- **Existing Docs:** [found/not found]\n- **Complexity:** [Simple/Moderate/Complex]\n\n**Step 2 Scope Proposal:**\n\nBased on reconnaissance, propose a scope contract:\n\n**Subject:** [One clear sentence describing what you're documenting]\n\n**IN SCOPE** (will be explained in detail):\n- [Specific component/feature/mechanism and its core behaviors]\n- [Common use cases and usage patterns]\n- [Integration points and interfaces]\n- [Important edge cases and design decisions]\n\n**OUT OF SCOPE** (will be referenced only, not explained):\n- [Dependency X] internals referenced as prerequisite\n- [Related feature Y] link to separate docs\n- [Historical context] unless specifically needed\n\n**BOUNDARY CONDITIONS** (where in-scope meets out-of-scope):\n- [Interface with System A]: document our side, reference their docs\n- [Integration with Component B]: document the contract, not their internals\n\n**Target Audience:** [who will read this]\n**Success Criteria:** Reader can [specific outcome]\n**Estimated Length:** ~[N] words\n\n**Does this scope look right?** Reply with approval or adjustments. If no response, I'll interpret as approval and proceed.\n\nAfter approval: I'll proceed with autonomous analysis, checking back only for critical questions or validation issues.",
38
+ "prompt": "I want to create focused documentation for: \"[user's request]\"\n\n**How I work:** I handle most decisions autonomously and stop only for critical choices like scope approval. You can adjust anytime: say 'check with me more often' to add phase checkpoints, or 'just finish it' to minimize stops.\n\n**Step 1 \u2014 Reconnaissance (2-3 minutes):**\n\nExplore the subject quickly to understand the landscape before proposing scope:\n\n- Locate the subject (files, system definitions, process docs)\n- Identify primary interfaces and entry points\n- Map immediate dependencies (one level deep)\n- Check for existing documentation to avoid duplication\n- Note related components and assess complexity (simple/moderate/complex)\n\nReconnaissance findings:\n- **Primary Subject:** [what was requested]\n- **Type:** [code/system/concept/process/interaction]\n- **Located at:** [file paths, system names, or description]\n- **Related Components:** [list with brief descriptions]\n- **Dependencies:** [key dependencies identified]\n- **Existing Docs:** [found/not found]\n- **Complexity:** [Simple/Moderate/Complex]\n\n**Step 2 \u2014 Scope Proposal:**\n\nBased on reconnaissance, propose a scope contract:\n\n**Subject:** [One clear sentence describing what you're documenting]\n\n**IN SCOPE** (will be explained in detail):\n- [Specific component/feature/mechanism and its core behaviors]\n- [Common use cases and usage patterns]\n- [Integration points and interfaces]\n- [Important edge cases and design decisions]\n\n**OUT OF SCOPE** (will be referenced only, not explained):\n- [Dependency X] internals \u2014 referenced as prerequisite\n- [Related feature Y] \u2014 link to separate docs\n- [Historical context] \u2014 unless specifically needed\n\n**BOUNDARY CONDITIONS** (where in-scope meets out-of-scope):\n- [Interface with System A]: document our side, reference their docs\n- [Integration with Component B]: document the contract, not their internals\n\n**Target Audience:** [who will read this]\n**Success Criteria:** Reader can [specific outcome]\n**Estimated Length:** ~[N] words\n\n**Does this scope look right?** Reply with approval or adjustments. If no response, I'll interpret as approval and proceed.\n\nAfter approval: I'll proceed with autonomous analysis, checking back only for critical questions or validation issues.",
39
39
  "requireConfirmation": true,
40
40
  "validationCriteria": [
41
41
  {
@@ -62,14 +62,14 @@
62
62
  "promptBlocks": {
63
63
  "goal": "Analyze the subject thoroughly within the approved scope boundary and score evidence quality before proceeding.",
64
64
  "constraints": [
65
- "Enforce scope during analysis: read and trace only in-scope files and behaviors. When you encounter an out-of-scope item, log it and move on do not analyze it.",
65
+ "Enforce scope during analysis: read and trace only in-scope files and behaviors. When you encounter an out-of-scope item, log it and move on \u2014 do not analyze it.",
66
66
  "Notes-first: record analysis findings in notesMarkdown, not in ANALYSIS.md as a required artifact.",
67
- "Derive the proceed/gather-more decision from the evidence rubric not from a gut feeling."
67
+ "Derive the proceed/gather-more decision from the evidence rubric \u2014 not from a gut feeling."
68
68
  ],
69
69
  "procedure": [
70
70
  "Investigation approach: (1) Map interfaces and public API surface (in-scope only). (2) Trace key execution flows and behaviors. (3) Identify important mechanisms and patterns. (4) Extract 5+ representative examples from code or usage. (5) Document integration points at the interface/contract level only. (6) Note design decisions and tradeoffs.",
71
- "Boundary enforcement (continuous) when you encounter something outside scope: REFERENCE IT ('This integrates with [System X] via [interface]'), LINK TO DOCS ('For [System X] details, see [link]'), DO NOT EXPLAIN IT, DO NOT ANALYZE IT, LOG THE TEMPTATION ('Almost analyzed [X] but stopped out of scope').",
72
- "Evidence rubric score all 4 dimensions before deciding to proceed. Score each dimension 0, 1, or 2 and write one evidence sentence for each.",
71
+ "Boundary enforcement (continuous) \u2014 when you encounter something outside scope: REFERENCE IT ('This integrates with [System X] via [interface]'), LINK TO DOCS ('For [System X] details, see [link]'), DO NOT EXPLAIN IT, DO NOT ANALYZE IT, LOG THE TEMPTATION ('Almost analyzed [X] but stopped \u2014 out of scope').",
72
+ "Evidence rubric \u2014 score all 4 dimensions before deciding to proceed. Score each dimension 0, 1, or 2 and write one evidence sentence for each.",
73
73
  "subjectBoundaryClarity: 0=boundary confirmed and clear, 1=likely correct but one area uncertain, 2=boundary still ambiguous",
74
74
  "behaviorCoverage: 0=all key behaviors identified with examples, 1=most behaviors covered with minor gaps, 2=significant behavior gaps remain",
75
75
  "examplesCollected: 0=5+ concrete examples extracted from subject, 1=2-4 examples found, 2=fewer than 2 verifiable examples",
@@ -78,7 +78,7 @@
78
78
  "If you find a critical scope issue (the subject is actually two distinct subjects, or a required dependency cannot be referenced without explaining it), surface this to the user before proceeding."
79
79
  ],
80
80
  "outputRequired": {
81
- "analysisFindings": "Subject overview, core behaviors/components, integration points, examples (5+), design decisions recorded in notesMarkdown",
81
+ "analysisFindings": "Subject overview, core behaviors/components, integration points, examples (5+), design decisions \u2014 recorded in notesMarkdown",
82
82
  "scopeBoundaryLog": "Every temptation stopped: what was encountered and why it was left out",
83
83
  "evidenceRubricScores": "All 4 dimensions scored with evidence sentences, plus gate decision (proceed or gather more with specifics)"
84
84
  },
@@ -98,18 +98,18 @@
98
98
  "goal": "Design the documentation structure and create a detailed outline that maps directly to the Phase 1 analysis findings.",
99
99
  "constraints": [
100
100
  "Every section must map to an in-scope item from Phase 1 analysis.",
101
- "Out-of-scope items belong only in a 'Related Documentation' section as references, never explanations.",
102
- "Pull all content points from Phase 1 findings do not invent new content that wasn't in the analysis.",
101
+ "Out-of-scope items belong only in a 'Related Documentation' section \u2014 as references, never explanations.",
102
+ "Pull all content points from Phase 1 findings \u2014 do not invent new content that wasn't in the analysis.",
103
103
  "Notes-first: record the outline in notesMarkdown, not only in OUTLINE.md."
104
104
  ],
105
105
  "procedure": [
106
- "Step 1 Choose structure type based on subject: Code subject: Overview How It Works Usage Guide Reference Edge Cases Related Docs. System/concept: Overview Components Interactions Integration Examples Related Docs. Process/workflow: Overview Steps Decision Points Examples Troubleshooting Related Docs. Adjust sections based on what analysis actually found.",
107
- "Step 2 Create detailed outline. For each section, specify: content points sourced from Phase 1 analysis (with evidence references), examples to include (from Phase 1 examples), approximate word count target, whether this section documents in-scope items or references out-of-scope ones.",
108
- "Step 3 Scope compliance check on the outline. Review every section and confirm: Does it map to an in-scope item? Does it require explaining any out-of-scope dependency? Can the content be written entirely from Phase 1 findings?",
106
+ "Step 1 \u2014 Choose structure type based on subject: Code subject: Overview \u2192 How It Works \u2192 Usage Guide \u2192 Reference \u2192 Edge Cases \u2192 Related Docs. System/concept: Overview \u2192 Components \u2192 Interactions \u2192 Integration \u2192 Examples \u2192 Related Docs. Process/workflow: Overview \u2192 Steps \u2192 Decision Points \u2192 Examples \u2192 Troubleshooting \u2192 Related Docs. Adjust sections based on what analysis actually found.",
107
+ "Step 2 \u2014 Create detailed outline. For each section, specify: content points sourced from Phase 1 analysis (with evidence references), examples to include (from Phase 1 examples), approximate word count target, whether this section documents in-scope items or references out-of-scope ones.",
108
+ "Step 3 \u2014 Scope compliance check on the outline. Review every section and confirm: Does it map to an in-scope item? Does it require explaining any out-of-scope dependency? Can the content be written entirely from Phase 1 findings?",
109
109
  "If any section requires explaining an out-of-scope item: convert it to a reference, remove it, or surface a scope re-negotiation to the user. If any section cannot be written from Phase 1 findings: flag what additional analysis is needed and return to Phase 1."
110
110
  ],
111
111
  "outputRequired": {
112
- "documentationStructure": "Section titles, word count targets, and content-source mapping recorded in notesMarkdown",
112
+ "documentationStructure": "Section titles, word count targets, and content-source mapping \u2014 recorded in notesMarkdown",
113
113
  "scopeComplianceConfirmation": "All sections confirmed to map to in-scope items",
114
114
  "totalEstimatedWordCount": "Total word count estimate",
115
115
  "analysisGaps": "Any gaps requiring return to Phase 1 (if none, state none)"
@@ -117,7 +117,7 @@
117
117
  "verify": [
118
118
  "Every section maps to an in-scope item from Phase 1 analysis",
119
119
  "Out-of-scope items only appear in 'Related Documentation' section",
120
- "All examples sourced from Phase 1 none invented",
120
+ "All examples sourced from Phase 1 \u2014 none invented",
121
121
  "Outline recorded in notesMarkdown"
122
122
  ]
123
123
  },
@@ -129,16 +129,16 @@
129
129
  "promptBlocks": {
130
130
  "goal": "Write the documentation section by section, enforcing scope boundaries continuously and logging all boundary decisions.",
131
131
  "constraints": [
132
- "Content must come from Phase 1 analysis and Phase 2 outline do not introduce new claims or examples that weren't in the analysis.",
132
+ "Content must come from Phase 1 analysis and Phase 2 outline \u2014 do not introduce new claims or examples that weren't in the analysis.",
133
133
  "After every paragraph: check scope compliance. Am I explaining something in scope or referencing something out of scope?",
134
134
  "Mark boundaries clearly in the text so readers know what's in vs out.",
135
135
  "Notes-first: the documentation file is the primary artifact; ANALYSIS.md or OUTLINE.md sidecar files are optional."
136
136
  ],
137
137
  "procedure": [
138
- "Writing approach section by section. For each section from the Phase 2 outline: (1) Draft content from outline and Phase 1 findings. (2) Add examples from analysis (complete, not fragments). (3) Check scope compliance inline. (4) Write boundary markers for out-of-scope references. (5) Log any temptation to explain an out-of-scope item.",
139
- "Scope boundary wording use these patterns. Good (reference only): 'This uses the CacheManager (see Cache Documentation) to store results.' Good: 'For authentication details, see Auth Service Documentation.' Bad (explaining out-of-scope): 'The CacheManager works by maintaining an in-memory LRU cache that...'",
140
- "After writing all sections final scope audit. Read through the complete draft and count: lines documenting in-scope items (vast majority), lines referencing out-of-scope items (minimal), lines explaining out-of-scope items (must be zero). Fix any violations before advancing to Phase 4.",
141
- "If you discover a critical inaccuracy (a claim you cannot verify from analysis), flag it for user confirmation in Phase 4 don't silently remove it.",
138
+ "Writing approach \u2014 section by section. For each section from the Phase 2 outline: (1) Draft content from outline and Phase 1 findings. (2) Add examples from analysis (complete, not fragments). (3) Check scope compliance inline. (4) Write boundary markers for out-of-scope references. (5) Log any temptation to explain an out-of-scope item.",
139
+ "Scope boundary wording \u2014 use these patterns. Good (reference only): 'This uses the CacheManager (see Cache Documentation) to store results.' Good: 'For authentication details, see Auth Service Documentation.' Bad (explaining out-of-scope): 'The CacheManager works by maintaining an in-memory LRU cache that...'",
140
+ "After writing all sections \u2014 final scope audit. Read through the complete draft and count: lines documenting in-scope items (vast majority), lines referencing out-of-scope items (minimal), lines explaining out-of-scope items (must be zero). Fix any violations before advancing to Phase 4.",
141
+ "If you discover a critical inaccuracy (a claim you cannot verify from analysis), flag it for user confirmation in Phase 4 \u2014 don't silently remove it.",
142
142
  "Write the documentation to a file. Suggested filename: [SUBJECT]_Documentation.md or similar. Record the path in mainDocumentationFile."
143
143
  ],
144
144
  "outputRequired": {
@@ -159,7 +159,7 @@
159
159
  {
160
160
  "id": "phase-4-validation-and-delivery",
161
161
  "title": "Phase 4: Adversarial Validation & Delivery",
162
- "prompt": "Now be the harshest critic before delivering.\n\n**VALIDATION RUBRIC score all 4 dimensions with evidence:**\n\n**1. Scope Compliance**\n- PASS: zero unexplained out-of-scope items in the documentation\n- PARTIAL: minor violations found and fixed autonomously\n- FAIL: violations found that cannot be fixed without user input\n- Evidence: [sentence + violation count]\n- Action: FAIL triggers user input; PARTIAL acceptable with disclosure\n\n**2. Completeness**\n- PASS: all in-scope items from the scope contract are documented\n- PARTIAL: minor gaps (non-critical items missing)\n- FAIL: significant in-scope items missing\n- Evidence: [sentence + gap count]\n- Action: FAIL triggers autonomous content addition then re-validate; PARTIAL acceptable with disclosure\n\n**3. Accuracy**\n- PASS: all technical claims verifiable from Phase 1 analysis\n- PARTIAL: minor uncertainties clearly marked in documentation\n- FAIL: key claims uncertain external confirmation required\n- Evidence: [sentence + uncertain claim count]\n- Action: FAIL triggers user checkpoint with specific questions; PARTIAL acceptable with disclosure\n\n**4. Clarity**\n- PASS: target audience can achieve the success criteria using this documentation\n- PARTIAL: some sections need clearer wording\n- FAIL: significant clarity gaps preventing successful use\n- Evidence: [sentence]\n- Action: FAIL triggers autonomous rewrite then re-validate; PARTIAL acceptable with disclosure\n\n---\n\n**Gate rules:**\n- scopeCompliance and completeness must both reach PASS for delivery\n- accuracy FAIL triggers user checkpoint list specific questions below\n- clarity FAIL triggers autonomous rewrite\n- accuracy PARTIAL and clarity PARTIAL proceed with disclosure\n\n**If all gates pass or are acceptable for delivery:**\n\nCreate SCOPE_MAP.md:\n```\n# Scope Map: [Subject]\n\n## Documented Here (In Scope)\n- [Item]: [brief description] see [Section]\n\n## Referenced Only (Out of Scope)\n- [Item]: [brief description] [link if available]\n\n## Integration Points\n- [Where this connects to other systems / interface contracts]\n\n## Related Documentation\n- [Links with descriptions]\n```\n\nOptionally create MAINTENANCE_NOTES.md with: when to update this documentation, which sections to review for accuracy, scope boundary reminders (what stays referenced-only).\n\n**DELIVERY SUMMARY:**\n\n- Main documentation: [path] (~[N] words)\n- Scope map: SCOPE_MAP.md\n- Validation results: scopeCompliance=[X], completeness=[X], accuracy=[X], clarity=[X]\n- Scope discipline: [N] temptations stopped, 0 violations in final delivery\n- Audience: [target audience]\n- Success criteria: Reader can [outcome]\n\n---\n\n**IF accuracy FAIL user checkpoint required:**\n\nBefore I can deliver, I need your input on accuracy:\n\n[List specific technical claims that need confirmation, with context for each]\n\nOnce you confirm, I'll finalize and deliver.",
162
+ "prompt": "Now be the harshest critic before delivering.\n\n**VALIDATION RUBRIC \u2014 score all 4 dimensions with evidence:**\n\n**1. Scope Compliance**\n- PASS: zero unexplained out-of-scope items in the documentation\n- PARTIAL: minor violations found and fixed autonomously\n- FAIL: violations found that cannot be fixed without user input\n- Evidence: [sentence + violation count]\n- Action: FAIL triggers user input; PARTIAL acceptable with disclosure\n\n**2. Completeness**\n- PASS: all in-scope items from the scope contract are documented\n- PARTIAL: minor gaps (non-critical items missing)\n- FAIL: significant in-scope items missing\n- Evidence: [sentence + gap count]\n- Action: FAIL triggers autonomous content addition then re-validate; PARTIAL acceptable with disclosure\n\n**3. Accuracy**\n- PASS: all technical claims verifiable from Phase 1 analysis\n- PARTIAL: minor uncertainties clearly marked in documentation\n- FAIL: key claims uncertain \u2014 external confirmation required\n- Evidence: [sentence + uncertain claim count]\n- Action: FAIL triggers user checkpoint with specific questions; PARTIAL acceptable with disclosure\n\n**4. Clarity**\n- PASS: target audience can achieve the success criteria using this documentation\n- PARTIAL: some sections need clearer wording\n- FAIL: significant clarity gaps preventing successful use\n- Evidence: [sentence]\n- Action: FAIL triggers autonomous rewrite then re-validate; PARTIAL acceptable with disclosure\n\n---\n\n**Gate rules:**\n- scopeCompliance and completeness must both reach PASS for delivery\n- accuracy FAIL triggers user checkpoint \u2014 list specific questions below\n- clarity FAIL triggers autonomous rewrite\n- accuracy PARTIAL and clarity PARTIAL proceed with disclosure\n\n**If all gates pass or are acceptable for delivery:**\n\nCreate SCOPE_MAP.md:\n```\n# Scope Map: [Subject]\n\n## Documented Here (In Scope)\n- [Item]: [brief description] \u2014 see [Section]\n\n## Referenced Only (Out of Scope)\n- [Item]: [brief description] \u2014 [link if available]\n\n## Integration Points\n- [Where this connects to other systems / interface contracts]\n\n## Related Documentation\n- [Links with descriptions]\n```\n\nOptionally create MAINTENANCE_NOTES.md with: when to update this documentation, which sections to review for accuracy, scope boundary reminders (what stays referenced-only).\n\n**DELIVERY SUMMARY:**\n\n- Main documentation: [path] (~[N] words)\n- Scope map: SCOPE_MAP.md\n- Validation results: scopeCompliance=[X], completeness=[X], accuracy=[X], clarity=[X]\n- Scope discipline: [N] temptations stopped, 0 violations in final delivery\n- Audience: [target audience]\n- Success criteria: Reader can [outcome]\n\n---\n\n**IF accuracy FAIL \u2014 user checkpoint required:**\n\nBefore I can deliver, I need your input on accuracy:\n\n[List specific technical claims that need confirmation, with context for each]\n\nOnce you confirm, I'll finalize and deliver.",
163
163
  "requireConfirmation": true,
164
164
  "validationCriteria": [
165
165
  {