Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .Knowledge/manifest-routing.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.8.1",
"version": "3.8.3",
"knowledgeRoot": ".Knowledge",
"matcherKey": "matcherId",
"sourceOfTruth": ".Knowledge/manifest-routing.json",
Expand Down Expand Up @@ -74,7 +74,7 @@
"topics": [
"f2s-task"
],
"summary": "任务清单 .task 目录的创建、续作与归档规则"
"summary": "任务清单 .task 目录的创建、续作、归档与跨机同步规则"
},
{
"task": "req-plan",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@

### Git 与跨电脑续作

`.gitignore` 使用 `.task/completed/` 与 `.task/*/completed/`,仅忽略两种布局的已完成归档。进行中的 `active/`、`todo.json` 与任务上下文可随代码提交、推送,在另一台电脑拉取后续作;两端应保持相同 `collaboration.developerId`(或相同的 Git 身份解析结果)。`init` 会将旧的整目录 `.task/` 忽略规则迁为上述两条规则。
`collaboration.syncActiveTasks=true`(默认)时,`.gitignore` 使用 `.task/completed/` 与 `.task/*/completed/`,仅忽略两种布局的已完成归档;进行中的 `active/`、`todo.json` 与任务上下文可随代码提交、推送,在另一台电脑拉取后续作。`false` 时整个 `.task/` 留在本地。`init` 会按开关维护 `.gitignore`,并迁移旧的整目录 `.task/` 规则。

跨机续作要求两端解析出相同 `developerId`;共享仓库中推荐两端使用相同 `git config user.email`,不要把个人 id 写进受跟踪的 `flow2spec.config.json`。`flow2spec doctor` 会显示解析来源与 `TASK_ROOT`。提交前必须检查 `user-todos.md` / `context.md`,不得写入密码、token、私钥、数据库连接串或内网地址;归档已提交任务时,把 Git 显示的删除一并提交。

### 3.1 `user-todos.md` 与 `acceptance.md`:用户侧两份文件,职责分离

Expand Down
10 changes: 6 additions & 4 deletions .Knowledge/topics/f2s-task.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: f2s-task
revision: 1
summary: "任务清单 .task 目录的创建、续作与归档规则"
revision: 2
summary: "任务清单 .task 目录的创建、续作、归档与跨机同步规则"
primary: policy
confidence: manual
---
Expand Down Expand Up @@ -51,9 +51,11 @@ TASK_ROOT/ ← `.task` 或 `.task/<developerId>`

## Git 与跨电脑续作

- `.gitignore` 使用 `.task/completed/` 与 `.task/*/completed/`,忽略单人及多人布局的已完成归档。
- `collaboration.syncActiveTasks=true`(默认):`.gitignore` 仅使用 `.task/completed/` 与 `.task/*/completed/`,进行中任务可随 Git 同步;`false` 时整个 `.task/` 留在本地。
- `active/`、`todo.json` 与任务上下文可提交并推送;另一台电脑拉取后,使用相同 developerId 解析到原 TASK_ROOT 续作。
- `init` 自动将旧的整目录 `.task/` 忽略规则迁为上述两条规则。
- 跨机身份要求两端解析一致,推荐两端使用相同 `git config user.email`;`flow2spec doctor` 显示当前来源与 TASK_ROOT。
- 提交前检查 `user-todos.md` / `context.md` 是否含凭据或内网信息;归档产生的删除 diff 与任务提交一并同步。
- `init` 按 `syncActiveTasks` 维护 `.gitignore`,并迁移旧的整目录 `.task/` 规则。

## 跨会话续作

Expand Down
5 changes: 3 additions & 2 deletions .Knowledge/topics/flow2spec-collaboration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: flow2spec-collaboration
revision: 2
revision: 3
summary: "任务按身份隔离与跨电脑续作、知识 delta 合入及 revision 冲突处理"
dependsOn: [f2s-task]
primary: feature
Expand All @@ -17,9 +17,10 @@ tags: [policy]

## 协作边界

- `.task/<developerId>/` 保存个人 checklist、会话上下文与用户代办;进行中任务可随代码提交,completed 归档由 `.task/completed/` 与 `.task/*/completed/` 忽略;Agent 只读写当前 `TASK_ROOT`。
- `.task/<developerId>/` 保存个人 checklist、会话上下文与用户代办;`collaboration.syncActiveTasks=true`(默认)时进行中任务可随代码提交,completed 归档由 `.task/completed/` 与 `.task/*/completed/` 忽略;`false` 时整个 `.task/` 留在本地;Agent 只读写当前 `TASK_ROOT`。
- `.Knowledge/` 保存团队共享事实,随代码通过 Git / PR 评审。
- `collaboration.enabled` 只控制任务根是否按 developerId 分层,不关闭知识库协作。
- 跨机续作要求两端解析出相同 developerId;推荐两端使用相同 `git config user.email`,共享仓库不要往受跟踪的 `flow2spec.config.json` 写个人 id。

## 知识合入

Expand Down
4 changes: 2 additions & 2 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ Flow2Spec does not add documentation for its own sake. It keeps a small, machine
| Topic shards | Stores project facts such as APIs, limits, locks, data rules, and workflows. | `.Knowledge/topics/*.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 |
| Team collaboration | Keeps each developer's task state local while merging reviewed knowledge through structured deltas and topic revisions. | `.task/<developerId>/`, `.Knowledge/` |
| Team collaboration | In-progress tasks can travel with the code for continuation on another computer, while completed archives stay local; reviewed knowledge is merged through structured deltas and topic revisions. | `.task/<developerId>/`, `.Knowledge/` |

## Built for shared repositories

Flow2Spec separates collaboration state by ownership. Checklists, session context, and user todos stay under each developer's local `TASK_ROOT` and do not enter Git. Confirmed project knowledge remains shared in `.Knowledge/`.
Flow2Spec separates collaboration state by ownership. Checklists, session context, and user todos live under each developer's `TASK_ROOT`; with `collaboration.syncActiveTasks=true` (the default), in-progress tasks can be committed with the code while `completed/` archives stay local. Confirmed project knowledge remains shared in `.Knowledge/`.

Knowledge-producing skills write a structured `kb-delta.json` instead of editing topic files directly. Before apply, the CLI compares the delta's `baseRevisions` with the topic revisions on disk. Different topics can merge independently; concurrent changes to the same topic stop for a semantic review after the latest branch state is pulled.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ Flow2Spec 不是为了增加文档数量。它把项目事实保存在一层小
| 主题分片 | 保存 API、上限、锁、数据规则、业务流程等项目事实。 | `.Knowledge/topics/*.md` |
| Agent 入口 | 为选中的 AI 编程客户端安装规则和技能。 | 客户端配置根、`.dsh/`、`AGENTS.md` |
| 技能工作流 | 澄清需求、编写方案、实现、修复、同步知识、提交。 | `f2s-*` skills |
| 团队协作 | 每个人的任务现场留在本地,确认后的知识通过结构化 delta 与 topic revision 合入共享仓库。 | `.task/<developerId>/`, `.Knowledge/` |
| 团队协作 | 进行中任务可随代码同步以跨电脑续作,completed 归档留在本地;确认后的知识通过结构化 delta 与 topic revision 合入共享仓库。 | `.task/<developerId>/`, `.Knowledge/` |

## 多人共用一份知识库

Flow2Spec 按所有权拆分协作状态。checklist、会话上下文和用户代办保存在每名开发者自己的 `TASK_ROOT`,默认不进 Git;已经确认的项目知识统一进入 `.Knowledge/`。
Flow2Spec 按所有权拆分协作状态。checklist、会话上下文和用户代办保存在每名开发者自己的 `TASK_ROOT`;`collaboration.syncActiveTasks=true`(默认)时进行中任务可随代码提交,`completed/` 归档留在本地;已经确认的项目知识统一进入 `.Knowledge/`。

知识类技能先生成结构化 `kb-delta.json`,不直接改 topic。真正 apply 前,CLI 会比较 delta 的 `baseRevisions` 与磁盘上的 topic revision。修改不同 topic 可以分别合入;两个人同时修改同一 topic 时,后合入的一方需要先拉取最新版本、重读语义,再改写 delta。

Expand Down
2 changes: 1 addition & 1 deletion docs/Flow2Spec基础介绍.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ flowchart TD

图 3:任务分开,知识合流

`.task/` 默认不进 Git,并按 `developerId` 分成不同的 `TASK_ROOT`。Alice 的 Agent 不会为了找续作任务去扫描 Bob 的目录。这里保存的是 checklist、会话上下文和用户代办,它们属于执行者自己的工作现场。
`.task/` 默认只把 `completed/` 归档留在本地,进行中任务可按 `collaboration.syncActiveTasks` 随代码同步,用于同一开发者跨电脑续作;目录仍按 `developerId` 分成不同的 `TASK_ROOT`。Alice 的 Agent 不会为了找续作任务去扫描 Bob 的目录。这里保存的是 checklist、会话上下文和用户代办,它们属于执行者自己的工作现场。

`.Knowledge/` 则必须全员共享。技能先把知识变更写成结构化 delta,里面带着读取时的 topic revision;真正写入前由 `flow2spec kb plan` 检查磁盘版本。两个人改不同 topic 可以各自推进,改到同一个 topic 时,后合入的一方必须拉取最新版本、重新理解语义,再更新 delta。

Expand Down
2 changes: 1 addition & 1 deletion docs/en/Flow2Spec-Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ flowchart LR

Figure 3: Tasks stay separate; knowledge converges

`.task/` is ignored by Git by default and split into developer-specific `TASK_ROOT` directories. `.Knowledge/` is shared. Skills express changes as structured deltas with the topic revisions they read; `flow2spec kb plan` checks those revisions before disk writes. Different topics can advance independently. When two people change the same topic, the second person pulls, rereads the latest meaning, and rewrites the delta.
`.task/` keeps only `completed/` archives local by default; in-progress tasks can travel through Git (controlled by `collaboration.syncActiveTasks`) for the same developer's cross-computer continuation, and remain split into developer-specific `TASK_ROOT` directories. `.Knowledge/` is shared. Skills express changes as structured deltas with the topic revisions they read; `flow2spec kb plan` checks those revisions before disk writes. Different topics can advance independently. When two people change the same topic, the second person pulls, rereads the latest meaning, and rewrites the delta.

This is not automatic text concatenation. It isolates state that should remain personal, keeps shared facts in Git, and stops where a semantic decision is needed. See [Team Collaboration](./team-collaboration.md).

Expand Down
8 changes: 4 additions & 4 deletions docs/en/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ The documentation curation chain produces two document types:

Flow2Spec assumes that a team shares one knowledge base. It applies opposite policies to two loops: **task state is separated; knowledge is merged**.

- **Task loop**: `.task/` stays out of Git and is partitioned by `<developerId>/` as personal working state.
- **Task loop**: `.task/` is partitioned by `<developerId>`. With `collaboration.syncActiveTasks=true` (default), only `completed/` stays out of Git while in-progress tasks can travel with the code for the same developer's cross-computer continuation; with `false`, the whole directory stays local.
- **Knowledge loop**: `.Knowledge/` stays in Git. Topic-level integer `revision` values act as optimistic disk locks, while `kb-delta.json` carries structured changes into the shared knowledge base.

Both policies follow the same rule: team facts belong in Git; personal execution state does not.
Both policies follow the same rule: team facts belong in Git; personal execution state may travel for continuity, but it is not team truth.

### 6.1 Task loop: a local TASK_ROOT per developer

With collaboration enabled, each developer gets `.task/<developerId>/`. The task rule creates, resumes, and archives tasks only under the current `TASK_ROOT`; it must not scan another developer's `todo.json`. If collaboration is disabled or no identity is available, Flow2Spec retains the legacy `.task/` root.

Because `.task/` is local, team progress should be read from PRs, commits, `.Knowledge/` diffs, and milestones, not from another person's active checklist.
With `collaboration.syncActiveTasks=true`, `active/`, `todo.json`, and `kb-delta.json` can be committed with the code; `completed/` stays local. Both machines must resolve the same `developerId` (preferably the same `git config user.email`); `flow2spec doctor` prints the resolved source and `TASK_ROOT`. Team progress should still be read from PRs, commits, `.Knowledge/` diffs, and milestones, not from task files.

### 6.2 Knowledge loop: structured deltas and optimistic locking

Expand All @@ -125,7 +125,7 @@ This is a topic-level lock. Two unrelated edits to different sections of the sam

### 6.3 Why the boundary is drawn here

Sharing `.task/` would turn rapidly changing checklists and session context into repository noise. Splitting `.Knowledge/` by developer would create competing versions of project truth. Keeping the first local and the second reviewable gives each kind of state one owner and one lifecycle. See [Team Collaboration](./team-collaboration.md) for the complete workflow and conflict examples.
Treating task state as a team board would turn rapidly changing checklists and session context into repository noise. Splitting `.Knowledge/` by developer would create competing versions of project truth. Keeping `completed/` local, syncing only in-progress tasks for the same developer, and keeping knowledge reviewable gives each kind of state one owner and one lifecycle. See [Team Collaboration](./team-collaboration.md) for the complete workflow and conflict examples.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/en/commands-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ It checks:
- whether `flow2spec.config.json`, root `AGENTS.md`, and `.Knowledge/manifest-routing.json` exist and are usable
- whether detected `.codex`, `.claude`, and `.cursor` roots contain their required entry and hook files
- the resolved `developerId`, source, and `TASK_ROOT`; falling back to the legacy `.task/` root produces a warning
- whether the root `.gitignore` ignores `.task/completed/` and `.task/*/completed/` while allowing active tasks to be committed
- whether the root `.gitignore` matches `collaboration.syncActiveTasks`: `true` ignores only `.task/completed/` and `.task/*/completed/` while allowing active tasks to be committed; `false` ignores the whole `.task/`
- strict knowledge graph health, topic revisions, and routing metadata drift

Human-readable output marks each check with `[PASS]`, `[WARN]`, or `[FAIL]` and includes a repair suggestion when applicable. `--json` returns a stable `ok / package / cwd / summary / checks` structure for CI and scripts.
Expand Down
4 changes: 3 additions & 1 deletion docs/en/design-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,13 @@ Old
.task/ -> Git -> everyone shares one todo.json

Current
.task/alice/ -> Alice resumes locally
.task/alice/ -> Alice resumes locally; with syncActiveTasks=true, active/todo can travel through Git
.task/bob/ -> Bob resumes locally
.Knowledge/ -> Git -> shared team facts
```

Cross-computer continuation does not return to a single shared `todo.json`: the `developerId` partition remains, only in-progress tasks and `todo.json` can be synced, `completed/` stays local, and both machines must resolve the same `developerId`. The behavior is controlled by `collaboration.syncActiveTasks` (default on; it can be turned off for local-only state).

The current developer's `TASK_ROOT` owns progress. Code, formal documents, and `.Knowledge/` own the delivered capability. `developerId` remains useful on shared machines and as an Agent read boundary; it is not a remote identity or authorization system.

### 6. Why Knowledge Merges Use Optimistic Locks
Expand Down
Loading
Loading