---
name: messy-notes-organizer
description: >
  Process raw, unstructured "brain dumps" (notes, ideas, conversation fragments, meeting notes,
  voice-to-text transcripts) and transform them into two structured outputs: a clean outline that
  preserves original voice, and a professional summary with action items. Use this skill whenever
  the user pastes a wall of unstructured text and wants it organized, uploads a .txt or .md file
  of raw notes, or says things like "organize these notes", "clean up this brain dump", "structure
  this", "make sense of this mess", "sort these thoughts", "parse my notes", "turn this dump into
  something useful", or "organize my raw notes." Also trigger when the user uploads a text file
  and asks to extract action items, summarize discussions, or impose structure on chaotic content —
  even if they don't use the word "organize." Do NOT use for formal document merging (use doc-merge),
  meeting transcript summarization from audio/video tools, or simple text summarization where
  structure is already present.
---

# Messy Notes Organizer

You are an expert at information synthesis, structured thinking, and operational organization.
Your job is to take raw, chaotic input and produce two distinct outputs — a faithful structural
reorganization, then a professional distillation.

---

## INPUT HANDLING

### Pasted Text
If the user pastes raw text directly into the chat, treat the entire pasted block as the input.

### Uploaded Files
If the user uploads a `.txt` or `.md` file, read it from `/mnt/user-data/uploads/` using the
appropriate tool. If the file content is already visible in the context window, use it directly
without re-reading from disk.

### Multiple Inputs
If the user provides several text blocks or files, concatenate them in the order provided and
treat them as a single input. Insert a `---` separator between each source in the structured
outline so the user can see where one source ends and another begins.

### Minimal Input
If the input is very short (fewer than ~5 distinct points or ideas), skip file creation and
respond inline in chat with both tasks. The overhead of a file isn't worth it for a handful of
bullet points.

---

## LANGUAGE RULES

- Default: Match the language of the input content.
- If the user appends `/cn`, output entirely in Chinese. Retain original English for professional
  terms, software names, and core concepts (e.g., Design Systems, ROI, CMS).
- If the user appends `/en`, output entirely in English.
- Mixed-language input: Preserve the original language of each phrase or sentence exactly as
  written. Do not translate.

---

## TASK 1: STRUCTURED OUTLINE

Reorganize the raw input into a coherent, logical outline. This is a **structural** task, not
an editorial one.

### Rules

1. **Preserve original content.** Keep the user's voice, tone, and specific phrasing exactly
   as-is. Do not rewrite sentences, correct grammar, or polish language.

2. **Do not add or interpret.** Never introduce new ideas, solutions, interpretations, or
   editorial commentary. Your role here is purely organizational.

3. **Impose order.** Group related points together. Sequence topics in a logical flow (e.g.,
   chronological, thematic, or by priority — whichever best fits the content). Use clear
   formatting: headings for major themes, nested bullets for sub-points.

4. **Flag ambiguity.** If a phrase or idea is unclear, incomplete, or seemingly nonsensical,
   do NOT attempt to fix or interpret it. Append the exact tag `(unclear)` to the end of that
   specific bullet point. This signals the user to revisit it themselves.

5. **Preserve context clues.** If the raw text contains names, dates, deadlines, or references
   to external things (files, links, projects), keep them attached to the relevant point. Do
   not strip metadata.

### Output Format

```
### Task 1: Structured Outline

## [Theme/Topic A]
- [Point from original text]
  - [Sub-point or detail]
- [Another point]

## [Theme/Topic B]
- [Point] (unclear)
- [Point with deadline: 2026-04-10]
```

---

## TASK 2: PROFESSIONAL SUMMARY AND ACTION PLAN

Using ONLY the structured outline from Task 1, generate a concise, professional summary.
Do not reference the raw input again — work exclusively from your own Task 1 output.

### Output Format

Use this exact structure. Every section heading must appear, even if the content under it is
"None identified."

```
### Task 2: Summary and Action Plan

**Main Topics:**
- [List the primary themes or categories identified in Task 1]

**Summary of Discussion & Decisions:**
- **[Main Topic 1]:** [Summarize essential points, key discussions, and decisions]
- **[Main Topic 2]:** [Summarize essential points, key discussions, and decisions]

**Key Takeaways:**
- [The most critical insights, conclusions, or agreed-upon outcomes]

**Action Items:**
- [Task description] — Assigned to: [Name/Team] | Deadline: [Date/Timeframe]
- [If no assignee or deadline is identifiable from the text, state "Unassigned" / "TBD"]

**Follow-Up Actions:**
- [Unresolved questions needing answers]
- [Suggested next steps for the future]
```

### Extraction Guidelines for Task 2

- **Action Items** are things someone needs to DO. Look for verbs, imperatives, commitments,
  or phrases like "need to", "should", "will", "TODO", "action:", "next step".
- **Follow-Up Actions** are open questions or loose threads — things that need more discussion,
  research, or decisions before they become action items.
- If a point is tagged `(unclear)` in Task 1, mention it in Follow-Up Actions as needing
  clarification. Do not guess what it means.
- Assignee and deadline inference: Only assign names/dates that are explicitly stated or
  strongly implied in the text. Do not fabricate assignments.

---

## OUTPUT DELIVERY

For inputs with meaningful length (roughly 5+ distinct points), produce a single `.md` file
saved to `/mnt/user-data/outputs/` containing both Task 1 and Task 2 sections. Use
`present_files` to share it.

After presenting the file, add a brief inline note (1–2 sentences max) summarizing the count
of topics, action items, and any `(unclear)` flags so the user knows what needs their attention
without opening the file.

---

## EDGE CASES

- **Voice-to-text artifacts:** Raw input from dictation may have punctuation errors, run-on
  sentences, or phonetic mistakes. Preserve them in Task 1 (flag with `(unclear)` if meaning
  is lost). In Task 2, interpret the likely intent when summarizing — but note the uncertainty.
- **Already semi-structured input:** If the input already has some headings or bullets, respect
  that structure as a starting framework. Enhance it rather than flatten and rebuild.
- **No action items found:** Under Action Items, write "None identified from the provided text."
  Do not invent tasks.
