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

Test and debug a mod with an agent

Do this by hand

Your agent drafts the test plan and the rule file, collects the logs after you play, reads the report and drafts the result for each step. You play the game, mark the steps and decide what to fix.

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
Write a test plan for MyMod for a new character, with five to eight smoke steps and the console commands to try. Check it and build the page.
Ask your agent
I've played the session and quit the game. Collect the logs with a save pair, read them with the rule file, and draft the result for each step.
Ask your agent
Compare my before and after saves and tell me exactly what changed. Say what the tool didn't check.

What the agent runs

The starfield-agent skills test-plan and log-review cover this task, and logging-rules covers the Debug.Trace and debug switch rules. Other agents follow each tool's AGENTS.md: sf-test-plan, papyrus-log-check, sf-log-collector and sf-save-health. The commands match the manual page.

Command Prompt
sf-mod-build doctor
Command Prompt
sf-test-plan new MyMod.testplan.md --mod MyMod
Command Prompt
sf-test-plan check MyMod.testplan.md
Command Prompt
sf-test-plan build MyMod.testplan.md

Before rules, the agent adds a log: <id> line under each step the log can prove. rules writes one rule per id, and on the starter plan, which has none, it writes nothing (0 log ids on 0 steps).

Command Prompt
sf-test-plan rules MyMod.testplan.md --prefix MYM --plugin MyMod.esm
Command Prompt
powershell -ExecutionPolicy Bypass -File .\Collect-StarfieldTestLogs.ps1 -SavePair

To share the zip, the agent adds -Redact, which hides your Windows user name, computer name, user folder and Steam account number in the copied text files:

Command Prompt
powershell -ExecutionPolicy Bypass -File .\Collect-StarfieldTestLogs.ps1 -SavePair -Redact
Command Prompt
python -I papyrus_log_check.py <StarfieldLogs-zip> --rules MyMod.logrules.json

To see everything one mod wrote across all your test runs, the agent can use the prefix mode (papyrus-log-check 0.5.0, released 2026-12-01). It searches every collector .zip in one folder for the mod's prefix (--prefix, plain text, any letter case, repeatable) and the start of its script names (--scripts), and --since and --until (YYYY-MM-DD, both days included) leave out whole zips by the day they were made. It reads no rule file, writes prefix-run<stamp>.txt and .json into out\, and ends with a RESULT: line. Exit 0 means a line was found, exit 1 means none was, and exit 2 is a refusal (a bad date, --prefix with --rules, or no readable Papyrus log in range). The agent should quote the RESULT: line, and say which zips were left out by date or SKIPPED.

Command Prompt
python -I papyrus_log_check.py --logs-dir "<folder of collector zips>" --prefix "[MYMOD]" --scripts MYMOD_ --since 2026-11-20 --until 2026-11-23
Command Prompt
sf-test-plan logs <report.json> --plan MyMod.testplan.md

logs finds your mod in the report by the plan's mod: line. If the rule file names the mod differently, the agent adds --mod <name>. It replaces an existing marks file only with --force, which includes the default marks file, so a second run on one report needs --force:

Command Prompt
sf-test-plan logs <report.json> --plan MyMod.testplan.md --force

The marks file from logs holds none of your own page marks. You open the plan page, use Import on that file, then Export, and the agent gives the exported file to sf-test-plan import <export> --plan MyMod.testplan.md. For each step the newer mark wins, but a mark from the log never replaces a mark or note you made yourself.

Command Prompt
sf-save-health solo <StarfieldLogs-zip>

solo needs a zip made with -SavePair. Without the pair, it exits 3.

For a quest, the agent starts from the quest tutorial's plan and rule file in this guide's repository (examples/PMTTutorialCourier/, with one check per stage and a getstage check). The tools' own made-up quest example, Tidewater Errand, ships in the release zips since sf-test-plan version 0.4.1 (examples\QuestExample.testplan.md and its rule file) and papyrus-log-check version 0.4.3 (examples\example-quest.log and example-quest.logrules.json). The agent changes the names, the quest ID and the log lines to yours. Before you play, the agent runs sf-mod-check check on the built plugin: since sf-mod-check version 0.19.0 it warns about a stage 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). It can't see a stage that another mod or the game's engine sets, so your play test is still the proof (Build a quest mod with an agent shows the check on the tutorial quest). In the tutorial's folder:

Command Prompt
sf-test-plan check PMTTutorialCourier.testplan.md --rules PMTTutorialCourier.logrules.json
Command Prompt
sf-save-reader quests <save.sfs> --filter <name> --details

The collector must run only when the game is closed. In a scripted run an agent adds -NoPrompt. The agent runs it as the Windows user who plays.

What you check

  • The PASS, FAIL and NOT SEEN lines. Ask the agent to quote them. NOT SEEN usually means the step wasn't tested.
  • Exit codes. For papyrus-log-check, exit 1 means at least one FAIL, and exit 2 means there is no report. For sf-save-health, exit 2 is normal after removing a mod, and only exit 3 means it didn't run.
  • The rule file. rules only guesses patterns. Read each pattern yourself, and check that lines that must never appear are under forbid.
  • Silent lines. For a voiced mod, ask the agent to run sf-mod-check release on the zip before you test. Since sf-mod-check version 0.18.0 it warns about each dialogue line with no voice file (rule voice-missing). A mod with dialogue and no voice files at all gets one NOTE instead of warnings, so ask the agent to report the NOTE lines too.
  • The agent's claims. A report is a reading aid, not a verdict. The agent must not call a mod good, or a save safe, from a clean run.
  • Private data. Reports quote log lines, which can hold Windows user and computer names. Read the report before it goes anywhere.

What stays your decision

  • Playing the session and marking each step Pass, Fail or Skip. The agent can draft results from logs, but only you saw the game.
  • Console testing, which is by hand on the console.
  • What to fix, and whether a failure is a bug in your mod.
  • Sharing logs or saves with anyone. -Redact hides names in the copied text files but not in saves, screenshots or file names, so you look inside the zip first.

For CK and xEdit authors

The agent can write the plan and rule file, run the collector and the log check, and explain the report. It can't play the game or edit your plugin. You add the Debug.Trace lines to your scripts in the CK.

For code builders

The agent can also add the GameplayOptions.Debug switch and the trace lines to your builder and scripts, compile without -release, and run sf-mod-build doctor. Check that its trace lines carry your prefix, and that it never uses Debug.Notification for text the player must see.

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

Do this by hand