用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/devcodex-labs/devcodex --skill host-instruction-projection命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | host-instruction-projection |
| description | 宿主指令投影 Owner — 从统一 instructions 真相源确定性生成精简 Host Kernel、薄包装、覆盖回执与完整回退 |
当任务涉及 always-on instructions 体积、Copilot/Codex/Claude/Gemini/Grok 规则加载、宿主入口文件、生成式规则投影、重复指令碰撞或完整规范回退时,本 Skill 是唯一 Owner。
本 Skill 只负责 instructions.md → projection config → generated host projections → coverage receipt → deployment descriptors。它不替代 intent、cp-gate、load-profile、spec-governance 或 host-contract-verification 的执行正文,也不把派生文件升级成第二规范真相源。
确定性实现位于 scripts/lib/host-instruction-projection.js,生成配置位于 scripts/host-instruction-projection.json,派生产物位于 host-projections/。
| 场景 | 是否触发 |
|---|---|
修改 instructions.md 中 S/C、路由、CP、Context、治理或闭环语义 | 必须 |
| 修改宿主入口文件、安装路径或 deployment descriptor | 必须 |
| 新增/调整 Copilot、Claude、Codex、Gemini、Grok、Cursor surface | 必须 |
| 调整 always-on 指令预算或 full fallback | 必须 |
| 仅修改按需 Skill 正文且不触达投影锚点 | N/A + skipReason |
投影链固定为:
instructions.md → mandatory rule parser → semantic replay groups → HostKernelV1 → thin wrappers → HostInstructionCoverageReceiptV1。
instructions.md 是唯一规范真相源;配置只声明抽取规则、语义锚点、宿主包装与预算。--check、负向 mutation 和 staged/post-commit freshness 缺一不可。host-projections/*;发现漂移时重新生成,不能在派生文件上补规则。| 产物 | 预算 |
|---|---|
| shared/Copilot kernel | ≤ 16 KiB 且 ≤ 200 行 |
| Claude/Gemini wrapper | ≤ 2 KiB |
| 相同完整 kernel 重复入口 | 0 |
预算超限、覆盖不完整或碰撞时,投影状态必须为 full-fallback,不得把部分 kernel 标成可用。性能优化不能降低安全、CP、恢复、治理或 ECR 语义。
| Surface | always-on | 按需/回退 |
|---|---|---|
| Copilot | .github/copilot-instructions.md(Copilot projection) | .github/skills + .agents/devcodex/instructions.full.md |
| Codex | AGENTS.md(shared kernel) | .agents/skills + .agents/devcodex/instructions.full.md |
| Claude | CLAUDE.md(仅导入 @AGENTS.md 的薄包装) | .claude/skills + full fallback |
| Gemini | GEMINI.md(导入 @AGENTS.md 的薄包装) | .agents/skills + full fallback |
| Grok | 独立 project-portable 安装使用原生 AGENTS.md;workspace 根原生读取共享 kernel;workspace 子 Git 项目用 devcodex grok 官方 --rules launcher 绑定同一 kernel | workspace 插件提供 resolver Skill、Hook/MCP bridge;官方用户级本地插件登记绑定 workspace source owner,配置只维护 enabled 状态 |
wrapper 只允许宿主能力提示和 shared kernel 指针;不得复制完整规则。Grok 不创建 .grok/rules 规范副本。
每次生成、安装、更新、状态检查、诊断或卸载宿主 adapter 前必须先形成 HostAdapterScopeV1:
| scope | owner / activation | 子项目默认产物 |
|---|---|---|
workspace-native | workspace root / ancestor 或宿主原生工作区发现 | 0 |
user-registered-workspace | workspace root / 官方用户级本地插件登记 + 配置 enabled 状态 | 0 |
project-portable | 显式 project root / repo-shared project discovery | 按显式选择生成 |
<workspace-root>/.grok/devcodex/plugins/devcodex-workspace,只由官方 user installation 暴露一个插件 identity;旧 .grok/plugins/devcodex-workspace 仅作可逆迁移输入。插件只含 metadata、thin resolver、Hook/MCP bridge;不得复制完整 kernel 或 Skill 树。plugin install/update/uninstall 管理用户级本地插件登记,登记的 source_path 必须指回 workspace owner,安装副本 digest 必须一致;官方命令导致的配置格式化必须恢复为调用前原始字节。UserPromptSubmit 不得声明或模拟上下文注入。工作区根依赖原生 AGENTS.md;子 Git 项目需要 full 证据时使用 devcodex grok,由官方 --rules 绑定同一 kernel。plain child 仅可保持 Skill-discovery / partial 口径。project-portable 必须由显式参数选择,其产物应是可共享、manifest 管理的项目能力;不能靠 .gitignore 隐藏。uninstall --host grok 只移除官方用户安装与精确受管 config 项,必须保留 workspace plugin source、未知配置和其他插件;重复卸载幂等。portable 项目资产不得借此静默删除。[plugins].enabled、plugin hooks 的 GROK_PLUGIN_ROOT、passive Hook stdout ignored、官方 --rules 与 grok inspect --json;变更前重新核验时效性。UserPromptSubmit / Stop / PreCompact 只允许 passive 观测或运行态维护;PreToolUse 才能按 Grok 顶层 {decision, reason} 契约形成阻断。任何 passive stdout 都不能作为 kernel evidence。grok 必须从 workspace root 与 child project 两个 cwd direct 验证 plugin identity,并分别记录 root native kernel 与 child Skill-discovery 上限;工作区外必须 no-op。devcodex grok launcher 必须先按官方 --cwd 解析最终 cwd/owner,在 workspace root 校验原生 kernel 存在,并仅在子 Git 项目追加同一 kernel;合并用户额外 --rules,拒绝 system prompt override 与重复 cwd 冲突,并以 headless direct replay 证明 launcher-rules。不得用 launcher 结果升级 plain child 结论,也不得从父 workspace 借用缺失的子 workspace kernel。完整源固定部署到 .agents/devcodex/instructions.full.md,且不位于任一宿主自动规则目录。以下任一情况必须使用或建议读取 full fallback:
full fallback 是兼容/故障路径,不得与 kernel 同时作为两个 always-on 完整副本加载。
devcodex grok 的 SkillRoute bootstrap 必须明确 active,才允许物化 GrokPrivateTempOwnerV1 prompt snapshot 并 spawn child;bootstrap error/inactive 分别返回 GROK_FULL_BOOTSTRAP_ERROR / GROK_FULL_BOOTSTRAP_INACTIVE,且 promptMaterialized=0、spawnCount=0。plain Grok 继续保持 Partial,不能用 SessionStart fallback 冒充 Full bootstrap。grok/plugins/devcodex-workspace/lib/private-temp-contract.cjs 的 schema/identity/path guard;installed plugin 不得反向 require source-only 文件,诊断 owner record 不保存 prompt body。GrokSessionPrivateOwnerV1 nonce owner root;sessionId 缺失也必须保持唯一。owner token、host/PID、path containment、TTL 与 state 任一不可验证都 fail closed;仅 expired + dead owner 可进入恢复,live/unknown owner 不得抢占或清理。碰撞检查至少记录:path / surface / role / digest / bytes / lines / sourceDigest / cwd / projectRoot。
init --host 遇到未授权的现有冲突入口时返回 HOST_INSTRUCTION_COLLISION;update --host 通过显式 force 路线更新。instruction-backed/unverified,不得凭 fixture 升级 enforced。--host <copilot|claude|codex|gemini|grok|cursor|all>。--claude、--codex 保留;--gemini、--grok、--cursor 为等价 alias。GlobalOnlyWorkspaceCleanModeV1 下,bare init/update 只维护 .devcodex,不部署任何 workspace 宿主 adapter;用户级 global-adapters apply 默认部署六宿主。legacy project projection 仍只有 copilot+claude+codex+gemini+grok 五类工作区 surface,Cursor 必须保持零业务 workspace .cursor 产物。CLI_HOST_SELECTION_CONFLICT;未知 host 使用 CLI_HOST_UNSUPPORTED。--host all install/update 时,所有非 portable target/manifest owner 必须解析为 workspace root;Grok uninstall 与 status/doctor 也消费相同 scope identity。uninstall 不删除 workspace source。node scripts/generate-host-instruction-projections.js --check。node scripts/test-host-instruction-projection.js:规则缺失、锚点 mutation、预算回退、重复内容碰撞、派生新鲜度。node scripts/test-host-adapters.js:Gemini/Grok/Cursor event 与输出映射。node scripts/test-cli-command-registry.js 与 host install fixture:默认兼容、六 host、aliases、unknown/conflict、dry-run、collision、two-cwd、Cursor workspace 零产物,以及 Grok uninstall/repeat/reinstall 配置保真。grok plugin validate grok/plugins/devcodex-workspace + workspace/project/outside grok inspect --json;无 direct 的宿主保持 UNVERIFIED。node scripts/run-validation.js --route full --no-cache、package/Profile/deploy、staged freshness 与 post-commit clean replay。任一 correctness、coverage、碰撞或 direct evidence 失败:
full-fallback;instructions.md reader;AGENTS.md/.grok/.codex/.claude/.gemini,或让读写/诊断使用不同作用域解析器。