From cpm
Focused one-to-one consultation with a chosen agent persona. Start a deep conversation with one expert, invite others as needed, and transfer the facilitation lead. Use for focused problem-solving, expert Q&A, or guided exploration. Triggers on "/cpm:consult".
How this skill is triggered — by the user, by Claude, or both
Slash command
/cpm:consultThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Start a focused consultation with a single agent persona. You control who's in the room — invite others when the conversation demands it, dismiss them when it doesn't. You lead by default, but can hand the lead to an agent when you want them to drive.
Start a focused consultation with a single agent persona. You control who's in the room — invite others when the conversation demands it, dismiss them when it doesn't. You lead by default, but can hand the lead to an agent when you want them to drive.
If $ARGUMENTS is provided, use it to determine the starting agent and/or topic:
Margot, Bella), start a one-to-one conversation with that agent. Ask what they'd like to discuss.architect, developer, PM), resolve the role to the matching agent from the roster and start the conversation.Margot docs/plans/my-plan.md), start the conversation with that agent using the topic as context.If no arguments are given, present the roster and ask the user to pick an agent and provide a topic.
Load the agent roster at session start. Check for a project-level override first:
docs/agents/roster.yaml in the current project directory. If it exists, use it as the complete roster (no merging with defaults).agents/roster.yaml (located in the same plugin directory as this skill, at ../../agents/roster.yaml relative to this file).If neither file can be found, tell the user and stop — consult mode requires a roster.
After loading, present the roster so the user can choose an agent (unless one was already selected via $ARGUMENTS). Present them as a compact roster:
Available agents:
📋 **Jordan** — Product Manager
🏗️ **Margot** — Software Architect
💻 **Bella** — Senior Developer
🎨 **Priya** — UX Designer
🔍 **Tomas** — QA Engineer
🧪 **Casey** — Test Engineer
🚀 **Sable** — DevOps Engineer
📝 **Elli** — Technical Writer
🔄 **Ren** — Scrum Master
Who would you like to consult? (Name or role.)
Adapt the roster display to whatever agents are actually loaded. If the user already selected an agent via $ARGUMENTS, skip the selection prompt and confirm the choice:
Starting consultation with {icon} **{displayName}** ({role}).
What would you like to discuss?
This is the core conversation loop. For each user message:
Before generating agent responses, scan the user's message for commands. Commands take priority over normal conversation.
Be careful to distinguish commands from conversation. "I'd like to dismiss that idea" is not a dismiss command. "Let's bring in a fresh perspective" may or may not be an invite — if ambiguous, treat it as conversation and let the agent respond naturally. Only act on clear intent.
If no command is detected, proceed to step 2.
Each active agent responds in character. Format:
{icon} **{displayName}**: {response in character}
When one agent is active (the default starting state): Only that agent responds. This should feel like a natural one-to-one dialogue — no panel formatting, no multi-voice structure. The agent responds directly to the user as an expert in their domain.
When multiple agents are active (after invites): All active agents respond, in roster order. The primary agent (first one invited at session start) responds first. Agents can reference each other — "Building on what Margot said...", "I agree with Bella, but..." — but they respond to the user, not to each other.
Rules for agent responses:
After each round of agent responses, present a subtle exit option:
---
*Type **wrap up** to end the consultation, or continue the conversation.*
Important: Do not use "exit" or "quit" as trigger words — these are reserved by the Claude Code CLI and will terminate the session entirely, orphaning the progress file. Use "wrap up" as the primary trigger.
The user can end consult mode at any time by typing "wrap up", "done", "end consultation", or "goodbye".
When an exit is triggered, follow this sequence:
Briefly acknowledge the end of the consultation. Keep it natural — one sentence, not a ceremony.
Save the progress file's content as a permanent discussion artifact. This preserves the full fidelity of decisions, key points, and context accumulated during the conversation — no summarisation, no information loss.
docs/plans/.cpm-progress-{session_id}.md).docs/discussions/{nn}-discussion-{slug}.md.
{nn} is a zero-padded auto-incrementing number. Use the Glob tool to list existing docs/discussions/[0-9]*-discussion-*.md files, find the highest number, and increment by 1. If none exist, start at 01.{slug} is a short kebab-case name derived from the consultation topic.docs/discussions/ directory if it doesn't exist.# Discussion: {Topic}
**Date**: {today's date}
**Agents**: {comma-separated list of agent display names who participated}
{Rest of the Discussion Highlights section from the progress file — key points, decisions, active thread, and any other accumulated content — preserved verbatim}
Do not summarise. The progress file already contains curated, structured content — decisions with numbered objectives, key points, rationale. Summarising loses this detail. The discussion record is the artifact.
After saving the discussion record, offer the user options for what to do next. Use AskUserQuestion:
If the user chooses a pipeline skill, pass the discussion record file path as the input context for that skill. The file path becomes the $ARGUMENTS equivalent — the next skill should read the file and treat it as its starting brief/description.
When the user invites an agent, add them to the active agents list. The newly invited agent joins with full context (they can see the entire conversation history — no transfer needed) and announces their presence.
Recognise natural language invite phrases. Examples:
Resolve references by display name (case-insensitive) or by role (match against the role field in the roster). If the reference is ambiguous (e.g. multiple agents could match), ask the user to clarify.
"{displayName} is already in the conversation." Do not add them again.{icon} **{displayName}** joins the consultation.
{icon} **{displayName}**: {brief in-character response to the current discussion}
When the user dismisses an agent, remove them from the active agents list. The conversation continues with the remaining agents.
Recognise natural language dismiss phrases. Examples:
Be careful with ambiguity. "I'd like to dismiss that idea" is NOT a dismiss command — it's conversation. Only act on clear intent to remove an agent from the consultation.
Resolve references by display name (case-insensitive) or by role (match against the role field in the roster).
"{displayName} isn't currently in the conversation." Do nothing."No agents remaining. Who would you like to bring in?" Present the roster for selection.When multiple agents are active (after invites), consult mode shifts from a pure dialogue to a guided panel — but it's still fundamentally different from party mode. Here's how:
Active agents respond in roster order (the order they appear in the roster YAML), not in the order they were invited. The primary agent (the one selected at session start) always responds first, regardless of roster position. This keeps the original consultation relationship front and centre.
The user leads by default — they ask questions, steer topics, decide when to go deeper. But the user can hand the lead to an agent, and the agent can suggest handing it to another agent. The lead determines who drives the conversation.
At any point, the lead is either:
user (default) — the user drives. Agents respond to the user's questions and directions.The user can hand the lead to an agent explicitly. Recognise phrases like:
When a handover is recognised:
{icon} **{displayName}** takes the lead.
{icon} **{displayName}** *(leading)*: {response}
Other active agents do NOT get the marker. This makes it visually clear who's driving.
When an agent has the lead, their responses shift qualitatively. This is the key difference between user-led and agent-led mode:
User-led mode (default):
Agent-led mode:
The user reclaims the lead by simply leading again. There's no "reclaim" command — the agent recognises the shift and defers.
Signals that the user is reclaiming the lead:
When the agent detects a reclaim signal:
user.A leading agent can suggest handing the lead to another agent when the discussion moves into another agent's domain. This requires user confirmation — agents cannot unilaterally transfer the lead.
The leading agent might say:
{icon} **{displayName}** *(leading)*: This is getting into implementation detail — that's more Bella's area. Bella, want to take this? (Your call — say yes to hand over, or I'll keep going.)
If the user confirms (e.g. "yes", "go ahead", "hand it over"):
"{new agent icon} **{new displayName}** takes the lead."If the user declines (e.g. "no", "keep going", "you continue"):
Maintain docs/plans/.cpm-progress-{session_id}.md throughout the session for compaction resilience. This allows seamless continuation if context compaction fires mid-consultation.
Path resolution: All paths in this skill are relative to the current Claude Code session's working directory. When calling Write, Glob, Read, or any file tool, construct the absolute path by prepending the session's primary working directory. Never write to a different project's directory or reuse paths from other sessions.
Session ID: The {session_id} in the filename comes from CPM_SESSION_ID — a unique identifier for the current Claude Code session, injected into context by the CPM hooks on startup and after compaction. Use this value verbatim when constructing the progress file path. If CPM_SESSION_ID is not present in context (e.g. hooks not installed), fall back to .cpm-progress.md (no session suffix) for backwards compatibility.
Resume adoption: When a session is resumed (--resume) or context is cleared (/clear), CPM_SESSION_ID changes to a new value while the old progress file remains on disk. The hooks inject all existing progress files into context — if one matches this skill's **Skill**: field but has a different session ID in its filename, adopt it:
docs/plans/.cpm-progress-{current_session_id}.md with the same contents.rm docs/plans/.cpm-progress-{old_session_id}.md.
Do not attempt adoption if CPM_SESSION_ID is absent from context — the fallback path handles that case.Create the file after roster loading and agent selection (before the first conversation turn). Update it after every 2-3 substantive exchanges (not every single turn — use judgement). Delete it only after the discussion record has been saved to docs/discussions/ and any pipeline handoff is complete — never before. If compaction fires between deletion and a pending output, all session state is lost.
Also delete docs/plans/.cpm-compact-summary-{session_id}.md if it exists — this companion file is written by the PostCompact hook and should be cleaned up alongside the progress file.
Use the Write tool to write the full file each time (not Edit — the file is replaced wholesale). Format:
# CPM Session State
**Skill**: cpm:consult
**Phase**: Consultation in progress
**Topic**: {the consultation topic}
**Active agents**: {ordered comma-separated list of active agent display names}
**Lead**: {user or agent display name}
## Discussion Highlights
### Key points so far
- {Major point or insight from the consultation}
- {Another key point}
### Active thread
{Brief description of the current line of discussion — what was just being talked about, who was leading, what the user's last question or statement was about}
## Next Action
Continue the consultation. The user's last message was about {brief description}. Lead is {user/agent name}. Active agents: {list}. Resume the conversation loop.
The "Discussion Highlights" section is the critical part — it captures enough of the conversation's substance that post-compaction continuation feels seamless. The Active agents and Lead fields are essential for restoring the correct conversation dynamics after compaction.
After roster loading and before the first conversation turn, check the project library for reference documents:
docs/library/*.md. If no files found or directory doesn't exist, skip silently.--- delimiters, typically the first ~10 lines). Read each file individually — do not use Bash loops with shell variables for this. Filter to documents whose scope array includes party or all.Graceful degradation: If any library document has malformed or missing front-matter, fall back to using the filename as context. Never block the consultation due to a malformed library document.
Compaction resilience: Include library scan results (files found, scope matches) in the progress file so post-compaction continuation doesn't re-scan.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub ninthspace/claude-code-marketplace --plugin cpm