Salesforce write-spec skill
[!WARNING]
Unofficial. This is not an official Salesforce skill and is not supported by Salesforce. Use it at your own discretion.
For org discovery, the skill uses Agentforce Coworker over MCP (the AskCoworker MCP server). The preferred approach will be the metadata grounding MCP server launching in the October release. Until that is available, you can use this skill.
An Agent Skill that turns a plain-English Salesforce business requirement into a reviewable implementation specification, grounded in a real org. It works in Claude Code, the Code tab of Claude Desktop, and Codex. The repo also contains the eval harness used to build and harden the skill over 38 revisions.
The skill only writes specs. It never deploys, retrieves, changes metadata or data, or runs Apex. For discovery it uses Agentforce Coworker through the AskCoworker Salesforce hosted MCP server, and it checks every claim it relies on with read-only sf CLI queries.
/write-spec Flag accounts whose SLA expires in the next 30 days so account managers can renew. org: MyDevOrg
The spec is saved as plain Markdown to design/<slug>-spec.md in your working directory. An example is in design/review-aggregation-storefront-spec.md.
Quick start
- Org setup, once per org: register the AskCoworker MCP server and create an External Client App.
- Install the skill in your agent (below).
- Connect AskCoworker in your agent (step 4).
- Run it:
/write-spec <requirement> org: <alias> (the invocation differs by agent; see the table).
Install
| Agent | Install | Invoke |
|---|
| Claude Code (plugin) | claude plugin marketplace add msrivastav13/salesforce-write-spec-skill
claude plugin install salesforce-write-spec@salesforce-write-spec | /salesforce-write-spec:write-spec … |
| Claude Code (plain skill) | npx skills add msrivastav13/salesforce-write-spec-skill --skill write-spec -a claude-code -g | /write-spec … |
| Claude Desktop | Use the Code tab, which runs Claude Code on your machine, and install with either Claude Code option above | as in Claude Code |
| Codex | npx skills add msrivastav13/salesforce-write-spec-skill --skill write-spec -a codex -g | $write-spec … |
To install from a local clone instead, pass its path, e.g. claude plugin marketplace add ~/src/salesforce-write-spec-skill. Inside Claude Code the interactive equivalents are /plugin marketplace add … and /plugin install ….
Without npx: copy the skill folder yourself.
# Claude Code
mkdir -p ~/.claude/skills && cp -R skills/write-spec ~/.claude/skills/
# Codex
mkdir -p ~/.agents/skills && cp -R skills/write-spec ~/.agents/skills/
Developing the skill in this repo: run claude --plugin-dir . to load it for one session without installing it (/reload-plugins picks up edits).
Notes:
- Explicit invocation only. The skill doesn't trigger on its own:
disable-model-invocation: true in Claude Code, and allow_implicit_invocation: false in skills/write-spec/agents/openai.yaml for Codex.
- Claude Desktop Chat and Cowork aren't supported. The skill has to run
sf against an org you're logged in to on your own machine, so use the Code tab.
- Cross-agent installer. The
npx skills commands come from vercel-labs/skills. The Claude Code plugin install was tested end to end; the npx path was not.
Prerequisites
1. Tools and an authorized org
-
An agent from the table above
-
Salesforce CLI (sf), logged in to a Developer Edition org or a sandbox:
sf org login web --alias MyDevOrg
Name the org by adding org: <alias> to the skill's arguments. Without it, the skill uses your CLI default (sf config get target-org) and names that org in Section 2 of the spec. The skill needs no Python or other runtime; Python 3 is only for the optional eval aggregator.
2. Register the AskCoworker MCP server
In Setup → MCP Servers, create a Custom MCP server:
| Field | Value |
|---|
| API Name | AskCoworker |
| Tool | SearchAgent_1 (source: Agentforce Agents), the agent that runs multi-step retrieval over org and enterprise sources |
| Status | Active |
| Server URL (generated) | https://api.salesforce.com/platform/mcp/v1/custom/AskCoworker |
