Part 2: For modders · 7 sections · page built 2026-12-05 00:35 UTC

Build a quest mod with an agent

Do this by hand

Describe the quest's stages, objectives and aliases in plain words, and your agent writes the scripts and the quest records, builds the mod, runs the checks and writes a test plan with a check for each stage. You decide the story, play each stage, and confirm the quest really finishes.

Richard is modding

What's new

  • 2026-12-03. The page now has a Richard is modding panel that links to Richard's mods at Creations and Nexus Mods, and to Help Richard Help You.
  • 2026-11-29. This page has a new look, the same as the other Richard Presents pages, with a menu that lights the section you are reading, a short summary at the top and this What's new box.

What to ask

Ask your agent
Make a new quest mod called PMTTutorialCourier with the prefix PTCR. Three stages: when I first arrive in New Atlantis, give me a note and show "Read the courier's note"; when I read it, show "Collect 5 Iron"; when I hold 5 Iron, pay 100 credits, complete the quest and show a HUD message. One player alias, no dialogue or voice, no changes to vanilla records, and the Xbox archives.
Ask your agent
Make sure the quest finishes properly: call Stop() after CompleteQuest() at the last stage, and flag that stage's journal entry Complete Quest. Show me where you did both.
Ask your agent
Write a test plan with one group per stage and the getstage and setstage console commands, and a rule file for the stage log lines. After my test, read the quest from my save and tell me its state.

What the agent runs

The starfield-agent skills new-mod, build-mod, logging-rules and test-plan cover this task. Other agents follow each tool's AGENTS.md: sf-mod-build, BuildKit, sf-mod-check, sf-papyrus-ref, sf-cut-check, sf-test-plan and sf-save-reader. The commands match the manual page, where each one is explained.

Command Prompt
dotnet new sfmod -n PMTTutorialCourier --prefix PTCR --mod-author "PMT Guide"
cd PMTTutorialCourier
sf-mod-build doctor
Command Prompt
sf-papyrus-ref lookup Quest.SetStage
sf-papyrus-ref lookup Quest.Stop
sf-mod-check find CityNewAtlantisLocation
sf-mod-check find InorgCommonIron
Command Prompt
sf-mod-build validate
sf-mod-build build
Command Prompt
sf-mod-check check dist\PMTTutorialCourier.esm
sf-mod-check gap dist\PMTTutorialCourier.esm
sf-mod-check find --plugin dist\PMTTutorialCourier.esm
sf-papyrus-ref check Scripts --creations
sf-mod-check release creations-out --profile creations
sf-cut-check scan --plugin dist\PMTTutorialCourier.esm --out C:\Scratch\cutcheck-cr
Command Prompt
sf-test-plan new PMTTutorialCourier.testplan.md --mod PMTTutorialCourier
sf-test-plan rules PMTTutorialCourier.testplan.md --prefix PTCR --plugin PMTTutorialCourier.esm
sf-test-plan check PMTTutorialCourier.testplan.md --rules PMTTutorialCourier.logrules.json
sf-test-plan build PMTTutorialCourier.testplan.md --rules PMTTutorialCourier.logrules.json
Command Prompt
sf-save-reader quests <save.sfs> --data --filter PTCR --details

If the quest has scenes, the agent can run sf-mod-check scenes MyQuest --plugin MyMod.esm (since sf-mod-check 0.24.0, released 2026-11-26). It prints each scene as a conversation tree and checks it: a jump to a part the scene doesn't have (scene-phase-missing, an ERROR that check also reports), a choice part with no way out (scene-no-exit), a stage gate nothing sets (stage-gate-unset, a WARNING, or a NOTE when scripts can't be read or a SetStage number is worked out while the game runs), a Scene topic no scene uses (scene-topic-unused), and a stage that is set and never checked (stage-set-unchecked, a NOTE). The tutorial has no scenes. Exit 0 means the quest was found, even with problems, so ask the agent to report the Problems list and the RESULT line. A stage-set-unchecked NOTE reads like this: NOTE stage-set-unchecked: MyQuest stage 20 is set (000821:MyMod.esm (on end)) but no condition in MyMod.esm checks it, so setting it changes no dialogue or quest condition (a script may still read it).

