← Về thư mục
📄 / / root / ceo / skills / operate / setup-departments / SKILL.md

name: setup-departments description: Set up "departments" = forum topics in the company's Telegram group. Use when a user IN A GROUP asks to set up/create departments. Run EXACTLY 1 command, do NOT self-discover.


Skill: setup-departments — set up departments (1 command, deterministic)

🚫 ONLY run when the user EXPLICITLY ASKS to "set up/create/update departments". A QUESTION (e.g. "which department am I in?", "what does this department do?", "what departments are there?") is NOT a setup request → answer DIRECTLY from context (current topic name, profile), NEVER run setup_departments.py (running it by mistake creates duplicate departments). Only create when the user truly wants to CREATE NEW.

When the user (IN A GROUP) wants to set up departments → run EXACTLY 1 command, then report the result. Do NOT read lib source, do NOT run -h, do NOT session_search, do NOT scan ~/.hermes/state.db/channel_directory to guess chat_id. The script handles everything.

Step 1 — Run the script (single command)

python3 lib/setup_departments.py

The script auto: gets chat_id from the session (env), gets the department structure from the user profile, checks the group is a forum + bot is admin, creates topics + pins descriptions. Returns JSON.

Step 2 — Read JSON & report to user (concise, natural)

Step 3 — Customize ICONS (collaboration loop: suggest → user approves → AI executes)

Right after departments are set up (ok:true), proactively offer icon customization — this is the moment to show the user the assistant both suggests and executes: 1. Run python3 lib/customize_icons.py suggest → returns JSON suggestions[], each department has emoji + thread_id + custom_emoji_id. 2. Present to the user (partner proposing): list "Phòng X → " for each department, then clarify: [Dùng bộ icon này] [Đổi vài cái]. 3. User approves → run python3 lib/customize_icons.py apply --json '<exact suggestions array just received>' → bot changes the real icons (AI executes). Report "đã đổi icon xong". 4. User wants to change one department (e.g. "Marketing thành 🔥") → python3 lib/tg_topics.py icons --find 🔥 to get custom_emoji_id → edit that entry in the array → apply again. (Can also change the department name at the same time via the name field.)

🚫 Icon is SEPARATE (via custom_emoji_id) — NEVER put emoji in the name field (causes duplication: emoji-in-name + icon). Department name is text only; the script strips emoji if any slips in. This demonstrates the "AI 3 roles": guide + partner proposing + executor. Keep it tight, one sentence at a time.

If the user wants a structure different from the agreed one

Run: python3 lib/setup_departments.py --departments "<department names, comma-separated>".

Principles