@salesforce/afv-skills 1.57.0 → 1.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/package.json +1 -1
  2. package/skills/agentforce-bot-upgrade/SKILL.md +3 -1
  3. package/skills/agentforce-generate/SKILL.md +21 -1
  4. package/skills/agentforce-generate/references/known-issues.md +51 -1
  5. package/skills/agentforce-generate/references/legacy-nga-regression-eval.md +547 -0
  6. package/skills/agentforce-generate/references/upgrade-legacy-agent-to-agentscript.md +577 -0
  7. package/skills/agentforce-generate/scripts/upgrade-legacy-nga-analyze.py +404 -0
  8. package/skills/agentforce-generate/scripts/upgrade-legacy-nga-run-trials.sh +58 -0
  9. package/skills/agentforce-persona-generate/SKILL.md +505 -0
  10. package/skills/agentforce-persona-generate/assets/checklist-template.md +100 -0
  11. package/skills/agentforce-persona-generate/assets/persona-encoding-template.md +252 -0
  12. package/skills/agentforce-persona-generate/assets/persona-template.md +229 -0
  13. package/skills/agentforce-persona-generate/assets/sample-dialog-template.md +50 -0
  14. package/skills/agentforce-persona-generate/assets/workshop-outline-template.md +97 -0
  15. package/skills/agentforce-persona-generate/examples/concierge-persona.md +189 -0
  16. package/skills/agentforce-persona-generate/examples/concierge-sample-dialog.md +70 -0
  17. package/skills/agentforce-persona-generate/examples/drover-persona.md +194 -0
  18. package/skills/agentforce-persona-generate/examples/drover-sample-dialog.md +62 -0
  19. package/skills/agentforce-persona-generate/examples/steady-hand-persona.md +188 -0
  20. package/skills/agentforce-persona-generate/examples/steady-hand-sample-dialog.md +68 -0
  21. package/skills/agentforce-persona-generate/examples/yt-persona.md +195 -0
  22. package/skills/agentforce-persona-generate/examples/yt-sample-dialog.md +66 -0
  23. package/skills/agentforce-persona-generate/references/attributions.md +36 -0
  24. package/skills/agentforce-persona-generate/references/interaction-design-notes.md +30 -0
  25. package/skills/agentforce-persona-generate/references/persona-encoding-guide.md +566 -0
  26. package/skills/agentforce-persona-generate/references/persona-framework.md +796 -0
  27. package/skills/agentforce-persona-generate/references/refinement-mappings.md +31 -0
  28. package/skills/agentforce-persona-generate/references/scoring-rubric.md +58 -0
  29. package/skills/agentforce-persona-generate/references/voice-catalog.json +2327 -0
  30. package/skills/agentforce-persona-generate/references/workshop-question-policy.md +90 -0
  31. package/skills/agentforce-persona-generate/references/workshop-scenario-seeds.md +119 -0
  32. package/skills/agentforce-persona-generate/scripts/parse_agent_yaml.py +223 -0
  33. package/skills/dx-app-analytics-query/SKILL.md +8 -8
  34. package/skills/experience-ui-bundle-app-coordinate/SKILL.md +12 -12
  35. package/skills/experience-ui-bundle-app-coordinate/references/phase-completion-validation.md +3 -3
  36. package/skills/experience-ui-bundle-app-coordinate/references/phase-execution-pattern.md +9 -7
  37. package/skills/experience-ui-bundle-app-coordinate/scripts/check-dangling-refs.mjs +132 -0
  38. package/skills/experience-ui-bundle-app-coordinate/scripts/check-hosting-target.mjs +62 -0
  39. package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-1-complete.mjs +71 -0
  40. package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-4-complete.mjs +95 -0
  41. package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-6-ready.mjs +78 -0
  42. package/skills/experience-ui-bundle-app-coordinate/scripts/check-prerequisites.mjs +21 -0
  43. package/skills/experience-ui-bundle-app-coordinate/scripts/check-sfdx-project.mjs +28 -0
  44. package/skills/experience-ui-bundle-custom-app-generate/SKILL.md +3 -1
  45. package/skills/experience-ui-bundle-custom-app-generate/scripts/resolve-uibundle-path.mjs +40 -0
  46. package/skills/experience-ui-bundle-frontend-generate/SKILL.md +7 -5
  47. package/skills/experience-ui-bundle-frontend-generate/scripts/check-preconditions.mjs +70 -0
  48. package/skills/experience-ui-bundle-frontend-generate/scripts/resolve-ui-bundle.mjs +76 -0
  49. package/skills/experience-ui-bundle-frontend-generate/scripts/verify-rules.mjs +115 -0
  50. package/skills/experience-ui-bundle-metadata-generate/SKILL.md +7 -3
  51. package/skills/experience-ui-bundle-metadata-generate/references/angular-metadata-generate.md +1 -1
  52. package/skills/experience-ui-bundle-metadata-generate/references/react-metadata-generate.md +1 -1
  53. package/skills/experience-ui-bundle-metadata-generate/scripts/check-api-version.mjs +43 -0
  54. package/skills/experience-ui-bundle-metadata-generate/scripts/detect-framework.mjs +131 -0
  55. package/skills/experience-ui-bundle-metadata-generate/scripts/verify-bundle-location.mjs +152 -0
  56. package/skills/experience-ui-bundle-mfa-configure/references/branding.md +10 -6
  57. package/skills/experience-ui-bundle-project-generate/SKILL.md +13 -39
  58. package/skills/experience-ui-bundle-project-generate/scripts/flatten-project.mjs +33 -11
  59. package/skills/experience-ui-bundle-project-generate/scripts/generate-project.mjs +77 -0
  60. package/skills/experience-ui-bundle-project-generate/scripts/install-deps.mjs +95 -0
  61. package/skills/service-omni-channel-setup-coordinate/SKILL.md +1 -0
  62. package/skills/service-omni-command-center-analyze/SKILL.md +1 -0
  63. package/skills/service-omni-command-center-configure/SKILL.md +92 -0
  64. package/skills/service-omni-command-center-configure/references/api-notes.md +50 -0
  65. package/skills/service-omni-command-center-configure/scripts/configure-and-report.sh +257 -0
  66. package/skills/service-omni-command-center-configure/scripts/settings_document.py +97 -0
  67. package/skills/service-omni-command-center-configure/scripts/tests/test_command_center_configure_contracts.py +206 -0
  68. package/skills/experience-ui-bundle-app-coordinate/scripts/check-dangling-refs.sh +0 -42
  69. package/skills/experience-ui-bundle-app-coordinate/scripts/check-hosting-target.sh +0 -26
  70. package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-1-complete.sh +0 -35
  71. package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-4-complete.sh +0 -47
  72. package/skills/experience-ui-bundle-app-coordinate/scripts/check-phase-6-ready.sh +0 -33
  73. package/skills/experience-ui-bundle-app-coordinate/scripts/check-prerequisites.sh +0 -20
  74. package/skills/experience-ui-bundle-app-coordinate/scripts/check-sfdx-project.sh +0 -15
  75. package/skills/experience-ui-bundle-custom-app-generate/scripts/resolve-uibundle-path.sh +0 -30
  76. package/skills/experience-ui-bundle-frontend-generate/scripts/check-preconditions.sh +0 -37
  77. package/skills/experience-ui-bundle-frontend-generate/scripts/resolve-ui-bundle.sh +0 -66
  78. package/skills/experience-ui-bundle-frontend-generate/scripts/verify-rules.sh +0 -58
  79. package/skills/experience-ui-bundle-metadata-generate/scripts/check-api-version.sh +0 -30
  80. package/skills/experience-ui-bundle-metadata-generate/scripts/detect-framework.sh +0 -73
  81. package/skills/experience-ui-bundle-metadata-generate/scripts/verify-bundle-location.sh +0 -118