To read what the player will see, the agent can run text (sf-mod-check 0.28.0, released 2026-11-27). It lists every string the plugin adds or changes that the game shows or translates, each with its field path: the quest's name, the journal entries, the objectives, a book's text and the messages. An override lists only the strings it changes, with the master's text as was:. On the tutorial plugin it lists 14 strings in 5 new records and ends RESULT: text: 14 strings in 5 records (5 new, 0 changed) in PMTTutorialCourier.esm. Ask the agent to read it for typos and for any line that tells the player something false. It only reads, and exit 2 means it couldn't run.

Command Prompt
sf-mod-check text dist\PMTTutorialCourier.esm

find --plugin lists the quest's alias and one line per stage, but not the log entries' flags. For those, the agent runs find PTCR_Quest --stages --plugin dist\PMTTutorialCourier.esm (sf-mod-check 0.30.0 and later, quests only, other record types exit 2). It prints every stage with its flags and log entries, then every objective, and for a stage fragment it reads the compiled script and says which stages and objectives the fragment changes. On the tutorial it shows stage 30 as [CompleteQuest], so the agent can quote that flag. A call whose value is only known while the game runs is listed as one it can't read, so the agent must not call such a stage proven. In the tutorial's 0.1.1 and 0.1.2 tests, sf-save-reader read the quest as "stopped, completed, stage 30". rules writes a rule only for each log: id in the plan, so the agent adds those lines first, and release creations-out needs "xbox": true in sfmod.json. The tutorial's source, with its WALKTHROUGH.md, is in the folder examples/PMTTutorialCourier/ of this guide's repository (https://github.com/taosecurity/starfield-pmt-guide).

The tutorial was written before BuildKit had quest helpers, so its Program.cs writes the stages, objectives and aliases with plain Mutagen next to Quests.New. For a new quest, BuildKit 0.6.3 has Quests.Basic, Quests.Stage, Quests.Objective, four alias helpers (ForcedAlias, FindAlias, CreatedAlias, LocationAlias), Quests.Scene for a simple two-actor scene and Quests.Fragments for the stage fragment script, all in the Creation Kit's layout (BuildKit's README, section "Quests"). The sf-mod-build starter template pins BuildKit 0.6.2 (since version 0.7.0; it pinned 0.6.0 from version 0.5.1), so a new project has the helpers. The agent should use the helpers, tell you about anything it still writes with plain Mutagen (collection aliases and scene package actions aren't covered), and run sf-mod-check gap on the plugin, because gap finds data that Mutagen loses when it writes records. With Quests.Fragments, it runs IdLock.Apply first, takes the quest again from the plugin (IdLock may replace it with a copy), then calls Apply(), and ships the compiled fragment script, or the stages do nothing. BuildKit's README says the order matters because the fragment script's name holds the quest's FormID, and the quest record must agree with the compiled script. No quest built with the helpers has been played in game yet, so your test is the proof.

For a second model to copy, the agent can use the made-up quest example, Tidewater Errand, that ships in the sf-test-plan and papyrus-log-check release zips (see Test and debug a mod with an agent).

Voice for new dialogue

If the quest has dialogue, each new line needs a voice file, or it plays silent. Since sf-mod-build 0.6.0, its voice step makes the .wem voice files and .ffxanim lip files from one WAV per line, without opening the Creation Kit. It needs sf-mod-check 0.21.0 or later, your own Audiokinetic Wwise 2021.1 (sf-mod-build never ships it; register your mod there as a free non-commercial project and credit Audiokinetic in the README), the Creation Kit's Tools folder (the Wwise project, LipGenerator and ffxc) and the WAVs. The agent lists the lines, you supply one WAV per line named <FILENAME>.wav in a folder named after its voice type (Starfield Voice Cloner's output folder works as it is), and the agent adds "voice": { "source": "Voice" } to sfmod.json and builds.

Command Prompt
sf-mod-check voice-lines dist\MyMod.esm --out MyMod-lines.tsv
Command Prompt
sf-mod-build voice

