Sign In

@double-coding/flow2spec

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@double-coding/flow2spec - npm Package Compare versions

Comparing version
3.2.12
to
3.2.13
+81
lib/dshAgentsAdapter.js
const fs = require("fs");
const path = require("path");
const { buildCodexAgentsMd } = require("./codexAgentsAdapter");
function replaceSection(body, startHeading, endHeading, replacement) {
const start = body.indexOf(startHeading);
const end = body.indexOf(endHeading, start + startHeading.length);
if (start < 0 || end < 0) return body;
return `${body.slice(0, start)}${replacement.trim()}\n\n${body.slice(end)}`;
}
function buildDshAgentsMd(templatesDir, projectConfig) {
let body = buildCodexAgentsMd(templatesDir, projectConfig)
.replace(/Codex/g, "DeepSeek Harness")
.replace(/codex/g, "dsh");
const isEnglish = path.basename(path.dirname(templatesDir)) === "templates" &&
path.basename(templatesDir) === "en-US";
if (isEnglish) {
body = body
.replace(" **`./.dsh/AGENTS.md`** is only a pointer.", "")
.replace("\n**`.dsh/AGENTS.md`** is only a pointer and cannot replace root `AGENTS.md`.\n", "\n");
body = replaceSection(
body,
"## DeepSeek Harness Hooks",
"## Flow2Spec Skills",
`## DeepSeek Harness Integration
DeepSeek Harness loads the repository-root \`AGENTS.md\` and discovers project skills from \`./.dsh/skills/\`. Flow2Spec mirrors its long-form rules to \`./.dsh/topics/\` for on-demand reading. Native Cordis plugin integration is outside this initialization adapter.`,
);
return body;
}
body = body
.replace("**`./.dsh/AGENTS.md`** 仅为指针。", "")
.replace("- **`.dsh/AGENTS.md`** 仅为目录指针,不能替代根 `AGENTS.md`。\n", "");
return replaceSection(
body,
"## DeepSeek Harness Hooks",
"## Flow2Spec 技能",
`## DeepSeek Harness 适配
DeepSeek Harness 会加载仓库根 \`AGENTS.md\`,并从 \`./.dsh/skills/\` 发现项目技能。Flow2Spec 将规则长文镜像到 \`./.dsh/topics/\` 供按需读取。原生 Cordis 插件集成不属于本初始化适配范围。`,
);
}
function buildDshAgentsStubMd(templatesDir) {
const isEnglish = path.basename(templatesDir) === "en-US";
if (isEnglish) {
return `# Flow2Spec (\`.dsh/\` Directory Notes)
DeepSeek Harness loads the complete project instructions from repository-root [\`AGENTS.md\`](../AGENTS.md).
- \`skills/\`: Flow2Spec \`f2s-*\` skills discovered by DeepSeek Harness
- \`topics/\`: long-form rule mirrors loaded on demand
`;
}
return `# Flow2Spec(\`.dsh/\` 目录说明)
DeepSeek Harness 从仓库根 [\`AGENTS.md\`](../AGENTS.md) 加载完整项目说明。
- \`skills/\`:DeepSeek Harness 可发现的 Flow2Spec \`f2s-*\` 技能
- \`topics/\`:按需读取的规则长文镜像
`;
}
function writeDshAgentsStub(cwd, templatesDir) {
const dshRoot = path.join(cwd, ".dsh");
fs.mkdirSync(dshRoot, { recursive: true });
fs.writeFileSync(
path.join(dshRoot, "AGENTS.md"),
buildDshAgentsStubMd(templatesDir),
"utf8",
);
}
module.exports = {
buildDshAgentsMd,
buildDshAgentsStubMd,
writeDshAgentsStub,
};
{
"includeAny": ["DeepSeek Harness", "deepseek-harness", "dsh", "flow2spec init dsh", ".dsh/skills", ".dsh/topics", "Cordis plugin", "Harness adapter"],
"id": "m-flow2spec-dsh-adapter",
"version": "1.0.0",
"schema": "flow2spec.matcher.v1"
}
---
id: flow2spec-dsh-adapter
revision: 0
summary: "DeepSeek Harness project skill initialization and directory adapter"
primary: feature
confidence: inferred
tags: [module]
---
# DeepSeek Harness Adapter
Use this topic for `flow2spec init dsh`, DeepSeek Harness skill discovery, `.dsh/skills`, `.dsh/topics`, and the repository-root `AGENTS.md` entry.
- Skills are written to `.dsh/skills/<skill-name>/SKILL.md`.
- Long-form rules are mirrored to `.dsh/topics/*.md`, with `.dsh/AGENTS.md` as a directory pointer.
- A missing root `AGENTS.md` receives a full entry; an existing entry is preserved.
- Native Cordis plugin work remains a later roadmap item.
{
"includeAny": ["DeepSeek Harness", "deepseek-harness", "dsh", "flow2spec init dsh", ".dsh/skills", ".dsh/topics", "Cordis 插件", "Harness 适配"],
"id": "m-flow2spec-dsh-adapter",
"version": "1.0.0",
"schema": "flow2spec.matcher.v1"
}
---
id: flow2spec-dsh-adapter
revision: 0
summary: "DeepSeek Harness 项目级技能初始化与目录适配"
primary: feature
confidence: inferred
tags: [module]
---
# DeepSeek Harness 适配
用于 `flow2spec init dsh`、DeepSeek Harness 技能发现、`.dsh/skills`、`.dsh/topics` 和根 `AGENTS.md` 入口问题。
- 技能写入 `.dsh/skills/<skill-name>/SKILL.md`。
- 规则长文镜像到 `.dsh/topics/*.md`,并写入 `.dsh/AGENTS.md` 目录指针。
- 缺少根 `AGENTS.md` 时生成完整入口,已有入口不覆盖。
- 原生 Cordis 插件属于后续路线图事项。
+8
-11

