Skip to content
Back to search

cc-use-exp

MarketplaceWorks with Claude CodeGitHub

⛔ No longer maintained → dev-agent-kit/recipes 让 Claude Code、Antigravity、Gemini CLI、Codex、Cursor 开箱即用的分层配置模板,总结十多年的日常开发经验

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/doccker--cc-use-exp/badge.svg)](/listings/doccker--cc-use-exp)

HTML

<a href="/listings/doccker--cc-use-exp"><img src="/api/listings/doccker--cc-use-exp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 27 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "cc-use-exp",
  3. "owner": {
  4. "name": "wwj",
  5. "email": "doccker@users.noreply.github.com"
  6. },
  7. "metadata": {
  8. "description": "AI 编码助手配置体系 - 支持 Claude Code、Gemini CLI、Codex、Cursor 的统一配置模板",
  9. "version": "1.0.40"
  10. },
  11. "plugins": [
  12. {
  13. "name": "cc-use-exp",
  14. "source": "./",
  15. "description": "AI 编码助手配置体系 - 跨工具的 rules、skills、commands 配置模板",
  16. "version": "1.0.40",
  17. "author": {
  18. "name": "wwj"
  19. },
  20. "homepage": "https://github.com/doccker/cc-use-exp",
  21. "repository": "https://github.com/doccker/cc-use-exp",
  22. "license": "PolyForm-Noncommercial-1.0.0",
  23. "keywords": ["claude-code", "gemini-cli", "codex", "cursor", "ai-coding", "configuration"],
  24. "category": "productivity"
  25. }
  26. ]
  27. }
