@deftai/directive-content 0.92.0 → 0.94.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 (35) hide show
  1. package/.agents/skills/deft-directive-xbrief/SKILL.md +11 -0
  2. package/Taskfile.yml +8 -3
  3. package/UPGRADING.md +14 -0
  4. package/ci-cd/README.md +57 -0
  5. package/ci-cd/blacksmith/README.md +32 -0
  6. package/ci-cd/blacksmith/examples/lint-vs-test-split.md +98 -0
  7. package/ci-cd/blacksmith/migration-prompt.md +80 -0
  8. package/ci-cd/blacksmith/overview.md +58 -0
  9. package/ci-cd/blacksmith/runner-tiers.md +80 -0
  10. package/coding/coding.md +7 -1
  11. package/coding/docs.md +44 -0
  12. package/coding/review.md +50 -0
  13. package/commands.md +81 -3
  14. package/conventions/content-manifest.json +6 -1
  15. package/deployments/README.md +8 -0
  16. package/docs/openclaw-agent-host.md +46 -0
  17. package/docs/skill-discovery-hosts.md +84 -0
  18. package/docs/slash-multi-host.md +241 -0
  19. package/main.md +1 -0
  20. package/package.json +1 -1
  21. package/packs/rules/rules-pack-0.1.json +137 -1
  22. package/packs/skills/skills-pack-0.1.json +22 -6
  23. package/packs/strategies/strategies-pack-0.1.json +1 -1
  24. package/skills/deft-directive-pre-pr/SKILL.md +8 -5
  25. package/skills/deft-directive-review-cycle/SKILL.md +67 -23
  26. package/skills/deft-directive-setup/SKILL.md +10 -2
  27. package/skills/deft-directive-swarm/SKILL.md +7 -0
  28. package/skills/deft-directive-swarm/references/core-ops.md +2 -0
  29. package/skills/deft-directive-swarm/references/core-phase-5-6.md +2 -0
  30. package/skills/deft-directive-xbrief/SKILL.md +77 -0
  31. package/strategies/research.md +26 -1
  32. package/tasks/verify.yml +10 -0
  33. package/templates/agent-prompt-preamble.md +33 -0
  34. package/templates/swarm-greptile-poller-prompt.md +18 -15
  35. package/tools/greptile.md +1 -1
package/commands.md CHANGED
@@ -77,12 +77,55 @@ The legacy product forms below remain accepted but SHOULD emit a deprecation war
77
77
 
78
78
  Skills retain the `deft-directive-*` prefix — only the slash-command surface is namespaced.
79
79
 
