@c4a/context-cli 0.7.20 → 0.7.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +6 -6
  2. package/README.zh-CN.md +6 -6
  3. package/cli.js +667 -651
  4. package/indexers/contracts/profile-contract.json +245 -245
  5. package/indexers/release-manifest.json +1 -1
  6. package/package.json +12 -12
  7. package/plugins/VERSION +1 -1
  8. package/plugins/claude/.claude-plugin/plugin.json +1 -1
  9. package/plugins/claude/commands/context.md +77 -6
  10. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  11. package/plugins/codex/skills/context/SKILL.md +77 -6
  12. package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
  13. package/plugins/cursor/commands/c4a-context.md +77 -6
  14. package/plugins/skills/context/SKILL.md +77 -6
  15. package/providers/context/codes.yaml +1 -1
  16. package/providers/context/graphs/indexer.yaml +11 -7
  17. package/providers/context/graphs/workspace.yaml +5 -0
  18. package/providers/context/manifest.json +30 -30
  19. package/providers/context/provider.yaml +1 -1
  20. package/providers/context/resources/manuals/guides/knowledge-updates.md +5 -1
  21. package/providers/context/resources/manuals/guides/workspace-prepare.md +4 -0
  22. package/providers/context/resources/manuals/guides/workspace-restore.md +5 -1
  23. package/providers/context/resources/procedures/knowledge-review.md +11 -4
  24. package/providers/context/resources/procedures/knowledge-updates.md +5 -1
  25. package/providers/context/resources/procedures/package-output.md +4 -0
  26. package/providers/context/resources/procedures/production-requirements.md +5 -3
  27. package/providers/context/resources/procedures/source-boundary.md +15 -5
  28. package/providers/context/resources/procedures/work-start-report.md +19 -6
  29. package/providers/context/resources/procedures/workspace-prepare.md +4 -0
  30. package/providers/context/resources/procedures/workspace-restore.md +5 -1
  31. package/providers/context/skills/resolve-current-indexer-gate/SKILL.md +7 -2
  32. package/providers/context/skills/run-indexer-lifecycle/SKILL.md +3 -2
  33. package/providers/context/skills/work-production-stage/SKILL.md +5 -3
package/README.md CHANGED
@@ -20,18 +20,18 @@ an LLM itself.
20
20
  npm install -g @c4a/context-cli@latest
21
21
  context plugin install # global installation
22
22
  # Alternatively, install only in a repository:
23
- context plugin install --local /path/to/repo
23
+ context plugin install --local /path/to/repo --agent auto-detect
24
24
  ```
25
25
 
26
- `--local <path>` requires an explicit path without global configuration changes. Omit `--agent` to detect Claude Code, Cursor and Codex executables on PATH (including `cursor-agent`), plus Cursor/Codex in standard macOS Applications directories. Only detected hosts are installed under the repository's `.claude`, `.cursor`, or `.agents`. If none are detected, only `.agents/skills` is installed with a user hint. Stale configuration directories are not detection evidence; discovery does not verify runtime loading. Omitting `--local` keeps global installation.
26
+ `--local` requires explicit `--agent`: `claude`, `cursor`, `codex`, `all`, `auto-detect`, or `standalone`. The path is a repository root: explicit hosts install into `.claude`, `.cursor`, or `.agents` without detection. `all` installs all three. Only `auto-detect` checks existing `.claude`, `.cursor`, and `.agents` directories in the target repository, never PATH or installed desktop applications; it falls back to `.agents/skills` when none exist. `standalone` instead writes all skills directly to `<path>/skills`, with no commands or host subdirectory. All modes support `--dry-run` and preserve global configuration.
27
27
 
28
- Automatic mode accepts a repository root; paths ending in `.claude`, `.cursor`, or `.agents` use their parent as the root. Explicit `--agent` still uses the exact supplied host directory below; `--agent all` is not accepted with `--local`.
28
+ Migration from 0.7.20: add `--agent auto-detect` to bare `--local`; for explicit hosts pass the repository root, not its host directory. Global installation is unchanged. Host detection does not verify runtime loading.
29
29
 
30
30
  | Command | Local layout |
31
31
  | --- | --- |
32
- | `context plugin install --local /path/to/repo/.claude --agent claude` | Public entries in `commands/`, other skills in `skills/`; internal skills receive `user-invocable: false`, without duplicate entry skills |
33
- | `context plugin install --local /path/to/repo/.cursor --agent cursor` | Bundled `c4a-*` commands plus other skills; hiding Providers from the command menu is not guaranteed |
34
- | `context plugin install --local /path/to/repo/.agents --agent codex` | All entries remain skills; bundled `agents/openai.yaml` policies are preserved; no unsupported `commands/` directory |
32
+ | `context plugin install --local /path/to/repo --agent claude` | Public entries in `commands/`, other skills in `skills/`; internal skills receive `user-invocable: false`, without duplicate entry skills |
33
+ | `context plugin install --local /path/to/repo --agent cursor` | Bundled `c4a-*` commands plus other skills; hiding Providers from the command menu is not guaranteed |
34
+ | `context plugin install --local /path/to/repo --agent codex` | All entries remain skills; bundled `agents/openai.yaml` policies are preserved; no unsupported `commands/` directory |
35
35
 
36
36
  Local entries have no plugin namespace; the host must discover the destination. Use `--dry-run` to preview. Refresh only replaces unmodified managed content; unrelated files remain and conflicting/customized entries are rejected. Choose a fresh host directory when switching from a standalone installation to command entries, to avoid duplicates. `plugin status` still inspects global hosts only. Invocation metadata is not a CLI permission or security boundary.
37
37
 
package/README.zh-CN.md CHANGED
@@ -16,18 +16,18 @@
16
16
  npm install -g @c4a/context-cli@latest
17
17
  context plugin install # 全局安装
18
18
  # 或者,只安装到仓库:
19
- context plugin install --local /path/to/repo
19
+ context plugin install --local /path/to/repo --agent auto-detect
20
20
  ```
