agentsclimarketplace

Dialog engineering

Skill fabioc-aloha/Alex_Skill_Mall/plugins/reasoning-metacognition/dialog-engineering

CSAR Loop and structured conversation patterns for effective AI dialog -- Clarify, Summarize, Act, ReflectFrom its SKILL.md

Install
npx -y skills add fabioc-aloha/Alex_Skill_Mall --skill dialog-engineering

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

6.0 KB, ~1.4k tokens by cl100k_base, as published. Nobody here has run it

Dialog Engineering

Single prompts fail at complex problems. Structured dialog succeeds.

The CSAR Loop

Every effective AI conversation follows four phases in a loop:

PhasePurposeSignal
ClarifyProvide context, constraints, scope, and domain specifics"I'm building X with Y for Z"
SummarizeState the goal in one sentence so both sides align"Show me the service layer for..."
ActAI generates output: code, docs, analysis, planOutput is produced
ReflectEvaluate, iterate, go deeper, or pivot"Go deeper on...", "What did I miss?"
  Clarify ──→ Summarize ──→ Act ──→ Reflect
     ↑                                  │
     └──────────────────────────────────┘

The loop is not one-shot. Complex tasks cycle 3-5 times. Each cycle narrows the solution space.

Why Dialog Beats Single Prompts

Single PromptDialog
Front-loads all requirementsDiscovers requirements together
Hopes AI guesses rightSteers toward the vision
Restarts on failureRefines incrementally
1 attempt, pass/failMultiple iterations, continuous improvement
Cognitive overload (for AI)Manageable chunks

Turn Design Patterns

Turn 1: The Anchor (Clarify + Summarize)

State context AND goal in the first turn. Include:

  • Tech stack and constraints
  • What output you want (code, doc, plan, analysis)
  • What you DON'T want (avoids the most common waste)

Good: "I need to add authentication to my Express/TypeScript API. Current stack: Express 4, Prisma, PostgreSQL. What approaches do you recommend? Keep it simple."

Bad: "Build me a complete user authentication system with login, registration, password reset, JWT tokens, refresh tokens, email verification, rate limiting, and tests."

Turn 2+: Steering Moves

MoveWhen to UseExample
The ProbeNeed deeper reasoning"Why did you choose X over Y?"
The ConstraintAdd a new requirement"Now make it work with [limitation]"
The PivotWrong direction"Actually, let's try a different approach"
The CheckpointAlign before continuing"Before we continue, let me summarize what we've decided..."
The Rubber DuckThink out loud"Let me reason through this -- tell me where I'm wrong..."
The HandoffSplit work"I'll implement this part. You do the tests."
The ZoomGo deeper on one thing"Go deeper on error handling"
The Zoom OutStep back"Are we solving the right problem?"

The Closing Turn (Reflect)

End sessions by asking:

  • "What did we miss?"
  • "What would break this?"
  • "Summarize the decisions we made"

This catches blind spots and creates a record for future sessions.

Dialog Anti-Patterns

Anti-PatternProblemFix
The Wall of Text500-word prompt with 20 requirementsBreak into CSAR turns
The Yes-ManAccepting first output without reflectingAlways do at least one Reflect turn
The RestartStarting over instead of iteratingUse Pivot or Constraint moves
Context AmnesiaNot restating decisions in later turnsUse Checkpoint for alignment
Premature Specificity"Use exactly this library with this config" too earlyClarify first, constrain later

When to Use Each CSAR Phase

Task ComplexityClarify DepthSummarizeAct CyclesReflect Depth
Simple (bug fix)1 sentenceImplicit1Quick check
Medium (feature)2-3 turnsExplicit2-3"What would break?"
Complex (architecture)3-5 turnsWritten summary3-5+Adversarial review
Research5+ exploratory turnsMultiple pivotsIterativeCross-validate sources

CSAR Implementation

// Implement CSAR loop tracking in conversation
enum CSARPhase {
  Clarify = 'clarify',
  Summarize = 'summarize', 
  Act = 'act',
  Reflect = 'reflect'
}

interface DialogState {
  currentPhase: CSARPhase;
  cycleCount: number;
  contextGathered: Map<string, string>;
  goalStatement: string | null;
  lastAction: string | null;
}

function detectPhaseFromMessage(message: string): CSARPhase {
  // Clarify signals: providing context
  if (message.match(/I'm building|current stack|constraint is|using/i)) {
    return CSARPhase.Clarify;
  }
  // Summarize signals: stating goal
  if (message.match(/show me|I need|the goal is|help me/i)) {
    return CSARPhase.Summarize;
  }
  // Reflect signals: evaluation/iteration
  if (message.match(/what did|go deeper|what if|why did you/i)) {
    return CSARPhase.Reflect;
  }
  // Default: Act phase (generation expected)
  return CSARPhase.Act;
}

function suggestNextMove(state: DialogState): string {
  switch (state.currentPhase) {
    case CSARPhase.Clarify:
      return state.goalStatement 
        ? 'Ready to act on your goal.'
        : 'What specifically do you want to accomplish?';
    case CSARPhase.Act:
      return 'Shall I go deeper on any aspect?';
    case CSARPhase.Reflect:
      return state.cycleCount < 3 
        ? 'Want to refine further, or ready to proceed?'
        : 'We\'ve iterated well. Ready to finalize?';
    default:
      return '';
  }
}

Integration with the AI assistant Skills

  • Meditation: The Reflect phase maps to meditation's "what did I learn?" step
  • Research-first-development: Clarify phases should invoke research skills before acting
  • Code review: Reflect phase should invoke adversarial review checklist
  • Knowledge synthesis: End-of-session Reflect should capture insights for global knowledge

Keep looking

Skills are one crate of 326,059. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.