community-platform-patterns
Build community platforms with user profiles, discussion forums, event management, and moderation tools. Covers real-time features, content moderation, and community engagement patterns. Triggers on community platform development, forum design, or social feature requests.
What this skill does
# Community Platform Patterns
Build engaging community platforms with sustainable moderation and meaningful interaction design.
## Core Data Model
```python
from datetime import datetime
from enum import Enum
class MemberRole(str, Enum):
MEMBER = "member"
MODERATOR = "moderator"
ADMIN = "admin"
class ContentStatus(str, Enum):
DRAFT = "draft"
PUBLISHED = "published"
HIDDEN = "hidden" # Soft-removed by mod
ARCHIVED = "archived"
# Core entities
class Member:
id: str
display_name: str
bio: str
joined_at: datetime
role: MemberRole
reputation: int = 0
class Discussion:
id: str
title: str
body: str
author_id: str
category: str
status: ContentStatus
created_at: datetime
reply_count: int = 0
view_count: int = 0
pinned: bool = False
locked: bool = False
class Reply:
id: str
discussion_id: str
author_id: str
body: str
parent_id: str | None = None # Threaded replies
status: ContentStatus
created_at: datetime
upvotes: int = 0
```
## Discussion Forum
### Thread Display Patterns
**Flat (chronological):** Best for announcements and linear conversations.
**Threaded (nested):** Best for technical discussions where tangents are valuable.
**Hybrid (flat with quoted replies):** Best for general discussion.
```python
async def get_discussion_with_replies(discussion_id: str, sort: str = "chronological"):
discussion = await db.get_discussion(discussion_id)
replies = await db.get_replies(discussion_id)
if sort == "chronological":
return sorted(replies, key=lambda r: r.created_at)
elif sort == "threaded":
return build_thread_tree(replies)
elif sort == "popular":
return sorted(replies, key=lambda r: r.upvotes, reverse=True)
```
### Categories and Tags
```python
CATEGORIES = {
"reading-group": {"description": "Book discussions and study groups", "color": "#4A90D9"},
"announcements": {"description": "Official updates", "color": "#E74C3C", "mod_only": True},
"help": {"description": "Questions and support", "color": "#2ECC71"},
"showcase": {"description": "Share your work", "color": "#F39C12"},
"meta": {"description": "About the community itself", "color": "#9B59B6"},
}
```
## Reputation System
### Action-Based Scoring
| Action | Points | Rationale |
|--------|--------|-----------|
| Post discussion | +2 | Encourages contribution |
| Reply to discussion | +1 | Encourages engagement |
| Receive upvote | +5 | Community validation |
| Give upvote | +1 | Encourages voting |
| Marked as answer | +15 | High-value contribution |
| Post hidden by mod | -10 | Discourages violations |
### Privilege Tiers
```python
PRIVILEGE_TIERS = {
0: ["read", "reply"],
10: ["create_discussion", "upvote"],
50: ["edit_own_posts", "flag_content"],
100: ["create_events", "add_tags"],
500: ["edit_wiki_posts"],
1000: ["nominate_moderator"],
}
def get_privileges(reputation: int) -> list[str]:
privileges = []
for threshold, perms in PRIVILEGE_TIERS.items():
if reputation >= threshold:
privileges.extend(perms)
return privileges
```
## Content Moderation
### Moderation Queue
```python
class ModerationAction(str, Enum):
APPROVE = "approve"
HIDE = "hide"
WARN = "warn"
BAN_TEMPORARY = "ban_temporary"
BAN_PERMANENT = "ban_permanent"
async def flag_content(content_id: str, reason: str, reporter_id: str):
flag = await db.create_flag(
content_id=content_id,
reason=reason,
reporter_id=reporter_id,
)
# Auto-hide if threshold reached
flag_count = await db.count_flags(content_id)
if flag_count >= 3:
await db.update_content_status(content_id, ContentStatus.HIDDEN)
await notify_moderators(content_id, flag_count)
```
### Community Guidelines Enforcement
```python
GUIDELINES = {
"be_respectful": "Treat others as you'd want to be treated",
"stay_on_topic": "Keep discussions relevant to the community focus",
"no_spam": "No promotional content without context",
"cite_sources": "Back up claims with references when possible",
"no_personal_attacks": "Criticize ideas, not people",
}
async def moderate(content_id: str, action: ModerationAction, reason: str, mod_id: str):
await db.record_mod_action(content_id, action, reason, mod_id)
if action == ModerationAction.HIDE:
await db.update_content_status(content_id, ContentStatus.HIDDEN)
await notify_author(content_id, reason)
elif action == ModerationAction.WARN:
await send_warning(content_id, reason)
```
## Event Management
```python
class Event:
id: str
title: str
description: str
organizer_id: str
event_type: str # "reading-group", "salon", "workshop", "office-hours"
starts_at: datetime
ends_at: datetime
location: str # URL for virtual, address for physical
capacity: int | None
rsvp_count: int = 0
recurring: str | None = None # "weekly", "biweekly", "monthly"
async def create_recurring_events(template: Event, count: int):
events = []
for i in range(count):
event = template.copy()
if template.recurring == "weekly":
event.starts_at += timedelta(weeks=i)
event.ends_at += timedelta(weeks=i)
events.append(await db.create_event(event))
return events
```
## Notification System
```python
class NotificationType(str, Enum):
REPLY = "reply"
MENTION = "mention"
UPVOTE = "upvote"
EVENT_REMINDER = "event_reminder"
MOD_ACTION = "mod_action"
async def send_notification(user_id: str, notification_type: NotificationType, data: dict):
prefs = await db.get_notification_preferences(user_id)
if notification_type.value not in prefs.get("muted", []):
await db.create_notification(user_id, notification_type, data)
if prefs.get("email_enabled") and notification_type in prefs.get("email_types", []):
await send_email_notification(user_id, notification_type, data)
```
## Anti-Patterns
- **No onboarding flow** — New members need guided first steps
- **Flat hierarchy only** — Categories/tags help people find relevant content
- **No moderation tools** — Build moderation from day one, not after the first incident
- **Gamification without purpose** — Points should encourage healthy behavior, not just activity
- **One-size-fits-all notifications** — Let members control what they receive
- **No archive strategy** — Old discussions should be searchable but not clutter active feeds
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.