@fenglimg/fabric-cli 1.3.0 → 1.4.0

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/README.md +24 -22
  2. package/dist/{bootstrap-IUL4SAAK.js → bootstrap-B6RCVJZJ.js} +4 -2
  3. package/dist/{chunk-N4DCTOXW.js → chunk-AZRKMFRY.js} +6 -6
  4. package/dist/{chunk-VMYPJPKV.js → chunk-BEKSXO5N.js} +161 -21
  5. package/dist/{chunk-TO5RUB4R.js → chunk-BVTMVW5M.js} +1 -1
  6. package/dist/{chunk-F2BXHPM5.js → chunk-N7EZORJZ.js} +9 -1
  7. package/dist/{chunk-6UUPKSDE.js → chunk-Q4LOVXML.js} +13 -8
  8. package/dist/{chunk-RUQCZA2Q.js → chunk-XQYY2U2C.js} +92 -115
  9. package/dist/{config-MKWKDE32.js → config-EC5L2QNI.js} +2 -2
  10. package/dist/index.js +11 -11
  11. package/dist/{init-BZ73IUHH.js → init-QC2MLFHR.js} +894 -261
  12. package/dist/{ledger-append-XZ5SX4O5.js → ledger-append-DULKJ6Q2.js} +1 -1
  13. package/dist/{pre-commit-AK55G73F.js → pre-commit-IK6SJOPT.js} +5 -5
  14. package/dist/{scan-WKDSKEBB.js → scan-43R3IBLR.js} +2 -2
  15. package/dist/{sync-meta-THZSEM7Y.js → sync-meta-LKVSO6TS.js} +1 -1
  16. package/dist/{update-JZPUJ36D.js → update-FY2WKWPB.js} +5 -5
  17. package/package.json +4 -3
  18. package/templates/agents-md/AGENTS.md.template +14 -13
  19. package/templates/agents-md/variants/cocos.md +20 -20
  20. package/templates/agents-md/variants/next.md +20 -20
  21. package/templates/agents-md/variants/vite.md +20 -20
  22. package/templates/bootstrap/CLAUDE.md +3 -5
  23. package/templates/bootstrap/GEMINI.md +3 -5
  24. package/templates/bootstrap/codex-AGENTS-header.md +3 -5
  25. package/templates/bootstrap/cursor-fabric-bootstrap.mdc +11 -11
  26. package/templates/bootstrap/roo-fabric.md +6 -6
  27. package/templates/bootstrap/windsurf-fabric.md +6 -6
  28. package/templates/claude-hooks/agents-md-init-reminder.cjs +18 -18
  29. package/templates/claude-skills/agents-md-init/SKILL.md +86 -86
  30. package/templates/codex-hooks/fabric-session-start.cjs +19 -0
  31. package/templates/codex-hooks/fabric-stop-reminder.cjs +18 -0
  32. package/templates/codex-skills/fabric-init/SKILL.md +27 -0
  33. package/templates/fabric/human-lock.json +12 -12
  34. package/templates/husky/pre-commit +24 -24
  35. package/dist/{doctor-5KJGOV2P.js → doctor-QTSG2RWF.js} +3 -3
  36. package/dist/{serve-MMN4GYLM.js → serve-4J2CQY25.js} +4 -4
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  ledgerAppendCommand,
4
4
  ledger_append_default
5
- } from "./chunk-F2BXHPM5.js";
5
+ } from "./chunk-N7EZORJZ.js";
6
6
  import "./chunk-6ICJICVU.js";
7
7
  export {
8
8
  ledger_append_default as default,
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  sync_meta_default
4
- } from "./chunk-6UUPKSDE.js";
4
+ } from "./chunk-Q4LOVXML.js";
5
5
  import {
6
6
  human_lint_default
7
7
  } from "./chunk-L43IGJ6X.js";
8
8
  import {
9
9
  ledger_append_default
10
- } from "./chunk-F2BXHPM5.js";
11
- import "./chunk-WWNXR34K.js";
10
+ } from "./chunk-N7EZORJZ.js";
12
11
  import {
13
12
  resolveDevModeTarget
14
13
  } from "./chunk-AEOYCVBG.js";
14
+ import "./chunk-WWNXR34K.js";
15
15
  import {
16
16
  t
17
17
  } from "./chunk-6ICJICVU.js";
@@ -57,9 +57,9 @@ function tryReadAgentsMeta(target) {
57
57
  }
58
58
  }
59
59
  function matchesFabricScope(stagedFiles, meta) {
60
- const scopeGlobs = Object.values(meta.nodes).filter((node) => node.file !== "AGENTS.md").map((node) => node.scope_glob);
60
+ const scopeGlobs = Object.values(meta.nodes).filter((node) => node.file !== ".fabric/bootstrap/README.md" && node.file !== "AGENTS.md").map((node) => node.scope_glob);
61
61
  return stagedFiles.some(
62
- (file) => file === "AGENTS.md" || file === ".fabric/agents.meta.json" || file === ".fabric/human-lock.json" || file === ".intent-ledger.jsonl" || scopeGlobs.some((pattern) => minimatch(file, pattern, { dot: true }))
62
+ (file) => file === ".fabric/bootstrap/README.md" || file === "AGENTS.md" || file === ".fabric/agents.meta.json" || file === ".fabric/human-lock.json" || file === ".intent-ledger.jsonl" || scopeGlobs.some((pattern) => minimatch(file, pattern, { dot: true }))
63
63
  );
64
64
  }
