agentleFS
qwwiwiqwwiwi/agentos-skills-public/skills/chat-archive/SKILL.md

chat-archive

Skill4 starsChanged 4 months agoMITView on GitHub

Archive messages from a Telegram business chat. Saves each message to daily markdown, classifies (DECISION/TASK/OPEN_QUESTION), makes daily summary, pushes decisions and summaries to storage. Use when: (1) a message is received from the monitored chat, (2) @mention of the monitor agent in this chat, (3) request for flush/day summary, (4) request for data from chat history of a partnership. NOT for: messages from other chats, direct user commands outside partnership context.

  • Reads credentials

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 14 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈14

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All paths are relative to the agent workspace.

    line 35
  2. Distinctive:

    Create directories on first use:

    line 36
  3. Very specific:

    Use the message timestamp.

    line 47
  4. Distinctive:

    If file does not exist -- create with header:

    line 54
  5. Distinctive:

    If message contains media, add tag before text:

    line 68
  6. Distinctive:

    If both media and text (caption) -- record both.

    line 90
  7. Distinctive:

    If no text -- record only the media tag in parentheses.

    line 91
  8. Distinctive:

    do, need, task, to-do, deadline

    line 108
  9. Distinctive:

    No direct answer in the following 2-3 messages

    line 119
  10. Very specific:

    If unclear -- mark [QUESTION].

    line 122
  11. Distinctive:

    When the monitor agent is mentioned in the monitored chat:

    line 236
  12. Distinctive:

    Append-only: Never delete or overwrite chat-history.

    line 257
  13. Distinctive:

    Timezone: all timestamps in your local timezone.

    line 261
  14. Distinctive:

    Privacy: do not forward or display chat contents outside the context of tasks.

    line 263
  15. Distinctive:

    Write to chat-history with [voice] tag AND transcription:

    line 306
  16. Distinctive:

    If transcription failed -- write:

    line 312

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Chat Archive

Skill for archiving business chat correspondence.

  • Chat ID: <your-chat-id>
  • Workspace: <your-workspace>
  • Storage CLI: your-storage-cli

1. File structure

partnerships/<partner-name>/
├── chat-history/
│   └── YYYY-MM-DD.md          # daily log (append-only)
├── chat-summary/
│   └── YYYY-MM-DD-summary.md  # daily summary
├── documents/                   # partnership documents
└── questionnaire/               # questionnaires etc.

All paths are relative to the agent workspace. Create directories on first use:

mkdir -p partnerships/<partner-name>/chat-history partnerships/<partner-name>/chat-summary

2. On receiving a message from the monitored chat

2.1 Determine date and time

Use the message timestamp. File date format: YYYY-MM-DD. Time format in record: HH:MM (your local timezone).

2.2 Append to daily log

File: partnerships/<partner-name>/chat-history/YYYY-MM-DD.md

If file does not exist -- create with header:

# Chat Log -- YYYY-MM-DD

Append each message in format:

[HH:MM] @username: message text

Media messages

If message contains media, add tag before text:

TypeTag
Photo[photo]
Voice[voice]
Video[video]
Document/file[document]
Sticker[sticker]
Video note[video_note]
Audio[audio]
Location[location]
Contact[contact]
Forwarded[forwarded]

Format with media:

[HH:MM] @username: [photo] photo caption
[HH:MM] @username: [voice] (voice message)
[HH:MM] @username: [document] filename.pdf

If both media and text (caption) -- record both. If no text -- record only the media tag in parentheses.

2.3 Message classification

Analyze text and add tag at end of line when matched:

[DECISION] -- decision/agreement

Keywords/phrases:

  • agreed, decided, plan, ok let's do it, confirmed
  • accepted, approved, done deal
[14:30] @partner: ok let's do 70/30 [DECISION]

[TASK] -- a task

Keywords/phrases:

  • do, need, task, to-do, deadline
  • prepare, by tomorrow, by Monday
  • your responsibility
[15:10] @user: need to prepare presentation by Friday [TASK]

[OPEN_QUESTION] -- unanswered question

Criteria:

  • Message contains a question mark ?
  • No direct answer in the following 2-3 messages
  • Message asks a question requiring a decision (not rhetorical)

If unclear -- mark [QUESTION]. At daily summary review: if still unanswered, reclassify to [OPEN_QUESTION].

[16:00] @partner: what about the legal entity, decided? [OPEN_QUESTION]

Regular message -- no tag

[16:05] @user: hi, how are things?

2.4 Push decisions to storage

On detecting [DECISION] -- push immediately:

your-storage-cli push partnerships/<partner-name>/decisions << 'EOF'
{
  "date": "YYYY-MM-DD",
  "time": "HH:MM",
  "author": "@username",
  "text": "decision text",
  "chat_message_id": MESSAGE_ID
}
EOF