A line with no WAV is a WARNING and stays silent, a WAV that matches no line is a WARNING, a line with no text gets a .wem but no lip file, and a line whose WAV, text and face set haven't changed is skipped. The agent must tell you to keep the WAVs: they are the source, and a line whose WAV is gone loses its files at the next run. Since sf-mod-build 0.7.0, two more fields cover lines your WAVs don't: reuse ("voice": { "reuse": [ { "from": "Starfield.esm" } ] }) gives a new line with no WAV the recording of the same voice type and number from the plugin you name, and replace ("voice": { "source": "Voice", "replace": ["HelperCrew.esm"] }) gives a master's line your own WAV at the master's own path, and the plugin must have that master. Both are English only, and a voice path may come from one place only. To see what voice files a mod ships and whether each has its lip file, the agent runs voice-format, a report that never calls a format wrong:

Command Prompt
sf-mod-check voice-format dist\MyMod.esm

The voice step makes PC files only. It is refused with "xbox": true, because a PC .wem is silent on Xbox and PlayStation 5, and it covers the main plugin's lines, not those of parts plugins. A subtitle with digits ("18,000 credits") gives a different lip file than the spoken words would, so the agent should write such lines in words.

What you check

  • The quest finishes. Ask the agent to show the last stage's script lines (CompleteQuest(), then Stop()) and the journal entry's Complete Quest flag. Without both, the quest keeps running after it completes. After your test, the save should read "stopped, completed", not "running, completed". Don't judge by Missions > Completed: the game never lists a finished Activity there, vanilla ones included (found in the tutorial's 0.1.2 test, 2026-11-26).
  • The quest's item can't be lost. If the player needs an item to move the quest on, such as the tutorial's note, ask the agent to put it in an alias with the Quest Object flag (ForceRefTo() when it's given, Clear() before Stop()), so the player can't drop, sell or store it too early. Test it: try to drop and sell the item before the quest ends.
  • Every stage is set, and every stage the scripts set exists. Since sf-mod-check version 0.19.0, check warns about a stage of your quest that nothing in the plugin sets (quest-stage-unset) and about a script that sets a stage the quest doesn't have (quest-stage-missing). Ask the agent to quote those lines, or the clean RESULT line, and to run check --verbose to show what sets each stage. On the tutorial's 0.1.1 plugin, the log read PTCR_Quest [QUST:000802:PMTTutorialCourier.esm]: 3 stage(s), 3 set, unset: none (2026-11-25). The check can't see a stage that another mod or the game's engine sets, and it prints a NOTE instead when it can't read a script, so the agent must not call a WARNING a bug or a clean run a proof. Your play-through of each stage is the proof.
  • Every Papyrus name was looked up. A name that lookup didn't find must not be in a script unless the agent can show where it is defined.
  • The RESULT lines and exit codes of check, gap, release creations-out --profile creations and sf-test-plan check. Ask for the exact lines.
  • The rule file. rules only guesses patterns. Check that each one matches the real [PTCR] line and that no-script-errors is under forbid.

What stays your decision

  • The story, the stage numbers, the reward and every line of player text.
  • Playing each stage on a new character and marking the plan. The agent drafts results from the log and the save, but only you saw the Missions menu.
  • Voice: recording or generating the WAVs, and installing and registering your own Wwise 2021.1, if your quest has dialogue. The agent can make the voice and lip files from your WAVs with sf-mod-build's voice step (below), but not console audio. sf-mod-check release warns about a line with no voice file (rule voice-missing, since version 0.18.0; a mod with no voice files at all gets one NOTE instead), but only you can hear whether a line is right, so you listen to each one.
  • Console testing, by hand on the console, and the upload, which the Creation Kit does. The agent never uploads.

For CK and xEdit authors

The agent can't drive the CK's window. You build the stages, objectives and aliases in the CK, which is the normal route for quests. The agent can write and check the stage scripts, remind you to call Stop() and tick the Complete Quest checkbox on the last stage's log entry in the CK, run every check on the CK's plugin, and write the test plan and rule file.

For code builders

The agent can write the whole quest with BuildKit's quest helpers, or with plain Mutagen as the tutorial's Program.cs does. Check that it said which records it wrote with plain Mutagen, ran gap after the build, kept ids.lock.json, and made the last stage complete the quest (end: StageEnd.CompleteQuest with the helpers, or QuestLogEntry.Flag.CompleteQuest on the last stage's entry with plain Mutagen).

Read the guardrails before you let an agent act on your files.

Do this by hand