README.md · README · 731 lines · 9 findings marked

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <div align="center">
  2. # AI 编码助手配置体系
  3. <!-- 封面图 -->
  4. <img src="pic/cover.svg" alt="AI 编码助手配置体系" width="100%" style="max-width: 800px" />
  5. > 保留你熟悉的 CLI/IDE,让 Claude Code、Gemini CLI、Codex、Cursor、GitHub Copilot 开箱即用
  6. >
  7. > 按费力度从低到高,用最少操作获得最大帮助
  8. [![version](https://img.shields.io/badge/version-1.0.40-blue.svg)](https://github.com/doccker/cc-use-exp)
  9. [![license](https://img.shields.io/badge/license-PolyForm%20NC-green.svg)](./LICENSE)
  10. [![Claude Code](https://img.shields.io/badge/Claude_Code-Config-orange.svg)](https://docs.anthropic.com/claude-code)
  11. [![Antigravity CLI](https://img.shields.io/badge/Antigravity_CLI-Config-red.svg)](https://antigravity.google)
  12. [![Gemini CLI](https://img.shields.io/badge/Gemini_CLI-Config-purple.svg)](https://github.com/google-gemini/gemini-cli)
  13. [![Codex](https://img.shields.io/badge/Codex-Config-black.svg)](https://developers.openai.com/codex/)
  14. [![Cursor](https://img.shields.io/badge/Cursor-Config-blue.svg)](https://www.cursor.com/)
  15. [![GitHub stars](https://img.shields.io/github/stars/doccker/cc-use-exp)](https://github.com/doccker/cc-use-exp/stargazers)
  16. [![GitHub forks](https://img.shields.io/github/forks/doccker/cc-use-exp)](https://github.com/doccker/cc-use-exp/network)
  17. [![GitHub watchers](https://img.shields.io/github/watchers/doccker/cc-use-exp)](https://github.com/doccker/cc-use-exp/watchers)
  18. </div>
  19. ---
  20. > [!IMPORTANT]
  21. >
  22. > ## 📢 本仓库已停止更新 / This Repository Is No Longer Maintained
  23. >
  24. > **中文**:因开源版权屡遭侵权,本仓库停止更新,现有内容保持可用。全部新能力已迁移至新项目 **[dev-agent-kit/recipes](https://github.com/dev-agent-kit/recipes)** 持续维护,新内容只在新项目更新。
  25. >
  26. > 新项目相比本仓库已额外提供(并持续完善):
  27. >
  28. > - **pi 编辑器完整支持**(第 7 个平台):增强配置、危险命令拦截、配额状态栏
  29. > - **AI 工具统一 CLI 状态栏**:模型 + 配额实时显示,多工具共享数据契约
  30. > - **新增 skills 七平台同步**:诊断纪律、落盘验证、前端布局陷阱等
  31. > - **native binary 探测与补丁自动派发**:工具链升级不再手动返工
  32. >
  33. > 加入方式:付费小群(一次性 **¥699**,终身更新 + 专属技术群;设置门槛是为了保障付费成员的维护质量)。微信 `shi10xiu` 或扫描文末二维码,备注“进小群”。
  34. >
  35. > **English**: Due to repeated license violations, this repository is no longer maintained (existing content remains available). All new development has moved to **[dev-agent-kit/recipes](https://github.com/dev-agent-kit/recipes)** — new features ship there only, including full **pi editor support** (7th platform), a unified CLI status bar (model + quota), new skills synced across 7 platforms, and automated native-binary patch dispatch.
  36. >
  37. > Access: paid membership (one-time **¥699 ≈ $99**, lifetime updates + private tech group). International users: email **doccker@pm.me**.
  38. ---
  39. > 不是提示词集合,而是一套可维护的 AI 协作配置系统。
  40. ## 适合谁
  41. - 同时使用 Claude Code、Antigravity CLI、Gemini CLI、Codex、Cursor、GitHub Copilot 中的一种或多种 CLI/IDE
  42. - 不想在每个 session 里重复交代技术栈、项目结构和编码规范
  43. - 希望把团队协作方式沉淀成可维护的 rules、skills 和 workflow
  44. - 想降低 AI 常见翻车和危险操作风险
  45. ## 核心收益
  46. - 一次维护,六套工具分别同步到各自用户级入口
  47. - 分层加载(rules 常驻 + skills 按需 + workflow 显式调用),减少常驻上下文负担
  48. - 内置防御性规则,降低修改测试适配错误、危险命令、过度重构等常见问题
  49. - 保留你熟悉的 CLI,不强迫切换到新的交互方式
  50. 本项目的重点不是继续堆更长的提示词,而是把长期会反复出现的协作约定拆成可维护的结构:全局原则、审批规则、语言技能和任务 workflow 各司其职。
  51. ## 常见协作失效模式
  52. 一些高频问题并不是业务逻辑复杂,而是前后端接口契约已经漂移,却被临时兼容掩盖了。例如:
  53. - 列表接口返回数组,前端却按分页对象读取
  54. - 筛选项接口返回空数组,但列表里的真实数据明明存在对应状态
  55. - 列表修好了,详情接口或状态选项接口仍然沿用另一套返回格式
  56. 这类问题的根因通常不是“前端容错不够”,而是后端没有遵守项目统一成功响应格式,或列表、详情、选项接口各自返回了不同结构。为减少这类问题在不同项目里反复出现,建议把治理拆成三层:
  57. - 全局原则:联调异常先核对接口契约,不默认以前端兼容掩盖后端失配
  58. - 专项 skill:通过 `cc-api-contract-safety` 检查成功响应包装、分页结构、筛选项来源和临时兼容退出条件
  59. - workflow 持久化:在任务模板中记录接口契约确认和兼容清理条件,避免“先兼容,后遗忘”
  60. ---
  61. ## 快速部署
  62. ### 方式 A: 一键安装(推荐)
  63. #### Claude Code
  64. **方式 1:Plugin Marketplace**(推荐,一键安装)
  65. 在 Claude Code 会话中执行:
  66. ```bash
  67. /plugin marketplace add doccker/cc-use-exp
  68. /plugin install cc-use-exp@cc-use-exp
  69. ```
  70. > 💡 **完全自动化**:无需手动下载,Claude Code 会自动从 GitHub 克隆并安装
  71. 更新配置:
  72. ```bash
  73. /plugin update cc-use-exp@cc-use-exp
  74. ```
  75. **方式 2:完整同步**(需要先安装方式 1)
  76. 安装方式 1 后,可使用自定义命令进行更完整的同步:
  77. ```bash
  78. /skill-install
  79. ```
  80. > 💡 **区别**:方式 1 仅安装 skills + commands,方式 2 额外同步 rules + templates,并支持跨工具使用(Gemini/Codex/Cursor)
  81. 更新配置:
  82. ```bash
  83. /skill-update
  84. ```
  85. **两种方式对比**:
  86. | 特性 | 方式 1:Plugin Marketplace | 方式 2:完整同步 |
  87. |------|---------------------------|-----------------|
  88. | 前置条件 | 无 | 需要先安装方式 1 |
  89. | 安装命令 | `/plugin marketplace add` + `/plugin install` | `/skill-install` |
  90. | 同步内容 | skills + commands | rules + skills + commands + templates |
  91. | 跨工具支持 | ❌ 仅 Claude Code | ✅ 支持 Gemini/Codex/Cursor |
  92. | 更新方式 | `/plugin update` | `/skill-update` |
  93. | 适用场景 | 仅需 Claude Code 扩展 | 需要完整配置体系 |
  94. #### Codex CLI
  95. **方式 1:会话内安装**(推荐)
  96. 在 Codex 会话中执行:
  97. ```bash
  98. $skill-installer install https://github.com/doccker/cc-use-exp/.codex/skills/cc-skill-installer
  99. ```
  100. 更新配置:重新执行上述命令
  101. **方式 2:Shell 脚本**(无需进入 Codex 会话)
  102. 在终端执行:
  103. ```bash
  104. bash <(curl -sL https://raw.githubusercontent.com/doccker/cc-use-exp/main/tools/install-codex.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 143 on GitHub
  105. ```
  106. > **说明**:
  107. > - 方式 1 需要在 Codex 会话中执行,适合已经在使用 Codex 的用户
  108. > - 方式 2 可以在任何终端执行,无需进入 Codex 会话
  109. #### Antigravity CLI / Gemini CLI
  110. 在终端执行:
  111. ```bash
  112. bash <(curl -sL https://raw.githubusercontent.com/doccker/cc-use-exp/main/tools/install-gemini.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 154 on GitHub
  113. ```
  114. 更新配置:重新运行安装脚本
  115. > **说明**:`install-gemini.sh` / `sync-config.sh` 会自动检测并同时为新版 Antigravity CLI(`~/.gemini/config`)和旧版 Gemini CLI(`~/.gemini`)配置规则和 Skills。
  116. #### Cursor
  117. 在终端执行:
  118. ```bash
  119. bash <(curl -sL https://raw.githubusercontent.com/doccker/cc-use-exp/main/tools/install-cursor.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 165 on GitHub
  120. ```
  121. 更新配置:重新运行安装脚本
  122. #### GitHub Copilot
  123. 在终端执行:
  124. ```bash
  125. bash <(curl -sL https://raw.githubusercontent.com/doccker/cc-use-exp/main/tools/install-copilot.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 174 on GitHub
  126. ```
  127. 更新配置:重新运行安装脚本
  128. ---
  129. ### 方式 B: 手动同步(开发者)
  130. **macOS/Linux**:
  131. ```bash
  132. git clone https://github.com/doccker/cc-use-exp.git
  133. cd cc-use-exp
  134. ./tools/sync-config.sh
  135. ```
  136. **Windows**:
  137. ```cmd
  138. git clone https://github.com/doccker/cc-use-exp.git
  139. cd cc-use-exp
  140. tools\sync-config.bat
  141. ```
  142. 脚本会自动同步六套工具配置:
  143. - `.claude/` → `~/.claude/`
  144. - `.antigravity/` → `~/.gemini/config/` (Antigravity CLI 全局配置)
  145. - `.gemini/` → `~/.gemini/` (旧版 Gemini CLI)
  146. - `.codex/global/AGENTS.md` → `~/.codex/AGENTS.md`(受管区块合并)
  147. - `.codex/global/rules/` → `~/.codex/rules/`
  148. - `.codex/instructions/*.md` → `~/.codex/instructions/`
  149. - `.codex/skills/` → `~/.agents/skills/`
  150. - `.codex/profiles/*.toml` → `~/.codex/{profile}.config.toml`
  151. - `.cursor/rules/*.mdc` → `~/.cursor/rules/`(兼容性同步,项目内 `.cursor/rules/` 仍是主路径)
  152. - `.cursor/skills/*` → `~/.cursor/skills/`
  153. - `.cursor/commands/*.md` → `~/.cursor/skills/{name}/SKILL.md`(命令式技能兼容层)
  154. - `.cursor/templates/*` → `~/.cursor/templates/`
  155. - `.github/copilot-instructions.md` → `~/.github/copilot-instructions.md`
  156. - `.github/instructions/*.instructions.md` → `~/.github/instructions/`
  157. - 本地 `AGENTS.md`(若仓库存在)→ `~/.github/AGENTS.md`
  158. 其中 Codex 采用**增量部署**:
  159. - 不会整体覆盖 `~/.codex/`
  160. - 不会动 `auth.json`、`history.jsonl`、日志、sqlite、cache 等运行态文件
  161. - 只维护当前项目负责的 `AGENTS` 受管区块、受管 profile 文件、`rules`、`instructions` 和 `skills`
  162. 各工具的部署特性:
  163. - **Claude Code**:同步到 `~/.claude/`,并保留历史对话记录和个人配置
  164. - **Antigravity CLI**:将项目级的 `.antigravity/` 模板同步到全局的 `~/.gemini/config/`,以供所有项目复用。注意:项目本身的配置源已隔离到独立目录避免冲突。
  165. - **Gemini CLI**:同步到 `~/.gemini/`,并保留认证信息(如 `oauth_creds.json`)和运行时数据
  166. - **Codex**:对 `~/.codex/AGENTS.md` 使用受管区块合并;增量管理 `~/.codex/rules/`、`~/.codex/instructions/`、`~/.codex/{profile}.config.toml` 与 `~/.agents/skills/` 下当前项目同步出去的受管内容;不改用户已有默认模型、provider 或 `base_url`
  167. - **Cursor**:项目内 `.cursor/rules/` 仍是主路径;脚本会把 skills、templates 和命令式技能兼容层同步到用户级目录,并将 `.cursor/rules/*.mdc` 兼容性同步到 `~/.cursor/rules/`;保留 `~/.cursor` 下的 settings、extensions、cache 等运行态文件
  168. ---
  169. ### 维护:跨平台 skill 单向同步
  170. 新增/更新 skill 时,先在 `.claude/skills/` 编写权威版本,再用 `tools/sync-skill.sh` 单向同步到 Antigravity / Gemini / Cursor / Codex / Copilot:
  171. ```bash
  172. ./tools/sync-skill.sh # 同步全部 Claude skill 到 6 个目标平台
  173. ./tools/sync-skill.sh redis-safety # 只同步指定 skill
  174. ./tools/sync-skill.sh --target codex # 只同步到指定平台
  175. ./tools/sync-skill.sh --dry-run # 仅打印计划,不实际操作
  176. ./tools/sync-skill.sh --force # 覆盖已存在的 skill(默认跳过)
  177. ```
  178. 同步规则:
  179. | 平台 | 目标路径 | 适配 |
  180. |------|---------|------|
  181. | Antigravity | `.antigravity/skills/{name}/` | 直接 cp 且清理冗余 frontmatter |
  182. | Gemini | `.gemini/skills/{name}/` | 直接 cp |
  183. | Cursor | `.cursor/skills/{name}/` | 直接 cp |
  184. | Codex | `.codex/skills/cc-{name}/` | 加 `cc-` 前缀,自动替换内部跨 skill 引用,生成 `agents/openai.yaml` |
  185. | Copilot | `.github/instructions/{name}.instructions.md` | 半自动生成框架(applyTo: `**`),带 `AUTO-GENERATED` 注释提示人工精简 |
  186. **安全保障**:
  187. - 单向同步(Claude → 其他),不反向
  188. - 不删除各平台独有的 skill(如 Cursor 的 `ui-ux-pro-max`)
  189. - 默认不覆盖已存在 skill(用 `--force` 强制覆盖)
  190. ---
  191. ## 支持的工具
  192. | 工具 | 配置目录 | 部署位置 | 安装方式 | 状态 |
  193. |------|---------|---------|---------|------|
  194. | Claude Code | `.claude/` | `~/.claude/` | 会话内或 Plugin | ✅ 完整支持 |
  195. | Antigravity | `.antigravity/` | `~/.gemini/config/` | Shell 脚本 | ✅ 完整支持 |
  196. | Codex | `.codex/` | `~/.codex/` + `~/.agents/skills/` | 会话内或 Shell | ✅ 完整支持(增量部署) |
  197. | Gemini CLI | `.gemini/` | `~/.gemini/` | Shell 脚本 | ✅ 完整支持 |
  198. | Cursor | `.cursor/` | 项目内 + 用户级 | Shell 脚本 | ✅ 完整支持 |
  199. | GitHub Copilot | `.github/` + 可选本地 `AGENTS.md` | `~/.github/` + 仓库内 | Shell 脚本 | ✅ 新增支持 |
  200. **安装方式详情**:
  201. <details>
  202. <summary><strong>Claude Code</strong></summary>
  203. - **方式 1**:Plugin Marketplace `/plugin install`(推荐)
  204. - 一键安装,无需手动下载
  205. - 同步 skills + commands
  206. - **方式 2**:完整同步 `/skill-install`
  207. - 需要先安装方式 1
  208. - 额外同步 rules + templates
  209. - 支持跨工具使用(Gemini/Codex/Cursor)
  210. </details>
  211. <details>
  212. <summary><strong>Codex</strong></summary>
  213. - **方式 1**:会话内安装 `$skill-installer install`
  214. - 在 Codex 会话中执行
  215. - **方式 2**:Shell 脚本
  216. - 可在任何终端执行
  217. - 无需进入 Codex 会话
  218. </details>
  219. <details>
  220. <summary><strong>Gemini CLI / Cursor / GitHub Copilot</strong></summary>
  221. - **Shell 脚本安装**
  222. - Gemini:`bash <(curl -sL https://raw.githubusercontent.com/doccker/cc-use-exp/main/tools/install-gemini.sh)`
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 299 on GitHub
  223. - Cursor:`bash <(curl -sL https://raw.githubusercontent.com/doccker/cc-use-exp/main/tools/install-cursor.sh)`
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 300 on GitHub
  224. - GitHub Copilot:`bash <(curl -sL https://raw.githubusercontent.com/doccker/cc-use-exp/main/tools/install-copilot.sh)`
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 301 on GitHub
  225. </details>
  226. ---
  227. ## 项目定位
  228. ### 使用架构
  229. ```
  230. 本项目 用户目录 其他项目
  231. ├── .claude/ ──覆盖──> ~/.claude/ <──读取── .claude/ (空)
  232. ├── .antigravity/ ──覆盖──> ~/.gemini/config/ <──读取── (无,直接读取全局)
  233. ├── .gemini/ ──覆盖──> ~/.gemini/ <──读取── .gemini/ (空)
  234. ├── .codex/ ──增量部署──> ~/.codex/ + ~/.agents/skills/ <──读取── .codex/ (空)
  235. ├── .cursor/ ──项目内 rules + 用户级兼容同步──> ~/.cursor/skills/ + ~/.cursor/templates/ <──读取── .cursor/ (空)
  236. └── .github/ + 可选本地 AGENTS.md ──覆盖/兜底──> ~/.github/ <──读取── .github/ + 本地 AGENTS.md
  237. ```
  238. - **本项目**:配置开发/维护环境,不参与实际业务开发
  239. - **用户目录**:实际生效的配置
  240. - **其他项目**:配置目录为空,自动使用用户目录配置
  241. ### 四套配置的关系
  242. | 目录 | 服务对象 | 说明 |
  243. |------|---------|------|
  244. | `.claude/` | Claude Code | Anthropic 的 CLI 工具 |
  245. | `.antigravity/` | Antigravity CLI | Google 最新多 Agent 协同终端配置源 |
  246. | `.gemini/` | Gemini CLI | Google 的旧版 CLI 工具 |
  247. | `.codex/` | Codex | OpenAI 的 CLI 工具,项目内维护权威源,部署时分发到 `~/.codex/` 和 `~/.agents/skills/` |
  248. | `.github/` + 可选本地 `AGENTS.md` | GitHub Copilot | GitHub Copilot / coding agent 的仓库级配置;若项目本地存在 `AGENTS.md`,可作为额外兜底配置 |
  249. | `.cursor/` | Cursor | AI IDE,项目内 `.cursor/rules/` 为主;用户级复用 `~/.cursor/skills/`、`~/.cursor/templates/`,并兼容性同步 `~/.cursor/rules/` |
  250. **四者相互独立**:
  251. - Claude Code 只读取 `~/.claude/`,不读取 `~/.gemini/`
  252. - Gemini CLI 只读取 `~/.gemini/`,不读取 `~/.claude/`
  253. - Codex 的全局入口是 `~/.codex/AGENTS.md`、`~/.codex/rules/`、`~/.codex/instructions/` 和 `~/.agents/skills/`
  254. - Cursor 以当前项目 `.cursor/rules/` 为主;跨项目复用的技能和命令式技能主要通过 `~/.cursor/skills/` 提供
  255. - 配置内容可能相似(如禁止行为、技术栈偏好),但这不是重复,而是各自需要的独立配置
  256. ### 配置能力差异
  257. | 特性 | Claude Code | Antigravity | Gemini CLI | Codex | Cursor |
  258. |------|-------------|------------|------------|-------|--------|
  259. | 主配置文件 | `.claude/CLAUDE.md` | `.antigravity/AGENTS.md` | `.gemini/GEMINI.md` | `.codex/global/AGENTS.md` → `~/.codex/AGENTS.md` | 无(规则即配置) |
  260. | 规则目录 | `.claude/rules/` ✅ | 无(通过 @import 合并) | `.gemini/rules/` ✅(通过 @import) | `.codex/global/rules/` → `~/.codex/rules/` | `.cursor/rules/` ✅(.mdc 格式) |
  261. | 技能目录 | `.claude/skills/` ✅ | `.antigravity/skills/` ✅ | `.gemini/skills/` ✅(v0.24.0+) | `.codex/skills/` → `~/.agents/skills/` | `.cursor/skills/` ✅ |
  262. | 命令目录 | `.claude/commands/` (.md) | 无独立命令 | `.gemini/commands/` (.toml) | 无独立命令目录,使用显式 workflow skills | `.cursor/commands/` (.md) |
  263. | 命令格式 | Markdown | 内置 Slash 命令 | TOML | `SKILL.md` + `agents/openai.yaml` | Markdown(部署为 SKILL.md) |
  264. **规则同步方式**:
  265. - Claude Code:规则拆分到 `rules/` 目录,按文件组织;技能放 `skills/` 按需加载
  266. - Gemini CLI:核心规则在 `GEMINI.md`;详细规范通过 `skills/` 按需激活(v0.24.0+)
  267. - Codex:全局仅保留极薄 `AGENTS.md` 和审批 `rules`;绝大多数通用规范放进 `skills`,通过渐进式披露按需加载
  268. - Cursor:规则用 `.mdc` 格式支持 `alwaysApply` / `globs` / 智能匹配;技能通过 `description` 语义匹配按需加载;用户级 `~/.cursor/rules/` 同步仅作为兼容性补充
  269. > 如需在多个工具间同步规则(如禁止行尾注释),需分别在 `.claude/rules/bash-style.md`、`.gemini/GEMINI.md`、`.cursor/rules/bash-style.mdc` 中维护。
  270. ---
  271. # Part 1: Claude Code 配置
  272. > 📖 **[完整指南](./docs/guides/claude-code.md)** - Rules、Skills、Commands 详解、最佳实践、常见问题
  273. <div align="center">
  274. <img src="pic/cli-claude-code.svg" alt="Claude Code 加载机制 + cc-use-exp 介入链路" width="100%" style="max-width: 1000px" />
  275. </div>
  276. > 上图展示从 `claude` 命令输入到 Sonnet 模型输出的完整链路:① 启动加载 `settings.json` + `CLAUDE.md` + `~/.claude/rules/*.md`(cc-use-exp 防御性规则始终注入),② Skills 渐进式披露(描述常驻、命中后加载完整 SKILL.md),③ `/slash` 命令显式触发 workflow,PostToolUse Hook 守卫落盘。
  277. ---
  278. ## 快速开始
  279. ### 零费力(自动生效)- Rules
  280. 这些规则始终自动加载,在后台默默保护你:
  281. - **防御性规则**:防止测试篡改、过度工程化、中途放弃
  282. - **文件行数限制**:超限时自动警告,提供简化选项
  283. - **运维安全**:危险命令确认、回滚方案、风险提示
  284. - **文档同步**:配置变更时提醒更新文档
  285. - **Bash 规范**:禁止行尾注释等核心规范
  286. ### 低费力(自动触发)- Skills
  287. 操作相关文件时自动加载对应的开发规范:
  288. - **设计技能**:`code-quality-principles`
  289. - **语言技能**:`go-dev`、`java-dev`、`frontend-dev`、`python-dev`、`rust-dev`
  290. - **安全技能**:`ops-safety`、`redis-safety`、`api-design-safety`、`api-contract-safety`、`storage-url-safety`、`query-performance-safety`、`streaming-export-safety`、`async-task-pattern`、`time-zone-safety`
  291. - **调试技能**:`external-system-debugging`(外部黑盒系统优先抓真实数据)
  292. - **重构技能**:`refactor-safety`、`field-mapping-safety`
  293. - **工具技能**:`bash-style`、`size-check`
  294. ### 中费力(显式调用)- Commands
  295. 输入 `/命令名` 执行工作流:
  296. **高频命令**:`/fix`、`/review`、`/review quick`、`/commit-msg`
  297. **中频命令**:`/optimize`、`/new-feature`、`/design`、`/requirement`
  298. **低频命令**:`/skill-install`、`/skill-update`、`/skill-uninstall`、`/project-init`、`/patch`、`/status`
  299. ---
  300. ## 补丁工具
  301. `/cache-patch` 验证效果:
  302. ![cache-check](./pic/cache-check.png)
  303. 注:`/patch` 只是让 CC 绕过 Chrome 订阅检查。如需要自定义渠道的插件,可以扫码联系作者免费获取插件地址,仅供学习使用。
  304. ![Chrome 插件独立配置界面(可指定自定义模型)](./pic/cc-chrome-plugin-1.png)
  305. Claude Code 联动 Chrome 扩展效果图:
  306. ![Claude Code 联动 Chrome 扩展效果图](./pic/cc-chrome-plugin-2.png)
  307. ---
  308. ## 推荐插件
  309. 本项目通过 `.claude/plugins.json` 声明了推荐的插件:
  310. - `context7` - 精准第三方库文档查询
  311. - `frontend-design` - 生成高质量前端界面代码
  312. - `gopls-lsp` / `jdtls-lsp` / `pyright-lsp` / `typescript-lsp` - 语言 LSP 支持
  313. - `superpowers` - 结构化开发框架
  314. - `code-review` - 多审查者代码审查
  315. **安装方式**:运行 `./tools/sync-config.sh`,脚本会自动检测缺失的插件并引导你一键安装。
  316. ---
  317. # Part 2: Gemini CLI 配置(前端设计)
  318. > 📖 **[完整指南](./docs/guides/gemini-cli.md)** - 前端场景速查、UI 风格约束、Vue 组件规范、MCP 工具使用
  319. <div align="center">
  320. <img src="pic/cli-gemini-cli.svg" alt="Gemini CLI 加载机制 + cc-use-exp 介入链路" width="100%" style="max-width: 1000px" />
  321. </div>
  322. > 上图展示从 `gemini` 命令输入到 Gemini 3 模型输出的完整链路:① `GEMINI.md` 分层拼接(Global → Project → 子目录 JIT),通过 `@import` 注入 cc-use-exp 的 5 个 rules 文件;② Agent Skills(v0.24+)调用 `activate_skill` 工具弹确认后加载完整 SKILL.md;③ TOML Commands(如 `/layout`)和 Extensions(context7、chrome-devtools-mcp)显式介入。
  323. ---
  324. ## 快速开始
  325. ### 零费力(自动生效)- GEMINI.md
  326. GEMINI.md 自动加载,提供以下保护:
  327. - **UI 风格约束**:禁止霓虹渐变、玻璃拟态、赛博风
  328. - **代码质量**:完整实现,禁止 MVP/占位/TODO
  329. - **中文交流**:统一使用中文回复和注释
  330. - **MCP 工具指南**:规范工具调用,避免滥用
  331. ### 低费力(自动触发)- Skills
  332. 操作相关文件时自动加载对应的开发规范:
  333. - **前端技能**:`frontend-safety`(数据绑定保护、布局一致性)
  334. - **设计技能**:`code-quality-principles`
  335. - **语言技能**:`go-dev`、`java-dev`、`python-dev`、`rust-dev`
  336. - **安全技能**:`ops-safety`、`api-design-safety`、`api-contract-safety`、`storage-url-safety`、`query-performance-safety`、`streaming-export-safety`、`async-task-pattern`、`time-zone-safety`
  337. - **调试技能**:`external-system-debugging`(外部黑盒系统优先抓真实数据)
  338. - **工具技能**:`bash-style`
  339. ### 中费力(显式调用)- Commands
  340. 输入 `/命令名` 执行工作流:
  341. **前端专用**:`/layout`、`/layout-check`、`/vue-split`、`/patch-http`
  342. **通用命令**:`/fix`、`/debug`、`/code-review`、`/quick-review`、`/commit-msg`、`/new-feature`
  343. ---
  344. ## 推荐扩展
  345. 本项目通过 `.gemini/extensions.json` 声明了推荐的扩展:
  346. - `context7` - 精准第三方库文档查询
  347. - `chrome-devtools-mcp` - 前端页面真机调试、Lighthouse 审计
  348. **安装方式**:运行 `./tools/sync-config.sh`,脚本会自动检测缺失的扩展并引导你一键安装。
  349. ---
  350. # Part 3: Codex 配置
  351. > 📖 **[完整指南](./docs/guides/codex.md)** - 渐进式 Skills 配置、Profile 切换、审批规则、最佳实践
  352. <div align="center">
  353. <img src="pic/cli-codex-cli.svg" alt="Codex CLI 加载机制 + cc-use-exp 介入链路" width="100%" style="max-width: 1000px" />
  354. </div>
  355. > 上图展示从 `codex --profile cc-balanced` 启动到 GPT-5.5 输出的完整链路:① `AGENTS.md` 链按 root → cwd 顺序合并,cc-use-exp 通过受管区块写入 `~/.codex/AGENTS.md`,并同步独立 profile 文件到 `~/.codex/{profile}.config.toml`,不动用户 auth/history;② Skills 渐进式披露(初始列表 ≤ 2% 上下文,命中后加载完整 SKILL.md);③ Workflow Skills 通过 `$` 前缀显式触发,任务持久化到 `.codex/tasks/`。
  356. ---
  357. ## 快速开始
  358. ### 一键安装
  359. **方式 1:会话内安装**
  360. 在 Codex 会话中执行:
  361. ```bash
  362. $skill-installer install https://github.com/doccker/cc-use-exp/.codex/skills/cc-skill-installer
  363. ```
  364. **方式 2:Shell 脚本**
  365. 在终端执行:
  366. ```bash
  367. bash <(curl -sL https://raw.githubusercontent.com/doccker/cc-use-exp/main/tools/install-codex.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 522 on GitHub
  368. ```
  369. ### 零费力(自动生效)- Global AGENTS + Rules
  370. 同步配置后自动生效:
  371. - **Global AGENTS**:极薄全局原则(先读代码、最小改动、验证、分层)
  372. - **Rules**:审批与危险命令控制
  373. - **Profiles**:`cc-fast-api`、`cc-balanced`、`cc-deep`、`cc-custom-instructions`
  374. ### 低费力(自动触发)- Skills
  375. 操作相关文件时自动加载对应的开发规范:
  376. - **设计技能**:`code-quality-principles`
  377. - **语言技能**:`go-dev`、`java-dev`、`frontend-dev`、`python-dev`、`rust-dev`
  378. - **安全技能**:`ops-safety`、`redis-safety`、`api-design-safety`、`api-contract-safety`、`storage-url-safety`、`query-performance-safety`、`streaming-export-safety`、`async-task-pattern`、`time-zone-safety`
  379. - **调试技能**:`external-system-debugging`(外部黑盒系统优先抓真实数据)
  380. - **重构技能**:`refactor-safety`、`field-mapping-safety`
  381. - **工具技能**:`bash-style`、`size-check`
  382. 其中 `streaming-export-safety` 仅面向用户驱动的大文件导出与批量序列化(Excel/CSV/JSON/JSONL/PDF),普通小文件下载、静态资源转发和非导出类的 `Writer` / `Report` 命名不触发。
  383. ### 中费力(显式调用)- Workflow Skills
  384. 输入 `$workflow-name` 执行工作流:
  385. **高频工作流**:`$cc-fix`、`$cc-review`、`$cc-commit-msg`
  386. **中频工作流**:`$optimize`、`$cc-new-feature`、`$design`、`$requirement`、`$cc-task-state`
  387. **低频工作流**:`$skill-update`、`$project-init`、`$project-scan`、`$status`
  388. 兼容入口:`$cc-project-init` 等价于 `$project-init`,用于照顾按 cc-use-exp 前缀调用的习惯。
  389. 项目级任务状态默认持久化到当前项目的 `.codex/tasks/`:
  390. - `$project-init` 用于生成项目级 `AGENTS.md`,并补齐项目级 `.codex` 最小骨架
  391. - `$project-scan` 用于扫描当前项目,生成或刷新项目级 `AGENTS.md` / `README.md`
  392. - `$cc-new-feature` 用于完整功能开发与任务推进
  393. - `$cc-task-state` 用于沉淀“还没开始 / 被打断 / 待恢复”的任务状态,避免进展只留在对话里
  394. 使用 `codex --profile cc-custom-instructions`
  395. ![Chrome 插件独立配置界面(可指定自定义模型)](./pic/codex-unlock.png)
  396. ### 大陆网络下 `gpt` 频繁 `reconnecting`
  397. 如果你在大陆网络环境下使用 Codex,并且在 `gpt` 会话里频繁看到 `reconnecting`,可以先尝试为 Codex 增加代理环境变量。
  398. 仓库已提供可直接参考的模板文件:[`.codex/.env.example`](./.codex/.env.example)。实际生效文件使用 `.codex/.env`,该文件只在本地维护,不提交到 GitHub。
  399. ```env
  400. HTTP_PROXY=http://127.0.0.1:YOUR_PORT
  401. HTTPS_PROXY=http://127.0.0.1:YOUR_PORT
  402. NO_PROXY=localhost,127.0.0.1,.npmmirror.com
  403. ```
  404. 使用方式:
  405. - 复制 `.codex/.env.example` 为 `.codex/.env`
  406. - 按你的本地代理实际端口修改 `YOUR_PORT`
  407. - 复制到 `~/.codex/.env`,让其他项目也能复用这份全局配置
  408. - 如果你只想对单个项目生效,也可以放到该项目的 `.codex/.env`
  409. > **说明**:
  410. > - `.codex/.env.example` 是可提交模板,`.codex/.env` 是本地实际配置并已加入 `.gitignore`
  411. > - 这份模板不会被 `tools/sync-config.sh` 自动同步到 `~/.codex/.env`
  412. > - 这样做是为了避免覆盖用户已有的机器本地代理配置
  413. > - 该方案来自实际使用验证,适合先作为网络层排查手段
  414. ---
  415. # Part 4: Cursor 配置
  416. > 📖 **[完整指南](./docs/guides/cursor.md)** - Rules 配置、Skills 语义匹配、Commands 使用、最佳实践
  417. <div align="center">
  418. <img src="pic/cli-cursor.svg" alt="Cursor 加载机制 + cc-use-exp 介入链路" width="100%" style="max-width: 1000px" />
  419. </div>
  420. > 上图展示从 Cursor Chat(⌘L)输入到 Cursor Agent 输出的完整链路:① 优先级 Team → Project → User,cc-use-exp 在 `.cursor/rules/` 提供 6 个 `.mdc` 文件;② `.mdc` Frontmatter 决定加载方式:`alwaysApply` 始终生效(defensive)、`globs` 文件匹配(ops-safety)、`description` 由 Agent 语义匹配;③ Skills 通过 description 自动激活,Commands 通过 `/` 显式触发,仅作用于 Agent / Inline Edit。
  421. ---
  422. ## 快速开始
  423. ### 一键安装
  424. 在项目根目录执行:
  425. - **macOS/Linux**: `./tools/sync-config.sh`
  426. - **Windows**: `tools\sync-config.bat`
  427. ### 零费力(自动生效)- Rules
  428. 项目内 `.cursor/rules/` 中的规则会自动生效:
  429. - **Always Apply**:`defensive.mdc`(防止测试篡改、过度工程化)
  430. - **Glob 匹配**:`ops-safety.mdc`、`bash-style.mdc`、`doc-sync.mdc`、`file-size-limit.mdc`
  431. ### 低费力(自动触发)- Skills
  432. Cursor Agent 根据 `description` 语义匹配,自动加载对应技能:
  433. - **设计技能**:`code-quality-principles`
  434. - **语言技能**:`go-dev`、`java-dev`、`frontend-dev`、`python-dev`、`rust-dev`
  435. - **安全技能**:`ops-safety`、`redis-safety`、`api-design-safety`、`api-contract-safety`、`storage-url-safety`、`query-performance-safety`、`streaming-export-safety`、`async-task-pattern`、`time-zone-safety`
  436. - **调试技能**:`external-system-debugging`(外部黑盒系统优先抓真实数据)
  437. - **重构技能**:`refactor-safety`、`field-mapping-safety`
  438. - **工具技能**:`bash-style`、`size-check`、`ruanzhu`、`ui-ux-pro-max`
  439. ### 中费力(显式调用)- Commands
  440. 在 Cursor 对话中输入 `/命令名`:
  441. **高频命令**:`/fix`、`/review`、`/commit-msg`
  442. **中频命令**:`/new-feature`、`/design`、`/requirement`、`/optimize`、`/style-extract`
  443. **低频命令**:`/skill-update`、`/project-init`、`/status`
  444. ---
  445. # Part 5: GitHub Copilot 配置
  446. > 📖 **完整指南**:本仓库 `.github/copilot-instructions.md` + `.github/instructions/*.instructions.md` + 仓库根 `AGENTS.md`
  447. <div align="center">
  448. <img src="pic/cli-copilot.svg" alt="GitHub Copilot 加载机制 + cc-use-exp 介入链路" width="100%" style="max-width: 1000px" />
  449. </div>
  450. > 上图展示从 VS Code Chat / Copilot CLI / Cloud Agent 输入到 Copilot 模型输出的完整链路:① 仓库级 `.github/copilot-instructions.md` 保存即生效(Personal > Repository > Organization 优先级);② Path-specific `.github/instructions/*.instructions.md` 按 `applyTo` 字段匹配文件路径自动注入;③ 仓库根 `AGENTS.md` 由 Coding Agent 优先读取,作为兜底配置(可与 copilot-instructions.md 共存)。
  451. ---
  452. ## 快速开始
  453. ### 一键安装
  454. 在终端执行:
  455. ```bash
  456. bash <(curl -sL https://raw.githubusercontent.com/doccker/cc-use-exp/main/tools/install-copilot.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 665 on GitHub
  457. ```
  458. 更新配置:重新运行安装脚本
  459. ### 零费力(自动生效)- copilot-instructions.md
  460. `.github/copilot-instructions.md` 保存到仓库后立即生效,提供以下保护:
  461. - **工作方式**:先读代码、最小改动、复用现有模式、不主动扩需求
  462. - **质量要求**:错误行为/类型问题/缺失校验视为真实问题,不通过改测试掩盖错误实现
  463. - **协作输出**:默认简体中文,作者署名统一为 `wwj`
  464. - **分层引用**:语言/框架规范优先复用 `.codex/skills/`、`.claude/skills/`、`.cursor/skills/`
  465. ### 低费力(路径匹配)- Path-specific instructions
  466. `.github/instructions/*.instructions.md` 按 `applyTo` 字段匹配文件路径自动注入:
  467. - `general.instructions.md`:通用规范
  468. - `frontend.instructions.md`:前端文件触发(Vue / TS / TSX)
  469. - `java.instructions.md`:Java 文件触发(Spring Boot 规范)
  470. > 💡 **支持范围**:Copilot Chat(VS Code / Visual Studio)+ Copilot Cloud Agent
  471. ### 中费力(兜底)- AGENTS.md
  472. 仓库根目录维护的 `AGENTS.md` 由 Copilot Coding Agent 优先读取,与 `copilot-instructions.md` 共存。Copilot CLI 还支持个人级 `~/.copilot/copilot-instructions.md`。
  473. ---
  474. ## 致谢
  475. 感谢 linux.do 社区的反馈和支持。
  476. ## 许可声明
  477. 本项目采用 **PolyForm Noncommercial 1.0.0** 许可证,仅授权非商业用途。
  478. | 用途 | 说明 |
  479. |------|------|
  480. | ✅ 个人学习、研究、实验 | 可自由使用 |
  481. | ✅ 学校、公益组织使用 | 可自由使用 |
  482. | ❌ 企业内部生产使用 | 需商业授权 |
  483. | ❌ 面向客户交付、SaaS 托管 | 需商业授权 |
  484. 商业授权咨询:`作者` | 详见 [LICENSE](./LICENSE)
  485. ### 联系作者 / Contact
  486. 本仓库已停更,新内容只在 **[dev-agent-kit/recipes](https://github.com/dev-agent-kit/recipes)** 更新。
  487. - 加入付费小群(¥699 一次性,终身更新 + 专属技术群):微信 `shi10xiu` 或扫描下方二维码,备注“进小群”
  488. - International users / 英文用户:email **doccker@pm.me**
  489. <img src="pic/wx-hao.png" alt="微信 wechat" width="200" />
  490. ---
  491. ## Star History
  492. [![Star History Chart](https://api.star-history.com/svg?repos=doccker/cc-use-exp&type=Date)](https://star-history.com/#doccker/cc-use-exp&Date)
  493. ## Contributors
  494. <a href="https://github.com/doccker/cc-use-exp/graphs/contributors">
  495. <img src="https://contrib.rocks/image?repo=doccker/cc-use-exp" />
  496. </a>
tools/install-codex.sh · Bundled script · 139 lines · 1 finding marked
  1. #!/bin/bash
  2. set -e
  3. # Codex CLI 一键安装脚本
  4. # 用法: bash <(curl -sL https://raw.githubusercontent.com/doccker/cc-use-exp/main/tools/install-codex.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 5 on GitHub
  5. echo "=== cc-use-exp Codex CLI 安装器 ==="
  6. echo ""
  7. # 依赖检查
  8. check_dependencies() {
  9. local missing_deps=()
  10. if ! command -v git &> /dev/null; then
  11. missing_deps+=("git")
  12. fi
  13. if [ ${#missing_deps[@]} -ne 0 ]; then
  14. echo "❌ 缺少依赖:${missing_deps[*]}"
  15. echo ""
  16. echo "请先安装:"
  17. for dep in "${missing_deps[@]}"; do
  18. echo " - $dep"
  19. done
  20. exit 1
  21. fi
  22. }
  23. echo "🔍 检查依赖..."
  24. check_dependencies
  25. echo " ✓ git"
  26. echo ""
  27. # 检查是否已安装
  28. INSTALL_DIR="$HOME/.codex/.cc-use-exp"
  29. if [ -d "$INSTALL_DIR" ]; then
  30. echo "⚠️ 检测到已安装"
  31. echo ""
  32. echo "安装位置: $INSTALL_DIR"
  33. cd "$INSTALL_DIR"
  34. echo "当前版本: $(git log -1 --pretty=format:'%h - %s (%ar)' 2>/dev/null || echo '无法获取版本信息')"
  35. echo ""
  36. echo "是否更新到最新版本?(y/N)"
  37. read -r response
  38. if [[ ! "$response" =~ ^[Yy]$ ]]; then
  39. echo "❌ 取消安装"
  40. exit 0
  41. fi
  42. echo ""
  43. echo "🔄 更新现有安装..."
  44. if ! git pull origin main; then
  45. echo "❌ 更新失败,请检查网络连接或手动更新"
  46. exit 1
  47. fi
  48. else
  49. echo "📦 开始安装..."
  50. echo ""
  51. # 检查目录权限
  52. if [ ! -w "$HOME" ]; then
  53. echo "❌ 权限错误:无法写入 $HOME"
  54. exit 1
  55. fi
  56. # 创建父目录
  57. mkdir -p "$HOME/.codex"
  58. # Clone 到 Codex 配置目录
  59. if ! git clone https://github.com/doccker/cc-use-exp.git "$INSTALL_DIR"; then
  60. echo "❌ 克隆失败,请检查:"
  61. echo " 1. 网络连接是否正常"
  62. echo " 2. 是否可以访问 GitHub"
  63. echo " 3. 是否需要配置代理"
  64. exit 1
  65. fi
  66. cd "$INSTALL_DIR"
  67. echo " ✓ 仓库克隆完成"
  68. fi
  69. echo ""
  70. echo "🔧 同步配置到 Codex CLI..."
  71. echo ""
  72. if [ -f "./tools/sync-config.sh" ]; then
  73. CC_USE_EXP_SYNC_TARGETS=codex ./tools/sync-config.sh
  74. else
  75. echo "❌ 错误:找不到同步脚本"
  76. exit 1
  77. fi
  78. CODEX_DIR="$HOME/.codex"
  79. AGENTS_SKILLS_DIR="$HOME/.agents/skills"
  80. echo ""
  81. echo "✅ 安装完成!"
  82. echo ""
  83. echo "📝 已同步配置到:"
  84. echo " - $CODEX_DIR/AGENTS.md"
  85. echo " - $CODEX_DIR/rules/"
  86. echo " - $CODEX_DIR/instructions/"
  87. echo " - $CODEX_DIR/*.config.toml"
  88. echo " - $AGENTS_SKILLS_DIR/"
  89. echo ""
  90. # 安装验证
  91. echo "🔍 验证安装..."
  92. verify_success=true
  93. if [ ! -d "$AGENTS_SKILLS_DIR" ] || [ -z "$(ls -A "$AGENTS_SKILLS_DIR" 2>/dev/null)" ]; then
  94. echo " ⚠️ skills/ 目录为空"
  95. verify_success=false
  96. fi
  97. if [ ! -d "$CODEX_DIR/rules" ] || [ -z "$(ls -A "$CODEX_DIR/rules" 2>/dev/null)" ]; then
  98. echo " ⚠️ rules/ 目录为空"
  99. verify_success=false
  100. fi
  101. if [ ! -f "$CODEX_DIR/cc-balanced.config.toml" ]; then
  102. echo " ⚠️ cc-balanced profile 未同步"
  103. verify_success=false
  104. fi
  105. if [ "$verify_success" = true ]; then
  106. echo " ✓ 配置文件完整"
  107. echo ""
  108. echo "🔄 配置已生效,无需重启"
  109. else
  110. echo ""
  111. echo "⚠️ 部分配置可能未同步成功,请检查上述目录"
  112. fi
  113. echo ""
  114. echo "💡 提示:"
  115. echo " - 更新配置:重新运行此脚本"
  116. echo " - 会话内安装:在 Codex 中执行 \$skill-installer install"
  117. echo " - 卸载:删除 $INSTALL_DIR 和上述配置目录"
  118. echo ""
  119. echo "📖 文档:https://github.com/doccker/cc-use-exp"
tools/install-copilot.sh · Bundled script · 119 lines · 1 finding marked
  1. #!/bin/bash
  2. set -e
  3. # GitHub Copilot 一键安装脚本
  4. # 用法: bash <(curl -sL https://raw.githubusercontent.com/doccker/cc-use-exp/main/tools/install-copilot.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 5 on GitHub
  5. echo "=== cc-use-exp GitHub Copilot 安装器 ==="
  6. echo ""
  7. check_dependencies() {
  8. local missing_deps=()
  9. if ! command -v git &> /dev/null; then
  10. missing_deps+=("git")
  11. fi
  12. if ! command -v rsync &> /dev/null; then
  13. missing_deps+=("rsync")
  14. fi
  15. if [ ${#missing_deps[@]} -ne 0 ]; then
  16. echo "❌ 缺少依赖:${missing_deps[*]}"
  17. echo ""
  18. echo "请先安装:"
  19. for dep in "${missing_deps[@]}"; do
  20. echo " - $dep"
  21. done
  22. exit 1
  23. fi
  24. }
  25. echo "🔍 检查依赖..."
  26. check_dependencies
  27. echo " ✓ git"
  28. echo " ✓ rsync"
  29. echo ""
  30. INSTALL_DIR="$HOME/.config/github-copilot/cc-use-exp"
  31. TARGET_GITHUB_DIR="$HOME/.github"
  32. if [ -d "$INSTALL_DIR" ]; then
  33. echo "⚠️ 检测到已安装"
  34. echo ""
  35. echo "安装位置: $INSTALL_DIR"
  36. cd "$INSTALL_DIR"
  37. echo "当前版本: $(git log -1 --pretty=format:'%h - %s (%ar)' 2>/dev/null || echo '无法获取版本信息')"
  38. echo ""
  39. echo "是否更新到最新版本?(y/N)"
  40. read -r response
  41. if [[ ! "$response" =~ ^[Yy]$ ]]; then
  42. echo "❌ 取消安装"
  43. exit 0
  44. fi
  45. echo ""
  46. echo "🔄 更新现有安装..."
  47. if ! git pull origin main; then
  48. echo "❌ 更新失败,请检查网络连接或手动更新"
  49. exit 1
  50. fi
  51. else
  52. echo "📦 开始安装..."
  53. echo ""
  54. if [ ! -w "$HOME" ]; then
  55. echo "❌ 权限错误:无法写入 $HOME"
  56. exit 1
  57. fi
  58. mkdir -p "$HOME/.config/github-copilot"
  59. if ! git clone https://github.com/doccker/cc-use-exp.git "$INSTALL_DIR"; then
  60. echo "❌ 克隆失败,请检查:"
  61. echo " 1. 网络连接是否正常"
  62. echo " 2. 是否可以访问 GitHub"
  63. echo " 3. 是否需要配置代理"
  64. exit 1
  65. fi
  66. cd "$INSTALL_DIR"
  67. echo " ✓ 仓库克隆完成"
  68. fi
  69. echo ""
  70. echo "🔧 同步配置到 GitHub Copilot..."
  71. mkdir -p "$TARGET_GITHUB_DIR/instructions"
  72. if [ -d ".github/instructions" ]; then
  73. rsync -a --delete .github/instructions/ "$TARGET_GITHUB_DIR/instructions/"
  74. echo " ✓ instructions/"
  75. fi
  76. if [ -f ".github/copilot-instructions.md" ]; then
  77. cp .github/copilot-instructions.md "$TARGET_GITHUB_DIR/copilot-instructions.md"
  78. echo " ✓ copilot-instructions.md"
  79. fi
  80. if [ -f "AGENTS.md" ]; then
  81. cp AGENTS.md "$TARGET_GITHUB_DIR/AGENTS.md"
  82. echo " ✓ AGENTS.md"
  83. else
  84. echo " ⚠️ 未找到仓库根 AGENTS.md,已跳过"
  85. fi
  86. echo "cc-use-exp" > "$TARGET_GITHUB_DIR/instructions/.cc-use-exp-managed"
  87. echo ""
  88. echo "✅ 安装完成!"
  89. echo ""
  90. echo "📝 已同步配置到:"
  91. echo " - $TARGET_GITHUB_DIR/copilot-instructions.md"
  92. echo " - $TARGET_GITHUB_DIR/instructions/"
  93. echo " - $TARGET_GITHUB_DIR/AGENTS.md(若仓库存在)"
  94. echo ""
  95. echo "💡 提示:"
  96. echo " - 更新配置:重新运行此脚本"
  97. echo " - GitHub Copilot coding agent 会优先读取仓库内 AGENTS.md 与 .github/copilot-instructions.md"
  98. echo " - 若使用本机用户级兜底,可复用已同步到 $TARGET_GITHUB_DIR 的配置"
  99. echo ""
  100. echo "📖 文档:https://github.com/doccker/cc-use-exp"
tools/install-cursor.sh · Bundled script · 177 lines · 1 finding marked
  1. #!/bin/bash
  2. set -e
  3. # Cursor 一键安装脚本
  4. # 用法: bash <(curl -sL https://raw.githubusercontent.com/doccker/cc-use-exp/main/tools/install-cursor.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 5 on GitHub
  5. echo "=== cc-use-exp Cursor 安装器 ==="
  6. echo ""
  7. # 依赖检查
  8. check_dependencies() {
  9. local missing_deps=()
  10. if ! command -v git &> /dev/null; then
  11. missing_deps+=("git")
  12. fi
  13. if ! command -v rsync &> /dev/null; then
  14. missing_deps+=("rsync")
  15. fi
  16. if [ ${#missing_deps[@]} -ne 0 ]; then
  17. echo "❌ 缺少依赖:${missing_deps[*]}"
  18. echo ""
  19. echo "请先安装:"
  20. for dep in "${missing_deps[@]}"; do
  21. echo " - $dep"
  22. done
  23. exit 1
  24. fi
  25. }
  26. echo "🔍 检查依赖..."
  27. check_dependencies
  28. echo " ✓ git"
  29. echo " ✓ rsync"
  30. echo ""
  31. # 检查是否已安装
  32. INSTALL_DIR="$HOME/.cursor/.cc-use-exp"
  33. if [ -d "$INSTALL_DIR" ]; then
  34. echo "⚠️ 检测到已安装"
  35. echo ""
  36. echo "安装位置: $INSTALL_DIR"
  37. cd "$INSTALL_DIR"
  38. echo "当前版本: $(git log -1 --pretty=format:'%h - %s (%ar)' 2>/dev/null || echo '无法获取版本信息')"
  39. echo ""
  40. echo "是否更新到最新版本?(y/N)"
  41. read -r response
  42. if [[ ! "$response" =~ ^[Yy]$ ]]; then
  43. echo "❌ 取消安装"
  44. exit 0
  45. fi
  46. echo ""
  47. echo "🔄 更新现有安装..."
  48. if ! git pull origin main; then
  49. echo "❌ 更新失败,请检查网络连接或手动更新"
  50. exit 1
  51. fi
  52. else
  53. echo "📦 开始安装..."
  54. echo ""
  55. # 检查目录权限
  56. if [ ! -w "$HOME" ]; then
  57. echo "❌ 权限错误:无法写入 $HOME"
  58. exit 1
  59. fi
  60. # 创建父目录
  61. mkdir -p "$HOME/.cursor"
  62. # Clone 到 Cursor 配置目录
  63. if ! git clone https://github.com/doccker/cc-use-exp.git "$INSTALL_DIR"; then
  64. echo "❌ 克隆失败,请检查:"
  65. echo " 1. 网络连接是否正常"
  66. echo " 2. 是否可以访问 GitHub"
  67. echo " 3. 是否需要配置代理"
  68. exit 1
  69. fi
  70. cd "$INSTALL_DIR"
  71. echo " ✓ 仓库克隆完成"
  72. fi
  73. echo ""
  74. echo "🔧 同步配置到 Cursor..."
  75. # 执行同步脚本(只同步 Cursor 部分)
  76. if [ -f "./tools/sync-config.sh" ]; then
  77. # 提取 Cursor 同步逻辑
  78. CURSOR_SKILLS_DIR="$HOME/.cursor/skills"
  79. CURSOR_TEMPLATES_DIR="$HOME/.cursor/templates"
  80. CURSOR_RULES_DIR="$HOME/.cursor/rules"
  81. mkdir -p "$CURSOR_SKILLS_DIR"
  82. mkdir -p "$CURSOR_TEMPLATES_DIR"
  83. mkdir -p "$CURSOR_RULES_DIR"
  84. # 同步 skills
  85. if [ -d ".cursor/skills" ]; then
  86. rsync -a --delete .cursor/skills/ "$CURSOR_SKILLS_DIR/"
  87. echo " ✓ skills/"
  88. fi
  89. # 同步 commands(转换为 skills)
  90. if [ -d ".cursor/commands" ]; then
  91. for cmd_file in .cursor/commands/*.md; do
  92. if [ -f "$cmd_file" ]; then
  93. cmd_name=$(basename "$cmd_file" .md)
  94. cmd_skill_dir="$CURSOR_SKILLS_DIR/$cmd_name"
  95. mkdir -p "$cmd_skill_dir"
  96. cp "$cmd_file" "$cmd_skill_dir/SKILL.md"
  97. fi
  98. done
  99. echo " ✓ commands/ (转换为 skills)"
  100. fi
  101. # 同步 templates
  102. if [ -d ".cursor/templates" ]; then
  103. rsync -a --delete .cursor/templates/ "$CURSOR_TEMPLATES_DIR/"
  104. echo " ✓ templates/"
  105. fi
  106. # 同步 rules(兼容性补充)
  107. if [ -d ".cursor/rules" ]; then
  108. rsync -a .cursor/rules/ "$CURSOR_RULES_DIR/"
  109. echo " ✓ rules/ (兼容性补充)"
  110. fi
  111. # 创建 manifest 标记
  112. echo "cc-use-exp" > "$CURSOR_SKILLS_DIR/.cc-use-exp-managed"
  113. echo "cc-use-exp" > "$CURSOR_TEMPLATES_DIR/.cc-use-exp-managed"
  114. echo "cc-use-exp" > "$CURSOR_RULES_DIR/.cc-use-exp-managed"
  115. else
  116. echo "❌ 错误:找不到同步脚本"
  117. exit 1
  118. fi
  119. echo ""
  120. echo "✅ 安装完成!"
  121. echo ""
  122. echo "📝 已同步配置到:"
  123. echo " - $CURSOR_SKILLS_DIR"
  124. echo " - $CURSOR_TEMPLATES_DIR"
  125. echo " - $CURSOR_RULES_DIR"
  126. echo ""
  127. # 安装验证
  128. echo "🔍 验证安装..."
  129. verify_success=true
  130. if [ ! -d "$CURSOR_SKILLS_DIR" ] || [ -z "$(ls -A "$CURSOR_SKILLS_DIR" 2>/dev/null)" ]; then
  131. echo " ⚠️ skills/ 目录为空"
  132. verify_success=false
  133. fi
  134. if [ ! -d "$CURSOR_RULES_DIR" ] || [ -z "$(ls -A "$CURSOR_RULES_DIR" 2>/dev/null)" ]; then
  135. echo " ⚠️ rules/ 目录为空"
  136. verify_success=false
  137. fi
  138. if [ "$verify_success" = true ]; then
  139. echo " ✓ 配置文件完整"
  140. echo ""
  141. echo "🔄 请重启 Cursor 使配置生效"
  142. else
  143. echo ""
  144. echo "⚠️ 部分配置可能未同步成功,请检查上述目录"
  145. fi
  146. echo ""
  147. echo "💡 提示:"
  148. echo " - 更新配置:重新运行此脚本"
  149. echo " - 验证安装:在 Cursor Agent 中查看可用 skills"
  150. echo " - 卸载:删除 $INSTALL_DIR 和上述配置目录"
  151. echo ""
  152. echo "📖 文档:https://github.com/doccker/cc-use-exp"
tools/install-gemini.sh · Bundled script · 181 lines · 1 finding marked
  1. #!/bin/bash
  2. set -e
  3. # Gemini CLI 一键安装脚本
  4. # 用法: bash <(curl -sL https://raw.githubusercontent.com/doccker/cc-use-exp/main/tools/install-gemini.sh)
    • Note: Runs a downloaded script through process substitution (bash <(curl …))
    • Line 5 on GitHub
  5. echo "=== cc-use-exp Gemini CLI 安装器 ==="
  6. echo ""
  7. # 依赖检查
  8. check_dependencies() {
  9. local missing_deps=()
  10. if ! command -v git &> /dev/null; then
  11. missing_deps+=("git")
  12. fi
  13. if ! command -v rsync &> /dev/null; then
  14. missing_deps+=("rsync")
  15. fi
  16. if [ ${#missing_deps[@]} -ne 0 ]; then
  17. echo "❌ 缺少依赖:${missing_deps[*]}"
  18. echo ""
  19. echo "请先安装:"
  20. for dep in "${missing_deps[@]}"; do
  21. echo " - $dep"
  22. done
  23. exit 1
  24. fi
  25. }
  26. echo "🔍 检查依赖..."
  27. check_dependencies
  28. echo " ✓ git"
  29. echo " ✓ rsync"
  30. echo ""
  31. # 检查是否已安装
  32. INSTALL_DIR="$HOME/.gemini/.cc-use-exp"
  33. if [ -d "$INSTALL_DIR" ]; then
  34. echo "⚠️ 检测到已安装"
  35. echo ""
  36. echo "安装位置: $INSTALL_DIR"
  37. cd "$INSTALL_DIR"
  38. echo "当前版本: $(git log -1 --pretty=format:'%h - %s (%ar)' 2>/dev/null || echo '无法获取版本信息')"
  39. echo ""
  40. echo "是否更新到最新版本?(y/N)"
  41. read -r response
  42. if [[ ! "$response" =~ ^[Yy]$ ]]; then
  43. echo "❌ 取消安装"
  44. exit 0
  45. fi
  46. echo ""
  47. echo "🔄 更新现有安装..."
  48. if ! git pull origin main; then
  49. echo "❌ 更新失败,请检查网络连接或手动更新"
  50. exit 1
  51. fi
  52. else
  53. echo "📦 开始安装..."
  54. echo ""
  55. # 检查目录权限
  56. if [ ! -w "$HOME" ]; then
  57. echo "❌ 权限错误:无法写入 $HOME"
  58. exit 1
  59. fi
  60. # 创建父目录
  61. mkdir -p "$HOME/.gemini"
  62. # Clone 到 Gemini 配置目录
  63. if ! git clone https://github.com/doccker/cc-use-exp.git "$INSTALL_DIR"; then
  64. echo "❌ 克隆失败,请检查:"
  65. echo " 1. 网络连接是否正常"
  66. echo " 2. 是否可以访问 GitHub"
  67. echo " 3. 是否需要配置代理"
  68. exit 1
  69. fi
  70. cd "$INSTALL_DIR"
  71. echo " ✓ 仓库克隆完成"
  72. fi
  73. echo ""
  74. echo "🔧 同步配置到 Gemini CLI..."
  75. # 执行同步脚本(只同步 Gemini 部分)
  76. if [ -f "./tools/sync-config.sh" ]; then
  77. GEMINI_DIR="$HOME/.gemini"
  78. mkdir -p "$GEMINI_DIR/commands"
  79. mkdir -p "$GEMINI_DIR/skills"
  80. mkdir -p "$GEMINI_DIR/rules"
  81. mkdir -p "$GEMINI_DIR/policies"
  82. # 同步 commands
  83. if [ -d ".gemini/commands" ]; then
  84. rsync -a --delete .gemini/commands/ "$GEMINI_DIR/commands/"
  85. echo " ✓ commands/"
  86. fi
  87. # 同步 skills
  88. if [ -d ".gemini/skills" ]; then
  89. rsync -a --delete .gemini/skills/ "$GEMINI_DIR/skills/"
  90. echo " ✓ skills/"
  91. fi
  92. # 同步 rules
  93. if [ -d ".gemini/rules" ]; then
  94. rsync -a .gemini/rules/ "$GEMINI_DIR/rules/"
  95. echo " ✓ rules/"
  96. fi
  97. # 同步 policies
  98. if [ -d ".gemini/policies" ]; then
  99. rsync -a .gemini/policies/ "$GEMINI_DIR/policies/"
  100. echo " ✓ policies/"
  101. fi
  102. # 同步 GEMINI.md(如果不存在)
  103. if [ -f ".gemini/GEMINI.md" ] && [ ! -f "$GEMINI_DIR/GEMINI.md" ]; then
  104. cp .gemini/GEMINI.md "$GEMINI_DIR/GEMINI.md"
  105. echo " ✓ GEMINI.md"
  106. fi
  107. # 同步 settings.json(如果不存在)
  108. if [ -f ".gemini/settings.json" ] && [ ! -f "$GEMINI_DIR/settings.json" ]; then
  109. cp .gemini/settings.json "$GEMINI_DIR/settings.json"
  110. echo " ✓ settings.json"
  111. fi
  112. # 创建 manifest 标记
  113. echo "cc-use-exp" > "$GEMINI_DIR/commands/.cc-use-exp-managed"
  114. echo "cc-use-exp" > "$GEMINI_DIR/skills/.cc-use-exp-managed"
  115. echo "cc-use-exp" > "$GEMINI_DIR/rules/.cc-use-exp-managed"
  116. else
  117. echo "❌ 错误:找不到同步脚本"
  118. exit 1
  119. fi
  120. echo ""
  121. echo "✅ 安装完成!"
  122. echo ""
  123. echo "📝 已同步配置到:"
  124. echo " - $GEMINI_DIR/commands/"
  125. echo " - $GEMINI_DIR/skills/"
  126. echo " - $GEMINI_DIR/rules/"
  127. echo " - $GEMINI_DIR/policies/"
  128. echo ""
  129. # 安装验证
  130. echo "🔍 验证安装..."
  131. verify_success=true
  132. if [ ! -d "$GEMINI_DIR/skills" ] || [ -z "$(ls -A "$GEMINI_DIR/skills" 2>/dev/null)" ]; then
  133. echo " ⚠️ skills/ 目录为空"
  134. verify_success=false
  135. fi
  136. if [ ! -d "$GEMINI_DIR/rules" ] || [ -z "$(ls -A "$GEMINI_DIR/rules" 2>/dev/null)" ]; then
  137. echo " ⚠️ rules/ 目录为空"
  138. verify_success=false
  139. fi
  140. if [ "$verify_success" = true ]; then
  141. echo " ✓ 配置文件完整"
  142. echo ""
  143. echo "🔄 配置已生效,无需重启"
  144. else
  145. echo ""
  146. echo "⚠️ 部分配置可能未同步成功,请检查上述目录"
  147. fi
  148. echo ""
  149. echo "💡 提示:"
  150. echo " - 更新配置:重新运行此脚本"
  151. echo " - 验证安装:在 Gemini CLI 中执行 /skills list"
  152. echo " - 卸载:删除 $INSTALL_DIR 和上述配置目录"
  153. echo ""
  154. echo "📖 文档:https://github.com/doccker/cc-use-exp"

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.