65
65
  var pre_commit_default = defineCommand({
@@ -3,9 +3,9 @@ import {
3
3
  createScanReport,
4
4
  scanCommand,
5
5
  scan_default
6
- } from "./chunk-N4DCTOXW.js";
7
- import "./chunk-WWNXR34K.js";
6
+ } from "./chunk-AZRKMFRY.js";
8
7
  import "./chunk-AEOYCVBG.js";
8
+ import "./chunk-WWNXR34K.js";
9
9
  import "./chunk-6ICJICVU.js";
10
10
  export {
11
11
  createScanReport,
@@ -5,7 +5,7 @@ import {
5
5
  deriveTopologyType,
6
6
  syncMetaCommand,
7
7
  sync_meta_default
8
- } from "./chunk-6UUPKSDE.js";
8
+ } from "./chunk-Q4LOVXML.js";
9
9
  import "./chunk-6ICJICVU.js";
10
10
  export {
11
11
  computeAgentsMeta,
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  installMcpClients
4
- } from "./chunk-TO5RUB4R.js";
5
- import "./chunk-VMYPJPKV.js";
4
+ } from "./chunk-BVTMVW5M.js";
5
+ import "./chunk-BEKSXO5N.js";
6
6
  import {
7
7
  installHooks
8
8
  } from "./chunk-YDZJRLHL.js";
9
- import {
10
- paint
11
- } from "./chunk-WWNXR34K.js";
12
9
  import {
13
10
  resolveDevModeTarget
14
11
  } from "./chunk-AEOYCVBG.js";
12
+ import {
13
+ paint
14
+ } from "./chunk-WWNXR34K.js";
15
15
  import {
16
16
  t
17
17
  } from "./chunk-6ICJICVU.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fenglimg/fabric-cli",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "fab": "dist/index.js",
@@ -13,13 +13,14 @@
13
13
  "templates"
14
14
  ],
15
15
  "dependencies": {
16
+ "@clack/prompts": "^1.2.0",
16
17
  "@iarna/toml": "^2.2.5",
17
18
  "citty": "^0.2.2",
18
19
  "minimatch": "^10.0.1",
19
20
  "picocolors": "^1.1.1",
20
21
  "string-width": "^7.2.0",
21
- "@fenglimg/fabric-server": "1.3.0",
22
- "@fenglimg/fabric-shared": "1.3.0"
22
+ "@fenglimg/fabric-server": "1.4.0",
23
+ "@fenglimg/fabric-shared": "1.4.0"
23
24
  },
