@fenglimg/fabric-cli 2.0.0 → 2.0.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/LICENSE +21 -0
- package/README.md +6 -5
- package/dist/chunk-BATF4PEJ.js +361 -0
- package/dist/{chunk-OBQU6NHO.js → chunk-COI5VDFU.js} +0 -18
- package/dist/chunk-D25XJ4BC.js +880 -0
- package/dist/chunk-MF3OTILQ.js +544 -0
- package/dist/chunk-PWLW3B57.js +18 -0
- package/dist/config-XJIPZNUP.js +13 -0
- package/dist/doctor-EJDSEJSS.js +810 -0
- package/dist/index.js +15 -8
- package/dist/{init-BIRSIOXO.js → install-EKWMFLUU.js} +622 -711
- package/dist/metrics-ACEQFPDU.js +122 -0
- package/dist/onboard-coverage-MFCAEBDO.js +220 -0
- package/dist/{plan-context-hint-QMUPAXIB.js → plan-context-hint-FC6P3WFE.js} +34 -28
- package/dist/uninstall-MH7ZIB6M.js +1064 -0
- package/package.json +30 -5
- package/templates/hooks/cite-policy-evict.cjs +231 -0
- package/templates/hooks/configs/README.md +29 -6
- package/templates/hooks/configs/claude-code.json +14 -3
- package/templates/hooks/configs/codex-hooks.json +6 -3
- package/templates/hooks/configs/cursor-hooks.json +8 -10
- package/templates/hooks/fabric-hint.cjs +833 -105
- package/templates/hooks/knowledge-hint-broad.cjs +509 -135
- package/templates/hooks/knowledge-hint-narrow.cjs +791 -26
- package/templates/hooks/lib/banner-i18n.cjs +309 -0
- package/templates/hooks/lib/cite-contract-reminder.cjs +173 -0
- package/templates/hooks/lib/cite-line-parser.cjs +158 -0
- package/templates/hooks/lib/client-adapter.cjs +106 -0
- package/templates/hooks/lib/config-cache.cjs +107 -0
- package/templates/hooks/lib/state-store.cjs +84 -0
- package/templates/hooks/lib/summary-fallback.cjs +210 -0
- package/templates/skills/fabric-archive/SKILL.md +93 -419
- package/templates/skills/fabric-archive/ref/dry-run-scope.md +16 -0
- package/templates/skills/fabric-archive/ref/e5-cron-recap.md +58 -0
- package/templates/skills/fabric-archive/ref/i18n-policy.md +86 -0
- package/templates/skills/fabric-archive/ref/phase-0-range-resolution.md +156 -0
- package/templates/skills/fabric-archive/ref/phase-1-5-onboard.md +218 -0
- package/templates/skills/fabric-archive/ref/phase-1-cross-session.md +62 -0
- package/templates/skills/fabric-archive/ref/phase-2-5-viability.md +68 -0
- package/templates/skills/fabric-archive/ref/phase-3-5-scope.md +108 -0
- package/templates/skills/fabric-archive/ref/phase-3-classify.md +63 -0
- package/templates/skills/fabric-archive/ref/phase-4-5-emit.md +78 -0
- package/templates/skills/fabric-archive/ref/phase-4-mcp-persist.md +89 -0
- package/templates/skills/fabric-archive/ref/rc-history.md +38 -0
- package/templates/skills/fabric-archive/ref/worked-examples.md +78 -0
- package/templates/skills/fabric-import/SKILL.md +75 -516
- package/templates/skills/fabric-import/ref/checkpoint-state.md +85 -0
- package/templates/skills/fabric-import/ref/i18n-policy.md +79 -0
- package/templates/skills/fabric-import/ref/output-contract.md +61 -0
- package/templates/skills/fabric-import/ref/phase-2-mining.md +213 -0
- package/templates/skills/fabric-import/ref/phase-3-dedup.md +75 -0
- package/templates/skills/fabric-import/ref/state-recovery.md +57 -0
- package/templates/skills/fabric-import/ref/worked-examples.md +127 -0
- package/templates/skills/fabric-review/SKILL.md +86 -284
- package/templates/skills/fabric-review/ref/askuserquestion-policy.md +66 -0
- package/templates/skills/fabric-review/ref/i18n-policy.md +111 -0
- package/templates/skills/fabric-review/ref/modify-flow.md +103 -0
- package/templates/skills/fabric-review/ref/output-contract.md +58 -0
- package/templates/skills/fabric-review/ref/per-mode-flows.md +155 -0
- package/templates/skills/fabric-review/ref/semantic-check.md +26 -0
- package/templates/skills/fabric-review/ref/worked-examples.md +95 -0
- package/templates/skills/lib/shared-policy.md +69 -0
- package/dist/chunk-6ICJICVU.js +0 -10
- package/dist/chunk-74SZWYPH.js +0 -658
- package/dist/chunk-EYIDD2YS.js +0 -1000
- package/dist/doctor-T7JWODKG.js +0 -282
- package/dist/hooks-Y74Y5LQS.js +0 -12
- package/dist/scan-LMK3UCWL.js +0 -22
- package/dist/serve-H554BHLG.js +0 -124
- package/templates/agents-md/AGENTS.md.template +0 -59
- package/templates/bootstrap/CLAUDE.md +0 -8
- package/templates/bootstrap/codex-AGENTS-header.md +0 -6
- package/templates/bootstrap/cursor-fabric-bootstrap.mdc +0 -10
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Shared skill policy — cross-skill canonical core (rc.37 NEW-13)
|
|
2
|
+
|
|
3
|
+
> **Single source of truth** for the policy invariants that fabric-archive,
|
|
4
|
+
> fabric-review, and fabric-import all depend on. Each skill's `ref/` keeps
|
|
5
|
+
> only its skill-specific examples and points here (`../../lib/shared-policy.md`)
|
|
6
|
+
> for the common rules. Edit invariants HERE — never fork them per skill.
|
|
7
|
+
|
|
8
|
+
## 1. Protected tokens — NEVER translated
|
|
9
|
+
|
|
10
|
+
When rendering bilingual (zh-CN ↔ en) output, prose is translated but the
|
|
11
|
+
following classes of token appear **verbatim in both variants**:
|
|
12
|
+
|
|
13
|
+
- **MCP tool + field names**: `fab_extract_knowledge`, `fab_review`,
|
|
14
|
+
`fab_recall`, `fab_plan_context`, `fab_get_knowledge_sections`,
|
|
15
|
+
`relevance_scope`, `relevance_paths`, `source_sessions`, `proposed_reason`,
|
|
16
|
+
`session_context`, `intent_clues`, `tech_stack`, `impact`, `must_read_if`,
|
|
17
|
+
`evidence_paths`, `tags`, `pending_path`, `layer`.
|
|
18
|
+
- **Enum / routing values**: `narrow`, `broad`, `team`, `personal`, `draft`,
|
|
19
|
+
`verified`, `proven`, `knowledge_scope_degraded`.
|
|
20
|
+
- **Imperatives + paths**: `MUST`, `NEVER`, `.fabric/knowledge/`, file paths.
|
|
21
|
+
|
|
22
|
+
The authoritative machine-checked list is `PROTECTED_TOKENS` in
|
|
23
|
+
`@fenglimg/fabric-shared` (enforced by `scripts/lint-protected-tokens.ts`).
|
|
24
|
+
Bilingualization scope is **prose ONLY**.
|
|
25
|
+
|
|
26
|
+
## 2. AskUserQuestion routing-key invariant
|
|
27
|
+
|
|
28
|
+
When any skill issues an `AskUserQuestion`:
|
|
29
|
+
|
|
30
|
+
- `header` + `question` → user-facing prose → **translated** per
|
|
31
|
+
`.fabric/fabric-config.json` → `fabric_language`.
|
|
32
|
+
- `options[]` entries → **routing keys** consumed by the skill's `switch`
|
|
33
|
+
over the returned choice → stay **English** in BOTH variants.
|
|
34
|
+
|
|
35
|
+
Canonical option arrays (English in every locale):
|
|
36
|
+
|
|
37
|
+
- Per-item review action: `["approve", "reject", "modify", "defer", "skip"]`
|
|
38
|
+
- Stale-item action (review health mode): `["defer", "demote", "skip"]`
|
|
39
|
+
- Layer-flip target: `["team", "personal"]`
|
|
40
|
+
|
|
41
|
+
A skill that translates `options[]` MUST then dual-string-match
|
|
42
|
+
(`choice === "approve" || choice === "通过"`); avoid this — keep options
|
|
43
|
+
English so the state machine stays single-string.
|
|
44
|
+
|
|
45
|
+
## 3. Layer heuristic (team vs personal)
|
|
46
|
+
|
|
47
|
+
Default classification when archiving / proposing knowledge:
|
|
48
|
+
|
|
49
|
+
- **强 team** — cross-cutting decisions, architecture, shared pitfalls,
|
|
50
|
+
conventions the whole repo depends on.
|
|
51
|
+
- **强 personal** — individual workflow preferences, local environment quirks,
|
|
52
|
+
notes scoped to one contributor (`KP-*` ids, in-repo `~/.fabric` root).
|
|
53
|
+
- **默认 team** — when ambiguous, default to `team` (shared visibility is the
|
|
54
|
+
safer default; a mis-scoped personal entry hides knowledge from the team).
|
|
55
|
+
|
|
56
|
+
This block is itself a protected token sequence — render `强 team` /
|
|
57
|
+
`强 personal` / `默认 team` verbatim.
|
|
58
|
+
|
|
59
|
+
## 4. Events emit convention
|
|
60
|
+
|
|
61
|
+
Skills persist lifecycle via MCP tools (which emit the canonical events) —
|
|
62
|
+
they do NOT hand-write `.fabric/events.jsonl`:
|
|
63
|
+
|
|
64
|
+
- `fab_extract_knowledge` → `knowledge_proposed` (+ archive-attempt events).
|
|
65
|
+
- `fab_review` approve → `knowledge_promote_started` → `knowledge_promoted`.
|
|
66
|
+
- `fab_review` modify-layer → `knowledge_layer_changed` (+ id-redirect).
|
|
67
|
+
|
|
68
|
+
Never instruct the user to delete or hand-edit the event ledger; it is the
|
|
69
|
+
append-only audit trail. Counter rollups live in `.fabric/metrics.jsonl`.
|