diff --git a/agent/install.ps1 b/agent/install.ps1 new file mode 100644 index 0000000..22dc95c --- /dev/null +++ b/agent/install.ps1 @@ -0,0 +1,170 @@ +# 黑手党提案 Agent — Windows 一键安装/更新脚本 (PowerShell) +# 用法: irm https://git.brainwork.club/lidf/chanpinhsd/archive/main.zip -OutFile $env:TEMP\mafia.zip; Expand-Archive $env:TEMP\mafia.zip $env:TEMP\mafia -Force; & $env:TEMP\mafia\chanpinhsd\agent\install.ps1 + +$ErrorActionPreference = "Stop" + +function Write-Info($msg) { Write-Host "[mafia] $msg" -ForegroundColor Green } +function Write-Warn($msg) { Write-Host "[mafia] $msg" -ForegroundColor Yellow } +function Write-Err($msg) { Write-Host "[mafia] $msg" -ForegroundColor Red; exit 1 } + +$COPAW_HOME = if ($env:COPAW_HOME) { $env:COPAW_HOME } else { Join-Path $env:USERPROFILE ".copaw" } +$AGENT_ID = "mafia-expert" +$WORKSPACE_DIR = Join-Path $COPAW_HOME "workspaces\$AGENT_ID" +$SCRIPT_DIR = Split-Path -Parent $MyInvocation.MyCommand.Path + +# ── 检查 CoPaw ──────────────────────────────────────────────────────── +if (-not (Test-Path (Join-Path $COPAW_HOME "config.json"))) { + Write-Err "CoPaw 未安装。请先安装 CoPaw 桌面客户端:https://copaw.agentscope.io" +} +Write-Info "CoPaw 已就绪" + +# ── 创建工作区 ───────────────────────────────────────────────────────── +Write-Info "配置 $AGENT_ID 工作区..." +$dirs = @("skills", "cases", "iteration_reports", "memory") +foreach ($d in $dirs) { + $p = Join-Path $WORKSPACE_DIR $d + if (-not (Test-Path $p)) { New-Item -ItemType Directory -Path $p -Force | Out-Null } +} + +# ── 核心配置 ─────────────────────────────────────────────────────────── +$coreFiles = @("AGENTS.md", "SOUL.md", "PROFILE.md", "HEARTBEAT.md", "agent.json") +foreach ($f in $coreFiles) { + $src = Join-Path $SCRIPT_DIR $f + if (Test-Path $src) { Copy-Item $src (Join-Path $WORKSPACE_DIR $f) -Force } +} + +# MEMORY.md 只在首次创建 +$memPath = Join-Path $WORKSPACE_DIR "MEMORY.md" +if (-not (Test-Path $memPath)) { + $memSrc = Join-Path $SCRIPT_DIR "MEMORY.md" + if (Test-Path $memSrc) { Copy-Item $memSrc $memPath } + else { Set-Content $memPath "# 黑手党提案专家长期记忆" -Encoding UTF8 } +} + +# ── Skills(每次全量覆盖) ───────────────────────────────────────────── +$skillsSrc = Join-Path $SCRIPT_DIR "skills" +if (Test-Path $skillsSrc) { + Get-ChildItem $skillsSrc -Directory | ForEach-Object { + if ($_.Name -eq "mafia_agent_installer") { return } + $target = Join-Path $WORKSPACE_DIR "skills\$($_.Name)" + if (-not (Test-Path $target)) { New-Item -ItemType Directory -Path $target -Force | Out-Null } + Copy-Item "$($_.FullName)\*" $target -Force -Recurse 2>$null + } +} + +Write-Info "文件复制完成" + +# ── 合并 skill.json ──────────────────────────────────────────────────── +Write-Info "注册自定义 Skills..." +$wsSkillJson = Join-Path $WORKSPACE_DIR "skill.json" +$repoSkillJson = Join-Path $SCRIPT_DIR "skill.json" + +$pyScript = @" +import json, os, time + +ws_skill = r'$wsSkillJson' +repo_skill = r'$repoSkillJson' + +if os.path.exists(ws_skill): + with open(ws_skill, encoding='utf-8') as f: + manifest = json.load(f) +else: + manifest = {'schema_version': 'workspace-skill-manifest.v1', 'version': 0, 'skills': {}} + +if os.path.exists(repo_skill): + with open(repo_skill, encoding='utf-8') as f: + repo = json.load(f) + for name, skill_cfg in repo.get('skills', {}).items(): + manifest['skills'][name] = skill_cfg + print(f' + {name}') + +skills_dir = os.path.join(r'$WORKSPACE_DIR', 'skills') +if os.path.isdir(skills_dir): + for d in os.listdir(skills_dir): + if d.startswith('.'): + continue + skill_md = os.path.join(skills_dir, d, 'SKILL.md') + if os.path.exists(skill_md) and d not in manifest['skills']: + manifest['skills'][d] = { + 'enabled': True, + 'channels': ['all'], + 'source': 'customized', + 'metadata': { + 'name': d, + 'description': '', + 'version_text': '1.0.0', + 'source': 'customized', + 'protected': False, + 'requirements': {'require_bins': [], 'require_envs': []}, + }, + 'requirements': {'require_bins': [], 'require_envs': []}, + } + print(f' + {d} (from dir)') + +manifest['version'] = int(time.time() * 1000) +with open(ws_skill, 'w', encoding='utf-8') as f: + json.dump(manifest, f, indent=2, ensure_ascii=False) +print(' skills done') +"@ + +python3 -c $pyScript 2>$null +if ($LASTEXITCODE -ne 0) { python -c $pyScript } + +# ── 注册到 config.json ───────────────────────────────────────────────── +Write-Info "注册 Agent..." +$regScript = @" +import json, os + +config_path = os.path.join(r'$COPAW_HOME', 'config.json') +with open(config_path, 'r', encoding='utf-8') as f: + cfg = json.load(f) + +agent_id = '$AGENT_ID' +ws_dir = r'$WORKSPACE_DIR' +changed = False + +if agent_id not in cfg['agents']['profiles']: + cfg['agents']['profiles'][agent_id] = { + 'id': agent_id, + 'workspace_dir': ws_dir, + 'enabled': True + } + changed = True + +if agent_id not in cfg['agents']['agent_order']: + cfg['agents']['agent_order'].append(agent_id) + changed = True + +if changed: + with open(config_path, 'w', encoding='utf-8') as f: + json.dump(cfg, f, indent=2, ensure_ascii=False) + print(' registered') +else: + print(' already registered') +"@ + +python3 -c $regScript 2>$null +if ($LASTEXITCODE -ne 0) { python -c $regScript } + +# ── 记录来源 ─────────────────────────────────────────────────────────── +$repoDir = Split-Path -Parent $SCRIPT_DIR +Set-Content (Join-Path $WORKSPACE_DIR ".repo_path") $repoDir -Encoding UTF8 + +# ── 清理临时文件 ─────────────────────────────────────────────────────── +if ($SCRIPT_DIR -like "$env:TEMP*") { + Write-Info "清理临时文件..." + Remove-Item $repoDir -Recurse -Force -ErrorAction SilentlyContinue +} + +# ── 完成 ─────────────────────────────────────────────────────────────── +Write-Host "" +Write-Info "════════════════════════════════════════════════" +Write-Info " ✅ 黑手党提案专家 安装/更新完成!" +Write-Info "════════════════════════════════════════════════" +Write-Host "" +Write-Info "下一步:" +Write-Info " 1. 打开 CoPaw 客户端" +Write-Info " 2. 刷新页面(Ctrl+R / F5)" +Write-Info " 3. 左上角切换到「黑手党提案专家」" +Write-Info " 4. 发送:我想为 XX 品牌做一个黑手党提案" +Write-Host "" diff --git a/landing/index.html b/landing/index.html new file mode 100644 index 0000000..c5604e1 --- /dev/null +++ b/landing/index.html @@ -0,0 +1,980 @@ + + + + + + 黑手党提案专家 — CoPaw Agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + CoPaw Agent · 开源免费 +
+

