Skip to content

forcedotcom/sf-skills / plugins/builder/agentforce-adlc/skills/agentforce-test

agentforce-test

Flagged

Write, run, and analyze structured test suites for Agentforce agents — functional AND security. TRIGGER when: user writes or modifies test spec YAML (AiEvaluationDefinition); runs sf agent test create, run, run-eval, or results commands; asks about test coverage strategy, metric selection, or custom evaluations; interprets test results or diagnoses test failures; asks about batch testing, regression suites, or CI/CD test integration; requests security testing, OWASP LLM Top 10, red-teaming, penetration testing, prompt-injection tests, a security grade, or a vulnerability assessment of an agent. DO NOT TRIGGER when: user creates, modifies, previews, or debugs .agent files (use agentforce-generate); deploys or publishes agents; writes Agent Script code; uses sf agent preview for development iteration; analyzes production session traces (use agentforce-observe); performs a static safety review of .agent file content (use agentforce-generate Section 15).

assets/basic-test-spec.yaml

View on GitHub
# Basic Test Specification Template
# Compatible with: sf agent test create --spec <file> --api-name <name>
#
# Usage:
#   1. Replace <placeholders> with actual values
#   2. Create: sf agent test create --spec basic-test-spec.yaml --api-name <Test_Name> --target-org <alias>
#   3. Run:    sf agent test run --api-name <Test_Name> --wait 10 --result-format json --target-org <alias>
#
# IMPORTANT: This YAML is parsed by @salesforce/agents — NOT a generic AiEvaluationDefinition format.
# Only the fields below are recognized. Do NOT add apiVersion, kind, metadata, or settings.
#
# NOTE: The Testing Center API uses "topic" terminology. In Agent Script, topics are called
# "subagents" (e.g., the `subagent` block). When writing tests, use "topic" to match the API,
# but understand that each expectedTopic value maps to a subagent in your .agent file.

# Required: Display name for the test (MasterLabel) — deploy FAILS without this
name: "<Agent_Name> Basic Tests"

# Required: Must be AGENT
subjectType: AGENT

# Required: Agent BotDefinition DeveloperName (API name)
subjectName: <Agent_Name>

testCases:
  # ═══════════════════════════════════════════════════════════════
  # TOPIC ROUTING TESTS
  # Test that user messages route to the correct topic
  # ═══════════════════════════════════════════════════════════════

  - utterance: "<User message that should trigger primary topic>"
    expectedTopic: <topic_name>

  - utterance: "<User message that should trigger secondary topic>"
    expectedTopic: <another_topic_name>

  # ═══════════════════════════════════════════════════════════════
  # ACTION INVOCATION TESTS
  # expectedActions is a FLAT list of action name strings
  # ═══════════════════════════════════════════════════════════════

  - utterance: "<User message that should trigger action>"
    expectedTopic: <topic_name>
    expectedActions:
      - <action_name>

  # ═══════════════════════════════════════════════════════════════
  # OUTCOME VALIDATION TESTS
  # expectedOutcome is optional — omitting causes harmless ERROR
  # in output_validation (test still passes topic/action checks)
  # ═══════════════════════════════════════════════════════════════

  - utterance: "<User message with expected outcome>"
    expectedTopic: <topic_name>
    expectedOutcome: "Agent should provide a helpful response about <topic>"

  # ═══════════════════════════════════════════════════════════════
  # ESCALATION TEST
  # Standard topics like Escalation use localDeveloperName
  # ═══════════════════════════════════════════════════════════════

  - utterance: "I want to talk to a real person"
    expectedTopic: Escalation
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall