@fenglimg/fabric-cli 2.1.0-rc.2 → 2.2.0-rc.1
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.
- package/dist/{chunk-PWLW3B57.js → chunk-2CY4BMTH.js} +5 -1
- package/dist/{chunk-F46ORPOA.js → chunk-2R55HNVD.js} +82 -5
- package/dist/{chunk-HFQVXY6P.js → chunk-4R2CYEA4.js} +31 -1
- package/dist/{chunk-BATF4PEJ.js → chunk-AOE6AYI7.js} +2 -2
- package/dist/{chunk-WWNXR34K.js → chunk-BO4XIZWZ.js} +8 -1
- package/dist/{chunk-MF3OTILQ.js → chunk-XC5RUHLK.js} +29 -8
- package/dist/{config-XJIPZNUP.js → config-XYRBZJDU.js} +3 -3
- package/dist/{doctor-QVNPHLJK.js → doctor-YONYXDX6.js} +39 -26
- package/dist/index.js +54 -14
- package/dist/{install-2HDO5FTQ.js → install-74ANPCCP.js} +88 -34
- package/dist/{metrics-ACEQFPDU.js → metrics-RER6NLFC.js} +22 -9
- package/dist/{onboard-coverage-MFCAEBDO.js → onboard-coverage-JWQWDZW7.js} +1 -1
- package/dist/{scope-explain-2F2R5URO.js → scope-explain-CDIZESP5.js} +6 -2
- package/dist/{store-XTSE5TY6.js → store-XB3ADT65.js} +50 -11
- package/dist/{sync-BJCWDPNC.js → sync-UJ4BBCZJ.js} +18 -12
- package/dist/{uninstall-TAXSUSKH.js → uninstall-C3QXKOO6.js} +35 -4
- package/dist/{whoami-B6AEMSEV.js → whoami-2MLO4Y37.js} +10 -5
- package/package.json +3 -3
- package/templates/hooks/fabric-hint.cjs +99 -7
- package/templates/hooks/knowledge-hint-broad.cjs +164 -9
- package/templates/hooks/knowledge-hint-narrow.cjs +10 -4
- package/templates/hooks/lib/injection-log.cjs +91 -0
- package/templates/hooks/lib/state-store.cjs +30 -11
- package/templates/skills/fabric-audit/SKILL.md +53 -0
- package/templates/skills/fabric-connect/SKILL.md +48 -0
- package/templates/skills/fabric-review/SKILL.md +2 -0
- package/templates/skills/fabric-review/ref/cite-contract.md +56 -0
- package/templates/skills/fabric-store/SKILL.md +44 -0
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
* acceptable — the hook never blocks user flow on sidecar I/O, KT-DEC-0007).
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
// Namespace import (not destructured) so the atomic write goes through a single
|
|
25
|
+
// mutable fs reference — also what the atomicity tests spy on (ISS-016).
|
|
26
|
+
const fs = require("node:fs");
|
|
25
27
|
const { dirname, join } = require("node:path");
|
|
26
28
|
|
|
27
29
|
const CACHE_DIR_REL = join(".fabric", ".cache");
|
|
@@ -30,11 +32,31 @@ function cachePath(projectRoot, fileName) {
|
|
|
30
32
|
return join(projectRoot, CACHE_DIR_REL, fileName);
|
|
31
33
|
}
|
|
32
34
|
|
|
35
|
+
// ISS-016: write to a unique temp file then rename over the target. rename is
|
|
36
|
+
// atomic on POSIX, so a reader sees either the old or the new file in full —
|
|
37
|
+
// never a truncated/garbled write from a crash or concurrent writer. The temp
|
|
38
|
+
// suffix (pid + clock) keeps concurrent windows from colliding on the temp.
|
|
39
|
+
function atomicWrite(path, data) {
|
|
40
|
+
fs.mkdirSync(dirname(path), { recursive: true });
|
|
41
|
+
const tmp = `${path}.tmp-${process.pid}-${Date.now()}`;
|
|
42
|
+
try {
|
|
43
|
+
fs.writeFileSync(tmp, data);
|
|
44
|
+
fs.renameSync(tmp, path);
|
|
45
|
+
} catch (err) {
|
|
46
|
+
try {
|
|
47
|
+
if (fs.existsSync(tmp)) fs.unlinkSync(tmp);
|
|
48
|
+
} catch {
|
|
49
|
+
// best-effort temp cleanup
|
|
50
|
+
}
|
|
51
|
+
throw err;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
33
55
|
function readJsonState(projectRoot, fileName, validate) {
|
|
34
56
|
const path = cachePath(projectRoot, fileName);
|
|
35
|
-
if (!existsSync(path)) return null;
|
|
57
|
+
if (!fs.existsSync(path)) return null;
|
|
36
58
|
try {
|
|
37
|
-
const parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
59
|
+
const parsed = JSON.parse(fs.readFileSync(path, "utf8"));
|
|
38
60
|
if (typeof validate === "function" && !validate(parsed)) return null;
|
|
39
61
|
return parsed;
|
|
40
62
|
} catch {
|
|
@@ -43,10 +65,8 @@ function readJsonState(projectRoot, fileName, validate) {
|
|
|
43
65
|
}
|
|
44
66
|
|
|
45
67
|
function writeJsonState(projectRoot, fileName, value) {
|
|
46
|
-
const path = cachePath(projectRoot, fileName);
|
|
47
68
|
try {
|
|
48
|
-
|
|
49
|
-
writeFileSync(path, JSON.stringify(value));
|
|
69
|
+
atomicWrite(cachePath(projectRoot, fileName), JSON.stringify(value));
|
|
50
70
|
return true;
|
|
51
71
|
} catch {
|
|
52
72
|
return false;
|
|
@@ -55,19 +75,17 @@ function writeJsonState(projectRoot, fileName, value) {
|
|
|
55
75
|
|
|
56
76
|
function readTextState(projectRoot, fileName) {
|
|
57
77
|
const path = cachePath(projectRoot, fileName);
|
|
58
|
-
if (!existsSync(path)) return null;
|
|
78
|
+
if (!fs.existsSync(path)) return null;
|
|
59
79
|
try {
|
|
60
|
-
return readFileSync(path, "utf8").trim();
|
|
80
|
+
return fs.readFileSync(path, "utf8").trim();
|
|
61
81
|
} catch {
|
|
62
82
|
return null;
|
|
63
83
|
}
|
|
64
84
|
}
|
|
65
85
|
|
|
66
86
|
function writeTextState(projectRoot, fileName, text) {
|
|
67
|
-
const path = cachePath(projectRoot, fileName);
|
|
68
87
|
try {
|
|
69
|
-
|
|
70
|
-
writeFileSync(path, String(text));
|
|
88
|
+
atomicWrite(cachePath(projectRoot, fileName), String(text));
|
|
71
89
|
return true;
|
|
72
90
|
} catch {
|
|
73
91
|
return false;
|
|
@@ -80,5 +98,6 @@ module.exports = {
|
|
|
80
98
|
writeJsonState,
|
|
81
99
|
readTextState,
|
|
82
100
|
writeTextState,
|
|
101
|
+
atomicWrite,
|
|
83
102
|
CACHE_DIR_REL,
|
|
84
103
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fabric-audit
|
|
3
|
+
description: 知识库语义淘汰门面 — 审计 KB 健康并以 deprecate-over-delete + rescue-before-delete 收口陈旧/孤儿/被取代条目。引擎是 `fabric doctor`;本 skill 按用户意图挑动作并守「不硬删、先抢救」红线。Triggers 审计知识库/清理陈旧知识/知识库体检/deprecate 条目/prune stale knowledge/知识库瘦身/淘汰旧决策.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# fabric-audit — 知识库语义淘汰
|
|
7
|
+
|
|
8
|
+
知识库 *维护期* 的对话入口:体检 KB,把陈旧 / 孤儿 / 被取代的条目按 **语义淘汰** 收口 —— 而不是一删了之。CLI (`fabric doctor`) 是引擎(跑 lint、算 health、给 orphan/stale 信号);本 skill 按用户意图挑动作,并守两条红线:**deprecate-over-delete** 与 **rescue-before-delete**。
|
|
9
|
+
|
|
10
|
+
写新条目用 `fabric-archive`;批量审 pending 用 `fabric-review`;本 skill 专管 *已归档条目的退役*。
|
|
11
|
+
|
|
12
|
+
## When to use
|
|
13
|
+
|
|
14
|
+
- 「审计 / 体检知识库」「知识库健康度怎样?」
|
|
15
|
+
- 「清理陈旧知识」「这些旧决策还要吗?」「知识库瘦身」
|
|
16
|
+
- 发布 / 大重构前想把过时知识收口。
|
|
17
|
+
- doctor 报了 orphan / stale / 低 health,想逐条处置。
|
|
18
|
+
|
|
19
|
+
## When NOT to use
|
|
20
|
+
|
|
21
|
+
- 写 / 提议新知识条目 → `fabric-archive`。
|
|
22
|
+
- 批量审 `.fabric/knowledge/pending/` 的 draft → `fabric-review`。
|
|
23
|
+
- store 运维 / 同步 → `fabric-store` / `fabric-sync`。
|
|
24
|
+
|
|
25
|
+
## 两条红线
|
|
26
|
+
|
|
27
|
+
1. **deprecate-over-delete**:陈旧 ≠ 该删。一条「当时为什么这么决策」的 decision/pitfall 即使方案已换,其 **rationale 仍是知识**。退役 = 降 maturity / 标记 deprecated(保留正文 + 记录被什么取代),而非 `rm`。删除只用于「从未成立 / 纯噪声 / 重复」的条目。
|
|
28
|
+
2. **rescue-before-delete**:任何 *打算删* 的条目,删前必做抢救检查 —— 它是否携带别处没有的独特 rationale / 反例 / 边界?有则先 **merge 进取代它的条目**(或在新条目加 `related` 边指回),再删空壳。抢救检查没做过,不许删。
|
|
29
|
+
|
|
30
|
+
## 意图 → 动作映射
|
|
31
|
+
|
|
32
|
+
| 意图 | 动作 |
|
|
33
|
+
|---|---|
|
|
34
|
+
| 体检 / 健康度 | `fabric doctor`(读 lint + health rollup);零阻断,只报告 |
|
|
35
|
+
| 找孤儿 / 陈旧条目 | `fabric doctor`(消费 orphan / stale / orphan-demote 信号) |
|
|
36
|
+
| 退役一条陈旧条目 | **不删** → 降 maturity(proven→verified→draft)或在 frontmatter 标 deprecated + 记 superseded-by;经 `fabric-review` 落盘 |
|
|
37
|
+
| 删一条「从未成立 / 重复」条目 | 先跑 rescue 检查(独特 rationale?有则 merge/加 related);确认空壳后才删 |
|
|
38
|
+
| 被取代但有价值 | rescue:把独特 rationale merge 进取代条目,新条目加 `related` 边指回,再退役旧条目 |
|
|
39
|
+
|
|
40
|
+
## 流程(逐条处置)
|
|
41
|
+
|
|
42
|
+
1. `fabric doctor` 取 KB health + orphan/stale 候选清单(引擎给信号,本 skill 不自算)。
|
|
43
|
+
2. 对每个候选判 **三态**:still-valid(留) / superseded(退役,走 deprecate) / never-valid(删,走 rescue 检查)。
|
|
44
|
+
3. superseded → deprecate:降 maturity 或标 deprecated + `superseded-by`,保留正文 rationale。
|
|
45
|
+
4. never-valid → rescue-before-delete:独特知识?有则 merge + `related`,无则删空壳。
|
|
46
|
+
5. 处置经 `fabric-review` skill 落盘(本 skill 给决策,review 做写入),保持单一写路径。
|
|
47
|
+
|
|
48
|
+
## Constraints
|
|
49
|
+
|
|
50
|
+
- 本 skill **只读 + 给处置建议**;实际写入(降级 / 标记 / 删)经 `fabric-review` 的写路径,不自行改 `.fabric/knowledge/`。
|
|
51
|
+
- NEVER 绕过 rescue 检查直接删;删前 MUST 先跑抢救检查。删是最后手段,默认是 deprecate。
|
|
52
|
+
- `agents.meta.json` 派生态严禁手改;退役动作改的是 `.fabric/knowledge/<type>/` 下 markdown 的 frontmatter(maturity / deprecated / superseded-by),再 `fabric doctor --fix` reconcile。
|
|
53
|
+
- health / orphan / stale 一律取自 `fabric doctor` 的 JSON 输出,不在 skill 内重算(单一真源)。
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fabric-connect
|
|
3
|
+
description: 知识图谱关联门面 — 发现 KB 条目间隐藏关联并回写 H2 `related` 图边。读 fab_recall/fab_plan_context 看候选, 按语义/共路径/共引提议 related 边, 经 fabric-review 写路径落盘。Triggers 连接知识/找关联条目/建知识图谱/link related entries/补 related 边/知识库连通性.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# fabric-connect — 知识图谱关联
|
|
7
|
+
|
|
8
|
+
把孤立的 KB 条目连成图:发现彼此**隐藏关联**(同一决策的正反面、pitfall↔规避它的 guideline、被取代↔取代),回写到 frontmatter 的 `related: [<stable_id>...]` 图边(v2.2 H2)。下游 `fab_recall include_related:true` 据此一跳拉回连通知识。
|
|
9
|
+
|
|
10
|
+
`related` 是**有向引用**(A.related=[B] 表示「读 A 时也该看 B」),按需补反向边(B.related=[A])。
|
|
11
|
+
|
|
12
|
+
## When to use
|
|
13
|
+
|
|
14
|
+
- 「把这些知识连起来」「找出相关条目」「补 related 边」
|
|
15
|
+
- 「知识库连通性怎样?」「有哪些孤岛条目?」
|
|
16
|
+
- 新增一批条目后想建立彼此引用。
|
|
17
|
+
|
|
18
|
+
## When NOT to use
|
|
19
|
+
|
|
20
|
+
- 写新条目 → `fabric-archive`。
|
|
21
|
+
- 审 pending / 退役陈旧 → `fabric-review` / `fabric-audit`。
|
|
22
|
+
- 检索时临时拉关联 → 直接 `fab_recall include_related:true`(无需建边)。
|
|
23
|
+
|
|
24
|
+
## 关联类型(提议 related 边的判据)
|
|
25
|
+
|
|
26
|
+
| 类型 | 例 |
|
|
27
|
+
|---|---|
|
|
28
|
+
| 互补 | decision「用 JWT」 ↔ pitfall「JWT 过期未刷新踩坑」 |
|
|
29
|
+
| 规避 | pitfall「sprite 黑边」 ↔ guideline「premultiplyAlpha 正确设置」 |
|
|
30
|
+
| 取代 | 旧 decision ↔ 取代它的新 decision(配合 deprecated/superseded-by) |
|
|
31
|
+
| 同域 | 同一子系统 / 共 relevance_paths 的条目 |
|
|
32
|
+
| 引用链 | A 的 rationale 依赖 B 的结论 |
|
|
33
|
+
|
|
34
|
+
## 流程
|
|
35
|
+
|
|
36
|
+
1. `fab_recall(paths=[...])` 或 `fab_plan_context` 拿候选 + 现有 `related`(读 description.related 看已连状态)。
|
|
37
|
+
2. 对候选两两/成簇判隐藏关联(用上表判据);只提议**高置信**边,不为「话题相邻」乱连(噪声边稀释图价值)。
|
|
38
|
+
3. 每条提议 = `(源 id, 目标 id, 类型, 一句理由)`;按需提议反向边。
|
|
39
|
+
4. 落盘经 `fabric-review` 写路径:在源条目 frontmatter 的 `related` inline 数组追加目标 stable_id;`fabric doctor --fix` reconcile 进 agents.meta。
|
|
40
|
+
5. 回报新增/反向边数 + 连通性变化(孤岛减少)。
|
|
41
|
+
|
|
42
|
+
## Constraints
|
|
43
|
+
|
|
44
|
+
- 本 skill **只提议 + 经 review 写路径落盘**;不自行改 `.fabric/knowledge/`,不手改 `agents.meta.json`(派生态)。
|
|
45
|
+
- `related` MUST 只填**真实存在的 stable_id**(先 `fab_recall` 验证目标在库);NEVER 编造 / 指向 pending。
|
|
46
|
+
- **稀疏优于稠密**:宁缺毋滥。只连高置信关联;低置信「相邻」不连(图的信噪比比覆盖率重要)。
|
|
47
|
+
- 反向边按需补,不强制双向(有向语义:A 该带出 B ≠ B 该带出 A)。
|
|
48
|
+
- 写 `related` 复用 H2 字段(`fabric-review` 的 modify 路径);schema 已支持,无需迁移。
|
|
@@ -44,6 +44,8 @@ Missing or unreadable → defaults silently.
|
|
|
44
44
|
|
|
45
45
|
Review iterates **per-store** — the read-set may span multiple stores (`fabric scope-explain team` → resolved `readSet.stores`). Pending/backlog is reported per-store (NOT aggregated into one undifferentiated pile); each candidate's provenance store is surfaced in cites as `KB: <store-alias>:<id>`. Promotion (draft → verified/proven) is a normal edit + git commit **inside that store's own repo** — no cross-store move. A `dismissed`/`modify` that flips layer between team and personal still goes through `AskUserQuestion`. Never read `~/.fabric` store trees directly; go through the MCP recall path / `scope-explain`.
|
|
46
46
|
|
|
47
|
+
`Read ref/cite-contract.md` (v2.2 SK5) for the authoritative cite-contract reference — operator syntax, skip/dismissed reason dictionaries, type routing, audit semantics, backward-compat, and the adjudication ladder (AI-self → multi-LLM cold-eval → non-blocking queue) — sunk out of the bootstrap so cite/governance depth lives here, not in `.fabric/AGENTS.md`.
|
|
48
|
+
|
|
47
49
|
### UX i18n Policy
|
|
48
50
|
|
|
49
51
|
Read `fabric_language` (`zh-CN` / `en` / `zh-CN-hybrid` / `match-existing`); emit user-facing prose in resolved variant. Protected tokens (`fab_review`, `fab_extract_knowledge`, `relevance_scope`, layer/scope enums, `stable_id`, the verbatim `强 team` / `强 personal` / `默认 team` block) NEVER translated. `AskUserQuestion` policy: `header` + `question` translate; `options[]` stay English (routing keys).
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Cite-contract + 裁决阶梯参考 (v2.2 SK5)
|
|
2
|
+
|
|
3
|
+
> 本文是 cite policy 与裁决(adjudication)的**权威详参**,从 bootstrap (`.fabric/AGENTS.md`) 下沉至此,避免 bootstrap 随治理细节膨胀。bootstrap 只留**可执行 core**(cite 行格式 + 验证义务 + operator 例),完整 enum 词典 / 类型路由 / 稽核 / backward-compat / 裁决阶梯看这里。`fabric doctor --cite-coverage` 的稽核口径以本文为准。
|
|
4
|
+
|
|
5
|
+
## 1. Cite 行格式 (回顾)
|
|
6
|
+
|
|
7
|
+
edit / decide / propose plan 之前,**回复首行**:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
KB: <id> (<≤8字 用法>) [applied|dismissed:<reason>]
|
|
11
|
+
KB: none [<reason>]
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
- `[applied]` 前必须先 `fab_recall`(或 `fab_plan_context` → `fab_get_knowledge_sections`)实际抓 KB body —— 防编造 id。验证不通过 = 不能 cite。
|
|
15
|
+
- **store 前缀** (多 store):read-set 含多 store 且同一 local id 跨 store shadow 时,cite 必须 store-qualified:`KB: <store-alias>:<id> ...`(如 `KB: team:KT-DEC-0001 (auth) [applied]`)。单 store / 无歧义时裸 `KB: <id>` 仍 valid。personal-only 条目 cite 进团队产物 = 强 warning(防泄漏 R5#3)。
|
|
16
|
+
|
|
17
|
+
## 2. Contract 语法 (decisions/pitfalls 类 `[applied]`)
|
|
18
|
+
|
|
19
|
+
cite 尾段加 contract:`→ <operator> [<operator> ...]`
|
|
20
|
+
|
|
21
|
+
| operator | 含义 |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `edit:<glob>` | 本 cite 承诺会改的文件范围 |
|
|
24
|
+
| `!edit:<glob>` | 承诺**不**改的范围 |
|
|
25
|
+
| `require:<symbol>` | 实现必须含某 symbol |
|
|
26
|
+
| `forbid:<symbol>` | 实现必须不含某 symbol |
|
|
27
|
+
| `skip:<reason>` | 本条 applied 但某 operator 跳过,附理由 |
|
|
28
|
+
|
|
29
|
+
例:`KB: K-001 (auth) [applied] → edit:src/auth/**/*.ts !edit:src/legacy/**`
|
|
30
|
+
|
|
31
|
+
## 3. 枚举词典
|
|
32
|
+
|
|
33
|
+
- **skip reason**:`sequencing | conditional | semantic | aesthetic | architectural | other:<text>`
|
|
34
|
+
- **dismissed reason**:`scope-mismatch | outdated | not-applicable | other:<text>`
|
|
35
|
+
- **`KB: none` sentinel**:`[no-relevant]`(已调 recall/plan_context 但无可用条目) / `[not-applicable]`(当前动作不在 cite 范围:纯探索 / Bash 只读 / 用户问答)。裸 `KB: none` 仍 valid,归 `[unspecified]`(legacy 兼容)。
|
|
36
|
+
|
|
37
|
+
## 4. 类型路由
|
|
38
|
+
|
|
39
|
+
- `models` 类引用 = reference cite,**不需 contract**。
|
|
40
|
+
- `guidelines` / `processes` 类暂不强制 contract,推后 LLM-judge。
|
|
41
|
+
- `decisions` / `pitfalls` 类 `[applied]` **需** contract。
|
|
42
|
+
|
|
43
|
+
## 5. 稽核 + Backward compat
|
|
44
|
+
|
|
45
|
+
- 稽核:`fabric doctor --cite-coverage [--since=7d] [--client=cc|codex|all]` 输出覆盖率,含 `KB: none` sentinel 拆分。不阻断工作,只记录。
|
|
46
|
+
- Backward compat:解析器同时接受老 4-state tags(`planned` / `recalled` / `chained-from <id>`),都映射到 `[applied]` 语义;旧 session cite 仍计入 cite-coverage。
|
|
47
|
+
|
|
48
|
+
## 6. 裁决阶梯 (adjudication ladder)
|
|
49
|
+
|
|
50
|
+
执行中遇到**需要拍板**的分歧(plan 选型 / review 取舍 / cross-LLM 不一致),按三级阶梯收口,**只有真正属于 human 的决定才阻塞**:
|
|
51
|
+
|
|
52
|
+
1. **AI 自决** — 已有清晰证据 + 明确推荐时,直接执行,记 rationale。不为有默认值的选择拆 sub-question。
|
|
53
|
+
2. **多-LLM 评审(含 ≥1 零上下文冷评)** — 主观 / 高风险 / 跨 LLM 分歧时,maestro delegate ≥2 LLM(至少一个零上下文,防执行者自我合理化)。一致 PASS 自动闭;一致 BLOCK + fix verbatim 采纳重跑。
|
|
54
|
+
3. **非阻塞队列** — 仍分歧 / 主观 / 不可逆 / 属 frame 级(只有 human 能挑战 frame)→ 升 `needs_adjudication` 非阻塞队列,带两方理由 + AI 倾向裁决,继续推进不卡死。
|
|
55
|
+
|
|
56
|
+
**Anchor**:critic 只能 frame 内审计;多-LLM 收敛 ≠ 正确,frame 级判断留给 human。cross-LLM 给 suggested fix 时直接 verbatim 采纳(+ trade-off 注释)。
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fabric-store
|
|
3
|
+
description: 知识 store 运维门面 — 创建 / 挂载 / 绑定 / 列出 / 切换写目标。CLI `fabric store …` 做事,本 skill 按用户意图选命令。NOT for git-managing 用户自己的产品仓。Triggers 创建 store/挂载 store/绑定知识库/store 列表/切换写库/set up knowledge store.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# fabric-store — 知识 store 运维
|
|
7
|
+
|
|
8
|
+
每个「知识 store」操作的对话入口。CLI (`fabric store …`) 是引擎;本 skill 按用户意图挑命令。*store* 是 `~/.fabric/stores/<uuid>/` 下的平行 git 仓 —— 与用户的产品仓不同。同步 (pull+push) 见姊妹 skill `fabric-sync`。
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
|
|
12
|
+
- 「创建团队 store」「建个人知识 store」
|
|
13
|
+
- 「挂载团队 store」「这个项目要绑团队 store」
|
|
14
|
+
- 「列出挂了哪些 store?」「我的共享决策写到哪个 store?」
|
|
15
|
+
|
|
16
|
+
## When NOT to use
|
|
17
|
+
|
|
18
|
+
- git 同步用户自己的产品仓 (那是普通 `git`)。
|
|
19
|
+
- 同步知识 store (pull/push 冲突解决) → 用 `fabric-sync` skill。
|
|
20
|
+
- 写知识条目 → 用 `fabric-archive` / `fabric-review`。
|
|
21
|
+
|
|
22
|
+
## 意图 → 命令映射
|
|
23
|
+
|
|
24
|
+
| 意图 | 命令 |
|
|
25
|
+
|---|---|
|
|
26
|
+
| 创建全新本地 store | `fabric store create --alias <a> [--remote <url>]` |
|
|
27
|
+
| 挂载已存在的磁盘 store | `fabric store add --uuid <u> --alias <a> [--remote <url>]` |
|
|
28
|
+
| 本项目声明需要某 store | `fabric store bind <alias-or-uuid>` |
|
|
29
|
+
| 列出挂载的 store | `fabric store list` |
|
|
30
|
+
| 设置非 personal scope 的写目标 | `fabric store switch-write <alias>` |
|
|
31
|
+
| 解释某 alias 如何解析 | `fabric store explain <alias>` |
|
|
32
|
+
| 同步 (pull+push) | 见 `fabric-sync` skill |
|
|
33
|
+
|
|
34
|
+
## Precondition
|
|
35
|
+
|
|
36
|
+
已 `fabric install --global` (存在 `~/.fabric` + 全局 store registry)。无全局配置 → 提示先 `fabric install --global`,停止。
|
|
37
|
+
|
|
38
|
+
## Constraints
|
|
39
|
+
|
|
40
|
+
- `store remove` 是 *detach ≠ delete*:从 registry 卸载但 MUST 保留磁盘 git 树。
|
|
41
|
+
- `store add` MUST 拒绝磁盘无 store 树的 uuid (无「幽灵挂载」) —— 先 clone (`fabric install --global --url <remote>`) 或 `store create`。
|
|
42
|
+
- 知识条目写在各 store 的 `.fabric/knowledge/` 下;本 skill 只管 store 生命周期,不写条目。
|
|
43
|
+
- Personal-scope 写永远落在隐式 personal store,与 active write store 无关。
|
|
44
|
+
- Hook/skill NEVER 直接解析 store 或执行 store 内文件 (S65 RCE 防线:store 是数据-only);所有 store 状态 MUST 经 CLI JSON 输出获取。
|