AgentSkillsCN

mail-system

通过SQLite追踪邮件文件夹,实现产品负责人、首席开发人员与利益相关者角色之间的异步沟通。在角色间发送消息、检查收件箱、回复对方、查看对话线程、将决策上报利益相关者,或归档已处理的消息时使用此功能。

SKILL.md
--- frontmatter
name: mail-system
description: Asynchronous communication between Product Owner, Lead Developer, and Stakeholder roles using mail folders with SQLite tracking. Use when sending messages between roles, checking for incoming mail, responding to the other role, viewing threads, escalating decisions to stakeholder, or archiving processed messages.
allowed-tools: Read, Write, Glob, Bash(node:*), Bash(npm:*), Bash(mkdir:*), Bash(ls:*)

Mail System

Asynchronous communication system for Product Owner, Lead Developer, and Stakeholder roles, backed by SQLite for message tracking, threading, and read status.

Roles

RoleDescription
product-ownerClaude as Product Owner (requirements, issues, documentation)
lead-developerClaude as Lead Developer (technical review, code quality)
stakeholderThe human user (decisions, approvals, direction)

Setup

First time setup (run from project root):

bash
# Navigate to the plugin's skill directory and install dependencies
cd "${CLAUDE_PLUGIN_ROOT}/skills/mail-system" && npm install && npm run init

This creates:

  • Mail directories in your project (mail/product-owner/, mail/lead-developer/, mail/stakeholder/)
  • SQLite database (mail.db) in the skill directory

Web UI

Launch the web interface:

bash
cd "${CLAUDE_PLUGIN_ROOT}/skills/mail-system" && npm run ui

Then open http://localhost:3333 in your browser.

Features:

  • View all inboxes (Product Owner, Lead Developer, Stakeholder)
  • Compose and send messages
  • Reply to threads
  • Mark messages as read
  • Archive messages
  • Auto-refresh every 30 seconds

Commands

All commands run from the skill directory (${CLAUDE_PLUGIN_ROOT}/skills/mail-system/):

Check Inbox

bash
# List unread messages
node scripts/list.js product-owner
node scripts/list.js lead-developer

# List all messages (including read)
node scripts/list.js product-owner --all

Send Message

bash
# New message (creates new thread)
node scripts/send.js --from product-owner --to lead-developer --subject "Sprint Review Feedback"

# Reply to existing thread
node scripts/send.js --from lead-developer --to product-owner --subject "Re: Sprint Review" --thread thread-2025-01-20-sprint-review

# Message to stakeholder (for decisions)
node scripts/send.js --from product-owner --to stakeholder --subject "Decision Needed: Auth Approach"

Mark as Read

bash
node scripts/read.js msg-2025-01-20-abc123
node scripts/read.js 2025-01-20-sprint-review.md

Archive Message

bash
node scripts/archive.js msg-2025-01-20-abc123

View Threads

bash
# List all threads
node scripts/thread.js --list

# View specific thread
node scripts/thread.js thread-2025-01-20-sprint-review

Folder Structure

code
your-project/
└── mail/                        # Created in project root
    ├── product-owner/           # Messages TO Product Owner
    │   └── archive/
    ├── lead-developer/          # Messages TO Lead Developer
    │   └── archive/
    └── stakeholder/             # Messages TO Stakeholder (human)
        └── archive/

${CLAUDE_PLUGIN_ROOT}/skills/mail-system/
├── SKILL.md                     # This file
├── package.json                 # Dependencies
├── schema.sql                   # Database schema
├── mail.db                      # SQLite database (created on init)
└── scripts/
    ├── db.js                    # Database utilities
    ├── init-db.js               # Initialize system
    ├── send.js                  # Send message
    ├── list.js                  # List inbox
    ├── read.js                  # Mark as read
    ├── archive.js               # Archive message
    ├── thread.js                # View threads
    └── server.js                # Web UI server

Message Format

Messages are created with YAML frontmatter for tracking:

markdown
---
id: msg-2025-01-20-abc123
thread: thread-2025-01-20-sprint-review
from: lead-developer
to: product-owner
date: 2025-01-20
---

# Subject

## Summary
Brief overview.

## Details
Full content.

## Action Required
- [ ] Actions needed

## Questions
1. Questions for recipient

---
From: lead-developer
Date: 2025-01-20

Threading

Messages are grouped into threads:

  • New messages create a new thread
  • Replies use --thread <thread-id> to join existing thread
  • Use node scripts/thread.js --list to see all threads
  • Use node scripts/thread.js <thread-id> to see thread history

Status Indicators

  • Unread
  • Read
  • 📦 Archived

Workflow

As Product Owner

  1. Check inbox: node scripts/list.js product-owner
  2. Read message file, take action
  3. Mark as read: node scripts/read.js <id>
  4. Reply: node scripts/send.js --from product-owner --to lead-developer --subject "Re: ..." --thread <thread-id>
  5. Escalate to stakeholder if needed: node scripts/send.js --from product-owner --to stakeholder --subject "Decision Needed"
  6. Archive when done: node scripts/archive.js <id>

As Lead Developer

  1. Check inbox: node scripts/list.js lead-developer
  2. Read message file, verify claims
  3. Mark as read: node scripts/read.js <id>
  4. Reply: node scripts/send.js --from lead-developer --to product-owner --subject "Re: ..." --thread <thread-id>
  5. Archive when done: node scripts/archive.js <id>

As Stakeholder (Human)

  1. Check inbox: node scripts/list.js stakeholder
  2. Read message file in mail/stakeholder/
  3. Mark as read: node scripts/read.js <id>
  4. Reply: node scripts/send.js --from stakeholder --to product-owner --subject "Re: ..." --thread <thread-id>
  5. Archive when done: node scripts/archive.js <id>