Inspiration
Automod configuration files can be hard to write and manage. I built Automod Wizard to make AutoModerator accessible to all moderators, especially new mods who may not have extensive YAML knowledge.
What it does
Automod Wizard is a visual rule builder for Reddit's AutoModerator. You open it from the subreddit menu and build rules as a vertical stack of steps instead of writing YAML.
Each rule has a scope (posts, comments, or everything), one or more trigger and filter steps (content matches, author conditions, post attributes, parent submission constraints), and an action. There are 14 action types: remove, spam, filter, approve, report, set flair, post a comment, modmail the team, DM the author, lock, mark NSFW, mark spoiler, sticky, set suggested sort, and contest mode.
Edits auto-save to Redis and auto-publish to the subreddit's config/automoderator wiki page about 1.5 seconds later. A status badge at the top shows what's happening; if a publish fails, tapping the badge opens an error panel with copy buttons for the error and the YAML that was attempted.
The first time you open the app on a subreddit that already has an AutoMod config, the wizard imports the existing YAML and walks you through reviewing the rules it recovered. If the wizard sees a YAML construct it doesn't recognize, it keeps the original text as an "Unrecognized step" rather than dropping it, so editing a partially-supported config doesn't destroy hand-written sections. A Revert button restores the original wiki YAML the wizard first imported.
If the wiki diverges from what the wizard last published (someone edited it directly, reverted to an older version, or wiped it), the wizard detects that on the next load and offers a per-rule diff: keep the wiki version, keep the saved version, or drop it.
Fresh installs on a subreddit with no AutoMod config get a six-screen tutorial instead of an empty editor. The flow can be replayed later from the status panel.
Challenges I ran into
Mapping AutoMod's syntax onto a visual editor. AutoMod's YAML has several subtleties that mattered for round-tripping correctly: comparisons need to be quoted strings ("< 100"), only one comparison per field is supported, range checks have to be expressed as two separate fields, and modifiers attach as suffixes like (includes-word), (starts-with), (full-exact), (regex). The emitter and parser had to handle all of these consistently so that a rule built in the wizard, published to the wiki, re-imported, and republished produces byte-identical output.
Detecting when the wiki was edited outside the wizard. The wiki is the source of truth for what AutoMod actually runs, but moderators legitimately hand-edit it and old configs predate the app entirely. Each emitted rule is tagged with a # wizard-rule-id: comment and separated by ---. On load, the wizard counts separators and ID markers; if they diverge, it runs a signature-based fuzzy match (hashing the rule's filter chain) to figure out which wiki rules correspond to which stored rules, and the user gets a per-rule diff to decide what to keep.
Mobile webview constraints. Reddit's mobile app shows "Sorry, removed by mods" for any custom post until the app explicitly approve()s it, even for moderators viewing their own app's post. confirm() and prompt() aren't reliable inside the webview either, so destructive actions go through an in-app modal. Screen real estate is tight enough that I built a separate full-screen detail view for the import-review screen instead of trying to fit a chip strip and brief into a 320-pixel-wide card.
Mod-only gating. Webview entrypoints in Devvit Web are static HTML, so the gate has to live on the client. I used a two-layer pattern: a static splash page is the post's default entrypoint, which calls an init endpoint that returns isModerator: boolean. Mods see an "Open wizard" button (which calls requestExpandedMode("wizard") to load the actual editor); non-mods see a "Not for you!" card.
Robust error reporting. Devvit menu handlers return a UiResponse, and if a handler throws, the client sees a generic error. I wrapped every endpoint in a try/catch that surfaces a clear toast and writes the underlying error to server logs, so a failed publish becomes a tappable status badge with a copy-pasteable report rather than a dead end.
Accomplishments that I'm proud of
- A YAML round-trip parser that preserves input it doesn't understand. Unrecognized constructs are kept verbatim as
UnknownNodes and re-emitted on publish, so the wizard can edit configs it doesn't fully model without destroying them. - Signature-based corruption recovery. When the wiki diverges from saved state, rules are auto-matched by content hash so the diff view shows "this rule matched, this is new, this was deleted" instead of a wall of duplicates.
- End-to-end tested with 14 distinct rule types covering every action type and most filter combinations. The YAML the wizard generates is the YAML AutoMod runs; there is no separate "preview" mode.
What I learned
- Building a visual editor for a YAML format is a forcing function for actually understanding the format. I started this project with a rough familiarity with AutoMod and finished it with a much deeper one.
- Approval review catches what a personal test rig doesn't. I had a fresh-install bug where on-demand
submitCustomPostwas failing in some configurations: not in my dev sub, but in the reviewer's. The fix (pre-create the post inonAppInstall, fall back to on-demand) was easy once I could see the error. "Works in dev" is not the same as "robust against environments I haven't seen." - Snapshot before you touch anything. The wizard saves the original wiki YAML the moment it first imports it. The Revert button is a safety net that turned a few "wait, did I just break the sub?" moments into shrug-and-undo.
- Mobile-first UI in a Reddit webview rewards being literal about constraints. No
confirm(), noprompt(), tight viewports, swipe gestures that compete with the host app's gestures. Designing around those from the start is much easier than retrofitting.
What's next for Automod Wizard
- A "test against a sample post" mode: paste a title and body, see which rules would fire.
- Rule templates. A library of common rules (low-karma filter, link-only sub, OP-only replies) you can drop in with one tap and tweak.
- Per-publish history. Right now Revert is all-or-nothing back to the original snapshot; I'd like to keep a history so you can undo just the last edit.
- Sharing. Export a rule or a whole config as a portable snippet you can paste into another mod's wizard.
- More AutoMod feature coverage as new fields and actions land. The parser already round-trips unknown constructs safely, but I'd rather give them first-class UI.
Built With
- css
- devvit
- esbuild
- html
- js-yaml
- node.js
- redis
- typescript
Log in or sign up for Devpost to join the conversation.