007
無料Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.
日本語の概要は準備中です。原文の説明を表示しています。
Authoring and managing Agentforce agent definitions using the declarative Agent Script DSL (.agent files) and associated metadata types. Use when creating agents in source control, debugging agent metadata, or understanding the metadata lifecycle of GenAiPlugin/GenAiPlanner/BotVersion types. Triggers: 'how do I deploy an Agentforce agent using source control', 'what metadata types make up an Agentforce agent', 'agent test run command failing in CI pipeline', 'GenAiPlugin vs GenAiPlanner metadata relationship'. NOT for Apex-based agent actions (use custom-agent-actions-apex). NOT for UI-based agent creation (use agentforce-agent-creation).
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Use this skill when the work involves authoring, editing, validating, or deploying Agentforce agent definitions through source-controlled metadata rather than through the Agentforce Builder UI. This skill covers the YAML-based .agent file format, the three composite metadata types that make up an agent (GenAiPlugin, GenAiPlanner/GenAiPlannerBundle, BotVersion), LSP validation tooling, the sf agent test run CLI command, and the metadata deployment lifecycle end-to-end. It does not cover Apex implementation of invocable agent actions (use agentforce/custom-agent-actions-apex) and does not cover UI-driven agent creation workflow (use agentforce/agentforce-agent-creation).
Agentforce agent definitions are stored as YAML-based declarative metadata in .agent files within a Salesforce DX project. These files are the machine-readable representations of the same configuration surfaced in Agentforce Builder. Understanding the relationship between the three composite metadata types — GenAiPlugin, GenAiPlanner (or GenAiPlannerBundle from API v64+), and BotVersion — is essential for correct deployment and source control management.
Gather this context before working on anything in this domain:
.agent files produce silent or cryptic deploy failures.sfdx-project.json? The sf agent CLI commands operate on DX-structured projects only..agent files that diverge from the deployed BotVersion state produce merge conflicts on the next retrieve.An Agentforce agent in source control is not a single file. It is composed of three linked metadata types that must be deployed together as a bundle:
GenAiPlugin — the action definition layer. Each GenAiPlugin corresponds to a topic in Agentforce Builder. It declares the topic label, description (used by the LLM for topic classification), and references to the GenAiFunction records (actions) that belong to the topic. A plugin that has a vague or overlapping description will cause the LLM planner to route incorrectly, even if the metadata deploys cleanly.
GenAiPlanner / GenAiPlannerBundle — the orchestration configuration layer. GenAiPlanner (API v60–v63) or GenAiPlannerBundle (API v64+) configures the LLM reasoning engine: model selection, planner instructions (the system prompt), and the set of GenAiPlugins the agent can invoke. The bundle variant introduces the ability to link the planner to a BotVersion within a single metadata record, replacing the manual cross-reference approach of the earlier type.
BotVersion — the conversation container and channel routing shell. BotVersion wraps the Bot record and manages conversation session parameters, language settings, and fallback behavior. It also carries the reference that links a deployed agent to the GenAiPlannerBundle. BotVersion without a linked planner produces a legacy Einstein Bot, not an Agentforce agent. The presence of the genAiPlannerBundle element in BotVersion XML is the authoritative indicator that a BotVersion is an Agentforce agent and not a legacy scripted bot.
All three types must be retrieved and deployed as a coherent unit. Partial deploys — for example, deploying only GenAiPlugin changes without an updated BotVersion — will either fail validation or produce a deployed state that diverges from the source of truth in version control.
The .agent file is the primary human-authoring surface for Agentforce agent definitions in a DX project. It is a YAML file that declaratively defines the full agent configuration: agent metadata, planner instructions (the system prompt persona), topic references, and action references. The Salesforce CLI tooling (sf agent) consumes .agent files and translates them into the correct GenAiPlugin/GenAiPlanner/BotVersion metadata records during deployment.
Key YAML keys in a typical .agent file:
name — the agent API name (immutable after first deployment)type — agent for standard Agentforce agentsspec.agentType — differentiates service agents from custom agentsspec.description — the agent's role description (becomes part of the system context)spec.topics — array of topic definitions, each with a label, description, and list of actionsspec.plannerInstructions — the full system prompt block governing persona, tone, and constraintsThe Salesforce Agentforce VS Code extension provides LSP validation against the .agent schema. Hover hints, inline error diagnostics, and autocomplete are available when the extension is active. Authoring .agent files without LSP validation significantly increases the risk of silent schema violations that only surface at deploy time.
Legacy Einstein Bots used a finite state machine (FSM): dialog flows defined explicit transitions between states, and conversation routing was deterministic. Agentforce agents use LLM-driven orchestration: the GenAiPlanner uses a language model to decide at runtime which topic to invoke and which action to execute within that topic, based on the user's utterance and the planner instructions.
This distinction has direct implications for metadata authoring. In an FSM bot, gaps in dialog states produce predictable fallthrough behavior. In an Agentforce agent, poorly written topic descriptions or action descriptions cause the LLM to route incorrectly — routing issues manifest as wrong-topic invocation or no-topic fallback, not as errors in the metadata itself. Debugging a misbehaving agent therefore requires reviewing the natural-language content of topic and action descriptions, not just the structural validity of the metadata.
The sf agent test run command (Beta as of Spring '26) executes automated agent tests defined as .aiTest metadata records against a deployed agent in a target org. Tests specify input utterances and expected outcomes (expected topic classification, expected action invocation, or expected response text patterns). This command is the primary mechanism for verifying agent behavior in CI pipelines without a live UI session.
sf agent test run \
--spec force-app/main/default/aiTests/myAgentTest.aiTest-meta.xml \
--target-org MySandbox \
--wait 10
Key behaviors:
sf agent test run against an Inactive or Draft agent returns an error.--wait flag sets a polling timeout in minutes (default 5).@salesforce/plugin-agent CLI plugin version in CI pipeline tooling.When to use: Creating a new Agentforce agent or making topology changes (new topics, restructured actions) and managing them through version control with a CI/CD pipeline.
How it works:
sf agent generate agent --name MyServiceAgent --target-org DevSandbox
This scaffolds a .agent file and the corresponding GenAiPlugin/BotVersion stubs in the DX project..agent file in VS Code with the Agentforce extension active. The LSP provides inline validation.spec.plannerInstructions, topic descriptions, and action references locally.sf project deploy start \
--metadata Bot:MyServiceAgent \
--metadata BotVersion:MyServiceAgent.v1 \
--metadata GenAiPlannerBundle:MyServiceAgent \
--metadata GenAiPlugin:MyServiceAgent_TopicOne \
--target-org DevSandbox
sf agent test run --spec force-app/.../myTest.aiTest-meta.xml --target-org DevSandbox
Why not UI-only authoring: UI-only authoring produces configuration that lives only in the org. It cannot be reviewed in pull requests, rolled back deterministically, or promoted through a pipeline without manual re-entry. YAML-based authoring provides auditability, reviewability, and repeatable deployment.
When to use: Any time an agent has been modified in the Agentforce Builder UI and those changes need to be reconciled with the source-control version.
How it works:
sf project retrieve start \
--metadata Bot:MyServiceAgent \
--metadata BotVersion:MyServiceAgent.v1 \
--metadata GenAiPlannerBundle:MyServiceAgent \
--metadata "GenAiPlugin:MyServiceAgent_*" \
--target-org DevSandbox
plannerInstructions blocks — these are plain-text fields and are overwritten entirely by each retrieve.Why not skip the retrieve: Deploying stale .agent files over a more recent org state can silently regress changes made in the Builder UI. In production, this can take an active agent and replace its instructions with an older version.
When to use: An agent routes to the wrong topic or falls back to "I can't help with that" even when the topic clearly applies.
How it works:
.agent file and review spec.topics[*].description for each topic. The description is the primary signal used by the LLM planner for classification.spec.plannerInstructions for any negative constraints that might be inadvertently excluding valid queries.sf agent test run.GenAiPlugin XML for the affected topic and verify the description stored in the org matches the .agent file.| Situation | Recommended Approach | Reason |
|---|---|---|
| New agent with no source control history | Generate with sf agent generate agent, build in VS Code with LSP | Establishes source-of-truth in version control from the start |
| Agent exists only in org, needs to move to source control | Retrieve all metadata layers, commit, then manage via pipeline | Retrieve-first prevents state divergence from the first deploy |
| API v60–v63 project (older sandbox) | Use GenAiPlanner, not GenAiPlannerBundle | GenAiPlannerBundle requires API v64+ (Spring '26) |
| CI pipeline needs automated agent testing | Use sf agent test run with .aiTest metadata | Only scriptable agent test mechanism; exit codes integrate with CI |
| Topic routing is inconsistent | Edit topic descriptions in .agent file, not action definitions | The LLM planner uses topic descriptions for routing; actions are invoked after routing |
| Agent changes made in Builder UI | Retrieve before next deploy | Prevents overwriting org state with stale source |
Step-by-step instructions for an AI agent or practitioner working on this task:
@salesforce/plugin-agent plugin version, and target org API version. Confirm whether the project targets GenAiPlanner (v60–v63) or GenAiPlannerBundle (v64+)..agent file — use VS Code with the Salesforce Agentforce extension. Address any LSP diagnostic warnings before proceeding. Pay particular attention to topic description quality and the plannerInstructions block.sf agent test run against the target org. Review output for routing failures, action invocation failures, or assertion mismatches. Iterate on topic or planner instruction content as needed..agent file plus all generated XML) and promote through the pipeline. Repeat activation in each target org after deployment.Run through these before marking work in this area complete:
.agent file has no LSP diagnostic errors or warnings in VS Code with Agentforce extension.plannerInstructions block contains specific, deterministic persona and constraint language.sf agent test run passes with exit code 0.Non-obvious platform behaviors that cause real production problems:
apiVersion set to v63 or lower in sfdx-project.json cannot use GenAiPlannerBundle. Attempting to deploy it produces a confusing "Unknown type" error. Set apiVersion: 64.0 or higher before building Spring '26 agents..agent file with vague topic descriptions produces a broken agent with no metadata errors.sf agent test run requires an Active agent — running agent tests against a Draft or Inactive agent returns an error that is easy to misread as a CLI or credential problem. Always confirm the agent is Active in the target org before running CI test jobs.| Artifact | Description |
|---|---|
.agent YAML file | Declarative agent definition for VS Code authoring and version control |
| GenAiPlugin XML records | Metadata files for each topic, containing topic description and action references |
| GenAiPlannerBundle XML | Metadata linking the planner instructions and plugins to the BotVersion |
| BotVersion XML | Agent container with channel settings and GenAiPlannerBundle reference |
| sf agent test run commands | CLI invocations for CI pipeline agent testing with exit-code integration |
| Metadata deploy command set | Full sf project deploy start commands targeting the complete agent bundle |
agentforce/agentforce-agent-creation — use for UI-driven agent setup, channel assignment, activation, and lifecycle management in Setup.agentforce/custom-agent-actions-apex — use when the problem is implementing invocable Apex methods that serve as agent actions, not the metadata layer.agentforce/agent-channel-deployment — use when the problem is configuring Embedded Service, Messaging for Web, or Agent API channel surfaces.devops/scratch-org-management — use when agent development involves scratch orgs, unlocked packages, or org shape-based environment management.まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.
日本語の概要は準備中です。原文の説明を表示しています。
Guides the creation of agile user stories and Gherkin feature files. Use when the user wants to create a user story, write acceptance criteria, define Gherkin scenarios, or author BDD feature files. This should trigger for requests such as Create a user story; Write a user story; I need to write a user story. Part of cursor-rules-java project
日本語の概要は準備中です。原文の説明を表示しています。
Facilitates conversational discovery to create Architectural Decision Records (ADRs) for non-functional requirements using the ISO/IEC 25010:2023 quality model. Use when the user wants to document quality attributes, NFR decisions, security/performance/scalability architecture, or design systems with measurable quality criteria. This should trigger for requests such as Create ADR for Non-functional requirements; Document Non-functional requirements; Capture Non-functional requirements; Generate Non-functional requirements in an ADR. Part of cursor-rules-java project
日本語の概要は準備中です。原文の説明を表示しています。
Run a health check on an existing project: dependency audit, security scan, test runner detection, CI/CD evaluation, and missing configuration analysis. Maps the three execution gates (pre/in/post) from /10x-bootstrapper to an assessment framework for existing codebases. Reads optional context/foundation/stack-assessment.md from /10x-stack-assess to focus checks on identified gaps. Writes context/foundation/health-check.md with findings, prioritized fixes, and an agent-readiness verdict. Use when the user has an existing project and wants to verify its health before working with an agent. Trigger phrases: "health check", "check my project", "audit my project", "is my project healthy", "sprawdź projekt", "audyt projektu", "health-check", "project health". Use AFTER /10x-stack-assess (brownfield chain), BEFORE agent onboarding (m1-l4).
日本語の概要は準備中です。原文の説明を表示しています。
You MUST use this when building projects end-to-end. Orchestrates all 12 team roles — automatically switches between CTO, architect, PM, engineers, SRE, security, DBA, QA, and EM based on the current phase of work. Starts with brainstorming before any implementation.
日本語の概要は準備中です。原文の説明を表示しています。
Use when you need to add or configure Maven plugins in your pom.xml — including quality tools (enforcer, surefire, failsafe, jacoco, pitest, spotbugs, pmd), security scanning (OWASP), code formatting (Spotless), version management, container image build (Jib), build information tracking, and benchmarking (JMH) — through a consultative, modular step-by-step approach that only adds what you actually need. This should trigger for requests such as Add Maven plugins in pom.xml; Improve Maven plugins in pom.xml. Part of cursor-rules-java project
日本語の概要は準備中です。原文の説明を表示しています。