@double-codeing/flow2spec 3.0.14 → 3.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +15 -15
  3. package/README.md +15 -15
  4. package/cli.js +2 -2
  5. package/docs/.mermaid-cache.json +49 -0
  6. package/docs/.sync-mapping.json +59 -0
  7. package/docs/en/README.md +12 -0
  8. package/docs/{architecture.en.md → en/architecture.md} +57 -20
  9. package/docs/{commands-reference.en.md → en/commands-reference.md} +14 -16
  10. package/docs/{design-principles.en.md → en/design-principles.md} +26 -7
  11. package/docs/{directory-conventions.en.md → en/directory-conventions.md} +18 -13
  12. package/docs/{usage-guide.en.md → en/usage-guide.md} +23 -35
  13. package/docs/{usage-scenarios.en.md → en/usage-scenarios.md} +8 -34
  14. package/docs/{README- → }/344/275/223/347/263/273/344/270/216/345/216/237/347/220/206.md +60 -19
  15. package/docs/{Flow2Spec- → }/344/275/277/347/224/250/346/241/210/344/276/213-/346/250/241/346/213/237/345/257/271/350/257/235.md +9 -33
  16. package/docs/{Flow2Spec → }/344/275/277/347/224/250/350/257/264/346/230/216.md +24 -34
  17. package/docs/{README- → }/345/221/275/344/273/244/350/257/264/346/230/216.md +15 -15
  18. package/docs/{README- → }/347/233/256/345/275/225/344/270/216/350/267/257/345/276/204/347/272/246/345/256/232.md +19 -12
  19. package/docs/{Flow2Spec- → }/350/256/276/350/256/241/350/257/264/346/230/216.md +69 -6
  20. package/package.json +1 -1
  21. package/templates/knowledge/template//345/220/216/347/253/257/346/212/200/346/234/257/346/250/241/347/211/210.md +1 -1
  22. package/templates/knowledge/template//347/273/210/347/250/277/346/250/241/347/211/210.md +1 -2
  23. package/templates/knowledge/template//351/241/271/347/233/256/351/207/214/347/250/213/347/242/221/346/250/241/347/211/210.md +1 -1
  24. package/templates/knowledge/topics/f2s-req-plan.md +1 -1
  25. package/templates/knowledge/topics/f2s-task.md +1 -1
  26. package/templates/rules/f2s-flow2spec-unified-entry.mdc +1 -0
  27. package/templates/rules/f2s-stock-docs-vs-req-docs.mdc +1 -1
  28. package/templates/rules/f2s-task.mdc +5 -5
  29. package/templates/skills/f2s-ctx-build/SKILL.md +3 -3
  30. package/templates/skills/f2s-ctx-rm/SKILL.md +1 -1
  31. package/templates/skills/f2s-doc-add/SKILL.md +1 -1
  32. package/templates/skills/f2s-doc-milestone/SKILL.md +1 -1
  33. package/templates/skills/f2s-git-commit/SKILL.md +1 -1
  34. package/templates/skills/f2s-kb-fix/SKILL.md +1 -1
  35. package/templates/skills/f2s-kb-sync/SKILL.md +1 -1
  36. package/templates/skills/stock-docs-vs-req-docs/SKILL.md +1 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 兰涛
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md CHANGED
@@ -5,12 +5,12 @@
5
5
  >
6
6
  > 🌐 **[中文](./README.md)** · 中 / EN
7
7
 
