AgentSpec is a specialized framework for building, testing, and managing Salesforce Agentforce agents, flows, and Lightning Web Components (LWCs). It leverages the OpenSpec CLI to provide a spec-driven development workflow tailored for the Salesforce ecosystem.
Building Agentforce agents requires coordinating multiple metadata types (Agents, Flows, Apex, LWC) and adhering to strict platform rules. AgentSpec provides a structured workflow to ensure:
- Agreement before Implementation: Define agent behavior in specs before writing code.
- MCP First: Integrate Model Context Protocol (MCP) tools for real-time org insights.
- Salesforce Standards: Enforce security and coding best practices automatically.
- Node.js >= 20.19.0
- Salesforce CLI (
sf) installed and authenticated
From Source (recommended for development):
git clone https://github.com/designthynk/AgentSpec.git
cd AgentSpec
npm install -g .From npm (once published):
npm install -g @designthynk/agentspecNavigate to your Salesforce DX project and run:
agentspec initThis will create the openspec/ directory structure with the necessary Salesforce-specific templates.
- Draft Proposal:
agentspec init(if not already done) -> Ask your AI to create a change proposal. - Spec: Define requirements in
specs/. - Implement: Use
sfand MCP tools to build in the org. - Verify: Run tests and update specs.
- Archive:
agentspec archive <change-id>to merge changes into the permanent specs.
AgentSpec is a fork of OpenSpec tailored for Salesforce. To benefit from upstream OpenSpec updates, you can merge changes from the OpenSpec repository into this project, resolving conflicts in src/core/templates/agents-template.ts (where Salesforce-specific instructions live).
AgentSpec is built on top of OpenSpec by the Fission AI team. We are grateful for their work on creating a robust spec-driven development framework.
Key Resources:
- OpenSpec Framework: github.com/Fission-AI/OpenSpec
- Salesforce Agentforce Documentation: developer.salesforce.com/docs/einstein/genai
- Salesforce CLI Plugin (Agent): github.com/salesforcecli/plugin-agent
- Model Context Protocol (MCP): @salesforce/mcp
This project adapts OpenSpec's methodology specifically for Salesforce Agentforce development, integrating MCP-first workflows and the Salesforce CLI agent lifecycle.
MIT