2.5 Push tasks to storage

On detecting [TASK] -- push:

your-storage-cli push partnerships/<partner-name>/tasks << 'EOF'
{
  "date": "YYYY-MM-DD",
  "time": "HH:MM",
  "author": "@username",
  "text": "task text",
  "status": "open",
  "chat_message_id": MESSAGE_ID
}
EOF

3. Daily Summary

Runs once per day (via cron, on flush, or on context compaction).

3.1 Generate summary

Read file partnerships/<partner-name>/chat-history/YYYY-MM-DD.md. Create file: partnerships/<partner-name>/chat-summary/YYYY-MM-DD-summary.md

Format:

# Summary -- YYYY-MM-DD

## Stats
- Total messages: N
- Participants: @user1 (X messages), @user2 (Y messages)

## Key topics
- Topic 1: brief description
- Topic 2: brief description

## Decisions [DECISION]
1. "decision text" -- @author, HH:MM
2. ...

(If no decisions: "No decisions recorded for the day.")

## Tasks [TASK]
1. "task text" -- @author, HH:MM, status: open
2. ...

(If no tasks: "No tasks recorded for the day.")

## Open questions [OPEN_QUESTION]
1. "question text" -- @author, HH:MM
2. ...

(If no questions: "All questions for the day received answers.")

## Context
Brief description of the overall tone and flow of conversation (2-3 sentences).

3.2 Push summary to storage

your-storage-cli push partnerships/<partner-name>/chat-summaries << 'EOF'
{
  "date": "YYYY-MM-DD",
  "total_messages": N,
  "decisions_count": N,
  "tasks_count": N,
  "open_questions_count": N,
  "topics": ["topic1", "topic2"],
  "decisions": ["text1", "text2"],
  "tasks": ["text1", "text2"],
  "open_questions": ["text1"],
  "summary_file": "partnerships/<partner-name>/chat-summary/YYYY-MM-DD-summary.md"
}
EOF

4. On @mention of the monitor agent in the chat

When the monitor agent is mentioned in the monitored chat:

  1. Read context -- last 20-30 messages from current chat-history
  2. Identify question/request from the mention message
  3. Pull data as needed:
    • Chat history: partnerships/<partner-name>/chat-history/
    • Summaries: partnerships/<partner-name>/chat-summary/
    • Documents: partnerships/<partner-name>/documents/
    • Stored decisions: your-storage-cli get partnerships/<partner-name>/decisions
    • Stored tasks: your-storage-cli get partnerships/<partner-name>/tasks
  4. Reply in chat -- briefly, to the point, citing sources

Example responses:

  • "What did we agree on regarding X?" → find in decisions, quote
  • "What tasks are open?" → collect from tasks with status open
  • "What did we discuss last week?" → collect summaries for period

5. Rules

  1. Append-only. Never delete or overwrite chat-history. Only append.
  2. Do not reply to regular messages. Only archive silently.
  3. Reply only on @mention.
  4. Do not reveal technical information (paths, storage internals) in chat -- internal mechanics only.
  5. Timezone: all timestamps in your local timezone.
  6. Encoding: UTF-8.
  7. Privacy: do not forward or display chat contents outside the context of tasks.

6. Environment check (first run)

# Check storage CLI
your-storage-cli get partnerships/<partner-name>

# Create directory structure
mkdir -p partnerships/<partner-name>/chat-history
mkdir -p partnerships/<partner-name>/chat-summary
mkdir -p partnerships/<partner-name>/documents

# Check storage credentials
ls -la ~/.secrets/storage/credentials.json

7. Fallbacks

SituationAction
Storage unavailableWrite to file, mark [storage-pending]. Push when restored
No chat-history file for todayCreate with header # Chat Log -- YYYY-MM-DD
Cannot determine message typeRecord as regular (no tag)
Message in EnglishArchive as-is, classification works in both languages
Edited messageAppend line: [HH:MM] @username: [edited] new text
Deleted messageIgnore (do not record deletion)

8. Voice messages (voice/audio)

On receiving a voice message from the monitored chat:

  1. Extract the .ogg file path from [media attached: /path/to/file.ogg ...]
  2. Transcribe via Groq Whisper:
bash ~/.claude/skills/groq-voice/transcribe.sh "/path/to/file.ogg"
  1. Write to chat-history with [voice] tag AND transcription:
[HH:MM] @username: [voice] «transcription of voice message»
  1. Classify transcribed text by normal rules ([DECISION], [TASK], [OPEN_QUESTION])

If transcription failed -- write:

[HH:MM] @username: [voice] (could not transcribe)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.