Files
personas/personas/_shared/community-skills/waha-whatsapp/scripts/waha_bulk_fetch.py
salvacybersec 0183a1eb5f feat(community-skills): add opencode-cli + feynman-cli + migrate 12 skills
Two new tool-operation skills with deep references/ docs:
- opencode-cli: SKILL.md + 6 references covering rules, agents, models,
  commands, formatters, permissions, skills, MCP, plugins, custom tools,
  LSP, themes, keybinds, server API, SDK, GitHub Actions, IDE, network,
  troubleshooting (full opencode.ai/docs surface)
- feynman-cli: SKILL.md + 6 references covering install, setup, config,
  CLI, REPL slash commands, agents/tools/packages, and full pi-subagents
  custom-agent spec (verified against the working install)

Migrate 12 skills from ~/.claude/skills into _shared/community-skills/:
- clean copy: intel-briefing, vercel-react-best-practices, ui-ux-pro-max
- core-only: notebooklm (data/images stripped — 184M to 224K)
- light sanitize: anythingllm-manager (gitea URL), foia-tool (DB password),
  jira (atlassian instance + email), librarian (paths), obsidian-tasks
  (vault path + email-in-cred-path)
- branding sanitize: marketing-strategist + pentest-reporter (Proudsec
  variants normalized to <COMPANY>)
- secrets sanitize: waha-whatsapp (IP, API key, vault path placeholders)

Skipped per user: proudguard-api (kept locally only).

build.py:
- DEFAULT_SKILL_PERSONA_MAP: 14 new entries
- NAME_PATTERNS: opencode + jira to coding-tools; notebooklm + feynman-
  to ai-llm-dev; waha- to osint-intel

Community-skills index: 703 -> 716 (+13).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 12:19:53 +03:00

62 lines
2.0 KiB
Python

#!/usr/bin/env python3
"""Bulk-fetch multiple WAHA chats and write transcripts + media.
Reads a JSON config with chat definitions, runs waha_fetch_group.py logic for each.
Usage:
python3 waha_bulk_fetch.py <config.json>
Config format (example):
{
"default_parent_dir": "<VAULT>/6-Geopolitics/BAM",
"default_tag": "6.1-Geopolitical Analysis",
"default_up": "BAM WhatsApp Index",
"chats": [
{"chat_id": "120363422940477656@g.us", "name": "BAM Afrika II", "slug": "Afrika-II"},
{"chat_id": "120363402693559339@g.us", "name": "BAM Svahili-I", "slug": "Svahili-I",
"parent_dir": "<VAULT>/6-Geopolitics/BAM"}
]
}
A reference config for the 13 BAM groups + Orta Doğu Politik İktisat lives at:
~/.claude/skills/waha-whatsapp/references/bam_groups_config.json
"""
import json, os, subprocess, sys
HERE = os.path.dirname(os.path.abspath(__file__))
FETCH_SCRIPT = os.path.join(HERE, "waha_fetch_group.py")
def main():
if len(sys.argv) < 2:
print(f"Usage: {sys.argv[0]} <config.json>")
sys.exit(2)
cfg = json.load(open(sys.argv[1]))
default_parent = cfg.get("default_parent_dir")
default_tag = cfg.get("default_tag", "6.1-Geopolitical Analysis")
default_up = cfg.get("default_up", "BAM WhatsApp Index")
chats = cfg["chats"]
for c in chats:
parent = c.get("parent_dir", default_parent)
if not parent:
print(f"SKIP {c.get('name')}: no parent_dir")
continue
cmd = [
"python3", FETCH_SCRIPT,
"--chat-id", c["chat_id"],
"--name", c["name"],
"--slug", c["slug"],
"--parent-dir", parent,
"--tag", c.get("tag", default_tag),
"--up", c.get("up", default_up),
]
if "limit" in c:
cmd += ["--limit", str(c["limit"])]
if "rel_prefix" in c:
cmd += ["--rel-prefix", c["rel_prefix"]]
print(f"\n>>> {c['name']} ({c['slug']})")
subprocess.run(cmd, check=False)
if __name__ == "__main__":
main()