黑手党提案专家

+

+ 基于 TOC 约束理论的 AI 战略顾问。
+ 帮你做出对手无法拒绝的提案。 +

+

+ TOC 五步法 + + VOC 消费者洞察 + + 一键安装 +

+
+
+ + +
+
+

安装指引

+

两步完成部署,让 AI 战略顾问即刻上线

+ +
+ + 前置条件:需先安装 CoPaw 桌面客户端(阿里巴巴开源 AI 助手框架) +
+ +
+ +
+
+
1
+
一键安装到 CoPaw
+
+

+ 打开终端,粘贴以下命令即可自动完成 Agent 注册、Skills 部署和配置。 +

+ +
+ + +
+ +
+
curl -fsSL https://git.brainwork.club/lidf/chanpinhsd/archive/main.tar.gz | tar xz -C /tmp && bash /tmp/chanpinhsd/agent/install.sh
+
+ +
+
irm https://git.brainwork.club/lidf/chanpinhsd/archive/main.zip -OutFile $env:TEMP\mafia.zip; Expand-Archive $env:TEMP\mafia.zip $env:TEMP\mafia -Force; & $env:TEMP\mafia\chanpinhsd\agent\install.ps1
+

在 PowerShell 中运行(右键开始菜单 → Windows Terminal)

