{"id":48775720,"url":"https://github.com/cloverstd/ccmate","last_synced_at":"2026-04-23T17:00:54.044Z","repository":{"id":348948280,"uuid":"1196153168","full_name":"cloverstd/ccmate","owner":"cloverstd","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-20T12:16:35.000Z","size":542,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-20T13:50:20.828Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloverstd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-03-30T12:26:38.000Z","updated_at":"2026-04-20T11:59:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cloverstd/ccmate","commit_stats":null,"previous_names":["cloverstd/ccmate"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cloverstd/ccmate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloverstd%2Fccmate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloverstd%2Fccmate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloverstd%2Fccmate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloverstd%2Fccmate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloverstd","download_url":"https://codeload.github.com/cloverstd/ccmate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloverstd%2Fccmate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32050451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-13T12:32:59.929Z","updated_at":"2026-04-20T14:01:29.237Z","avatar_url":"https://github.com/cloverstd.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ccmate\n\n将 Coding Agent（Claude Code、Codex、Gemini）与 GitHub 项目管理集成的平台。监听 Issue/PR 事件，自动触发 Agent 任务，生成代码并创建 PR。\n\n## 依赖\n\n- Go 1.21+\n- [bun](https://bun.sh/)\n- SQLite3\n\n## 配置\n\n复制示例配置并按需修改：\n\n```bash\ncp config.example.yaml config.yaml\n```\n\n配置项通过环境变量覆盖，前缀 `CCMATE_`，层级用 `_` 分隔，如 `CCMATE_SERVER_PORT=9090`。\n\n## 开发\n\n### 后端\n\n```bash\n# 安装依赖\ngo mod tidy\n\n# 生成 ent 代码（修改 schema 后需要重新执行）\ngo generate ./...\n\n# 启动开发服务（默认 :8080）\ngo run ./cmd/ccmate-server -config config.yaml\n\n# 运行测试\ngo test ./... -v\n\n# Lint（需安装 golangci-lint）\ngolangci-lint run ./...\n```\n\n### 前端\n\n```bash\n# 安装依赖\ncd web \u0026\u0026 bun install\n\n# 启动开发服务（自动代理 /api 到后端 :8080）\ncd web \u0026\u0026 bun run dev\n\n# 构建（输出到 internal/static/dist/，嵌入 Go 二进制）\ncd web \u0026\u0026 bun run build\n```\n\n## 构建\n\n```bash\n# 先构建前端\ncd web \u0026\u0026 bun run build \u0026\u0026 cd ..\n\n# 再构建后端（含嵌入的前端资源）\ngo build -o bin/ccmate-server ./cmd/ccmate-server\n```\n\n## 运行\n\n```bash\n./bin/ccmate-server -config config.yaml\n```\n\n首次启动会在日志中输出 bootstrap token，用于注册管理员 Passkey。\n\n## Prompt Templates\n\nPrompt Templates 用于自定义发送给 Agent 的 task prompt。模板使用 Go template 语法，支持以下变量：\n\n| 变量 | 类型 | 说明 |\n|------|------|------|\n| `{{.IssueNumber}}` | int | Issue 编号 |\n| `{{.IssueTitle}}` | string | Issue 标题 |\n| `{{.IssueBody}}` | string | Issue 正文 |\n| `{{.IssueLabels}}` | []string | Issue 标签列表 |\n| `{{.IssueUser}}` | string | Issue 创建者 |\n| `{{.IssueLink}}` | string | Issue 链接（如 https://github.com/owner/repo/issues/1） |\n| `{{.RepoOwner}}` | string | 仓库 Owner |\n| `{{.RepoName}}` | string | 仓库名称 |\n| `{{.RepoFullName}}` | string | 完整仓库名（owner/name） |\n| `{{.TaskType}}` | string | 任务类型（issue_implementation / review_fix / manual_followup） |\n| `{{.BranchName}}` | string | 工作分支名 |\n\n模板还提供以下辅助函数：\n\n| 函数 | 说明 | 示例 |\n|------|------|------|\n| `has` | 检查字符串切片是否包含某项 | `{{if has .IssueLabels \"bug\"}}...{{end}}` |\n| `join` | 用分隔符连接字符串切片 | `{{join .IssueLabels \", \"}}` |\n\n### 示例\n\n```\n请使用 Go 编写，遵循项目现有代码风格。\n{{if has .IssueLabels \"bug\"}}这是一个 Bug 修复任务，请确保添加回归测试。{{end}}\n{{if eq .TaskType \"review_fix\"}}请仔细阅读 review 反馈并逐条修复。{{end}}\n```\n\n### Scope 策略\n\n每个 Project 可以设置 Template Scope：\n\n- **Project Only**：只使用项目自己的模板\n- **Global Only**：只使用全局默认模板（在 Settings 中配置）\n- **Merged**：全局模板 + 项目模板合并（全局在前，项目在后）\n\n## 项目结构\n\n```\ncmd/ccmate-server/         服务入口\ninternal/\n  config/                  配置加载\n  ent/schema/              数据模型（13 个 ent schema）\n  api/                     HTTP 路由、handler、中间件\n  auth/                    Passkey 认证\n  sse/                     SSE 事件广播\n  scheduler/               任务调度、状态机、并发控制\n  runner/                  Agent 子进程执行、工作目录管理\n  gitprovider/             Git 平台抽象 + GitHub 实现\n  agentprovider/           Agent 适配抽象 + Claude Code / Mock 实现\n  webhook/                 Webhook 验签、去重、命令解析\n  prompt/                  Prompt 分层组装、UNTRUSTED_CONTEXT 反注入\n  sanitize/                日志脱敏、XSS 防护\n  audit/                   审计日志\n  model/                   共享领域类型\n  static/                  前端嵌入\nweb/                       React 前端（Vite + shadcn/ui）\nconfig.example.yaml        配置示例\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloverstd%2Fccmate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloverstd%2Fccmate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloverstd%2Fccmate/lists"}