agentleFS
roie9876roie9876/clawpilot-skills/msx-crm/SKILL.md

msx-crm

Skill4 starsChanged 7 months agoMITView on GitHub

Query Microsoft Sales Experience (MSX) CRM data — accounts, opportunities, milestones, tasks, and deal teams. Triggers: any mention of 'MSX', 'CRM', 'milestones', 'opportunities', 'deal team', 'pipeline', 'accounts', 'customer milestones', 'sales play', or questions about customer engagement status in Dynamics 365 Sales.

  • Installs packages

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. About 0 are common, 15 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before running, verify all dependencies are present.

    line 31
  2. Distinctive:

    Check if each required skill is installed:

    line 42
  3. Distinctive:

    Run the installer (idempotent — safe to re-run):

    line 68
  4. Distinctive:

    Verify the required skills are now installed.

    line 78
  5. Very specific:

    If node is not on PATH after Homebrew installation, use the Homebrew binary directly:

    line 89
  6. Very specific:

    If missing, reinstall the skills repository so the bundled crm-tools folder is linked:

    line 112
  7. Very specific:

    If MCAPS-IQ is missing but run-tool.mjs exists, restore MCAPS-IQ locally or provide an authorized repo URL, then transpile the MSX modules:

    line 145
  8. Very specific:

    Check if a VPN ensure script exists at $HOME/Scripts/ensure-vpn.sh:

    line 178
  9. Very specific:

    Check m_m365_status. If not signed in → call m_m365_sign_in.

    line 197
  10. Distinctive:

    After all prerequisites are satisfied:

    line 203
  11. Distinctive:

    Important: Always run the VPN check before any CRM tool call.

    line 217
  12. Distinctive:

    Check if CRM authentication is working.

    line 222
  13. Distinctive:

    Create a new task linked to a milestone.

    line 325
  14. Distinctive:

    Update an existing task. Parameters:

    line 336
  15. Distinctive:

    Delete a task by ID. Parameters:

    line 342
  16. Distinctive:

    When presenting data, always check for these formatted values to show human-readable names instead of GUIDs.

    line 362
  17. Distinctive:

    If you get "IP address is blocked" → VPN dropped mid-call.

    line 367
  18. Very specific:

    If you get auth errors → Run az login or check Azure CLI session.

    line 368
  19. Distinctive:

    Always wrap calls in try/catch and surface useful error messages.

    line 369
  20. Distinctive:

    When presenting CRM data to the user:

    line 373
  21. Distinctive:

    Use tables for lists of milestones/opportunities

    line 374

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

MSX CRM Skill

Overview

This skill queries the Microsoft Sales Experience (MSX) CRM (Dynamics 365) to retrieve accounts, opportunities, milestones, tasks, and deal team data. It uses a Node.js helper script (run-tool.mjs) that wraps the CRM OData API.

CRM URL

https://microsoftsales.crm.dynamics.com

Platform Compatibility

This skill runs on macOS, Linux, and Windows. Detect the OS first and pick the right command syntax. See _shared/PLATFORM.md (skills repo root) for the full reference.

ActionmacOS / Linux (bash)Windows (PowerShell)
Run node scriptnode $HOME/.copilot/skills/msx-crm/crm-tools/run-tool.mjs ...node $HOME/.copilot/skills/msx-crm/crm-tools/run-tool.mjs ...
Find nodewhich nodeGet-Command node
Home dir~ or $HOME$HOME

Prerequisite Auto-Install

Before running, verify all dependencies are present. Install anything missing automatically.

Required Sibling Skills

