cm-init skillA
cm-init is agent-read markdown (skill) from kingxiaozhe/cm-workflow: 用户说“第一次接管这个项目”“分析仓库并生成项目规则”时使用。分析已有代码并生成 Codex AGENTS.md 与 CM/Claude 兼容规则;仅适用于非空存量项目,不创建脚手架、不承接普通代码修改。.
Indexed from public GitHub and served as immutable, content-addressed versions. Install it pinned to an exact SHA-256 with the mdr CLI, and every file is verified against the hash recorded here before it reaches your agent. The deterministic audit below grades the latest version, and the same file always earns the same grade.
What the file says
# cm-init — 项目上下文初始化
执行前读取 `../../runtime/project-context.md`。Codex 入口为 `$cm-init`;Claude Code 跨平台入口为 `/cm-init`,macOS/Linux 另有历史别名 `/cm:init`。
你是一个项目配置初始化助手。在当前项目生成 Codex 原生 `AGENTS.md`,并维护 `.claude/` 兼容配置。两套文档不得分别编造相互冲突的项目事实。
## JS 只读准入
在读取项目内容、运行命令、调用 codebase-context 或生成任何文件之前,先执行:
```bash
node "{CM_WORKFLOW_ROOT}/scripts/cm-init-entry.mjs" \
--skill-dir "{CM_WORKFLOW_ROOT}/skills/cm-init" --project "{CODE_PROJECT}"
```
该 JS 结果是本入口唯一的前置分类:`blocked / existing_project_required` 时按下方“空目录检测”
提示后停止;`ready` 直接进入后续项目分析,不得再因缺少项目描述文件或 `src/` 目录将纯 prompt、
文档或配置仓库重判为空项目。返回的 `executionAuthorized: false` 和 `writeAuthorized: false` 不得改写,
项目读取、命令探测、codebase-context 和规则写入仍分别由后文约束授权。本入口不判断技术栈、
版本控制、业务地图或待生成文件,也不替代生成前机械核验。
## 空目录检测(前置)
JS 准入返回 `blocked / existing_project_required`(项目根除 `.git`、`.DS_Store` 外没有内容)→
**本命令不适用,不自行搭脚手架**。提示用户:
> "这是空目录——$cm-init 服务于已有项目。全新项目请走 0→1 分支:建 specs 文件夹放入需求文档后运行 `$cm-prd {specs路径}`,那里会基于需求推荐架构与脚手架(含团队首选 better-t-stack),脚手架与规范生成都由 bootstrap 任务完成。"
## 执行步骤
用户要继续一次中断的初始化时,准入后先按 [JS 宿主恢复](references/js-host.md#中断后恢复) 检查该次私有会话记录或已审档案;不先重跑分析、地图或生成。记录缺失/归属不明则说明缺口,不能猜选另一轮或声称恢复成功。
### 1. 项目分析清单
…Read the whole file at its exact version.
How to install
mdr add kingxiaozhe/cm-workflow/cm-init@git:20260917.8e7a8edmdr add kingxiaozhe/cm-workflow/cm-init@sha256:4b69e2a2fa14676ePin to a label to follow the author's releases, or to a sha256 to freeze the exact bytes forever. Either way the resolved hash is written to mdr.lock, and mdr install reproduces it on any machine.
[](https://markdownregistry.com/a/art_k4dhbfxwoaidlip2)
1 badge views in 30 days
Versions
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20260917.8e7a8ed latest | 2026-09-17 | 8e7a8ed | 13,550 B | A | view · diff |
| git:20260917.100626f | 2026-09-17 | 100626f | 14,596 B | A | view · diff |
| git:20260909.60f88dd | 2026-09-09 | 60f88dd | 12,609 B | A | view · diff |
| git:20260906.ac01bfb | 2026-09-06 | ac01bfb | 10,886 B | A | view · diff |
| git:20260730.bdbd28e | 2026-07-30 | bdbd28e | 9,976 B | A | view |
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (13550 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
kingxiaozhe/cm-workflow · 29 stars · license MIT · pushed 2026-09-24 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_k4dhbfxwoaidlip2 GET https://markdownregistry.com/api/v1/resolve?ref=kingxiaozhe/cm-workflow/cm-init GET https://markdownregistry.com/api/v1/blob/4b69e2a2fa14676e3aa105729ba3dccc9f54053b2876cad0af1bf66e344bd7ec
Your agent does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.