{
  "$schema": "https://petdex.crafter.run/discord/server-template.schema.json",
  "_comment": "Source of truth for the Petdex Community Discord server. Apply via the discord-mcp tools using docs/discord/apply-template.md as the prompt. Categories render top-to-bottom in the order listed; channels in each category render top-to-bottom in the order listed.",

  "guild": {
    "name": "Petdex Community",
    "iconPath": "public/brand/discord-icon.png",
    "description": "Animated pixel pets for the Codex CLI. Where creators ship, collectors trade, and the Pokédex grows.",
    "rulesAcceptanceRequired": true,
    "verificationLevel": "low",
    "explicitContentFilter": "members_without_roles"
  },

  "roles": [
    {
      "name": "Petdex Team",
      "color": "#5266EA",
      "hoist": true,
      "mentionable": false,
      "permissions": ["Administrator"],
      "_comment": "Founders + admins. Skip discord ban hammer for these. Clerk admin status is the source of truth, this is just a colored badge."
    },
    {
      "name": "Featured Creator",
      "color": "#F4A261",
      "hoist": true,
      "mentionable": true,
      "permissions": [
        "SendMessages",
        "AttachFiles",
        "EmbedLinks",
        "AddReactions",
        "UseApplicationCommands",
        "CreatePublicThreads"
      ],
      "_comment": "Manually granted to creators with a dedicated /collections/<slug> spotlight (graycraft, scientific-minds, etc.). Mention them when their collection lands."
    },
    {
      "name": "Creator",
      "color": "#7AA2F7",
      "hoist": true,
      "mentionable": false,
      "permissions": [
        "SendMessages",
        "AttachFiles",
        "EmbedLinks",
        "AddReactions",
        "UseApplicationCommands",
        "CreatePublicThreads"
      ],
      "_comment": "Auto-assigned by the petdex bot when a user has 1+ approved pets and links their Clerk → Discord account."
    },
    {
      "name": "Collector",
      "color": "#9D8DF1",
      "hoist": false,
      "mentionable": false,
      "permissions": ["SendMessages", "AddReactions", "UseApplicationCommands"],
      "_comment": "Auto-assigned at 3+ caught pets. Pure flair, feeds the leaderboard rivalry."
    },
    {
      "name": "Verified",
      "color": "#A0AAB6",
      "hoist": false,
      "mentionable": false,
      "permissions": ["SendMessages", "AddReactions", "UseApplicationCommands"],
      "_comment": "Default role granted after passing #welcome onboarding (rules accept). Required to send messages anywhere."
    },
    {
      "name": "Petdex Bot",
      "color": "#5266EA",
      "hoist": false,
      "mentionable": false,
      "permissions": [
        "ManageChannels",
        "ManageRoles",
        "ManageMessages",
        "ManageWebhooks",
        "SendMessages",
        "EmbedLinks",
        "AttachFiles",
        "UseApplicationCommands"
      ],
      "_comment": "Granted by the OAuth bot install; never assigned by hand."
    }
  ],

  "categories": [
    {
      "name": "🌟 START HERE",
      "channels": [
        {
          "name": "welcome",
          "type": "text",
          "topic": "Read the rules and pick your roles. Welcome to the Pokédex of pixel pets.",
          "slowmode": 5
        },
        {
          "name": "announcements",
          "type": "announcement",
          "topic": "New features, new collections, new featured creators. Read-only.",
          "lockedToBot": true
        },
        {
          "name": "introductions",
          "type": "text",
          "topic": "Tell us your name, your favorite pet, and what you're building.",
          "slowmode": 30
        }
      ]
    },
    {
      "name": "🐾 PETS",
      "channels": [
        {
          "name": "showcase",
          "type": "text",
          "topic": "Every approved pet lands here, posted by Petdex Bot. React, riff, vibe.",
          "lockedToBot": true
        },
        {
          "name": "wip",
          "type": "text",
          "topic": "Share work-in-progress sprites. Honest feedback only. No critique = no growth."
        },
        {
          "name": "collections",
          "type": "text",
          "topic": "Discuss the 10 featured collections. Suggest pets, request new sets."
        },
        {
          "name": "ip-spotlight",
          "type": "text",
          "topic": "Featured creators of the moment: GRAYCRAFT, Scientific Minds, Crafter Originals.",
          "lockedToBot": true
        }
      ]
    },
    {
      "name": "💬 COMMUNITY",
      "channels": [
        {
          "name": "general",
          "type": "text",
          "topic": "The default room. Pets, code, life. Keep it kind."
        },
        {
          "name": "off-topic",
          "type": "text",
          "topic": "Anything that isn't pets. Memes welcome."
        },
        {
          "name": "ideas",
          "type": "text",
          "topic": "Pet ideas the community wants to see. Synced with petdex.crafter.run/requests.",
          "slowmode": 60
        },
        {
          "name": "help",
          "type": "text",
          "topic": "Issues installing the CLI, signing in, or submitting a pet. Search before you ask."
        }
      ]
    },
    {
      "name": "🛠️ BUILDERS",
      "channels": [
        {
          "name": "dev",
          "type": "text",
          "topic": "For people extending the Codex CLI or hacking on Petdex itself."
        },
        {
          "name": "cli-feedback",
          "type": "text",
          "topic": "Bug reports + feature requests for `npx petdex`."
        },
        {
          "name": "design",
          "type": "text",
          "topic": "Sprite art tips, palette references, animation tricks."
        }
      ]
    },
    {
      "name": "🎉 EVENTS",
      "channels": [
        {
          "name": "ship-or-sink",
          "type": "text",
          "topic": "Weekend build competitions. Theme drops Friday, results Sunday."
        },
        {
          "name": "hackathons",
          "type": "text",
          "topic": "Petdex hackathon announcements + team-finding."
        }
      ]
    },
    {
      "name": "🔊 VOICE",
      "channels": [
        {
          "name": "co-working",
          "type": "voice",
          "topic": "Silent co-work room. Camera optional, vibes mandatory."
        },
        {
          "name": "pixel-jam",
          "type": "voice",
          "topic": "Live sprite-art jams. Share screen, draw together."
        },
        {
          "name": "office-hours",
          "type": "voice",
          "topic": "Open hours with Petdex Team. Drop by Fridays 4pm GMT-5."
        }
      ]
    },
    {
      "name": "🔒 STAFF",
      "private": true,
      "_comment": "Only @Petdex Team + @Petdex Bot can see this category.",
      "channels": [
        {
          "name": "admin",
          "type": "text",
          "topic": "Admin coordination: pet approvals, collection curation, comms."
        },
        {
          "name": "moderation",
          "type": "text",
          "topic": "Moderation queue + member reports. Action log lives in #bot-logs."
        },
        {
          "name": "bot-logs",
          "type": "text",
          "topic": "Webhook events from petdex.crafter.run + bot action audit trail.",
          "lockedToBot": true
        }
      ]
    }
  ],

  "automations": [
    {
      "id": "auto_role_creator",
      "trigger": "petdex_pet_approved",
      "_comment": "Bot listens to a webhook from petdex.crafter.run/api/discord/webhook (we'll wire that). Looks up the submitter's linked Discord account and grants @Creator if not already.",
      "action": "assign_role",
      "role": "Creator"
    },
    {
      "id": "auto_role_collector",
      "trigger": "petdex_install_count_threshold",
      "threshold": 3,
      "action": "assign_role",
      "role": "Collector"
    },
    {
      "id": "auto_post_showcase",
      "trigger": "petdex_pet_approved",
      "action": "post_to_channel",
      "channel": "showcase",
      "templatePath": "docs/discord/templates/pet-approved.md"
    },
    {
      "id": "auto_post_collection_launch",
      "trigger": "petdex_collection_featured",
      "action": "post_to_channel",
      "channel": "ip-spotlight"
    },
    {
      "id": "verified_on_join",
      "trigger": "guild_member_join",
      "action": "send_dm_with_rules",
      "_comment": "After accepting rules in #welcome, the bot grants @Verified and unlocks send-message permissions everywhere."
    }
  ],

  "_followups": [
    "Enable Community features: Server Settings → Enable Community → set rules + community updates channel + safety contact email.",
    "Enable Discovery (later, when 100+ members) so we appear in Discord's server browser.",
    "Enable AutoMod: profanity filter, mention spam (5+ in 60s), suspicious link blocker.",
    "Configure server boosts threshold messages: post a thank-you in #general at every level milestone."
  ]
}
