add-node
Add or modify a node in an existing Copilot Studio topic. Use when the user asks to add a question, message, condition, variable, or other node to a topic. Do NOT use this for generative answers or knowledge search — use /add-generative-answers instead.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 493
- Forks
- 103
01 前言 Front Matter
- agent
- copilot-studio-author
- context
- fork
- description
- Add or modify a node in an existing Copilot Studio topic. Use when the user asks to add a question, message, condition, variable, or other node to a topic. Do NOT use this for generative answers or knowledge search — use /add-generative-answers instead.
- allowed-tools
- Bash(node *schema-lookup.bundle.js *), Read, Write, Edit, Glob
- argument-hint
- <node-type> to <topic-name>
- user-invocable
- false
03 SKILL.md 正文
Add Node to Topic
Add a new node to an existing Copilot Studio topic, or modify an existing one.
In Copilot Studio, the elements inside a topic's actions array are nodes (SendActivity, Question, ConditionGroup, etc.). These are different from actions (actions/*.mcs.yml), which are connector-based TaskDialogs. This skill handles nodes within topics.
For generative answers (SearchAndSummarizeContent, AnswerQuestionWithAI), use the /add-generative-answers skill instead — it has the specific patterns, follow-up ConditionGroup logic, and disambiguation guidance needed to set them up correctly.
Instructions
-
Auto-discover the agent directory:
Glob: **/agent.mcs.ymlNEVER hardcode an agent name.
-
Parse the arguments to identify:
- The node type (SendActivity, Question, SetVariable, ConditionGroup, etc.)
- The target topic file
- If modifying an existing node, which node to modify
-
Look up the node schema:
node ${CLAUDE_SKILL_DIR}/../../scripts/schema-lookup.bundle.js resolve <NodeType> -
Read the existing topic file to understand its current structure.
-
Generate or modify the node with:
- A unique ID (format:
<nodeType>_<6-8 random alphanumeric>) - All required properties from the schema
- Appropriate default values
- A unique ID (format:
-
Determine the correct insertion point in the actions array and present the plan to the user before writing.
Common Node Types
| Node | Purpose | Key Properties |
|---|---|---|
SendActivity |
Send message | kind, id, activity |
Question |
Ask user input | kind, id, variable, prompt, entity |
SetVariable |
Set/compute value | kind, id, variable, value |
SetTextVariable |
Set text with interpolation (YAML-only, no canvas) | kind, id, variable, value |
ConditionGroup |
Branching logic | kind, id, conditions |
BeginDialog |
Call another topic | kind, id, dialog |
EndDialog |
End topic | kind, id |
CancelAllDialogs |
Cancel all topics | kind, id |
Generative Orchestration Guidelines
When the agent has GenerativeActionsEnabled: true:
- Prefer AutomaticTaskInput over Question nodes for collecting user info (the orchestrator handles prompting automatically).
- Still use Question nodes when: conditional asks (ask X only if Y), or end-of-flow confirmations.
- Prefer topic outputs over SendActivity for returning results.
- Do NOT use SendActivity to show final outputs unless it's a precise mid-flow message.
Power Fx Quick Reference
- Expressions start with
=:condition: =System.FallbackCount < 3 - String interpolation uses
{}:activity: "Error: {System.Error.Message}" - Variable init on first assignment:
variable: init:Topic.MyVar - Common:
Text(),Now(),IsBlank(),!IsBlank()
Example: Adding a Question Node
- kind: Question
id: question_k7xPm2
variable: init:Topic.UserName
prompt: What is your name?
entity: StringPrebuiltEntity
alwaysPrompt: true
interruptionPolicy:
allowInterruption: false
Important Notes
- Unique IDs: Use random 6-8 alphanumeric characters. Duplicate IDs cause Copilot Studio errors.
- Verify the node type exists in the schema before generating.
- For ConditionGroup, include at least one condition item with its own unique ID.
04 同仓库更多 Skills
validate
Validate Copilot Studio agent YAML files using the LSP binary's full diagnostics (YAML structure, Power Fx, schema, cross-file references). Use when the user asks to check, validate, or verify YAML files.
test-auth
Authenticate for Copilot Studio evaluation API and SDK chat. Caches a token that is shared across run-eval and chat-sdk skills. Run this before any eval or SDK chat workflow. Requires an App Registration with MakerOperations and Copilots.Invoke permissions.
run-tests-kit
Run a batch test suite via the Copilot Studio Kit (Dataverse API). Uses the Power CAT Copilot Studio Kit to execute test cases against a published agent and produces pass/fail results with latencies. Requires the Kit installed in the environment, an App Registration with Dataverse permissions, and a published agent.
run-eval
Run evaluations against a Copilot Studio agent via the Power Platform Evaluation API. Works on DRAFT agents — no publish step required. Lists test sets, starts a run, polls until complete, fetches results, and proposes YAML fixes for failures. Use when the user wants to test agent changes without publishing.
new-topic
Create a new Copilot Studio topic YAML file. Use when the user asks to create a new topic, conversation flow, or dialog for their agent.
manage-agent
Push/pull Copilot Studio agent content via the VS Code extension's LanguageServerHost LSP binary. Handles authentication (interactive browser login for push/pull, device code flow for chat token), sync push, sync pull, clone, and diff operations.