+
+
+ + +
+
+
2
+
刷新并切换 Agent
+
+

+ 安装完成后,刷新 CoPaw 桌面客户端(Cmd+R),在左上角切换到「黑手党提案专家」即可开始使用。 +

+
+
+
试试说
+
我想为天维美护肝片做一个黑手党提案
+
+
+
+
+
+
+ +
+ + +
+
+

核心技能

+

TOC 约束理论五步法 + VOC 消费者洞察,6 大技能协同工作

+ +
+
+ TOC +
+ +
+

UDE 诊断

+

识别品牌面临的「不满意效果」(Undesirable Effect),找到约束系统的核心痛点

+
+ +
+ TOC +
+ +
+

冲突图构建

+

将 UDE 转化为「对立假设」冲突图,揭示表面矛盾背后的隐藏假设

+
+ +
+ TOC +
+ +
+

惯例打破

+

挑战行业惯例与隐性假设,找到「打破规则」的突破口——提案的核心创新点

+
+ +
+ TOC +
+ +
+

负面分支预测

+

预判提案可能引发的负面后果(NBRS),提前设计「修剪策略」降低风险

+
+ +
+ TOC +
+ +
+

提案组装

+

将诊断、冲突、惯例、风险整合为完整的黑手党提案交付文档

+
+ +
+ 数据 +
+ +
+

VOC 研究

+

调用 VOC 后端 API 采集抖音、小红书消费者声音数据,为诊断提供实证基础

+
+
+ + +
+

工作流程

+
+
+
+

VOC 采集

+

消费者数据

+
+
+
+
+

UDE 诊断

+

找到痛点

+
+
+
+
+

冲突图

+

揭示矛盾

+
+
+
+
+

打破惯例

+

找到突破

+
+
+
+
+

风险修剪

+

降低副作用

+
+
+
+
+

提案交付

+

完整文档

+
+
+
+
+
+ +
+ + +
+
+

VOC 数据采集

+

使用 VOC 研究功能需要配置 TikHub API Key(用于采集抖音/小红书数据)

+ +
+

TikHub API Key 配置

+

每位用户使用自己的 Key,按用量付费。单次研究成本约 $1-3(12 关键词 × 2 平台)。

+ +
+
+
1
+
+

注册 TikHub

+

前往 tikhub.io 注册并充值

+
+
+
+
2
+
+

告诉 Agent

+

对 Agent 说「我的 TikHub Key 是 xxx」,它会自动保存到本地

+
+
+
+
3
+
+

安全可靠

+

Key 存储在本地,加密传输,不存储到服务器数据库

+
+
+
+
+
+
+ + + + + + + +