name: collab-cleanup description: Close out a collab session - archive or delete design artifacts user-invocable: false
Collab Cleanup
Browser-Based Questions
When a collab session is active, use render_ui for all user interactions.
Component selection:
| Question Type | Component |
|---|---|
| Yes/No | Card with action buttons |
| Choose 1 of 2-5 | RadioGroup |
| Choose 1 of 6+ | MultipleChoice |
| Free text | TextInput or TextArea |
Example - Yes/No:
Tool: mcp__plugin_mermaid-collab_mermaid__render_ui
Args: {
"project": "<cwd>",
"session": "<session>",
"ui": {
"type": "Card",
"props": { "title": "<question context>" },
"children": [{ "type": "Markdown", "props": { "content": "<question>" } }],
"actions": [
{ "id": "yes", "label": "Yes", "primary": true },
{ "id": "no", "label": "No" }
]
},
"blocking": true
}
Terminal prompts only when: No collab session exists (pre-session selection).
Overview
Close a collab session after development is complete. Offers choices to archive design artifacts, delete them, or keep the session open for reference.
Announce at start: "I'm using the collab-cleanup skill to close this session."
Workflow
Step 1: Identify Current Session
- Call
mcp__plugin_mermaid-collab_mermaid__list_sessionsto get all sessions across projects:Tool: mcp__plugin_mermaid-collab_mermaid__list_sessions Args: {} - Filter results to current project (match
projectfield against absolute cwd path) - If sessions found for current project:
- For each session, fetch phase via
mcp__plugin_mermaid-collab_mermaid__get_session_state:Tool: mcp__plugin_mermaid-collab_mermaid__get_session_state Args: { "project": "<cwd>", "session": "<session-name>" } - Display list with phases:
Sessions in this project: 1. glowing-sunny-mesa (phase: rough-draft) 2. bright-calm-river (phase: implementation) - Ask: "Which session to clean up?" (or if only one, confirm it)
- For each session, fetch phase via
- If no sessions for current project:
- Display: "No collab sessions found in this project."
- Exit
Step 2: Show Session Summary
Display session details:
Session: [name]
Template: [feature/bugfix/refactor/spike]
Phase: [current phase]
Artifacts:
- Documents: [list .md files]
- Diagrams: [list .mmd files]
Step 3: Ask User Choice
What would you like to do with the design artifacts?
1. Archive - Copy to docs/designs/[session-name]/
2. Delete - Remove without saving
3. Keep - Leave session in place, exit without cleanup
4. Archive & Continue - Archive with timestamp, reset session for new work
Step 4: Execute Choice
If Archive:
- Create
docs/designs/[session-name]/directory - Copy all documents including per-item documents:
.collab/[session]/documents/design.md.collab/[session]/documents/interface-item-*.md.collab/[session]/documents/pseudocode-item-*.md.collab/[session]/documents/skeleton-item-*.md
- Copy
.collab/[session]/diagrams/*todocs/designs/[session-name]/ - Delete
.collab/[session]/folder - Report what was archived (including count of per-item documents)
If Delete:
- Confirm: "Delete session [name]? This cannot be undone."
1. Yes, delete 2. No, go back - If 1 (Yes): Delete
.collab/[session]/folder - If 2 (No): Return to Step 3
If Keep:
- Exit without changes
- Remind user: "Session kept open. Run
/collab-cleanupwhen ready to close."
If Archive & Continue:
- Generate timestamp:
[session-name]-[YYYY-MM-DD-HHmmss] - Create archive directory:
docs/designs/[session-name]-[timestamp]/ - Copy
.collab/[session]/documents/*to archive directory - Copy
.collab/[session]/diagrams/*to archive directory - Clear Work Items section in
.collab/[session]/documents/design.md:- Keep "## Session Context" and its content intact
- Replace "## Work Items" section with empty placeholder
- Reset collab state via MCP:
Note:Tool: mcp__plugin_mermaid-collab_mermaid__update_session_state Args: { "project": "<absolute-path-to-cwd>", "session": "<session-name>", "phase": "brainstorming", "currentItem": null }lastActivityis automatically updated by the MCP tool. - Report: "Session
[name]archived todocs/designs/[name]-[timestamp]/. Session reset for new work." - Loop back to
gather-session-goalsskill to start work on new items
Step 5: Confirm
Display completion message:
- Archive: "Session
[name]archived todocs/designs/[name]/" - Delete: "Session
[name]deleted." - Keep: "Session
[name]kept open." - Archive & Continue: "Session
[name]archived todocs/designs/[name]-[timestamp]/. Ready for new work items."
Integration
Called by:
finishing-a-development-branchskill at completion- User directly via
/collab-cleanupcommand
Collab workflow position:
collab → brainstorming → rough-draft → executing-plans → finishing-a-development-branch → collab-cleanup
↑
(you are here)
Common Mistakes
Archiving without checking contents
- Problem: Archived files might be incomplete or contain sensitive info
- Fix: Always show session summary before archiving
Deleting active session
- Problem: User accidentally deletes session they're still working on
- Fix: Confirm deletion, check if phase is not "implementation"
Red Flags
Never:
- Delete without confirmation
- Archive to a location that already exists (overwrite)
- Clean up if there are pending verification issues
Always:
- Show session summary before action
- Confirm destructive actions
- Report what was done