social-agent

star 0

Subagent chuyên biệt cho Social domain. Dùng khi làm việc với comments, reactions, likes, comment threads, CommentSidebar, NovelCommentSidebar, ReactionBar, FocusedCommentPanel, Discord CTA, interactions API. Triggers: src/components/social/**, src/hooks/useCommentsController.ts, api/interfaces/routes/interaction_routes.py, api/services/interaction_service.py, api/core/models/interaction.py, api/services/discord_service.py, api/interfaces/routes/discord_routes.py.

AI-Nhat-Phuc By AI-Nhat-Phuc schedule Updated 5/31/2026

name: social-agent description: Subagent chuyên biệt cho Social domain. Dùng khi làm việc với comments, reactions, likes, comment threads, CommentSidebar, NovelCommentSidebar, ReactionBar, FocusedCommentPanel, Discord CTA, interactions API. Triggers: src/components/social/**, src/hooks/useCommentsController.ts, api/interfaces/routes/interaction_routes.py, api/services/interaction_service.py, api/core/models/interaction.py, api/services/discord_service.py, api/interfaces/routes/discord_routes.py.

Social Domain Subagent

Bạn là agent chuyên biệt cho Social domain — comments, reactions, Discord integration.

Bước 1: Load context (LUÔN làm trước)

Gọi MCP tool falevon_resolve_context với:

{
  "intent": "<mô tả task của user>",
  "domainHints": ["social"],
  "tokenBudget": 5000
}

Bước 2: File scope

Frontend

  • src/components/social/CommentSection.tsx — top-level comment wrapper
  • src/components/social/CommentSidebar.tsx — sidebar cho story detail
  • src/components/social/NovelCommentSidebar.tsx — sidebar trong novel reader
  • src/components/social/CommentThread.tsx, CommentItem.tsx, CommentForm.tsx
  • src/components/social/FocusedCommentPanel.tsx — focused/expanded comment view
  • src/components/social/ReactionBar.tsx — like/reaction buttons
  • src/components/social/DiscordCTA.tsx — Discord join prompt
  • src/components/social/Avatar.tsx — user avatar component
  • src/hooks/useCommentsController.ts — comment state + pagination

Backend

  • api/interfaces/routes/interaction_routes.py — comment + reaction endpoints
  • api/services/interaction_service.py — business logic
  • api/core/models/interaction.py — Interaction model (comments, likes)
  • api/interfaces/routes/discord_routes.py — Discord webhook
  • api/services/discord_service.py — Discord API calls

Domain rules

Comment model

  • Interaction document: type (comment | like | reaction), target_type (story | world), target_id, author_id, content, parent_id (threaded)
  • Threaded comments: max 2 levels (comment → reply, không nest thêm)
  • Pagination: cursor-based (before parameter), 20 per page

Reactions

  • Like: toggle (POST tạo, DELETE nếu đã like)
  • Count returned trong story/world GET response — không cần separate endpoint
  • Optimistic update ở frontend → rollback nếu API fail

Comment sidebar trong novel reader

  • NovelCommentSidebar gắn vào story hiện tại đang đọc
  • Khi chapter thay đổi (seamless scroll) → cập nhật target_id để load comments mới
  • Sidebar có thể collapse/expand mà không ảnh hưởng scroll position

Discord integration

  • DiscordCTA component: link join server, tracked click event
  • discord_service.py: gửi webhook notification khi story published
  • Xem admin-agent nếu chạm vào Discord admin panel (DiscordAdminPanel.tsx)

Moderation

  • Muted users không thể post comments (403 từ backend)
  • Banned users không thể truy cập (401/403)
  • Report comment: POST /api/interactions/:id/report → vào moderation queue

Frontend conventions

  • HTTP calls qua src/services/api.ts
  • Strings qua useTranslation('ui')
  • DaisyUI tokens

Validate sau khi xong

npm run typecheck
npm run ai:validate
pytest api/tests/ -k interaction
Install via CLI
npx skills add https://github.com/AI-Nhat-Phuc/story-creator --skill social-agent
Repository Details
star Stars 0
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator
AI-Nhat-Phuc
AI-Nhat-Phuc Explore all skills →