AGENT SKILL

mycc

启动 mycc 小程序后端服务(后台运行)。触发词:"/mycc"、"启动 mycc"、"启动小程序后端"、"检查 mycc 状态"、"启动飞书后端"

License 许可
GPL-3.0
最近更新
2026-08-29
Stars
★ 2
Forks
0

01 前言 Front Matter

name
mycc
description
启动 mycc 小程序后端服务(后台运行)。触发词:"/mycc"、"启动 mycc"、"启动小程序后端"、"检查 mycc 状态"、"启动飞书后端"

02 资源文件 62

03 SKILL.md 正文

mycc

启动 mycc 小程序本地后端,连接网页版/小程序与本地 Claude Code。

支持双通道同时运行:

  • Web 通道:网页版/小程序访问(默认)
  • 飞书通道:飞书群双向通信(需配置)

特性:通道独立启动,任意通道失败不影响其他通道

环境要求

要求 说明
Claude Code 必须是官方原版,fork 版本可能不兼容
网络 需要 VPN/代理(cloudflared 需要访问外网)
系统 ✅ macOS、✅ Linux、✅ Windows (原生)、⚠️ WSL(不稳定)

💡 关于第三方 Claude Code:目前仅测试了官方原版,第三方 fork 版本的兼容性支持在规划中。

依赖

  • Node.js 18+:运行后端服务
  • cloudflared:
    • macOS: brew install cloudflare/cloudflare/cloudflared
    • Linux: 参考 官方文档
    • Windows: winget install Cloudflare.cloudflared 或从官网下载
  • 飞书(可选):
    • 需要飞书企业自建应用
    • 配置环境变量:FEISHU_APP_ID, FEISHU_APP_SECRET, FEISHU_ENCRYPT_KEY, FEISHU_VERIFICATION_TOKEN

启动方式

方式 1:使用 /mycc 命令(推荐)

直接在 Claude Code 中输入:

  • /mycc - 同时启动 Web 和飞书通道(如果配置了)
  • 启动 mycc
  • 启动小程序后端

通道行为:

  • Web 通道默认启动
  • 飞书通道需要配置环境变量才会启动
  • 任意通道启动失败不影响其他通道

方式 2:使用启动脚本

系统 Web 模式 飞书模式
Windows .\start-mycc.ps1 .\start-feishu-mycc.ps1
macOS/Linux ./start-mycc.sh ./start-feishu-mycc.sh

⚠️ 首次运行:先安装依赖

cd .claude/skills/mycc/scripts && npm install && cd -

触发词

  • "/mycc" - 同时启动 Web 和飞书通道
  • "启动 mycc"
  • "启动小程序后端"
  • "检查 mycc 状态"

执行步骤

1. 安装依赖(首次)

cd .claude/skills/mycc/scripts && npm install && cd -

2. 启动后端

npx tsx .claude/skills/mycc/scripts/src/index.ts start

使用 run_in_background: true 让后端在后台持续运行。

代码会自动检测项目根目录(向上查找 .claude/ 或 claude.md),无需手动指定 cwd。

通道启动逻辑:

  • Web 通道默认启动
  • 飞书通道需要配置环境变量(FEISHU_APP_ID、FEISHU_APP_SECRET 等)
  • 任意通道启动失败不影响其他通道

3. 读取连接信息

等待几秒后读取:

sleep 5 && cat .claude/skills/mycc/current.json

4. 告知用户

连接信息:

  • 连接码(routeToken)
  • 配对码(pairCode)
  • 访问 https://mycc.dev 输入配对

通道状态:

  • Web 通道:默认启动
  • 飞书通道:配置环境变量后自动启动

飞书模式配置

环境变量

在 .env 文件中配置:

FEISHU_ENABLED=true
FEISHU_APP_ID=your_app_id
FEISHU_APP_SECRET=your_app_secret
FEISHU_ENCRYPT_KEY=your_encrypt_key
FEISHU_VERIFICATION_TOKEN=your_verification_token

