🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@double-codeing/flow2spec

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@double-codeing/flow2spec - npm Package Compare versions

Comparing version
3.2.8
to
3.2.9
+19
-0
cli.js

@@ -30,2 +30,21 @@ #!/usr/bin/env node

if (pkg.name === "@double-codeing/flow2spec" && !process.env.FLOW2SPEC_SUPPRESS_MIGRATION_NOTICE) {
const RED = "\x1b[31m";
const YELLOW = "\x1b[33m";
const BOLD = "\x1b[1m";
const RESET = "\x1b[0m";
console.warn(`${RED}${BOLD}
╔══════════════════════════════════════════════════════════════════════╗
║ ⚠️ @double-codeing/flow2spec is DEPRECATED (typo in org name) ║
║ ║
║ Please migrate to @double-coding/flow2spec: ║
║ ║
║ ${YELLOW}npm uninstall -g @double-codeing/flow2spec${RED} ║
║ ${YELLOW}npm install -g @double-coding/flow2spec${RED} ║
║ ║
║ All future updates will be published under the new organization. ║
╚══════════════════════════════════════════════════════════════════════╝${RESET}
`);
}
const UPDATE_CHECK_TTL_MS = 24 * 60 * 60 * 1000;

@@ -32,0 +51,0 @@

+1
-1
{
"name": "@double-codeing/flow2spec",
"version": "3.2.8",
"version": "3.2.9",
"description": "在业务仓库初始化「文档驱动、可写回知识库」的 AI 协作骨架:项目根 .Knowledge 承载 stock-docs/req-docs 与机读路由,.cursor/.claude/.codex 写入 f2s-* 规则与技能(含 Karpathy 式编码行为准则,init 同步 rules / Codex topics / skills);init 只落结构与模板,业务内容由各 f2s-* 技能在对话中维护。",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/double-coding-lab/Flow2Spec#readme",

# Flow2Spec
> ## ⚠️ This package has moved
>
> **`@double-codeing/flow2spec` is deprecated** — the organization name had a typo.
>
> Future updates will be published on **`@double-coding/flow2spec`** (same code, correct org name).
>
> ```bash
> npm uninstall -g @double-codeing/flow2spec
> npm install -g @double-coding/flow2spec
> ```
>
> Or one-shot via npx:
>
> ```bash
> npx @double-coding/flow2spec@latest init
> ```
>
> This is the last release under `@double-codeing`. All future work will happen at [`@double-coding/flow2spec`](https://www.npmjs.com/package/@double-coding/flow2spec).
---
<p align="center">

@@ -4,0 +25,0 @@ <img src="./assets/readme/hero.svg" width="100%" alt="Flow2Spec routes a natural language coding request into compact project facts before code edits">

# Flow2Spec
> ## ⚠️ This package has moved
>
> **`@double-codeing/flow2spec` is deprecated** — the organization name had a typo.
>
> Future updates will be published on **`@double-coding/flow2spec`** (same code, correct org name).
>
> ```bash
> npm uninstall -g @double-codeing/flow2spec
> npm install -g @double-coding/flow2spec
> ```
>
> Or one-shot via npx:
>
> ```bash
> npx @double-coding/flow2spec@latest init
> ```
>
> This is the last release under `@double-codeing`. All future work will happen at [`@double-coding/flow2spec`](https://www.npmjs.com/package/@double-coding/flow2spec).
---
<p align="center">

@@ -4,0 +25,0 @@ <img src="./assets/readme/hero.svg" width="100%" alt="Flow2Spec routes a natural language coding request into compact project facts before code edits">

# Flow2Spec
> ## ⚠️ 本 npm 包已迁移
>
> **`@double-codeing/flow2spec` 已弃用**——组织名有拼写错误(`codeing` → `coding`)。
>
> 后续版本将发布在 **`@double-coding/flow2spec`**(代码相同,组织名正确)。
>
> ```bash
> npm uninstall -g @double-codeing/flow2spec
> npm install -g @double-coding/flow2spec
> ```
>
> 或直接 npx:
>
> ```bash
> npx @double-coding/flow2spec@latest init
> ```
>
> 这是 `@double-codeing` 组织下的最后一个版本;后续所有维护迁移到 [`@double-coding/flow2spec`](https://www.npmjs.com/package/@double-coding/flow2spec)。
---
<p align="center">

@@ -4,0 +25,0 @@ <img src="./assets/readme/hero-zh.svg" width="100%" alt="Flow2Spec 将自然语言编码需求路由到紧凑项目事实后再修改代码">

@@ -95,24 +95,29 @@ ---

### Step -1: Global flow2spec Version Preflight (Required, Before Everything, Foreground Probe by Main Agent)
### Step -1: Global flow2spec Version Preflight + Org Rename Migration (Required, Before Everything, Foreground Probe by Main Agent)
**Purpose**: prefer using the **already-installed global `flow2spec`** whenever possible. Only trigger a global upgrade when it is **missing** or **out of date**; when it is already at latest, **completely skip** any upgrade action. This also decides the **default form** of the step 2 command (whether to use `flow2spec init` or `npx @latest init`).
**Action**: before entering step 0, the main agent **sequentially runs 3 probes in the foreground** (all read-only, no side effects, seconds to return — no sub-agent needed):
> **📦 Org rename migration (auto-executed since 3.2.9)**: **The legacy `@double-codeing/flow2spec` is deprecated** (org name had a typo: `codeing` → `coding`). This step detects whether the local machine has the legacy-named global CLI installed and, if so, **automatically** runs `npm uninstall -g @double-codeing/flow2spec` + `npm install -g @double-coding/flow2spec@latest` to complete the migration — no user interaction required. **From here on all `npm view` / `npm i -g` / `npx` commands use the new package name `@double-coding/flow2spec`**.
**Action**: before entering step 0, the main agent **sequentially runs 4 probes in the foreground** (all read-only, no side effects, seconds to return — no sub-agent needed):
```bash
# 1. Probe whether flow2spec is installed globally on this machine
# 1. Probe whether flow2spec is installed globally on this machine (either org name counts)
flow2spec --version 2>/dev/null || echo __F2S_NOT_INSTALLED__
# 2. Query the latest version on npm (may fail on restricted networks — allowed)
npm view @double-codeing/flow2spec version 2>/dev/null || echo __F2S_NPM_UNREACHABLE__
# 3. (Backup) if step 1 returned __F2S_NOT_INSTALLED__, confirm npx is available
# 2. Determine whether the installed global uses the new or the legacy org name (drives migration)
npm ls -g --depth=0 --json 2>/dev/null | grep -oE '@double-cod[a-z]+/flow2spec' | head -1 || echo __F2S_ORG_UNKNOWN__
# 3. Query the latest version on npm (uses the **new** package name; may fail on restricted networks)
npm view @double-coding/flow2spec version 2>/dev/null || echo __F2S_NPM_UNREACHABLE__
# 4. (Backup) if step 1 returned __F2S_NOT_INSTALLED__, confirm npx is available
command -v npx >/dev/null 2>&1 && echo __NPX_OK__ || echo __NPX_MISSING__
```
**Three-way decision** (pick one branch based on the results; record it in this-turn context and use it to drive step 2 & step 5 summary):
**Four-way decision** (pick one branch based on the results; record it in this-turn context and use it to drive step 2 & step 5 summary):
| Case | Condition | Action | Default step 2 command |
| --- | --- | --- | --- |
| **A. Installed & on latest** | Step 1 returned version `V`, step 2 returned version `L`, and `V === L` | **Skip upgrade entirely** — no sub-agent, no `npm i -g` this turn | **`flow2spec init <agents...>`** (use global CLI) |
| **B. Installed but behind** | Step 1 returned `V`, step 2 returned `L`, and `V !== L` (`V < L` or semver-unequal) | **Dispatch an independent sub-agent (fire-and-forget)** to run `npm i -g @double-codeing/flow2spec@latest` in the background — no wait, no block. Current turn's step 2 still uses `npx @latest` to guarantee this session gets the latest template | **`npx @double-codeing/flow2spec@latest init <agents...>`** |
| **C. Not installed or latest unknown** | Step 1 hit `__F2S_NOT_INSTALLED__`, OR step 2 hit `__F2S_NPM_UNREACHABLE__` and step 1 also didn't return a version | If A doesn't hold and **not installed**: same as B — dispatch a sub-agent to `npm i -g ...@latest`. If step 2 failed but step 1 shows some installed version: treat as B without a way to compare to latest — **do not** dispatch an upgrade, just note "latest unknown, use npx conservatively" | **`npx @double-codeing/flow2spec@latest init <agents...>`** |
| **A. Installed new-org pkg & on latest** | Step 1 returned version `V`, step 2 returned `@double-coding/flow2spec`, step 3 returned version `L`, and `V === L` | **Skip upgrade entirely** — no sub-agent, no `npm i -g` this turn | **`flow2spec init <agents...>`** (use global CLI) |
| **B. Installed new-org pkg but behind** | Step 1 returned `V`, step 2 returned `@double-coding/flow2spec`, step 3 returned `L`, and `V !== L` (`V < L` or semver-unequal) | **Dispatch an independent sub-agent (fire-and-forget)** to run `npm i -g @double-coding/flow2spec@latest` in the background — no wait, no block. Current turn's step 2 still uses `npx @latest` to guarantee this session gets the latest template | **`npx @double-coding/flow2spec@latest init <agents...>`** |
| **C. Not installed or latest unknown** | Step 1 hit `__F2S_NOT_INSTALLED__`, OR step 3 hit `__F2S_NPM_UNREACHABLE__` and step 1 also didn't return a version | If "installed & on latest" doesn't hold and **not installed**: dispatch a sub-agent to `npm i -g @double-coding/flow2spec@latest`. If step 3 failed but step 1 shows some installed version: treat as B without a way to compare to latest — **do not** dispatch an upgrade, just note "latest unknown, use npx conservatively" | **`npx @double-coding/flow2spec@latest init <agents...>`** |
| **D. Installed legacy `@double-codeing` pkg (org rename migration)** | Step 2 returned `@double-codeing/flow2spec` (legacy org, extra `e` in `codeing`) | **Must** dispatch an independent sub-agent to **silently, in order** run:<br>1. `npm uninstall -g @double-codeing/flow2spec`<br>2. `npm install -g @double-coding/flow2spec@latest`<br>fire-and-forget, does not block the main flow; no user re-confirmation. **Current turn's step 2** uses `npx @double-coding/flow2spec@latest` so this session immediately gets the new-org latest template | **`npx @double-coding/flow2spec@latest init <agents...>`** |

@@ -122,5 +127,6 @@ **Orchestration (required)**:

- **Branch A**: main agent skips all upgrade actions and **does not** dispatch a sub-agent; step 2's default is `flow2spec init`.
- **Branch B / C**: only when an upgrade is actually needed (missing or behind), dispatch an **independent sub-agent** fire-and-forget to run `npm i -g @double-codeing/flow2spec@latest`; **do not wait**, **do not block** the main flow. Success/failure does not enter the SKILL summary conclusion. This sub-agent dispatch is **mandatory** and **not subject to** `flow2spec.config.json.subAgent` (a one-off global npm install is not a business split).
- **Branch B / C**: only when an upgrade is actually needed (missing or behind), dispatch an **independent sub-agent** fire-and-forget to run `npm i -g @double-coding/flow2spec@latest`; **do not wait**, **do not block** the main flow. Success/failure does not enter the SKILL summary conclusion. This sub-agent dispatch is **mandatory** and **not subject to** `flow2spec.config.json.subAgent` (a one-off global npm install is not a business split).
- **Branch D (org rename migration, since 3.2.9)**: **must** dispatch an independent sub-agent to silently run `uninstall` → `install` in order — do not give the user a re-confirmation prompt (avoid "let me think" blocking the migration). Only mention "org rename migration completed" in the summary after the fact. If either `uninstall` or `install` fails (restricted network, insufficient permission), **do not block** the main flow — the summary lists the failure reason plus the full manual commands the user can run. This sub-agent dispatch is **mandatory** and **not subject to** `flow2spec.config.json.subAgent`.
- **Write permission**: the sub-agent only runs that shell command and **does not** touch any project file (`.Knowledge`, `manifest-routing.json`, `index.md`, etc.). Write-permission constraints remain unchanged.
- **Probe failure fallback**: if all 3 probes fail (no shell permission, extremely restricted env), treat as branch C and use `npx @latest`; alternatively, skip step -1 entirely and rely on `cli.js`'s `maybeAutoUpdateGlobalInstall()` tail fallback.
- **Probe failure fallback**: if all 4 probes fail (no shell permission, extremely restricted env), treat as branch C and use `npx @double-coding/flow2spec@latest`; alternatively, skip step -1 entirely and rely on `cli.js`'s `maybeAutoUpdateGlobalInstall()` tail fallback.

@@ -168,3 +174,3 @@ **Relation to cli.js**:

2. **Step -1 returned B/C (missing / behind / latest unknown)**: fetch npm latest (**guarantees this session gets the latest template**):
- `npx @double-codeing/flow2spec@latest init <agents...>`
- `npx @double-coding/flow2spec@latest init <agents...>`
3. For overwrite reset:

@@ -301,3 +307,3 @@ - Append `--reset-knowledge` to the above command.

- **Step -1 global version preflight**: branch (`A Installed & on latest (upgrade skipped) / B Installed but behind (sub-agent dispatched to upgrade) / C Missing or latest unknown (dispatched / advised)`) + current global version + npm latest (if obtained)
- **Step -1 global version preflight**: branch (`A Installed new-org pkg & on latest (upgrade skipped) / B Installed new-org pkg but behind (sub-agent dispatched to upgrade) / C Missing or latest unknown (dispatched / advised) / D Installed old-org @double-codeing pkg (sub-agent silently uninstalled old + installed new — org rename migration done)`) + current global version + npm latest (if obtained)
- Executed command (including agents and whether reset was used)

@@ -321,3 +327,3 @@ - Whether it succeeded

- **Step -1 global version preflight**: `A Installed & on latest (upgrade skipped) / B Installed but behind (sub-agent dispatched to run npm i -g in background) / C Missing or latest unknown (dispatched / conservative npx)`; current version=`<V>`, latest=`<L or unknown>`
- **Step -1 global version preflight**: `A Installed new-org pkg & on latest (upgrade skipped) / B Installed new-org pkg but behind (sub-agent dispatched to run npm i -g in background) / C Missing or latest unknown (dispatched / conservative npx) / D Installed old-org @double-codeing pkg (sub-agent uninstalled old + installed new)`; current version=`<V>`, latest=`<L or unknown>`
- Command run inside this skill: `<actual flow2spec init ... or npx @latest init ...>`

@@ -354,3 +360,3 @@ - init mode: `incremental` / `overwrite reset (--reset-knowledge)`

1. **Step -1** was performed: before entering step 0, **3 foreground probes** were run sequentially (`flow2spec --version` / `npm view ... version` / `npx` availability) and one of the A/B/C branches was determined. Only under B/C did an **independent sub-agent** get dispatched to run `npm i -g @double-codeing/flow2spec@latest` in the background (fire-and-forget); under A **no upgrade action** was dispatched. Step 2's default command form was chosen accordingly (A → `flow2spec init`, B/C → `npx @latest init`); the summary clearly states the branch and version comparison.
1. **Step -1** was performed: before entering step 0, **4 foreground probes** were run sequentially (`flow2spec --version` / `npm ls -g` for org / `npm view ... version` / `npx` availability) and one of the A/B/C/D branches was determined. Only under B/C did an **independent sub-agent** get dispatched to run `npm i -g @double-coding/flow2spec@latest` in the background (fire-and-forget); under A **no upgrade action** was dispatched. Step 2's default command form was chosen accordingly (A → `flow2spec init`, B/C → `npx @latest init`); the summary clearly states the branch and version comparison.
2. **Step 0** was performed: V1 did not skip migrate, and **current repositories (V2+)** did not incorrectly run migrate.

@@ -357,0 +363,0 @@ 3. **Before step 2** recorded the project-side `projectRev` (`projectRev`), and **after step 2 `init`** re-read `pkgRev` and executed **step 2c** judgment.

@@ -95,24 +95,29 @@ ---

### 步骤 -1:全局 flow2spec 版本预检(必须,先于一切,主 agent 前台探测)
### 步骤 -1:全局 flow2spec 版本预检 + 组织名迁移(必须,先于一切,主 agent 前台探测)
**目的**:让「能用全局 `flow2spec` 就用全局」,只在**没装**或**版本过旧**时才动手升级;已装且已是 latest 时**完全跳过**升级动作,同时决定步骤 2 命令的**默认形态**(用 `flow2spec init` 还是 `npx @latest init`)。
**动作**:主 agent 在进入步骤 0 **之前**,**顺序、前台**执行以下 3 条探测(都是纯查询,无副作用,秒级返回;无需拆子 agent):
> **📦 组织名迁移(3.2.9 起自动执行)**:**旧包 `@double-codeing/flow2spec` 已弃用**(组织名拼写错误:`codeing` → `coding`)。本步骤会检测本机是否装着旧包名的全局 CLI,若是则**自动**执行 `npm uninstall -g @double-codeing/flow2spec` + `npm install -g @double-coding/flow2spec@latest` 完成迁移,用户无需干预。**从下一步起所有 `npm view` / `npm i -g` / `npx` 命令均使用新包名 `@double-coding/flow2spec`**。
**动作**:主 agent 在进入步骤 0 **之前**,**顺序、前台**执行以下 4 条探测(都是纯查询,无副作用,秒级返回;无需拆子 agent):
```bash
# 1. 探测本机全局是否装了 flow2spec
# 1. 探测本机全局是否装了 flow2spec(新旧包名都算)
flow2spec --version 2>/dev/null || echo __F2S_NOT_INSTALLED__
# 2. 查询 npm 上 latest 版本号(网络受限时可能失败,允许失败)
npm view @double-codeing/flow2spec version 2>/dev/null || echo __F2S_NPM_UNREACHABLE__
# 3. (备用)若第 1 步返回 __F2S_NOT_INSTALLED__,用来确认 npx 可用
# 2. 判断当前全局装的是新包名还是旧包名(决定是否需要顺手迁移)
npm ls -g --depth=0 --json 2>/dev/null | grep -oE '@double-cod[a-z]+/flow2spec' | head -1 || echo __F2S_ORG_UNKNOWN__
# 3. 查询 npm 上 latest 版本号(用**新包名**查,网络受限时可能失败)
npm view @double-coding/flow2spec version 2>/dev/null || echo __F2S_NPM_UNREACHABLE__
# 4. (备用)若第 1 步返回 __F2S_NOT_INSTALLED__,用来确认 npx 可用
command -v npx >/dev/null 2>&1 && echo __NPX_OK__ || echo __NPX_MISSING__
```
**判定 3 分支**(按结果选一条,写入本轮上下文并影响步骤 2 与步骤 5 摘要):
**判定 4 分支**(按结果选一条,写入本轮上下文并影响步骤 2 与步骤 5 摘要):
| 情况 | 判定条件 | 行动 | 步骤 2 命令默认形态 |
| --- | --- | --- | --- |
| **A. 已装且是 latest** | 第 1 步返回版本号 `V`,第 2 步返回版本号 `L`,且 `V === L` | **完全跳过升级**,本轮不派子 agent、不跑 `npm i -g` | **`flow2spec init <agents...>`**(用全局) |
| **B. 已装但落后** | 第 1 步返回版本号 `V`,第 2 步返回版本号 `L`,且 `V !== L`(`V < L` 或 semver 不等) | **派独立子 agent 后台跑** `npm i -g @double-codeing/flow2spec@latest`(fire-and-forget,不等待,不阻塞主流程);本轮步骤 2 仍用 `npx @latest` 保证本次拿到 latest 模板 | **`npx @double-codeing/flow2spec@latest init <agents...>`** |
| **C. 未装 or 版本无法确认** | 第 1 步命中 `__F2S_NOT_INSTALLED__`,或第 2 步命中 `__F2S_NPM_UNREACHABLE__` 且第 1 步也未拿到版本号 | 若 A 情况「已装 latest」不成立且**未装**:派独立子 agent 后台跑 `npm i -g ...@latest`(同 B);若第 2 步失败但第 1 步已装某版本:视作 B 且无法比对 latest,**不派**升级、仅提示「latest 未知,保守用 npx」 | **`npx @double-codeing/flow2spec@latest init <agents...>`** |
| **A. 已装新包名且是 latest** | 第 1 步返回版本号 `V`,第 2 步返回 `@double-coding/flow2spec`,第 3 步返回版本号 `L`,且 `V === L` | **完全跳过升级**,本轮不派子 agent、不跑 `npm i -g` | **`flow2spec init <agents...>`**(用全局) |
| **B. 已装新包名但版本落后** | 第 1 步返回版本号 `V`,第 2 步返回 `@double-coding/flow2spec`,第 3 步返回版本号 `L`,且 `V !== L`(`V < L` 或 semver 不等) | **派独立子 agent 后台跑** `npm i -g @double-coding/flow2spec@latest`(fire-and-forget,不等待,不阻塞主流程);本轮步骤 2 仍用 `npx @latest` 保证本次拿到 latest 模板 | **`npx @double-coding/flow2spec@latest init <agents...>`** |
| **C. 未装 or 版本无法确认** | 第 1 步命中 `__F2S_NOT_INSTALLED__`,或第 3 步命中 `__F2S_NPM_UNREACHABLE__` 且第 1 步也未拿到版本号 | 若「已装 latest」不成立且**未装**:派独立子 agent 后台跑 `npm i -g @double-coding/flow2spec@latest`;若第 3 步失败但第 1 步已装某版本:视作 B 且无法比对 latest,**不派**升级、仅提示「latest 未知,保守用 npx」 | **`npx @double-coding/flow2spec@latest init <agents...>`** |
| **D. 已装旧包名 `@double-codeing`(组织名迁移)** | 第 2 步返回 `@double-codeing/flow2spec`(旧组织名,`codeing` 多了 `e`) | **必须**派独立子 agent **静默、按顺序**执行:<br>1. `npm uninstall -g @double-codeing/flow2spec`<br>2. `npm install -g @double-coding/flow2spec@latest`<br>fire-and-forget,不阻塞主流程;无需用户二次确认。**本轮步骤 2** 用 `npx @double-coding/flow2spec@latest` 保证立即拿到新包名的 latest 模板 | **`npx @double-coding/flow2spec@latest init <agents...>`** |

@@ -122,5 +127,6 @@ **编排(必须)**:

- **A 分支**:主 agent 直接跳过所有升级动作,**不派**子 agent;本轮步骤 2 命令首选 `flow2spec init`。
- **B / C 分支**:若确需升级(未装或版本落后),派**独立子 agent** fire-and-forget 执行 `npm i -g @double-codeing/flow2spec@latest`,**不等待完成**、**不阻塞**主流程;成败均不进入 SKILL 结论。该派子**强制**执行,**不受** `flow2spec.config.json.subAgent` 字段约束(全局 npm 装包不属业务拆分范畴)。
- **B / C 分支**:若确需升级(未装或版本落后),派**独立子 agent** fire-and-forget 执行 `npm i -g @double-coding/flow2spec@latest`,**不等待完成**、**不阻塞**主流程;成败均不进入 SKILL 结论。该派子**强制**执行,**不受** `flow2spec.config.json.subAgent` 字段约束(全局 npm 装包不属业务拆分范畴)。
- **D 分支(组织名迁移,3.2.9 起)**:**必须**派独立子 agent **静默**按顺序跑 `uninstall` → `install`,不给用户二次确认机会(避免"我先想想"卡住迁移);仅在摘要里事后告知「已完成组织名迁移」。若 uninstall 或 install 任一步失败(网络受限、权限不足),**不阻塞主流程**,摘要中列出失败原因与用户可手动执行的完整命令。该派子**强制**执行,**不受** `flow2spec.config.json.subAgent` 字段约束。
- **写权**:子 agent 仅执行该 shell,**不**触碰 `.Knowledge` / `manifest-routing.json` / `index.md` 等任何项目文件;写权硬约束不变。
- **探测失败兜底**:若 3 条探测全部失败(无 shell 权限、极端受限环境),按 C 分支处理并用 `npx @latest`;此时也可以直接放弃步骤 -1、把升级留给 `cli.js` 的 `maybeAutoUpdateGlobalInstall()` 收尾兜底。
- **探测失败兜底**:若 4 条探测全部失败(无 shell 权限、极端受限环境),按 C 分支处理并用 `npx @double-coding/flow2spec@latest`;此时也可以直接放弃步骤 -1、把升级留给 `cli.js` 的 `maybeAutoUpdateGlobalInstall()` 收尾兜底。

@@ -131,2 +137,3 @@ **与 cli.js 的关系**:

### 步骤 0:版本判定与分流(必须,先于 init)

@@ -169,3 +176,3 @@

2. **步骤 -1 判定为 B/C(未装 / 落后 / latest 未知)**:拉 npm latest 跑(**保证本次拿到最新模板**):
- `npx @double-codeing/flow2spec@latest init <agents...>`
- `npx @double-coding/flow2spec@latest init <agents...>`
3. 覆盖重置时:

@@ -302,3 +309,3 @@ - 在上述命令末尾追加 `--reset-knowledge`

- **步骤 -1 全局版本预检**:分支结论(`A 已装且是 latest(跳过升级) / B 已装但落后(已派子 agent 后台升级) / C 未装或 latest 未知(已派或提示)`)+ 当前全局版本 + npm latest 版本(若拿到)
- **步骤 -1 全局版本预检**:分支结论(`A 已装新包且是 latest(跳过升级) / B 已装新包但落后(已派子 agent 后台升级) / C 未装或 latest 未知(已派或提示) / D 已装旧组织名 @double-codeing(已派子 agent 静默卸旧装新完成组织名迁移)`)+ 当前全局版本 + npm latest 版本(若拿到)
- 执行命令(含 agent 与是否 reset)

@@ -322,3 +329,3 @@ - 是否成功

- **步骤 -1 全局版本预检**:`A 已装且是 latest(跳过升级) / B 已装但落后(已派子 agent 后台升级 npm i -g) / C 未装或 latest 未知(已派 / 保守用 npx)`;当前版本=`<V>`,latest=`<L 或 未知>`
- **步骤 -1 全局版本预检**:`A 已装新包且是 latest(跳过升级) / B 已装新包但落后(已派子 agent 后台升级 npm i -g) / C 未装或 latest 未知(已派 / 保守用 npx) / D 已装旧组织名 @double-codeing(已派子 agent 卸旧装新)`;当前版本=`<V>`,latest=`<L 或 未知>`
- 本技能内代跑命令:`<实际执行的 flow2spec init ... 或 npx @latest init ...>`

@@ -355,3 +362,3 @@ - init 模式:`增量` / `覆盖重置(--reset-knowledge)`

1. 是否已做 **步骤 -1**:在进入步骤 0 前**已顺序前台执行 3 条探测**(`flow2spec --version` / `npm view ... version` / `npx` 可用性),并按 A/B/C 分支得出结论;仅在 B/C 时才**派独立子 agent**后台跑 `npm i -g @double-codeing/flow2spec@latest`(不等待),A 分支**未派**任何升级动作;步骤 2 命令默认形态是否随分支选定(A→`flow2spec init`,B/C→`npx @latest init`);摘要中已写清分支与版本对比。
1. 是否已做 **步骤 -1**:在进入步骤 0 前**已顺序前台执行 4 条探测**(`flow2spec --version` / `npm ls -g` 判组织 / `npm view ... version` / `npx` 可用性),并按 A/B/C/D 分支得出结论;仅在 B/C 时才**派独立子 agent**后台跑 `npm i -g @double-coding/flow2spec@latest`(不等待),D 分支时**必须**派子跑 `uninstall @double-codeing/flow2spec` + `install @double-coding/flow2spec@latest` 完成组织名迁移,A 分支**未派**任何升级动作;步骤 2 命令默认形态是否随分支选定(A→`flow2spec init`,B/C→`npx @latest init`);摘要中已写清分支与版本对比。
2. 是否已做 **步骤 0**:V1 未跳过 migrate、**现行库(V2+)** 未误跑 migrate。

@@ -358,0 +365,0 @@ 3. 是否在 **步骤 2 开始前** 记录了项目侧 `projectRev`(`projectRev`),并在 **步骤 2 的 `init` 之后** 重读 `pkgRev`、执行 **步骤 2c** 判定。