@fenglimg/fabric-cli 0.1.2 → 0.1.3
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/package.json +4 -3
- package/templates/agents-md/AGENTS.md.template +29 -0
- package/templates/bootstrap/CLAUDE.md +8 -0
- package/templates/bootstrap/GEMINI.md +8 -0
- package/templates/bootstrap/codex-AGENTS-header.md +6 -0
- package/templates/bootstrap/cursor-fabric-bootstrap.mdc +11 -0
- package/templates/bootstrap/roo-fabric.md +6 -0
- package/templates/bootstrap/windsurf-fabric.md +6 -0
- package/templates/fabric/human-lock.json +12 -0
- package/templates/husky/pre-commit +24 -0
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fenglimg/fabric-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
|
-
"fab": "
|
|
6
|
+
"fab": "dist/index.js"
|
|
7
7
|
},
|
|
8
8
|
"main": "./dist/index.js",
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"files": [
|
|
11
|
-
"dist"
|
|
11
|
+
"dist",
|
|
12
|
+
"templates"
|
|
12
13
|
],
|
|
13
14
|
"scripts": {
|
|
14
15
|
"build": "tsup",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# { projectName } — L0 AGENTS.md
|
|
2
|
+
|
|
3
|
+
// TODO: describe project purpose.
|
|
4
|
+
|
|
5
|
+
<!-- TODO: tech stack: detected framework is { frameworkKind }. Verify this manually before replacing TODOs. -->
|
|
6
|
+
|
|
7
|
+
<!-- fab:index -->
|
|
8
|
+
<!-- /fab:index -->
|
|
9
|
+
|
|
10
|
+
## Human Documentation References
|
|
11
|
+
|
|
12
|
+
// TODO: reference README.md sections that are source-of-truth for humans.
|
|
13
|
+
// TODO: reference CONTRIBUTING.md if this project has one.
|
|
14
|
+
|
|
15
|
+
## L0 AI Constraints
|
|
16
|
+
|
|
17
|
+
// TODO: list hard constraints, e.g., ban any, require TypeScript strict.
|
|
18
|
+
// TODO: list commands AI may run for validation.
|
|
19
|
+
// TODO: list files or directories AI must not modify without permission.
|
|
20
|
+
|
|
21
|
+
## @HUMAN
|
|
22
|
+
|
|
23
|
+
// TODO: human-owned decisions live here. AI must not rewrite locked sentences.
|
|
24
|
+
// TODO: placeholder locked sentence 1.
|
|
25
|
+
// TODO: placeholder locked sentence 2.
|
|
26
|
+
|
|
27
|
+
## L1 Candidate Notes
|
|
28
|
+
|
|
29
|
+
// TODO: identify domain folders that may need scoped AGENTS.md files.
|
|
@@ -0,0 +1,8 @@
|
|
|
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` 写一条意图记录。
|
|
7
|
+
|
|
8
|
+
@AGENTS.md
|
|
@@ -0,0 +1,8 @@
|
|
|
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` 写一条意图记录。
|
|
7
|
+
|
|
8
|
+
@AGENTS.md
|
|
@@ -0,0 +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` 写一条意图记录。
|
|
@@ -0,0 +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` 写一条意图记录。
|
|
@@ -0,0 +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` 写一条意图记录。
|
|
@@ -0,0 +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` 写一条意图记录。
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://fabric.local/schemas/human-lock.json",
|
|
3
|
+
"locked": [],
|
|
4
|
+
"examples": [
|
|
5
|
+
{
|
|
6
|
+
"file": "AGENTS.md",
|
|
7
|
+
"start_line": 18,
|
|
8
|
+
"end_line": 22,
|
|
9
|
+
"hash": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Fabric pre-commit hook — sub-300ms budget via single Node process
|
|
3
|
+
# Runs: sync-meta --check-only → human-lint → ledger-append --staged → meta-guard
|
|
4
|
+
# Uses local binary (no npx spawn) to avoid 3× Node startup cost.
|
|
5
|
+
|
|
6
|
+
FAB_BIN="./node_modules/.bin/fab"
|
|
7
|
+
|
|
8
|
+
if [ ! -x "$FAB_BIN" ]; then
|
|
9
|
+
echo "fabric: $FAB_BIN not found. Run 'pnpm install' at repo root." >&2
|
|
10
|
+
exit 1
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
# Single Node invocation covering all three checks + meta guard.
|
|
14
|
+
# The `pre-commit` meta-command chains sync-meta/human-lint/ledger-append
|
|
15
|
+
# inside one process for minimal startup overhead.
|
|
16
|
+
"$FAB_BIN" pre-commit || exit $?
|
|
17
|
+
|
|
18
|
+
# Guard: block manual edits to .fabric/agents.meta.json
|
|
19
|
+
if git diff --cached --name-only | grep -q '^\.fabric/agents\.meta\.json$'; then
|
|
20
|
+
if [ "$FAB_ALLOW_META_EDIT" != '1' ]; then
|
|
21
|
+
echo '.fabric/agents.meta.json cannot be manually edited; use fab_update_registry or set FAB_ALLOW_META_EDIT=1' >&2
|
|
22
|
+
exit 1
|
|
23
|
+
fi
|
|
24
|
+
fi
|