This skill requires sibling skills from the same repository (https://github.com/roie9876/clawpilot-skills):

SkillPurposeRequired?
/customer-repoCustomer engagement folder structure⚠️ For customer-scoped queries

Check if each required skill is installed:

# macOS / Linux
[ -f "$HOME/.copilot/skills/customer-repo/SKILL.md" ] && echo "✅ installed" || echo "❌ missing"
# Windows
if (Test-Path "$HOME\.copilot\skills\customer-repo\SKILL.md") { "✅ installed" } else { "❌ missing" }

If ANY required skill is missing, install all skills from the repository:

  1. Clone the repo (skip if already cloned):
    # macOS / Linux
    [ -d "$HOME/customer-skills/.git" ] || git clone https://github.com/roie9876/clawpilot-skills.git "$HOME/customer-skills"
    # Windows
    if (-not (Test-Path "$HOME\customer-skills\.git")) {
        git clone https://github.com/roie9876/clawpilot-skills.git "$HOME\customer-skills"
    }
  2. Run the installer (idempotent — safe to re-run):
    # macOS / Linux
    bash "$HOME/customer-skills/scripts/install.sh"
    # Windows
    pwsh "$HOME\customer-skills\scripts\install.ps1"
  3. Verify the required skills are now installed. If still missing, stop and report the error.

Required Tools

ToolCheck (POSIX)Check (Windows)Install (macOS)Install (Windows)
Node.jsnode --versionGet-Command nodebrew install nodewinget install OpenJS.NodeJS
gitgit --versionGet-Command gitPre-installedwinget install Git.Git
Azure CLIaz versionaz versionbrew install azure-cliwinget install Microsoft.AzureCLI

Install any missing tools before proceeding. After installing Node.js, verify: node --version. If node is not on PATH after Homebrew installation, use the Homebrew binary directly:

NODE_BIN="$(command -v node || true)"
[ -n "$NODE_BIN" ] || NODE_BIN="$HOME/.homebrew/bin/node"
"$NODE_BIN" --version

CRM Tool Script (run-tool.mjs)

The CRM helper script must exist at $HOME/.copilot/skills/msx-crm/crm-tools/run-tool.mjs. It is bundled with this skill; do not clone a separate crm-tools repo.

# macOS / Linux
[ -f "$HOME/.copilot/skills/msx-crm/crm-tools/run-tool.mjs" ] && echo "✅ CRM tools found" || echo "❌ CRM tools missing"
# Windows
if (Test-Path "$HOME\.copilot\skills\msx-crm\crm-tools\run-tool.mjs") { "✅ CRM tools found" } else { "❌ CRM tools missing" }

If missing, reinstall the skills repository so the bundled crm-tools folder is linked:

[ -d "$HOME/customer-skills/.git" ] || git clone https://github.com/roie9876/clawpilot-skills.git "$HOME/customer-skills"
bash "$HOME/customer-skills/scripts/install.sh"
if (-not (Test-Path "$HOME\customer-skills\.git")) {
    git clone https://github.com/roie9876/clawpilot-skills.git "$HOME\customer-skills"
}
pwsh "$HOME\customer-skills\scripts\install.ps1"

MCAPS-IQ Library

run-tool.mjs imports the MSX auth/client code from the MCAPS-IQ library at:

OSRequired path
macOS / Linux$HOME/.copilot/skills/msx-crm/crm-tools/lib/mcaps-iq/mcp/msx-mcp-server/dist
Windows$HOME\.copilot\skills\msx-crm\crm-tools\lib\mcaps-iq\mcp\msx-mcp-server\dist

The skill installer clones MCAPS-IQ automatically. Verify it exists:

[ -f "$HOME/.copilot/skills/msx-crm/crm-tools/lib/mcaps-iq/mcp/msx-mcp-server/dist/auth.js" ] && echo "✅ MCAPS-IQ MSX modules found" || echo "❌ MCAPS-IQ MSX modules missing"
if (Test-Path "$HOME\.copilot\skills\msx-crm\crm-tools\lib\mcaps-iq\mcp\msx-mcp-server\dist\auth.js") { "✅ MCAPS-IQ MSX modules found" } else { "❌ MCAPS-IQ MSX modules missing" }

If MCAPS-IQ is missing but run-tool.mjs exists, restore MCAPS-IQ locally or provide an authorized repo URL, then transpile the MSX modules:

mkdir -p "$HOME/.copilot/skills/msx-crm/crm-tools/lib"
if [ -d "$HOME/MCAPS-IQ" ]; then
    ln -sfn "$HOME/MCAPS-IQ" "$HOME/.copilot/skills/msx-crm/crm-tools/lib/mcaps-iq"
elif [ -n "${MCAPS_IQ_REPO_URL:-}" ]; then
    git clone "$MCAPS_IQ_REPO_URL" "$HOME/.copilot/skills/msx-crm/crm-tools/lib/mcaps-iq"
else
    echo "Place MCAPS-IQ at ~/MCAPS-IQ or set MCAPS_IQ_REPO_URL to an authorized repo URL."
fi
cd "$HOME/.copilot/skills/msx-crm/crm-tools/lib/mcaps-iq/mcp/msx-mcp-server"
esbuild src/auth.ts src/crm.ts src/validation.ts --outdir=dist --format=esm --platform=node --target=node22
New-Item -ItemType Directory -Force -Path "$HOME\.copilot\skills\msx-crm\crm-tools\lib" | Out-Null
if (Test-Path "$HOME\MCAPS-IQ") {
    New-Item -ItemType SymbolicLink -Path "$HOME\.copilot\skills\msx-crm\crm-tools\lib\mcaps-iq" -Target "$HOME\MCAPS-IQ" -Force | Out-Null
} elseif ($env:MCAPS_IQ_REPO_URL) {
    git clone $env:MCAPS_IQ_REPO_URL "$HOME\.copilot\skills\msx-crm\crm-tools\lib\mcaps-iq"
} else {
    "Place MCAPS-IQ at ~/MCAPS-IQ or set MCAPS_IQ_REPO_URL to an authorized repo URL."
}
Set-Location "$HOME\.copilot\skills\msx-crm\crm-tools\lib\mcaps-iq\mcp\msx-mcp-server"
esbuild src/auth.ts src/crm.ts src/validation.ts --outdir=dist --format=esm --platform=node --target=node22

VPN Connection

CRM is only accessible on Microsoft corpnet via VPN.

macOS / Linux: Check if a VPN ensure script exists at $HOME/Scripts/ensure-vpn.sh:

if [ -f "$HOME/Scripts/ensure-vpn.sh" ]; then
    bash "$HOME/Scripts/ensure-vpn.sh"
else
    echo "⚠️ No VPN auto-connect script found. Please connect to Azure VPN manually."
    echo "Check VPN status: scutil --nc list | grep VPN"
fi

Windows: There is no automated VPN script for Windows. Ask the user to confirm VPN is connected via Azure VPN Client before proceeding:

⚠️ CRM requires VPN. Please confirm Azure VPN Client is connected before continuing.

M365 Sign-In

Check m_m365_status. If not signed in → call m_m365_sign_in.


How to Run Tools

After all prerequisites are satisfied:

# macOS / Linux
NODE_BIN="$(command -v node || true)"
[ -n "$NODE_BIN" ] || NODE_BIN="$HOME/.homebrew/bin/node"
"$NODE_BIN" "$HOME/.copilot/skills/msx-crm/crm-tools/run-tool.mjs" <tool-name> '<json-params>'
# Windows
node "$HOME\.copilot\skills\msx-crm\crm-tools\run-tool.mjs" <tool-name> '<json-params>'

Important: Always run the VPN check before any CRM tool call.

Available Tools

1. crm_auth_status

Check if CRM authentication is working.

node "$HOME/.copilot/skills/msx-crm/crm-tools/run-tool.mjs" crm_auth_status

2. crm_whoami

Get the current user's CRM identity.

node "$HOME/.copilot/skills/msx-crm/crm-tools/run-tool.mjs" crm_whoami

3. get_milestones

Get milestones for a customer, opportunity, or the current user. Parameters:

  • customerKeyword (string) — Search accounts by name (e.g., "Aidoc", "Nuvei")
  • opportunityKeyword (string) — Search opportunities by name
  • opportunityId (GUID) — Single opportunity ID
  • opportunityIds (GUID[]) — Multiple opportunity IDs
  • milestoneNumber (string) — Milestone number lookup
  • milestoneId (GUID) — Direct milestone lookup
  • ownerId (GUID) — Filter by owner
  • mine (boolean) — Get milestones owned by current user
  • statusFilter ("active") — Only active milestones (Not Started, On Track, In Progress, Blocked, At Risk)
  • keyword (string) — Filter milestone names
  • includeTasks (boolean) — Include task data

Examples:

# Customer milestones
node "$HOME/.copilot/skills/msx-crm/crm-tools/run-tool.mjs" get_milestones '{"customerKeyword":"Aidoc"}'

# My active milestones
node "$HOME/.copilot/skills/msx-crm/crm-tools/run-tool.mjs" get_milestones '{"mine":true,"statusFilter":"active"}'

4. list_opportunities

List opportunities for a customer. Parameters:

  • customerKeyword (string) — Search accounts by name
  • accountIds (GUID[]) — Direct account IDs
  • includeCompleted (boolean) — Include completed/old opportunities
node "$HOME/.copilot/skills/msx-crm/crm-tools/run-tool.mjs" list_opportunities '{"customerKeyword":"Aidoc"}'

5. get_my_active_opportunities

Get all active opportunities where the user is owner or deal team member. Parameters:

  • customerKeyword (string) — Optional filter by customer name
node "$HOME/.copilot/skills/msx-crm/crm-tools/run-tool.mjs" get_my_active_opportunities

6. get_milestone_activities

Get tasks linked to milestones. Parameters:

  • milestoneId (GUID) — Single milestone
  • milestoneIds (GUID[]) — Multiple milestones
node "$HOME/.copilot/skills/msx-crm/crm-tools/run-tool.mjs" get_milestone_activities '{"milestoneId":"abc-123..."}'

7. find_milestones_needing_tasks

Find active milestones that have no tasks created yet. Parameters:

  • customerKeyword (string)
  • opportunityKeyword (string)
  • mine (boolean)
node "$HOME/.copilot/skills/msx-crm/crm-tools/run-tool.mjs" find_milestones_needing_tasks '{"mine":true}'

8. crm_query

Raw OData query against any CRM entity set. Parameters:

  • entitySet (string, required) — e.g., "accounts", "opportunities", "msp_engagementmilestones", "tasks"
  • filter (string) — OData $filter expression
  • select (string) — Comma-separated fields
  • orderby (string) — OData $orderby expression
  • top (number) — Max records
  • expand (string) — OData $expand expression
node "$HOME/.copilot/skills/msx-crm/crm-tools/run-tool.mjs" crm_query '{"entitySet":"accounts","filter":"contains(name,'\''Aidoc'\'')","select":"accountid,name,msp_tpid","top":10}'