80
+ ### Native multi-host registration (#55 / #3052–#3055)
81
+
82
+ Prose routing above remains the fallback for every agent (L9). For hosts that load project command/prompt files, `directive init` and `deft update` also deposit **thin native wrappers** for the locked product set (exactly **13** commands — L2) across every **enabled** emitter host in one pass (L6):
83
+
84
+ | Host | Managed directory |
85
+ |------|-------------------|
86
+ | Claude Code | `.claude/commands/` |
87
+ | Cursor | `.cursor/commands/` |
88
+ | Grok | `.grok/commands/` |
89
+ | Codex | `.codex/prompts/` |
90
+
91
+ - **Thin wrappers only (L5):** frontmatter description + short dispatch pointer to strategy/skill/`commands.md` / resilience paths. ⊗ Inline full strategy or skill bodies. ⊗ Emit native files for legacy deprecation aliases (L3 — prose aliases only).
92
+ - **Opt-out:** `plan.policy.hostSlashCommands.<host>` = `false` (hosts: `claude`, `cursor`, `grok`, `codex`). Inspect with `deft policy:show --field=hostSlashCommands`. Opt-out removes managed thin wrappers only; consumer customizations at the same path are preserved. Parallel mental model to `plan.policy.hostHooks`, but hooks and slash deposit are separate.
93
+ - **Git (L8):** Prefer **committing** managed product command/prompt paths so multi-host clones share the same surface. Idempotent rewrite on init/update. Personal gitignore of host command dirs is an escape, not the team default. Managed allowlist is exact product filenames — not whole host command directories.
94
+ - **Not skill discovery:** Native slash files (#55) ≠ skill path auto-discovery ([#75](https://github.com/deftai/directive/issues/75)). Skills deposit remains independent (L7).
95
+
96
+ Full operator guide, L2 table, and multi-host dogfood checklist: [docs/slash-multi-host.md](./docs/slash-multi-host.md).
97
+
80
98
  ---
81
99
 
82
100
  <!-- xbrief-backcompat-2111 -->
83
101
 
84
102
  > **xBRIEF rename (#2034 / #2110):** Projects still on the legacy `vbrief/` layout and `x-vbrief/` reference tokens remain read-accepted until you run `deft migrate:xbrief` (or `task migrate:xbrief`). `deft doctor` and `deft update` signpost unmigrated layouts.
85
103
 
104
+ ## xBRIEF create / verify (artifact write — not lifecycle) (#3057)
105
+
106
+ On-demand **write + check** dense xBRIEF SoT artifacts at an explicit path. These verbs do **not** promote, activate, or complete scopes.
107
+
108
+ | Verb | Meaning |
109
+ |------|---------|
110
+ | `deft xbrief:create` / `task xbrief:create` | Write json, md, or both at `--out` |
111
+ | `deft xbrief:verify` / `task xbrief:verify` | Fail-closed check at `--out` |
112
+ | `scope:*` / intake | Lifecycle birth and folder/status transitions |
113
+ | `xbrief:preflight` | Implementation-intent gate (unchanged) |
114
+
115
+ ```bash
116
+ deft xbrief:create -- --format <json|md|both> --out <path> [--style scope|playbook|mission|project] [--title T] [--id ID] [--force]
117
+ deft xbrief:verify -- --format <json|md|both> --out <path> [--style scope|playbook|mission|project]
118
+ ```
119
+
120
+ - ! `--format` and `--out` are **required**
121
+ - ! `both` uses one stem → `*.xbrief.json` + `*.xbrief.md`
122
+ - ! P0 styles: `scope` | `playbook` | `mission` | `project`
123
+ - ! Paths expand portably (`~`, `%USERPROFILE%`); project-root containment fails closed
124
+ - ~ Skill postcard: `deft-directive-xbrief` (pack grammar loads on use)
125
+ - ⊗ Overload `scope:promote` (or invent `xbrief:promote`) for “compress text”
126
+
127
+ ---
128
+
86
129
  ## Scope xBRIEF Lifecycle
87
130
 
88
131
  Scope xBRIEFs live under `xbrief/{proposed,pending,active,completed,cancelled}/`. The folder and `plan.status` must agree.
@@ -228,15 +271,27 @@ task pr:finish-loop -- <N> # after a PR is open
228
271
  - **Exit codes:** `0` clean/empty queue · `1` agent address / AGENT_STEP / human-merge · `2` BLOCKED (no grant / error)
229
272
  - Full contract: `content/contracts/finish-loop.md`. Typed escalation UX is sibling **#518**.
230
273
 
231
- When the workflow needs an Approach 1 monitor, scope the Cursor leaf `stop-at: pr-open`. The orchestrator that owns the Task primitive must spawn the sibling review-monitor and claim the PR-anchored lease with `task review-monitor:register -- --pr <N> --monitor-agent-id <id> --platform-primitive cursor-task`; `task verify:review-monitor -- --pr <N>` remains the fail-closed proof of active GitHub ownership (sticky `<!-- deft:review-owner -->` comment — not local JSON). Release with `task review-monitor:release -- --pr <N>` when done. See `skills/deft-directive-review-cycle/SKILL.md` Review Monitoring and `skills/deft-directive-swarm/SKILL.md` Phase 3.
274
+ When the workflow needs an Approach 1 monitor, scope the Cursor leaf `stop-at: pr-open`. The orchestrator that owns the Task primitive must spawn the sibling review-monitor and claim the PR-anchored lease with `task review-monitor:register -- --pr <N> --monitor-agent-id <id> --platform-primitive cursor-task`; `task verify:review-monitor -- --pr <N>` remains the fail-closed proof of active GitHub ownership (sticky `<!-- deft:review-owner -->` comment — not local JSON). Release with `task review-monitor:release -- --pr <N>` when done. Owner Continuity / L4 handoff gate (#3090): `task verify:l4-owner -- --pr <N>` (or `deft verify:l4-owner --pr <N>`) exits 0 only when a sticky lease is fresh or `--review-cycle done` after Step 6; freeform `started`/`pending` is rejected. See `skills/deft-directive-review-cycle/SKILL.md` Owner Continuity Gate + Review Monitoring and `skills/deft-directive-swarm/SKILL.md` Phase 3.
232
275
 
233
276
  **Worker liveness (#2824):** For in-flight `drive-to: merge*` Cursor leaves, monitors run `task verify:subagent-alive -- --require-agent <agent-id> [--scratch-dir <worktree>/.deft-scratch/subagent-status]` each poll iteration. Exit `1` prints `REDISPATCH_OK` — authorize takeover when the host still reports running but heartbeats are missing/STALE. Raw heartbeat sweep: `task agent:monitor`. See `docs/subagent-heartbeat.md` § Cursor false-alive.
234
277
 
235
278
  ### Agent-host direct-write hooks (#2438, #2596)
236
279
 
237
- `directive init` and `deft update` idempotently merge Directive-owned entries into `.claude/settings.json`, `.grok/hooks/deft.json`, `.cursor/hooks.json`, and `.codex/hooks.json` while preserving unrelated settings. `SessionStart` refreshes resume bookkeeping on a non-blocking path. `PreToolUse` uses the lightweight `deft-hook` entrypoint rather than booting the full CLI router, reducing cold hook latency while retaining the same fail-closed ritual, scope, and runtime-authority decisions. Cursor `ApplyPatch` shares the direct-write registration, so each matched edit invokes one hook process. Cursor `preToolUse` deposits set `failClosed: true`, so allow decisions emit `{"permission":"allow"}` — empty stdout is treated as hook failure and would block Write tools. A second `PreToolUse` matcher covers spawn/Task tools (`Task`, `SubagentStart`, `spawn_subagent`, `start_agent`, `CreateAgent`) with the same pre-`start_agent` gate stack; explore spawns (`subagent_type: explore`) pass without implementation gates.
280
+ `directive init` and `deft update` idempotently merge Directive-owned entries into `.claude/settings.json`, `.grok/hooks/deft.json`, `.cursor/hooks.json`, and `.codex/hooks.json` while preserving unrelated settings. `SessionStart` refreshes resume bookkeeping on a non-blocking path. `PreToolUse` uses the lightweight `deft-hook` entrypoint rather than booting the full CLI router, reducing cold hook latency while retaining the same fail-closed ritual, scope, and runtime-authority decisions. Cursor `ApplyPatch` shares the direct-write registration, so each matched edit invokes one hook process. Cursor `preToolUse` deposits set `failClosed: true`, so allow decisions emit `{"permission":"allow"}` — empty stdout is treated as hook failure and would block Write tools. A second `PreToolUse` matcher covers spawn/Task tools (`Task`, `SubagentStart`, `spawn_subagent`, `start_agent`, `CreateAgent`) with the pre-`start_agent` gate stack for **implementation** spawns; explore and ephemeral postures skip active-xBRIEF (see three postures below).
281
+
282
+ - **Spawn postures (#1185 / #3080):** PreToolUse classifies Task/spawn by **structural markers** (not free-text prompt NLP). Unmarked / default Multitask (`generalPurpose`) is treated as **implement** (fail closed). Session-level **assist** posture for direct scratch writes is the #1802 twin — see § Assist / research posture (#1802).
283
+
284
+ | Posture | Markers | Active xBRIEF | Typical work |
285
+ |---|---|---|---|
286
+ | **Implement** | default / `generalPurpose` / implement leaf / `drive-to: merge-ready` | **Required** | Features, bugs, PRs, scope lifecycle |
287
+ | **Explore** | `subagent_type` or `worker_role` = `explore` (#1185) | Not required | Read-only research, orientation |
288
+ | **Ephemeral** | `worker_role` (or `subagent_type`) ∈ {`ephemeral`, `docs`, `assist`} (#3080) | Not required | Brochure, pitch, disposable analysis notes |
289
+
290
+ Gate order: explore allow (`spawn-explore-ready`) → ephemeral allow (`spawn-ephemeral-ready`) → else implementation stack (`inspectMutationGates`). If an ephemeral marker conflicts with implement envelope signals (`drive-to: merge-ready`, `worker_role: leaf-implementation`, swarm implement dispatch), **implement wins**. Ephemeral allowance does **not** authorize push/merge/deploy or skip `runtimeAuthority` / human-merge gates. **Anti-pattern:** invent a fake `scope:activate` only to dispatch brochure/docs work — use `worker_role: ephemeral` (or continue in the parent) instead. Deny text for missing active scope on implement spawns lists activate \| explore \| ephemeral recoveries.
238
291
 
239
- - **Read-only explore (#1185):** Prefer Grok role deposit `default_capability_mode = "read-only"` (see [issue #1185](https://github.com/deftai/directive/issues/1185)). Hooks also deny direct writes when `DEFT_HOOK_READ_ONLY=1` or the host payload signals read-only capability. Implementation spawns remain blocked in read-only posture unless explicitly marked explore.
292
+ - **Assist scratch direct writes (#1802):** PreToolUse allows Write/Edit under allowlisted gitignored roots (`.deft-scratch/**`, `temp/**`) when assist/ephemeral classification applies (`DEFT_SESSION_POSTURE=assist`, payload posture, or #3080 role markers) decision code `write-assist-scratch-ready`. Skips ritual + active-scope; does **not** unlock tracked product paths. Fail closed outside the allowlist or without structural markers. Deny recovery for in-repo scope-not-ready mentions the assist scratch path (do not invent fake `scope:activate` for notes). Full rules: § Assist / research posture (#1802).
293
+
294
+ - **Read-only explore (#1185):** Prefer Grok role deposit `default_capability_mode = "read-only"` (see [issue #1185](https://github.com/deftai/directive/issues/1185)). Hooks also deny direct writes when `DEFT_HOOK_READ_ONLY=1` or the host payload signals read-only capability. Implementation and ephemeral spawns remain blocked in read-only posture unless explicitly marked explore.
240
295
 
241
296
  - Verify registration: `deft verify:hooks-installed --scope=agent` (or `--scope=all` for git + agent hooks).
242
297
  - Repair missing/drifted entries: `deft update`.
@@ -263,6 +318,29 @@ Full always-on contract for the interactive session-start ritual and its gated v
263
318
  - ? Explicit read-only alignment only: `deft session:start -- --read-only` (no ritual-state write).
264
319
  - ~ Operators MAY still explicitly request full `deft session:start`, `deft triage:welcome`, sync, or doctor in read-only sessions.
265
320
 
321
+ ### Assist / research posture (#1802)
322
+
323
+ Low-ceremony path for research and disposable local notes. Shared taxonomy with spawn postures (#3080 / #1185): session posture name is **`assist`**; spawn `worker_role` primary is **`ephemeral`** (aliases `docs`, `assist`).
324
+
325
+ | Posture | Session ceremony | Direct write | Spawn (`Task`) |
326
+ |---|---|---|---|
327
+ | **Read-only research** | No mutation ritual | None / deny writes | `explore` only (#1185) |
328
+ | **Assist / ephemeral** | No story-start; no active xBRIEF for scratch writes | Allowlisted scratch roots only (#1802) | `worker_role: ephemeral` (#3080) |
329
+ | **Mutation / implement** | Full `session:start` + gated ritual + story/xBRIEF | Product paths + gates | Active xBRIEF required |
330
+
331
+ - ! **Named assist intent:** declare non-implementation research/assist via structural markers — `DEFT_SESSION_POSTURE=assist` (or `research` / `research-notes` / `scratch` / `ephemeral` / `docs`), `DEFT_HOOK_ASSIST=1`, payload `posture` / `session_posture`, or spawn `worker_role` / `subagent_type` ∈ {`ephemeral`, `docs`, `assist`}. Prefer answering in chat; write scratch only when the operator asks for a file.
332
+ - ! **Read-only research needs no mutation ceremony:** with no file writes (or only read tools), do **not** run gated session ritual / story-start / `git status` story gates as if starting implementation. Alignment load (AGENTS / USER / PROJECT-DEFINITION) still applies where session routing requires it.
333
+ - ! **Operator language → assist:** phrases such as "Obsidian notes", "scratch only", "do not commit", "not a story/PR" map to assist posture. Default disposable notes to gitignored allowlisted roots so "do not commit" is structural.
334
+ - ! **Allowlisted scratch roots (v1):** `.deft-scratch/**` (canonical) and `temp/**` (gitignored alias). PreToolUse allows direct Write/Edit under these roots when assist/ephemeral classification applies (`write-assist-scratch-ready`) — no active xBRIEF, no story-start, no full pre-`start_agent` gate stack. Compose with #3080 ephemeral spawn markers.
335
+ - ! **Tracked / source still hard:** writes to product paths (`src/`, `packages/`, `content/`, app source, tracked `docs/` / `overview/`, …) under **any** posture still require mutation ceremony + existing write/scope gates. Labeling a change "research" does **not** bypass them. If the operator insists on a tracked path for notes, reclassify as mutation or obtain explicit override + normal gates; prefer redirect to `.deft-scratch/overview/` instead.
336
+ - ⊗ Invent a fake `scope:activate` solely to capture disposable notes — use allowlisted scratch + assist posture (or continue in chat).
337
+ - ⊗ Use assist posture for feature/bug/PR work; ⊗ write product code under scratch roots then smuggle into the tree; ⊗ treat assist as license to skip push/merge/human-merge gates.
338
+ - ⊗ Rely on free-text prompt NLP alone as the gate classifier — path fence + structural markers only (fail closed on ambiguity).
339
+ - ~ Offer to move finalized notes into committed docs via a **separate** mutation story if the operator wants them in-repo.
340
+ - **Not this path:** `/deft:run:research` proposes a research vBRIEF (higher ceremony). Ceremony latency (#2990) is a separate track.
341
+
342
+ Cross-link: spawn three postures and deny recoveries live under § Agent-host direct-write hooks (#2438, #2596) / Spawn postures (#1185 / #3080).
343
+
266
344
  ### Mutable ritual (mutation posture)
267
345
 
268
346
  - ! On **mutation** session start, run `deft session:start` (or `task session:start` in framework source) after loading AGENTS.md. Records quick-tier ritual in `.deft/ritual-state.json`: alignment confirmation, branch-policy disclosure, `deft verify:tools` guidance, default-branch sync warnings, and `deft triage:welcome` one-liner. State is worktree- and HEAD-bound; stale after `plan.policy.sessionRitualStalenessHours` hours (default 4).
@@ -49,7 +49,7 @@
49
49
  {
50
50
  "path": "content/coding",
51
51
  "bucket": "content",
52
- "note": "Coding standards docs (coding.md, hygiene.md, testing.md, build-output.md, toolchain.md)."
52
+ "note": "Coding standards docs (coding.md, testing.md, security.md, review.md, hygiene.md, debugging.md, build-output.md, toolchain.md, holzmann.md)."
53
53
  },
54
54
  {
55
55
  "path": "content/commands.md",
@@ -72,6 +72,11 @@
72
72
  "note": "Conventions prose docs ship as content; co-located structured data files (rule-ownership.json, content-manifest.json) are engine-consumed gate inputs that travel with the same directory.",
73
73
  "straddle": true
74
74
  },
75
+ {
76
+ "path": "content/ci-cd",
77
+ "bucket": "content",
78
+ "note": "Optional CI/CD provider guidance (Blacksmith runner tiers, migration prompts, examples). Parallel to deployments/; lazy-load only (#448)."
79
+ },
75
80
  {
76
81
  "path": "content/deployments",
77
82
  "bucket": "content",
@@ -8,6 +8,14 @@ Platform-specific guidance for deployment environments (cloud.gov, Cloudflare, A
8
8
  - ~ Keep platform guidance separate from core Deft rules
9
9
  - ~ Enable export of platform instructions for external tools (e.g., Copilot)
10
10
 
11
+ ## Relation to CI/CD
12
+
13
+ This layer covers **where and how you deploy** runtime apps. For **CI runner
14
+ migration** (Blacksmith tiered vCPU sizing, agent migration prompts), use the
15
+ optional [`ci-cd/`](../ci-cd/README.md) layer instead. Platform modules may still
16
+ include a `cicd.md` for deploy-pipeline steps; that is not a substitute for
17
+ runner-tier guidance under `ci-cd/`.
18
+
11
19
  ## Module Structure
12
20
 
13
21
  Create a directory per platform:
@@ -18,6 +18,52 @@ Epic spine: [#2874](https://github.com/deftai/directive/issues/2874). This doc i
18
18
 
19
19
  If you are installing Directive for the first time, start at [QUICK-START.md](../QUICK-START.md) or [getting-started.md](./getting-started.md), then return here for host-specific expectations.
20
20
 
21
+ Native **file-host** slash/prompt command registration (thin wrappers under `.claude/commands/`, `.cursor/commands/`, and peers) is documented in [slash-multi-host.md](./slash-multi-host.md) (epic #55). **OpenClaw L2 product commands** are a separate skills adapter ([#3064](https://github.com/deftai/directive/issues/3064)) — see § L2 product commands below. That surface is separate from always-pin skills (#3001/#3008), spawn/review mapping, and skill-discovery residual [#75](https://github.com/deftai/directive/issues/75).
22
+
23
+ ---
24
+
25
+ ## L2 product commands (OpenClaw adapter — #3064)
26
+
27
+ OpenClaw does **not** load repo-local command files the way Claude/Cursor do. L2 parity for the **exactly 13** product commands is delivered as **thin user-invocable skills** deposited into the OpenClaw **main workspace skills** root (real copies — not symlink-escape into npm; same spirit as always-pins).
28
+
29
+ ### Hybrid layout (LockedDecisions D1–D3)
30
+
31
+ | Artifact | OpenClaw slug | Role |
32
+ |----------|---------------|------|
33
+ | **Router** | `deft` | Preferred **native/menu-facing** entry (Telegram `BOT_COMMANDS` budget) |
34
+ | **13 product skills** | e.g. `deft_run_interview`, `deft_continue` | Invocable as `/<slug>` text skills for discoverability |
35
+
36
+ Stable map (logical slash → OpenClaw slug, `a-z0-9_`, max 32). Colons never appear in OC slugs. Example: `/deft:directive:run:interview` → `deft_run_interview`. Full table lives in `packages/core/src/slash/openclaw-slugs.ts` and is unit-tested for bijectivity against `listProductCommands()`.
37
+
38
+ Bodies stay **thin** (L5): frontmatter + short dispatch pointer to the same content-relative targets as file hosts (`generateThinWrappers()` IR). ⊗ Inline full strategy/skill bodies. ⊗ Add `openclaw` to `HOST_COMMAND_LAYOUTS` / invent `.openclaw/commands/`.
39
+
40
+ ### Native menu / `commands.nativeSkills` (D3)
41
+
42
+ | Setting | Expected behavior |
43
+ |---------|-------------------|
44
+ | Prefer menu safety | Use the **`deft` router** as the primary bot menu entry; invoke product work via router args or typed `/deft_run_*` skill text |
45
+ | `commands.nativeSkills` **on** / aggressive native registration | All `user-invocable: true` skills (router + 13 + always-pins) **may** flood Telegram → `BOT_COMMANDS_TOO_MUCH` risk |
46
+ | `auto` / selective | Prefer **router-first** for menu slots; keep the 13 invocable as skill/text without requiring 13 menu slots |
47
+ | **off** | Skills remain loadable; operators type skill names / prose — no native menu flood |
48
+
49
+ ! Do not require 13 Telegram bot menu slots for L2 parity.
50
+
51
+ ### Wire path (D4–D5)
52
+
53
+ 1. **Primary recovery:** `deft doctor --fix` when OpenClaw is detected — deposits managed L2 skills next to always-pins.
54
+ 2. **init/update:** deposits when OpenClaw signals are present and `plan.policy.openClawProductCommands` is not false. **Fail-closed** when OpenClaw is not detected (no writes on non-OC machines).
55
+ 3. Multi-seat: `deft doctor --fix --openclaw-all-agents` (same flag as always-pins).
56
+ 4. Opt-out: `plan.policy.openClawProductCommands: false` — removes **managed** L2 thin skills only; preserves consumer custom skills at the same slug.
57
+ 5. After deposit: **restart the OpenClaw gateway or start a new session** so `available_skills` refreshes.
58
+
59
+ Always-pin skills (`deft-directive-build`, `pre-pr`, `review-cycle`, `swarm`) remain a **different** surface from L2 product commands (`/deft:directive:run:interview`, `/deft:continue`, …).
60
+
61
+ Inspect policy:
62
+
63
+ ```bash
64
+ deft policy:show --field=openClawProductCommands
65
+ ```
66
+
21
67
  ---
22
68
 
23
69
  ## Mental model (host class)
@@ -0,0 +1,84 @@
1
+ # Multi-host skill discovery (#75)
2
+
3
+ Directive deposits **thin skill discovery pointers** so agent hosts that do not
4
+ scan `.agents/skills/` still auto-load the same consumer skill inventory.
5
+
6
+ ## Canonical vs additional paths
7
+
8
+ | Path | Role |
9
+ |------|------|
10
+ | `.agents/skills/` | **Canonical** consumer discovery (landed with #94 / install `writeAgentsSkills`) |
11
+ | `.claude/skills/` | Claude Code |
12
+ | `.codex/skills/` | OpenAI Codex |
13
+ | `.github/skills/` | GitHub Copilot |
14
+ | `.cursor/skills/` | Cursor (when not fully covered by optional OpenPackage install) |
15
+
16
+ Additional host paths **mirror** the same thin `SKILL.md` inventory as
17
+ `.agents/skills/`. They do not fork independent skill bodies. Full skill text
18
+ lives under `.deft/core/skills/…` (or `.deft/core/SKILL.md` for the root
19
+ `deft` skill).
20
+
21
+ ## Thin pointers only
22
+
23
+ Each deposited `SKILL.md` is a short frontmatter + `Read and follow: .deft/core/…`
24
+ line. Init/update **must not** copy full skill process docs into host skill dirs
25
+ (those rot on framework upgrade).
26
+
27
+ Windows: deposit uses ordinary file writes (contained projection). Elevated
28
+ symlinks are **not** required.
29
+
30
+ ## When deposit runs
31
+
32
+ - `directive init` / greenfield scaffold — after `.agents/skills/`
33
+ - `directive update` / refresh — every refresh (idempotent rewrite of managed
34
+ pointers when content drifts)
35
+
36
+ ## Per-host opt-out
37
+
38
+ Typed policy: `plan.policy.hostSkillDiscovery`
39
+
40
+ ```json
41
+ {
42
+ "plan": {
43
+ "policy": {
44
+ "hostSkillDiscovery": {
45
+ "claude": true,
46
+ "cursor": true,
47
+ "codex": true,
48
+ "github": false
49
+ }
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ - Default: all four residual hosts **enabled**
56
+ - Inspect: `deft policy:show --field=hostSkillDiscovery`
57
+ - Opt-out skips deposit for that host only (does not remove unrelated user files)
58
+
59
+ Distinct from `plan.policy.hostHooks` (hook JSON deposit, #2752).
60
+
61
+ ## Relationship to #55 slash registration
62
+
63
+ | | **#75 skill discovery** | **#55 slash / commands** |
64
+ |--|-------------------------|---------------------------|
65
+ | Artifact | Host **skill** dirs (`…/skills/`) | Host **command/prompt** files (`…/commands/`, `…/prompts/`) |
66
+ | Product set | Existing consumer skill inventory | Locked product slash set (L2) |
67
+ | Content | Thin skill pointer `SKILL.md` | Thin command wrapper (~40–100 tok) |
68
+ | Deposit | This doc / `skill-discovery-deposit` | Epic children #3052–#3055 |
69
+
70
+ Do **not** treat slash completion as closing skill-path residual, or skill
71
+ deposit as registering slash commands.
72
+
73
+ ## Relationship to OpenPackage
74
+
75
+ OpenPackage (#2462 / #2370) is an optional tiered pack install for some hosts.
76
+ It does **not** replace init/update multi-host skill discovery for the residual
77
+ matrix above. Close #75 only when residual host paths are deposited (or
78
+ explicitly opted out), not solely because OpenPackage exists.
79
+
80
+ ## Implementation pointers
81
+
82
+ - Layouts + policy: `packages/core/src/init-deposit/skill-discovery-hosts.ts`
83
+ - Deposit: `packages/core/src/init-deposit/skill-discovery-deposit.ts`
84
+ - Shared inventory with `.agents/skills/`: `CONSUMER_SKILL_DISCOVERY_INVENTORY`
@@ -0,0 +1,241 @@
1
+ # Multi-host native slash-command registration
2
+
3
+ Operator guide for **host-native** Directive slash and prompt files after epic [#55](https://github.com/deftai/directive/issues/55).
4
+
5
+ This surface is **not** skill auto-discovery ([#75](https://github.com/deftai/directive/issues/75)). Skills stay under skill deposit paths. Slash registration writes thin command/prompt wrappers so hosts can show `/deft…` (or the host equivalent) in autocomplete.
6
+
7
+ Legend (RFC2119): `!`=MUST, `~`=SHOULD, `≉`=SHOULD NOT, `⊗`=MUST NOT, `?`=MAY.
8
+
9
+ Product locks: **LockedDecisions L1–L10** on [#55](https://github.com/deftai/directive/issues/55). Code waves: [#3052](https://github.com/deftai/directive/issues/3052) generator, [#3053](https://github.com/deftai/directive/issues/3053) emitters, [#3054](https://github.com/deftai/directive/issues/3054) deposit. This page is the docs/dogfood child [#3055](https://github.com/deftai/directive/issues/3055).
10
+
11
+ Prose SoT for routing and deprecation aliases: [commands.md § Slash Command Namespaces](../commands.md#slash-command-namespaces-418--1670).
12
+
13
+ ---
14
+
15
+ ## What you get
16
+
17
+ On `directive init` and `deft update`, Directive deposits **exactly 13** thin wrappers (L2) for every **enabled** host that has a real emitter (L6).
18
+
19
+ | Host id | Directory | Surface |
20
+ |---------|-----------|---------|
21
+ | `claude` | `.claude/commands/` | commands |
22
+ | `cursor` | `.cursor/commands/` | commands |
23
+ | `grok` | `.grok/commands/` | commands |
24
+ | `codex` | `.codex/prompts/` | prompts |
25
+ | **OpenClaw** (adapter, not file emitter) | OpenClaw **workspace skills** (`~/.openclaw/workspace/skills` or `$OPENCLAW_STATE_DIR/...`) | user-invocable skills + router |
26
+
27
+ File hosts use portable hyphen filenames (L4), for example `deft-directive-run-interview.md` and `deft-continue.md`. Logical slash ids keep the namespace form (`/deft:directive:run:interview`).
28
+
29
+ **OpenClaw** is **not** a fifth row in `SLASH_EMITTER_HOSTS` / `HOST_COMMAND_LAYOUTS`. There is no project-tree `.openclaw/commands/` deposit (that would be stub theater — Gateway does not load that path). OpenClaw L2 parity ships as a **skills/plugin adapter** ([#3064](https://github.com/deftai/directive/issues/3064)): thin **user-invocable** skills under the main workspace skills root, with a stable `logicalId → openClawSlug` map (`a-z0-9_`, max 32). See [openclaw-agent-host.md](./openclaw-agent-host.md) § L2 product commands.
30
+
31
+ ⊗ Treat last-writer-wins single-host install as the product default. One repo may use many hosts; deposit targets the **configured set** in one pass.
32
+
33
+ ---
34
+
35
+ ## Product set (L2 — exactly 13)
36
+
37
+ | # | Logical slash id | Filename stem |
38
+ |---|------------------|---------------|
39
+ | 1 | `/deft:directive:change` | `deft-directive-change` |
40
+ | 2 | `/deft:directive:change:apply` | `deft-directive-change-apply` |
41
+ | 3 | `/deft:directive:change:verify` | `deft-directive-change-verify` |
42
+ | 4 | `/deft:directive:change:archive` | `deft-directive-change-archive` |
43
+ | 5 | `/deft:directive:run:interview` | `deft-directive-run-interview` |
44
+ | 6 | `/deft:directive:run:yolo` | `deft-directive-run-yolo` |
45
+ | 7 | `/deft:directive:run:map` | `deft-directive-run-map` |
46
+ | 8 | `/deft:directive:run:discuss` | `deft-directive-run-discuss` |
47
+ | 9 | `/deft:directive:run:research` | `deft-directive-run-research` |
48
+ | 10 | `/deft:directive:run:speckit` | `deft-directive-run-speckit` |
49
+ | 11 | `/deft:directive:run:probe` | `deft-directive-run-probe` |
50
+ | 12 | `/deft:continue` | `deft-continue` |
51
+ | 13 | `/deft:checkpoint` | `deft-checkpoint` |
52
+
53
+ ⊗ Auto-register every `deft-directive-*` skill as a slash entry.
54
+ ⊗ Expand N without an amendment to L2 on #55.
55
+
56
+ Legacy prose aliases (`/deft:change`, `/deft:run:…`) remain accepted in agent text with deprecation guidance. Native host files emit **canonical names only** (L3) — no second set of alias files.
57
+
58
+ ---
59
+
60
+ ## Thin wrappers (L5)
61
+
62
+ Each managed file is a short pointer, not a copy of a strategy or skill:
63
+
64
+ - YAML frontmatter: `description` (and `argument-hint` when needed)
65
+ - Body: load the content-relative target under `.deft/core/` when installed; honor `$ARGUMENTS`; do not inline the target body
66
+
67
+ Token intent (catalog ≤ ~1k tok for the set; invoke body ~40–100 tok). Real cost is the strategy/skill after invoke.
68
+
69
+ Contributors: keep wrappers thin. Emitters consume `generateThinWrappers()` / `listProductCommands()` — do not maintain a second name table.
70
+
71
+ ---
72
+
73
+ ## Policy opt-out (`plan.policy.hostSlashCommands`)
74
+
75
+ Default: all emitter hosts enabled (`claude`, `cursor`, `grok`, `codex`).
76
+
77
+ Set a host to `false` in `xbrief/PROJECT-DEFINITION.xbrief.json` (or consumer deposit layout) to skip that host:
78
+
79
+ ```json
80
+ {
81
+ "plan": {
82
+ "policy": {
83
+ "hostSlashCommands": {
84
+ "claude": true,
85
+ "cursor": true,
86
+ "grok": false,
87
+ "codex": true
88
+ }
89
+ }
90
+ }
91
+ }
92
+ ```
93
+
94
+ Inspect:
95
+
96
+ ```bash
97
+ deft policy:show --field=hostSlashCommands
98
+ ```
99
+
100
+ On opt-out, init/update **removes only** Directive-managed thin wrappers for that host. Consumer-customized files at the same path are left alone. Unknown host keys fail validation.
101
+
102
+ This policy is parallel to `plan.policy.hostHooks` (enforcement hooks). Hooks and slash deposit are separate surfaces.
103
+
104
+ ### OpenClaw adapter opt-out (`plan.policy.openClawProductCommands`)
105
+
106
+ OpenClaw L2 deposit is **separate** from the four file emitters. Default **on** when the adapter is real and OpenClaw is detected.
107
+
108
+ ```json
109
+ {
110
+ "plan": {
111
+ "policy": {
112
+ "openClawProductCommands": false
113
+ }
114
+ }
115
+ }
116
+ ```
117
+
118
+ ```bash
119
+ deft policy:show --field=openClawProductCommands
120
+ ```
121
+
122
+ When false, init/update/doctor **removes only** Directive-managed OpenClaw L2 thin skills (router + 13 product slugs). Consumer-customized skills at the same slug are left alone. Deposit **does not write** OpenClaw artifacts when OpenClaw is not detected (fail-closed).
123
+
124
+ Primary recovery: `deft doctor --fix` (optional `--openclaw-all-agents` for multi-seat).
125
+
126
+ ---
127
+
128
+ ## Git policy (L8 — prefer commit)
129
+
130
+ ! **Prefer committing** managed product command/prompt files so every clone and every host share the same `/deft…` surface.
131
+
132
+ - Managed paths are exact product filenames (installer allowlist), not “claim the whole `.claude/commands/` tree.”
133
+ - Custom files you add next to managed ones stay app-owned.
134
+ - Idempotent rewrite on init/update keeps managed thin wrappers current either way.
135
+
136
+ ? Personal gitignore of host command dirs remains an escape for machine-local only setups. That is **not** the default team recommendation. Multi-host shared repos benefit most from a committed deposit.
137
+
138
+ ⊗ Do not use single-host last-writer-wins as the team sharing model.
139
+
140
+ ---
141
+
142
+ ## Prose fallback (L9)
143
+
144
+ File hosts without native registration (or with all file hosts opted out) still use the agent text convention in [commands.md](../commands.md). AGENTS.md and skills routing continue to work without native autocomplete files.
145
+
146
+ **OpenClaw** after [#3064](https://github.com/deftai/directive/issues/3064): when the adapter has deposited L2 skills, operators should prefer the invocable skills / router — not prose-only discovery. Prose `/deft:directive:…` remains accepted in agent text when skills are not yet wired (doctor not run, policy off, or host without OpenClaw signals).
147
+
148
+ ---
149
+
150
+ ## Slash registration vs skill discovery (#55 vs #75 vs #3064)
151
+
152
+ | Concern | Tracker | What lands |
153
+ |---------|---------|------------|
154
+ | Native slash / prompt **command files** | #55 | Thin wrappers under host command/prompt dirs; multi-host deposit |
155
+ | Skill auto-discovery paths | #75 | `SKILL.md` discovery under `.agents/skills/`, `.claude/skills/`, etc. |
156
+ | OpenClaw L2 product commands | #3064 | Thin **user-invocable** skills + router in OpenClaw workspace skills (not a file emitter) |
157
+
158
+ ! Do not treat skill discovery alone as “slash registration done.”
159
+ ! Do not dual-maintain full skill bodies as command file contents (L7).
160
+ ! Do not invent project `.openclaw/commands/` for L2 parity.
161
+
162
+ Agent-host runtime notes (OpenClaw spawn/review + L2 skills) live under [openclaw-agent-host.md](./openclaw-agent-host.md).
163
+
164
+ ---
165
+
166
+ ## Dogfood checklist (multi-host clone)
167
+
168
+ Use this after install or upgrade when two or more hosts share one repo.
169
+
170
+ 1. **Upgrade / deposit**
171
+
172
+ ```bash
173
+ npm i -g @deftai/directive@latest # when using the npm channel
174
+ directive update # or directive init on a new project
175
+ ```
176
+
177
+ 2. **Confirm policy**
178
+
179
+ ```bash
180
+ deft policy:show --field=hostSlashCommands
181
+ ```
182
+
183
+ Expect enabled hosts = emitters you want (default: all four true).
184
+
185
+ 3. **Smoke paths on disk** (enabled hosts only)
186
+
187
+ ```text
188
+ .claude/commands/deft-continue.md
189
+ .cursor/commands/deft-continue.md
190
+ .grok/commands/deft-continue.md
191
+ .codex/prompts/deft-continue.md
192
+ ```
193
+
194
+ Spot-check count: **13** managed files per enabled host. Bodies stay short (description + dispatch pointer).
195
+
196
+ 4. **Two-host UI check**
197
+
198
+ - Open the same clone in host A (for example Claude Code) and host B (for example Cursor).
199
+ - Type `/` (or the host prompt picker) and confirm Directive entries such as `deft-directive-run-interview` / `/deft:continue` appear on **both** hosts when both are enabled.
200
+ - Invoke one strategy command and one session command; agent should load the pointed strategy/resilience doc, not a fat inlined body.
201
+
202
+ 5. **Opt-out smoke (optional)**
203
+
204
+ - Set one host to `false`, run `directive update`, confirm that host’s **managed** product files were removed and other hosts remain.
205
+ - Restore `true` and update again to redeposit.
206
+
207
+ 6. **Git**
208
+
209
+ - Stage managed product paths (or let the installer staging path include them) and commit so teammates inherit the surface.
210
+ - ~ Avoid gitignoring the whole host command directory on team repos.
211
+
212
+ 7. **Hooks still separate**
213
+
214
+ - `deft verify:hooks-installed --scope=agent` checks hooks, not slash files.
215
+ - Missing autocomplete after a clean deposit is a host UI/cache issue or policy opt-out — re-run update and re-check policy before filing a deposit bug.
216
+
217
+ ---
218
+
219
+ ## Related surfaces
220
+
221
+ | Surface | Role |
222
+ |---------|------|
223
+ | [commands.md § Slash Command Namespaces](../commands.md#slash-command-namespaces-418--1670) | Prose namespaces, routing, deprecation aliases, deposit pointer |
224
+ | `packages/core/src/slash/` | Generator IR + emitters + OpenClaw adapter (maintainers) |
225
+ | `writeSlashCommandDeposit` | init/update file-host deposit |
226
+ | `depositOpenClawL2ProductCommands` / doctor OpenClaw L2 check | OpenClaw skills adapter (#3064) |
227
+ | `plan.policy.openClawProductCommands` | OpenClaw L2 adapter opt-out |
228
+ | `plan.policy.hostHooks` | Host enforcement hooks (#2438) — not slash files |
229
+ | [#75](https://github.com/deftai/directive/issues/75) | Skill discovery residual |
230
+ | [#3064](https://github.com/deftai/directive/issues/3064) | OpenClaw L2 product-command adapter |
231
+
232
+ ---
233
+
234
+ ## Design reading order (#55)
235
+
236
+ 1. LockedDecisions L1–L10 on #55
237
+ 2. Multi-host deposit amendment on #55
238
+ 3. Token / context design rules on #55
239
+ 4. This page + `commands.md`
240
+
241
+ Issue body (2026-03) on #55 is historical intent only.
package/main.md CHANGED
@@ -32,6 +32,7 @@ Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
32
32
  - Interfaces: [interfaces/cli.md](./content/interfaces/cli.md), [interfaces/tui.md](./content/interfaces/tui.md), [interfaces/web.md](./content/interfaces/web.md), [interfaces/rest.md](./content/interfaces/rest.md)
33
33
  - Tools: [tools/taskfile.md](./content/tools/taskfile.md), [scm/git.md](./content/scm/git.md), [scm/github.md](./content/scm/github.md), [tools/telemetry.md](./content/tools/telemetry.md)
34
34
  - Testing: [coding/testing.md](./content/coding/testing.md)
35
+ - Review process: [coding/review.md](./content/coding/review.md) (tool-agnostic; Greptile adapter via review-cycle skill)
35
36
 
36
37
  **Advanced:**
37
38
  - Contracts: [contracts/hierarchy.md](./content/contracts/hierarchy.md), [contracts/boundary-maps.md](./content/contracts/boundary-maps.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftai/directive-content",
3
- "version": "0.92.0",
3
+ "version": "0.94.0",
4
4
  "description": "Shippable Directive framework content in the consumer .deft/core/ layout (C1 flatten), plus the engine surfaces (.githooks/, Taskfile.yml, tasks/) the deposit wires. Python-free per #2022 Phase 3. Refs #11, #1669, #1967.",
5
5
  "license": "MIT",
6
6
  "type": "module",