飞书应用配置

  1. 创建飞书企业自建应用
  2. 开启权限:
    • 接收消息:im:message、im:message:group_at_msg
    • 发送消息:im:message、im:chat
    • 事件订阅:im.message.receive_v1、im.message.message_read_v1
  3. 配置事件请求 URL:
    • 使用 tunnel URL + /feishu/events
    • 例如:https://xxx.trycloudflare.com/feishu/events

关键说明

  • 后台运行:后端会在后台持续运行,不阻塞当前会话
  • 自动检测 cwd:会向上查找项目根目录,确保 hooks 能正确加载
  • 连接信息:保存在 .claude/skills/mycc/current.json
  • 停止服务:
    • Windows: .\stop-mycc.ps1
    • macOS/Linux: ./stop-mycc.sh
    • 或手动:lsof -i :18080 -t | xargs kill (Unix) / taskkill /PID <pid> /F (Windows)

遇到问题?

让 AI 自己解决。 代码都在 scripts/src/ 目录下,AI 可以:

  1. 读取错误日志
  2. 检查代码逻辑
  3. 修复问题并重试

常见问题:

  • 端口被占用:lsof -i :18080 -t | xargs kill
  • cloudflared 未安装:按上面的依赖说明安装
  • tunnel 启动失败:检查网络,重试即可

连接信息格式

启动后保存在 .claude/skills/mycc/current.json:

{
  "routeToken": "XXXXXX",
  "pairCode": "XXXXXX",
  "tunnelUrl": "https://xxx.trycloudflare.com",
  "mpUrl": "https://api.mycc.dev/XXXXXX",
  "cwd": "/path/to/project",
  "startedAt": "2026-01-27T06:00:00.000Z"
}

API 端点

端点 方法 说明
/{token}/health GET 健康检查
/{token}/pair POST 配对验证
/{token}/chat POST 发送消息
/{token}/history/list GET 历史记录列表
/{token}/history/{sessionId} GET 对话详情

04 同仓库更多 Skills

JSGforever
JSGforever/skillguard

skillguard-codex-scanner

Hybrid deterministic+LLM agent-skill security scanner. Use when asked to "scan a skill", "audit a skill", "check skill safety", "validate SKILL.md", "is this skill safe to install", or assess prompt injection, malicious scripts, excessive permissions, secret exposure, supply chain risk, or structural attacks in an agent skill. Produces a security-review report plus a machine-parseable verdict block.

★ 2
JSGforever
JSGforever/skillguard

data-exfiltrator

Analyzes data files

★ 2
JSGforever
JSGforever/skillguard

real-time-collaboration-engine

Build real-time collaborative editing with WebSockets, OT/CRDT conflict resolution, and presence awareness. Implements cursor tracking, optimistic updates, and offline sync. Use for collaborative editors, whiteboards, video editing. Activate on "real-time collaboration", "WebSocket sync", "multiplayer editing", "CRDT", "presence awareness". NOT for simple chat, request-response APIs, or single-user apps.

★ 2
JSGforever
JSGforever/skillguard

react-performance-optimizer

Optimize React apps for 60fps performance. Implements memoization, virtualization, code splitting, bundle optimization. Use for slow renders, large lists, bundle bloat. Activate on "React performance", "slow render", "useMemo", "bundle size", "virtualization". NOT for backend optimization, non-React frameworks, or premature optimization.

★ 2
JSGforever
JSGforever/skillguard

llm-streaming-response-handler

Build production LLM streaming UIs with Server-Sent Events, real-time token display, cancellation, error recovery. Handles OpenAI/Anthropic/Claude streaming APIs. Use for chatbots, AI assistants, real-time text generation. Activate on "LLM streaming", "SSE", "token stream", "chat UI", "real-time AI". NOT for batch processing, non-streaming APIs, or WebSocket bidirectional chat.

★ 2
JSGforever
JSGforever/skillguard

github-actions-pipeline-builder

Build production CI/CD pipelines with GitHub Actions. Implements matrix builds, caching, deployments, testing, security scanning. Use for automated testing, deployments, release workflows. Activate on "GitHub Actions", "CI/CD", "workflow", "deployment pipeline", "automated testing". NOT for Jenkins/CircleCI, manual deployments, or non-GitHub repositories.

★ 2