技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
inbox【数据与研究】Email triage system that handles both one-time setup and recurring triage in a single skill. Auto-detects state: if no knowledge base exists at ${WORKSPACE}/Email/, runs an 8-section onboarding interview (grill-me discipline, one question at a time) to build a 7-file personalized KB, then offers to run triage immediately. If the KB already exists, sk…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Self-contained email triage skill. Handles setup and recurring triage in a single command. Detects its own state and routes accordingly — no need to remember which mode to run.
Before anything else, check for the KB:
| State | Route |
|---|---|
Argument is update | → Update Mode |
${WORKSPACE}/Email/email-taxonomy.md does NOT exist | → Setup Mode |
${WORKSPACE}/Email/email-taxonomy.md exists | → Triage Mode |
Edge cases:
Runs when no KB exists.
Do NOT generate all files at once. Walk through the 8 sections one at a time. Each section commits its file(s) before moving on. Partial completion (user drops off mid-interview) still produces a usable partial KB.
See references/grill_me_section_walk.md for the 8-section discipline detail.
Write to ${WORKSPACE}/Email/:
| File | Purpose | Required? |
|---|---|---|
email-taxonomy.md | Classification system + report preferences | Yes |
email-patterns.md | Reply voice, tone, templates, hard rules | Yes |
evaluation-framework.md | Decision tree for opportunity emails | Only if user receives pitches/opportunities |
rate-card.md | Pricing, terms, negotiation posture | Only if user has pricing |
blocklist.md | Auto-skip senders + learned decline patterns | Yes (seeded, grows over time) |
tracker.md | Active follow-ups, overdue items, deadlines | Yes (starts mostly empty) |
triage-log/ | Directory for per-run logs | Yes (created empty) |
~25–31 questions total across 8 sections. Hard ceiling: 35 questions including sub-clarifications. Section 4 (Evaluation Framework) is skipped entirely when Section 1 surfaced no opportunity-email category. After Section 8's confirmation + handoff message, intake is closed — to change preferences, use update mode.
Six grill-me questions, one at a time:
Action: Build mental model. Do NOT write files yet. Note whether opportunity emails are a category (drives S4 skip-logic).
Propose 5–7 categories based on Section 1 — pre-recommend a subset:
Three forcing questions, one at a time:
Action: Generate email-taxonomy.md with categories, signals, and default actions per category.
Six grill-me questions plus the critical sample request:
S3.SAMPLES (highest-quality input):
Paste 3–5 real sent emails from your inbox.
Why I'm asking: Self-description of voice is unreliable. Real samples are the best signal — use
scripts/voice_sample_analyzer.pyto extract patterns.
Action: Generate email-patterns.md. See references/voice_calibration.md for the sample-extraction discipline.
Skip if Section 1 surfaced no opportunity emails. Otherwise six grill-me questions:
Action: Generate evaluation-framework.md + rate-card.md (if pricing exists).
Action: Generate blocklist.md.
Action: Generate tracker.md + create empty triage-log/ directory.
Action: Append report preferences to email-taxonomy.md.
List every file created with a one-sentence summary. Run scripts/kb_validator.py --workspace ${WORKSPACE} to confirm the 7-file contract is satisfied.
Then ask:
Your triage system is ready. Run triage now?
- Yes — process my inbox immediately
- No — I'll invoke it separately
If yes → transition directly to Triage Mode below.
Never persist passwords, full account numbers, SSNs, or other sensitive credentials in KB files. If volunteered during the interview, acknowledge but don't store — write [stored separately by user] in the relevant file.
Runs when KB exists. Light-intake by design.
This skill creates drafts. It NEVER sends.
Non-negotiable. The scripts/draft_safety_validator.py enforces it post-run. Any send-shaped tool call in the action log fails validation. See references/drafts_only_safety.md.
Q1 (only when on-demand run is outside normal cadence):
Override the default 9-hour search window? yes (specify hours) / no.
Why I'm asking: If you're running outside your normal cadence, you may want a wider or narrower window.
Q2 (only when user invokes with category-skip intent):
Skip any categories this run? E.g., "skip newsletters".
Why I'm asking: Sometimes you just want to scan opportunities or clear active threads.
Max 2 questions. Default invocations skip both and run with KB-default preferences.
Use scripts/search_window_calculator.py --cadence <CADENCE> --now <ISO>:
| Cadence (from email-taxonomy.md) | Default window |
|---|---|
| once daily | 26h |
| 2x daily | 9h |
| 3x daily | 6h |
| on-demand only | 24h (asks Q1) |
Two queries:
window_startCollect per email: sender, subject, date, snippet, thread ID, labels.
Provider adapter:
| Provider | Tool |
|---|---|
| Gmail | Gmail MCP |
| Outlook / Microsoft 365 | Outlook MCP |
| IMAP (Fastmail, ProtonMail, etc.) | IMAP MCP if available; halt otherwise |
| (no email tool available) | Halt: "No email tool registered for this session." |
Apply taxonomy from email-taxonomy.md. For lowest-priority category (newsletters/automation/spam): skip thread reads entirely. For everything else: read full thread.
For senders not in tracker / blocklist / prior logs:
blocklist.md → if matched, auto-skiptracker.md → if known thread, note existing contextSkip entirely for: known senders, internal email, automated notifications, obvious low-priority.
Apply evaluation-framework.md (skip this step entirely if file doesn't exist):
| Category | When | Output |
|---|---|---|
| TAKE IT | Meets criteria | Recommend engaging; draft reply (Step 6) |
| WORTH CONSIDERING | Has potential, needs user judgment | Surface context; draft for user to edit |
| PASS | Doesn't meet criteria | Brief "why" (1–3 sentences); draft polite decline |
| FLAG FOR REVIEW | Unusual; needs direct user decision | Surface fully; NO draft |
See references/triage_decision_framework.md for the framework canon.
Draft using email-patterns.md voice rules. NEVER call any send operation. Only create drafts.
Draft body must honor:
email-patterns.mdDo NOT draft for: newsletters, automation, FYI threads, already-replied threads, blocked senders.
Tone by recommendation:
Honor preference from email-taxonomy.md. Default: email draft to self.
Subject: Inbox Triage — [Day], [Month Date] ([Run Label])
Sections (in order):
**Sender** — summary + recommendationHTML formatting (if applicable): inline CSS only (Gmail strips <style>). Color-coded: green → TAKE IT, amber → WORTH CONSIDERING, red → PASS, purple → FLAG FOR REVIEW, blue → active conversation.
blocklist.md: append new declined senders + patterns; remove if user overrode.
tracker.md: append new follow-ups, update existing, mark resolved, flag overdue, remove resolved items older than 30 days, add entry to update log.
After 5+ runs, suggest KB improvements: "You always decline emails from X — add as auto-skip?"
Save to ${WORKSPACE}/Email/triage-log/[YYYY-MM-DD]-[run-label].md:
Audit trail for scripts/draft_safety_validator.py.
Even with zero new emails:
tracker.md for items due today or overdueSkip Steps 3–6 entirely on empty inbox.
Triggered by /notion inbox update or "update my inbox preferences."
${WORKSPACE}/Email/| Situation | Behavior |
|---|---|
| No KB + triage invoked | Run setup first, then triage |
| KB exists + setup invoked | Acknowledge; offer triage / update / both |
| Partial KB (missing files) | List gaps; offer full setup or fill missing sections only |
| Workspace inaccessible | Stop; tell user where files would go; ask for path |
| Email tool unavailable | Halt with clear message |
| User refuses voice samples | Use self-description; flag in patterns file that calibration may need iteration |
| User drops off mid-interview | Honor partial KB; committed files are usable |
| 100+ new emails | Flag volume; offer to focus on priority categories only |
| Sender in both blocklist and tracker | Tracker wins; note inconsistency in log |
| Script | Role |
|---|---|
scripts/kb_validator.py | Validates the 7-file KB after setup (required files present, conditional files match sections run, headers + structure correct). |
scripts/section_progress_tracker.py | JSON-backed walk state across the 8 interview sections. |
scripts/voice_sample_analyzer.py | Extracts voice patterns from pasted sent-email samples. |
scripts/kb_reader.py | Reads + validates the 7-file KB at triage start. Halts on missing required files. |
scripts/search_window_calculator.py | Computes window_start from cadence + current time. Returns run_label. Honors Q1 override. |
scripts/draft_safety_validator.py | Post-run scan of action log for any send-shaped tool call. FAIL if detected. |
references/grill_me_section_walk.md — 8-section discipline, skip-logic, commit-per-sectionreferences/voice_calibration.md — sample-based voice extraction theory + anti-patternsreferences/kb_file_contract.md — 7-file contract (structure, sections, read behavior)references/triage_decision_framework.md — TAKE IT / WORTH / PASS / FLAG taxonomyreferences/drafts_only_safety.md — NEVER-SEND discipline canon