24
25
  "devDependencies": {
25
26
  "@types/iarna__toml": "^2.0.5",
@@ -1,19 +1,20 @@
1
- # { projectName } — Fabric Bootstrap Protocol
2
-
3
- ## CORE RULES (DO NOT TRANSLATE)
4
-
5
- MUST: Treat this file as the Fabric Protocol bootstrap for this repository.
6
- MUST: Treat `.fabric/agents/` as the authoritative home for all AI shadow constraints.
7
- MUST: Before ANY code reading, architecture planning, or logic modification, call `fab_get_rules(path=<target file>)`.
8
- MUST: When creating or changing an L1/L2 rule node, keep `.fabric/agents.meta.json` synchronized through Fabric tooling.
9
- MUST: Preserve protected tokens exactly: `AGENTS.md`, `.fabric/agents/`, `.fabric/agents.meta.json`, `fab_get_rules`, `shadow constraints`, `Shadow Mirroring`, `MUST`, `NEVER`.
10
- NEVER: Add import-style directive lines to this bootstrap file.
11
- NEVER: Put framework, domain, repository rule bodies, or submodule rules in this file.
12
- NEVER: Create colocated `AGENTS.md` rule files under source directories.
13
-
1
+ # { projectName } — Fabric Bootstrap Protocol
2
+
3
+ ## CORE RULES (DO NOT TRANSLATE)
4
+
5
+ MUST: Treat this file as the Fabric Protocol bootstrap for this repository.
6
+ MUST: Treat `.fabric/agents/` as the authoritative home for all AI shadow constraints.
7
+ MUST: Before ANY code reading, architecture planning, or logic modification, call `fab_get_rules(path=<target file>)`.
8
+ MUST: When creating or changing an L1/L2 rule node, keep `.fabric/agents.meta.json` synchronized through Fabric tooling.
9
+ MUST: Preserve protected tokens exactly: `AGENTS.md`, `.fabric/agents/`, `.fabric/agents.meta.json`, `fab_get_rules`, `shadow constraints`, `Shadow Mirroring`, `MUST`, `NEVER`.
10
+ NEVER: Add import-style directive lines to this bootstrap file.
11
+ NEVER: Put framework, domain, repository rule bodies, or submodule rules in this file.
12
+ NEVER: Create colocated `AGENTS.md` rule files under source directories.
13
+
14
14
  ## 使用说明 / Explanation
15
15
 
16
16
  - 本文件只负责启动 Fabric Bootstrap Protocol,不承载项目业务规则。
17
+ - 详细 bootstrap 说明位于 `.fabric/bootstrap/README.md`。
17
18
  - Detected framework kind: `{ frameworkKind }`.
18
19
  - This repository uses `Shadow Mirroring`: source directories contain ZERO rule files, while `.fabric/agents/` mirrors source paths for AI constraints.
19
20
  - 根级规则应放在 `.fabric/agents/root.md`;跨领域规则应放在 `.fabric/agents/_cross/`。
@@ -1,20 +1,20 @@
1
- # { projectName } — Fabric Bootstrap Protocol
2
-
3
- ## CORE RULES (DO NOT TRANSLATE)
4
-
5
- MUST: Treat this file as the Fabric Protocol bootstrap for this repository.
6
- MUST: Treat `.fabric/agents/` as the authoritative home for all AI shadow constraints.
7
- MUST: Before ANY code reading, architecture planning, or logic modification, call `fab_get_rules(path=<target file>)`.
8
- MUST: When creating or changing an L1/L2 rule node, keep `.fabric/agents.meta.json` synchronized through Fabric tooling.
9
- MUST: Preserve protected tokens exactly: `AGENTS.md`, `.fabric/agents/`, `.fabric/agents.meta.json`, `fab_get_rules`, `shadow constraints`, `Shadow Mirroring`, `MUST`, `NEVER`.
10
- NEVER: Add import-style directive lines to this bootstrap file.
11
- NEVER: Put Cocos, asset, prefab, scene, repository rule bodies, or submodule rules in this file.
12
- NEVER: Create colocated `AGENTS.md` rule files under source directories.
13
-
14
- ## 使用说明 / Explanation
15
-
16
- - 本文件只负责启动 Fabric Bootstrap Protocol,不承载 Cocos 业务或编辑器规则。
17
- - Detected framework kind: `cocos-creator`.
18
- - This repository uses `Shadow Mirroring`: source directories contain ZERO rule files, while `.fabric/agents/` mirrors source paths for AI constraints.
19
- - 根级规则应放在 `.fabric/agents/root.md`;跨领域规则应放在 `.fabric/agents/_cross/`。
20
- - If `.fabric/agents/root.md` is missing, stop normal coding and run the initialization flow that creates shadow constraints.
1
+ # { projectName } — Fabric Bootstrap Protocol
2
+
3
+ ## CORE RULES (DO NOT TRANSLATE)
4
+
5
+ MUST: Treat this file as the Fabric Protocol bootstrap for this repository.
6
+ MUST: Treat `.fabric/agents/` as the authoritative home for all AI shadow constraints.
7
+ MUST: Before ANY code reading, architecture planning, or logic modification, call `fab_get_rules(path=<target file>)`.
8
+ MUST: When creating or changing an L1/L2 rule node, keep `.fabric/agents.meta.json` synchronized through Fabric tooling.
9
+ MUST: Preserve protected tokens exactly: `AGENTS.md`, `.fabric/agents/`, `.fabric/agents.meta.json`, `fab_get_rules`, `shadow constraints`, `Shadow Mirroring`, `MUST`, `NEVER`.
10
+ NEVER: Add import-style directive lines to this bootstrap file.
11
+ NEVER: Put Cocos, asset, prefab, scene, repository rule bodies, or submodule rules in this file.
12
+ NEVER: Create colocated `AGENTS.md` rule files under source directories.
13
+
14
+ ## 使用说明 / Explanation
15
+
16
+ - 本文件只负责启动 Fabric Bootstrap Protocol,不承载 Cocos 业务或编辑器规则。
17
+ - Detected framework kind: `cocos-creator`.
18
+ - This repository uses `Shadow Mirroring`: source directories contain ZERO rule files, while `.fabric/agents/` mirrors source paths for AI constraints.
19
+ - 根级规则应放在 `.fabric/agents/root.md`;跨领域规则应放在 `.fabric/agents/_cross/`。
20
+ - If `.fabric/agents/root.md` is missing, stop normal coding and run the initialization flow that creates shadow constraints.
@@ -1,20 +1,20 @@
1
- # { projectName } — Fabric Bootstrap Protocol
2
-
3
- ## CORE RULES (DO NOT TRANSLATE)
4
-
5
- MUST: Treat this file as the Fabric Protocol bootstrap for this repository.
6
- MUST: Treat `.fabric/agents/` as the authoritative home for all AI shadow constraints.
7
- MUST: Before ANY code reading, architecture planning, or logic modification, call `fab_get_rules(path=<target file>)`.
8
- MUST: When creating or changing an L1/L2 rule node, keep `.fabric/agents.meta.json` synchronized through Fabric tooling.
9
- MUST: Preserve protected tokens exactly: `AGENTS.md`, `.fabric/agents/`, `.fabric/agents.meta.json`, `fab_get_rules`, `shadow constraints`, `Shadow Mirroring`, `MUST`, `NEVER`.
10
- NEVER: Add import-style directive lines to this bootstrap file.
11
- NEVER: Put Next.js, route, repository rule bodies, or submodule rules in this file.
12
- NEVER: Create colocated `AGENTS.md` rule files under source directories.
13
-
14
- ## 使用说明 / Explanation
15
-
16
- - 本文件只负责启动 Fabric Bootstrap Protocol,不承载 Next.js 业务或路由规则。
17
- - Detected framework kind: `next`.
18
- - This repository uses `Shadow Mirroring`: source directories contain ZERO rule files, while `.fabric/agents/` mirrors source paths for AI constraints.
19
- - 根级规则应放在 `.fabric/agents/root.md`;跨领域规则应放在 `.fabric/agents/_cross/`。
20
- - If `.fabric/agents/root.md` is missing, stop normal coding and run the initialization flow that creates shadow constraints.
1
+ # { projectName } — Fabric Bootstrap Protocol
2
+
3
+ ## CORE RULES (DO NOT TRANSLATE)
4
+
5
+ MUST: Treat this file as the Fabric Protocol bootstrap for this repository.
6
+ MUST: Treat `.fabric/agents/` as the authoritative home for all AI shadow constraints.
7
+ MUST: Before ANY code reading, architecture planning, or logic modification, call `fab_get_rules(path=<target file>)`.
8
+ MUST: When creating or changing an L1/L2 rule node, keep `.fabric/agents.meta.json` synchronized through Fabric tooling.
9
+ MUST: Preserve protected tokens exactly: `AGENTS.md`, `.fabric/agents/`, `.fabric/agents.meta.json`, `fab_get_rules`, `shadow constraints`, `Shadow Mirroring`, `MUST`, `NEVER`.
10
+ NEVER: Add import-style directive lines to this bootstrap file.
11
+ NEVER: Put Next.js, route, repository rule bodies, or submodule rules in this file.
12
+ NEVER: Create colocated `AGENTS.md` rule files under source directories.
13
+
14
+ ## 使用说明 / Explanation
15
+
16
+ - 本文件只负责启动 Fabric Bootstrap Protocol,不承载 Next.js 业务或路由规则。
17
+ - Detected framework kind: `next`.
18
+ - This repository uses `Shadow Mirroring`: source directories contain ZERO rule files, while `.fabric/agents/` mirrors source paths for AI constraints.
19
+ - 根级规则应放在 `.fabric/agents/root.md`;跨领域规则应放在 `.fabric/agents/_cross/`。
20
+ - If `.fabric/agents/root.md` is missing, stop normal coding and run the initialization flow that creates shadow constraints.
@@ -1,20 +1,20 @@
1
- # { projectName } — Fabric Bootstrap Protocol
2
-
3
- ## CORE RULES (DO NOT TRANSLATE)
4
-
5
- MUST: Treat this file as the Fabric Protocol bootstrap for this repository.
6
- MUST: Treat `.fabric/agents/` as the authoritative home for all AI shadow constraints.
7
- MUST: Before ANY code reading, architecture planning, or logic modification, call `fab_get_rules(path=<target file>)`.
8
- MUST: When creating or changing an L1/L2 rule node, keep `.fabric/agents.meta.json` synchronized through Fabric tooling.
9
- MUST: Preserve protected tokens exactly: `AGENTS.md`, `.fabric/agents/`, `.fabric/agents.meta.json`, `fab_get_rules`, `shadow constraints`, `Shadow Mirroring`, `MUST`, `NEVER`.
10
- NEVER: Add import-style directive lines to this bootstrap file.
11
- NEVER: Put Vite, browser, repository rule bodies, or submodule rules in this file.
12
- NEVER: Create colocated `AGENTS.md` rule files under source directories.
13
-
14
- ## 使用说明 / Explanation
15
-
16
- - 本文件只负责启动 Fabric Bootstrap Protocol,不承载 Vite 业务或浏览器规则。
17
- - Detected framework kind: `vite`.
18
- - This repository uses `Shadow Mirroring`: source directories contain ZERO rule files, while `.fabric/agents/` mirrors source paths for AI constraints.
19
- - 根级规则应放在 `.fabric/agents/root.md`;跨领域规则应放在 `.fabric/agents/_cross/`。
20
- - If `.fabric/agents/root.md` is missing, stop normal coding and run the initialization flow that creates shadow constraints.
1
+ # { projectName } — Fabric Bootstrap Protocol
2
+
3
+ ## CORE RULES (DO NOT TRANSLATE)
4
+
5
+ MUST: Treat this file as the Fabric Protocol bootstrap for this repository.
6
+ MUST: Treat `.fabric/agents/` as the authoritative home for all AI shadow constraints.
7
+ MUST: Before ANY code reading, architecture planning, or logic modification, call `fab_get_rules(path=<target file>)`.
8
+ MUST: When creating or changing an L1/L2 rule node, keep `.fabric/agents.meta.json` synchronized through Fabric tooling.
9
+ MUST: Preserve protected tokens exactly: `AGENTS.md`, `.fabric/agents/`, `.fabric/agents.meta.json`, `fab_get_rules`, `shadow constraints`, `Shadow Mirroring`, `MUST`, `NEVER`.
10
+ NEVER: Add import-style directive lines to this bootstrap file.
11
+ NEVER: Put Vite, browser, repository rule bodies, or submodule rules in this file.
12
+ NEVER: Create colocated `AGENTS.md` rule files under source directories.
13
+
14
+ ## 使用说明 / Explanation
15
+
16
+ - 本文件只负责启动 Fabric Bootstrap Protocol,不承载 Vite 业务或浏览器规则。
17
+ - Detected framework kind: `vite`.
18
+ - This repository uses `Shadow Mirroring`: source directories contain ZERO rule files, while `.fabric/agents/` mirrors source paths for AI constraints.
19
+ - 根级规则应放在 `.fabric/agents/root.md`;跨领域规则应放在 `.fabric/agents/_cross/`。
20
+ - If `.fabric/agents/root.md` is missing, stop normal coding and run the initialization flow that creates shadow constraints.
@@ -1,8 +1,6 @@
1
1
  # Fabric Bootstrap
2
- - 本项目使用 Fabric Protocol 管理规则。
3
- - **任何文件修改前**,必须调 MCP tool `fab_get_rules(path=<被改文件>)` 获取规则。
4
- - 新建 L1/L2 节点时,必须调 `fab_update_registry`,**严禁**直接编辑 `.fabric/agents.meta.json`。
5
- - 涉及 @HUMAN 段(`.fabric/human-lock.json` 中列出)时,必须停下来请示人类。
6
- - 每次完整任务结束,调 `fab_append_intent` 写一条意图记录。
2
+ - 主说明文档已收敛到 `.fabric/bootstrap/README.md`。
3
+ - 项目级 bootstrap 入口仍然是 `AGENTS.md`。
4
+ - 修改任何文件前必须调用 `fab_get_rules(path=<被改文件>)`。
7
5
 
8
6
  @AGENTS.md
@@ -1,8 +1,6 @@
1
1
  # Fabric Bootstrap
2
- - 本项目使用 Fabric Protocol 管理规则。
3
- - **任何文件修改前**,必须调 MCP tool `fab_get_rules(path=<被改文件>)` 获取规则。
4
- - 新建 L1/L2 节点时,必须调 `fab_update_registry`,**严禁**直接编辑 `.fabric/agents.meta.json`。
5
- - 涉及 @HUMAN 段(`.fabric/human-lock.json` 中列出)时,必须停下来请示人类。
6
- - 每次完整任务结束,调 `fab_append_intent` 写一条意图记录。
2
+ - 主说明文档已收敛到 `.fabric/bootstrap/README.md`。
3
+ - 项目级 bootstrap 入口仍然是 `AGENTS.md`。
4
+ - 修改任何文件前必须调用 `fab_get_rules(path=<被改文件>)`。
7
5
 
8
6
  @AGENTS.md
@@ -1,6 +1,4 @@
1
1
  # Fabric Bootstrap
2
- - 本项目使用 Fabric Protocol 管理规则。
3
- - **任何文件修改前**,必须调 MCP tool `fab_get_rules(path=<被改文件>)` 获取规则。
4
- - 新建 L1/L2 节点时,必须调 `fab_update_registry`,**严禁**直接编辑 `.fabric/agents.meta.json`。
5
- - 涉及 @HUMAN 段(`.fabric/human-lock.json` 中列出)时,必须停下来请示人类。
6
- - 每次完整任务结束,调 `fab_append_intent` 写一条意图记录。
2
+ - 主说明文档已收敛到 `.fabric/bootstrap/README.md`。
3
+ - header 仅用于把 Codex 引导到 Fabric 项目级规则入口。
4
+ - 修改任何文件前必须调用 `fab_get_rules(path=<被改文件>)`。
@@ -1,11 +1,11 @@
1
- ---
2
- alwaysApply: true
3
- description: Fabric Protocol bootstrap rules
4
- ---
5
-
6
- # Fabric Bootstrap
7
- - 本项目使用 Fabric Protocol 管理规则。
8
- - **任何文件修改前**,必须调 MCP tool `fab_get_rules(path=<被改文件>)` 获取规则。
9
- - 新建 L1/L2 节点时,必须调 `fab_update_registry`,**严禁**直接编辑 `.fabric/agents.meta.json`。
10
- - 涉及 @HUMAN 段(`.fabric/human-lock.json` 中列出)时,必须停下来请示人类。
11
- - 每次完整任务结束,调 `fab_append_intent` 写一条意图记录。
1
+ ---
2
+ alwaysApply: true
3
+ description: Fabric Protocol bootstrap rules
4
+ ---
5
+
6
+ # Fabric Bootstrap
7
+ - 本项目使用 Fabric Protocol 管理规则。
8
+ - **任何文件修改前**,必须调 MCP tool `fab_get_rules(path=<被改文件>)` 获取规则。
9
+ - 新建 L1/L2 节点时,必须调 `fab_update_registry`,**严禁**直接编辑 `.fabric/agents.meta.json`。
10
+ - 涉及 @HUMAN 段(`.fabric/human-lock.json` 中列出)时,必须停下来请示人类。
11
+ - 每次完整任务结束,调 `fab_append_intent` 写一条意图记录。
@@ -1,6 +1,6 @@
1
- # Fabric Bootstrap
2
- - 本项目使用 Fabric Protocol 管理规则。
3
- - **任何文件修改前**,必须调 MCP tool `fab_get_rules(path=<被改文件>)` 获取规则。
4
- - 新建 L1/L2 节点时,必须调 `fab_update_registry`,**严禁**直接编辑 `.fabric/agents.meta.json`。
5
- - 涉及 @HUMAN 段(`.fabric/human-lock.json` 中列出)时,必须停下来请示人类。
6
- - 每次完整任务结束,调 `fab_append_intent` 写一条意图记录。
1
+ # Fabric Bootstrap
2
+ - 本项目使用 Fabric Protocol 管理规则。
3
+ - **任何文件修改前**,必须调 MCP tool `fab_get_rules(path=<被改文件>)` 获取规则。
4
+ - 新建 L1/L2 节点时,必须调 `fab_update_registry`,**严禁**直接编辑 `.fabric/agents.meta.json`。
5
+ - 涉及 @HUMAN 段(`.fabric/human-lock.json` 中列出)时,必须停下来请示人类。
6
+ - 每次完整任务结束,调 `fab_append_intent` 写一条意图记录。
@@ -1,6 +1,6 @@
1
- # Fabric Bootstrap
2
- - 本项目使用 Fabric Protocol 管理规则。
3
- - **任何文件修改前**,必须调 MCP tool `fab_get_rules(path=<被改文件>)` 获取规则。
4
- - 新建 L1/L2 节点时,必须调 `fab_update_registry`,**严禁**直接编辑 `.fabric/agents.meta.json`。
5
- - 涉及 @HUMAN 段(`.fabric/human-lock.json` 中列出)时,必须停下来请示人类。
6
- - 每次完整任务结束,调 `fab_append_intent` 写一条意图记录。
1
+ # Fabric Bootstrap
2
+ - 本项目使用 Fabric Protocol 管理规则。
3
+ - **任何文件修改前**,必须调 MCP tool `fab_get_rules(path=<被改文件>)` 获取规则。
4
+ - 新建 L1/L2 节点时,必须调 `fab_update_registry`,**严禁**直接编辑 `.fabric/agents.meta.json`。
5
+ - 涉及 @HUMAN 段(`.fabric/human-lock.json` 中列出)时,必须停下来请示人类。
6
+ - 每次完整任务结束,调 `fab_append_intent` 写一条意图记录。
@@ -1,18 +1,18 @@
1
- #!/usr/bin/env node
2
- const { existsSync } = require("node:fs");
3
- const { join } = require("node:path");
4
-
5
- const forensicPath = join(process.cwd(), ".fabric", "forensic.json");
6
- const initContextPath = join(process.cwd(), ".fabric", "init-context.json");
7
-
8
- if (!existsSync(forensicPath) || existsSync(initContextPath)) {
9
- process.exit(0);
10
- }
11
-
12
- process.stdout.write(
13
- JSON.stringify({
14
- decision: "block",
15
- reason:
16
- "fab init 已完成证据收集,但项目 AGENTS.md 初始化尚未完成。调用 agents-md-init skill (通过 Skill 工具) 完成 3 阶段初始化访谈。参考: .claude/skills/agents-md-init/SKILL.md + .fabric/forensic.json",
17
- }),
18
- );
1
+ #!/usr/bin/env node
2
+ const { existsSync } = require("node:fs");
3
+ const { join } = require("node:path");
4
+
5
+ const forensicPath = join(process.cwd(), ".fabric", "forensic.json");
6
+ const initContextPath = join(process.cwd(), ".fabric", "init-context.json");
7
+
8
+ if (!existsSync(forensicPath) || existsSync(initContextPath)) {
9
+ process.exit(0);
10
+ }
11
+
12
+ process.stdout.write(
13
+ JSON.stringify({
14
+ decision: "block",
15
+ reason:
16
+ "fab init 已完成证据收集,但项目 AGENTS.md 初始化尚未完成。调用 agents-md-init skill (通过 Skill 工具) 完成 3 阶段初始化访谈。参考: .claude/skills/agents-md-init/SKILL.md + .fabric/forensic.json",
17
+ }),
18
+ );
@@ -1,86 +1,86 @@
1
- ---
2
- name: agents-md-init
3
- description: Use this skill when fab init just completed, when forensic.json generated, or when the user is asking to initialize AGENTS.md. This skill runs a 3-phase initialization interview, writes .fabric/init-context.json, generates layered AGENTS.md, and updates .fabric/agents.meta.json.
4
- allowed-tools: Read, Write, Glob, Grep, Bash
5
- ---
6
-
7
- ## Precondition
8
-
9
- 必须先 Read `.fabric/forensic.json`。若该文件不存在,终止 skill 并告知用户:`请先运行 fab init 生成证据包`。
10
-
11
- 把以下状态视为 initialization pending:
12
-
13
- - `.fabric/forensic.json` 存在
14
- - `.fabric/init-context.json` 不存在
15
-
16
- ## 执行流程 (3 Phase / 3 Round)
17
-
18
- ### Phase 1 — 框架确认(1 轮,高效)
19
-
20
- 展示 `.fabric/forensic.json` 的 `framework`、`topology.by_ext`、`entry_points` 摘要,向用户提 1-2 个框架架构澄清问题。
21
-
22
- 示例(Cocos Creator 3.x):
23
-
24
- > 我检测到 Cocos Creator 3.8 项目,主要脚本在 `assets/scripts`,采用 `@ccclass + extends Component` 模式。请确认:(1) 这是 TypeScript 项目(非 JavaScript)对吗?(2) 节点引用主要通过 `@property(Node)` 注入,还是 `find/getChildByName`?
25
-
26
- 将用户确认结果暂存为已验证 framework assumptions。
27
-
28
- ### Phase 2 — 不变式提取(1 轮,关键)
29
-
30
- 基于 `.fabric/forensic.json` 的 `recommendations_for_skill` 列表,向用户提 3-5 个 invariants 问题,覆盖三类:
31
-
32
- - `ban`:禁止 any、禁止 update() 中 async、禁止 find-by-name 等
33
- - `require`:必须 strict TypeScript、必须 `@ccclass` decorator、必须 import from `cc` only 等
34
- - `protect`:哪些目录或文件 AI 不能修改,一般是 `assets/prefabs/**`、`assets/scenes/**`、`**/*.meta`
35
-
36
- 原则:
37
-
38
- - 只问 invariants,不问 preferences
39
- - 每个问题只接受 yes/no/具体规则,不接受模糊回答
40
- - 不要自动推测用户未确认的硬约束
41
-
42
- ### Phase 3 — 构造与落地(1 轮,自动)
43
-
44
- 1. 写入 `.fabric/init-context.json`,包含:
45
-
46
- - `framework`
47
- - `architecture_patterns`
48
- - `invariants`
49
- - `domain_groups`
50
- - `interview_trail`
51
- - `forensic_ref`
52
-
53
- 写入规则:
54
-
55
- - `invariants[].type` 必须是 `ban`、`require`、`protect`
56
- - `domain_groups` 由 `entry_points` 和访谈结果推断
57
- - `interview_trail[]` 必须记录 Phase 1 和 Phase 2 的原始问答
58
- - `forensic_ref` 必须为 `.fabric/forensic.json`
59
-
60
- 2. 生成分层 `AGENTS.md`:
61
-
62
- - 根 `AGENTS.md` 必须在 300 行以内,结构包含:
63
- - `# {projectName} — L0 AGENTS.md`
64
- - `<!-- fab:index -->`:填充 `domain_groups` 索引
65
- - `## L0 AI Constraints`:从 invariants 派生,按 `ban`、`require`、`protect` 分段
66
- - `## @HUMAN`:protect 路径和用户声明的人类保护规则
67
- - `## L1 Candidate Notes`:domain_groups 对应的候选子模块说明
68
-
69
- 如果 `domain_groups.length >= 2`,为每个 group 生成 `{group_path}/AGENTS.md`。最多到 L3,总嵌套不超过 4 层。
70
-
71
- 3. 更新 `.fabric/agents.meta.json` 的 nodes 树,保持 revision hash 链一致:
72
-
73
- - nodes 结构与生成后的 AGENTS 层级一致
74
- - 更新所有变更 AGENTS 文件的 hash
75
- - 保持 revision hash 链内部一致
76
-
77
- 4. 最终输出:向用户列出生成文件清单,并建议后续维护时运行 `fab sync-meta`。
78
-
79
- ## Hard Rules
80
-
81
- - Zero TODO: 不生成任何 `TODO`、`TBD`、placeholder、stub
82
- - No YAML frontmatter in outputs: 除本 skill 自身外,生成的 `AGENTS.md` 不得包含 YAML frontmatter
83
- - Root AGENTS.md <= 300 lines
84
- - AGENTS 嵌套总层级 <= 4
85
- - 不得自动推测用户未确认的 invariants
86
- - 有不确定内容时删除,不要留占位符
1
+ ---
2
+ name: agents-md-init
3
+ description: Use this skill when fab init just completed, when forensic.json generated, or when the user is asking to initialize AGENTS.md. This skill runs a 3-phase initialization interview, writes .fabric/init-context.json, generates layered AGENTS.md, and updates .fabric/agents.meta.json.
4
+ allowed-tools: Read, Write, Glob, Grep, Bash
5
+ ---
6
+
7
+ ## Precondition
8
+
9
+ 必须先 Read `.fabric/forensic.json`。若该文件不存在,终止 skill 并告知用户:`请先运行 fab init 生成证据包`。
10
+
11
+ 把以下状态视为 initialization pending:
12
+
13
+ - `.fabric/forensic.json` 存在
14
+ - `.fabric/init-context.json` 不存在
15
+
16
+ ## 执行流程 (3 Phase / 3 Round)
17
+
18
+ ### Phase 1 — 框架确认(1 轮,高效)
19
+
20
+ 展示 `.fabric/forensic.json` 的 `framework`、`topology.by_ext`、`entry_points` 摘要,向用户提 1-2 个框架架构澄清问题。
21
+
22
+ 示例(Cocos Creator 3.x):
23
+
24
+ > 我检测到 Cocos Creator 3.8 项目,主要脚本在 `assets/scripts`,采用 `@ccclass + extends Component` 模式。请确认:(1) 这是 TypeScript 项目(非 JavaScript)对吗?(2) 节点引用主要通过 `@property(Node)` 注入,还是 `find/getChildByName`?
25
+
26
+ 将用户确认结果暂存为已验证 framework assumptions。
27
+
28
+ ### Phase 2 — 不变式提取(1 轮,关键)
29
+
30
+ 基于 `.fabric/forensic.json` 的 `recommendations_for_skill` 列表,向用户提 3-5 个 invariants 问题,覆盖三类:
31
+
32
+ - `ban`:禁止 any、禁止 update() 中 async、禁止 find-by-name 等
33
+ - `require`:必须 strict TypeScript、必须 `@ccclass` decorator、必须 import from `cc` only 等
34
+ - `protect`:哪些目录或文件 AI 不能修改,一般是 `assets/prefabs/**`、`assets/scenes/**`、`**/*.meta`
35
+
36
+ 原则:
37
+
38
+ - 只问 invariants,不问 preferences
39
+ - 每个问题只接受 yes/no/具体规则,不接受模糊回答
40
+ - 不要自动推测用户未确认的硬约束
41
+
42
+ ### Phase 3 — 构造与落地(1 轮,自动)
43
+
44
+ 1. 写入 `.fabric/init-context.json`,包含:
45
+
46
+ - `framework`
47
+ - `architecture_patterns`
48
+ - `invariants`
49
+ - `domain_groups`
50
+ - `interview_trail`
51
+ - `forensic_ref`
52
+
53
+ 写入规则:
54
+
55
+ - `invariants[].type` 必须是 `ban`、`require`、`protect`
56
+ - `domain_groups` 由 `entry_points` 和访谈结果推断
57
+ - `interview_trail[]` 必须记录 Phase 1 和 Phase 2 的原始问答
58
+ - `forensic_ref` 必须为 `.fabric/forensic.json`
59
+
60
+ 2. 生成分层 `AGENTS.md`:
61
+
62
+ - 根 `AGENTS.md` 必须在 300 行以内,结构包含:
63
+ - `# {projectName} — L0 AGENTS.md`
64
+ - `<!-- fab:index -->`:填充 `domain_groups` 索引
65
+ - `## L0 AI Constraints`:从 invariants 派生,按 `ban`、`require`、`protect` 分段
66
+ - `## @HUMAN`:protect 路径和用户声明的人类保护规则
67
+ - `## L1 Candidate Notes`:domain_groups 对应的候选子模块说明
68
+
69
+ 如果 `domain_groups.length >= 2`,为每个 group 生成 `{group_path}/AGENTS.md`。最多到 L3,总嵌套不超过 4 层。
70
+
71
+ 3. 更新 `.fabric/agents.meta.json` 的 nodes 树,保持 revision hash 链一致:
72
+
73
+ - nodes 结构与生成后的 AGENTS 层级一致
74
+ - 更新所有变更 AGENTS 文件的 hash
75
+ - 保持 revision hash 链内部一致
76
+
77
+ 4. 最终输出:向用户列出生成文件清单,并建议后续维护时运行 `fab sync-meta`。
78
+
79
+ ## Hard Rules
80
+
81
+ - Zero TODO: 不生成任何 `TODO`、`TBD`、placeholder、stub
82
+ - No YAML frontmatter in outputs: 除本 skill 自身外,生成的 `AGENTS.md` 不得包含 YAML frontmatter
83
+ - Root AGENTS.md <= 300 lines
84
+ - AGENTS 嵌套总层级 <= 4
85
+ - 不得自动推测用户未确认的 invariants
86
+ - 有不确定内容时删除,不要留占位符
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env node
2
+ const { existsSync } = require("node:fs");
3
+ const { join } = require("node:path");
4
+
5
+ const forensicPath = join(process.cwd(), ".fabric", "forensic.json");
6
+ const initContextPath = join(process.cwd(), ".fabric", "init-context.json");
7
+
8
+ if (!existsSync(forensicPath) || existsSync(initContextPath)) {
9
+ process.exit(0);
10
+ }
11
+
12
+ process.stdout.write(
13
+ JSON.stringify({
14
+ hookSpecificOutput: {
15
+ additionalContext:
16
+ "Fabric initialization is still pending in this repository. Read .fabric/forensic.json, .fabric/bootstrap/README.md, and use the repo skill at .agents/skills/fabric-init/SKILL.md before proceeding. If Codex hooks are not firing, ensure features.codex_hooks = true is enabled in your Codex config.",
17
+ },
18
+ }),
19
+ );
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ const { existsSync } = require("node:fs");
3
+ const { join } = require("node:path");
4
+
5
+ const forensicPath = join(process.cwd(), ".fabric", "forensic.json");
6
+ const initContextPath = join(process.cwd(), ".fabric", "init-context.json");
7
+
8
+ if (!existsSync(forensicPath) || existsSync(initContextPath)) {
9
+ process.exit(0);
10
+ }
11
+
12
+ process.stdout.write(
13
+ JSON.stringify({
14
+ decision: "block",
15
+ reason:
16
+ "fab init has collected Fabric evidence, but initialization follow-up is still pending. Ensure features.codex_hooks = true is enabled, then use the repo skill at .agents/skills/fabric-init/SKILL.md and review .fabric/forensic.json plus .fabric/bootstrap/README.md before continuing.",
17
+ }),
18
+ );