Awesome Cohub
EN
实践卡intermediatecohub.bp.user-config-and-rules7 min

何时用

希望个人 Agent 默认(规则、skills、prompts)跨 Space 生效,而不是每个项目重贴。

对照

Home Space(v2.66+)config SpaceProject Space
Identity通常 slug=homename === "config"你的工作线名称
Job个人配置 + 落点个人配置(旧方案)真实产品工作
On Save白名单 → /configs/user白名单 → /configs/user仅普通 Checkpoint
Sandbox viewHome 自身的 /workspace;发布树在其他 Space 显示为 /configs/user同样发布,source: "config-space"普通 /workspace
Uniqueness每用户一个每用户一个(旧配置)多个

个人配置从 Home(v2.66+)或名为 config 的 Space 发布。随意项目 Space 里的 skills 永远不会变成账户级配置;已有 name=config Space 仍是普通 Space,所以只选一个来源。

结果

  • 一个个人配置 Space:Home 或 名为 config 的 Space(不要两边都用)
  • AGENTS.md / .agents/skills / allowed .cohub bits live there
  • After Save, other Spaces’ agents pick up User Context + user skills
  • Settings → User Rules reflects published AGENTS.md (GET /api/me/rules)

发布白名单

Only these paths copy out of the config Space workspace on Save:

AGENTS.md
CLAUDE.md
.agents/          # skills, prompts, agent extras
.cohub/           # models.json, generations, etc. as used by platform caches

Everything else in that Space is normal workspace content — not auto-published as user config.

步骤

  1. 选择个人配置来源:Home Space,或一个 name 恰好为 config 的 Space(不是随便起个像 config 的 slug)。
  2. 个人默认放这里:AGENTS.md、.agents/skills/…、需要的 .cohub/…。
  3. User Rules 保持短而稳;项目法写在项目 Space 的 AGENTS.md。
  4. 对该 Space 存档(Save) → 触发用户配置发布。
  5. 到任意项目沙箱检查 /configs/user 与 skills。
  6. Chat 里确认 /skill: 与 User Rules 已生效。
  7. 改配置 = 改 config Space 再 Save;不要在业务 Space 里改 /configs/user(只读)。

优先级(Agent)

When building system prompt / skills:

platform  →  mods  →  user config  →  current workspace
  • Skills with the same name: later wins (workspace overrides user overrides mod overrides platform).
  • User Context (AGENTS.md from config) is applied as user-specific instructions when present.
  • Project AGENTS.md remains project-specific context — use it for repo law, not personal taste dumps.

安全与协作

  • Config publish is owner-scoped. Don’t treat /configs/user as a shared team wiki.
  • Non-owner actors should not rely on seeing your personal skill paths; owner config is not a substitute for Mods when sharing with a team.
  • No symlinks in published config (publish rejects them).
  • Secrets: prefer Space env / secret surfaces; don’t park tokens in published AGENTS.md.

接口线索

# User Rules (published AGENTS.md)
# GET /api/me/rules → { content, updatedAt, source: "config-space", path: "/configs/user/AGENTS.md" }

# Sandbox env
# USER_AGENTS_DIR=/configs/user/.agents
# PLATFORM_AGENTS_DIR=/configs/platform/.agents

UI: Settings → User Rules 从 Home 或 config 流程编辑/发布个人规则(source 为 home-space 或 config-space)。

完成标准

  • [ ] 只有一个个人配置来源(Home 或 name=config)
  • [ ] Save 成功且没有 409 duplicate-config
  • [ ] /configs/user/AGENTS.md visible in a project sandbox after publish
  • [ ] Personal skill appears in discovery and runs
  • [ ] Project rules still live in project Space, not only in user config

推荐默认 skill

Web search: install hyper-search into this config Space (not a random project), then Save:

npx skills add https://github.com/kjx-talesofai/claude-skill-hyper-search \
  --skill hyper-search --agent codex --yes --copy

See search-layers.

别这样做

  • 误以为 name=config Space 与 Home 共享同一份配置(它们不会;只选一个)
  • Putting team-shared kits only in user config (use Mod instead)
  • Editing /configs/user inside a project sandbox (read-only mount)
  • Giant User Rules that fight every project’s AGENTS.md
  • Multiple Spaces named config

另见:.cohub 分层与优先级 · 实践卡。