@fenglimg/fabric-cli 1.5.0 → 1.5.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/README.md +13 -13
- package/dist/index.js +2 -2
- package/dist/{init-YR7EVBYQ.js → init-QPKI2QOW.js} +1 -1
- package/package.json +3 -3
- package/templates/codex-hooks/fabric-session-start.cjs +1 -1
- package/templates/codex-hooks/fabric-stop-reminder.cjs +1 -1
- package/templates/codex-skills/fabric-init/SKILL.md +15 -15
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# @fenglimg/fabric-cli
|
|
2
2
|
|
|
3
|
-
`fabric`
|
|
3
|
+
`fabric` 是 Fabric 的主命令,`fab` 是永久别名,两者等价。
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
1.
|
|
8
|
-
2.
|
|
9
|
-
3.
|
|
10
|
-
4.
|
|
11
|
-
|
|
12
|
-
`fabric init`
|
|
5
|
+
## 快速开始
|
|
6
|
+
|
|
7
|
+
1. 在 monorepo 根目录运行 `pnpm install`。
|
|
8
|
+
2. 用 `pnpm --filter @fenglimg/fabric-cli build` 构建 CLI。
|
|
9
|
+
3. 在目标项目运行 `fabric init`,完成一站式初始化。
|
|
10
|
+
4. 启动 `fabric serve`,再去客户端里验证 `fab_get_rules`。
|
|
11
|
+
|
|
12
|
+
`fabric init` 会自动执行 `bootstrap install`、`config install` 和 `hooks install`。只有在需要单独重跑某个阶段时,才需要单独调用它们。
|
|
13
13
|
|
|
14
|
-
`fabric bootstrap install`
|
|
14
|
+
`fabric bootstrap install` 只会刷新 `.fabric/bootstrap/README.md` 里的内部初始化说明,不会再生成根级 `AGENTS.md`、`CLAUDE.md` 或 `GEMINI.md`。
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## 常用命令
|
|
17
17
|
|
|
18
18
|
- `fabric init`
|
|
19
19
|
- `fabric serve`
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
- `fabric approve --interactive`
|
|
22
22
|
- `fabric approve --all`
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## 进阶命令
|
|
25
25
|
|
|
26
26
|
- `fabric bootstrap install`
|
|
27
27
|
- `fabric config install`
|
|
28
28
|
- `fabric hooks install`
|
|
29
29
|
|
|
30
|
-
`fabric approve`
|
|
30
|
+
`fabric approve` 会在审查完成后更新 `.fabric/human-lock.json` 中已经发生漂移的条目。需要逐项确认时使用 `--interactive`,只有在别处已经完成审查时才使用 `--all`。
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { defineCommand, runMain } from "citty";
|
|
|
9
9
|
// src/commands/index.ts
|
|
10
10
|
var allCommands = {
|
|
11
11
|
approve: () => import("./approve-YT4DEABS.js").then((module) => module.default),
|
|
12
|
-
init: () => import("./init-
|
|
12
|
+
init: () => import("./init-QPKI2QOW.js").then((module) => module.default),
|
|
13
13
|
update: () => import("./update-M5M5PYKE.js").then((module) => module.default),
|
|
14
14
|
scan: () => import("./scan-QH76LC7Z.js").then((module) => module.default),
|
|
15
15
|
serve: () => import("./serve-4J2CQY25.js").then((module) => module.default),
|
|
@@ -33,7 +33,7 @@ var allCommands = {
|
|
|
33
33
|
var main = defineCommand({
|
|
34
34
|
meta: {
|
|
35
35
|
name: "fabric",
|
|
36
|
-
version: "1.5.
|
|
36
|
+
version: "1.5.1",
|
|
37
37
|
description: 'Initialize and manage Fabric projects. Use "fabric init" for one-shot setup.'
|
|
38
38
|
},
|
|
39
39
|
subCommands: allCommands
|
|
@@ -1147,7 +1147,7 @@ function readProjectName(target) {
|
|
|
1147
1147
|
return basename(target);
|
|
1148
1148
|
}
|
|
1149
1149
|
function getCliVersion() {
|
|
1150
|
-
return true ? "1.5.
|
|
1150
|
+
return true ? "1.5.1" : "unknown";
|
|
1151
1151
|
}
|
|
1152
1152
|
function sortRecord(record) {
|
|
1153
1153
|
return Object.fromEntries(Object.entries(record).sort(([left], [right]) => left.localeCompare(right)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fenglimg/fabric-cli",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"fab": "dist/index.js",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"tree-sitter-javascript": "^0.25.0",
|
|
23
23
|
"tree-sitter-typescript": "^0.23.2",
|
|
24
24
|
"web-tree-sitter": "^0.26.8",
|
|
25
|
-
"@fenglimg/fabric-server": "1.5.
|
|
26
|
-
"@fenglimg/fabric-shared": "1.5.
|
|
25
|
+
"@fenglimg/fabric-server": "1.5.1",
|
|
26
|
+
"@fenglimg/fabric-shared": "1.5.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/iarna__toml": "^2.0.5",
|
|
@@ -13,7 +13,7 @@ process.stdout.write(
|
|
|
13
13
|
JSON.stringify({
|
|
14
14
|
hookSpecificOutput: {
|
|
15
15
|
additionalContext:
|
|
16
|
-
"Fabric
|
|
16
|
+
"这个仓库的 Fabric 初始化还没完成。继续操作前,请先查看 .fabric/forensic.json 和 .fabric/bootstrap/README.md,并使用仓库内的 .agents/skills/fabric-init/SKILL.md。若 Codex hooks 没有触发,请确认配置里已启用 features.codex_hooks = true。",
|
|
17
17
|
},
|
|
18
18
|
}),
|
|
19
19
|
);
|
|
@@ -13,6 +13,6 @@ process.stdout.write(
|
|
|
13
13
|
JSON.stringify({
|
|
14
14
|
decision: "block",
|
|
15
15
|
reason:
|
|
16
|
-
"fab init
|
|
16
|
+
"fab init 已经收集完当前仓库的初始化依据,但后续初始化还没完成。请先确认 Codex 已启用 features.codex_hooks = true,然后查看 .fabric/forensic.json 和 .fabric/bootstrap/README.md,并使用仓库内的 .agents/skills/fabric-init/SKILL.md 继续初始化。",
|
|
17
17
|
}),
|
|
18
18
|
);
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fabric-init
|
|
3
|
-
description: Use this skill when `.fabric/forensic.json` exists and
|
|
3
|
+
description: Use this skill when `.fabric/forensic.json` exists and this repository still needs the remaining Fabric initialization steps.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
## Hard Rules (
|
|
6
|
+
## Hard Rules (不要翻译受保护 token)
|
|
7
7
|
|
|
8
|
-
MUST:
|
|
9
|
-
MUST:
|
|
10
|
-
MUST:
|
|
11
|
-
MUST:
|
|
8
|
+
MUST: 先读取 `.fabric/forensic.json`,再做其他动作。
|
|
9
|
+
MUST: 把 `.fabric/bootstrap/README.md` 视为当前仓库的初始化说明。
|
|
10
|
+
MUST: 如果 `.fabric/init-context.json` 已存在,立即停止并报告当前仓库看起来已经完成后续初始化。
|
|
11
|
+
MUST: 使用 `.fabric/forensic.json` 和仓库结构中的依据,判断接下来该做什么。
|
|
12
12
|
MUST: Preserve protected tokens exactly: `AGENTS.md`, `FABRIC.md`, `.fabric/agents.meta.json`, `.fabric/human-lock.json`, `.fabric/init-context.json`, `.fabric/forensic.json`, `MUST`, `NEVER`.
|
|
13
|
-
NEVER:
|
|
14
|
-
NEVER:
|
|
15
|
-
NEVER:
|
|
13
|
+
NEVER: 在没有检查 `.fabric/init-context.json` 的情况下声称初始化已经完成。
|
|
14
|
+
NEVER: 改写或翻译受保护 token。
|
|
15
|
+
NEVER: 在判断下一步初始化动作时忽略 `.fabric/bootstrap/README.md`。
|
|
16
16
|
|
|
17
17
|
## Purpose
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
当你在 Codex 中处理这个仓库,并且 `fab init` 已经生成 `.fabric/forensic.json` 时,使用这个 skill 继续完成仓库专属的 Fabric 初始化。目标是基于当前仓库的初始化依据和内部说明,明确下一步该做什么,而不是重新解释一遍通用流程。
|
|
20
20
|
|
|
21
21
|
## Workflow
|
|
22
22
|
|
|
23
|
-
1.
|
|
24
|
-
2.
|
|
25
|
-
3.
|
|
26
|
-
4.
|
|
27
|
-
5.
|
|
23
|
+
1. 读取 `.fabric/forensic.json`。
|
|
24
|
+
2. 读取 `.fabric/bootstrap/README.md`。
|
|
25
|
+
3. 检查 `.fabric/init-context.json` 是否已经存在。
|
|
26
|
+
4. 如果初始化仍未完成,明确总结当前仓库接下来要做的初始化动作。
|
|
27
|
+
5. 只讨论这个仓库的后续初始化,不扩展到无关建议。
|