chatroom-cli 1.99.0 → 1.99.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -78980,19 +78980,19 @@ function getDelegationBriefIntro() {
78980
78980
  var HANDOFF_NOT_APPLICABLE_EXACT_TEXT = "Not Applicable.";
78981
78981
 
78982
78982
  // ../../services/backend/prompts/utils/handoff-quality-principles.ts
78983
- function getHandoffQualityPrinciplesTemplateBlock() {
78983
+ function getHandoffQualityPrinciplesTemplateBlock(subject = "work") {
78984
78984
  const lines = HANDOFF_QUALITY_PRINCIPLES.flatMap((p) => [
78985
- `- **${p.name}:** <how this work demonstrates ${p.name.toLowerCase()}, or exactly "${HANDOFF_NOT_APPLICABLE_EXACT_TEXT}">`,
78985
+ `- **${p.name}:** <how this ${subject} demonstrates ${p.name.toLowerCase()}, or exactly "${HANDOFF_NOT_APPLICABLE_EXACT_TEXT}">`,
78986
78986
  `<!-- ${p.name}: ${p.description} -->`,
78987
78987
  ""
78988
78988
  ]);
78989
78989
  return lines.join(`
78990
78990
  `).trimEnd();
78991
78991
  }
78992
- function getHandoffQualityPrinciplesSectionBlock() {
78992
+ function getHandoffQualityPrinciplesSectionBlock(subject = "work") {
78993
78993
  return `${PROOF_OF_PRINCIPLES_HEADING_H2}
78994
78994
  ${PROOF_OF_PRINCIPLES_MANDATORY_COMMENT}
78995
- ${getHandoffQualityPrinciplesTemplateBlock()}`;
78995
+ ${getHandoffQualityPrinciplesTemplateBlock(subject)}`;
78996
78996
  }
78997
78997
  var HANDOFF_QUALITY_PRINCIPLES, PROOF_OF_PRINCIPLES_HEADING_H2 = "## Proof of Principles", PROOF_OF_PRINCIPLES_MANDATORY_COMMENT;
78998
78998
  var init_handoff_quality_principles = __esm(() => {
@@ -79087,163 +79087,195 @@ var init_builder_to_planner = __esm(() => {
79087
79087
  init_role_guidance_disclosure();
79088
79088
  });
79089
79089
 
79090
- // ../../services/backend/prompts/enhancer/defragmentation-reference.ts
79091
- function renderDefragmentationHandoffReference() {
79092
- return [
79093
- "### Defragmentation workflow checklist",
79094
- 'Complete the optional **Defragmentation** section when the planner check-in addresses a large or multi-surface system revision, including refactoring, consolidation, or consistency work. Write exactly "Not Applicable." only when no such revision is proposed.',
79095
- "",
79096
- "1. **Study surfaces** — map all call sites, use cases, and complexity variants before proposing slices; name every relevant file/module",
79097
- "2. **Golden implementation** — build a standalone canonical solution first; introduce canonical domain entities/types only when the studied variants require them, then shared use cases, UI components, or utilities; do not patch duplicates in place",
79098
- "3. **Migrate callers** — refactor all consumers to the golden path; each slice must be shippable end-to-end",
79099
- "4. **Delete legacy** — remove old implementations only after migration is complete; no dead-code leftovers",
79100
- "",
79101
- "### Anti-patterns to flag",
79102
- "- Incremental copy-paste fixes across N files without a golden SSOT",
79103
- "- New abstraction without studying all existing variants",
79104
- '- Leaving old code "for safety" after migration',
79105
- "- Slices that add helpers/infra without a runnable end-to-end outcome",
79106
- "- Parallel implementations coexisting without a deletion plan",
79107
- "",
79108
- "### Structural decisions",
79109
- "- Identify SSOT locations for domain entities, shared use cases, and UI components",
79110
- "- Align with `structural-decisions` glossary: folder structure, file naming, interface locations",
79111
- "- Flag when the plan scatters the canonical implementation across unrelated modules"
79112
- ].join(`
79113
- `);
79114
- }
79090
+ // ../../services/backend/src/domain/usecase/enhancer/enhancer-handoff-content.ts
79091
+ var ENHANCER_USER_MESSAGE_PLACEHOLDER = "{{USER_MESSAGE}}";
79115
79092
 
79116
- // ../../services/backend/prompts/enhancer/webapp-ux-reference.ts
79117
- function renderWebappUxHandoffReference() {
79118
- return [
79119
- "### UX review checklist",
79120
- 'Complete the optional **UX** section in your output when the planner proposes UI changes. Write exactly "Not Applicable." for non-UI tasks. Put code snippets in **Suggested edits** only.',
79121
- "",
79122
- "1. **Flows** — is the primary path straightforward? simpler alternatives exist?",
79123
- "2. **Patterns** — consistent with existing project components and conventions? recommend one when multiple exist.",
79124
- "3. **Layout** — unnecessary complexity or wrappers? layout stable across loading/empty/error transitions (no layout shift when async content arrives or state changes)?",
79125
- "4. **Shortcuts** — aligned with the project keyboard/shortcut conventions? gaps or conflicts?",
79126
- "5. **States** — loading, error, and empty states explicitly handled for async surfaces (no blank panels, silent failures, or missing retry affordances)?",
79127
- "6. **Error boundaries** — failures scoped so one subtree does not crash the whole app?",
79128
- "7. **Feedback** — timely response for async user actions?",
79129
- "8. **Interaction affordance** — clickable/interactive elements use pointer cursor (or the project's established equivalent) where applicable?",
79130
- "9. **Destructive actions** — irreversible or high-impact single actions gated by confirmation?",
79131
- "10. **Bulk actions** — batch/multi-item operations confirmed with scope or impact summary?",
79132
- "",
79133
- "### Review principles",
79134
- "- Ground feedback in the planner check-in and the project codebase — cite existing patterns rather than inventing generic UI preferences.",
79135
- "- Flag missing states, layout-shift risk, and missing interaction affordances when the plan omits them; recommend consistency with established project conventions.",
79136
- "- Do **not** prescribe style choices the project has not adopted (e.g. specific flex layouts, canonical card chrome, responsive utility patterns, button label copy).",
79137
- "- When multiple valid patterns exist in the codebase, recommend one and explain the tradeoff."
79138
- ].join(`
79139
- `);
79093
+ // ../../services/backend/prompts/utils/frontend-design-ux-checklist.ts
79094
+ function getFrontendDesignUxPlanningPrinciplesBlock() {
79095
+ return `<!-- Ground every flow in user history and repository patterns. Recommend one existing pattern when multiple exist; do not prescribe style choices the project has not adopted. -->`;
79096
+ }
79097
+ function getFrontendDesignUxFlowChecklistBlock() {
79098
+ return `**UX quality (complete for every interactive step in this flow):**
79099
+ - **States:** loading | empty | error | success — no blank panels, silent failures, or missing retry affordances
79100
+ - **Layout:** stable across async transitions — no layout shift when content arrives or state changes
79101
+ - **Patterns:** consistent with existing project components — cite the chosen pattern and repo-relative file
79102
+ - **Shortcuts:** aligned with project keyboard/shortcut conventions; document tab order and gaps
79103
+ - **Feedback:** timely response for async user actions
79104
+ - **Interaction affordance:** pointer cursor (or project equivalent) on clickable elements
79105
+ - **Safeguards:** confirmation before destructive actions; bulk operations confirmed with scope summary`;
79140
79106
  }
79141
79107
 
79142
79108
  // ../../services/backend/prompts/utils/enhancer-feedback-template-body.ts
79143
79109
  function getEnhancerFeedbackTemplateBody() {
79144
79110
  return `<handoff-overview>
79145
79111
  ## Summary
79146
- <overall assessment — cite specific strengths, risks, and whether the approach is sound; reference concrete elements from the check-in>
79112
+ <one paragraph: what we're building and the single design direction>
79147
79113
 
79148
- ## User intent alignment
79149
- <specific misreadings or missing constraints — what the user asked vs what the planner proposed>
79114
+ ## User intent and constraints
79115
+ <explicit requirements from user messages; hard constraints that must not be violated>
79150
79116
  </handoff-overview>
79151
79117
 
79152
- <!-- UI collapses proofs, direction, ux, defragmentation, and notes by default; overview and action required are expanded -->
79118
+ <!-- UI collapses proofs, direction, frontend design, data design, and notes by default; overview and action required are expanded -->
79153
79119
 
79154
79120
  <handoff-proofs>
79155
- ## Reasoning review
79156
- <specific logical errors, weak inference, or contradictions — cite the claim and why it fails>
79121
+ ## Repository evidence
79122
+ <files read, current behavior verified, patterns reused — cite repo-relative paths and short snippets only>
79123
+
79124
+ ${getHandoffQualityPrinciplesSectionBlock("design")}
79157
79125
  </handoff-proofs>
79158
79126
 
79159
79127
  <handoff-direction>
79160
- ## Alignment with eventual user handoff
79161
- <specific gaps for user-facing completeness — what proof or report sections would be missing>
79128
+ ## Recommended design
79129
+ <!-- ONE design only. No Option A/B/C. -->
79130
+
79131
+ <2–4 sentences: the chosen architecture and why it fits the request and existing system>
79162
79132
  </handoff-direction>
79163
79133
 
79164
- <handoff-ux>
79165
- <!-- Optional — write exactly "Not Applicable." when no UI changes are proposed -->
79166
- <!-- When UI is proposed: specific findings tied to the planner's proposal. No code blocks (use Suggested edits). -->
79167
- - **Flows:** <click count, nested modals, simpler alternatives>
79168
- - **Patterns:** <consistency with existing project components; recommend one when multiple>
79169
- - **Layout:** <complexity, wrappers, layout stable across state transitions — no layout shift>
79170
- - **Shortcuts:** <alignment with catalog; gaps or conflicts>
79171
- - **States:** <loading/error/empty explicitly handled; no blank panels or silent failures>
79172
- - **Error boundaries:** <error boundary placement; failure isolated from the whole app>
79173
- - **Feedback:** <timely response for async actions>
79174
- - **Interaction affordance:** <pointer cursor or project equivalent on clickable elements where applicable>
79175
- - **Destructive safeguards:** <confirmation before irreversible/high-impact actions>
79176
- - **Bulk safeguards:** <confirmation with scope summary for batch operations>
79177
- </handoff-ux>
79178
-
79179
- <handoff-defragmentation>
79180
- <!-- Optional — write exactly "Not Applicable." when no large or multi-surface system revision is proposed -->
79181
- <!-- When revision work is proposed: specific findings tied to the planner's proposal. No code blocks (use Suggested edits). -->
79182
- - **Surfaces:** <call sites and modules identified; gaps in surface mapping>
79183
- - **Golden path:** <whether planner builds standalone canonical implementation first>
79184
- - **Domain model:** <canonical types/entities needed or "not needed">
79185
- - **Shared components:** <shared abstractions planned (use cases, UI, utilities)>
79186
- - **Slice ordering:** <study → golden → migrate → delete sequence respected?>
79187
- - **Migration plan:** <how all callers move to golden path>
79188
- - **Deletion plan:** <old implementations slated for removal>
79189
- - **Duplication:** <existing duplicates to eliminate; risk of new duplication>
79190
- - **Structural decisions:** <folder/module boundaries; SSOT locations>
79191
- </handoff-defragmentation>
79134
+ <handoff-frontend-design>
79135
+ ## Frontend / user-centric design
79192
79136
 
79193
- <handoff-notes>
79194
- ## Knowledge gaps
79195
- <specific facts, files, or research to verify — name what to check and why>
79196
- </handoff-notes>
79137
+ ${getFrontendDesignUxPlanningPrinciplesBlock()}
79197
79138
 
79198
- <handoff-action>
79199
- ## Risks & failure modes
79200
- <specific risks tied to this plan — what fails, under what conditions, and how to mitigate>
79139
+ ### Flow 1: <name>
79140
+ **Entry:** User visits \`<route/page>\` from \`<source>\`.
79201
79141
 
79202
- ## Recommendations
79203
- <!-- SECOND-LAST — concrete, actionable suggestions tied to the check-in. Include tradeoffs and considerations. No code blocks here (use Suggested edits for snippets). -->
79142
+ | Step | User action | System response | UI state |
79143
+ |------|-------------|-----------------|----------|
79144
+ | 1 | User clicks \`<element label>\` | \`<navigation / modal / fetch>\` | \`<loading → success/error>\` |
79204
79145
 
79205
- ## Suggested edits (remove or change only)
79206
- <!-- LAST — proposed edits to grounding and builder-handoff. File paths and code snippets required when recommending changes. Omit entirely if none. -->
79207
- When you recommend removing or changing specific content in the planner's check-in, list each change here with file-level detail and code examples.
79208
- ${getFileReferenceGuidanceComment()}
79146
+ ${getFrontendDesignUxFlowChecklistBlock()}
79147
+
79148
+ **Expected interactions per element:**
79149
+ - \`<ElementName>\` (\`apps/webapp/src/...\`): click → \`<handler>\`; keyboard: \`<tab order>\`; disabled when \`<condition>\`
79150
+
79151
+ ### Element, style, and layout specification
79209
79152
 
79210
- ### <section or claim to remove or change>
79211
- **File:** \`apps/webapp/src/path/to/file.ts\`
79212
- **Change:** <what to remove, replace, or correct and why>
79153
+ #### \`<ComponentName>\` — \`apps/webapp/src/path/to/Component.tsx\`
79154
+ **Change:** <create | modify>
79155
+
79156
+ **Layout:** \`<div className="...">\` — flex/grid, gaps, breakpoints
79157
+
79158
+ **States:** loading | empty | error | success
79159
+
79160
+ \`\`\`tsx
79161
+ export function ComponentName({ ... }: Props) {
79162
+ // target structure — props, classNames, branches
79163
+ }
79164
+ \`\`\`
79165
+
79166
+ <!-- Repeat per component; write exactly "Not Applicable." for the entire section if no UI -->
79167
+ </handoff-frontend-design>
79168
+
79169
+ <handoff-data-design>
79170
+ ## Persistent state and query pattern design
79171
+
79172
+ **Goal:** Small updates must not cause large cache invalidations. High-frequency writes use projections to smaller tables.
79173
+
79174
+ ### 1. Sources of concern
79175
+ | Source | Write frequency | Read pattern | Risk |
79176
+ |--------|---------------|--------------|------|
79177
+ | \`<table/mutation>\` | \`<frequency>\` | \`<pattern>\` | \`<scan / hot partition>\` |
79178
+
79179
+ ### 2. Schema design
79180
+ **Hot path:** \`<table>\` — fields, projection from \`<source>\`
79181
+ **Cold path:** \`<table>\` — …
79182
+
79183
+ \`\`\`typescript
79184
+ // target schema shape
79185
+ \`\`\`
79186
+
79187
+ ### 3. Index design (within limits)
79188
+ | Table | Index | Serves query | Budget |
79189
+ |-------|-------|--------------|--------|
79190
+
79191
+ ### 4. Query design (within limits)
79192
+ | Query | Index | Rows scanned | Timeout | Invalidation scope |
79193
+ |-------|-------|--------------|---------|-------------------|
79213
79194
 
79214
79195
  \`\`\`typescript
79215
- // Code snippet: what should change, be removed, or what the planner got wrong
79196
+ // target query signature
79216
79197
  \`\`\`
79217
79198
 
79218
- (Add one ### block per distinct removal or change. Use repo-relative paths with file extensions.)
79199
+ <!-- Write exactly "Not Applicable." for the entire section if no persistence changes -->
79200
+ </handoff-data-design>
79201
+
79202
+ <handoff-notes>
79203
+ ## Open questions for user
79204
+ <decisions only the user can make, or write "Not Applicable.">
79205
+ </handoff-notes>
79206
+
79207
+ <handoff-action>
79208
+ ## Recommended implementation sequence
79209
+ <!-- Ordered slices for the planner — references files from design sections. For large or multi-surface revisions, activate the defragmentation skill before delegating. -->
79210
+
79211
+ 1. …
79212
+ 2. …
79213
+
79214
+ ## Files touched (index)
79215
+ - \`apps/webapp/src/...\` — …
79216
+ - \`services/backend/convex/...\` — …
79219
79217
  </handoff-action>`;
79220
79218
  }
79221
- var init_enhancer_feedback_template_body = () => {};
79219
+ var init_enhancer_feedback_template_body = __esm(() => {
79220
+ init_handoff_quality_principles();
79221
+ });
79222
79222
 
79223
- // ../../services/backend/prompts/teams/duo/handoff-templates/enhancer-to-planner.ts
79224
- function getEnhancerToPlannerHandoffTemplate() {
79225
- return `${getHandoffRecipientVisibilityCallout("planner")}
79223
+ // ../../services/backend/prompts/enhancer/handoff-templates.ts
79224
+ function roleLabel(role) {
79225
+ return role.charAt(0).toUpperCase() + role.slice(1).toLowerCase();
79226
+ }
79227
+ function getEntryPointToEnhancerHandoffTemplate(entryPointRole) {
79228
+ const label = roleLabel(entryPointRole);
79229
+ return `**Planning Request (${label} → Enhancer)** — after reading the user message and any pinned chatroom context, fill only <additional-context> below. The system injects the user message automatically — do not copy it.
79226
79230
 
79227
- ${getHandoffReportTemplateIntro("Planning Feedback (Enhancer → Planner)")}
79231
+ \`\`\`markdown
79232
+ <user-message>
79233
+ <!-- Injected automatically from the originating user message — do not edit or copy the user message here -->
79234
+ ${ENHANCER_USER_MESSAGE_PLACEHOLDER}
79235
+ </user-message>
79228
79236
 
79229
- The planner sent you three XML sections. Your job is **advisory adversarial review** — raise risks, challenge assumptions, align with user intent. Be **specific and targeted**: cite concrete claims, files, UX choices, and gaps from the check-in so the planner can improve the plan without re-synthesizing vague feedback.
79237
+ <additional-context>
79238
+ ## Goal
79239
+ <what the user wants in plain language — one short paragraph>
79240
+ </additional-context>
79241
+ \`\`\`
79230
79242
 
79231
- Give **concrete, actionable recommendations** in every section. End with **Recommendations** (second-last: summarized suggestions, tradeoffs, and considerations) then **Suggested edits** (last: proposed edits to grounding and the builder-handoff with file paths and code snippets). For UI work, complete the optional **UX** section using the reference below. For large or multi-surface revision work, complete the optional **Defragmentation** section using its reference below. **Do not rewrite their full builder brief.** The planner makes the final call.
79243
+ After handoff succeeds, **end your turn immediately**. The enhancer independently downloads the originating message history and returns design input as your next ${entryPointRole.toLowerCase()} task.`;
79244
+ }
79245
+ function getEnhancerToEntryPointHandoffTemplate(entryPointRole) {
79246
+ const normalizedRole = entryPointRole.toLowerCase();
79247
+ const label = roleLabel(entryPointRole);
79248
+ return `**Design Input (Enhancer → ${label})**
79232
79249
 
79233
- ${renderWebappUxHandoffReference()}
79250
+ You are the design authority for this request. Recover conversation history, inspect the repository, and return **one** complete design — not options. The ${normalizedRole} agent verifies your design and delegates implementation.
79234
79251
 
79235
- ${renderDefragmentationHandoffReference()}
79252
+ **Rules:**
79253
+ - Design first — complete frontend and data/query sections before implementation sequencing.
79254
+ - **No alternative approaches** — one \`Recommended design\` only.
79255
+ - Frontend and data sections: code granularity (component names, props, classes, file paths, schema, indexes, queries).
79256
+ - Complete per-flow **UX quality** checklist in frontend design — states, layout stability, patterns, safeguards.
79257
+ - For large or multi-surface revisions, note in implementation sequence that the entry point should activate the \`defragmentation\` skill.
79258
+ - In \`<handoff-proofs>\`, complete **Proof of Principles** for how this design satisfies each quality principle (or "Not Applicable.").
79259
+ - Write "Not Applicable." only when a major design section truly does not apply.
79236
79260
 
79237
79261
  \`\`\`markdown
79238
79262
  ${getEnhancerFeedbackTemplateBody()}
79239
79263
  \`\`\`
79240
79264
 
79241
- Return only the feedback markdown — no preamble. Follow this structure; omit sections that truly do not apply.`;
79265
+ Return only the design input markdown — no preamble. Follow this structure; use "Not Applicable." where a major section does not apply.`;
79242
79266
  }
79243
- var init_enhancer_to_planner = __esm(() => {
79267
+ var init_handoff_templates = __esm(() => {
79244
79268
  init_enhancer_feedback_template_body();
79245
79269
  });
79246
79270
 
79271
+ // ../../services/backend/prompts/teams/duo/handoff-templates/enhancer-to-planner.ts
79272
+ function getEnhancerToPlannerHandoffTemplate() {
79273
+ return getEnhancerToEntryPointHandoffTemplate("planner");
79274
+ }
79275
+ var init_enhancer_to_planner = __esm(() => {
79276
+ init_handoff_templates();
79277
+ });
79278
+
79247
79279
  // ../../services/backend/prompts/teams/duo/handoff-templates/planner-to-builder.ts
79248
79280
  function getPlannerToBuilderHandoffTemplate() {
79249
79281
  return `${getHandoffRecipientVisibilityCallout("builder")}
@@ -79322,40 +79354,11 @@ var init_planner_to_builder = () => {};
79322
79354
 
79323
79355
  // ../../services/backend/prompts/teams/duo/handoff-templates/planner-to-enhancer.ts
79324
79356
  function getPlannerToEnhancerHandoffTemplate() {
79325
- return `${getHandoffRecipientVisibilityCallout("enhancer")}
79326
-
79327
- **Mandatory Planning Check-in (Planner → Enhancer)** — paste into the handoff message. **Do not skip this check-in** when the enhancer is enabled.
79328
-
79329
- The enhancer starts from this check-in — it may read files in the repo to verify your grounding. Use the three XML sections below **exactly** — they delimit what the enhancer will review.
79330
-
79331
- \`\`\`markdown
79332
- <user-message>
79333
- <verbatim or faithful quote of the user's request — include constraints, priorities, and classification context if relevant>
79334
- </user-message>
79335
-
79336
- <grounding>
79337
- <fully detailed research — include file paths and snippets the enhancer should verify; it may read the codebase to validate your proposal>
79338
-
79339
- Include:
79340
- - **Existing code examples** — relevant snippets, patterns, and conventions already in the codebase
79341
- - **File references** — paths to every file you investigated or plan to change
79342
- - **Technology choices** — libraries, frameworks, APIs, and why they apply here
79343
- - **Observations** — what you learned, edge cases, risks, and open questions from investigation
79344
- ${getFileReferenceGuidanceComment()}
79345
- </grounding>
79346
-
79347
- <builder-handoff>
79348
- <your complete, filled-in Delegation Brief for builder review — every section with real content, not placeholders>
79349
-
79350
- Follow the **Handoff to \`builder\`** template structure (Summary, Goal, approach, Requirements, etc.). The enhancer reviews **approach and scope** — not line-by-line file edits. Keep file references for context, but expect advisory feedback on risks and gaps, not a rewritten brief.
79351
- </builder-handoff>
79352
- \`\`\`
79353
-
79354
- After handoff succeeds, **end your turn immediately** — do not monitor the enhancer or wait in this session. When review completes, enhancer → planner handoff delivers feedback as your next planner task.
79355
-
79356
- After you receive that feedback, you make the **final call** — incorporate valid critiques, ignore what doesn't apply, then proceed to \`builder\` or \`user\`. Do not re-check with the enhancer for this slice; one round only.`;
79357
+ return getEntryPointToEnhancerHandoffTemplate("planner");
79357
79358
  }
79358
- var init_planner_to_enhancer = () => {};
79359
+ var init_planner_to_enhancer = __esm(() => {
79360
+ init_handoff_templates();
79361
+ });
79359
79362
 
79360
79363
  // ../../services/backend/prompts/utils/context-disclosure.ts
79361
79364
  function getContextReadDisclosureComment(params = {}) {
@@ -79533,7 +79536,7 @@ function getDuoHandoffTemplate(query) {
79533
79536
  return getter?.(query) ?? null;
79534
79537
  }
79535
79538
  var DUO_HANDOFF_TEMPLATES;
79536
- var init_handoff_templates = __esm(() => {
79539
+ var init_handoff_templates2 = __esm(() => {
79537
79540
  init_builder_to_planner();
79538
79541
  init_enhancer_to_planner();
79539
79542
  init_planner_to_builder();
@@ -79576,9 +79579,12 @@ function getSoloHandoffTemplate(query) {
79576
79579
  return getter?.(query) ?? null;
79577
79580
  }
79578
79581
  var SOLO_HANDOFF_TEMPLATES;
79579
- var init_handoff_templates2 = __esm(() => {
79582
+ var init_handoff_templates3 = __esm(() => {
79580
79583
  init_solo_to_user();
79584
+ init_handoff_templates();
79581
79585
  SOLO_HANDOFF_TEMPLATES = {
79586
+ "solo:enhancer": () => getEntryPointToEnhancerHandoffTemplate("solo"),
79587
+ "enhancer:solo": () => getEnhancerToEntryPointHandoffTemplate("solo"),
79582
79588
  "solo:user": (query) => getSoloToUserReportTemplate({
79583
79589
  chatroomId: query.chatroomId,
79584
79590
  role: query.role,
@@ -79596,9 +79602,9 @@ function getHandoffTemplate(query) {
79596
79602
  return getSoloHandoffTemplate(query);
79597
79603
  return null;
79598
79604
  }
79599
- var init_handoff_templates3 = __esm(() => {
79600
- init_handoff_templates();
79605
+ var init_handoff_templates4 = __esm(() => {
79601
79606
  init_handoff_templates2();
79607
+ init_handoff_templates3();
79602
79608
  });
79603
79609
 
79604
79610
  // ../../services/backend/prompts/cli/handoff/view-template.ts
@@ -79615,7 +79621,7 @@ function viewHandoffTemplate(params) {
79615
79621
  return template;
79616
79622
  }
79617
79623
  var init_view_template2 = __esm(() => {
79618
- init_handoff_templates3();
79624
+ init_handoff_templates4();
79619
79625
  });
79620
79626
 
79621
79627
  // src/commands/handoff/view-template.ts
@@ -79780,9 +79786,12 @@ function formatDecodeError(error) {
79780
79786
 
79781
79787
  // ../../services/backend/prompts/native/session-continuity.ts
79782
79788
  function getNativeHandoffTurnEndGuidance(nextRole) {
79789
+ return getHandoffTurnEndGuidance(nextRole);
79790
+ }
79791
+ function getHandoffTurnEndGuidance(nextRole) {
79783
79792
  const lines = [
79784
79793
  "",
79785
- "**Handoff must be your last action this turn.** After running handoff, **End your turn now** — stop tool calls. Your session stays active."
79794
+ "**Handoff complete. End your turn now — stop tool calls. The system will send you a message when further action is required.**"
79786
79795
  ];
79787
79796
  if (nextRole.toLowerCase() === "user") {
79788
79797
  lines.push("The system delivers the next chatroom task when the user sends one.");
@@ -79792,11 +79801,11 @@ function getNativeHandoffTurnEndGuidance(nextRole) {
79792
79801
  return lines.join(`
79793
79802
  `);
79794
79803
  }
79795
- function getNativeEnhancerCheckInTurnEndGuidance() {
79804
+ function getNativeEnhancerRequestTurnEndGuidance() {
79796
79805
  return [
79797
79806
  "",
79798
- "**Handoff must be your last action this turn.** After running handoff, **End your turn now** — stop tool calls. Your session stays active.",
79799
- "Do **not** wait for enhancer feedback, poll, or monitor the enhancer job in this turn. The system delivers enhancer feedback as your next planner task when review completes."
79807
+ "**Handoff complete. End your turn now — stop tool calls. The system will send you a message when further action is required.**",
79808
+ "Do **not** wait for enhancer input, poll, or monitor the enhancer job in this turn. The system delivers independent planning input as your next task when analysis completes."
79800
79809
  ].join(`
79801
79810
  `);
79802
79811
  }
@@ -79826,10 +79835,14 @@ var init_backlog = __esm(() => {
79826
79835
  // ../../services/backend/src/domain/usecase/skills/modules/code-review/index.ts
79827
79836
  var init_code_review = () => {};
79828
79837
 
79838
+ // ../../services/backend/src/domain/usecase/skills/modules/defragmentation/index.ts
79839
+ var init_defragmentation = () => {};
79840
+
79829
79841
  // ../../services/backend/src/domain/usecase/skills/registry.ts
79830
79842
  var init_registry4 = __esm(() => {
79831
79843
  init_backlog();
79832
79844
  init_code_review();
79845
+ init_defragmentation();
79833
79846
  });
79834
79847
 
79835
79848
  // ../../services/backend/prompts/sections/glossary.ts
@@ -79866,7 +79879,8 @@ var init_glossary = __esm(() => {
79866
79879
  },
79867
79880
  {
79868
79881
  term: "structural-decisions",
79869
- definition: "Meta-level architectural choices that persist in the codebase and influence consistency: " + "folder structure, file naming, interface definitions, and key abstraction names/locations " + "(e.g., Repository/Service layers)."
79882
+ definition: "Meta-level architectural choices that persist in the codebase and influence consistency: " + "folder structure, file naming, interface definitions, and key abstraction names/locations " + "(e.g., Repository/Service layers).",
79883
+ linkedSkillId: "defragmentation"
79870
79884
  }
79871
79885
  ];
79872
79886
  NATIVE_GLOSSARY_TERMS = [
@@ -80225,15 +80239,15 @@ var init_types = __esm(() => {
80225
80239
  // ../../services/backend/prompts/review-guidelines/index.ts
80226
80240
  var init_review_guidelines = () => {};
80227
80241
  // ../../services/backend/prompts/generator.ts
80228
- function isEnhancerCheckInQueuedHandoff(params) {
80229
- return params.enhancerCheckInQueued === true && params.role.toLowerCase() === "planner" && params.nextRole.toLowerCase() === "enhancer";
80242
+ function isEnhancerRequestQueuedHandoff(params) {
80243
+ return params.enhancerRequestQueued === true && params.nextRole.toLowerCase() === "enhancer";
80230
80244
  }
80231
- function getEnhancerCheckInQueuedConfirmationLines(nativeIntegration) {
80232
- const turnEndRule = nativeIntegration ? "**End your turn now** — do not wait for feedback, poll, monitor the enhancer, or re-submit the handoff. The system delivers enhancer feedback as your next planner task when review completes." : "**Run get-next-task now and end your turn** — do not wait for feedback, poll, monitor the enhancer, or re-submit the handoff.";
80245
+ function getEnhancerRequestQueuedConfirmationLines(nativeIntegration) {
80246
+ const turnEndRule = nativeIntegration ? "**Handoff complete. End your turn now — stop tool calls. The system will send you a message when further action is required.** Do **not** wait for enhancer input, poll, monitor the enhancer, or re-submit the handoff. The system delivers independent planning input as your next task when analysis completes." : "**Run get-next-task now and end your turn — stop tool calls. The system will send you a message when further action is required.** Do **not** wait for enhancer input, poll, monitor the enhancer, or re-submit the handoff.";
80233
80247
  return [
80234
- "✅ Planning check-in queued for handoff enhancer",
80248
+ "✅ User request queued for handoff enhancer",
80235
80249
  "",
80236
- "Your check-in was sent to the handoff enhancer (async). You will receive planning feedback back as a planner task when review completes.",
80250
+ "The user request was sent to the handoff enhancer (async). You will receive independent planning input as your next task when analysis completes.",
80237
80251
  turnEndRule
80238
80252
  ];
80239
80253
  }
@@ -80244,24 +80258,28 @@ function generateHandoffOutput(params) {
80244
80258
  chatroomId,
80245
80259
  convexUrl,
80246
80260
  supportsNativeIntegration,
80247
- enhancerCheckInQueued
80261
+ enhancerRequestQueued
80248
80262
  } = params;
80249
80263
  const cliEnvPrefix = getCliEnvPrefix(convexUrl);
80250
- const enhancerCheckIn = isEnhancerCheckInQueuedHandoff({ role, nextRole, enhancerCheckInQueued });
80264
+ const enhancerRequest = isEnhancerRequestQueuedHandoff({
80265
+ nextRole,
80266
+ enhancerRequestQueued
80267
+ });
80251
80268
  const lines = [];
80252
- if (enhancerCheckIn) {
80253
- lines.push(...getEnhancerCheckInQueuedConfirmationLines(supportsNativeIntegration));
80269
+ if (enhancerRequest) {
80270
+ lines.push(...getEnhancerRequestQueuedConfirmationLines(supportsNativeIntegration));
80254
80271
  } else {
80255
80272
  lines.push(`✅ Chatroom task completed and handed off to ${nextRole}`);
80256
80273
  }
80257
80274
  if (supportsNativeIntegration) {
80258
- lines.push(enhancerCheckIn ? getNativeEnhancerCheckInTurnEndGuidance() : getNativeHandoffTurnEndGuidance(nextRole));
80275
+ lines.push(enhancerRequest ? getNativeEnhancerRequestTurnEndGuidance() : getNativeHandoffTurnEndGuidance(nextRole));
80259
80276
  } else {
80260
80277
  lines.push("");
80261
80278
  lines.push("✅ Level B complete (chatroom task handed off).");
80262
80279
  lines.push("⏳ Level A continues (session is still active) — run get-next-task to stay connected:");
80263
80280
  lines.push("");
80264
80281
  lines.push(`\`${getNextTaskCommand({ chatroomId, role, cliEnvPrefix })}\``);
80282
+ lines.push(getHandoffTurnEndGuidance(nextRole));
80265
80283
  }
80266
80284
  return lines.join(`
80267
80285
  `);
@@ -80419,7 +80437,7 @@ var handoffEffect = (chatroomId, options) => exports_Effect.gen(function* () {
80419
80437
  chatroomId,
80420
80438
  convexUrl,
80421
80439
  supportsNativeIntegration: result.supportsNativeIntegration,
80422
- enhancerCheckInQueued: result.enhancerJobId != null
80440
+ enhancerRequestQueued: result.enhancerJobId != null
80423
80441
  }));
80424
80442
  });
80425
80443
  });
@@ -134297,4 +134315,4 @@ program2.hook("preAction", async (_thisCommand, actionCommand) => {
134297
134315
  });
134298
134316
  program2.parse();
134299
134317
 
134300
- //# debugId=D5DF842800E395EE64756E2164756E21
134318
+ //# debugId=6F8892900A69B55764756E2164756E21