@@ -0,0 +1,90 @@
1
+ ---
2
+ version: "1.0.0"
3
+ date: 2026-05-15
4
+ ---
5
+
6
+ # Workshop Question Policy
7
+
8
+ Rules for generating stakeholder-facing questions in the WORKSHOP spoke. The skill produces these questions for a customer's internal stakeholders to answer **asynchronously** — not in a live workshop with the skill running. So the questions need to be open-ended, thought-provoking, scoped to what's actually unresolved, and respectful of stakeholder time.
9
+
10
+ ## Guiding principle
11
+
12
+ **Quality over coverage. Better to ask 4 great questions than 12 generic ones.**
13
+
14
+ There is an infinite possible question set the framework could generate. Most of those questions are noise for any specific persona. The job here is identifying *what's actually unresolved or high-leverage* for *this* persona, given everything the skill already knows.
15
+
16
+ ## Skip what you already know
17
+
18
+ The skill must NOT generate questions for things it already knows from the brand input, persona draft, or context. Stakeholder attention is the scarce resource.
19
+
20
+ **Examples of what to skip:**
21
+
22
+ - The brand input clearly says "always formal" → don't ask about Formality.
23
+ - The customer is a serious law firm → don't ask "How much humor?" (the answer is probably None and asking burns attention on a non-question).
24
+ - Channel is locked to telephony → don't ask "Should the agent use emoji?" (no formatting in audio).
25
+ - Personification is locked to Talking System → don't ask about character names.
26
+ - Identity is filled with strong-signal traits → don't ask the stakeholders to re-validate every adjective; pick one or two with productive tension.
27
+
28
+ This is harder than it sounds. The framework has 14 dimensions × 5+ persona artifacts × business context. Most could generate plausible questions. The skill must actively prune.
29
+
30
+ ## What to ask about
31
+
32
+ In priority order:
33
+
34
+ 1. **High up the dimensions ladder** — Identity, Personification, Register. These have the most leverage; getting them wrong cascades.
35
+ 2. **Where confidence is low** — when a draft dimension was filled with a default rather than a strong signal, that's a candidate question.
36
+ 3. **Where productive tension exists** — Tension Pairs in the framework (Cool Warmth + Bold Personality, Blunt Coloring + Playful Humor, etc.) are inherently questions stakeholders should weigh in on.
37
+ 4. **Where the brand input is silent or contradictory** — e.g., the brand guide says "approachable" but doesn't say how much humor; that's worth asking.
38
+ 5. **Where channel forces a tradeoff** — voice agents handling frustrated callers; humor in escalation flows.
39
+ 6. **Where the use case raises a tone-flex question** — the framework's tone-flex triggers (system errors, content sensitivity, escalation) are stakeholder-relevant moments.
40
+
41
+ ## What never to ask about
42
+
43
+ - Things the input or context already answers definitively.
44
+ - Things downstream of a higher decision already made (don't ask about emoji if Formal Register is locked — Formal pulls Emoji to None).
45
+ - Internal mechanics the stakeholders shouldn't be making decisions about (e.g., dimension constraint notes, tension-pair resolution rules).
46
+ - Anything that produces a "neutral default" answer — those questions waste stakeholder attention without changing the persona.
47
+
48
+ ## Question styles
49
+
50
+ Three styles, picked per question based on what's needed:
51
+
52
+ ### 1. Validate
53
+
54
+ Use when the skill has a strong-signal draft and wants stakeholder confirmation.
55
+
56
+ > "We assumed [X] from your brand guide. Confirm or push back."
57
+ > "The agent will speak in Coach register — instructive, takes a position. That fits the 'sales coach' framing in the brief. Right call?"
58
+
59
+ ### 2. Choose between
60
+
61
+ Use when there are two genuinely different positions on a spectrum, with consequences spelled out.
62
+
63
+ > "When a customer expresses frustration, would you rather the agent (A) acknowledge the frustration before solving, or (B) skip to the solve? A reads as more empathetic; B reads as more efficient. Pick one."
64
+
65
+ The two options must be **meaningfully different**. Don't write false binaries where both options are the same with cosmetic differences. If you can't articulate the consequence of each choice, drop the question.
66
+
67
+ ### 3. Open spectrum
68
+
69
+ Use when it's a blank slate — no signal in the input, and the stakeholders genuinely need to make the call.
70
+
71
+ > "Place the agent on this line: [Brisk] ⟷ [Languid]"
72
+ > "How much character should come through? [Talking System] ⟷ [Familiar Thing] ⟷ [Personal Assistant]"
73
+
74
+ These are dimension-card-shaped — print on a page, dot-vote, or place stickies on a FigJam board. Especially good for high-leverage dimensions (Identity, Personification, Register, Warmth) where the stakeholder team needs to converge.
75
+
76
+ ## Output format constraints
77
+
78
+ The workshop outline is meant to be **lightweight and printable** — a FigJam board, a whiteboard, a Google Doc with sticky notes. Not a slide deck. Not a long-form persona document. The skill's job is to produce the outline; the customer's job is to run the workshop with it.
79
+
80
+ - Aim for 4-8 total questions per workshop outline. Fewer if the persona is well-grounded.
81
+ - Group questions by Activity (Identity calibration, Tone in difficult moments, Spectrum check) so the workshop has a clear arc.
82
+ - Pre-read materials section: link to or attach the brand-grounded persona draft and sample dialog so stakeholders walk in informed.
83
+ - Include a brief "Background" paragraph for the facilitator (≤1 paragraph) summarizing where the persona stands and what input is needed.
84
+
85
+ ## Anti-patterns to refuse
86
+
87
+ - A 20-question workshop outline. If you're hitting 20, you haven't pruned.
88
+ - A workshop outline for a Talking System that asks "What kind of humor?" Skip. You know the answer.
89
+ - A workshop outline that asks every dimension "where on the spectrum?" — that's a coverage approach, not a leverage approach.
90
+ - A workshop outline where every option in a "choose between" pair reads as neutral or compromised. The job is to surface real tradeoffs, not to write safe choices.
@@ -0,0 +1,119 @@
1
+ ---
2
+ version: "1.0.0"
3
+ date: 2026-05-15
4
+ ---
5
+
6
+ # Workshop Scenario Seeds
7
+
8
+ A library of common stakeholder-relevant scenarios the WORKSHOP spoke uses as starting material for would-you-rather question pairs. These are conversational moments where persona-level decisions have visible consequences.
9
+
10
+ The skill picks scenarios from this library that align with the captured Use cases and the dimensions where stakeholder input is wanted. It customizes the response options A and B to the persona under design. **Do not use these seeds verbatim** — the skill should rewrite the user utterance and the response pair so they fit the customer's actual context (their language, their typical issues, their brand voice).
11
+
12
+ ## How to use this library
13
+
14
+ For each seed:
15
+ - The **user utterance** is a representative kind of moment, not a literal quote. Adapt the wording.
16
+ - The **A / B contrast** sketches the two persona directions that produce different responses. The skill rewrites both A and B in the persona's voice (or two persona voices, if asking the stakeholders to pick).
17
+ - The **dimensions exercised** field identifies which dimensions the choice surfaces. This helps the skill pick the right seed for the gap it's trying to fill.
18
+
19
+ ---
20
+
21
+ ## Seeds
22
+
23
+ ### Frustration
24
+
25
+ **User utterance:** the user expresses frustration with a problem (a billing issue, a delayed order, a feature that doesn't work).
26
+
27
+ - **A — acknowledge first, then solve.** "That's frustrating, and I'm sorry you're dealing with it. Let me look into it."
28
+ - **B — skip to the solve.** "Let me check that for you. One moment."
29
+
30
+ **Dimensions exercised:** Empathy Level, Emotional Coloring, Brevity. A reads as more empathetic; B reads as more efficient. Different audiences (and different brands) have different right answers.
31
+
32
+ ### Escalation
33
+
34
+ **User utterance:** the user requests a human agent or escalation.
35
+
36
+ - **A — acknowledge the request, hand off warmly.** "I hear you — let me get a teammate on this who can help directly. One moment."
37
+ - **B — execute the handoff cleanly, no flourish.** "Connecting you to a specialist now."
38
+
39
+ **Dimensions exercised:** Warmth, Brevity, Phrase Book (handoff category). A invests in the relationship at the moment of handoff; B prioritizes speed and clarity.
40
+
41
+ ### Ambiguity
42
+
43
+ **User utterance:** the user gives an ambiguous request that could mean two things ("can you check on that order").
44
+
45
+ - **A — ask for clarification before acting.** "Got it — which order? You've got [N] in flight. Order number or recent activity?"
46
+ - **B — make the most likely guess and surface it.** "Pulling up your most recent order — is that the one?"
47
+
48
+ **Dimensions exercised:** Brevity, Personality Intensity, Empathy Level. A is conservative and accurate; B is proactive and faster. Choice often signals whether the agent is meant to feel like a careful clerk or a quick assistant.
49
+
50
+ ### Success
51
+
52
+ **User utterance:** the user confirms something worked or expresses satisfaction.
53
+
54
+ - **A — match the energy.** "Great. Glad we got it sorted."
55
+ - **B — acknowledge minimally and move on.** "Done."
56
+
57
+ **Dimensions exercised:** Warmth, Personality Intensity, Brevity, Emotional Coloring. A invests in the moment; B treats success as the default state. Different brands handle success differently — luxury hospitality tends toward A, transactional efficiency toward B.
58
+
59
+ ### Error (system)
60
+
61
+ **User utterance:** something the agent tried to do failed (an API call timed out, a record wasn't found).
62
+
63
+ - **A — apologize, then recover.** "Sorry — that didn't go through. Let me try again."
64
+ - **B — state the issue, recover.** "That didn't go through. Trying again."
65
+
66
+ **Dimensions exercised:** Formality, Warmth, Empathy Level, Brevity. A apologizes for the system; B treats the error as a fact. Stakeholders sometimes care more than designers expect.
67
+
68
+ ### Off-topic
69
+
70
+ **User utterance:** the user asks something the agent isn't designed to handle ("what do you think of the latest movie?").
71
+
72
+ - **A — engage briefly, then redirect.** "Ha — not really my thing. What I can help with: [scope]."
73
+ - **B — redirect cleanly without engagement.** "I can help with [scope]. What's on your mind?"
74
+
75
+ **Dimensions exercised:** Personality Intensity, Humor, Brevity, Phrase Book (off-topic redirect category). A acknowledges the human moment; B keeps the conversation on rails.
76
+
77
+ ### Bad news
78
+
79
+ **User utterance:** the user is about to receive news they won't like (their order is delayed; the feature isn't available; the policy doesn't allow it).
80
+
81
+ - **A — soften the delivery.** "Here's what I'm seeing — and it's not the news either of us wanted: [bad news]."
82
+ - **B — deliver directly.** "Your order is delayed by 3 days."
83
+
84
+ **Dimensions exercised:** Empathy Level, Emotional Coloring, Personality Intensity, Tone Flex. A leans into Encouraging coloring; B leans into Blunt or Neutral. Strong stakeholder-leverage question — the answer reveals brand stance on hard truths.
85
+
86
+ ### Repeat customer
87
+
88
+ **User utterance:** the user is a returning customer the agent has context on.
89
+
90
+ - **A — personalize the greeting.** "Welcome back, [name]. Last time we were sorting out [thing]."
91
+ - **B — start fresh, treat each session as new.** "Hi — what can I help with today?"
92
+
93
+ **Dimensions exercised:** Warmth, Personality Intensity, Personification. A treats the relationship as continuous; B treats each session discretely. Often a privacy / brand-stance question.
94
+
95
+ ### Compliment / kudos
96
+
97
+ **User utterance:** the user thanks the agent or compliments its help.
98
+
99
+ - **A — accept the thanks warmly.** "Glad it helped. Anything else?"
100
+ - **B — deflect to the user's effort.** "You did the work — I just pulled the data. Anything else?"
101
+
102
+ **Dimensions exercised:** Personality Intensity, Warmth, Humor. A is straightforward; B is humble and frames the interaction as collaborative. The choice signals whether the agent has its own agency or is a tool.
103
+
104
+ ### Disagreement
105
+
106
+ **User utterance:** the user pushes back on the agent's recommendation or information.
107
+
108
+ - **A — yield gracefully.** "Fair enough — let's go with your call. What can I do next?"
109
+ - **B — hold the line with reasoning.** "Hear you on that. The reason I went there: [reason]. Want to walk through together?"
110
+
111
+ **Dimensions exercised:** Register, Personality Intensity, Empathy Level. A is more Subordinate / accommodating; B is more Coach / Advisor with conviction. Reveals whether the agent has a point of view.
112
+
113
+ ---
114
+
115
+ ## Coverage
116
+
117
+ The library covers the situations a typical Agentforce agent will encounter — happy path, uncertainty, hard moments, and edge cases. The skill doesn't need to use all of these in any one workshop. **Pick 2-4 that align with the persona's use cases and the gaps in dimension coverage.**
118
+
119
+ If the agent's use cases include heavy escalation work, prioritize Frustration + Escalation + Bad news. If the agent is consultative (sales coach, advisor), prioritize Disagreement + Ambiguity + Compliment. If the agent is transactional, Frustration + Success + Off-topic may cover it.
@@ -0,0 +1,223 @@
1
+ #!/usr/bin/env python3
2
+ """Parse an Agent Script .agent file and return a normalized dict.
3
+
4
+ READ-ONLY. This script never writes back to the source file. It opens the
5
+ file, walks the structure, and returns a normalized Python dict that the
6
+ SKILL.md flow can iterate over without caring about the file's exact YAML
7
+ nesting.
8
+
9
+ Usage:
10
+ python3 parse_agent_yaml.py <path-to-.agent-file>
11
+
12
+ Output (stdout): JSON-formatted normalized structure.
13
+
14
+ Normalized shape:
15
+ {
16
+ "system": {
17
+ "instructions": str,
18
+ "welcome": str,
19
+ "error": str,
20
+ },
21
+ "config": {
22
+ "developer_name": str,
23
+ "agent_label": str,
24
+ "agent_type": str,
25
+ ...
26
+ },
27
+ "subagents": [
28
+ {
29
+ "name": str,
30
+ "description": str,
31
+ "instructions": str | None,
32
+ "reasoning_instructions": str | None,
33
+ "system_override": str | None,
34
+ "actions": [{"name": str, "progress_indicator_message": str | None}, ...]
35
+ },
36
+ ...
37
+ ],
38
+ "actions_global": [{"name": str, "progress_indicator_message": str | None}, ...],
39
+ }
40
+
41
+ The skill uses this structure to:
42
+ - SCORE: traverse subagents and actions, score per layer
43
+ - ENCODE (brownfield): produce a proposed-new-file with only persona-bearing
44
+ fields modified, preserving everything else exactly as the source had it.
45
+
46
+ Note on Agent Script syntax: .agent files are YAML-LIKE but use directive
47
+ syntax (`->`, `|`, `system:`, `subagent name:`) that isn't strict YAML. This
48
+ parser does best-effort regex-based extraction targeted at the persona-bearing
49
+ fields the skill needs. For full Agent Script parsing, refer to the
50
+ developing-agentforce skill in forcedotcom/sf-skills.
51
+ """
52
+
53
+ import json
54
+ import re
55
+ import sys
56
+ from pathlib import Path
57
+
58
+
59
+ def parse_agent_file(path: Path) -> dict:
60
+ """Parse an .agent file and return normalized structure. Read-only."""
61
+ text = path.read_text()
62
+
63
+ return {
64
+ "system": _extract_system(text),
65
+ "config": _extract_config(text),
66
+ "subagents": _extract_subagents(text),
67
+ "actions_global": [], # Global actions are rare; usually nested under subagents.
68
+ }
69
+
70
+
71
+ def _extract_block(text: str, header: str) -> str | None:
72
+ """Extract a top-level block (system, config, etc.) by indent boundary.
73
+
74
+ Returns the block content (lines after the header, dedented) or None if
75
+ the header isn't present.
76
+ """
77
+ lines = text.splitlines()
78
+ in_block = False
79
+ block_indent: int | None = None
80
+ block_lines: list[str] = []
81
+
82
+ for line in lines:
83
+ if not in_block:
84
+ stripped = line.strip()
85
+ if stripped == header or stripped == f"{header}:":
86
+ in_block = True
87
+ continue
88
+ else:
89
+ if not line.strip():
90
+ block_lines.append(line)
91
+ continue
92
+ indent = len(line) - len(line.lstrip())
93
+ if block_indent is None:
94
+ block_indent = indent
95
+ if indent < block_indent and line.strip():
96
+ # Dedent below the block — we're out.
97
+ break
98
+ block_lines.append(line[block_indent:] if len(line) >= block_indent else line)
99
+
100
+ return "\n".join(block_lines).rstrip() if block_lines else None
101
+
102
+
103
+ def _extract_field(block: str | None, key: str) -> str | None:
104
+ """Extract a `key: value` or `key: |` literal-block field from a block."""
105
+ if not block:
106
+ return None
107
+
108
+ # Try literal block scalar first: key: |\n text...
109
+ pattern_literal = rf"^{re.escape(key)}:\s*\|\s*\n((?:[ \t]+.*\n?)*)"
110
+ m = re.search(pattern_literal, block, flags=re.MULTILINE)
111
+ if m:
112
+ return _dedent(m.group(1)).rstrip()
113
+
114
+ # Try inline string: key: "value" or key: value
115
+ pattern_inline = rf'^{re.escape(key)}:\s*"?([^"\n]*?)"?\s*$'
116
+ m = re.search(pattern_inline, block, flags=re.MULTILINE)
117
+ if m:
118
+ val = m.group(1).strip()
119
+ return val if val else None
120
+
121
+ return None
122
+
123
+
124
+ def _dedent(text: str) -> str:
125
+ """Strip the common leading whitespace from every line."""
126
+ lines = text.splitlines()
127
+ indents = [len(l) - len(l.lstrip()) for l in lines if l.strip()]
128
+ if not indents:
129
+ return text
130
+ common = min(indents)
131
+ return "\n".join(l[common:] if len(l) >= common else l for l in lines)
132
+
133
+
134
+ def _extract_system(text: str) -> dict:
135
+ block = _extract_block(text, "system")
136
+ if not block:
137
+ return {"instructions": None, "welcome": None, "error": None}
138
+
139
+ # messages is a sub-block
140
+ messages_block = _extract_block(block, "messages")
141
+
142
+ return {
143
+ "instructions": _extract_field(block, "instructions"),
144
+ "welcome": _extract_field(messages_block, "welcome"),
145
+ "error": _extract_field(messages_block, "error"),
146
+ }
147
+
148
+
149
+ def _extract_config(text: str) -> dict:
150
+ block = _extract_block(text, "config")
151
+ if not block:
152
+ return {}
153
+
154
+ return {
155
+ "developer_name": _extract_field(block, "developer_name"),
156
+ "agent_label": _extract_field(block, "agent_label"),
157
+ "description": _extract_field(block, "description"),
158
+ "agent_type": _extract_field(block, "agent_type"),
159
+ "default_agent_user": _extract_field(block, "default_agent_user"),
160
+ }
161
+
162
+
163
+ def _extract_subagents(text: str) -> list[dict]:
164
+ """Find each `subagent NAME:` block and extract its persona-bearing fields."""
165
+ # Match subagent declarations and capture name + body
166
+ pattern = r"^subagent\s+(\w+):\s*\n((?:[ \t]+.*\n?)*)"
167
+ subagents: list[dict] = []
168
+
169
+ for match in re.finditer(pattern, text, flags=re.MULTILINE):
170
+ name = match.group(1)
171
+ body = _dedent(match.group(2))
172
+
173
+ system_override_block = _extract_block(body, "system")
174
+ reasoning_block = _extract_block(body, "reasoning")
175
+
176
+ subagents.append({
177
+ "name": name,
178
+ "description": _extract_field(body, "description"),
179
+ "system_override": _extract_field(system_override_block, "instructions"),
180
+ "reasoning_instructions": _extract_field(reasoning_block, "instructions"),
181
+ "actions": _extract_subagent_actions(body),
182
+ })
183
+
184
+ return subagents
185
+
186
+
187
+ def _extract_subagent_actions(subagent_body: str) -> list[dict]:
188
+ """Extract per-action progress_indicator_message from a subagent's actions: block."""
189
+ actions_block = _extract_block(subagent_body, "actions")
190
+ if not actions_block:
191
+ return []
192
+
193
+ actions: list[dict] = []
194
+ # Action declarations are like: `action_name:` followed by indented properties
195
+ pattern = r"^(\w+):\s*\n((?:[ \t]+.*\n?)*)"
196
+ for match in re.finditer(pattern, actions_block, flags=re.MULTILINE):
197
+ name = match.group(1)
198
+ body = _dedent(match.group(2))
199
+ actions.append({
200
+ "name": name,
201
+ "progress_indicator_message": _extract_field(body, "progress_indicator_message"),
202
+ })
203
+
204
+ return actions
205
+
206
+
207
+ def main() -> int:
208
+ if len(sys.argv) != 2:
209
+ print("Usage: parse_agent_yaml.py <path-to-.agent-file>", file=sys.stderr)
210
+ return 1
211
+
212
+ path = Path(sys.argv[1])
213
+ if not path.exists():
214
+ print(f"File not found: {path}", file=sys.stderr)
215
+ return 1
216
+
217
+ parsed = parse_agent_file(path)
218
+ print(json.dumps(parsed, indent=2))
219
+ return 0
220
+
221
+
222
+ if __name__ == "__main__":
223
+ sys.exit(main())
@@ -1,16 +1,15 @@
1
1
  ---
2
2
  name: dx-app-analytics-query
3
- description: "ISV App Analytics metadata types — AppAnalyticsQueryRequest and AppAnalyticsSettings. Use this skill when the user asks about retrieving managed package usage data, configuring App Analytics simulation mode, querying subscriber snapshots, or understanding the AppAnalyticsQueryRequest lifecycle (New → Pending → Complete → Expired). TRIGGER when: user mentions App Analytics, AppAnalyticsQueryRequest, AppAnalyticsSettings, package usage data, subscriber analytics, ISV analytics, or simulation mode for app analytics. DO NOT TRIGGER when: the task is about standard Salesforce reports/dashboards (use reporting skills), custom SOQL on Account/Contact (use platform-soql-query)."
3
+ description: "ISV App Analytics metadata types — AppAnalyticsQueryRequest and AppAnalyticsSettings. Use this skill when the user asks about retrieving managed package usage data, configuring App Analytics simulation mode, querying subscriber snapshots, or understanding the AppAnalyticsQueryRequest lifecycle (New → Pending → Complete → Expired). TRIGGER when: user mentions App Analytics, AppAnalyticsQueryRequest, AppAnalyticsSettings, package usage data, subscriber analytics, ISV analytics, or simulation mode for app analytics. DO NOT TRIGGER when: the task is about standard Salesforce reports/dashboards (use reporting skills), custom SOQL on Account/Contact (use querying-soql), or Data Cloud query/search (use retrieving-datacloud)."
4
4
  metadata:
5
- cliTools:
6
- - tool: ["sf"]
7
- semver: ">=2.0.0"
8
- relatedSkills:
9
- - "platform-metadata-deploy"
10
- - "platform-soql-query"
11
5
  version: "1.0"
12
6
  domains: ["Developer Experience"]
13
7
  minApiVersion: "56.0"
8
+ relatedSkills:
9
+ - "platform-soql-query"
10
+ cliTools:
11
+ - tool: ["sf"]
12
+ semver: ">=2.0.0"
14
13
  ---
15
14
 
16
15
  # App Analytics
@@ -28,8 +27,9 @@ Use `dx-app-analytics-query` when the work involves:
28
27
 
29
28
  Delegate elsewhere when the user is:
30
29
  - Running standard CRM SOQL queries → platform-soql-query
30
+ - Working with Data Cloud SQL or DMOs → retrieving-datacloud
31
31
  - Building reports/dashboards on standard objects → reporting skills
32
- - Deploying or retrieving generic metadata XML → platform-metadata-deploy / retrieving-metadata
32
+ - Deploying or retrieving generic metadata XML → deploying-metadata / retrieving-metadata
33
33
 
34
34
  ---
35
35
 
@@ -42,7 +42,7 @@ Before starting any phase, verify these preconditions are met:
42
42
 
43
43
  1. **Authenticated Salesforce org**: Run `sf org display` to confirm a default org is set and authenticated. If not, prompt the user to authenticate: `sf org login web`
44
44
  2. **Required CLI tools**: Verify `sf`, `npm`, and `npx` are available (declared in metadata.cliTools)
45
- 3. **Node.js version**: Run `scripts/check-prerequisites.sh` and report any errors it returns
45
+ 3. **Node.js version**: Run `node scripts/check-prerequisites.mjs` and report any errors
46
46
  4. **Org features** (if deploying): Experience Cloud enabled, appropriate licenses, and Sites enabled
47
47
 
48
48
  If any precondition fails, stop and report the specific missing requirement before attempting any phase execution.
@@ -114,7 +114,7 @@ Offer prebuilt starter template (experience-ui-bundle-project-generate)
114
114
  v
115
115
  If template chosen: scaffold via sf template generate project -- Phase 1 skipped
116
116
  v
117
- If declined: run scripts/check-sfdx-project.sh
117
+ If declined: run node scripts/check-sfdx-project.mjs
118
118
  v
119
119
  If missing: create sfdx-project.json
120
120
  v
@@ -123,7 +123,7 @@ Verify project directory initialized
123
123
 
124
124
  Offers a faster, less error-prone starting point before building from scratch. If no template is used, ensures an SFDX project exists before attempting to generate a UI bundle — without this, `sf template generate ui-bundle` will fail with a hard error. Always check first — do not assume the project structure exists.
125
125
 
126
- **Action:** Load `experience-ui-bundle-project-generate` and offer the two starter templates. If declined, run `scripts/check-sfdx-project.sh` and report any errors it returns. If the script reports an error, create the missing `sfdx-project.json` before proceeding.
126
+ **Action:** Load `experience-ui-bundle-project-generate` and offer the two starter templates. If declined, run `node scripts/check-sfdx-project.mjs`; on error, create the missing `sfdx-project.json` before proceeding.
127
127
 
128
128
  ### Phase 1: Scaffolding (Foundation)
129
129
 
@@ -154,7 +154,7 @@ Creates the UI bundle directory structure, meta XML (including hosting target),
154
154
  - `package.json` — remove now-unused dependencies (`vite-plugin-graphql-codegen`, `@graphql-codegen/*`, `playwright`, `vitest`, etc.) and their npm scripts, not just the config files.
155
155
  - Any component/page that imports a deleted hook, client, or shadcn component (e.g. `useAsyncData`, `graphqlClient`) must have that import and its usage removed or replaced — never leave an import pointing at a file that no longer exists.
156
156
  - Do NOT re-add a file you just deleted elsewhere in the same pass (e.g. deleting `codegen.yml` while still emitting `.graphqlrc.yml`) — decide scope once per concern and apply it consistently across every file that touches that concern.
157
- - Before finishing Phase 4, run `scripts/check-dangling-refs.sh <deleted-basename>` for each deleted file and report any errors it returns.
157
+ - Before finishing Phase 4, run `node scripts/check-dangling-refs.mjs <deleted-basename>` for each deleted file and report any errors.
158
158
 
159
159
  ### Phase 2: Features (Required if prompt mentions feature keywords — see "Prompt Classification Keywords" above)
160
160
 
@@ -378,12 +378,12 @@ Execute each phase sequentially following the standard pattern in `references/ph
378
378
  ---
379
379
 
380
380
  **Phase 0 -- Template Offer & Bootstrap**
381
- - Load `experience-ui-bundle-project-generate`, offer templates. If chosen: skip Phase 1, continue at Phase 2. If declined: run `scripts/check-sfdx-project.sh`, create project if missing.
381
+ - Load `experience-ui-bundle-project-generate`, offer templates. If chosen: skip Phase 1, continue at Phase 2. If declined: run `node scripts/check-sfdx-project.mjs`, create project if missing.
382
382
 
383
383
  **Phase 1 -- Scaffolding** (skip if template used in Phase 0)
384
- - **Precondition**: `scripts/check-sfdx-project.sh` passes
384
+ - **Precondition**: `node scripts/check-sfdx-project.mjs` passes
385
385
  - Load `experience-ui-bundle-metadata-generate`. Determine hosting target FIRST. Run `sf template generate ui-bundle --template reactbasic`, configure meta XML with `<target>`.
386
- - **Post-verification**: `scripts/check-phase-1-complete.sh` passes
386
+ - **Post-verification**: `node scripts/check-phase-1-complete.mjs` passes
387
387
 
388
388
  **Phase 2 -- Features** (run on any feature keyword, even if pre-installed — see "Prompt Classification Keywords")
389
389
  - Load `experience-ui-bundle-features-generate`. Install features, integrate examples. Verify with `npm run build`.
@@ -395,25 +395,25 @@ Execute each phase sequentially following the standard pattern in `references/ph
395
395
  - Load `experience-ui-bundle-salesforce-data-access`. Fetch schema, ground entities, generate queries/mutations. Verify with `npx eslint`.
396
396
 
397
397
  **Phase 4 -- UI** (ALWAYS REQUIRED)
398
- - **Precondition**: `scripts/check-phase-1-complete.sh` passes
398
+ - **Precondition**: `node scripts/check-phase-1-complete.mjs` passes
399
399
  - Load `experience-ui-bundle-frontend-generate`. Build layout, pages, components. Replace all boilerplate.
400
- - **Post-verification**: `scripts/check-phase-4-complete.sh` passes
400
+ - **Post-verification**: `node scripts/check-phase-4-complete.mjs` passes
401
401
  - **CRITICAL**: Phase 4 generates the actual React UI. Never skip.
402
402
 
403
403
  **Phase 5 -- Integrations** (skip if not requested)
404
404
  - Load `experience-ui-bundle-agentforce-client-generate` (5a) and/or `experience-ui-bundle-file-upload-generate` (5b) as needed.
405
405
 
406
406
  **Phase 6 -- Deployment**
407
- - **Precondition**: `scripts/check-phase-6-ready.sh` passes
407
+ - **Precondition**: `node scripts/check-phase-6-ready.mjs` passes
408
408
  - Load `experience-ui-bundle-deploy`. Follow 7-step sequence. Prefer `scripts/org-setup.mjs` if available.
409
409
  - **CRITICAL**: Guard against empty schema — retry fetch 3x before codegen.
410
410
 
411
411
  **Phase 7a -- Experience Site** (external users)
412
- - **Trigger**: `scripts/check-hosting-target.sh` outputs "ExperienceSite"
412
+ - **Trigger**: `node scripts/check-hosting-target.mjs` outputs "ExperienceSite"
413
413
  - Load `experience-ui-bundle-site-generate`. Deploy site infrastructure.
414
414
 
415
415
  **Phase 7b -- Custom Application** (internal users)
416
- - **Trigger**: `scripts/check-hosting-target.sh` outputs "CustomApplication"
416
+ - **Trigger**: `node scripts/check-hosting-target.mjs` outputs "CustomApplication"
417
417
  - Load `experience-ui-bundle-custom-app-generate`. Deploy app metadata.
418
418
 
419
419
  ### STEP 2.5: Phase Completion Validation
@@ -3,7 +3,7 @@
3
3
  Before proceeding to STEP 3 (Final Summary), validate that all required phases were executed:
4
4
 
5
5
  **Critical Validation (MUST pass):**
6
- - [ ] **Phase 0 (Template Offer & Bootstrap) executed**: If no template was used, run `scripts/check-sfdx-project.sh`. If it returns non-zero, STOP and report error:
6
+ - [ ] **Phase 0 (Template Offer & Bootstrap) executed**: If no template was used, run `node scripts/check-sfdx-project.mjs`. If it returns non-zero, STOP and report error:
7
7
  ```text
8
8
  ERROR: No SFDX project detected. Phase 0 (Bootstrap) is REQUIRED before scaffolding.
9
9
  Run `sf project generate` (or create sfdx-project.json) before invoking
@@ -11,7 +11,7 @@ Before proceeding to STEP 3 (Final Summary), validate that all required phases w
11
11
  ```
12
12
  If a template was used in Phase 0, this check is satisfied by the template's own scaffolding — skip re-running the script.
13
13
 
14
- - [ ] **Phase 1 hosting target resolved**: Run `scripts/check-hosting-target.sh`. If it returns non-zero, STOP and report error:
14
+ - [ ] **Phase 1 hosting target resolved**: Run `node scripts/check-hosting-target.mjs`. If it returns non-zero, STOP and report error:
15
15
  ```text
16
16
  ERROR: Hosting target was not resolved in Phase 1. A UI bundle without a <target> in its
17
17
  meta XML will not be visible in the org. Determine Experience Site vs Custom Application
@@ -33,7 +33,7 @@ Before proceeding to STEP 3 (Final Summary), validate that all required phases w
33
33
  Exactly one of Phase 7a/7b must run -- it is never optional or "skipped".
34
34
  ```
35
35
 
36
- - [ ] **No dangling references after scaffold pruning**: If any file was deleted during Phase 1 scaffold pruning (see "Prune unused scaffold" in SKILL.md), run `scripts/check-dangling-refs.sh <deleted-basename>` for each deleted file. If it returns non-zero (e.g. `vite.config.ts` still imports `vite-plugin-graphql-codegen` after `codegen.yml` was deleted, or a page still imports a deleted hook/component), STOP and report error:
36
+ - [ ] **No dangling references after scaffold pruning**: If any file was deleted during Phase 1 scaffold pruning (see "Prune unused scaffold" in SKILL.md), run `node scripts/check-dangling-refs.mjs <deleted-basename>` for each deleted file. If it returns non-zero (e.g. `vite.config.ts` still imports `vite-plugin-graphql-codegen` after `codegen.yml` was deleted, or a page still imports a deleted hook/component), STOP and report error:
37
37
  ```text
38
38
  ERROR: Scaffold pruning left a dangling reference -- <file> was deleted but <other-file>
39
39
  still imports/references it. Remove the reference (or restore the file) before completing
@@ -4,21 +4,23 @@ Each phase follows this standard pattern:
4
4
 
5
5
  | Step | What to do | Why |
6
6
  |------|-----------|-----|
7
- | **0. Precondition Check** | Run `scripts/check-phase-N-*.sh` script | Verifies prerequisites are met before proceeding |
7
+ | **0. Precondition Check** | Run the matching `node scripts/check-phase-N-*.mjs` script | Verifies prerequisites are met before proceeding |
8
8
  | **1. Load skill** | Invoke the skill for this phase | Gives you current rules, patterns, constraints |
9
9
  | **2. Execute** | Follow the loaded skill's workflow | The skill defines HOW to do the work correctly |
10
10
  | **3. Verify** | Run lint and build | Catch errors before moving to next phase |
11
- | **4. Post-verification** | Run `scripts/check-phase-N-complete.sh` (if available) | Machine-checkable validation of phase completion |
11
+ | **4. Post-verification** | Run the matching `node scripts/check-phase-N-complete.mjs` (if available) | Machine-checkable validation of phase completion |
12
12
  | **5. Checkpoint** | Confirm phase completion | Ensures dependencies satisfied for next phase |
13
13
 
14
14
  **CRITICAL: Do NOT skip step 1 (loading the skill).** Skills evolve — always load the current version.
15
15
 
16
+ **Always invoke every script via `node` (never as a bare executable)** so it works on Windows cmd/PowerShell as well as macOS/Linux/Git Bash.
17
+
16
18
  ## Available Verification Scripts
17
19
 
18
- - `scripts/check-sfdx-project.sh` - Validates SFDX project exists (Phase 0/1 prerequisite)
19
- - `scripts/check-phase-1-complete.sh` - Verifies scaffold complete (Phase 4/6 prerequisite)
20
- - `scripts/check-phase-4-complete.sh` - Verifies UI build complete (Phase 6 prerequisite)
21
- - `scripts/check-phase-6-ready.sh` - Verifies deployment prerequisites met
22
- - `scripts/check-hosting-target.sh` - Determines which hosting target is configured
20
+ - `node scripts/check-sfdx-project.mjs` - Validates SFDX project exists (Phase 0/1 prerequisite)
21
+ - `node scripts/check-phase-1-complete.mjs` - Verifies scaffold complete (Phase 4/6 prerequisite)
22
+ - `node scripts/check-phase-4-complete.mjs` - Verifies UI build complete (Phase 6 prerequisite)
23
+ - `node scripts/check-phase-6-ready.mjs` - Verifies deployment prerequisites met
24
+ - `node scripts/check-hosting-target.mjs` - Determines which hosting target is configured
23
25
 
24
26
  All scripts exit 0 on success, exit 1 on failure with an error message.