/load-profile
项目 Profile 加载规范 — 先形成语义意图种子与唯一目标,再按计划加载最小充分配置
$ npx -y skills add devcodex-labs/devcodex --skill load-profile --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/load-profile
Context preview
The summary Claude sees to decide when to auto-load this skill.
项目 Profile 加载规范 — 先形成语义意图种子与唯一目标,再按计划加载最小充分配置
SKILL.md
load-profile.SKILL.mdname: load-profile
description: 项目 Profile 加载规范 — 先形成语义意图种子与唯一目标,再按计划加载最小充分配置
Load Profile Skill
职责
在 `IntentSeedV1` 形成后,**独立确定目标项目 `<project>`**,再按 `ContextReadPlanV2`(兼容读取 `ContextReadPlanV1`)加载最小充分的项目配置(profile)。计划确定后的只读 Profile 与记忆查询可按并发策略执行。
必要来源形成 `ContextReadReceiptV2`(V1 兼容)后,必须把 Profile 结果交给“项目现实扩展”步骤,作为最终意图路由、产物落点和验证方式的输入。
如何确定 `<project>`
| 优先级 | 条件 | 结果 | |:------:|------|------| | 1 | 用户消息明确指定项目名称 | 直接使用 | | 2 | 消息涉及工作区目录(如 `vext/`、`ai-dev-guidelines/`) | 映射到项目名 | | 3 | 🔴 无法确定 | **必须先询问用户**:"当前请求关联哪个项目?"。在用户明确回复前,**禁止发起任何超出当前文件范围的工作区扫描**(`file_search` / `semantic_search` / `grep_search` / `list_dir` 调用与当前任务无关的、以及项目以外的 `read_file`)。`<project> = null` **不再是合法默认状态** |
> 🔴 **多项目工作区扫描禁令**(v1.9.8+):当 cwd 是 monorepo 根目录且未明确 `<project>` 时,AI 侧与 Hook 侧同步阐断扫描。豁免词:`workspace` / `monorepo` / `全工作区` / `all projects` / `所有项目`。详见 `lifecycle.cjs` `isMultiProjectWorkspace`。
工作区目录映射
| 工作区目录 | `<project>` | |-----------|------------| | `ai-dev-guidelines/` | `dev-docs` | | `devcodex/` | `devcodex` | | 其他目录 | 目录名(若 profile 存在) |
Profile 路径约定
默认兼容路径:
<项目根>/.devcodex/profile/
当 `<工作区根>/.devcodex/layout.json` 启用 `workspace-namespace` 时:
- `config.json`:`<工作区根>/.devcodex/workspace/profile/config.json` 作为 base,`<工作区根>/.devcodex/<project>/profile/config.json` 作为 overlay;Auto 精确别名全局默认 `@rocky`,可用 `extensions.devcodex.autoAliases` 替换全局默认别名(省略表示沿用默认,空数组表示关闭默认别名),也可在 `extensions.devcodex.concurrency` 配置 `ConcurrencyPolicy`
- `extensions.devcodex.concurrency` 缺省为 `mode=auto`:只读准备与隔离验证可按通道上限并行;`mode=serial` 表示全串行;项目只能追加 `locks.additionalSingleWriterScopes`,不得删除核心单写者域或开启并行 mutation
- `extensions.devcodex.git` 缺省投影为 `collaborationMode=unverified / branchPolicy=no-auto-branch / worktreePolicy=explicit-only / crossBranchIntegration=unverified / sharedActionsRequireExplicitAuthorization=true`;项目 overlay 可用证据收窄为 solo/team,但不得把共享动作显式授权降为 false
- Profile config 的对象层必须递归合并;project `extensions.devcodex.git` 只覆盖声明字段,不能因浅合并丢失 workspace 的授权边界、worktree policy 或其他 sibling 配置
- `config.local.json`:与 `config.json` 使用相同的 `workspace base + project overlay` 路径模型,可作为用户 / 项目指定的本地 overlay(长期连接、本地明文连接信息、env / secretRef 引用、`extensions.<namespace>`);脚本、测试、数据库 / SSH / MongoDB / 数据操作只有在用户或项目明确指定时才以它作为连接配置入口
- `README.md`、`01-项目信息.md`、`02-架构约束.md`、`03-代码风格.md`:项目命名空间文件优先,缺失回退到 `workspace/profile/`
- `<project>` 未确定时,禁止猜测项目命名空间
ProfileReadChainGate / ServiceNormCoverageGate
<!-- devcodex:include shared/profile/profile-read-chain.md -->
- 调用 `profile_context_plan`,以 canonical intent、changeTypes、risk、confidence 和明确 selector 生成 `ContextReadPlanV2`(V1 reader 保留);计划必须列出 baseline / selected / excluded / unclassified、base/project fallback 和实际 active-root。
- `ProfilePlanNoHiddenFullReadProbe` 必须证明计划阶段只返回 README/index、effective non-local config 与顶层 metadata inventory,没有预读 `01~09-*`、`config.local.json` 或其他 selected 正文。
- selected 正文通过 `profile_load({ project, files })` 定向读取;只有 contextEpoch / invocation `planId` / `planContentId` / activeRoot / source 精确关联且 `PostToolUse` 观察成功的 `ContextReadReceiptV2`(V1 兼容)才能证明加载完成。
- **ContextReadBindingGate(PF-149)**:`profile_load` / `profile_skill_plan` 与 memory query 应携带与当前 `ContextReadPlanV2` 一致的 `ContextReadBindingV1`(`contextEpoch` / `planId` / `planContentId` / `activeRoot` / `project`)。`bindingStatus=request-bound` 才可把相关源推进 relevant-complete;`legacy-unbound` 只能降级为 partial/unverified,**不得**宣称 Context Acquisition 已完整完成;`CONTEXT_BINDING_INVALID` / `CONTEXT_BINDING_MISMATCH` fail-closed。机器分类见 `scripts/lib/validate-context-read-controls.js`(`classifyContextReadBindingSample`)。
- `ContentIdentityReuseGate`:computation reuse 可跨进程复用有界解析/索引元数据,但仍须读取并返回当前任务需要的正文;delivery reuse 仅在同 host session、同 contextEpoch、同 planContentId、同 source identity 且当前模型的成功 body observation 可证时成立。cache hit 不能单独满足 receipt,旧 epoch receipt 只能作为 `reuseFrom`,不得改写成当前完成态。
- **硬预算(ABS-06 / PF-133)**:`profile_load` **禁止**无参默认真全量。省略 `files` 时必须 `explicitFull=true` + 非空 `fullReadReason`;否则返回 `PROFILE_LOAD_BUDGET` 错误与 inventory。定向 load 默认 `maxBytes=32768`(可调);`explicitFull` 默认更高字节上限仍可能 `truncated`。不得把无参全量成功当作 Context Acquisition 完成证据。
- `ProfileSectionSelectionGate`:文件已进入 plan.selected 后,可调用 `profile_load({ files, sectionSelectors })` 按完整 Markdown section 读取。selector 必须给出 `file / headingQueries / requiredQueries`,并显式选择 `includePreamble / includeDescendants / maxBytes`;多个标题必须分别定位、按源文件顺序拼接并对父子或重复范围去重,禁止按字符中途截断。
- `ProfileSectionLoadReceiptV1` 必须记录 full/selected bytes、source digest、matched/missing/ambiguous/deferred、completion 与 fallbackReason。普通显式 selector 在 required query 缺失或歧义、低置信、parser 不支持、required section 超预算时可兼容 `fallback-full`;`ProfileRouteLoadRecipeV2` 必须携带 `boundedOnly=true`,任何缺标题、歧义或预算不足都只能 fail closed 为 `partial` 并返回 `ProfileSectionRecoveryRecipeV1` / `ProfileRouteRecoveryRecipeV1`,不得退化为整文件。调用方补读 deferred 或完成分段恢复前,不得把 Context receipt 推进到 relevant-complete。
- `ContextReadPlanV2` 必须把 effective config 的优化模式封装为身份绑定的 `ExecutionOptimizationPlanBindingV1`,`profile_load` / `profile_skill_plan` 直接消费该绑定,禁止另读 `config.json`。绑定缺失、损坏或未知时 fail-closed 到 `full-only`,分别走完整 Profile 文件与 `full-skill-read`;这类 fallback 不能标记为渐进加载命中。
- 绑定只证明 config mode,不替代 feature lifecycle。Context computation、Profile section 与 Skill bundle 在消费绑定后还必须读取同一 active-root 的 `ExecutionOptimizationStateV2` 并形成 `ExecutionOptimizationFeatureDecisionV1`;对应 feature 为 `off / shadow / rolled-back / sunset` 或状态无效时,分别 bypass computation cache、清空 section selector、返回 `fallback-full / full-skill-read`,不得只在诊断输出里显示回滚。
- 全量升级必须记录 `fullReadReason`,仅限用户/项目明确要求、audit/migration、低置信或必要来源缺失;`config.local.json` 还须用户/项目明确指定,不能因文件存在自动读取。
- 覆盖 `.devcodex/<project>/profile` 读取链、`.devcodex/workspace/profile` 回退链和 sticky activeProject 生效边界;实质 identity / scope / action / risk / digest 漂移或 compact/resume 时重新规划。
- 复审服务 / 框架规范时列出全部服务集合、docs 自维护链、导航、版本、构建、报告和记忆消费者。
- 从单服务抽公共规范时同步执行 `StrongestProfileSourceGate` / `ServiceSpecificResidueSweep`,以最强 Profile 为基线并清扫服务化残留。
ProfileTruthReconciliationGate
Profile 加载只证明“声明已读取”,不能证明声明仍为当前真相。项目级 analyze / audit 在形成结论前必须执行
Read more
name: load-profile description: 项目 Profile 加载规范 — 先形成语义意图种子与唯一目标,再按计划加载最小充分配置
Load Profile Skill
职责
在 `IntentSeedV1` 形成后,**独立确定目标项目 `<project>`**,再按 `ContextReadPlanV2`(兼容读取 `ContextReadPlanV1`)加载最小充分的项目配置(profile)。计划确定后的只读 Profile 与记忆查询可按并发策略执行。
必要来源形成 `ContextReadReceiptV2`(V1 兼容)后,必须把 Profile 结果交给“项目现实扩展”步骤,作为最终意图路由、产物落点和验证方式的输入。
如何确定 `<project>`
| 优先级 | 条件 | 结果 | |:------:|------|------| | 1 | 用户消息明确指定项目名称 | 直接使用 | | 2 | 消息涉及工作区目录(如 `vext/`、`ai-dev-guidelines/`) | 映射到项目名 | | 3 | 🔴 无法确定 | **必须先询问用户**:"当前请求关联哪个项目?"。在用户明确回复前,**禁止发起任何超出当前文件范围的工作区扫描**(`file_search` / `semantic_search` / `grep_search` / `list_dir` 调用与当前任务无关的、以及项目以外的 `read_file`)。`<project> = null` **不再是合法默认状态** |
> 🔴 **多项目工作区扫描禁令**(v1.9.8+):当 cwd 是 monorepo 根目录且未明确 `<project>` 时,AI 侧与 Hook 侧同步阐断扫描。豁免词:`workspace` / `monorepo` / `全工作区` / `all projects` / `所有项目`。详见 `lifecycle.cjs` `isMultiProjectWorkspace`。
工作区目录映射
| 工作区目录 | `<project>` | |-----------|------------| | `ai-dev-guidelines/` | `dev-docs` | | `devcodex/` | `devcodex` | | 其他目录 | 目录名(若 profile 存在) |
Profile 路径约定
默认兼容路径:
<项目根>/.devcodex/profile/
当 `<工作区根>/.devcodex/layout.json` 启用 `workspace-namespace` 时:
- `config.json`:`<工作区根>/.devcodex/workspace/profile/config.json` 作为 base,`<工作区根>/.devcodex/<project>/profile/config.json` 作为 overlay;Auto 精确别名全局默认 `@rocky`,可用 `extensions.devcodex.autoAliases` 替换全局默认别名(省略表示沿用默认,空数组表示关闭默认别名),也可在 `extensions.devcodex.concurrency` 配置 `ConcurrencyPolicy`
- `extensions.devcodex.concurrency` 缺省为 `mode=auto`:只读准备与隔离验证可按通道上限并行;`mode=serial` 表示全串行;项目只能追加 `locks.additionalSingleWriterScopes`,不得删除核心单写者域或开启并行 mutation
- `extensions.devcodex.git` 缺省投影为 `collaborationMode=unverified / branchPolicy=no-auto-branch / worktreePolicy=explicit-only / crossBranchIntegration=unverified / sharedActionsRequireExplicitAuthorization=true`;项目 overlay 可用证据收窄为 solo/team,但不得把共享动作显式授权降为 false
- Profile config 的对象层必须递归合并;project `extensions.devcodex.git` 只覆盖声明字段,不能因浅合并丢失 workspace 的授权边界、worktree policy 或其他 sibling 配置
- `config.local.json`:与 `config.json` 使用相同的 `workspace base + project overlay` 路径模型,可作为用户 / 项目指定的本地 overlay(长期连接、本地明文连接信息、env / secretRef 引用、`extensions.<namespace>`);脚本、测试、数据库 / SSH / MongoDB / 数据操作只有在用户或项目明确指定时才以它作为连接配置入口
- `README.md`、`01-项目信息.md`、`02-架构约束.md`、`03-代码风格.md`:项目命名空间文件优先,缺失回退到 `workspace/profile/`
- `<project>` 未确定时,禁止猜测项目命名空间
ProfileReadChainGate / ServiceNormCoverageGate
<!-- devcodex:include shared/profile/profile-read-chain.md -->
- 调用 `profile_context_plan`,以 canonical intent、changeTypes、risk、confidence 和明确 selector 生成 `ContextReadPlanV2`(V1 reader 保留);计划必须列出 baseline / selected / excluded / unclassified、base/project fallback 和实际 active-root。
- `ProfilePlanNoHiddenFullReadProbe` 必须证明计划阶段只返回 README/index、effective non-local config 与顶层 metadata inventory,没有预读 `01~09-*`、`config.local.json` 或其他 selected 正文。
- selected 正文通过 `profile_load({ project, files })` 定向读取;只有 contextEpoch / invocation `planId` / `planContentId` / activeRoot / source 精确关联且 `PostToolUse` 观察成功的 `ContextReadReceiptV2`(V1 兼容)才能证明加载完成。
- **ContextReadBindingGate(PF-149)**:`profile_load` / `profile_skill_plan` 与 memory query 应携带与当前 `ContextReadPlanV2` 一致的 `ContextReadBindingV1`(`contextEpoch` / `planId` / `planContentId` / `activeRoot` / `project`)。`bindingStatus=request-bound` 才可把相关源推进 relevant-complete;`legacy-unbound` 只能降级为 partial/unverified,**不得**宣称 Context Acquisition 已完整完成;`CONTEXT_BINDING_INVALID` / `CONTEXT_BINDING_MISMATCH` fail-closed。机器分类见 `scripts/lib/validate-context-read-controls.js`(`classifyContextReadBindingSample`)。
- `ContentIdentityReuseGate`:computation reuse 可跨进程复用有界解析/索引元数据,但仍须读取并返回当前任务需要的正文;delivery reuse 仅在同 host session、同 contextEpoch、同 planContentId、同 source identity 且当前模型的成功 body observation 可证时成立。cache hit 不能单独满足 receipt,旧 epoch receipt 只能作为 `reuseFrom`,不得改写成当前完成态。
- **硬预算(ABS-06 / PF-133)**:`profile_load` **禁止**无参默认真全量。省略 `files` 时必须 `explicitFull=true` + 非空 `fullReadReason`;否则返回 `PROFILE_LOAD_BUDGET` 错误与 inventory。定向 load 默认 `maxBytes=32768`(可调);`explicitFull` 默认更高字节上限仍可能 `truncated`。不得把无参全量成功当作 Context Acquisition 完成证据。
- `ProfileSectionSelectionGate`:文件已进入 plan.selected 后,可调用 `profile_load({ files, sectionSelectors })` 按完整 Markdown section 读取。selector 必须给出 `file / headingQueries / requiredQueries`,并显式选择 `includePreamble / includeDescendants / maxBytes`;多个标题必须分别定位、按源文件顺序拼接并对父子或重复范围去重,禁止按字符中途截断。
- `ProfileSectionLoadReceiptV1` 必须记录 full/selected bytes、source digest、matched/missing/ambiguous/deferred、completion 与 fallbackReason。普通显式 selector 在 required query 缺失或歧义、低置信、parser 不支持、required section 超预算时可兼容 `fallback-full`;`ProfileRouteLoadRecipeV2` 必须携带 `boundedOnly=true`,任何缺标题、歧义或预算不足都只能 fail closed 为 `partial` 并返回 `ProfileSectionRecoveryRecipeV1` / `ProfileRouteRecoveryRecipeV1`,不得退化为整文件。调用方补读 deferred 或完成分段恢复前,不得把 Context receipt 推进到 relevant-complete。
- `ContextReadPlanV2` 必须把 effective config 的优化模式封装为身份绑定的 `ExecutionOptimizationPlanBindingV1`,`profile_load` / `profile_skill_plan` 直接消费该绑定,禁止另读 `config.json`。绑定缺失、损坏或未知时 fail-closed 到 `full-only`,分别走完整 Profile 文件与 `full-skill-read`;这类 fallback 不能标记为渐进加载命中。
- 绑定只证明 config mode,不替代 feature lifecycle。Context computation、Profile section 与 Skill bundle 在消费绑定后还必须读取同一 active-root 的 `ExecutionOptimizationStateV2` 并形成 `ExecutionOptimizationFeatureDecisionV1`;对应 feature 为 `off / shadow / rolled-back / sunset` 或状态无效时,分别 bypass computation cache、清空 section selector、返回 `fallback-full / full-skill-read`,不得只在诊断输出里显示回滚。
- 全量升级必须记录 `fullReadReason`,仅限用户/项目明确要求、audit/migration、低置信或必要来源缺失;`config.local.json` 还须用户/项目明确指定,不能因文件存在自动读取。
- 覆盖 `.devcodex/<project>/profile` 读取链、`.devcodex/workspace/profile` 回退链和 sticky activeProject 生效边界;实质 identity / scope / action / risk / digest 漂移或 compact/resume 时重新规划。
- 复审服务 / 框架规范时列出全部服务集合、docs 自维护链、导航、版本、构建、报告和记忆消费者。
- 从单服务抽公共规范时同步执行 `StrongestProfileSourceGate` / `ServiceSpecificResidueSweep`,以最强 Profile 为基线并清扫服务化残留。
ProfileTruthReconciliationGate
Profile 加载只证明“声明已读取”,不能证明声明仍为当前真相。项目级 analyze / audit 在形成结论前必须执行
Intent-driven AI coding workflow runtime for consistent context, skills, approvals, validation, and handoffs across six AI coding hosts.
Repo: devcodex-labs/devcodex
Other skills on devcodex.
ai-agent-system-archit…
AI Agent 系统架构专家 Owner — 当任务涉及 Agent 路由、工具调用、上下文管理、记忆、状态机、权限、人机协作、可观测性、回放验证或模型辅助治理时使用;要求把…
ai-evaluation-engineer…
AI 评测工程专家 Owner — 当任务涉及模型/Prompt 评测、模型选择、黄金集、评分量表、LLM-as-judge、Judge…

