/delivery-salesforce:delivery-salesforce-buildfrom delivery-salesforce
The Build stage of Delivery for Salesforce, Nouter's delivery line. Use it when you are the agent launched to build one story in a disposable VM - to implement the story's design, deploy and test it in the scratch org until it passes, and hand in the result without pushing or deploying to the target.
Ships in delivery-salesforce. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an agent launched to build one story. You see only your task, a VM (vm) and a callback (result): no other
tool, no chat. This skill is the contract of the stage and it rules where another skill of your task says something
different: the Salesforce skills carry examples for other environments (MCP tools, Code Analyzer, questions to the user,
other orgs), and none of that exists here.
The task has the stage's prompt, this skill, and the input: story (its design, criteria, testData and risk),
repo, branch, and, when the story came back to Build, report (why verification failed) and comment (what a person
said when returning it). If it came back, fix what the report or the comment says, not a new design.
/workspace, on a branch for this story. A scratch org is logged in with the alias run. There is
no default org, so every sf command carries -o run; the VM has no session for the org's REST API.salesforce/platform-permission-set-generate and assign it with sf org assign permset -n <Name> -o run before
the tests or queries that need it. If the design does not say who gets access, create a permission set named after the
story with the least privilege that works, and say so in the summary.delivery-salesforce-traps: read its Building section.salesforce/platform-custom-field-generate, salesforce/platform-validation-rule-generate,
salesforce/platform-permission-set-generate): the metadata XML is fragile. There is no flow skill: write the
.flow-meta.xml by hand and test it with Apex that makes it fire.vm.exec(argv, { cwd, stdin, timeoutMs }) runs a command and waits for it. The argv has no shell: use
["sh", "-c", "..."] for pipes and redirections.
timeoutMs: 1_800_000 (30 minutes, the most there is), or start it with vm.run(argv, opts), which returns a
{ jobId } at once, and poll vm.job(jobId) (state: running, done or failed) every 15 seconds or so.exitCode: null with failure: "timeout" means the command did not finish, not that it failed. Run it again with
vm.run() and wait with vm.job(), or with a longer timeoutMs. failure: "vm" means the VM failed: say so in
your summary and stop.exec gives you only the end of the output (tail: the last 200 lines). The rest is saved in r2Key, which you
cannot read. Send long output to a file and read the file:await vm.exec(["sh", "-c", "sf project deploy start -o run --json --wait 20 > /tmp/deploy.json 2>&1"], { cwd: "/workspace", timeoutMs: 1_800_000 })
const { content, truncated } = await vm.readFile("/tmp/deploy.json")
truncated: true means content is only the start: filter big output in the command
(| jq '.result.details.componentFailures') before reading it.
vm.readFile(path), not cat. Write with vm.writeFile(path, content) (up to 65,536 characters; for more,
use vm.exec with stdin).with sharing unless the design says
otherwise, bulk-safe, no hardcoded ids. Verify reviews exactly this.apex-test criteria name classes: create them with those names. Cover the single record, the
bulk case with 251 records (a trigger takes its records in batches of 200) and the negative path, with the test's
own data. For anonymous-apex and soql-assert criteria, make sure the behavior they check will exist.sf project deploy start -o run --json --wait 20, then
sf apex run test -o run --code-coverage --result-format json --wait 20; read the failures, fix the cause and repeat.
The line deploys the project and runs all the tests again itself, and they have to pass.git -C /workspace add -A: the line commits what is staged, as the bot, writes the story's
design and criteria into docs/delivery/<order>/<story>.md, pushes the branch and opens the pull request, so you do not
commit or push. Leave out generated folders the repository does not ignore (.sf/, .sfdx/, node_modules/).result.deliver: a text message delivers nothing, so do not stop to report progress in text.await result.deliver({ summary: "...", changes: ["force-app/.../X.cls"], tests: ["XTest"] })
summary says what you built and any decision you took where the design was silent; changes and tests list the
files and test classes. If you are blocked and cannot finish, hand in what you have with a summary that says what
blocks it; do not ask.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub nouter-ai/plugin-catalog --plugin delivery-salesforce6 skills in this plugin
/delivery-salesforce-processThe Delivery order process template of Delivery for Salesforce, Nouter's delivery line, its stages and its signatures. Use it when you create the Delivery order gadget for a request, to pass the template exactly as published, and to know what each stage expects and who signs./delivery-salesforce-proposeThe Propose stage of Delivery for Salesforce, Nouter's delivery line. Use it after the requester confirmed the understanding - to split the request into stories that can be proven done by a machine, with their design, executable criteria and estimate, to create the Delivery order gadget with the template and the proposal, and to send new versions until the proposal is valid./delivery-salesforce-trapsWhat usually breaks when building and verifying a Salesforce story in Nouter's delivery line, and how to get past it. Build reads the Building section and Verify the Verifying one; read it when you give access, write tests that create users, or the same error comes back./delivery-salesforce-understandThe Understand stage of Delivery for Salesforce, Nouter's delivery line. Use it when someone asks for a change to their Salesforce project in the chat, before proposing anything - to interview the requester, read the project's repository and the org without reading records, read an attached SOW, and get the requester's confirmation./delivery-salesforce-verifyThe Verify stage of Delivery for Salesforce, Nouter's delivery line. Use it when you are the agent launched to verify one story with a clean context, different from the agent that built it - to deploy the pull request's tree to a clean scratch org, prove each criterion with evidence, and report pass or fail honestly.