.agents/skills/devvit-config/SKILL.md
Modify devvit.json to add menu items, triggers, post entrypoints, or permissions. Use when wiring new server endpoints to Reddit UI actions.
npx skillsauth add vigneshksaithal/binarygrid update-devvit-configInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
All code must follow the Coding Principles in AGENTS.md (functional, minimal, readable, modular).
{
"$schema": "https://developers.reddit.com/schema/config-file.v1.json",
"name": "app-name",
"post": {
"dir": "dist/client",
"entrypoints": {
"default": {
"entry": "src/client/index.html",
"height": "tall", // "short" | "regular" | "tall"
"inline": true // renders inside post, not popup
}
}
},
"server": {
"dir": "dist/server",
"entry": "index.cjs"
},
"menu": { ... },
"triggers": { ... },
"dev": { ... }
}
Menu items appear in Reddit's "..." menu on posts or subreddits. Each maps to an /internal/menu/* endpoint.
{
"menu": {
"items": [
{
"label": "Human-readable label",
"description": "Tooltip text",
"location": "subreddit",
"forUserType": "moderator",
"endpoint": "/internal/menu/action-name"
}
]
}
}
| Field | Values | Notes |
|-------|--------|-------|
| location | "subreddit", "post", "comment" | Where the menu item appears |
| forUserType | "moderator", "member" | Who can see it |
| endpoint | /internal/menu/{name} | Must match a Hono route |
After adding a menu item, create the matching Hono handler:
app.post('/internal/menu/action-name', async (c) => {
// handler logic
return c.json({ status: 'success', data: {} })
})
Triggers fire on platform events. Each maps to an /internal/* endpoint.
{
"triggers": {
"onAppInstall": "/internal/on-app-install",
"onPostCreate": "/internal/on-post-create",
"onCommentCreate": "/internal/on-comment-create"
}
}
| Trigger | Fires when |
|---------|-----------|
| onAppInstall | App installed on a subreddit |
| onAppUpgrade | App updated to new version |
| onPostCreate | New post created in subreddit |
| onCommentCreate | New comment on any post |
| onPostDelete | Post deleted |
| onCommentDelete | Comment deleted |
| Height | Pixels | Use case |
|--------|--------|----------|
| "short" | ~240px | Simple widgets, counters |
| "regular" | ~320px | Cards, small games |
| "tall" | ~512px | Full games, complex UI |
src/server/__tests__/endpoint matches a Hono route in src/server/index.tslocation and forUserType are appropriate for the action/internal/menu/* or /internal/on-* conventionbun run test passes with zero failuresdevelopment
Test-Driven Development workflow using Vitest + @devvit/test. Use when writing any new feature, fixing bugs, or refactoring existing code.
tools
Create a Svelte 5 component with optional data fetching. Use when adding UI components, views, interactive elements, or wiring client-side fetch to server endpoints.
data-ai
Design and implement Redis data storage for a new feature. Use when adding new data models, leaderboards, counters, or any persistent state.
development
Interact with the Reddit API from server-side code. Use when reading user info, submitting posts/comments, setting flair, or accessing subreddit data.