@@ -249,5 +249,6 @@ #!/usr/bin/env node

flow2spec init # 交互选择工具和配置
flow2spec init claude # 直接写入 .claude/,跳过工具选择
flow2spec init cursor claude # 同时写入 .cursor/ 与 .claude/
flow2spec init codex --locale en-US # 使用英文模板初始化 Codex
flow2spec init <agent> # 直接写入指定客户端配置根,跳过工具选择
flow2spec init <agent> <agent> # 同时初始化多个客户端
flow2spec init <agent> --locale en-US # 使用英文模板初始化指定客户端
flow2spec init dsh # 初始化 DeepSeek Harness 项目技能
flow2spec init --yes # 跳过所有问答,使用默认值(适合 CI)

@@ -257,3 +258,3 @@ flow2spec init --reset-knowledge # 强制用模板覆盖 .Knowledge(谨慎)

init 会:
1. 交互询问要初始化的 AI 工具(cursor / claude / codex,可多选);已通过参数指定则跳过。
1. 交互询问要初始化的 AI 工具(见上方 agent 列表,可多选);已通过参数指定则跳过。
传 --yes 或非 TTY 环境时跳过问答,使用默认值。

@@ -264,9 +265,3 @@ 2. 对 ${CONFIG_FILENAME} 中缺失的配置字段逐项提问(已有字段不覆盖)。模板语言由 --locale、已有 locale 或默认 zh-CN 决定。

传 --reset-knowledge 时才会强制用模板覆盖 .Knowledge 中模板承载部分。
4. 在各 agent 配置根写入 rules、skills(Claude 规则自动转 .md;Codex 在仓库根写入完整 AGENTS.md,.codex/ 写入指针)。
Claude 额外写入 .claude/hooks/f2s-config-session.js、f2s-config-inject.js 与 .claude/settings.json:
SessionStart 注入一次配置摘要;PreToolUse 仅在调用 f2s-* Skill 时提示首步必须 Read 配置。
Cursor 额外写入 f2s-config-check.mdc(alwaysApply),强制在技能首步读取配置文件;
并写入 .cursor/hooks.json,在 sessionStart 自动检测知识库版本。
Codex:仓库根 AGENTS.md(完整条令);.codex/AGENTS.md 为指针;
并写入 .codex/hooks.json,在 SessionStart 注入配置摘要并检测知识库版本。
4. 在各 agent 配置根写入对应的 rules、skills、入口和 hooks(若该客户端支持);具体落盘方式以客户端适配器为准。
5. 每次 init 将当前 locale 包模板 knowledge/index.md 复制到 .Knowledge/template/index.template.md,供 f2s-kb-upgrade 技能与 .Knowledge/index.md 对照;不自动改写 index.md。(「知识库升级」指 f2s-kb-upgrade 技能,init 本身不是升级命令。)