21
21
 
22
- `--local <路径>` 必须显式指定路径,不注册全局插件、不修改用户级配置。省略 `--agent` 时探测 PATH 中的 Claude Code、Cursor、Codex(Cursor 也检查 `cursor-agent`;macOS 另检查标准 Applications 目录中的 Cursor/Codex),安装检测到的宿主到仓库下的 `.claude`、`.cursor`、`.agents`。均未检测到时,仅安装 `.agents/skills` 并输出提示。不根据遗留配置目录判断已安装;探测不代表已验证宿主加载技能。
22
+ `--local` 必须显式搭配 `--agent`:`claude`、`cursor`、`codex`、`all`、`auto-detect` `standalone`。路径为仓库根;指定宿主直接写入对应 `.claude`、`.cursor`、`.agents` 子目录,不检测是否安装宿主。`all` 全装;只有 `auto-detect` 检测目标仓库已有的 `.claude`、`.cursor`、`.agents` 目录,不检测 PATH 或桌面应用;均不存在时兜底 `.agents/skills`。`standalone` 则直接写入 `<path>/skills`,不生成 commands 或宿主子目录。均支持 `--dry-run`,不改全局配置。
23
23
 
24
- 自动模式传仓库根路径;若末尾为 `.claude`、`.cursor` `.agents`,以其父目录为根,不嵌套宿主目录。显式指定单一 `--agent` 时仍以传入路径为精确目标,见下表(不接受 `--agent all`)。不传 `--local` 保持全局安装。
24
+ 0.7.20 迁移:裸 `--local` 补充 `--agent auto-detect`;指定宿主时传仓库根,不再传宿主目录。全局安装不变。自动探测不代表宿主已加载,安装后需刷新宿主。
25
25
 
26
26
  | 命令 | 局部目录与行为 |
27
27
  | --- | --- |
28
- | `context plugin install --local /path/to/repo/.claude --agent claude` | `commands/` 放公开入口;`skills/` 放其他技能,内部技能设置 `user-invocable: false`,不重复安装入口 Skill |
29
- | `context plugin install --local /path/to/repo/.cursor --agent cursor` | `commands/` 使用随包的 `c4a-*` 命令;`skills/` 放其他技能,不保证隐藏 Provider 的菜单入口 |
30
- | `context plugin install --local /path/to/repo/.agents --agent codex` | 全部入口保留为 skills,保留随包的 `agents/openai.yaml` 调用策略,不生成无效的 `commands/` |
28
+ | `context plugin install --local /path/to/repo --agent claude` | `commands/` 放公开入口;`skills/` 放其他技能,内部技能设置 `user-invocable: false`,不重复安装入口 Skill |
29
+ | `context plugin install --local /path/to/repo --agent cursor` | `commands/` 使用随包的 `c4a-*` 命令;`skills/` 放其他技能,不保证隐藏 Provider 的菜单入口 |
30
+ | `context plugin install --local /path/to/repo --agent codex` | 全部入口保留为 skills,保留随包的 `agents/openai.yaml` 调用策略,不生成无效的 `commands/` |
31
31
 
32
32
  宿主必须支持发现目标位置。局部入口没有插件命名空间。`--dry-run` 只预览;重复安装仅刷新本命令管理且未被修改的内容,保留无关文件;同名自定义内容或本地修改会报冲突。已有通用 skills 目录切换为 command 宿主时,请选择新目录,避免重复入口。`plugin status` 仍只检查全局宿主状态。调用元数据控制宿主入口展示/自动调用,不是 CLI 权限或安全隔离。
33
33