refactor(template): generalize project config for lab members
- Stop tracking settings.local.json; commit base settings.json instead - Scope file permissions to workspace/ and .claude/ as safer default - Add .gitignore entries for .claude runtime files (scheduled_tasks, keybindings) - Annotate _LINK_MAP in init.py as user-customizable - Strip personal references from workspace CLAUDE.md template
This commit is contained in:
@@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"enabledPlugins": {
|
||||||
|
"superpowers@claude-plugins-official": true
|
||||||
|
},
|
||||||
|
"enableAllProjectMcpServers": true,
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Bash(python *)",
|
||||||
|
"Bash(python3 *)",
|
||||||
|
"Bash(uv *)",
|
||||||
|
"Bash(pip *)",
|
||||||
|
"Bash(pytest *)",
|
||||||
|
"Bash(ruff *)",
|
||||||
|
"Bash(black *)",
|
||||||
|
"Bash(git status *)",
|
||||||
|
"Bash(git add *)",
|
||||||
|
"Bash(git diff *)",
|
||||||
|
"Bash(git log *)",
|
||||||
|
"Bash(git commit *)",
|
||||||
|
"Bash(git push:*)",
|
||||||
|
"Bash(git pull *)",
|
||||||
|
"Bash(git fetch *)",
|
||||||
|
"Bash(git checkout *)",
|
||||||
|
"Bash(git branch *)",
|
||||||
|
"Bash(ls *)",
|
||||||
|
"Bash(mkdir *)",
|
||||||
|
"Bash(cp *)",
|
||||||
|
"Bash(mv *)",
|
||||||
|
"Bash(rm *)",
|
||||||
|
"Bash(find *)",
|
||||||
|
"Bash(grep *)",
|
||||||
|
"Bash(make *)",
|
||||||
|
"Bash(npx *)",
|
||||||
|
"Bash(node *)",
|
||||||
|
"Bash(npm *)",
|
||||||
|
"Bash(echo *)",
|
||||||
|
"Bash(gh *)",
|
||||||
|
"Bash(env)",
|
||||||
|
"WebSearch",
|
||||||
|
"Read(workspace/**/*)",
|
||||||
|
"Write(workspace/**/*)",
|
||||||
|
"Edit(workspace/**/*)",
|
||||||
|
"Read(.claude/**/*)",
|
||||||
|
"Write(.claude/**/*)",
|
||||||
|
"Edit(.claude/**/*)"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
-2
@@ -20,8 +20,10 @@ build/
|
|||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
# Project runtime
|
# Project runtime — commit base settings.json, ignore local overrides and runtime state
|
||||||
.claude/
|
.claude/settings.local.json
|
||||||
|
.claude/scheduled_tasks.json
|
||||||
|
.claude/keybindings.json
|
||||||
.obsidian/
|
.obsidian/
|
||||||
|
|
||||||
# MCP configs and temp artifacts
|
# MCP configs and temp artifacts
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ console = Console()
|
|||||||
stderr_console = Console(stderr=True)
|
stderr_console = Console(stderr=True)
|
||||||
|
|
||||||
# Link name -> list of environment variable names to try, in order.
|
# Link name -> list of environment variable names to try, in order.
|
||||||
|
#
|
||||||
|
# Customize this dict for your own projects. Each entry creates a symlink
|
||||||
|
# from workspace/<name> to the target path resolved from one of the env vars.
|
||||||
|
# Users define the corresponding env vars in their shell config (e.g. ~/.zshrc).
|
||||||
_LINK_MAP: dict[str, list[str]] = {
|
_LINK_MAP: dict[str, list[str]] = {
|
||||||
"myacademia": ["path_myacademia"],
|
"myacademia": ["path_myacademia"],
|
||||||
"myslides": ["path_myslides", "MYSLIDES_ROOT"],
|
"myslides": ["path_myslides", "MYSLIDES_ROOT"],
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
- **风格**: 简洁直接,不说废话
|
- **风格**: 简洁直接,不说废话
|
||||||
- **解释**: 关键部分详细,熟悉内容简洁
|
- **解释**: 关键部分详细,熟悉内容简洁
|
||||||
- **代码**: PEP8 + Black,需要类型注解
|
- **代码**: PEP8 + Black,需要类型注解
|
||||||
|
- **测试**: 高度重视
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -32,11 +33,6 @@
|
|||||||
|
|
||||||
### 知识检索
|
### 知识检索
|
||||||
|
|
||||||
使用 `metamemory` skill 或 `mm` CLI:
|
|
||||||
- `mm search <query>` - 搜索已有记忆
|
|
||||||
- `mm list` - 列出所有文档
|
|
||||||
- `mm folders` - 浏览文件夹结构
|
|
||||||
|
|
||||||
查询资料时直接用 `Grep`/`Read` 工具。
|
查询资料时直接用 `Grep`/`Read` 工具。
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -45,91 +41,26 @@
|
|||||||
|
|
||||||
```
|
```
|
||||||
workspace/
|
workspace/
|
||||||
├── .obsidian/ # Obsidian 配置
|
├── .claude/ # Claude Code 配置
|
||||||
├── myacademia -> ... # → Obsidian/iCloud 知识库 (符号链接)
|
├── .obsidian/ # Obsidian 配置(可选)
|
||||||
├── myagent -> ... # → myagent 项目 (符号链接)
|
├── .git/ # git 仓库
|
||||||
├── mydesktop -> ... # → Obsidian/iCloud 过程/共享文件 (符号链接)
|
├── CLAUDE.md # 本文件(个人助理配置)
|
||||||
├── myslides -> ... # → Slidev 幻灯片 (符号链接)
|
├── tmp/ # 临时文件
|
||||||
├── mytoolkit -> ... # → 个人 CLI 工具集 (符号链接)
|
└── ... # 按需添加项目目录或符号链接
|
||||||
├── mywebpage -> ... # → Docusaurus 网站 (符号链接)
|
|
||||||
├── scripts/ # 实用脚本
|
|
||||||
└── tmp/ # 临时文件
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**符号链接配置**:
|
可按需创建符号链接指向常用目录(如文献库、项目目录等),方便 Claude 快速访问。
|
||||||
根据实际环境创建符号链接,目标路径因人而异。例如:
|
|
||||||
- `myacademia` → Obsidian/iCloud 知识库路径
|
|
||||||
- `mydesktop` → Obsidian/iCloud 过程文件路径
|
|
||||||
- `myagent` → myagent 项目路径
|
|
||||||
- `myslides` → Slidev 幻灯片路径
|
|
||||||
- `mytoolkit` → 个人 CLI 工具集路径
|
|
||||||
- `mywebpage` → Docusaurus 网站路径
|
|
||||||
|
|
||||||
**重要路径**:
|
|
||||||
- `myacademia/` - Obsidian 知识库
|
|
||||||
- `mydesktop/` - Obsidian/iCloud 过程/共享文件
|
|
||||||
- `myagent/` - myagent 项目目录
|
|
||||||
- `myslides/` - Slidev 幻灯片项目
|
|
||||||
- `mytoolkit/` - 个人 CLI 工具集(PDF、图片、LaTeX 等)
|
|
||||||
- `mywebpage/` - Docusaurus 网站项目
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 4. 临时文件管理
|
## 4. 临时文件管理
|
||||||
|
|
||||||
- **截图/下载** 默认写入 `tmp/`,避免污染项目根目录
|
- **截图/下载** 默认写入 `tmp/`,避免污染根目录
|
||||||
- Playwright MCP 截图时务必指定 `filename="tmp/xxx.png"`(cwd 为 workspace/)
|
|
||||||
- 定期清理 `tmp/` 中过期的临时文件
|
- 定期清理 `tmp/` 中过期的临时文件
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 5. 文件系统管辖与主动搜索
|
## 5. 沟通风格
|
||||||
|
|
||||||
### 管辖原则
|
|
||||||
**全文件系统可管理**。具体目录结构以 `metamemory` 中的"文件系统知识库"文档为准,CLAUDE.md 不硬编码路径。
|
|
||||||
|
|
||||||
### 主动搜索协议
|
|
||||||
当用户提及文件、合同、报告等时:
|
|
||||||
1. **优先查知识库**:先用 `mm search` 查 metamemory 中已记录的目录结构,定位可能位置
|
|
||||||
2. **动态搜索**:在知识库提示的范围内用 `Glob`/`Grep` 按名称、日期、内容关键词搜索
|
|
||||||
3. **模糊匹配**:支持关键词部分匹配(如"成都理工" → `*成都*`, `*理工*`)
|
|
||||||
4. **结果汇报**:列出候选文件路径、修改时间,供用户确认
|
|
||||||
5. **兜底**:确实找不到时,询问是否需要创建或从其他来源获取
|
|
||||||
|
|
||||||
### 知识库同步
|
|
||||||
每次 `file-manager` 整理后,读取操作日志并同步更新 `metamemory` 中的"文件系统知识库"文档,确保 wiki 与物理文件系统一致。禁止在 CLAUDE.md 中硬编码具体路径。
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 6. 记忆机制
|
|
||||||
|
|
||||||
使用 `metamemory`(`mm` CLI)跨会话持久化信息:
|
|
||||||
|
|
||||||
### 写入
|
|
||||||
```bash
|
|
||||||
# 创建文档(推荐用 stdin)
|
|
||||||
echo '# 内容' | mm create "标题" --tags "user,feedback" --by "myclaude"
|
|
||||||
|
|
||||||
# 创建文件夹
|
|
||||||
mm mkdir "myclaude"
|
|
||||||
```
|
|
||||||
|
|
||||||
### 读取
|
|
||||||
```bash
|
|
||||||
mm search <query> # 搜索
|
|
||||||
mm list # 列出文档
|
|
||||||
mm get <doc_id> # 按 ID 获取
|
|
||||||
mm path </folder/doc> # 按路径获取
|
|
||||||
```
|
|
||||||
|
|
||||||
### 触发条件
|
|
||||||
- 用户说"记住"/"记下来"/"以后默认..."
|
|
||||||
- 用户纠正行为或偏好
|
|
||||||
- 发现重要的项目事实/约定
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 7. 沟通风格
|
|
||||||
|
|
||||||
- **简洁**: 不说废话
|
- **简洁**: 不说废话
|
||||||
- **透明**: 复杂任务同步进度
|
- **透明**: 复杂任务同步进度
|
||||||
@@ -142,7 +73,7 @@ mm path </folder/doc> # 按路径获取
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 8. 指令优先级
|
## 6. 指令优先级
|
||||||
|
|
||||||
1. **明确指令** > 默认规则
|
1. **明确指令** > 默认规则
|
||||||
2. **当前对话上下文** > 历史记忆
|
2. **当前对话上下文** > 历史记忆
|
||||||
|
|||||||
Reference in New Issue
Block a user