@@ -801,2 +796,4 @@ 6. 非破坏式补充 .gitignore:忽略 .task/ 与 .Knowledge/update-check.json 这类本地运行态。

return ` - ${root}/:(${label})skills/、topics/、hooks/、hooks.json、AGENTS.md(指针);仓库根 AGENTS.md(完整)`;
if (id === "dsh")
return ` - ${root}/:(${label})skills/、topics/、AGENTS.md(指针);根 AGENTS.md(缺少时生成)`;
if (id === "claude") {

@@ -803,0 +800,0 @@ const hookLine = claudeHooksResult?.settingsChanged

@@ -9,2 +9,3 @@ /**

codex: { root: ".codex", label: "Codex" },
dsh: { root: ".dsh", label: "DeepSeek Harness" },
};

@@ -18,2 +19,3 @@

codex: ["skills"],
dsh: ["skills", "topics"],
};

@@ -20,0 +22,0 @@

@@ -186,3 +186,3 @@ const fs = require("fs");

"缺少根 AGENTS.md。",
"运行 flow2spec init codex,或重新初始化所需 Agent。",
"运行 flow2spec init codex 或 flow2spec init dsh,或重新初始化所需 Agent。",
),

@@ -211,2 +211,3 @@ );

codex: ["AGENTS.md", "hooks.json"],
dsh: ["AGENTS.md", "skills", "topics"],
claude: ["settings.json"],

@@ -224,3 +225,3 @@ cursor: ["hooks.json"],

STATUS.warning,
"未检测到 .codex、.claude 或 .cursor 配置根。",
"未检测到 .codex、.claude、.cursor 或 .dsh 配置根。",
"运行 flow2spec init <agent> 初始化实际使用的 Agent。",

@@ -227,0 +228,0 @@ ),

@@ -19,2 +19,6 @@ const path = require("path");

const {
buildDshAgentsMd,
writeDshAgentsStub,
} = require("./dshAgentsAdapter");
const {
loadFlow2specConfig,

@@ -1161,8 +1165,8 @@ ensureFlow2specProjectConfig,

function writeCodexTopicMirrors(cwd, templatesDir) {
function writeTopicMirrors(cwd, templatesDir, agentRoot) {
const rulesDir = path.join(templatesDir, "rules");
const outDir = path.join(cwd, ".codex", "topics");
const outDir = path.join(cwd, agentRoot, "topics");
ensureDir(outDir);
if (!fs.existsSync(rulesDir)) return;
// 与 `.cursor/rules/*.mdc` 同源:Codex 不读 rules/,故镜像全部包模板规则到 `.codex/topics/*.md`
// Mirror rule templates for clients that load long-form guidance on demand.
const names = fs

@@ -1185,2 +1189,6 @@ .readdirSync(rulesDir)

function writeCodexTopicMirrors(cwd, templatesDir) {
writeTopicMirrors(cwd, templatesDir, ".codex");
}
/**

@@ -1197,2 +1205,16 @@ * 完整条令写仓库根;.codex/AGENTS.md 仅为指针,避免双份全文重复与 cwd 在 .codex 时双倍拼接。

/** Write the root instructions needed by DeepSeek Harness without overwriting an existing entry. */
function writeDshEntry(cwd, templatesDir, projectConfig) {
const agentsPath = path.join(cwd, "AGENTS.md");
if (!fs.existsSync(agentsPath)) {
fs.writeFileSync(
agentsPath,
buildDshAgentsMd(templatesDir, projectConfig),
"utf8",
);
}
writeDshAgentsStub(cwd, templatesDir);
writeTopicMirrors(cwd, templatesDir, ".dsh");
}
function writeAgentArtifacts(cwd, agentId, templatesDir, projectConfig) {

@@ -1202,3 +1224,5 @@ const root = AGENTS[agentId].root;

removeLegacyAgentTemplateDir(cwd, root);
if (agentId !== "codex") {
if (agentId === "dsh") {
writeDshEntry(cwd, templatesDir, projectConfig);
} else if (agentId !== "codex") {
copyRulesTemplates(cwd, root, templatesDir);

@@ -1205,0 +1229,0 @@ } else {

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

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

"scripts": {
"test": "node cli.js --help && node cli.js kb check && node scripts/test-knowledge-engine.js && node scripts/test-developer-id.js && node scripts/test-template-knowledge.js && node scripts/test-init-gitignore.js && node scripts/test-doctor.js",
"test": "node cli.js --help && node cli.js kb check && node scripts/test-knowledge-engine.js && node scripts/test-developer-id.js && node scripts/test-template-knowledge.js && node scripts/test-init-gitignore.js && node scripts/test-dsh-init.js && node scripts/test-doctor.js",
"sync:agents": "node cli.js init cursor claude codex",

@@ -32,0 +32,0 @@ "prepublishOnly": "node cli.js --help",

@@ -8,3 +8,3 @@ # Flow2Spec

<p align="center">
<strong>Give Cursor, Claude Code, and Codex the project facts they need before editing.</strong>
<strong>Give each initialized AI coding client the project facts it needs before editing.</strong>
</p>

@@ -17,3 +17,4 @@

<a href="./docs/en/usage-guide.md">Usage guide</a> ·
<a href="./docs/en/commands-reference.md">Commands</a>
<a href="./docs/en/commands-reference.md">Commands</a> ·
<a href="https://github.com/orgs/double-coding-lab/projects/2/views/1">Roadmap</a>
</p>

@@ -31,2 +32,4 @@

npx @double-coding/flow2spec@latest init
# DeepSeek Harness projects:
flow2spec init dsh
```

@@ -53,3 +56,3 @@

| Topic shards | Stores project facts such as APIs, limits, locks, data rules, and workflows. | `.Knowledge/topics/*.md` |
| Agent entrypoints | Installs rules and skills for Cursor, Claude Code, and Codex. | `.cursor/`, `.claude/`, `.codex/`, `AGENTS.md` |
| Agent entrypoints | Installs rules and skills for the selected AI coding clients. | client configuration roots, `.dsh/`, `AGENTS.md` |
| Skill workflows | Clarifies requirements, writes specs, implements, fixes, syncs knowledge, and commits. | `f2s-*` skills |

@@ -56,0 +59,0 @@ | Local task state | Keeps AI steps and user-side todos separate from product knowledge. | `.task/` |

@@ -8,3 +8,3 @@ # Flow2Spec

<p align="center">
<strong>Give Cursor, Claude Code, and Codex the project facts they need before editing.</strong>
<strong>Give each initialized AI coding client the project facts it needs before editing.</strong>
</p>

@@ -17,3 +17,4 @@

<a href="./docs/en/usage-guide.md">Usage guide</a> ·
<a href="./docs/en/commands-reference.md">Commands</a>
<a href="./docs/en/commands-reference.md">Commands</a> ·
<a href="https://github.com/orgs/double-coding-lab/projects/2/views/1">Roadmap</a>
</p>

@@ -31,2 +32,4 @@

npx @double-coding/flow2spec@latest init
# DeepSeek Harness projects:
flow2spec init dsh
```

@@ -53,3 +56,3 @@

| Topic shards | Stores project facts such as APIs, limits, locks, data rules, and workflows. | `.Knowledge/topics/*.md` |
| Agent entrypoints | Installs rules and skills for Cursor, Claude Code, and Codex. | `.cursor/`, `.claude/`, `.codex/`, `AGENTS.md` |
| Agent entrypoints | Installs rules and skills for the selected AI coding clients. | client configuration roots, `.dsh/`, `AGENTS.md` |
| Skill workflows | Clarifies requirements, writes specs, implements, fixes, syncs knowledge, and commits. | `f2s-*` skills |

@@ -56,0 +59,0 @@ | Team collaboration | Keeps each developer's task state local while merging reviewed knowledge through structured deltas and topic revisions. | `.task/<developerId>/`, `.Knowledge/` |

@@ -8,3 +8,3 @@ # Flow2Spec

<p align="center">
<strong>让 Cursor、Claude Code、Codex 在动手改代码前,先读到正确的项目事实。</strong>
<strong>让每个已初始化的 AI 编程客户端在动手改代码前,先读到正确的项目事实。</strong>
</p>

@@ -17,3 +17,4 @@

<a href="./docs/使用说明.md">使用说明</a> ·
<a href="./docs/命令说明.md">命令说明</a>
<a href="./docs/命令说明.md">命令说明</a> ·
<a href="https://github.com/orgs/double-coding-lab/projects/2/views/1">路线图</a>
</p>

@@ -31,2 +32,4 @@

npx @double-coding/flow2spec@latest init
# DeepSeek Harness 项目:
flow2spec init dsh
```

@@ -53,3 +56,3 @@

| 主题分片 | 保存 API、上限、锁、数据规则、业务流程等项目事实。 | `.Knowledge/topics/*.md` |
| Agent 入口 | 为 Cursor、Claude Code、Codex 安装规则和技能。 | `.cursor/`, `.claude/`, `.codex/`, `AGENTS.md` |
| Agent 入口 | 为选中的 AI 编程客户端安装规则和技能。 | 客户端配置根、`.dsh/`、`AGENTS.md` |
| 技能工作流 | 澄清需求、编写方案、实现、修复、同步知识、提交。 | `f2s-*` skills |

@@ -56,0 +59,0 @@ | 团队协作 | 每个人的任务现场留在本地,确认后的知识通过结构化 delta 与 topic revision 合入共享仓库。 | `.task/<developerId>/`, `.Knowledge/` |

@@ -31,2 +31,3 @@ # Flow2Spec Knowledge Index

| f2s-req-plan | `.Knowledge/topics/f2s-req-plan.md` | Requirement/spec planning and implementation; always maintain `.task/` | Skill: `skills/f2s-req-plan/SKILL.md`; depends on `f2s-task` |
| flow2spec-dsh-adapter | `.Knowledge/topics/flow2spec-dsh-adapter.md` | `flow2spec init dsh` and DeepSeek Harness project skill discovery | User guide: `docs/en/usage-guide.md`; implementation: `lib/dshAgentsAdapter.js` |

@@ -33,0 +34,0 @@ Keep **1-3** clickable summary links per topic. Full path mappings are written to `.Knowledge/migration-report.md` in migration scenarios.

@@ -43,2 +43,7 @@ {

"confidence": "manual"
},
"flow2spec-dsh-adapter": {
"primary": "feature",
"confidence": "inferred",
"tags": ["module"]
}

@@ -52,3 +57,4 @@ },

"f2s-task": ".Knowledge/topics/f2s-task.md",
"f2s-req-plan": ".Knowledge/topics/f2s-req-plan.md"
"f2s-req-plan": ".Knowledge/topics/f2s-req-plan.md",
"flow2spec-dsh-adapter": ".Knowledge/topics/flow2spec-dsh-adapter.md"
},

@@ -96,4 +102,12 @@ "taskToTopicRules": [

]
},
{
"task": "flow2spec-dsh-adapter",
"matcherId": "m-flow2spec-dsh-adapter",
"matcherPath": ".Knowledge/matchers/m-flow2spec-dsh-adapter.json",
"topics": [
"flow2spec-dsh-adapter"
]
}
]
}

@@ -95,3 +95,3 @@ ---

All three clients register a SessionStart version-check script: Cursor writes **`.cursor/hooks.json`** through `flow2spec init cursor` and runs `node .cursor/hooks/f2s-update-check.js` at `sessionStart`; Codex writes **`.codex/hooks.json`** through `flow2spec init codex` and registers both the configuration-summary script `node .codex/hooks/f2s-config-session.js` and the version-check script `node .codex/hooks/f2s-update-check.js` on `SessionStart` `startup|resume`; Claude writes **`.claude/settings.json`** through `flow2spec init claude` and registers the configuration summary, version check, and `PreToolUse Skill` guard. After the version-check script compares versions and writes cache, when an upgrade is needed it injects an imperative upgrade notice through `additional_context` (agent-instruction text requires the agent to relay it to the user verbatim).
Each initialized client uses its own startup/update mechanism when supported; the generated client entrypoint is authoritative. Clients without hooks continue to use the generated rules, skills, `AGENTS.md`, or topic mirrors. Version-check scripts compare versions and, when an upgrade is needed, inject an imperative upgrade notice through `additional_context` where the client supports it. Project-level skill discovery clients use `.dsh/skills/` and `.dsh/topics/` through `flow2spec init dsh`.

@@ -98,0 +98,0 @@ **Rule-layer fallback check** (backup for script cache):

@@ -65,4 +65,4 @@ ---

**Why does each Cursor / Claude / Codex directory have a same-named `SKILL.md`?**
Each tool only loads `skills/` under **its own configuration root** (for example, Codex only loads `.codex/skills/`). `flow2spec init` writes the current-language skill content into the selected agent directories.
**Why does each configured client directory have a same-named `SKILL.md`?**
Each client only loads `skills/` under **its own configuration root**. `flow2spec init` writes the current-language skill content into the selected agent directories.

@@ -77,3 +77,3 @@ ## Goal

2. Append `--reset-knowledge` only when the user explicitly requests "overwrite reset".
3. Prefer agents specified by the user; if unspecified, default to `cursor claude codex`.
3. Prefer agents specified by the user; if unspecified, use the package's default client selection.

@@ -80,0 +80,0 @@ ## init and Skill Self-Update (Required)

@@ -21,10 +21,4 @@ ---

**All three clients must read the full `f2s-task` text (Step 0 is mandatory, before any step below):**
**Every client initialized for the project must read the full `f2s-task` text (Step 0 is mandatory, before any step below).** Use the active client's generated rules, `AGENTS.md`, or topic entrypoint; do not substitute this skill's summary for the full text.
| Client | Path |
| --- | --- |
| **Cursor** | Config-root `rules/f2s-task.mdc`; or initialized `.cursor/rules/f2s-task.mdc` |
| **Claude Code** | `.claude/rules/f2s-task.md` |
| **Codex** | `.codex/topics/f2s-task.md` |
## Orchestration (main / sub agent)

@@ -50,3 +44,3 @@

1. **`Read("flow2spec.config.json")`** (project root; missing fields are treated as `false`).
2. **`Read` the full `f2s-task` text for one of the three clients above** (do not skip; do not use only this SKILL summary as a substitute).
2. **`Read` the full `f2s-task` text from the active client's generated entrypoint** (do not skip; do not use only this SKILL summary as a substitute).
3. Decide whether to split to sub agents and whether to cross-verify based on the read `subAgent` / `switchAgentVerification` values.

@@ -53,0 +47,0 @@

@@ -31,2 +31,3 @@ # Flow2Spec Knowledge Index

| f2s-req-plan | `.Knowledge/topics/f2s-req-plan.md` | 需求/方案规划与实现;始终维护 `.task/` | 技能:`skills/f2s-req-plan/SKILL.md`;依赖 `f2s-task` |
| flow2spec-dsh-adapter | `.Knowledge/topics/flow2spec-dsh-adapter.md` | `flow2spec init dsh` 与 DeepSeek Harness 项目技能发现 | 用户文档:`docs/使用说明.md`;实现:`lib/dshAgentsAdapter.js` |

@@ -33,0 +34,0 @@ 每主题保留 **1–3 条** 可点击摘要链接;全量路径对照写入 `.Knowledge/migration-report.md`(迁移场景)。

@@ -43,2 +43,7 @@ {

"confidence": "manual"
},
"flow2spec-dsh-adapter": {
"primary": "feature",
"confidence": "inferred",
"tags": ["module"]
}

@@ -52,3 +57,4 @@ },

"f2s-task": ".Knowledge/topics/f2s-task.md",
"f2s-req-plan": ".Knowledge/topics/f2s-req-plan.md"
"f2s-req-plan": ".Knowledge/topics/f2s-req-plan.md",
"flow2spec-dsh-adapter": ".Knowledge/topics/flow2spec-dsh-adapter.md"
},

@@ -96,4 +102,12 @@ "taskToTopicRules": [

]
},
{
"task": "flow2spec-dsh-adapter",
"matcherId": "m-flow2spec-dsh-adapter",
"matcherPath": ".Knowledge/matchers/m-flow2spec-dsh-adapter.json",
"topics": [
"flow2spec-dsh-adapter"
]
}
]
}

@@ -95,3 +95,3 @@ ---

三端均在 SessionStart 注册版本检查脚本:Cursor 由 `flow2spec init cursor` 写入 **`.cursor/hooks.json`** 在 `sessionStart` 执行 `node .cursor/hooks/f2s-update-check.js`;Codex 由 `flow2spec init codex` 写入 **`.codex/hooks.json`**,在 `SessionStart` 的 `startup|resume` 事件同时注册配置摘要脚本 `node .codex/hooks/f2s-config-session.js` 与版本检查脚本 `node .codex/hooks/f2s-update-check.js`;Claude 由 `flow2spec init claude` 写入 **`.claude/settings.json`**,注册配置摘要、版本检查与 `PreToolUse Skill` 守门。版本检查脚本完成版本比对与缓存写入后,需升级时通过 `additional_context` 注入命令式升级提示(agent-instruction 文案要求 agent 必须原文转告用户)。
各已初始化客户端在支持时使用自身的启动 / 更新机制,具体以生成的客户端入口为准。不提供 hooks 的客户端继续通过生成的 rules、skills、`AGENTS.md` 或 topics 镜像工作。版本检查脚本在客户端支持时完成版本比对并注入升级提示;项目级技能发现客户端通过 `flow2spec init dsh` 使用 `.dsh/skills/` 与 `.dsh/topics/`。

@@ -98,0 +98,0 @@ **规则层双保险**(与脚本缓存互为备份):

@@ -65,4 +65,4 @@ ---

**为何 Cursor / Claude / Codex 下各有一份同名 `SKILL.md`?**
各工具只加载**本配置根**下的 `skills/`(例如 Codex 仅 `.codex/skills/`)。`flow2spec init` 会向所选 agent 目录**同步落盘**当前语言对应的技能内容。
**为何每个已配置客户端目录下都有一份同名 `SKILL.md`?**
各客户端只加载**自身配置根**下的 `skills/`。`flow2spec init` 会向所选 agent 目录**同步落盘**当前语言对应的技能内容。

@@ -77,3 +77,3 @@ ## 目标

2. 仅当用户明确要求「覆盖重置」时,才在 `init` 末尾追加 `--reset-knowledge`。
3. 优先写入用户指定的 agent;未指定时默认 `cursor claude codex`。
3. 优先写入用户指定的 agent;未指定时使用包的默认客户端选择。

@@ -80,0 +80,0 @@ ## init 与技能自更新(必须)

@@ -21,10 +21,4 @@ ---

**三端读取 `f2s-task` 全文(步骤 0 必做,先于下文任何步骤)**:
**所有已为项目初始化的客户端都必须读取 `f2s-task` 全文(步骤 0 必做,先于下文任何步骤)**。请从当前客户端生成的 rules、`AGENTS.md` 或 topics 入口读取,不得用本技能摘要代替全文。
| 端 | 路径 |
| --- | --- |
| **Cursor** | 配置根 `rules/f2s-task.mdc`;或已 init 的 `.cursor/rules/f2s-task.mdc` |
| **Claude Code** | `.claude/rules/f2s-task.md` |
| **Codex** | `.codex/topics/f2s-task.md` |
## 编排(主 / 子 agent)

@@ -50,3 +44,3 @@

1. **`Read("flow2spec.config.json")`**(项目根;缺失字段视为 `false`)。
2. **`Read` 上表三端之一的 `f2s-task` 全文**(不得跳过;不得仅用本 SKILL 摘要代替)。
2. **`Read` 当前客户端生成入口中的 `f2s-task` 全文**(不得跳过;不得仅用本 SKILL 摘要代替)。
3. 按读到的 `subAgent` / `switchAgentVerification` 决定下文是否拆子 agent、是否交叉校验。

@@ -145,3 +139,3 @@

- **步骤 0**:必须先 `Read` `flow2spec.config.json` + **`f2s-task` 全文**(三端路径见上表)
- **步骤 0**:必须先 `Read` `flow2spec.config.json` + 当前客户端入口中的 **`f2s-task` 全文**
- **`.task/`**:一律服从 `f2s-task`;本 SKILL 不得与之冲突

@@ -148,0 +142,0 @@ - 不依赖 `changeTracking`,但**始终**创建并维护任务清单(除非续作已有 active 任务)