9. crm_get_record

Get a single record by entity set and ID. Parameters:

  • entitySet (string, required)
  • id (GUID, required)
  • select (string) — Comma-separated fields

10. list_accounts_by_tpid

Find accounts by TPID. Parameters:

  • tpid (string, required)

11. create_task

Create a new task linked to a milestone. Parameters:

  • subject (string, required) — Task title
  • description (string) — Task description
  • regardingobjectid (GUID, required) — Milestone ID to link the task to
  • msp_taskcategory (number) — Activity category (see category codes below)
  • scheduledend (string) — Due date (ISO format)
  • statuscode (number) — Status: 2=Not Started, 3=In Progress, 5=Completed
  • statecode (number) — State: 0=Open, 1=Completed, 2=Canceled

12. update_task

Update an existing task. Parameters:

  • taskId (GUID, required) — Task ID to update
  • Plus any fields from create_task to modify

13. delete_task

Delete a task by ID. Parameters:

  • taskId (GUID, required)

CRM Task Category Codes

CodeCategory
861980000Customer Engagement
861980001Workshop
861980002Demo
861980004Architecture Design Session
861980005PoC/Pilot
861980006Blocker Escalation
861980008Briefing
861980012Internal

Formatted Value Pattern

CRM returns lookup display names as field@OData.Community.Display.V1.FormattedValue. When presenting data, always check for these formatted values to show human-readable names instead of GUIDs.

Error Handling

  • If you get "IP address is blocked" → VPN dropped mid-call. Re-run VPN check and retry.
  • If you get auth errors → Run az login or check Azure CLI session.
  • Always wrap calls in try/catch and surface useful error messages.

Output Formatting

When presenting CRM data to the user:

  • Use tables for lists of milestones/opportunities
  • Show status with emoji indicators: ✅ Completed, 🟢 On Track, 🔴 At Risk/Lost, ❌ Cancelled, ⏸️ Not Started, 🔄 In Progress, ⚠️ Blocked
  • Include relevant dates, owners, and opportunity names
  • Summarize counts at the end

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.