@fenglimg/fabric-cli 2.0.0-rc.26 → 2.0.0-rc.28
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-AXKII55Y.js → chunk-PNRWNUFX.js} +138 -1
- package/dist/index.js +4 -4
- package/dist/{install-3MWBW6N7.js → install-MPSTI654.js} +2 -2
- package/dist/{plan-context-hint-KPGOW3QC.js → plan-context-hint-CXTLNVSV.js} +17 -2
- package/dist/{uninstall-SUSIZHGL.js → uninstall-VLLJG7JT.js} +1 -1
- package/package.json +3 -3
- package/templates/hooks/fabric-hint.cjs +104 -12
- package/templates/hooks/knowledge-hint-narrow.cjs +41 -2
- package/templates/hooks/lib/banner-i18n.cjs +27 -0
- package/templates/hooks/lib/cite-line-parser.cjs +42 -8
- package/templates/skills/fabric-archive/SKILL.md +29 -409
- package/templates/skills/fabric-archive/ref/e5-cron-recap.md +58 -0
- package/templates/skills/fabric-archive/ref/i18n-policy.md +80 -0
- package/templates/skills/fabric-archive/ref/phase-0-4-onboard.md +218 -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 +7 -117
- package/templates/skills/fabric-import/ref/i18n-policy.md +73 -0
- package/templates/skills/fabric-import/ref/state-recovery.md +57 -0
- package/templates/skills/fabric-review/SKILL.md +6 -187
- package/templates/skills/fabric-review/ref/i18n-policy.md +105 -0
- package/templates/skills/fabric-review/ref/worked-examples.md +95 -0
|
@@ -32,7 +32,7 @@ This skill is `Check-not-Ask`, not a preference interview:
|
|
|
32
32
|
|
|
33
33
|
## 执行流程 (6 Phase / 1 User Review Round)
|
|
34
34
|
|
|
35
|
-
### Phase -0.5 — Range Resolution
|
|
35
|
+
### Phase -0.5 — Range Resolution
|
|
36
36
|
|
|
37
37
|
When the skill is invoked, the user's prompt may carry an explicit range hint —
|
|
38
38
|
a time window (`今日` / `last week`), a topic keyword (`rc.20`, `cite policy`),
|
|
@@ -252,82 +252,16 @@ defaults if absent):
|
|
|
252
252
|
|
|
253
253
|
If `.fabric/fabric-config.json` is missing or unreadable, use defaults silently.
|
|
254
254
|
|
|
255
|
-
### UX i18n Policy
|
|
256
|
-
|
|
257
|
-
The skill consults `fabric_language` from `.fabric/fabric-config.json`
|
|
258
|
-
(固化于 init 时,via `lib/detect-language.ts:detectExistingLanguage`; default `"en"` when no
|
|
259
|
-
CJK signal is detected in README + docs/; may resolve to `"match-existing"`,
|
|
260
|
-
`"zh-CN"`, `"en"`, or `"zh-CN-hybrid"`). All user-facing text in the
|
|
261
|
-
following 5 categories MUST be rendered in the resolved language:
|
|
262
|
-
|
|
263
|
-
1. **Roll-up templates** — the `# Archive Review — N candidates` batch
|
|
264
|
-
review block (one per candidate) AND any final session summary the
|
|
265
|
-
skill emits after Phase 2 completes. zh-CN ↔ en mirror.
|
|
266
|
-
2. **Errors / Preconditions warnings** — abort + gate-fail messages (e.g.
|
|
267
|
-
the "没有触发归档信号…" trigger-miss and the "本次会话为常规执行…"
|
|
268
|
-
viability-gate-FAIL message). zh-CN ↔ en mirror.
|
|
269
|
-
3. **Confirmation prompts** — the per-candidate `Confirm? (Y to accept,
|
|
270
|
-
edit … inline, N to skip)` line in the batch review template. zh-CN
|
|
271
|
-
↔ en mirror.
|
|
272
|
-
4. **Dry-run table headers** — fabric-archive does not currently expose
|
|
273
|
-
a dry-run mode; this slot is reserved for parity with fabric-import.
|
|
274
|
-
IF a future revision adds dry-run, the table header MUST be
|
|
275
|
-
bilingualized per this policy. zh-CN ↔ en mirror.
|
|
276
|
-
5. **AskUserQuestion** — `header` + `question` fields (NOT `options[]`).
|
|
277
|
-
zh-CN ↔ en mirror. fabric-archive itself does not surface
|
|
278
|
-
AskUserQuestion in the current contract (Phase 1 batch review is a
|
|
279
|
-
single markdown screen, not a structured question), but if a future
|
|
280
|
-
version adds one — e.g. to confirm layer flip — this rule applies.
|
|
281
|
-
|
|
282
|
-
Rendering rule:
|
|
283
|
-
|
|
284
|
-
- `fabric_language === "zh-CN"` → emit the zh-CN variant; pure monolingual, no language mixing inside a single user-facing block.
|
|
285
|
-
- `fabric_language === "en"` → emit the en variant; pure monolingual, no language mixing inside a single user-facing block.
|
|
286
|
-
- `fabric_language === "zh-CN-hybrid"` → emit Chinese narrative prose with English technical terms preserved. Protected tokens (always EN): MCP tool names (e.g. `fab_get_knowledge_sections`), CLI command names (e.g. `fab install`), file paths, technical concepts (`Skill`, `SessionStart`, `hook`, `MCP`, `revision_hash`, `pending`, `proven`, `verified`, `draft`).
|
|
287
|
-
- `fabric_language === "match-existing"` or any other value → emit the en variant; pure monolingual.
|
|
288
|
-
|
|
289
|
-
Protected tokens (`fab_extract_knowledge`, `relevance_scope`,
|
|
290
|
-
`relevance_paths`, `narrow`, `broad`, `source_sessions`, `proposed_reason`,
|
|
291
|
-
`session_context`, `intent_clues`, `tech_stack`, `impact`, `must_read_if`,
|
|
292
|
-
`pending_path`, `layer`, `team`, `personal`,
|
|
293
|
-
`knowledge_scope_degraded`, `MUST`, `NEVER`, `.fabric/knowledge/`, the verbatim
|
|
294
|
-
`强 team` / `强 personal` / `默认 team` heuristic block, etc.) are NEVER
|
|
295
|
-
translated — they appear verbatim in both language variants. The
|
|
296
|
-
bilingualization scope is prose ONLY.
|
|
297
|
-
|
|
298
|
-
### AskUserQuestion i18n Policy (value vs label)
|
|
299
|
-
|
|
300
|
-
When a skill (this one or any sibling skill the user is composing with)
|
|
301
|
-
issues an `AskUserQuestion`, the `header` and `question` strings are
|
|
302
|
-
user-facing prose → translated per `fabric_language`. The `options[]`
|
|
303
|
-
array entries (e.g. `["approve", "reject", "modify", "defer", "skip"]` in
|
|
304
|
-
fabric-review, or `["team", "personal"]` for a layer-flip target) are
|
|
305
|
-
**routing keys** consumed by the skill state machine — they MUST remain
|
|
306
|
-
English regardless of `fabric_language`.
|
|
255
|
+
### UX i18n Policy
|
|
307
256
|
|
|
308
|
-
|
|
309
|
-
// EN (fabric_language === "en")
|
|
310
|
-
AskUserQuestion({
|
|
311
|
-
header: "Layer-flip target",
|
|
312
|
-
question: "Move '{title}' to which layer? (current: {current_layer})",
|
|
313
|
-
options: ["team", "personal"]
|
|
314
|
-
})
|
|
257
|
+
Read `.fabric/fabric-config.json` → `fabric_language` (`zh-CN` / `en` / `zh-CN-hybrid` / `match-existing`). Emit all user-facing prose in the resolved variant. Protected tokens (MCP tool names like `fab_extract_knowledge`, schema fields like `relevance_scope`, the verbatim `强 team` / `强 personal` / `默认 team` heuristic block) are NEVER translated.
|
|
315
258
|
|
|
316
|
-
|
|
317
|
-
AskUserQuestion({
|
|
318
|
-
header: "Layer 切换目标",
|
|
319
|
-
question: "将 '{title}' 切换到哪一层?(当前: {current_layer})",
|
|
320
|
-
options: ["team", "personal"] // 不翻译 — routing key
|
|
321
|
-
})
|
|
322
|
-
```
|
|
259
|
+
`AskUserQuestion` policy: `header` + `question` translate; `options[]` are routing keys — stay English regardless of locale.
|
|
323
260
|
|
|
324
|
-
|
|
325
|
-
dual-string match (e.g. `if (choice === "team" || choice === "团队")`),
|
|
326
|
-
which doubles the surface area for protected-token regressions and breaks
|
|
327
|
-
the option-list invariants that downstream tooling depends on. Keeping
|
|
328
|
-
`options[]` English-only is contract-locked across all three skills.
|
|
261
|
+
**For the full 5-class taxonomy + edge cases:** `Read packages/cli/templates/skills/fabric-archive/ref/i18n-policy.md` (or `.claude/skills/fabric-archive/ref/i18n-policy.md` post-install).
|
|
329
262
|
|
|
330
|
-
|
|
263
|
+
|
|
264
|
+
### Phase 0.0 — Collect Cross-Session Digests
|
|
331
265
|
|
|
332
266
|
Before any single-session collection or viability gating, stitch together
|
|
333
267
|
context from every session that has accumulated since the last
|
|
@@ -458,219 +392,11 @@ events), treat all sessions as never-attempted (current default behavior) —
|
|
|
458
392
|
step 4.5 rule (e) applies uniformly, so the filter degrades to the legacy
|
|
459
393
|
"scan everything since anchor" semantics without raising errors.
|
|
460
394
|
|
|
461
|
-
### Phase 0.4 — First-run Onboard
|
|
462
|
-
|
|
463
|
-
#### Phase 0.4 Trigger Gate (rc.25 — entry-context aware)
|
|
464
|
-
|
|
465
|
-
Before running ANY of the onboard coverage steps below, evaluate the
|
|
466
|
-
**entry-context gate**. Onboard slot collection is an interactive,
|
|
467
|
-
one-time project-tone capture flow that REQUIRES live user dialogue.
|
|
468
|
-
Non-user-active entries (hook / AI self-trigger / cron) either interrupt
|
|
469
|
-
the user mid-work or run unattended where dialogue is impossible, so
|
|
470
|
-
they MUST skip Phase 0.4 entirely and fall through to Phase 0.
|
|
471
|
-
|
|
472
|
-
Read `context.entry_point` — already determined in **Phase -0.5 Range
|
|
473
|
-
Resolution** (see TASK-04 / Phase -0.5 section above). The 5-entry model
|
|
474
|
-
is the canonical taxonomy for this gate.
|
|
475
|
-
|
|
476
|
-
##### Entry-context detection rules
|
|
477
|
-
|
|
478
|
-
| Entry | Symbol | Detection rule (LLM-native, evaluated at skill entry) |
|
|
479
|
-
|-------|--------|-------------------------------------------------------|
|
|
480
|
-
| **E1** | `hook_passive` | stdout JSON `{decision:'block', ...}` from `archive-hint.cjs` detected at skill entry (the Stop-hook reminder path). |
|
|
481
|
-
| **E2** | `explicit_user_invoke` | User prompt is a direct invocation: `fabric archive` / `/fabric-archive` / `archive what we just did` / `归档一下` / similar imperative. |
|
|
482
|
-
| **E3** | `ai_self_trigger` | AI internal marker `self-archive policy triggered by signal: <X>` present (substring match on the verbatim prefix `self-archive policy triggered by signal`; `<X>` is one of the 4 self-trigger signals from AGENTS.md E3 section: `Normative` / `Wrong-turn-and-revert` / `Decision confirmation` / `Explicit dismissal`). |
|
|
483
|
-
| **E4** | `user_range_rollback` | Prompt contains a **range hint** (parsed in Phase -0.5 — e.g. `今日` / `上周` / `rc.20`) AND the user is invoking. Sub-mode of E2. |
|
|
484
|
-
| **E5** | `cron` | Prompt contains literal `今日复盘` / `daily recap` / `daily-archive` AND no human is present (running under `/loop`, OS cron, or scheduled trigger). |
|
|
485
|
-
|
|
486
|
-
##### Gate decision
|
|
487
|
-
|
|
488
|
-
```
|
|
489
|
-
IF context.entry_point ∈ {E2_explicit_user_invoke, E4_user_range_rollback}:
|
|
490
|
-
→ gate = PROCEED # user is live, dialogue is possible
|
|
491
|
-
→ continue to Step 1 (Check coverage) below
|
|
492
|
-
ELSE (E1_hook_passive | E3_ai_self_trigger | E5_cron):
|
|
493
|
-
→ gate = SKIP # no live user, onboard prompting would misfire
|
|
494
|
-
→ emit one-line log: "Phase 0.4 skipped (entry=<E1|E3|E5>, no live user)"
|
|
495
|
-
→ proceed directly to Phase 0
|
|
496
|
-
```
|
|
497
|
-
|
|
498
|
-
##### Rationale
|
|
499
|
-
|
|
500
|
-
Onboard slot collection is a one-time project-tone capture flow that
|
|
501
|
-
requires user dialogue. Non-user-active entries (hook / AI / cron)
|
|
502
|
-
interrupt the user mid-work or run unattended where dialogue is
|
|
503
|
-
impossible, so they MUST skip Phase 0.4. The S5 slot semantics
|
|
504
|
-
(`tech-stack-decision`, `architecture-pattern`, ...) are user-validated
|
|
505
|
-
baselines — populating them from a hook fire-and-forget or a cron daily
|
|
506
|
-
recap would defeat the purpose of capturing _user-confirmed_ project
|
|
507
|
-
tone.
|
|
508
|
-
|
|
509
|
-
##### Tradeoff (documented in CHANGELOG)
|
|
510
|
-
|
|
511
|
-
A first-time user whose ONLY invocations ever come via hook (never an
|
|
512
|
-
explicit `/fabric-archive`) will not see the onboard prompt; the 5
|
|
513
|
-
onboard slots remain empty. Mitigation: documentation tells users to
|
|
514
|
-
run an explicit `fab archive` at least once to populate the onboard
|
|
515
|
-
baseline.
|
|
516
|
-
|
|
517
|
-
##### Worked example
|
|
518
|
-
|
|
519
|
-
```
|
|
520
|
-
$ /loop 24h /fabric-archive 今日复盘
|
|
521
|
-
→ cron context, no live user
|
|
522
|
-
→ Phase -0.5 detects literal "今日复盘" + no-human marker
|
|
523
|
-
→ context.entry_point = E5_cron
|
|
524
|
-
→ Phase 0.4 Trigger Gate evaluates: E5 ∉ {E2, E4} → SKIP
|
|
525
|
-
→ emit log "Phase 0.4 skipped (entry=E5, no live user)"
|
|
526
|
-
→ proceed directly to Phase 0 (collect candidates for daily window)
|
|
527
|
-
```
|
|
528
|
-
|
|
529
|
-
Contrast with E2:
|
|
530
|
-
|
|
531
|
-
```
|
|
532
|
-
$ /fabric-archive
|
|
533
|
-
→ user typed explicit invocation
|
|
534
|
-
→ Phase -0.5: context.entry_point = E2_explicit_user_invoke
|
|
535
|
-
→ Phase 0.4 Trigger Gate evaluates: E2 ∈ {E2, E4} → PROCEED
|
|
536
|
-
→ run Step 1 (Check coverage) below
|
|
537
|
-
```
|
|
538
|
-
|
|
539
|
-
---
|
|
540
|
-
|
|
541
|
-
After F8a removed the auto-`fab scan` baseline pipeline, a freshly installed
|
|
542
|
-
Fabric workspace ships with an EMPTY `.fabric/knowledge/` tree. Five fixed
|
|
543
|
-
**S5 onboard slots** capture the "project tone" baseline that the AI needs
|
|
544
|
-
for high-quality plan_context retrieval from day one:
|
|
545
|
-
|
|
546
|
-
- `tech-stack-decision` — primary languages / frameworks / runtime stack
|
|
547
|
-
- `architecture-pattern` — module layout, service boundaries, layering rules
|
|
548
|
-
- `code-style-tone` — naming / formatting / idiom conventions the project enforces
|
|
549
|
-
- `build-system-idiom` — build tool quirks, scripts, deploy pipeline shape
|
|
550
|
-
- `domain-vocabulary` — business / product terminology that names code entities
|
|
551
|
-
|
|
552
|
-
This phase runs ONCE per archive-skill invocation, BEFORE Phase 0 evidence
|
|
553
|
-
gathering, so coverage state is fresh for the session.
|
|
554
|
-
|
|
555
|
-
#### Step 1 — Check coverage
|
|
556
|
-
|
|
557
|
-
Invoke `fab onboard-coverage --json` and parse the JSON payload:
|
|
558
|
-
|
|
559
|
-
```bash
|
|
560
|
-
fab onboard-coverage --json
|
|
561
|
-
```
|
|
562
|
-
|
|
563
|
-
Expected shape:
|
|
564
|
-
|
|
565
|
-
```json
|
|
566
|
-
{
|
|
567
|
-
"filled": { "tech-stack-decision": ["KT-DEC-0012"], ... },
|
|
568
|
-
"missing": ["architecture-pattern", "code-style-tone"],
|
|
569
|
-
"opted_out": ["domain-vocabulary"],
|
|
570
|
-
"total": 5
|
|
571
|
-
}
|
|
572
|
-
```
|
|
573
|
-
|
|
574
|
-
#### Step 2 — Decide
|
|
575
|
-
|
|
576
|
-
```
|
|
577
|
-
IF missing.length === 0:
|
|
578
|
-
→ skip Phase 0.4 entirely; proceed to Phase 0.
|
|
579
|
-
ELSE:
|
|
580
|
-
→ ask the user how to handle the missing slots (Step 3).
|
|
581
|
-
```
|
|
582
|
-
|
|
583
|
-
#### Step 3 — Prompt user
|
|
584
|
-
|
|
585
|
-
Present a single roll-up listing each missing slot. UX i18n Policy class 5
|
|
586
|
-
applies: the `header` + `question` strings are translated per
|
|
587
|
-
`fabric_language`; the `options[]` routing keys stay English.
|
|
588
|
-
|
|
589
|
-
```ts
|
|
590
|
-
AskUserQuestion({
|
|
591
|
-
header: "Onboard coverage", // zh-CN: "首装基调覆盖"
|
|
592
|
-
question:
|
|
593
|
-
"KB is missing the following project-tone slots: " +
|
|
594
|
-
missing.join(", ") +
|
|
595
|
-
". Tour the project and propose pending entries for each?",
|
|
596
|
-
options: ["fill-all", "fill-each", "dismiss-all", "skip"]
|
|
597
|
-
})
|
|
598
|
-
```
|
|
599
|
-
|
|
600
|
-
`fab_extract_knowledge` is called with `onboard_slot: <slot>` set so each
|
|
601
|
-
proposed entry counts toward coverage once approved via fab_review.
|
|
602
|
-
|
|
603
|
-
| User choice | Action |
|
|
604
|
-
|----------------|--------|
|
|
605
|
-
| `fill-all` | For EACH slot in `missing`, run Step 4 (Tour-and-propose). All proposals share session_id; one batch review at the end (Phase 1). |
|
|
606
|
-
| `fill-each` | Loop slot-by-slot through `missing`. Per slot: ask user `confirm | dismiss | skip` (per-slot AskUserQuestion); `confirm` → run Step 4; `dismiss` → `fab config dismiss-slot <slot>`; `skip` → leave for next archive run. |
|
|
607
|
-
| `dismiss-all` | For EACH slot in `missing`, invoke `Bash("fab config dismiss-slot <slot>")`. Print a one-line confirmation each. Skip to Phase 0. |
|
|
608
|
-
| `skip` | No-op. Slots remain in `missing` for the next archive run. Skip to Phase 0. |
|
|
609
|
-
|
|
610
|
-
#### Step 4 — Tour-and-propose (per-slot)
|
|
611
|
-
|
|
612
|
-
For each slot to fill, the LLM independently sources slot-specific evidence
|
|
613
|
-
from the project (no user prompt — this is a Read-only tour):
|
|
614
|
-
|
|
615
|
-
| Slot | Source files (LLM should Read these) |
|
|
616
|
-
|--------------------------|---------------------------------------|
|
|
617
|
-
| `tech-stack-decision` | `package.json` (+ lockfile), `pyproject.toml` / `Cargo.toml` / `go.mod`, `tsconfig.json`, root README |
|
|
618
|
-
| `architecture-pattern` | Top-level dir tree (`ls -F`), 1-2 entry-point files (`src/index.ts`, `main.go`, etc.), framework-config files (`next.config`, `vite.config`, `astro.config`) |
|
|
619
|
-
| `code-style-tone` | `.editorconfig`, `prettier.config.*`, `eslint.config.*`, `biome.*`, `.prettierrc*`, framework lint config, 2-3 representative source files for naming-pattern inference |
|
|
620
|
-
| `build-system-idiom` | `package.json` `scripts` block, `Makefile`, `taskfile.yaml`, CI yml (`.github/workflows/*.yml`), Dockerfile if present |
|
|
621
|
-
| `domain-vocabulary` | README, `docs/*.md`, top-level `src/` directory names (often domain-aligned), public API entry types |
|
|
395
|
+
### Phase 0.4 — First-run Onboard (ref-only)
|
|
622
396
|
|
|
623
|
-
|
|
397
|
+
**SKIP this phase entirely unless** entry_point ∈ {E2_explicit_user_invoke, E4_user_range_rollback} AND a fresh `fab onboard-coverage --json` reports `missing.length > 0`. For E1 (hook), E3 (AI self-trigger), and E5 (cron), onboard is non-applicable — silently fall through to Phase 0.
|
|
624
398
|
|
|
625
|
-
|
|
626
|
-
- `architecture-pattern` → type=`models`, `proposed_reason=new-dependency-or-pattern`
|
|
627
|
-
- `code-style-tone` → type=`guidelines`, `proposed_reason=explicit-user-mark` (the project ITSELF is the mark)
|
|
628
|
-
- `build-system-idiom` → type=`processes`, `proposed_reason=new-dependency-or-pattern`
|
|
629
|
-
- `domain-vocabulary` → type=`models`, `proposed_reason=new-dependency-or-pattern`
|
|
630
|
-
|
|
631
|
-
Call `fab_extract_knowledge` with the inferred fields PLUS `onboard_slot:
|
|
632
|
-
<slot>`. The pending file's frontmatter will carry the slot label, and the
|
|
633
|
-
next `fab onboard-coverage` run will see the slot as filled (once approved
|
|
634
|
-
via fab_review).
|
|
635
|
-
|
|
636
|
-
Example:
|
|
637
|
-
|
|
638
|
-
```ts
|
|
639
|
-
mcp__fabric__fab_extract_knowledge({
|
|
640
|
-
source_sessions: ["<current-session-id>"],
|
|
641
|
-
recent_paths: ["package.json", "tsconfig.json"],
|
|
642
|
-
user_messages_summary: "Project uses TypeScript + pnpm workspace + Vitest. Node 20 LTS target. ESM-only.",
|
|
643
|
-
type: "decisions",
|
|
644
|
-
slug: "primary-tech-stack",
|
|
645
|
-
layer: "team",
|
|
646
|
-
relevance_scope: "broad", // tech stack applies everywhere
|
|
647
|
-
relevance_paths: [],
|
|
648
|
-
proposed_reason: "decision-confirmation",
|
|
649
|
-
session_context:
|
|
650
|
-
"Session goal: capture onboard tech-stack baseline.\nTurning point: read package.json + tsconfig.json + pnpm-workspace.yaml; stack confirmed.",
|
|
651
|
-
onboard_slot: "tech-stack-decision", // ← claims the slot
|
|
652
|
-
tech_stack: ["typescript", "nodejs", "pnpm", "vitest"]
|
|
653
|
-
})
|
|
654
|
-
```
|
|
655
|
-
|
|
656
|
-
#### Onboard phase constraints (DO NOT TRANSLATE)
|
|
657
|
-
|
|
658
|
-
- MUST run BEFORE Phase 0 evidence gathering — onboard is a separate flow,
|
|
659
|
-
not interleaved with session-archive candidates.
|
|
660
|
-
- MUST call `fab onboard-coverage --json` before deciding; never assume
|
|
661
|
-
coverage state.
|
|
662
|
-
- NEVER fill a slot that is in `opted_out` — `fab onboard-coverage` already
|
|
663
|
-
excludes those from `missing`, but the Skill MUST NOT re-propose them
|
|
664
|
-
even if the user asks "fill all of them" — the dismiss is intentional.
|
|
665
|
-
- NEVER prompt the user when `missing.length === 0` — silent skip.
|
|
666
|
-
- NEVER set `onboard_slot` on a regular session-archive candidate in
|
|
667
|
-
Phase 2 — that field is RESERVED for the onboard phase. Mixing the
|
|
668
|
-
two would let session-archive proposals masquerade as onboard
|
|
669
|
-
coverage and let any random pending file claim a slot.
|
|
670
|
-
- MUST emit `onboard_slot: <slot>` verbatim — the slot name is one of
|
|
671
|
-
the locked S5 strings (tech-stack-decision / architecture-pattern /
|
|
672
|
-
code-style-tone / build-system-idiom / domain-vocabulary). The
|
|
673
|
-
fab_extract_knowledge schema enum will reject anything else.
|
|
399
|
+
When the gate above does fire (live user + missing slots), `Read packages/cli/templates/skills/fabric-archive/ref/phase-0-4-onboard.md` (or `.claude/skills/fabric-archive/ref/phase-0-4-onboard.md` post-install) for the full Step 1-4 (coverage check → user prompt → tour-and-propose) procedure.
|
|
674
400
|
|
|
675
401
|
### Phase 0 — Collect Candidates
|
|
676
402
|
|
|
@@ -1095,6 +821,20 @@ If the skill needs to record a genuinely separate observation in the same sessio
|
|
|
1095
821
|
|
|
1096
822
|
MANDATORY closing step on every skill invocation — runs AFTER Phase 2 (success path) AND on every early-exit path (Phase 0.0 dropped-all, Phase 0.5 gate-FAIL silent-skip or user-active, Phase 1 batch user-dismissed). Drives the Q3.4 outcome state machine + cross-session digest rescan filter.
|
|
1097
823
|
|
|
824
|
+
#### Dry-run override (v2.0.0-rc.27 TASK-007 / audit §2.25)
|
|
825
|
+
|
|
826
|
+
When the user's invocation explicitly carries a dry-run intent — the prompt or `/fabric-archive` invocation contains a literal `--dry-run`, `dry-run`, `dry_run`, or `预览` token — the skill MUST skip Phase 2.5's ledger write. The mandatory contract above is suspended only in this single case; every other early-exit path still emits the event.
|
|
827
|
+
|
|
828
|
+
Rationale: pre-rc.27 the spec read as "MANDATORY on every invocation" which created an irreconcilable conflict when the user explicitly requested a no-mutation preview (audit §2.25). The dry-run override resolves the deadlock by treating dry-run as an entry-context override that disables the ledger side-effect while preserving the rest of the skill's read-side machinery (Phase 0.0 digest collection, Phase 0.5 viability gate, Phase 1 candidate preview render). The user sees what WOULD have happened without the audit trail recording an attempt that never produced a pending entry.
|
|
829
|
+
|
|
830
|
+
Detection rule (substring match, case-insensitive): if the originating prompt contains `--dry-run` | `dry-run` | `dry_run` | `预览` as a standalone token, set `dry_run = true` for the entire skill run and skip the Phase 2.5 event emission. All other phases run normally; their user-facing output should prefix `[DRY-RUN]` to make the mode visible.
|
|
831
|
+
|
|
832
|
+
When `dry_run = true`:
|
|
833
|
+
- Phase 1 batch review header MUST include `[DRY-RUN — no writes will occur]`
|
|
834
|
+
- Phase 2 candidate emission is REPLACED with a "would write N pending entries" preview rendered as a numbered table (`would-write` shape — same columns as the real Phase 1 review)
|
|
835
|
+
- Phase 2.5 event emission is SKIPPED entirely (the rationale above)
|
|
836
|
+
- No `fab_extract_knowledge` MCP call is issued (dry-run is purely read-side)
|
|
837
|
+
|
|
1098
838
|
#### What to emit
|
|
1099
839
|
|
|
1100
840
|
For EACH `session_id` in the run's scope (multi-session E4 runs emit MULTIPLE events — one per session_id; single-session E1/E2/E3/E5 runs emit ONE event), append ONE `session_archive_attempted` line to `.fabric/events.jsonl`:
|
|
@@ -1198,132 +938,12 @@ Next day's cron rescan: Phase 0.0 sees `covered_through_ts < max(ts of session's
|
|
|
1198
938
|
- NEVER paraphrase the verbatim layer heuristic block above — the Chinese text is contract-locked.
|
|
1199
939
|
- MUST preserve protected tokens exactly: `stable_id`, `knowledge_proposed`, `knowledge_archive_aborted`, `knowledge_scope_degraded`, `.fabric/knowledge/pending/`, `fab_extract_knowledge`, `relevance_paths`, `relevance_scope`, `narrow`, `broad`, `edit_paths`, `source_sessions`, `proposed_reason`, `session_context`, `intent_clues`, `tech_stack`, `impact`, `must_read_if`, `pending_path`, `layer`, `team`, `personal`, `MUST`, `NEVER`, `强 team`, `强 personal`, `默认 team`.
|
|
1200
940
|
|
|
1201
|
-
## Worked Examples
|
|
1202
|
-
|
|
1203
|
-
### Example 1 — decision (team)
|
|
1204
|
-
|
|
1205
|
-
Session: User and agent debated whether the Stop-hook should be one .cjs script or three per-client scripts. Settled on one because stdout JSON shape `{"decision":"block","reason"}` is identical across Claude / Codex.
|
|
1206
|
-
|
|
1207
|
-
Skill output:
|
|
1208
|
-
|
|
1209
|
-
```ts
|
|
1210
|
-
mcp__fabric__fab_extract_knowledge({
|
|
1211
|
-
source_sessions: ["WFS-2026-05-10-rc2"],
|
|
1212
|
-
recent_paths: ["templates/claude-hooks/", "packages/cli/src/commands/hooks.ts"],
|
|
1213
|
-
user_messages_summary: "User pushed back on three-script proposal; agreed single .cjs because stdout JSON shape is universal across Claude Code and Codex CLI.",
|
|
1214
|
-
type: "decisions",
|
|
1215
|
-
slug: "single-cjs-hook-script",
|
|
1216
|
-
layer: "team",
|
|
1217
|
-
relevance_scope: "narrow",
|
|
1218
|
-
relevance_paths: [
|
|
1219
|
-
"templates/claude-hooks/**/*.cjs",
|
|
1220
|
-
"packages/cli/src/commands/hooks.ts"
|
|
1221
|
-
],
|
|
1222
|
-
proposed_reason: "decision-confirmation",
|
|
1223
|
-
session_context: "Session goal: ship Stop-hook for v2 release.\nTurning point: user rejected 3-script proposal after seeing identical stdout JSON across Claude / Codex.\nResult: single .cjs path locked in."
|
|
1224
|
-
})
|
|
1225
|
-
```
|
|
1226
|
-
|
|
1227
|
-
Layer = team (引用本项目代码 + fabric-import 路径产物 signals). Scope = narrow (tied to hook templates + hooks command module; single-module evidence in edit_paths).
|
|
1228
|
-
|
|
1229
|
-
### Example 2 — pitfall (team)
|
|
1230
|
-
|
|
1231
|
-
Session: deepMerge silently replaced the existing `hooks.Stop[]` array in `.claude/settings.json` instead of appending. Cost ~30 min to diagnose.
|
|
1232
|
-
|
|
1233
|
-
Skill output:
|
|
1234
|
-
|
|
1235
|
-
```ts
|
|
1236
|
-
mcp__fabric__fab_extract_knowledge({
|
|
1237
|
-
source_sessions: ["WFS-2026-05-10-rc2"],
|
|
1238
|
-
recent_paths: ["packages/cli/src/config/json.ts"],
|
|
1239
|
-
user_messages_summary: "deepMerge default behavior REPLACES arrays. hooks.Stop[] needs an array-append-with-dedupe special case keyed on .command string match.",
|
|
1240
|
-
type: "pitfalls",
|
|
1241
|
-
slug: "deepmerge-array-replace-trap",
|
|
1242
|
-
layer: "team",
|
|
1243
|
-
relevance_scope: "broad",
|
|
1244
|
-
relevance_paths: [],
|
|
1245
|
-
proposed_reason: "diagnostic-then-fix",
|
|
1246
|
-
session_context: "Session goal: wire hook installer for v2.\nTurning point: spent ~30 min chasing why prior Stop[] entries vanished — root cause was deepMerge replacing arrays silently.\nResult: array-append-with-dedupe special case added."
|
|
1247
|
-
})
|
|
1248
|
-
```
|
|
1249
|
-
|
|
1250
|
-
Layer = team (绑定本项目代码的 pitfall signal). Scope = broad (deepMerge gotcha is cross-cutting — applies anywhere JSON merge is used, not just `json.ts`).
|
|
1251
|
-
|
|
1252
|
-
### Example 3 — guideline (personal)
|
|
1253
|
-
|
|
1254
|
-
Session: User mentioned across three projects that they prefer 2-space indent in TypeScript and 4-space in Python.
|
|
1255
|
-
|
|
1256
|
-
Skill output:
|
|
1257
|
-
|
|
1258
|
-
```ts
|
|
1259
|
-
mcp__fabric__fab_extract_knowledge({
|
|
1260
|
-
source_sessions: ["WFS-2026-05-10-rc2"],
|
|
1261
|
-
recent_paths: [".editorconfig"],
|
|
1262
|
-
user_messages_summary: "Personal indent preference: 2-space TS / 4-space Py. Stable across multiple projects, not project-specific.",
|
|
1263
|
-
type: "guidelines",
|
|
1264
|
-
slug: "indent-style-by-language",
|
|
1265
|
-
layer: "personal",
|
|
1266
|
-
relevance_scope: "broad",
|
|
1267
|
-
relevance_paths: [],
|
|
1268
|
-
proposed_reason: "explicit-user-mark",
|
|
1269
|
-
session_context: "Session goal: align editor config.\nTurning point: user said '一直 prefer 2-space TS / 4-space Py,across projects'.\nResult: personal-layer guideline; not bound to this project."
|
|
1270
|
-
})
|
|
1271
|
-
```
|
|
1272
|
-
|
|
1273
|
-
Layer = personal (跨项目通用 + 工具/编辑器偏好 signals dominate; no 强 team signal applies). Scope = broad with `relevance_paths=[]` (personal layer ALWAYS forces broad — paths don't generalize across projects per Phase 1.5 special case).
|
|
1274
|
-
|
|
1275
|
-
## E5 周期触发 (Scheduled Daily Recap)
|
|
1276
|
-
|
|
1277
|
-
### Overview
|
|
1278
|
-
|
|
1279
|
-
`今日复盘` = E5 entry point. Default scope = today. Falls back to historical scan if today yields no candidates (silent-skip per Phase 2.5).
|
|
1280
|
-
|
|
1281
|
-
E5 是 5 入口模型中唯一由 OS 调度器或 Claude Code `/loop` 周期触发的入口形态。fab 端**零代码**——不提供 `fab schedule` 子命令,亦不内嵌 daemon。用户基于自己的执行环境二选一接入: `/loop`(Claude Code 原生,推荐) 或 OS cron(跨平台 fallback)。
|
|
1282
|
-
|
|
1283
|
-
### /loop sample (primary path for Claude Code)
|
|
1284
|
-
|
|
1285
|
-
```
|
|
1286
|
-
/loop /fabric-archive 今日复盘 --cron "0 23 * * *"
|
|
1287
|
-
```
|
|
1288
|
-
|
|
1289
|
-
每晚 23:00 在当前 Claude Code session 中触发 fabric-archive skill,scope = today。`/loop` 复用现有 Claude session 鉴权,无需独立 token。
|
|
1290
|
-
|
|
1291
|
-
### OS cron sample (cross-platform alternative)
|
|
1292
|
-
|
|
1293
|
-
```
|
|
1294
|
-
# crontab -e
|
|
1295
|
-
0 23 * * * cd /path/to/project && claude code -p "/fabric-archive 今日复盘" 2>&1 >> /var/log/fabric-daily-recap.log
|
|
1296
|
-
```
|
|
1297
|
-
|
|
1298
|
-
适用于:
|
|
1299
|
-
- 非 Claude Code 环境(纯 server / CI 节点)
|
|
1300
|
-
- 希望脱离 /loop session 生命周期独立运行的场景
|
|
1301
|
-
- 已有 cron / launchd 调度基础设施的团队
|
|
1302
|
-
|
|
1303
|
-
macOS 用户可改用 `launchd` plist;Linux 用户直接 `crontab -e`。命令需自行确保 `claude code` CLI 已安装且鉴权可用。
|
|
1304
|
-
|
|
1305
|
-
### E5 prompt parse contract
|
|
1306
|
-
|
|
1307
|
-
当用户或 cron 以 `今日复盘` / `daily recap` 字面短语触发 fabric-archive 时,skill 应按以下契约处理:
|
|
1308
|
-
|
|
1309
|
-
- **Phase -0.5 Range Resolution**: 识别 `今日复盘` / `daily recap` 为 magic phrase, 直接设置 `time_window = today` (00:00 local timezone → current ts), 无需 AskUserQuestion 兜底。
|
|
1310
|
-
- **Phase 0.4 Onboard Coverage**: 跳过 (entry_point = E5_cron, 非 E2_explicit, 不弹 onboard 弹问)。
|
|
1311
|
-
- **Phase 2.5 Persist Archive Attempt**: 始终写入 `session_archive_attempted` event。当今日无 archive 信号触发 viability gate FAIL 时,走 silent-skip 路径(outcome = `skipped_no_signal`),skill 静默退出,cron 日志为空。
|
|
1312
|
-
|
|
1313
|
-
### Trade-off table (/loop vs OS cron)
|
|
1314
|
-
|
|
1315
|
-
| 维度 | /loop | OS cron |
|
|
1316
|
-
|---|---|---|
|
|
1317
|
-
| 鉴权 | 复用 Claude session | 独立 token / login |
|
|
1318
|
-
| 跨平台 | Claude Code 全平台一致 | macOS launchd / Linux cron 不同 |
|
|
1319
|
-
| Token 成本 | 累积 (长 session) | 每 tick fresh, 无累积 |
|
|
1320
|
-
| 调试 | Claude UI 可见 | 日志文件 |
|
|
941
|
+
## Worked Examples (ref-only)
|
|
1321
942
|
|
|
1322
|
-
|
|
943
|
+
Three end-to-end fab_extract_knowledge call examples (decision/team, pitfall/team, guideline/personal) live in `packages/cli/templates/skills/fabric-archive/ref/worked-examples.md` (or `.claude/skills/fabric-archive/ref/worked-examples.md` post-install). Load when you want to see all required + optional fields populated together in a realistic shape.
|
|
1323
944
|
|
|
1324
|
-
|
|
1325
|
-
- **OS cron**: 自带恢复(下一个 tick 重新启动),但需独立 `claude code` CLI 安装与鉴权;鉴权 token 过期时 cron job 会静默失败,需人工 `claude login` 重置。
|
|
945
|
+
## E5 Scheduled Daily Recap (ref-only)
|
|
1326
946
|
|
|
1327
|
-
|
|
947
|
+
Only relevant when entry_point=E5_cron (OS cron, `/loop`, or scheduled trigger). For interactive invocations, Phase -0.5 has already routed past this — nothing to load.
|
|
1328
948
|
|
|
1329
|
-
|
|
949
|
+
When E5 fires: `Read packages/cli/templates/skills/fabric-archive/ref/e5-cron-recap.md` (or `.claude/skills/fabric-archive/ref/e5-cron-recap.md` post-install) for `/loop` vs OS cron tradeoffs + the `今日复盘` magic-phrase parse contract.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# E5 Scheduled Daily Recap — full reference
|
|
2
|
+
|
|
3
|
+
> **Loaded on demand.** Only relevant when invocation context = `cron` / `/loop` (E5 entry). SKILL.md's Phase -0.5 already gates this — if the user just typed `/fabric-archive`, none of the below applies.
|
|
4
|
+
|
|
5
|
+
## E5 周期触发 (Scheduled Daily Recap)
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
`今日复盘` = E5 entry point. Default scope = today. Falls back to historical scan if today yields no candidates (silent-skip per Phase 2.5).
|
|
10
|
+
|
|
11
|
+
E5 是 5 入口模型中唯一由 OS 调度器或 Claude Code `/loop` 周期触发的入口形态。fab 端**零代码**——不提供 `fab schedule` 子命令,亦不内嵌 daemon。用户基于自己的执行环境二选一接入: `/loop`(Claude Code 原生,推荐) 或 OS cron(跨平台 fallback)。
|
|
12
|
+
|
|
13
|
+
### /loop sample (primary path for Claude Code)
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
/loop /fabric-archive 今日复盘 --cron "0 23 * * *"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
每晚 23:00 在当前 Claude Code session 中触发 fabric-archive skill,scope = today。`/loop` 复用现有 Claude session 鉴权,无需独立 token。
|
|
20
|
+
|
|
21
|
+
### OS cron sample (cross-platform alternative)
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
# crontab -e
|
|
25
|
+
0 23 * * * cd /path/to/project && claude code -p "/fabric-archive 今日复盘" 2>&1 >> /var/log/fabric-daily-recap.log
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
适用于:
|
|
29
|
+
- 非 Claude Code 环境(纯 server / CI 节点)
|
|
30
|
+
- 希望脱离 /loop session 生命周期独立运行的场景
|
|
31
|
+
- 已有 cron / launchd 调度基础设施的团队
|
|
32
|
+
|
|
33
|
+
macOS 用户可改用 `launchd` plist;Linux 用户直接 `crontab -e`。命令需自行确保 `claude code` CLI 已安装且鉴权可用。
|
|
34
|
+
|
|
35
|
+
### E5 prompt parse contract
|
|
36
|
+
|
|
37
|
+
当用户或 cron 以 `今日复盘` / `daily recap` 字面短语触发 fabric-archive 时,skill 应按以下契约处理:
|
|
38
|
+
|
|
39
|
+
- **Phase -0.5 Range Resolution**: 识别 `今日复盘` / `daily recap` 为 magic phrase, 直接设置 `time_window = today` (00:00 local timezone → current ts), 无需 AskUserQuestion 兜底。
|
|
40
|
+
- **Phase 0.4 Onboard Coverage**: 跳过 (entry_point = E5_cron, 非 E2_explicit, 不弹 onboard 弹问)。
|
|
41
|
+
- **Phase 2.5 Persist Archive Attempt**: 始终写入 `session_archive_attempted` event。当今日无 archive 信号触发 viability gate FAIL 时,走 silent-skip 路径(outcome = `skipped_no_signal`),skill 静默退出,cron 日志为空。
|
|
42
|
+
|
|
43
|
+
### Trade-off table (/loop vs OS cron)
|
|
44
|
+
|
|
45
|
+
| 维度 | /loop | OS cron |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| 鉴权 | 复用 Claude session | 独立 token / login |
|
|
48
|
+
| 跨平台 | Claude Code 全平台一致 | macOS launchd / Linux cron 不同 |
|
|
49
|
+
| Token 成本 | 累积 (长 session) | 每 tick fresh, 无累积 |
|
|
50
|
+
| 调试 | Claude UI 可见 | 日志文件 |
|
|
51
|
+
|
|
52
|
+
### Failure modes
|
|
53
|
+
|
|
54
|
+
- **/loop session crash**: 归档暂停,用户需重启 `/loop`。无自动恢复机制——`/loop` 与 Claude Code session 生命周期绑定。
|
|
55
|
+
- **OS cron**: 自带恢复(下一个 tick 重新启动),但需独立 `claude code` CLI 安装与鉴权;鉴权 token 过期时 cron job 会静默失败,需人工 `claude login` 重置。
|
|
56
|
+
|
|
57
|
+
### NOT in scope
|
|
58
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# UX i18n Policy — full reference
|
|
2
|
+
|
|
3
|
+
> **Loaded on demand.** Only consult when rendering bilingual output AND you're unsure which class a string belongs to. SKILL.md gives the operative rule: read `.fabric/fabric-config.json` → `fabric_language`, emit prose in resolved variant, never translate protected tokens. The 5-class taxonomy below disambiguates edge cases.
|
|
4
|
+
|
|
5
|
+
## UX i18n Policy (5-class bilingualization)
|
|
6
|
+
|
|
7
|
+
The skill consults `fabric_language` from `.fabric/fabric-config.json`
|
|
8
|
+
(固化于 init 时,via `lib/detect-language.ts:detectExistingLanguage`; default `"en"` when no
|
|
9
|
+
CJK signal is detected in README + docs/; may resolve to `"match-existing"`,
|
|
10
|
+
`"zh-CN"`, `"en"`, or `"zh-CN-hybrid"`). All user-facing text in the
|
|
11
|
+
following 5 categories MUST be rendered in the resolved language:
|
|
12
|
+
|
|
13
|
+
1. **Roll-up templates** — the `# Archive Review — N candidates` batch
|
|
14
|
+
review block (one per candidate) AND any final session summary the
|
|
15
|
+
skill emits after Phase 2 completes. zh-CN ↔ en mirror.
|
|
16
|
+
2. **Errors / Preconditions warnings** — abort + gate-fail messages (e.g.
|
|
17
|
+
the "没有触发归档信号…" trigger-miss and the "本次会话为常规执行…"
|
|
18
|
+
viability-gate-FAIL message). zh-CN ↔ en mirror.
|
|
19
|
+
3. **Confirmation prompts** — the per-candidate `Confirm? (Y to accept,
|
|
20
|
+
edit … inline, N to skip)` line in the batch review template. zh-CN
|
|
21
|
+
↔ en mirror.
|
|
22
|
+
4. **Dry-run table headers** — v2.0.0-rc.27 TASK-007 added a dry-run
|
|
23
|
+
override path (see Phase 2.5 "dry-run") so users can preview the
|
|
24
|
+
archive proposal without writing pending entries. The dry-run summary
|
|
25
|
+
header and per-candidate preview labels MUST be bilingualized per
|
|
26
|
+
this policy. zh-CN ↔ en mirror.
|
|
27
|
+
5. **AskUserQuestion** — `header` + `question` fields (NOT `options[]`).
|
|
28
|
+
zh-CN ↔ en mirror. fabric-archive itself does not surface
|
|
29
|
+
AskUserQuestion in the current contract (Phase 1 batch review is a
|
|
30
|
+
single markdown screen, not a structured question), but if a future
|
|
31
|
+
version adds one — e.g. to confirm layer flip — this rule applies.
|
|
32
|
+
|
|
33
|
+
Rendering rule:
|
|
34
|
+
|
|
35
|
+
- `fabric_language === "zh-CN"` → emit the zh-CN variant; pure monolingual, no language mixing inside a single user-facing block.
|
|
36
|
+
- `fabric_language === "en"` → emit the en variant; pure monolingual, no language mixing inside a single user-facing block.
|
|
37
|
+
- `fabric_language === "zh-CN-hybrid"` → emit Chinese narrative prose with English technical terms preserved. Protected tokens (always EN): MCP tool names (e.g. `fab_get_knowledge_sections`), CLI command names (e.g. `fab install`), file paths, technical concepts (`Skill`, `SessionStart`, `hook`, `MCP`, `revision_hash`, `pending`, `proven`, `verified`, `draft`).
|
|
38
|
+
- `fabric_language === "match-existing"` or any other value → emit the en variant; pure monolingual.
|
|
39
|
+
|
|
40
|
+
Protected tokens (`fab_extract_knowledge`, `relevance_scope`,
|
|
41
|
+
`relevance_paths`, `narrow`, `broad`, `source_sessions`, `proposed_reason`,
|
|
42
|
+
`session_context`, `intent_clues`, `tech_stack`, `impact`, `must_read_if`,
|
|
43
|
+
`pending_path`, `layer`, `team`, `personal`,
|
|
44
|
+
`knowledge_scope_degraded`, `MUST`, `NEVER`, `.fabric/knowledge/`, the verbatim
|
|
45
|
+
`强 team` / `强 personal` / `默认 team` heuristic block, etc.) are NEVER
|
|
46
|
+
translated — they appear verbatim in both language variants. The
|
|
47
|
+
bilingualization scope is prose ONLY.
|
|
48
|
+
|
|
49
|
+
### AskUserQuestion i18n Policy (value vs label)
|
|
50
|
+
|
|
51
|
+
When a skill (this one or any sibling skill the user is composing with)
|
|
52
|
+
issues an `AskUserQuestion`, the `header` and `question` strings are
|
|
53
|
+
user-facing prose → translated per `fabric_language`. The `options[]`
|
|
54
|
+
array entries (e.g. `["approve", "reject", "modify", "defer", "skip"]` in
|
|
55
|
+
fabric-review, or `["team", "personal"]` for a layer-flip target) are
|
|
56
|
+
**routing keys** consumed by the skill state machine — they MUST remain
|
|
57
|
+
English regardless of `fabric_language`.
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
// EN (fabric_language === "en")
|
|
61
|
+
AskUserQuestion({
|
|
62
|
+
header: "Layer-flip target",
|
|
63
|
+
question: "Move '{title}' to which layer? (current: {current_layer})",
|
|
64
|
+
options: ["team", "personal"]
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
// zh-CN (fabric_language === "zh-CN")
|
|
68
|
+
AskUserQuestion({
|
|
69
|
+
header: "Layer 切换目标",
|
|
70
|
+
question: "将 '{title}' 切换到哪一层?(当前: {current_layer})",
|
|
71
|
+
options: ["team", "personal"] // 不翻译 — routing key
|
|
72
|
+
})
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Rationale: localizing routing keys would force every routing branch to
|
|
76
|
+
dual-string match (e.g. `if (choice === "team" || choice === "团队")`),
|
|
77
|
+
which doubles the surface area for protected-token regressions and breaks
|
|
78
|
+
the option-list invariants that downstream tooling depends on. Keeping
|
|
79
|
+
`options[]` English-only is contract-locked across all three skills.
|
|
80
|
+
|