8
- 🎬 **[Live Demo (English)](https://lands-1203.github.io/Flow2Spec/en/)** | **[中文演示](https://lands-1203.github.io/Flow2Spec/)** (13-slide HTML PPT, `←` `→` to navigate, `S` for presenter mode)
8
+ 🎬 **[Live Demo](https://lands-1203.github.io/Flow2Spec/)** (13-slide HTML PPT, `←` `→` to navigate, `S` for presenter mode)
9
9
 
10
10
  🔧 **Quick start**:
11
11
 
12
12
  ```bash
13
- npx @double-codeing/flow2spec@latest init
13
+ npx @ctrip/flow2spec@latest init
14
14
  ```
15
15
 
16
16
  ---
@@ -68,7 +68,7 @@ Each task hits 1–4 topics, ~300 lines. Business constraints — Redis lock key
68
68
  **Minimum viable setup is an empty skeleton.**
69
69
 
70
70
  ```bash
71
- npx @double-codeing/flow2spec@latest init
71
+ npx @ctrip/flow2spec@latest init
72
72
  ```
73
73
 
74
74
  1 minute generates the directory structure + routing config. Empty, ready to use. **Next requirement hits whichever area → you document that area.** No upfront investment needed.
@@ -94,20 +94,20 @@ Real data from a production repo running for 3 months:
94
94
  ## Documentation
95
95
 
96
96
  ### English
97
- - [Usage Guide](./docs/usage-guide.en.md) — skill chains, config details
98
- - [Commands Reference](./docs/commands-reference.en.md) — all f2s-* command reference
99
- - [Directory Conventions](./docs/directory-conventions.en.md)
100
- - [Architecture & Principles](./docs/architecture.en.md)
101
- - [Usage Scenarios](./docs/usage-scenarios.en.md)
102
- - [Design Principles](./docs/design-principles.en.md)
97
+ - [Usage Guide](./docs/en/usage-guide.md) — skill chains, config details
98
+ - [Commands Reference](./docs/en/commands-reference.md) — all f2s-* command reference
99
+ - [Directory Conventions](./docs/en/directory-conventions.md)
100
+ - [Architecture & Principles](./docs/en/architecture.md)
101
+ - [Usage Scenarios](./docs/en/usage-scenarios.md)
102
+ - [Design Principles](./docs/en/design-principles.md)
103
103
 
104
104
  ### 中文
105
- - [使用说明](./docs/Flow2Spec使用说明.md)
106
- - [命令说明](./docs/README-命令说明.md)
107
- - [目录与路径约定](./docs/README-目录与路径约定.md)
108
- - [体系与原理](./docs/README-体系与原理.md)
109
- - [使用案例·模拟对话](./docs/Flow2Spec-使用案例-模拟对话.md)
110
- - [设计说明](./docs/Flow2Spec-设计说明.md)
105
+ - [使用说明](./docs/使用说明.md)
106
+ - [命令说明](./docs/命令说明.md)
107
+ - [目录与路径约定](./docs/目录与路径约定.md)
108
+ - [体系与原理](./docs/体系与原理.md)
109
+ - [使用案例·模拟对话](./docs/使用案例-模拟对话.md)
110
+ - [设计说明](./docs/设计说明.md)
111
111
 
112
112
  ## License
113
113
 
package/README.md CHANGED
@@ -5,12 +5,12 @@
5
5
  >
6
6
  > 🌐 **[English](./README.en.md)** · 中 / EN
7
7
 
8
- 🎬 **[在线演示(中文)](https://lands-1203.github.io/Flow2Spec/)** | **[English Demo](https://lands-1203.github.io/Flow2Spec/en/)**(13 页 HTML PPT,`←` `→` 翻页,`S` 演讲者模式)
8
+ 🎬 **[在线演示](https://lands-1203.github.io/Flow2Spec/)**(13 页 HTML PPT,`←` `→` 翻页,`S` 演讲者模式)
9
9
 
10
10
  🔧 **快速体验**:
11
11
 
12
12
  ```bash
13
- npx @double-codeing/flow2spec@latest init
13
+ npx @ctrip/flow2spec@latest init
14
14
  ```
15
15
 
16
16
  ---
@@ -69,7 +69,7 @@ topic 里,AI 不用从源码猜。
69
69
  **最小可用集是一个空骨架。**
70
70
 
71
71
  ```bash
72
- npx @double-codeing/flow2spec@latest init
72
+ npx @ctrip/flow2spec@latest init
73
73
  ```
74
74
 
75
75
  1 分钟生成目录结构 + 路由配置,空的,直接跑。**下次需求命中哪块,写哪块**,不提前建设。
@@ -95,20 +95,20 @@ npx @double-codeing/flow2spec@latest init
95
95
  ## 详细文档
96
96
 
97
97
  ### 中文
98
- - [使用说明](./docs/Flow2Spec使用说明.md) — 技能链、配置详解
99
- - [命令说明](./docs/README-命令说明.md) — 所有 f2s-* 命令速查
100
- - [目录与路径约定](./docs/README-目录与路径约定.md)
101
- - [体系与原理](./docs/README-体系与原理.md)
102
- - [使用案例·模拟对话](./docs/Flow2Spec-使用案例-模拟对话.md)
103
- - [设计说明](./docs/Flow2Spec-设计说明.md)
98
+ - [使用说明](./docs/使用说明.md) — 技能链、配置详解
99
+ - [命令说明](./docs/命令说明.md) — 所有 f2s-* 命令速查
100
+ - [目录与路径约定](./docs/目录与路径约定.md)
101
+ - [体系与原理](./docs/体系与原理.md)
102
+ - [使用案例·模拟对话](./docs/使用案例-模拟对话.md)
103
+ - [设计说明](./docs/设计说明.md)
104
104
 
105
105
  ### English
106
- - [Usage Guide](./docs/usage-guide.en.md)
107
- - [Commands Reference](./docs/commands-reference.en.md)
108
- - [Directory Conventions](./docs/directory-conventions.en.md)
109
- - [Architecture & Principles](./docs/architecture.en.md)
110
- - [Usage Scenarios](./docs/usage-scenarios.en.md)
111
- - [Design Principles](./docs/design-principles.en.md)
106
+ - [Usage Guide](./docs/en/usage-guide.md)
107
+ - [Commands Reference](./docs/en/commands-reference.md)
108
+ - [Directory Conventions](./docs/en/directory-conventions.md)
109
+ - [Architecture & Principles](./docs/en/architecture.md)
110
+ - [Usage Scenarios](./docs/en/usage-scenarios.md)
111
+ - [Design Principles](./docs/en/design-principles.md)
112
112
 
113
113
  ## 协议
114
114
 
package/cli.js CHANGED
@@ -58,7 +58,7 @@ init 会:
58
58
  5. 每次 init 将包内 templates/knowledge/index.md 复制到 .Knowledge/template/index.template.md,供 f2s-kb-upgrade 技能与 .Knowledge/index.md 对照;不自动改写 index.md。(「知识库升级」指 f2s-kb-upgrade 技能,init 本身不是升级命令。)
59
59
  6. 规则与技能在各 agent 配置根加载;其他模版类文件在 .Knowledge/template/ 等目录。
60
60
 
61
- 更多说明见 README.md 或 docs/Flow2Spec使用说明.md
61
+ 更多说明见 README.md 或 docs/使用说明.md
62
62
  `;
63
63
 
64
64
  if (sub === "--help" || sub === "-h" || !sub) {
@@ -324,7 +324,7 @@ ${indexLine}
324
324
  ${configLine}
325
325
  ${lines.join("\n")}
326
326
 
327
- 建议阅读 README 或 docs/Flow2Spec使用说明.md,按「规则在配置根、文档在 .Knowledge」的方式使用。
327
+ 建议阅读 README 或 docs/使用说明.md,按「规则在配置根、文档在 .Knowledge」的方式使用。
328
328
  `);
329
329
  })
330
330
  .catch((e) => {
@@ -0,0 +1,49 @@
1
+ {
2
+ "设计说明.md": [
3
+ {
4
+ "content": "graph TB\n subgraph MC[\"Memory Coding · 仓内四环\"]\n KR[\"知识环 .Knowledge/\"]\n TR[\"任务环 .task/\"]\n RR[\"规则环 rules\"]\n SR[\"技能环 f2s-*\"]\n end\n SR -->|\"维护 ↑\"| KR\n RR -->|\"读与做 ↓\"| KR\n TR -.->|\"并列,不在 .Knowledge 内\"| KR",
5
+ "hash": "fae76e2801d0",
6
+ "marker": "MERMAID_fae76e2801d0"
7
+ },
8
+ {
9
+ "content": "graph TB\n subgraph H[\"横读 · 渐进式收窄\"]\n L0[\"L0 manifest-routing\"]\n L1[\"L1 matchers 分片\"]\n L2[\"L2 topics 摘要\"]\n L3[\"L3 stock-docs / req-docs\"]\n L0 --> L1 --> L2 --> L3\n end\n subgraph V[\"纵链 · topicDependencies\"]\n T1[\"通用约定\"]\n T2[\"子域边界\"]\n T3[\"端上白名单\"]\n T4[\"本域细则\"]\n T1 --> T2 --> T3 --> T4\n end\n L2 --- V",
10
+ "hash": "2c3581e0ec89",
11
+ "marker": "MERMAID_2c3581e0ec89"
12
+ },
13
+ {
14
+ "content": "graph LR\n subgraph K[\".Knowledge/ 知识层\"]\n K1[架构说明]\n K2[技术方案]\n K3[路由索引]\n end\n\n subgraph R[\"配置根 执行层\"]\n R1[.cursor/rules/]\n R2[.claude/rules/]\n R3[.codex/AGENTS.md]\n end\n\n K -->|知识输入| AI[AI 工具]\n R -->|规则约束| AI\n\n note1[\"知识随项目迭代\"] -.-> K\n note2[\"规则随工具升级\"] -.-> R",
15
+ "hash": "048f705f3b6a",
16
+ "marker": "MERMAID_048f705f3b6a"
17
+ },
18
+ {
19
+ "content": "graph LR\n T[任务] --> M[manifest-routing\\n读路由表]\n M -->|关键词匹配| MT[matchers/xxx.json\\n只读这一个分片]\n MT -->|命中| TP[topics/xxx.md]\n TP --> V{缺口检查}\n V -->|通过| ACT[执行]\n V -->|不足| Q[向用户澄清]\n M -->|未命中| FB[fallback-triage\\n结构化分诊]",
20
+ "hash": "a24148e2b009",
21
+ "marker": "MERMAID_a24148e2b009"
22
+ },
23
+ {
24
+ "content": "graph LR\n K[\".Knowledge/\"] --> AI[\"下次会话\\n的 AI\"]\n AI --> C[\"功能迭代\"]\n\n C -->|\"修复 Bug\"| FIX[\"f2s-kb-fix\"] --> K\n C -->|\"新增能力\"| FEAT[\"f2s-kb-feat\"] --> K\n C -->|\"会话结束\"| SYNC[\"f2s-kb-sync\"] --> K\n C -->|\"提交代码\"| CMT[\"f2s-git-commit\\n收口检查\"]\n CMT -->|\"未入库则提醒\\n-> kb-sync/kb-feat\"| K\n\n D1[\"架构文档\"] -->|f2s-doc-arch| FIN[\"f2s-doc-final\"]\n D2[\"PDF/初稿\"] -->|f2s-doc-final| FIN\n FIN --> CTX[\"f2s-ctx-build\"] --> K\n\n OLD[\"存量代码/文档\"] -->|f2s-doc-add| K\n\n NR[\"新需求\"] --> CL[\"f2s-req-clarify\"] --> BE[\"f2s-req-backend\"]\n BE --> IMPL[\"实现xxx技术方案\"] -->|自动触发implement-tech-design规则| K\n\n GIT[\"Git 合并后\"] -->|f2s-kb-merge| K",
25
+ "hash": "6335fa6eda40",
26
+ "marker": "MERMAID_6335fa6eda40"
27
+ },
28
+ {
29
+ "content": "graph LR\n SKILL[\"f2s-kb-feat / f2s-kb-fix\\nimplement-tech-design\"] -->|\"changeTracking: true\"| TJ[\".task/active/\\ntask.md · todo.json\"]\n RP[\"f2s-req-plan\\n(始终创建)\"] --> TJ\n\n TJ --> NS[新会话首条消息]\n NS -->|关键词匹配| LD[\"加载剩余 checklist\\n+ linkedSkill 上下文\"]\n LD --> RS[按原技能约束继续]",
30
+ "hash": "954431299027",
31
+ "marker": "MERMAID_954431299027"
32
+ },
33
+ {
34
+ "content": "graph TD\n F[进入 fallback-triage] --> S1{路由是否命中?}\n S1 -->|已命中但上下文不足| EXP[展开依赖主题\\n补齐后继续]\n S1 -->|未命中| Q[询问用户:\\n这个领域文档是否已录入?]\n Q -->|是| HINT[路由词条缺失\\n建议补路由]\n Q -->|否| CHOICE[下钻源码\\n或补充 req-docs]\n Q -->|不确定| STOP[停止执行\\n等待明确指令]",
35
+ "hash": "4318b3c68d8d",
36
+ "marker": "MERMAID_4318b3c68d8d"
37
+ },
38
+ {
39
+ "content": "graph LR\n S1[步骤1: 素材汇总] -->|subAgent=true 可并行| SUB[子 agent]\n SUB -->|只读,不落盘| S2\n\n S2[步骤2: 输出大纲\\n用户确认] -->|必须主 agent| USER[用户]\n USER -->|确认| S3\n\n S3[步骤3: 落盘] -->|subAgent=true 可并行| SUB2[子 agent]",
40
+ "hash": "a2564dc94095",
41
+ "marker": "MERMAID_a2564dc94095"
42
+ },
43
+ {
44
+ "content": "graph LR\n T[触发 f2s-kb-sync] --> O[输出更新大纲]\n O --> U{用户确认}\n U -->|确认| W[写入 .Knowledge/]\n U -->|修改| O\n U -->|取消| STOP[不写入]",
45
+ "hash": "07d348a75406",
46
+ "marker": "MERMAID_07d348a75406"
47
+ }
48
+ ]
49
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "Flow2Spec-设计说明.md": {
3
+ "hash": ""
4
+ },
5
+ "体系与原理.md": {
6
+ "dedup_reuse": true,
7
+ "doc_token": "MJ3ddOEadoSalLxup2tctXC3nSh",
8
+ "hash": "36d6d00cae030bf24d8b669471ae4c27333ab0a3f59f73871b87ea271c35f112",
9
+ "last_sync": "2026-05-21T11:32:28",
10
+ "node_token": "JPX7wpAUxilS43kP31XclcJfnYb",
11
+ "space_id": "7516389318031998979",
12
+ "title": "体系与原理"
13
+ },
14
+ "使用案例-模拟对话.md": {
15
+ "doc_token": "PtAyd2CPloSUjcxZu5Rco7ylnRd",
16
+ "hash": "35fe556b103e683f1fcf15de79a68d775430c0fb9ebe456b8e1d326e8b3371c0",
17
+ "last_sync": "2026-05-21T11:31:57",
18
+ "node_token": "BzpzwlXVIiiJjNkqjDBcVVmGngu",
19
+ "space_id": "7516389318031998979",
20
+ "title": "Flow2Spec 使用案例(模拟对话)",
21
+ "url": "https://trip.larkenterprise.com/docx/PtAyd2CPloSUjcxZu5Rco7ylnRd"
22
+ },
23
+ "使用说明.md": {
24
+ "doc_token": "ULCudGycqo8G7gx6Jm9cxaD8nPf",
25
+ "hash": "8b627acc009e0405785f400bb6a9f250fdf93ffcd15a992c22bb5b4cc52d90e2",
26
+ "last_sync": "2026-05-21T11:32:24",
27
+ "node_token": "XpLYw8SCri3zzskG9Xhc3Ir1nsf",
28
+ "space_id": "7516389318031998979",
29
+ "title": "Flow2Spec 使用说明",
30
+ "url": "https://trip.larkenterprise.com/docx/ULCudGycqo8G7gx6Jm9cxaD8nPf"
31
+ },
32
+ "命令说明.md": {
33
+ "doc_token": "SfrGd4Fj2odWvsxj944cINqQnWh",
34
+ "hash": "7498e8d5b551db305dd1fa348044f66ffcdde77372f0ab963e6163e022a15186",
35
+ "last_sync": "2026-05-21T11:32:40",
36
+ "node_token": "AyE5wuPhoi4pPMkqxLgc4v53nfb",
37
+ "space_id": "7516389318031998979",
38
+ "title": "工作流与技能说明",
39
+ "url": "https://trip.larkenterprise.com/docx/SfrGd4Fj2odWvsxj944cINqQnWh"
40
+ },
41
+ "目录与路径约定.md": {
42
+ "dedup_reuse": true,
43
+ "doc_token": "KPebdJeyKoxFxLx66lgcmvVNnkc",
44
+ "hash": "c4fcff4abf8290910840a6448e5b49793be47c9e37a7b0d737095f0942444812",
45
+ "last_sync": "2026-05-21T11:32:44",
46
+ "node_token": "FNaCwSIGNiye0wkp9mEc76ohn1g",
47
+ "space_id": "7516389318031998979",
48
+ "title": "目录与路径约定"
49
+ },
50
+ "设计说明.md": {
51
+ "doc_token": "DSD8duoqwoIb2XxsspKcKirinjg",
52
+ "hash": "440310cf3c35a80b4ba21ce15d6e7d07e754169ab1fa2de92756362a10b12f6e",
53
+ "last_sync": "2026-05-21T11:32:09",
54
+ "node_token": "SsZJwXuNyiGPcBk4ftdcIrIhnwb",
55
+ "space_id": "7516389318031998979",
56
+ "title": "Flow2Spec 设计说明",
57
+ "url": "https://trip.larkenterprise.com/docx/DSD8duoqwoIb2XxsspKcKirinjg"
58
+ }
59
+ }
@@ -0,0 +1,12 @@
1
+ # English documentation
2
+
3
+ Product docs in English live under `docs/en/`. Chinese docs are in `docs/` (repository root of this folder).
4
+
5
+ | Document | Chinese counterpart |
6
+ | --- | --- |
7
+ | [usage-guide.md](./usage-guide.md) | [使用说明.md](../使用说明.md) |
8
+ | [commands-reference.md](./commands-reference.md) | [命令说明.md](../命令说明.md) |
9
+ | [directory-conventions.md](./directory-conventions.md) | [目录与路径约定.md](../目录与路径约定.md) |
10
+ | [architecture.md](./architecture.md) | [体系与原理.md](../体系与原理.md) |
11
+ | [usage-scenarios.md](./usage-scenarios.md) | [使用案例-模拟对话.md](../使用案例-模拟对话.md) |
12
+ | [design-principles.md](./design-principles.md) | [设计说明.md](../设计说明.md) |
@@ -1,24 +1,61 @@
1
- [中文](./README-体系与原理.md) | [English](./architecture.en.md)
1
+ [中文](../体系与原理.md) | [English](./architecture.md)
2
2
 
3
3
  # Architecture & Principles
4
4
 
5
- Flow2Spec's goal is to separate "business knowledge curation" from "Agent capability loading":
5
+ Flow2Spec separates "business knowledge curation" from "Agent capability loading", and uses **Memory Coding** to persist "what must be remembered" as versioned Git assets.
6
6
 
7
- - **Knowledge layer**: `.Knowledge` (documents and index)
8
- - **Execution layer**: config root `rules/skills` (natively loaded by each tool)
7
+ - **Knowledge ring** (`.Knowledge/`): documents and machine-readable routing (multi-layer, see below)
8
+ - **Task ring** (`.task/`): cross-session task checklists
9
+ - **Rules ring** (tool `rules` / `AGENTS.md`): how to **read** and **act**
10
+ - **Skills ring** (`f2s-*`): maintain knowledge and trigger workflows
11
+
12
+ > Flow2Spec is not "just a knowledge base." All four rings are Memory Coding; the two-layer table below is the **knowledge ring vs tool-side execution** lifecycle split.
13
+
14
+ ---
15
+
16
+ ## 1. Memory Coding and Four Rings
17
+
18
+ **Memory Coding**: encode durable context into the **committed repo**—not private model memory, not chat-only repetition, not whole-repo vector guessing.
19
+
20
+ Four rings in the repo (do not collapse rules + skills into a single "third ring"):
21
+
22
+ | Ring | Location | Stores |
23
+ | --- | --- | --- |
24
+ | **Knowledge** | `.Knowledge/` | Routing, topics, stock/req docs (§2 layers) |
25
+ | **Task** | `.task/` | `todo.json`, checklists, user todos |
26
+ | **Rules** | `.cursor/.claude/.codex` rules, `AGENTS.md` | Read order, gap gates, execution constraints |
27
+ | **Skills** | config root `skills/*/SKILL.md` | `f2s-kb-feat/fix/sync`, etc. |
28
+
29
+ ---
30
+
31
+ ## 2. Multi-Layer Memory Inside the Knowledge Ring
32
+
33
+ `.Knowledge/` is not a flat pile of Markdown. It combines **horizontal narrowing** (progressive routing) and **vertical chaining** (topic dependencies):
34
+
35
+ | Layer | Path / mechanism | Stores | Typical read |
36
+ | --- | --- | --- | --- |
37
+ | **L0 routing** | `manifest-routing.json` | task→topic, `topicDependencies`, `topicPaths` | First read (machine source of truth) |
38
+ | **L1 matcher shard** | `matchers/<id>.json` | `includeAny` triggers | **match**: one shard only |
39
+ | **L2 topic summary** | `topics/<topic>.md` | Hard constraints, boundaries, pointers | **expand**: pull dependency topics |
40
+ | **L3 long docs** | `stock-docs/`, `req-docs/` | Architecture finals, tech specs | Drill down on demand |
41
+ | **Vertical chain** | `topicDependencies` | Common → subdomain → whitelist → domain rules | **expand** stacks layers |
42
+
43
+ The pipeline `match → expand → verify → act` operates on L0–L2 (and L3 when needed). Topic-level dependencies are declared once and shared by all tasks.
44
+
45
+ `index.md` is human navigation only; it does not replace the machine-readable chain.
9
46
 
10
47
  ---
11
48
 
12
- ## 1. Two-Layer Structure
49
+ ## 3. Knowledge Layer vs Execution Layer (Two Layers)
13
50
 
14
51
  | Layer | Location | Role |
15
52
  | --- | --- | --- |
16
- | Knowledge layer | `.Knowledge/` | Stores business documents, index, routing |
17
- | Execution layer | `.cursor/.claude/.codex` | Stores rules and skill entry points |
53
+ | Knowledge layer (knowledge ring) | `.Knowledge/` | Business docs, index, routing (§2 layers) |
54
+ | Execution layer (rules + skills rings) | `.cursor/.claude/.codex` | Rules and skill entry points |
18
55
 
19
56
  ---
20
57
 
21
- ## 2. Progressive Reading
58
+ ## 4. Progressive Reading
22
59
 
23
60
  The recommended unified order:
24
61
 
@@ -35,7 +72,7 @@ Codex does not read the `rules/` directory; execution constraints are carried th
35
72
 
36
73
  ---
37
74
 
38
- ## 3. Key Chains
75
+ ## 5. Key Chains
39
76
 
40
77
  - Documentation curation chain: `f2s-doc-arch` -> `f2s-doc-final` -> `f2s-ctx-build`
41
78
  - Implementation chain: `.Knowledge/req-docs/*.md` -> `implement-tech-design` -> code
@@ -46,13 +83,13 @@ Codex does not read the `rules/` directory; execution constraints are carried th
46
83
 
47
84
  ---
48
85
 
49
- ## 4. Agent Execution Model
86
+ ## 6. Agent Execution Model
50
87
 
51
88
  Flow2Spec controls execution behavior through two fields in the project root `flow2spec.config.json`: `subAgent` and `switchAgentVerification`.
52
89
 
53
- **How the Agent reads the above truth values**: multi-end prompts + **Read** as authority, see [usage-guide.en.md § 1 (the only detailed table)](./usage-guide.en.md); design summary see [design-principles.en.md § 4, 5.1](./design-principles.en.md).
90
+ **How the Agent reads the above truth values**: multi-end prompts + **Read** as authority, see [usage-guide.md § 1 (the only detailed table)](./usage-guide.md); design summary see [design-principles.md § 4, 5.1](./design-principles.md).
54
91
 
55
- ### 4.1 Primary/Sub Agent Responsibility Division Principle
92
+ ### 6.1 Primary/Sub Agent Responsibility Division Principle
56
93
 
57
94
  **`subAgent: false` (default)**: All `f2s-*` skills execute sequentially within the primary agent, no parallel decomposition.
58
95
 
@@ -65,7 +102,7 @@ Flow2Spec controls execution behavior through two fields in the project root `fl
65
102
 
66
103
  The decomposition boundaries for sub-agents are progressively defined by each `f2s-*` skill body (e.g., thresholds for module count, document count, code line count). **There is currently no unified stage table at the template layer**; the skill body takes precedence.
67
104
 
68
- ### 4.2 Verification Ownership Principle
105
+ ### 6.2 Verification Ownership Principle
69
106
 
70
107
  **Default (whoever writes to disk verifies)**: Verification after write-to-disk or changes is performed within the agent that wrote to disk. If a sub-agent wrote, the sub-agent self-verifies; if the primary agent wrote, the primary agent self-verifies.
71
108
 
@@ -83,7 +120,7 @@ Cross-verification rules:
83
120
 
84
121
  Design intent: Cross-verification introduces an external perspective, reducing the blind spots in the writer's self-verification, but increases execution overhead. It is therefore an explicit opt-in rather than the default behavior.
85
122
 
86
- ### 4.3 Change Tracking (changeTracking)
123
+ ### 6.3 Change Tracking (changeTracking)
87
124
 
88
125
  `changeTracking` is a third dimension independent of `subAgent` / `switchAgentVerification`. It controls whether the skill automatically creates a task checklist that can be continued across sessions during execution.
89
126
 
@@ -104,7 +141,7 @@ Design intent: Cross-verification introduces an external perspective, reducing t
104
141
 
105
142
  ---
106
143
 
107
- ## 5. Design Benefits
144
+ ## 7. Design Benefits
108
145
 
109
146
  1. Share the same business knowledge source across tools
110
147
  2. Does not break the rule loading conventions of Claude/Cursor/Codex
@@ -114,9 +151,9 @@ Design intent: Cross-verification introduces an external perspective, reducing t
114
151
 
115
152
  ---
116
153
 
117
- ## 6. Related Documents
154
+ ## 8. Related Documents
118
155
 
119
- - [Usage Guide](./usage-guide.en.md)
120
- - [Commands Reference](./commands-reference.en.md)
121
- - [Directory Conventions](./directory-conventions.en.md)
122
- - [Usage Scenarios](./usage-scenarios.en.md)
156
+ - [Usage Guide](./usage-guide.md)
157
+ - [Commands Reference](./commands-reference.md)
158
+ - [Directory Conventions](./directory-conventions.md)
159
+ - [Usage Scenarios](./usage-scenarios.md)
@@ -1,4 +1,4 @@
1
- [中文](./README-命令说明.md) | [English](./commands-reference.en.md)
1
+ [中文](../命令说明.md) | [English](./commands-reference.md)
2
2
 
3
3
  # Workflow and Skill Reference
4
4
 
@@ -153,19 +153,17 @@
153
153
 
154
154
  **Purpose**: Converts PDF technical proposals to Markdown format, saves to `req-docs/`, and can supplement the process description.
155
155
 
156
- **How It Works**: Targets the step before "implement from a proposal" — extracts structured content from the PDF (API definitions, data models, sequence flows, etc.) into Markdown under `req-docs/`. Unlike `f2s-doc-final`, the destination and use differ: `doc-pdf` writes to `req-docs/` for consumption by the `implement-tech-design` rule to drive coding; `doc-final` writes to `stock-docs/` for ingestion via `ctx-build`.
156
+ **How It Works**: Extracts structured content from the PDF (API definitions, data models, sequence flows, etc.) into Markdown under `req-docs/` for editing and follow-up with `f2s-req-clarify` / `f2s-req-backend`. Unlike `f2s-doc-final`, `doc-pdf` writes to `req-docs/`; `doc-final` writes to `stock-docs/` for `ctx-build`. **Not recommended** as a shortcut for "PDF straight to coding" without clarification and a backend technical proposal.
157
157
 
158
158
  **Use Cases**:
159
- - A PDF technical proposal needs to be implemented
160
- - Historical PDF documents need to be managed
161
- - Cross-team deliverables are in PDF format and need conversion
159
+ - Cross-team deliverables are in PDF format and need conversion to editable Markdown
160
+ - Historical PDF proposals need to live under `req-docs/`
161
+ - Provide a readable draft before `f2s-req-clarify` / `f2s-req-backend`
162
162
 
163
163
  **Relationships**:
164
164
  - **Prerequisite**: PDF document
165
165
  - **Output**: `.Knowledge/req-docs/<Proposal>.md`
166
- - **Next Step**:
167
- - 1. If it is a requirement to implement: provide the converted proposal path with instructions "implement according to the technical proposal", driven by the `implement-tech-design` rule
168
- - 2. If it is for knowledge base archival: follow the final-draft conversion flow `f2s-doc-final` -> `f2s-ctx-build`
166
+ - **Next Step** (recommended): `f2s-req-clarify` → `f2s-req-backend` → implement from the technical proposal MD via `implement-tech-design`; for knowledge base archival use `f2s-doc-final` → `f2s-ctx-build`
169
167
 
170
168
  **Sub-Agent Invocation**:
171
169
  - `subAgent: false` (default): The main agent completes the full workflow
@@ -594,7 +592,7 @@ Controlled via `flow2spec.config.json` at the project root (all fields default t
594
592
 
595
593
  ### How Different Products "See" the Configuration (use with the field table below)
596
594
 
597
- `subAgent` and similar fields are written to the **on-disk JSON**; products do not guarantee automatic file opening. Therefore, multi-layered hints are provided via **Cursor rules / Claude hooks / Codex AGENTS snapshot table / knowledge base `config-precheck` summary**, but **the authoritative source remains `Read("flow2spec.config.json")`** (design rationale in [design-principles.en.md — Agent Orchestration § 5.1](./design-principles.en.md); talk / deck pacing in [intro deck HTML](../presentations/flow2spec-intro-public-en/index.html), config section). **The full path and table are maintained in one place**: [usage-guide.en.md Sec. 1, `f2s-*` and `flow2spec.config.json`](./usage-guide.en.md).
595
+ `subAgent` and similar fields are written to the **on-disk JSON**; products do not guarantee automatic file opening. Therefore, multi-layered hints are provided via **Cursor rules / Claude hooks / Codex AGENTS snapshot table / knowledge base `config-precheck` summary**, but **the authoritative source remains `Read("flow2spec.config.json")`** (design rationale in [design-principles.md — Agent Orchestration § 5.1](./design-principles.md); talk / deck pacing in [intro deck HTML](../../presentations/flow2spec-intro-public-en/index.html) (internal); Chinese source in `flow2spec-intro-draft`, config section). **The full path and table are maintained in one place**: [usage-guide.md Sec. 1, `f2s-*` and `flow2spec.config.json`](./usage-guide.md).
598
596
 
599
597
  ### `subAgent` Field
600
598
 
@@ -632,20 +630,20 @@ A nested object, with each skill independently controlled:
632
630
 
633
631
  > `f2s-req-plan` is not constrained by this configuration; it always creates a task checklist. Legacy boolean values (`"changeTracking": true/false`) are backward-compatible and automatically expand to all three sub-fields on/off.
634
632
 
635
- For full principles and design intent, see [architecture.en.md Sec. 4. Agent Execution Model](./architecture.en.md).
633
+ For full principles and design intent, see [architecture.md Sec. 4. Agent Execution Model](./architecture.md).
636
634
 
637
635
  ---
638
636
 
639
637
  ## 7) Quick Reference
640
638
 
641
- For typical work scenarios and full workflows, see [Usage Guide § 3. Typical Workflows](./usage-guide.en.md).
639
+ For typical work scenarios and full workflows, see [Usage Guide § 3. Typical Workflows](./usage-guide.md).
642
640
 
643
- For a complete directory description, see [Directory Conventions](./directory-conventions.en.md).
641
+ For a complete directory description, see [Directory Conventions](./directory-conventions.md).
644
642
 
645
643
  ---
646
644
 
647
645
  Related Documents:
648
- - [Usage Guide](./usage-guide.en.md)
649
- - [Directory Conventions](./directory-conventions.en.md)
650
- - [Architecture](./architecture.en.md)
651
- - [Usage Scenarios](./usage-scenarios.en.md)
646
+ - [Usage Guide](./usage-guide.md)
647
+ - [Directory Conventions](./directory-conventions.md)
648
+ - [Architecture](./architecture.md)
649
+ - [Usage Scenarios](./usage-scenarios.md)
@@ -1,4 +1,4 @@
1
- [中文](./Flow2Spec-设计说明.md) | [English](./design-principles.en.md)
1
+ [中文](../设计说明.md) | [English](./design-principles.md)
2
2
 
3
3
  # Flow2Spec Design Principles
4
4
 
@@ -21,6 +21,25 @@ Team experience ──┘ reinterpreted ├── topics/
21
21
 
22
22
  ## Core Design
23
23
 
24
+ ### 0. Memory Coding and Four Rings
25
+
26
+ **Memory Coding**: encode durable context into the **committed repository** (PR-reviewable), not private model memory or chat-only context.
27
+
28
+ Four rings in the repo (rules ring and skills ring are separate—do not merge):
29
+
30
+ | Ring | Location | Role |
31
+ | --- | --- | --- |
32
+ | Knowledge | `.Knowledge/` | Routing, topics, stock/req docs |
33
+ | Task | `.task/` | Cross-session continuation, user todos |
34
+ | Rules | Tool `rules` / `AGENTS.md` | How to read and act |
35
+ | Skills | `f2s-*` / `skills/` | Maintain KB, trigger workflows |
36
+
37
+ Flow2Spec delivers the **Memory Coding persistence and maintenance loop**, not "another RAG knowledge base."
38
+
39
+ ### 0.1 Knowledge Ring: Multi-Layer Memory
40
+
41
+ Inside the knowledge ring: **horizontal narrowing** (L0 manifest → L1 matchers → L2 topics → L3 long docs) plus **vertical chaining** (`topicDependencies`: common → subdomain → whitelist → domain). The `match → expand → verify → act` pipeline operates on these layers; see [architecture.md §4](./architecture.md).
42
+
24
43
  ### 1. Separation of Knowledge and Rules
25
44
 
26
45
  ```mermaid
@@ -80,7 +99,7 @@ graph LR
80
99
  CMT -->|"Not in KB, remind\n-> kb-sync/kb-feat"| K
81
100
 
82
101
  D1["Architecture Docs"] -->|f2s-doc-arch| FIN["f2s-doc-final"]
83
- D2["PDF Proposal"] -->|f2s-doc-pdf| FIN
102
+ D2["PDF/draft"] -->|f2s-doc-final| FIN
84
103
  FIN --> CTX["f2s-ctx-build"] --> K
85
104
 
86
105
  OLD["Existing Code/Docs"] -->|f2s-doc-add| K
@@ -463,7 +482,7 @@ Session context itself is an information source · no need for users to organi
463
482
  | **Codex `AGENTS.md` + `renderProjectConfigBlock`** | Top-level **Read** hard constraint + **init snapshot table** (if inconsistent with disk, Read takes precedence). |
464
483
  | **Knowledge base `config-precheck` topic** | When routing hits, provides only **summary** and a pointer to the Codex full text, **not** a substitute for Read JSON. |
465
484
 
466
- **Authority remains** the **Read** result of the project-root JSON; each layer is a prompt, not a second source of truth. For the complete operational table and paths, see **[Usage Guide § 1. `f2s-*` and `flow2spec.config.json`](./usage-guide.en.md)**.
485
+ **Authority remains** the **Read** result of the project-root JSON; each layer is a prompt, not a second source of truth. For the complete operational table and paths, see **[Usage Guide § 1. `f2s-*` and `flow2spec.config.json`](./usage-guide.md)**.
467
486
 
468
487
  #### 6. Skills don't restate unified entry rules, only reference them
469
488
 
@@ -593,7 +612,7 @@ Best suited when: has scale · long-term iteration · multi-tool or multi-person
593
612
 
594
613
  ## Related Documents
595
614
 
596
- - [Usage Guide](./usage-guide.en.md)
597
- - [Commands Reference](./commands-reference.en.md)
598
- - [Architecture](./architecture.en.md)
599
- - [Usage Scenarios](./usage-scenarios.en.md)
615
+ - [Usage Guide](./usage-guide.md)
616
+ - [Commands Reference](./commands-reference.md)
617
+ - [Architecture](./architecture.md)
618
+ - [Usage Scenarios](./usage-scenarios.md)
@@ -1,11 +1,14 @@
1
- [中文](./README-目录与路径约定.md) | [English](./directory-conventions.en.md)
1
+ [中文](../目录与路径约定.md) | [English](./directory-conventions.md)
2
2
 
3
3
  # Directory and Path Conventions
4
4
 
5
5
  ## Core Boundary
6
6
 
7
- - `.Knowledge/`: Business knowledge documents and index only
8
- - `Config Root` (`.cursor/.claude/.codex`): Rules and skill entry points
7
+ - `.Knowledge/`: **Knowledge ring** business docs and machine-readable routing ([architecture.md §2](./architecture.md))
8
+ - `.task/`: **Task ring** change tracking (not inside `.Knowledge/`)
9
+ - `Config Root` (`.cursor/.claude/.codex`): **Rules ring + skills ring**
10
+
11
+ See [architecture.md §1](./architecture.md) for Memory Coding four rings.
9
12
 
10
13
  ---
11
14
 
@@ -13,13 +16,15 @@
13
16
 
14
17
  | Path | Responsibility |
15
18
  | --- | --- |
16
- | `.Knowledge/stock-docs/` | Architecture, final drafts, reference documents |
17
- | `.Knowledge/req-docs/` | Requirement clarification, technical proposals |
18
- | `.Knowledge/topics/` | Topic routing documents (for rules and workflow execution) |
19
+ | `docs/` | Product docs (**Chinese**): usage guide, commands reference, design principles, etc. |
20
+ | `docs/en/` | Product docs (**English**): six paired documents; see [README.md](./README.md) |
21
+ | `.Knowledge/stock-docs/` | **L3** Architecture, final drafts, reference documents |
22
+ | `.Knowledge/req-docs/` | **L3** Requirement clarification, technical proposals |
23
+ | `.Knowledge/topics/` | **L2** Topic summaries (hard constraints, boundaries, pointers) |
19
24
  | `.Knowledge/template/` | Templates for final drafts / technical proposals |
20
25
  | `.Knowledge/index.md` | Human-readable index |
21
- | `.Knowledge/manifest-routing.json` | Machine-readable routing skeleton (task/topic/dependencies) |
22
- | `.Knowledge/matchers/*.json` | Keyword fragments (`id/includeAny`), directly linked by `manifest-routing.taskToTopicRules[].matcherPath` |
26
+ | `.Knowledge/manifest-routing.json` | **L0** Machine-readable routing skeleton (task/topic/`topicDependencies`) |
27
+ | `.Knowledge/matchers/*.json` | **L1** Keyword fragments (`id/includeAny`); **match** reads one shard via `matcherPath` |
23
28
  | `.Knowledge/migration-report.md` | Migration comparison table and deletion path list written by `f2s-kb-migrate` |
24
29
  | `.task/` | Change tracking task directory (`active/` for in-progress, `completed/` for archived with directory name in the format **`<YYYYMMDD>-<task-name>`** (date first), `todo.json` for active task index); created only when `changeTracking.*` is `true` or `f2s-req-plan` is explicitly invoked |
25
30
  | `Config Root/rules/` | Rule files (Cursor `.mdc`, Claude `.md`) |
@@ -28,7 +33,7 @@
28
33
  | `.codex/AGENTS.md` | Codex unified entry point and loading instructions |
29
34
  | `flow2spec.config.json` | Project root configuration, controls `subAgent`, `switchAgentVerification`, `changeTracking` (nested object with `feat` / `fix` / `implement` sub-items) |
30
35
 
31
- > See [Usage Guide Section 1](./usage-guide.en.md) for multi-platform references and path tables (detail maintained in a single table); **the authoritative source remains `Read(flow2spec.config.json)`**.
36
+ > See [Usage Guide Section 1](./usage-guide.md) for multi-platform references and path tables (detail maintained in a single table); **the authoritative source remains `Read(flow2spec.config.json)`**.
32
37
 
33
38
  ---
34
39
 
@@ -43,7 +48,7 @@
43
48
 
44
49
  ## Related Documents
45
50
 
46
- - [Usage Guide](./usage-guide.en.md)
47
- - [Commands Reference](./commands-reference.en.md)
48
- - [Architecture](./architecture.en.md)
49
- - [Usage Scenarios](./usage-scenarios.en.md)
51
+ - [Usage Guide](./usage-guide.md)
52
+ - [Commands Reference](./commands-reference.md)
53
+ - [Architecture](./architecture.md)
54
+ - [Usage Scenarios](./usage-scenarios.md)