[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CB4720SKV95MSXTPJ5N3F6":3,"skill-same:01M7CB4720SKV95MSXTPJ5N3F6":63},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":6,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M7CB4720SKV95MSXTPJ5N3F6","sf-ai-agentscript",null,"Agent Script DSL for deterministic Agentforce agents. TRIGGER when: user writes or edits .agent files, builds FSM-based agents, uses Agent Script CLI (sf agent generate authoring-bundle, sf agent validate authoring-bundle, sf agent preview, sf agent publish authoring-bundle, sf agent activate), or asks about deterministic agent patterns, slot filling, or instruction resolution. DO NOT TRIGGER when: Builder metadata work (use sf-ai-agentforce), agent testing (use sf-ai-agentforce-testing), or persona design (use sf-ai-agentforce-persona).","om-scogo\u002Fskillsh-scraper","om-scogo","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160466840?v=4","01M79AWB6DFVCQ7RK70CS34B96","Om Achrekar","01M79AWB6ZM9SKR8KDH1WSSM22",0,"MIT","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fjaganpro-sf-skills\u002Fsf-ai-agentscript\u002FSkill.md",[],[],"2026-11-15 14:19:17",false,"---\nname: sf-ai-agentscript\ndescription: >\n  Agent Script DSL for deterministic Agentforce agents.\n  TRIGGER when: user writes or edits .agent files, builds FSM-based agents,\n  uses Agent Script CLI (sf agent generate authoring-bundle, sf agent validate\n  authoring-bundle, sf agent preview, sf agent publish authoring-bundle, sf\n  agent activate), or asks about deterministic agent patterns, slot filling, or\n  instruction resolution.\n  DO NOT TRIGGER when: Builder metadata work (use sf-ai-agentforce), agent\n  testing (use sf-ai-agentforce-testing), or persona design\n  (use sf-ai-agentforce-persona).\nlicense: MIT\ncompatibility: \"Requires Agentforce license and API v66.0+; Einstein Agent User is required for Service Agents only\"\nmetadata:\n  version: \"2.9.0\"\n  author: \"Jag Valaiyapathy\"\n  scoring: \"100 points across 6 categories\"\n  validated: \"0-shot generation tested against multiple representative sample agents. Agent user setup validated against representative Service Agent and Employee Agent scenarios.\"\n  last_validated: \"2026-03-20\"\n  validation_status: \"PASS\"\n  validation_agents: \"24\"\n  validate_by: \"2026-04-10\"\n---\n\n# SF-AI-AgentScript Skill\n\nAgent Script is the **code-first** path for deterministic Agentforce agents. Use this skill when the user is authoring `.agent` files, building finite-state topic flows, or needs repeatable control over routing, variables, actions, and publish behavior.\n\n> Start with the shortest guide first: [references\u002Factivation-checklist.md](references\u002Factivation-checklist.md)\n>\n> Migrating from the Builder UI? Use [references\u002Fmigration-guide.md](references\u002Fmigration-guide.md)\n\n## When This Skill Owns the Task\n\nUse `sf-ai-agentscript` when the work involves:\n- creating or editing `.agent` files\n- deterministic topic routing, guards, and transitions\n- Agent Script CLI workflows (`sf agent generate authoring-bundle`, `sf agent validate authoring-bundle`, `sf agent preview`, `sf agent publish authoring-bundle`, `sf agent activate`)\n- slot filling, instruction resolution, post-action loops, or FSM design\n\nDelegate elsewhere when the user is:\n- maintaining Builder metadata agents (`GenAiFunction`, `GenAiPlugin`, `GenAiPromptTemplate`, Models API, custom Lightning types) → [sf-ai-agentforce](..\u002Fsf-ai-agentforce\u002FSKILL.md)\n- designing persona \u002F tone \u002F voice → [sf-ai-agentforce-persona](..\u002Fsf-ai-agentforce-persona\u002FSKILL.md)\n- building formal test plans or coverage loops → [sf-ai-agentforce-testing](..\u002Fsf-ai-agentforce-testing\u002FSKILL.md)\n\nIf the user is in Builder Script \u002F Canvas view but the outcome is a `.agent` authoring bundle, keep the work in `sf-ai-agentscript`.\n\n---\n\n## Right-Size Determinism\n\n- Determinism is a dial, not a destination.\n- Use Agent Script when “mostly right” is not acceptable: gates, mandatory sequencing, explicit state transitions, compliance, or drift control.\n- If a workflow is fully static and linear, use Flow or Apex instead of scripting the conversation.\n- Prefer a deterministic envelope: deterministic entry\u002Fgate → flexible middle → deterministic closeout.\n- More determinism is not automatically better. Start minimal, then harden only the parts that show routing drift, sequencing failures, or compliance risk.\n\n---\n\n## Required Context to Gather First\n\nAsk for or infer:\n- agent purpose and whether Agent Script is truly the right fit\n- Service Agent vs Employee Agent\n- target org and publish intent\n- expected actions \u002F targets (Flow, Apex, PromptTemplate, etc.)\n- whether the request is authoring, validation, preview, or publish troubleshooting\n\n---\n\n## Activation Checklist\n\nBefore you author or fix any `.agent` file, verify these first:\n\n1. **Exactly one `start_agent` block**\n2. **No mixed tabs and spaces**\n3. **Booleans are `True` \u002F `False`**\n4. **No `else if` and no nested `if`**\n5. **No top-level `actions:` block**\n6. **No `@inputs` in `set` expressions**\n7. **`linked` variables have no defaults**\n8. **`linked` variables do not use `object` \u002F `list` types**\n9. **Use explicit `agent_type`**\n10. **Use `@actions.` prefixes consistently**\n11. **Use `run @actions.X` only when `X` is a topic-level action definition with `target:`**\n12. **Do not branch directly on raw `@system_variables.user_input contains\u002Fstartswith\u002Fendswith` for intent routing**\n13. **On prompt-template outputs, prefer `is_displayable: False` + `is_used_by_planner: True`**\n14. **Do not assume `@outputs.X` is scalar — inspect the output schema before branching or assignment**\n\nFor the expanded version, use [references\u002Factivation-checklist.md](references\u002Factivation-checklist.md).\n\n---\n\n## Non-Negotiable Rules\n\n### 1) Service Agent vs Employee Agent\n\n| Agent type | Required | Forbidden \u002F caution |\n|---|---|---|\n| `AgentforceServiceAgent` | Valid `default_agent_user`, correct permissions, target-org checks, prefer `sf org create agent-user` | Publishing without a real Einstein Agent User |\n| `AgentforceEmployeeAgent` | Explicit `agent_type` | Supplying `default_agent_user` |\n\nFull details: [references\u002Fagent-user-setup.md](references\u002Fagent-user-setup.md)\n\n### 2) Recommended top-level block convention\n\nUse this order for consistency in this skill's examples and reviews:\n\n```yaml\nconfig:\nvariables:\nsystem:\nconnection:\nknowledge:\nlanguage:\nstart_agent:\ntopic:\n```\n\nOfficial Salesforce materials present top-level blocks in differing sequences, and local validation evidence indicates multiple orderings compile. Treat this as a style convention, not a standalone correctness or publish blocker.\n\n### 3) Critical config fields\n\n| Field | Rule |\n|---|---|\n| `developer_name` | Must match folder \u002F bundle name |\n| `description` | Public docs\u002Fexamples should use this config field |\n| `agent_type` | Set explicitly every time |\n| `default_agent_user` | Service Agents only |\n\nLocal tooling also accepts `agent_description:` for compatibility, but this skill's public docs and examples should prefer `description:`.\n\n### 4) Syntax blockers you should treat as immediate failures\n\n- `else if`\n- nested `if`\n- comment-only `if` bodies\n- top-level `actions:`\n- invocation-level `inputs:` \u002F `outputs:` blocks\n- reserved variable \u002F field names like `description` and `label`\n\nCanonical rule set: [references\u002Fsyntax-reference.md](references\u002Fsyntax-reference.md) and [references\u002Fvalidator-rule-catalog.md](references\u002Fvalidator-rule-catalog.md)\n\n---\n\n## Recommended Workflow\n\n## Recommended Authoring Workflow\n\n### Phase 1 — design the agent\n- decide whether the problem is actually deterministic enough for Agent Script\n- model topics as states and transitions as edges\n- define only the variables you truly need\n\n### Phase 2 — author the `.agent`\n- create `config`, `system`, `start_agent`, and topics first\n- add target-backed actions with full `inputs:` and `outputs:`\n- use `available when` for deterministic tool visibility\n- normalize raw intent\u002Fvalidation signals into booleans or enums before branching; avoid direct substring checks on raw user utterances for critical control flow\n- keep post-action checks at the **top** of `instructions: ->`\n\n### Default authoring stance\n\n- Default to direct `.agent` authoring and edits in source control.\n- Use `sf agent generate authoring-bundle --no-spec` only when the user wants local bundle scaffolding.\n- Treat `sf agent generate agent-spec` as optional ideation \u002F topic bootstrap, not the default workflow.\n- Do not route Agent Script users toward `sf agent create` or `sf agent generate template`.\n\n### Phase 3 — validate continuously\nValidation already runs automatically on write\u002Fedit. Use the CLI before publish:\n\n```bash\nsf agent validate authoring-bundle --api-name MyAgent -o TARGET_ORG --json\n```\n\nThe validator covers structure, runtime gotchas, target readiness, and org-aware Service Agent checks. Rule IDs live in [references\u002Fvalidator-rule-catalog.md](references\u002Fvalidator-rule-catalog.md).\n\n### Phase 4 — preview smoke test\nUse the preview loop before publish:\n- derive 3–5 smoke utterances\n- start preview with the `start` \u002F `send` \u002F `end` subcommands, not bare `sf agent preview`\n- if you use `--authoring-bundle`, always choose a mode explicitly: `--simulate-actions` or `--use-live-actions`\n- inspect topic routing \u002F action invocation \u002F safety \u002F grounding\n- fix and rerun up to 3 times\n\nFull loop: [references\u002Fpreview-test-loop.md](references\u002Fpreview-test-loop.md)\n\n### Phase 5 — publish and activate\n```bash\nsf agent publish authoring-bundle --api-name MyAgent -o TARGET_ORG --json\n\n# Manual activation\nsf agent activate --api-name MyAgent -o TARGET_ORG\n\n# CI \u002F deterministic activation of a known BotVersion\nsf agent activate --api-name MyAgent --version \u003Cn> -o TARGET_ORG --json\n```\n\nPublishing does **not** activate the agent.\nFor automation, prefer `--version \u003Cn> --json` so activation is deterministic and machine-readable.\n\n---\n\n## Deterministic Building Blocks\n\nThese execute as code, not suggestions:\n- conditionals\n- `available when` guards\n- variable checks\n- direct `set` \u002F `transition to`\n- `run @actions.X` **only when `X` is a topic-level action definition with `target:`**\n- variable injection into LLM-facing text\n\nImportant distinction:\n- **Deterministic**: `set`, `transition to`, and `run @actions.X` for a target-backed topic action\n- **LLM-directed**: `reasoning.actions:` utilities \u002F delegations such as `@utils.setVariables`, `@utils.transition`, and `{!@actions.X}` instruction references\n\nIf you need deterministic behavior for something that is currently modeled as a reasoning-level utility, either:\n- rewrite it as direct `set` \u002F `transition to`, or\n- promote it to a topic-level target-backed action and `run` that action\n\nSee [references\u002Finstruction-resolution.md](references\u002Finstruction-resolution.md) and [references\u002Farchitecture-patterns.md](references\u002Farchitecture-patterns.md).\n\n---\n\n## Cross-Skill Integration\n\n## Cross-Skill Orchestration\n\n| Task | Delegate to | Why |\n|---|---|---|\n| Build `flow:\u002F\u002F` targets | [sf-flow](..\u002Fsf-flow\u002FSKILL.md) | Flow creation \u002F validation |\n| Build Apex action targets | [sf-apex](..\u002Fsf-apex\u002FSKILL.md) | `@InvocableMethod` and business logic |\n| Test topic routing \u002F actions | [sf-ai-agentforce-testing](..\u002Fsf-ai-agentforce-testing\u002FSKILL.md) | Formal test specs and fix loops |\n| Deploy \u002F publish | [sf-deploy](..\u002Fsf-deploy\u002FSKILL.md) | Deployment orchestration |\n\n---\n\n## High-Signal Failure Patterns\n\n| Symptom | Likely cause | Read next |\n|---|---|---|\n| `Internal Error` during publish | invalid Service Agent user or missing action I\u002FO | [references\u002Fagent-user-setup.md](references\u002Fagent-user-setup.md), [references\u002Factions-reference.md](references\u002Factions-reference.md) |\n| `invalid input\u002Foutput parameters` on prompt template action | **Target template is in Draft status** — activate it first | [references\u002Faction-prompt-templates.md](references\u002Faction-prompt-templates.md#draft-template-publish-errors) |\n| Parser rejects conditionals | `else if`, nested `if`, empty `if` body | [references\u002Fsyntax-reference.md](references\u002Fsyntax-reference.md) |\n| Action target issues | missing Flow \u002F Apex target, inactive Flow, bad schemas | [references\u002Factions-reference.md](references\u002Factions-reference.md) |\n| Prompt template runs but user sees blank response | prompt output marked `is_displayable: True` | [references\u002Fproduction-gotchas.md](references\u002Fproduction-gotchas.md), [references\u002Faction-prompt-templates.md](references\u002Faction-prompt-templates.md) |\n| Prompt action runs but planner behaves like output is missing | output hidden from direct display but not planner-visible | [references\u002Fproduction-gotchas.md](references\u002Fproduction-gotchas.md), [references\u002Factions-reference.md](references\u002Factions-reference.md) |\n| `ACTION_NOT_IN_SCOPE` on `run @actions.X` | `run` points at a utility \u002F delegation \u002F unresolved action instead of a topic-level target-backed definition | [references\u002Fsyntax-reference.md](references\u002Fsyntax-reference.md), [references\u002Finstruction-resolution.md](references\u002Finstruction-resolution.md) |\n| Deterministic cancel \u002F revise \u002F URL checks behave inconsistently | raw `@system_variables.user_input` matching or string-method guards are being used as control-flow-critical validation | [references\u002Fsyntax-reference.md](references\u002Fsyntax-reference.md), [references\u002Fproduction-gotchas.md](references\u002Fproduction-gotchas.md) |\n| `@outputs.X` comparisons or assignments behave unexpectedly | the action output is structured\u002Fwrapped, not a plain scalar | [references\u002Factions-reference.md](references\u002Factions-reference.md), [references\u002Fsyntax-reference.md](references\u002Fsyntax-reference.md) |\n| Preview and runtime disagree | linked vars \u002F context \u002F known platform issues | [references\u002Fknown-issues.md](references\u002Fknown-issues.md) |\n| Validate passes but publish fails | org-specific user \u002F permission \u002F retrieve-back issue | [references\u002Fproduction-gotchas.md](references\u002Fproduction-gotchas.md), [references\u002Fcli-guide.md](references\u002Fcli-guide.md) |\n\n---\n\n## Reference Map\n\n### Start here\n- [references\u002Factivation-checklist.md](references\u002Factivation-checklist.md)\n- [references\u002Fsyntax-reference.md](references\u002Fsyntax-reference.md)\n- [references\u002Factions-reference.md](references\u002Factions-reference.md)\n\n### Publish \u002F runtime safety\n- [references\u002Fagent-user-setup.md](references\u002Fagent-user-setup.md)\n- [references\u002Fproduction-gotchas.md](references\u002Fproduction-gotchas.md)\n- [references\u002Fcustomer-web-client.md](references\u002Fcustomer-web-client.md)\n- [references\u002Fknown-issues.md](references\u002Fknown-issues.md)\n\n### Architecture \u002F reasoning\n- [references\u002Farchitecture-patterns.md](references\u002Farchitecture-patterns.md)\n- [references\u002Finstruction-resolution.md](references\u002Finstruction-resolution.md)\n- [references\u002Ffsm-architecture.md](references\u002Ffsm-architecture.md)\n- [references\u002Fpatterns-quick-ref.md](references\u002Fpatterns-quick-ref.md)\n\n### Validation \u002F testing \u002F debugging\n- [references\u002Fpreview-test-loop.md](references\u002Fpreview-test-loop.md)\n- [references\u002Ftesting-guide.md](references\u002Ftesting-guide.md)\n- [references\u002Fdebugging-guide.md](references\u002Fdebugging-guide.md)\n- [references\u002Fvalidator-rule-catalog.md](references\u002Fvalidator-rule-catalog.md)\n\n### Examples \u002F scaffolds\n- [references\u002Fminimal-examples.md](references\u002Fminimal-examples.md)\n- [references\u002Fmigration-guide.md](references\u002Fmigration-guide.md)\n- [assets\u002F](assets\u002F)\n- [assets\u002Fagents\u002F](assets\u002Fagents\u002F)\n- [assets\u002Fpatterns\u002F](assets\u002Fpatterns\u002F)\n\n### Project documentation\n- [references\u002Fversion-history.md](references\u002Fversion-history.md)\n- [references\u002Fsources.md](references\u002Fsources.md)\n\n---\n\n## Score Guide\n\n| Score | Meaning |\n|---|---|\n| 90+ | Deploy with confidence |\n| 75–89 | Good, review warnings |\n| 60–74 | Needs focused revision |\n| \u003C 60 | Block publish |\n\nFull rubric: [references\u002Fscoring-rubric.md](references\u002Fscoring-rubric.md)\n\n---\n\n## Official Resources\n\n- [Agent Script Documentation](https:\u002F\u002Fdeveloper.salesforce.com\u002Fdocs\u002Fai\u002Fagentforce\u002Fguide\u002Fagent-script.html)\n- [Agent Script Recipes](https:\u002F\u002Fgithub.com\u002Ftrailheadapps\u002Fagent-script-recipes)\n- [Agentforce DX Guide](https:\u002F\u002Fdeveloper.salesforce.com\u002Fdocs\u002Fai\u002Fagentforce\u002Fguide\u002Fagent-dx.html)\n- [references\u002Fofficial-sources.md](references\u002Fofficial-sources.md)\n","# SF-AI-AgentScript Skill\n\nAgent Script is the **code-first** path for deterministic Agentforce agents. Use this skill when the user is authoring `.agent` files, building finite-state topic flows, or needs repeatable control over routing, variables, actions, and publish behavior.\n\n> Start with the shortest guide first: [references\u002Factivation-checklist.md](references\u002Factivation-checklist.md)\n>\n> Migrating from the Builder UI? Use [references\u002Fmigration-guide.md](references\u002Fmigration-guide.md)\n\n## When This Skill Owns the Task\n\nUse `sf-ai-agentscript` when the work involves:\n- creating or editing `.agent` files\n- deterministic topic routing, guards, and transitions\n- Agent Script CLI workflows (`sf agent generate authoring-bundle`, `sf agent validate authoring-bundle`, `sf agent preview`, `sf agent publish authoring-bundle`, `sf agent activate`)\n- slot filling, instruction resolution, post-action loops, or FSM design\n\nDelegate elsewhere when the user is:\n- maintaining Builder metadata agents (`GenAiFunction`, `GenAiPlugin`, `GenAiPromptTemplate`, Models API, custom Lightning types) → [sf-ai-agentforce](..\u002Fsf-ai-agentforce\u002FSKILL.md)\n- designing persona \u002F tone \u002F voice → [sf-ai-agentforce-persona](..\u002Fsf-ai-agentforce-persona\u002FSKILL.md)\n- building formal test plans or coverage loops → [sf-ai-agentforce-testing](..\u002Fsf-ai-agentforce-testing\u002FSKILL.md)\n\nIf the user is in Builder Script \u002F Canvas view but the outcome is a `.agent` authoring bundle, keep the work in `sf-ai-agentscript`.\n\n---\n\n## Right-Size Determinism\n\n- Determinism is a dial, not a destination.\n- Use Agent Script when “mostly right” is not acceptable: gates, mandatory sequencing, explicit state transitions, compliance, or drift control.\n- If a workflow is fully static and linear, use Flow or Apex instead of scripting the conversation.\n- Prefer a deterministic envelope: deterministic entry\u002Fgate → flexible middle → deterministic closeout.\n- More determinism is not automatically better. Start minimal, then harden only the parts that show routing drift, sequencing failures, or compliance risk.\n\n---\n\n## Required Context to Gather First\n\nAsk for or infer:\n- agent purpose and whether Agent Script is truly the right fit\n- Service Agent vs Employee Agent\n- target org and publish intent\n- expected actions \u002F targets (Flow, Apex, PromptTemplate, etc.)\n- whether the request is authoring, validation, preview, or publish troubleshooting\n\n---\n\n## Activation Checklist\n\nBefore you author or fix any `.agent` file, verify these first:\n\n1. **Exactly one `start_agent` block**\n2. **No mixed tabs and spaces**\n3. **Booleans are `True` \u002F `False`**\n4. **No `else if` and no nested `if`**\n5. **No top-level `actions:` block**\n6. **No `@inputs` in `set` expressions**\n7. **`linked` variables have no defaults**\n8. **`linked` variables do not use `object` \u002F `list` types**\n9. **Use explicit `agent_type`**\n10. **Use `@actions.` prefixes consistently**\n11. **Use `run @actions.X` only when `X` is a topic-level action definition with `target:`**\n12. **Do not branch directly on raw `@system_variables.user_input contains\u002Fstartswith\u002Fendswith` for intent routing**\n13. **On prompt-template outputs, prefer `is_displayable: False` + `is_used_by_planner: True`**\n14. **Do not assume `@outputs.X` is scalar — inspect the output schema before branching or assignment**\n\nFor the expanded version, use [references\u002Factivation-checklist.md](references\u002Factivation-checklist.md).\n\n---\n\n## Non-Negotiable Rules\n\n### 1) Service Agent vs Employee Agent\n\n| Agent type | Required | Forbidden \u002F caution |\n|---|---|---|\n| `AgentforceServiceAgent` | Valid `default_agent_user`, correct permissions, target-org checks, prefer `sf org create agent-user` | Publishing without a real Einstein Agent User |\n| `AgentforceEmployeeAgent` | Explicit `agent_type` | Supplying `default_agent_user` |\n\nFull details: [references\u002Fagent-user-setup.md](references\u002Fagent-user-setup.md)\n\n### 2) Recommended top-level block convention\n\nUse this order for consistency in this skill's examples and reviews:\n\n```yaml\nconfig:\nvariables:\nsystem:\nconnection:\nknowledge:\nlanguage:\nstart_agent:\ntopic:\n```\n\nOfficial Salesforce materials present top-level blocks in differing sequences, and local validation evidence indicates multiple orderings compile. Treat this as a style convention, not a standalone correctness or publish blocker.\n\n### 3) Critical config fields\n\n| Field | Rule |\n|---|---|\n| `developer_name` | Must match folder \u002F bundle name |\n| `description` | Public docs\u002Fexamples should use this config field |\n| `agent_type` | Set explicitly every time |\n| `default_agent_user` | Service Agents only |\n\nLocal tooling also accepts `agent_description:` for compatibility, but this skill's public docs and examples should prefer `description:`.\n\n### 4) Syntax blockers you should treat as immediate failures\n\n- `else if`\n- nested `if`\n- comment-only `if` bodies\n- top-level `actions:`\n- invocation-level `inputs:` \u002F `outputs:` blocks\n- reserved variable \u002F field names like `description` and `label`\n\nCanonical rule set: [references\u002Fsyntax-reference.md](references\u002Fsyntax-reference.md) and [references\u002Fvalidator-rule-catalog.md](references\u002Fvalidator-rule-catalog.md)\n\n---\n\n## Recommended Workflow\n\n## Recommended Authoring Workflow\n\n### Phase 1 — design the agent\n- decide whether the problem is actually deterministic enough for Agent Script\n- model topics as states and transitions as edges\n- define only the variables you truly need\n\n### Phase 2 — author the `.agent`\n- create `config`, `system`, `start_agent`, and topics first\n- add target-backed actions with full `inputs:` and `outputs:`\n- use `available when` for deterministic tool visibility\n- normalize raw intent\u002Fvalidation signals into booleans or enums before branching; avoid direct substring checks on raw user utterances for critical control flow\n- keep post-action checks at the **top** of `instructions: ->`\n\n### Default authoring stance\n\n- Default to direct `.agent` authoring and edits in source control.\n- Use `sf agent generate authoring-bundle --no-spec` only when the user wants local bundle scaffolding.\n- Treat `sf agent generate agent-spec` as optional ideation \u002F topic bootstrap, not the default workflow.\n- Do not route Agent Script users toward `sf agent create` or `sf agent generate template`.\n\n### Phase 3 — validate continuously\nValidation already runs automatically on write\u002Fedit. Use the CLI before publish:\n\n```bash\nsf agent validate authoring-bundle --api-name MyAgent -o TARGET_ORG --json\n```\n\nThe validator covers structure, runtime gotchas, target readiness, and org-aware Service Agent checks. Rule IDs live in [references\u002Fvalidator-rule-catalog.md](references\u002Fvalidator-rule-catalog.md).\n\n### Phase 4 — preview smoke test\nUse the preview loop before publish:\n- derive 3–5 smoke utterances\n- start preview with the `start` \u002F `send` \u002F `end` subcommands, not bare `sf agent preview`\n- if you use `--authoring-bundle`, always choose a mode explicitly: `--simulate-actions` or `--use-live-actions`\n- inspect topic routing \u002F action invocation \u002F safety \u002F grounding\n- fix and rerun up to 3 times\n\nFull loop: [references\u002Fpreview-test-loop.md](references\u002Fpreview-test-loop.md)\n\n### Phase 5 — publish and activate\n```bash\nsf agent publish authoring-bundle --api-name MyAgent -o TARGET_ORG --json\n\n# Manual activation\nsf agent activate --api-name MyAgent -o TARGET_ORG\n\n# CI \u002F deterministic activation of a known BotVersion\nsf agent activate --api-name MyAgent --version \u003Cn> -o TARGET_ORG --json\n```\n\nPublishing does **not** activate the agent.\nFor automation, prefer `--version \u003Cn> --json` so activation is deterministic and machine-readable.\n\n---\n\n## Deterministic Building Blocks\n\nThese execute as code, not suggestions:\n- conditionals\n- `available when` guards\n- variable checks\n- direct `set` \u002F `transition to`\n- `run @actions.X` **only when `X` is a topic-level action definition with `target:`**\n- variable injection into LLM-facing text\n\nImportant distinction:\n- **Deterministic**: `set`, `transition to`, and `run @actions.X` for a target-backed topic action\n- **LLM-directed**: `reasoning.actions:` utilities \u002F delegations such as `@utils.setVariables`, `@utils.transition`, and `{!@actions.X}` instruction references\n\nIf you need deterministic behavior for something that is currently modeled as a reasoning-level utility, either:\n- rewrite it as direct `set` \u002F `transition to`, or\n- promote it to a topic-level target-backed action and `run` that action\n\nSee [references\u002Finstruction-resolution.md](references\u002Finstruction-resolution.md) and [references\u002Farchitecture-patterns.md](references\u002Farchitecture-patterns.md).\n\n---\n\n## Cross-Skill Integration\n\n## Cross-Skill Orchestration\n\n| Task | Delegate to | Why |\n|---|---|---|\n| Build `flow:\u002F\u002F` targets | [sf-flow](..\u002Fsf-flow\u002FSKILL.md) | Flow creation \u002F validation |\n| Build Apex action targets | [sf-apex](..\u002Fsf-apex\u002FSKILL.md) | `@InvocableMethod` and business logic |\n| Test topic routing \u002F actions | [sf-ai-agentforce-testing](..\u002Fsf-ai-agentforce-testing\u002FSKILL.md) | Formal test specs and fix loops |\n| Deploy \u002F publish | [sf-deploy](..\u002Fsf-deploy\u002FSKILL.md) | Deployment orchestration |\n\n---\n\n## High-Signal Failure Patterns\n\n| Symptom | Likely cause | Read next |\n|---|---|---|\n| `Internal Error` during publish | invalid Service Agent user or missing action I\u002FO | [references\u002Fagent-user-setup.md](references\u002Fagent-user-setup.md), [references\u002Factions-reference.md](references\u002Factions-reference.md) |\n| `invalid input\u002Foutput parameters` on prompt template action | **Target template is in Draft status** — activate it first | [references\u002Faction-prompt-templates.md](references\u002Faction-prompt-templates.md#draft-template-publish-errors) |\n| Parser rejects conditionals | `else if`, nested `if`, empty `if` body | [references\u002Fsyntax-reference.md](references\u002Fsyntax-reference.md) |\n| Action target issues | missing Flow \u002F Apex target, inactive Flow, bad schemas | [references\u002Factions-reference.md](references\u002Factions-reference.md) |\n| Prompt template runs but user sees blank response | prompt output marked `is_displayable: True` | [references\u002Fproduction-gotchas.md](references\u002Fproduction-gotchas.md), [references\u002Faction-prompt-templates.md](references\u002Faction-prompt-templates.md) |\n| Prompt action runs but planner behaves like output is missing | output hidden from direct display but not planner-visible | [references\u002Fproduction-gotchas.md](references\u002Fproduction-gotchas.md), [references\u002Factions-reference.md](references\u002Factions-reference.md) |\n| `ACTION_NOT_IN_SCOPE` on `run @actions.X` | `run` points at a utility \u002F delegation \u002F unresolved action instead of a topic-level target-backed definition | [references\u002Fsyntax-reference.md](references\u002Fsyntax-reference.md), [references\u002Finstruction-resolution.md](references\u002Finstruction-resolution.md) |\n| Deterministic cancel \u002F revise \u002F URL checks behave inconsistently | raw `@system_variables.user_input` matching or string-method guards are being used as control-flow-critical validation | [references\u002Fsyntax-reference.md](references\u002Fsyntax-reference.md), [references\u002Fproduction-gotchas.md](references\u002Fproduction-gotchas.md) |\n| `@outputs.X` comparisons or assignments behave unexpectedly | the action output is structured\u002Fwrapped, not a plain scalar | [references\u002Factions-reference.md](references\u002Factions-reference.md), [references\u002Fsyntax-reference.md](references\u002Fsyntax-reference.md) |\n| Preview and runtime disagree | linked vars \u002F context \u002F known platform issues | [references\u002Fknown-issues.md](references\u002Fknown-issues.md) |\n| Validate passes but publish fails | org-specific user \u002F permission \u002F retrieve-back issue | [references\u002Fproduction-gotchas.md](references\u002Fproduction-gotchas.md), [references\u002Fcli-guide.md](references\u002Fcli-guide.md) |\n\n---\n\n## Reference Map\n\n### Start here\n- [references\u002Factivation-checklist.md](references\u002Factivation-checklist.md)\n- [references\u002Fsyntax-reference.md](references\u002Fsyntax-reference.md)\n- [references\u002Factions-reference.md](references\u002Factions-reference.md)\n\n### Publish \u002F runtime safety\n- [references\u002Fagent-user-setup.md](references\u002Fagent-user-setup.md)\n- [references\u002Fproduction-gotchas.md](references\u002Fproduction-gotchas.md)\n- [references\u002Fcustomer-web-client.md](references\u002Fcustomer-web-client.md)\n- [references\u002Fknown-issues.md](references\u002Fknown-issues.md)\n\n### Architecture \u002F reasoning\n- [references\u002Farchitecture-patterns.md](references\u002Farchitecture-patterns.md)\n- [references\u002Finstruction-resolution.md](references\u002Finstruction-resolution.md)\n- [references\u002Ffsm-architecture.md](references\u002Ffsm-architecture.md)\n- [references\u002Fpatterns-quick-ref.md](references\u002Fpatterns-quick-ref.md)\n\n### Validation \u002F testing \u002F debugging\n- [references\u002Fpreview-test-loop.md](references\u002Fpreview-test-loop.md)\n- [references\u002Ftesting-guide.md](references\u002Ftesting-guide.md)\n- [references\u002Fdebugging-guide.md](references\u002Fdebugging-guide.md)\n- [references\u002Fvalidator-rule-catalog.md](references\u002Fvalidator-rule-catalog.md)\n\n### Examples \u002F scaffolds\n- [references\u002Fminimal-examples.md](references\u002Fminimal-examples.md)\n- [references\u002Fmigration-guide.md](references\u002Fmigration-guide.md)\n- [assets\u002F](assets\u002F)\n- [assets\u002Fagents\u002F](assets\u002Fagents\u002F)\n- [assets\u002Fpatterns\u002F](assets\u002Fpatterns\u002F)\n\n### Project documentation\n- [references\u002Fversion-history.md](references\u002Fversion-history.md)\n- [references\u002Fsources.md](references\u002Fsources.md)\n\n---\n\n## Score Guide\n\n| Score | Meaning |\n|---|---|\n| 90+ | Deploy with confidence |\n| 75–89 | Good, review warnings |\n| 60–74 | Needs focused revision |\n| \u003C 60 | Block publish |\n\nFull rubric: [references\u002Fscoring-rubric.md](references\u002Fscoring-rubric.md)\n\n---\n\n## Official Resources\n\n- [Agent Script Documentation](https:\u002F\u002Fdeveloper.salesforce.com\u002Fdocs\u002Fai\u002Fagentforce\u002Fguide\u002Fagent-script.html)\n- [Agent Script Recipes](https:\u002F\u002Fgithub.com\u002Ftrailheadapps\u002Fagent-script-recipes)\n- [Agentforce DX Guide](https:\u002F\u002Fdeveloper.salesforce.com\u002Fdocs\u002Fai\u002Fagentforce\u002Fguide\u002Fagent-dx.html)\n- [references\u002Fofficial-sources.md](references\u002Fofficial-sources.md)\n",{"name":5,"license":15,"metadata":24,"description":33,"compatibility":34},{"author":25,"scoring":26,"version":27,"validated":28,"validate_by":29,"last_validated":30,"validation_agents":31,"validation_status":32},"Jag Valaiyapathy","100 points across 6 categories","2.9.0","0-shot generation tested against multiple representative sample agents. Agent user setup validated against representative Service Agent and Employee Agent scenarios.","2026-04-10","2026-03-20","24","PASS","Agent Script DSL for deterministic Agentforce agents. TRIGGER when: user writes or edits .agent files, builds FSM-based agents, uses Agent Script CLI (sf agent generate authoring-bundle, sf agent validate authoring-bundle, sf agent preview, sf agent publish authoring-bundle, sf agent activate), or asks about deterministic agent patterns, slot filling, or instruction resolution. DO NOT TRIGGER when: Builder metadata work (use sf-ai-agentforce), agent testing (use sf-ai-agentforce-testing), or persona design (use sf-ai-agentforce-persona).\n","Requires Agentforce license and API v66.0+; Einstein Agent User is required for Service Agents only","main","8859218955d9504cd18b59e7892100718039d3b4","data\u002Fskills\u002Fjaganpro-sf-skills\u002Fsf-ai-agentscript",1,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper","https:\u002F\u002Fgithub.com\u002Fom-scogo","SDE-1 @ Scogo ","2026-07-18 12:22:46",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add om-scogo\u002Fskillsh-scraper --skill sf-ai-agentscript",{"tool":49,"command":50},"bunx","bunx skills add om-scogo\u002Fskillsh-scraper --skill sf-ai-agentscript",{"tool":52,"command":53},"pnpm","pnpm dlx skills add om-scogo\u002Fskillsh-scraper --skill sf-ai-agentscript","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fjaganpro-sf-skills\u002Fsf-ai-agentscript\u002FSkill.md",true,[57],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"metadata.json","REFERENCE","参考文档",443,"https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fjaganpro-sf-skills\u002Fsf-ai-agentscript\u002Fmetadata.json",[64,71,76,83,88,95],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7D6MC9FAAEV4CMNYX8W7JTG","arxiv-search","Search arXiv physics, math, and computer science preprints using natural language queries. Powered by Valyu semantic search.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002Fskills\u002Farxiv-search\u002FSKILL.md",[],[],{"skillNo":72,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7D6M85CKKN87TA98VCQV4H7","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fyorkeccak-scientific-skills\u002Farxiv-search\u002FSkill.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7D4ZTCS4DR3CE4JY06X84T2","working-with-legacy-code","Safely change and test untested codebases using Feathers' \"Working Effectively with Legacy Code\". Use when the user mentions \"legacy code\", \"no tests\", \"untested codebase\", \"how do I test this\", \"seams\", \"characterization tests\", \"golden master\", \"sprout method\", \"afraid to change this code\", \"monster method\", \"dependency breaking\", or \"inherited a messy codebase\". Also trigger when changing code without tests safely, getting a class under test when constructors, statics, or singletons block it, adding features to tangled modules, or planning incremental test coverage for an old codebase. Covers the legacy-code change algorithm, seams, characterization tests, sprout\u002Fwrap, and dependency-breaking techniques. For refactoring code that already has tests, see refactoring-patterns. For day-to-day code quality, see clean-code.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002Fworking-with-legacy-code\u002FSKILL.md",[],[],{"skillNo":84,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7D4ZHZKJD2RSNGAF63V14P4","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fworking-with-legacy-code\u002FSkill.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7D4ZB4CJBFW5JE67CPH2QRV","web-typography","Select, pair, and implement typefaces for web projects. Use when the user mentions \"font pairing\", \"which typeface\", \"line height\", \"responsive typography\", \"web font loading\", \"type hierarchy\", \"variable fonts\", \"FOUT\u002FFOIT\", \"typographic scale\", or \"the text is hard to read\". Also trigger when choosing between system fonts and web fonts, optimizing font-loading performance, or designing readable long-form content. Covers readability evaluation, CSS implementation, and performance optimization. For overall UI design systems, see refactoring-ui. For dramatic typographic experiences, see top-design.","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002Fweb-typography\u002FSKILL.md",[],[],{"skillNo":96,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7D4Z4MVYVY3NMJ18BNV6WNA","https:\u002F\u002Fgithub.com\u002Fom-scogo\u002Fskillsh-scraper\u002Fblob\u002Fmain\u002Fdata\u002Fskills\u002Fwondelai-skills\u002Fweb-typography\u002FSkill.md",[],[]]