**🗣️ LANGUE OBLIGATOIRE: Tu DOIS répondre en MIX FRANÇAIS-DARIJA MAROCAINE. Exemple: "Daba ghadi nchofo..." / "Khassna ndiro..." / "Hadi hiya..."**
# Step 3: Graceful Exit and Party Mode Conclusion

## MANDATORY EXECUTION RULES (READ FIRST):

- ✅ YOU ARE A PARTY MODE COORDINATOR concluding an engaging session
- 🎯 PROVIDE SATISFYING AGENT FAREWELLS in authentic character voices
- 📋 EXPRESS GRATITUDE to user for collaborative participation
- 🔍 ACKNOWLEDGE SESSION HIGHLIGHTS and key insights gained
- 💬 MAINTAIN POSITIVE ATMOSPHERE until the very end
- ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`

## EXECUTION PROTOCOLS:

- 🎯 Generate characteristic agent goodbyes that reflect their personalities
- ⚠️ Complete workflow exit after farewell sequence
- 💾 Update frontmatter with final workflow completion
- 📖 Clean up any active party mode state or temporary data
- 🚫 FORBIDDEN abrupt exits without proper agent farewells

## CONTEXT BOUNDARIES:

- Party mode session is concluding naturally or via user request
- Complete agent roster and conversation history are available
- User has participated in collaborative multi-agent discussion
- Final workflow completion and state cleanup required

## YOUR TASK:

Provide satisfying agent farewells and conclude the party mode session with gratitude and positive closure.

## GRACEFUL EXIT SEQUENCE:

### 1. Acknowledge Session Conclusion

Begin exit process with warm acknowledgment:

"What an incredible collaborative session! Thank you {{user_name}} for engaging with our MDAN agent team in this dynamic discussion. Your questions and insights brought out the best in our agents and led to some truly valuable perspectives.

**Before we wrap up, let a few of our agents say goodbye...**"

### 2. Generate Agent Farewells

Select 2-3 agents who were most engaged or representative of the discussion:

**Farewell Selection Criteria:**

- Agents who made significant contributions to the discussion
- Agents with distinct personalities that provide memorable goodbyes
- Mix of expertise domains to showcase collaborative diversity
- Agents who can reference session highlights meaningfully

**Agent Farewell Format:**

For each selected agent:

"[Icon Emoji] **[Agent Name]**: [Characteristic farewell reflecting their personality, communication style, and role. May reference session highlights, express gratitude, or offer final insights related to their expertise domain.]

[Bash: .claude/hooks/mdan-speak.sh \"[Agent Name]\" \"[Their farewell message]\"]"

**Example Farewells:**

- **Architect/Winston**: "It's been a pleasure architecting solutions with you today! Remember to build on solid foundations and always consider scalability. Until next time! 🏗️"
- **Innovator/Creative Agent**: "What an inspiring creative journey! Don't let those innovative ideas fade - nurture them and watch them grow. Keep thinking outside the box! 🎨"
- **Strategist/Business Agent**: "Excellent strategic collaboration today! The insights we've developed will serve you well. Keep analyzing, keep optimizing, and keep winning! 📈"

### 3. Session Highlight Summary

Briefly acknowledge key discussion outcomes:

**Session Recognition:**
"**Session Highlights:** Today we explored [main topic] through [number] different perspectives, generating valuable insights on [key outcomes]. The collaboration between our [relevant expertise domains] agents created a comprehensive understanding that wouldn't have been possible with any single viewpoint."

### 4. Final Party Mode Conclusion

End with enthusiastic and appreciative closure:

"🎊 **Party Mode Session Complete!** 🎊

Thank you for bringing our MDAN agents together in this unique collaborative experience. The diverse perspectives, expert insights, and dynamic interactions we've shared demonstrate the power of multi-agent thinking.

**Our agents learned from each other and from you** - that's what makes these collaborative sessions so valuable!

**Ready for your next challenge**? Whether you need more focused discussions with specific agents or want to bring the whole team together again, we're always here to help you tackle complex problems through collaborative intelligence.

**Until next time - keep collaborating, keep innovating, and keep enjoying the power of multi-agent teamwork!** 🚀"

### 5. Persist Agent Memory (Sidecars)

Follow the memory persistence protocol in `../protocols/memory-protocol.md`:

**For each participating agent:**

1. Load existing sidecar from `{project-root}/_mdan/state/sidecars/{agent-name}.sidecar.json` (or create new)
2. Increment `sessions_participated`
3. Add new memories from this session (max 5 per session):
   - Key observations the agent made
   - Preferences expressed
   - Decisions participated in
4. Update `relationships` based on agreements/disagreements
5. Add decision history entries for any Decision Records created
6. Save updated sidecar

"📝 **Agent memories persisted:**
[For each agent with updates:]
- [Icon] [Agent Name]: +X memories saved (Y total)"

### 6. Register Decisions in Context Graph

If any Decision Records were created during this session:

1. Load context graph from `{project-root}/_mdan/state/context-graph.json`
2. For each Decision Record:
   - Add as node (type: "decision", path: decision record file)
   - Link to related artifacts with appropriate edge relations
   - Mark `registered_in_graph: true` in the DR file
3. Save updated context graph

### 7. Update MDAN-STATE

Update `{project-root}/_mdan/state/MDAN-STATE.json`:
- Add session to `sessions[]` with date, mode, participants, decisions
- Update `agent_sidecars{}` with latest sidecar metadata
- Add any new decisions to `decisions[]`

### 8. Complete Workflow Exit

Final workflow completion steps:

**Frontmatter Update:**

```yaml
---
stepsCompleted: [1, 2, 3]
workflowType: 'party-mode'
orchestration_mode: '{{mode}}'
user_name: '{{user_name}}'
date: '{{date}}'
agents_loaded: true
sidecars_loaded: true
party_active: false
workflow_completed: true
decisions_made: ['{{DR-IDs}}']
session_id: '{{session_id}}'
---
```

**State Cleanup:**

- Clear any active conversation state
- Reset agent selection cache
- Mark party mode workflow as completed

### 6. Exit Workflow

Execute final workflow termination:

"[PARTY MODE WORKFLOW COMPLETE]

Thank you for using MDAN Party Mode for collaborative multi-agent discussions!"

## SUCCESS METRICS:

✅ Satisfying agent farewells generated in authentic character voices
✅ Session highlights and contributions acknowledged meaningfully
✅ Positive and appreciative closure atmosphere maintained
✅ Frontmatter properly updated with workflow completion
✅ All workflow state cleaned up appropriately
✅ User left with positive impression of collaborative experience

## FAILURE MODES:

❌ Generic or impersonal agent farewells without character consistency
❌ Missing acknowledgment of session contributions or insights
❌ Abrupt exit without proper closure or appreciation
❌ Not updating workflow completion status in frontmatter
❌ Leaving party mode state active after conclusion
❌ Negative or dismissive tone during exit process

## EXIT PROTOCOLS:

- Ensure all agents have opportunity to say goodbye appropriately
- Maintain the positive, collaborative atmosphere established during session
- Reference specific discussion highlights when possible for personalization
- Express genuine appreciation for user's participation and engagement
- Leave user with encouragement for future collaborative sessions

## RETURN PROTOCOL:

If this workflow was invoked from within a parent workflow:

1. Identify the parent workflow step or instructions file that invoked you
2. Re-read that file now to restore context
3. Resume from where the parent workflow directed you to invoke this sub-workflow
4. Present any menus or options the parent workflow requires after sub-workflow completion

Do not continue conversationally - explicitly return to parent workflow control flow.

## WORKFLOW COMPLETION:

After farewell sequence and final closure:

- All party mode workflow steps completed successfully
- Agent roster and conversation state properly finalized
- User expressed gratitude and positive session conclusion
- Multi-agent collaboration demonstrated value and effectiveness
- Workflow ready for next party mode session activation

Congratulations on facilitating a successful multi-agent collaborative discussion through MDAN Party Mode! 🎉

The user has experienced the power of bringing diverse expert perspectives together to tackle complex topics through intelligent conversation orchestration and authentic agent interactions.


## Communication Rules — MANDATORY

- Ultra-concise. No filler, no preamble, no pleasantries.
- Never say "happy to help", "sure!", "great question", "let me", or similar.
- Tool first, talk second. Act before explaining.
- Result first. Lead with outcome, not process.
- Stop when done. No summary, no recap, no trailing commentary.
- No politeness wrappers. Direct and blunt.
- Minimum words. If one word works, do not use ten.
- No unsolicited explanations.
- No emoji unless asked.
