# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## 项目概述 蚁熊公司内部 Claude Code Plugin Marketplace(技能市场)。开发者在此仓库中维护供全员安装使用的 Claude Code 插件(Plugin)和技能(Skill)。 ## 目录结构 ``` .claude-plugin/ └── marketplace.json # 市场索引:声明本仓库包含哪些插件 plugins/ └── / # 每个插件独占一个子目录 ├── .claude-plugin/ │ └── plugin.json # 插件元数据(name, description, version, author) └── skills/ └── / └── SKILL.md # 技能实现(frontmatter + Markdown 指令) ``` ## 核心文件格式 ### marketplace.json(市场索引) ```json { "name": "yixiong-claude-hub", "owner": { "name": "蚁熊团队" }, "description": "...", "plugins": [ { "name": "", "source": "./plugins/", "description": "..." } ] } ``` 每新增一个插件,必须在 `plugins` 数组中追加对应条目。 ### plugin.json(插件元数据) ```json { "name": "plugin-name", "description": "...", "author": { "name": "蚁熊团队" } } ``` **不设 `version` 字段**:Claude Code 自动用 git commit SHA 作为版本基准,每次推送 main 分支即为新版本,已安装用户会话启动时自动检测更新。 含 MCP Server 的插件额外支持 `userConfig`(用户敏感配置,存系统钥匙链)和 `mcpServers`(服务器声明),可在 headers 中用 `${user_config.KEY}` 引用用户配置。 ### SKILL.md(技能实现) ```markdown --- description: 一句话说明该技能的用途(Claude 用此判断何时触发该技能) --- 技能的具体指令内容… ``` `description` 字段是触发判据,务必精确描述使用场景,避免与其他技能产生歧义。 ## 新增插件流程 1. 在 `plugins/` 下创建目录 `plugins//` 2. 创建 `plugins//.claude-plugin/plugin.json` 3. 在 `plugins//skills//SKILL.md` 编写技能 4. 在 `.claude-plugin/marketplace.json` 的 `plugins` 数组中追加该插件条目 ## 已发布插件 | 插件 | 技能 | 说明 | |------|------|------| | `huanxi` | `/huanxi-shared` `/huanxi-report` `/huanxi-leader` `/huanxi-task` `/huanxi-weekly` `/huanxi-org` | 寰汐企业管理系统完整工作流,含 MCP Server 自动配置 | | `memcore` | `/memory-sync` `/memory-update` `/memory-lint` | 项目记忆体系核心引擎 | ### memcore 技能调用关系 ``` /memory-sync ← 总编排(11 phases),调用下面两个技能 ├── /memory-update ← 增量写入,可独立执行 └── /memory-lint ← 健康校验,可独立执行 ``` ## 记忆体系(会话启动必读) > 每次新会话或长会话压缩后,必须先读 `MEMORY.md` 索引再按需加载文件。代码与记忆冲突 → 以代码为准并更新记忆。 ### 读取流程 1. `cat .claude/memory/MEMORY.md` 获取清单 2. **必读**(type=`project`/`feedback`):decisions.md / feedback_plugin_dev.md / project_overview.md 3. **按需**(type=`lint`):lint_report.md ### 记忆目录骨架 ``` .claude/memory/ ├── MEMORY.md # 索引(入口) ├── decisions.md # 关键架构决策 ├── project_overview.md # 项目定位与结构 ├── feedback_plugin_dev.md # 插件开发协作规范 └── lint_report.md # 记忆健康检查报告(按需) ```