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

Build a mechanics mod with an agent

Do this by hand

Describe the mechanic in plain words, and your agent makes the project, writes the script and the builder, builds the mod and runs the PC and Creations checks. You decide the design, check the agent's claims against each tool's RESULT line, and play-test the mod.

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 mod called PMTTutorialSecondWind with the prefix PTSW. When an enemy hits me while my health is below 25 percent in combat, restore 10 Health a second for 10 seconds and show "Second wind!" on the HUD, at most once every 120 seconds. Use only the mod's own records, log with Debug.Trace, add the debug switch, and make the Xbox archives.
Ask your agent
Look up every Papyrus function you plan to use with sf-papyrus-ref before you write it, and look up the vanilla records with sf-mod-check find. Tell me which names were found and which weren't.
Ask your agent
Build it, then run the plugin checks, the Papyrus check for Creations, the Creations release check on creations-out and the cut check. Quote each RESULT line and exit code.

What the agent runs

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

Command Prompt
dotnet new sfmod -n PMTTutorialSecondWind --prefix PTSW --mod-author "PMT Guide"
cd PMTTutorialSecondWind
sf-mod-build doctor
Command Prompt
sf-papyrus-ref build-local
sf-papyrus-ref lookup ScriptObject.RegisterForHitEvent
sf-mod-check find Health
sf-mod-check find EitherHand

To list records by a value (sf-mod-check 0.27.0 and later), the agent uses find --type with --where "<field> <op> <value>" (operators =, !=, ~, has and exists) or --editorid-match <regex>. To see what a vanilla cell holds or what stands near a point, it uses cell, which takes the cell's EditorID, FormKey or FormID (with --plugin, use the EditorID or FormKey). Both only read.

Command Prompt
sf-mod-check find --type NPC_ --where "Flags has Unique"
sf-mod-check find --type MISC --editorid-match "^MyMod_"
sf-mod-check cell <cell>
sf-mod-check cell --near <worldspace> <x> <y> <radius>
Command Prompt
sf-mod-build validate
sf-mod-build build
sf-mod-build build --verbose
Command Prompt
sf-mod-check check dist\PMTTutorialSecondWind.esm
sf-mod-check gap dist\PMTTutorialSecondWind.esm
sf-papyrus-ref check Scripts --creations
sf-mod-check release creations-out --profile creations
sf-cut-check scan --plugin dist\PMTTutorialSecondWind.esm --out C:\Scratch\cutcheck-sw
Command Prompt
sf-test-plan new PMTTutorialSecondWind.testplan.md --mod PMTTutorialSecondWind

The agent replaces the starter steps and adds a log: <id> line under each step the log can prove. Only then does it run rules, because rules writes a rule for each log: id, and on the starter plan it writes nothing (0 log ids on 0 steps):

Command Prompt
sf-test-plan rules PMTTutorialSecondWind.testplan.md --prefix PTSW --plugin PMTTutorialSecondWind.esm
sf-test-plan check PMTTutorialSecondWind.testplan.md --rules PMTTutorialSecondWind.logrules.json
sf-test-plan build PMTTutorialSecondWind.testplan.md --rules PMTTutorialSecondWind.logrules.json

The release creations-out command needs "xbox": true in sfmod.json, because only then does the build write creations-out. Without it, the command exits 2 with CANNOT CHECK (creations-out: no such file). The tutorial's source, with its WALKTHROUGH.md, is in the folder examples/PMTTutorialSecondWind/ of this guide's repository (https://github.com/taosecurity/starfield-pmt-guide).

The agent should run validate and read the runs: lines before it builds a project it didn't make, because sfmod.json runs commands. It should never compile with -release and never change the BuildKit or Mutagen pins unless you ask. The starter template of sf-mod-build 0.7.0 pins BuildKit 0.6.2 and Mutagen 0.54.4.

What you check

  • Every Papyrus name was looked up. Ask for the list. A name that lookup didn't find (exit 1) must not be in the script unless the agent can show the script that defines it. Agents can invent function names, and this is how you catch it.
  • Field filters. An unknown field name is refused with exit 2 and a list of the record type's fields, so the agent should correct the name, not guess. --where looks only at the winning copy of each record.
  • The RESULT lines. sf-mod-build build ends RESULT: OK, built ...zip, check and gap end RESULT: OK, and release creations-out --profile creations ends RESULT: OK (0 problems, 0 to review, 0 warnings). Ask for the exact lines and exit codes, not a summary.
  • The right set for Creations. The Creations check must run on creations-out. If the agent ran it on the zip, it will report a creations-xbox WARNING that only means it checked the PC download.
  • Player text. Text the player must see is a Message record. Debug.Notification may appear only behind the debug switch. sf-papyrus-ref's two warnings for Debug.Trace and Debug.Notification are expected, but any error isn't.
  • No vanilla records changed. check reports overrides. For this mod it should say 0 overrides.
  • Platforms. sf-mod-build is tested on PC (Steam) and Xbox. PS5 is not tested, and that is a known limit. Since sf-mod-build 0.7.0, a build with "xbox": true also writes <plugin> - Main_ps.ba2 in creations-out, a copy of the PC Main archive for PlayStation 5. PS5 reads PC-format files except audio, and there is no _ps Textures archive, so a mod with voice files still needs a PS5 audio test. The agent shouldn't claim a mod is ready for PlayStation 5.
  • Sound. sf-mod-build converts no sound, except that its voice step (version 0.6.0 and later) makes PC voice and lip files from WAVs for new dialogue lines. A PC .wem is silent on consoles, and voice is refused with "xbox": true.

What stays your decision

  • The design: what the mechanic does, its numbers, and what the player sees.
  • Playing the test on a new character and marking each step. The agent can only draft results from the logs.
  • Console testing, which is by hand on the console.
  • The upload. The agent never uploads, and the Creation Kit does the Creations upload. Whether and where to release is yours.

For CK and xEdit authors

The agent can't drive the CK's window. You make the records in the CK, and the agent can look up Papyrus names, write and check your scripts, and run check, release --profile creations and scan --plugin on the CK's plugin. It should skip gap, which is for plugins written with Mutagen.

For code builders

The agent can write the whole builder with BuildKit, including the magic effect with plain Mutagen where BuildKit has no helper. Since BuildKit 0.6.2, an on/off option's description ends with DISABLE: or ENABLE: (earlier builds wrote OFF or ON), so a rebuild differs from the old build in those lines, and since 0.6.3 an extra folder that doesn't exist makes new GameData(dataDir, extraDirs) throw. Check that it kept ids.lock.json, used Messages.Hud for player text and GameplayOptions.Debug for the switch, and ran gap on the result.

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

Do this by hand