@mytechtoday/augment-extensions 3.3.0 → 3.4.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 (87) hide show
  1. package/AGENTS.md +21 -16
  2. package/README.md +134 -5
  3. package/augment-extensions/workflows/cross-platform/README.md +120 -0
  4. package/augment-extensions/workflows/cross-platform/examples/end-to-end-session.md +196 -0
  5. package/augment-extensions/workflows/cross-platform/module.json +91 -0
  6. package/augment-extensions/workflows/cross-platform/rules/drift-resolution.md +126 -0
  7. package/augment-extensions/workflows/cross-platform/rules/export-guide.md +139 -0
  8. package/augment-extensions/workflows/cross-platform/rules/mcp-snippet-inlining.md +99 -0
  9. package/augment-extensions/workflows/cross-platform/rules/mirror-guide.md +139 -0
  10. package/augment-extensions/workflows/cross-platform/rules/windows-fallback.md +111 -0
  11. package/augment-extensions/workflows/decision-layer/README.md +40 -4
  12. package/augment-extensions/workflows/decision-layer/installation/augx-judgments/SKILL.md +14 -0
  13. package/augment-extensions/workflows/decision-layer/module.json +2 -2
  14. package/augment-extensions/workflows/decision-layer/rules/02-operation.md +2 -0
  15. package/augment-extensions/workflows/decision-layer/runtime/automatic.cjs +80 -0
  16. package/augment-extensions/workflows/decision-layer/runtime/chat-install.cjs +149 -0
  17. package/augment-extensions/workflows/decision-layer/runtime/chat-server.cjs +71 -0
  18. package/augment-extensions/workflows/decision-layer/runtime/contracts.d.ts +13 -0
  19. package/augment-extensions/workflows/decision-layer/runtime/install.cjs +16 -3
  20. package/augment-extensions/workflows/decision-layer/schemas/automatic-input.schema.json +40 -0
  21. package/augment-extensions/workflows/decision-layer/schemas/config.schema.json +12 -0
  22. package/augment-extensions/workflows/decision-layer/sources.md +9 -0
  23. package/cli/MODULES.md +22 -22
  24. package/cli/dist/cli.js +38 -7
  25. package/cli/dist/cli.js.map +1 -1
  26. package/cli/dist/commands/context.d.ts +8 -0
  27. package/cli/dist/commands/context.d.ts.map +1 -0
  28. package/cli/dist/commands/context.js +115 -0
  29. package/cli/dist/commands/context.js.map +1 -0
  30. package/cli/dist/commands/decision.d.ts.map +1 -1
  31. package/cli/dist/commands/decision.js +3 -1
  32. package/cli/dist/commands/decision.js.map +1 -1
  33. package/cli/dist/commands/gui-decision.d.ts.map +1 -1
  34. package/cli/dist/commands/gui-decision.js +23 -2
  35. package/cli/dist/commands/gui-decision.js.map +1 -1
  36. package/cli/dist/commands/gui-module-manager.d.ts.map +1 -1
  37. package/cli/dist/commands/gui-module-manager.js +2 -0
  38. package/cli/dist/commands/gui-module-manager.js.map +1 -1
  39. package/cli/dist/commands/show.d.ts.map +1 -1
  40. package/cli/dist/commands/show.js +5 -18
  41. package/cli/dist/commands/show.js.map +1 -1
  42. package/cli/dist/commands/skill.d.ts.map +1 -1
  43. package/cli/dist/commands/skill.js +3 -3
  44. package/cli/dist/commands/skill.js.map +1 -1
  45. package/cli/dist/commands/update.js +14 -7
  46. package/cli/dist/commands/update.js.map +1 -1
  47. package/cli/dist/core/compatibility-checker.d.ts.map +1 -1
  48. package/cli/dist/core/compatibility-checker.js +5 -2
  49. package/cli/dist/core/compatibility-checker.js.map +1 -1
  50. package/cli/dist/lib/context-hosts.d.ts +16 -0
  51. package/cli/dist/lib/context-hosts.d.ts.map +1 -0
  52. package/cli/dist/lib/context-hosts.js +395 -0
  53. package/cli/dist/lib/context-hosts.js.map +1 -0
  54. package/cli/dist/lib/context-refresh.d.ts +60 -0
  55. package/cli/dist/lib/context-refresh.d.ts.map +1 -0
  56. package/cli/dist/lib/context-refresh.js +630 -0
  57. package/cli/dist/lib/context-refresh.js.map +1 -0
  58. package/cli/dist/utils/decision-runner.d.ts +2 -0
  59. package/cli/dist/utils/decision-runner.d.ts.map +1 -1
  60. package/cli/dist/utils/decision-runner.js.map +1 -1
  61. package/cli/dist/utils/extensions-config.d.ts.map +1 -1
  62. package/cli/dist/utils/extensions-config.js +3 -1
  63. package/cli/dist/utils/extensions-config.js.map +1 -1
  64. package/cli/dist/utils/extractCommandHelp.d.ts.map +1 -1
  65. package/cli/dist/utils/extractCommandHelp.js +50 -20
  66. package/cli/dist/utils/extractCommandHelp.js.map +1 -1
  67. package/cli/dist/utils/mcp-integration.d.ts.map +1 -1
  68. package/cli/dist/utils/mcp-integration.js +5 -7
  69. package/cli/dist/utils/mcp-integration.js.map +1 -1
  70. package/cli/dist/utils/module-system.d.ts +12 -0
  71. package/cli/dist/utils/module-system.d.ts.map +1 -1
  72. package/cli/dist/utils/module-system.js +15 -0
  73. package/cli/dist/utils/module-system.js.map +1 -1
  74. package/cli/dist/utils/process.d.ts +14 -0
  75. package/cli/dist/utils/process.d.ts.map +1 -0
  76. package/cli/dist/utils/process.js +57 -0
  77. package/cli/dist/utils/process.js.map +1 -0
  78. package/cli/dist/utils/version.d.ts +2 -0
  79. package/cli/dist/utils/version.d.ts.map +1 -0
  80. package/cli/dist/utils/version.js +8 -0
  81. package/cli/dist/utils/version.js.map +1 -0
  82. package/cli/dist/utils/vscode-editor.d.ts.map +1 -1
  83. package/cli/dist/utils/vscode-editor.js +14 -8
  84. package/cli/dist/utils/vscode-editor.js.map +1 -1
  85. package/modules.md +17 -4
  86. package/package.json +7 -1
  87. package/scripts/check-wsl-augx.sh +63 -0
package/AGENTS.md CHANGED
@@ -51,7 +51,8 @@ Each module contains:
51
51
  - `augx show all` - Show all available modules
52
52
  - `augx search <term>` - Search for modules
53
53
  - `augx update` - Update all linked modules
54
- - `augx version` - Show CLI version
54
+ - `augx version` - Show CLI version (`augx --version`, `augx -V`, and `augx --v` also work)
55
+ - `augx --help` - Show CLI help (`augx -h` and `augx --h` also work on Linux and Windows)
55
56
 
56
57
  ### Command Help Reference
57
58
 
@@ -186,28 +187,32 @@ Use 'bd' for task tracking
186
187
 
187
188
  ### Beads Workflow
188
189
 
189
- 1. **Create Task**: Append to `.beads/issues.jsonl` with unique hash-based ID
190
- 2. **Add Dependencies**: Use `blocks` and `blocked_by` fields
191
- 3. **Find Ready Tasks**: Tasks with no open blockers
192
- 4. **Work on Task**: Update status to `in_progress`, add comments
193
- 5. **Close Task**: Update status to `closed`
190
+ 1. **Create Task**: Run `bd create "Task title" --type task`
191
+ 2. **Add Dependencies**: Run `bd dep add <task-id> <blocker-id> --type blocks`
192
+ 3. **Find Ready Tasks**: Run `bd ready` for tasks with no open blockers
193
+ 4. **Work on Task**: Run `bd update <id> --status in_progress` and `bd comments add <id> "Progress"`
194
+ 5. **Close Task**: Run `bd close <id> --reason "Completed work"`, then `bd sync`
194
195
 
195
196
  ### Beads Files
196
197
 
197
- - `.beads/issues.jsonl` - All issues (append-only JSONL log)
198
- - `.beads/config.json` - Beads configuration
199
- - `.beads/cache.db` - SQLite cache (gitignored, CLI only)
198
+ - `.beads/embeddeddolt/` - Authoritative native Dolt database (gitignored)
199
+ - `.beads/issues.jsonl` - Generated compatibility export for existing readers; never hand-edit or append task updates
200
+ - `.beads/config.yaml` - Shared native Beads settings and Dolt synchronization remote
201
+ - `.beads/config.json` - Existing Augx project metadata
202
+ - `.beads/metadata.json` - Local native storage identity (gitignored)
200
203
 
201
204
  ### For AI Agents
202
205
 
203
206
  When tracking work:
204
- 1. Create tasks by appending JSON to `.beads/issues.jsonl`
207
+ 1. Use the installed native `bd` CLI for every task mutation. On a fresh clone, run `bd bootstrap` first.
205
208
  2. Use hash-based IDs with **"bd-" prefix**: `bd-<hash>` (e.g., `bd-a1b2`)
206
209
  - All issue IDs MUST use "bd-" prefix (see `openspec/specs/beads/naming-convention.md`)
207
210
  - Valid formats: `bd-<hash>`, `bd-<name>`, `bd-<hash>.<number>`
208
- 3. Track dependencies with `blocks`/`blocked_by` fields
209
- 4. Find ready tasks (status: "open", no blockers)
210
- 5. Update status and add comments as work progresses
211
+ 3. Track dependencies with `bd dep`; do not mutate exported JSONL relationship fields.
212
+ 4. Find ready tasks with `bd ready` and inspect current state with `bd show` or `bd list`.
213
+ 5. Update status and add comments through `bd` as work progresses. Native writes refresh the JSONL export; `bd sync` exchanges Dolt history through the configured remote.
214
+
215
+ The November 27, 2026 cutover recovered the legacy task log into Beads 1.3.1 embedded Dolt. Legacy JSONL-only writers now reject mutations for Dolt projects. See `.beads/README.md` for commands and recovery guidance. Do not restore an old alias that shadows the installed native `bd` command.
211
216
 
212
217
  **Task States**: `open`, `in_progress`, `blocked`, `closed`
213
218
 
@@ -478,9 +483,9 @@ The canonical company services, service area, business claims, and contact detai
478
483
 
479
484
  The root `VERSION` file is the single source of truth for the workspace version.
480
485
 
481
- - After editing `VERSION`, run `pnpm version:sync`.
482
- - Use `pnpm version:sync:dry-run` to preview changes.
483
- - Use `pnpm version:sync:force` in non-interactive contexts.
486
+ - After editing `VERSION`, run `pnpm run version:sync`.
487
+ - Use `pnpm run version:sync:dry-run` to preview changes.
488
+ - Use `pnpm run version:sync:force` in non-interactive contexts.
484
489
  - `VERSIONING.md` defines the SemVer rules and supported rewrite targets.
485
490
 
486
491
  ## YAGNI
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Reusable augmentation modules for Augment Code AI, with cross-platform distribution to Claude Code, Cursor, Windsurf, and GitHub Copilot.**
4
4
 
5
- [![Version](https://img.shields.io/badge/version-3.3.0-blue.svg)](https://github.com/mytech-today-now/augment-extensions)
5
+ [![Version](https://img.shields.io/badge/version-3.4.0-blue.svg)](https://github.com/mytech-today-now/augment-extensions)
6
6
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](./LICENSE)
7
7
  [![npm](https://img.shields.io/badge/npm-%40mytechtoday%2Faugment--extensions-red.svg)](https://www.npmjs.com/package/@mytechtoday/augment-extensions)
8
8
 
@@ -10,15 +10,17 @@ Augment Extensions is the structural layer between your rule modules and the AI
10
10
 
11
11
  The repository exists because rule content for AI agents has outgrown the surfaces individual tools provide. Each tool reserves a small budget for instructions the agent sees before it reasons about your code. Augment Code allocates roughly 49,400 characters to `.augment/`. Cursor, Windsurf, Copilot, and Claude Code each have their own constraints. The modules here live outside those budgets, are loaded on demand, and are emitted into the tool-native shapes those budgets expect, so the same module set can drive every tool without manual duplication.
12
12
 
13
- Current release: 3.3.0 adds Java and Spring standards, Agent Engineering and Jev / TypeSafe Decision Layer workflows, and a refreshed terminal manager with scoped module selection, content browsing, and decision actions. See [the changelog](CHANGELOG.md#330---2026-11-26) for the release notes.
13
+ Current release: 3.4.0 adds automatic linked-rule refresh in Codex and Claude Code chats, opt-in automatic Jev judgments, installed-version discovery in the CLI and terminal manager, and version/help aliases. It also improves Linux, WSL, and Windows CLI handling. See [the changelog](CHANGELOG.md#340---2026-11-27) for the release notes.
14
14
 
15
15
  ## Table of Contents
16
16
 
17
17
  - [Why This Exists](#why-this-exists)
18
18
  - [Quickstart](#quickstart)
19
+ - [What's New in 3.4.0](#whats-new-in-340)
19
20
  - [Concepts](#concepts)
20
21
  - [CLI Reference](#cli-reference)
21
22
  - [Cross-Platform Distribution](#cross-platform-distribution)
23
+ - [Automatic Rule Refresh in Chat](#automatic-rule-refresh-in-chat)
22
24
  - [Coordination Manifest Schema](#coordination-manifest-schema)
23
25
  - [MCP Integration](#mcp-integration)
24
26
  - [OpenSpec Integration](#openspec-integration)
@@ -48,6 +50,8 @@ The result: rules are authored once in plain Markdown and JSON, versioned per mo
48
50
 
49
51
  ## Quickstart
50
52
 
53
+ For WSL, first verify that Linux Node.js and npm are selected as described in [WSL install and first run](#wsl-install-and-first-run). Installing with Windows npm can create an `augx` shim that cannot find Linux `node`.
54
+
51
55
  Install the CLI globally and link a module:
52
56
 
53
57
  ```bash
@@ -74,9 +78,97 @@ augx export --target all --dry-run # preview without writing
74
78
 
75
79
  From a clean clone to a working `CLAUDE.md`, `.cursor/rules/augx-coding-standards-typescript.mdc`, and `.windsurf/rules/augx-coding-standards-typescript.md` is four commands.
76
80
 
81
+ ### Linux install and first run
82
+
83
+ Augx requires Node.js 16 or newer and npm. Check that both are available, install the CLI, and verify it starts:
84
+
85
+ ```bash
86
+ node --version
87
+ npm --version
88
+ npm install --global @mytechtoday/augment-extensions
89
+ augx --version
90
+ augx --v
91
+ augx version
92
+ augx -h
93
+ augx --h
94
+ augx --help
95
+ ```
96
+
97
+ If npm reports a permissions error for its global package directory, use a user-owned prefix instead of running npm with `sudo`:
98
+
99
+ ```bash
100
+ npm config set prefix "$HOME/.local"
101
+ export PATH="$HOME/.local/bin:$PATH"
102
+ npm install --global @mytechtoday/augment-extensions
103
+ ```
104
+
105
+ Add the `PATH` export to your shell startup file so `augx` remains available in new terminals. If you use a Node version manager that already provides a user-writable global package directory, keep that configuration.
106
+
107
+ From the project where you want to use the extensions, initialize Augx and link the guidance that fits the project:
108
+
109
+ ```bash
110
+ cd /path/to/your/project
111
+ augx init --no-optional-rules
112
+ augx link coding-standards/java
113
+ augx link coding-standards/spring
114
+ augx link workflows/agent-engineering
115
+ augx list --linked
116
+ ```
117
+
118
+ ### WSL install and first run
119
+
120
+ Run the install from a WSL Linux terminal with Linux Node.js and npm. Windows npm can add a shell wrapper under `/mnt/c/Users/.../AppData/Roaming/npm`; that wrapper runs `node`, so it fails with `node: not found` when Linux Node is missing from the WSL `PATH`.
121
+
122
+ Check that the selected tools and npm prefix belong to Linux before installing:
123
+
124
+ ```bash
125
+ node --version
126
+ node -p 'process.platform' # must print linux
127
+ command -v npm # must be a Linux path, not /mnt/c/...
128
+ npm config get prefix # must be a Linux path, not /mnt/c/...
129
+ ```
130
+
131
+ If `node` is missing or `process.platform` prints `win32`, install a Linux build of Node.js and npm inside WSL using your preferred Linux Node version manager. Ensure its `bin` directory is on `PATH` before the imported Windows npm directories. Then install and verify Augx from WSL:
132
+
133
+ ```bash
134
+ npm install -g @mytechtoday/augment-extensions
135
+ command -v augx # should resolve to a Linux path
136
+ augx --version
137
+ ```
138
+
139
+ From a checkout of this repository, `bash scripts/check-wsl-augx.sh` checks the selected Node, npm, global prefix, and Augx command without requiring Augx itself to start. If it reports a Windows path, correct the Linux Node/npm `PATH` order, reinstall Augx from WSL, and open a new terminal.
140
+
141
+ The check is also included in the npm package. If `command -v augx` points into the Windows npm directory, run it directly from that installation:
142
+
143
+ ```bash
144
+ AUGX_BIN=$(command -v augx)
145
+ bash "$(dirname "$AUGX_BIN")/node_modules/@mytechtoday/augment-extensions/scripts/check-wsl-augx.sh"
146
+ ```
147
+
148
+ Link only the modules you need. Run `augx gui` to browse modules, inspect their content, and manage links interactively. See [CLI Reference](#cli-reference) for initialization, linking, exporting, and other commands.
149
+
150
+ ### What's New in 3.4.0
151
+
152
+ - **Automatic linked-rule refresh** adds `augx context setup`, `disable`, and `status` for Codex and Claude Code. Configured hooks select current linked guidance for each prompt and refresh it after compaction without storing chat text or rule contents. See [Automatic Rule Refresh in Chat](#automatic-rule-refresh-in-chat).
153
+ - **Automatic Jev judgments** can be enabled for eligible Codex and Claude Code chats with saved consent and a bounded request budget. Setup makes no provider call; the host controls selection. See the [Decision Layer guide](augment-extensions/workflows/decision-layer/README.md) and [chat integration evidence report](docs/reports/decision-chat-2026-11-27.md).
154
+ - **Installed-version discovery** adds `augx version` and `augx --v`; `augx --version` and `augx -V` remain supported. The terminal manager displays the same installed version when it opens.
155
+ - **Help aliases** include `augx -h`, `augx --h`, and `augx --help` on Linux and Windows.
156
+ - **Cross-platform CLI handling** improves Windows process execution and adds checks and guidance for selecting Linux Node.js/npm when installing from WSL.
157
+
158
+ For optional automatic Jev judgments in normal chat, configure the native MCP integration once for Codex or Claude Code:
159
+
160
+ ```bash
161
+ augx link workflows/decision-layer
162
+ augx decision setup --host codex --automatic --requests 6 --dry-run
163
+ augx decision setup --host codex --automatic --requests 6
164
+ augx decision doctor
165
+ ```
166
+
167
+ Use `--host claude-code` for Claude Code. Review the plan and public-data consent before setup, then restart the host and trust or approve the project. Setup makes no provider calls; live requests need `TYPESAFE_API_KEY` in the host's environment. Once configured, the host may select Jev for an eligible ambiguous classification or evidence-ranking decision without a per-turn terminal command. Selection is controlled by the host model and is not guaranteed; real ordinary-chat selection and a live Jev response remain unverified. See the [chat integration evidence report](docs/reports/decision-chat-2026-11-27.md).
168
+
77
169
  ## Runtime Compatibility
78
170
 
79
- The package declares Node.js `>=16` and builds the CLI as CommonJS. The CLI loads Chalk synchronously for command output, so it uses Chalk 4, which supports the fluent color and bold methods used by the CLI and can be required from CommonJS on Node 16. Chalk 5 is ESM-only and fails when loaded by this CommonJS entry point on Node 16. Inquirer remains on version 9 and is loaded with native dynamic import only when an interactive prompt is needed. UUID remains unchanged because the CLI startup path does not import it.
171
+ The package declares Node.js `>=16` and builds the CLI as CommonJS. The CLI supports Linux and Windows, including Linux executables and Windows command wrappers for external tools. It loads Chalk synchronously for command output, so it uses Chalk 4, which supports the fluent color and bold methods used by the CLI and can be required from CommonJS on Node 16. Chalk 5 is ESM-only and fails when loaded by this CommonJS entry point on Node 16. Inquirer remains on version 9 and is loaded with native dynamic import only when an interactive prompt is needed. UUID remains unchanged because the CLI startup path does not import it.
80
172
 
81
173
  ## Concepts
82
174
 
@@ -93,7 +185,22 @@ Four module categories exist:
93
185
 
94
186
  The [Agent Engineering workflow](augment-extensions/workflows/agent-engineering/README.md) covers scoped agents, harnesses, bounded loops, and dependency graphs with validated contracts and runnable deterministic local examples. Link it with `augx link workflows/agent-engineering` from a checkout or package that contains the module.
95
187
 
96
- The [Decision Layer workflow](augment-extensions/workflows/decision-layer/README.md) adds an optional TypeSafe integration with project-local software setup, eleven typed decision capabilities, bounded local workers, independent artifact verification, recovery, and labeled evaluation. Link it with `augx link workflows/decision-layer`, inspect `augx decision setup --dry-run`, then explicitly run setup. Ordinary discovery and exports do not install or load the optional SDK. See the module guide for offline fixtures, live credentials and request budgets, actual host boundaries, and safe removal.
188
+ The [Decision Layer workflow](augment-extensions/workflows/decision-layer/README.md) adds an optional TypeSafe integration with project-local software setup, eleven typed decision capabilities, bounded local workers, independent artifact verification, recovery, and labeled evaluation. Link it with `augx link workflows/decision-layer` and explicitly run setup. To enable selective native chat judgments once, use `augx decision setup --host codex --automatic --requests 6` (or `--host claude-code`) after reviewing the dry-run and public-data consent. Restart and trust/approve the project in the host. Saved runtime policy controls requests; ordinary discovery and static exports do not activate it. See the module guide for exact host support, fixtures, verification gaps, limits and removal.
189
+
190
+ ### Automatic Rule Refresh in Chat
191
+
192
+ Augx can refresh relevant linked rule files automatically in Codex and Claude Code chats. Run setup once in the project:
193
+
194
+ ```bash
195
+ augx context setup --host all
196
+ augx context status
197
+ ```
198
+
199
+ This adds project lifecycle hooks to `.codex/hooks.json` and `.claude/settings.json`. Trust the Codex project configuration and review its hook, or approve the Claude Code project settings when prompted. Each user prompt is evaluated against linked module metadata, rule headings, and referenced rule paths. The matching current rule files are reread and injected with their canonical module ID, version, source path, and SHA-256 hash. A compact or resumed session refreshes the saved module IDs before the next model request.
200
+
201
+ Augx stores only a schema version, host, project root, hashed session key, update time, canonical module IDs, selection modes, and relative rule paths for each session under the local user state directory. It does not store prompt text, transcripts, or rule contents. The next refresh checks current links and versions again. It does not fetch remote module updates or change pinned versions. Diagnostics identify missing links, unavailable versions, unsafe paths, unreadable files, and files omitted to stay within the host context budget.
202
+
203
+ Cursor, Windsurf, and GitHub Copilot remain supported through static export or mirrors and do not have automatic rule refresh from this integration. Remove Augx-owned hooks with `augx context disable --host all`; edited hooks and unrelated settings are preserved.
97
204
 
98
205
  ### Linked vs. mirrored vs. exported
99
206
 
@@ -161,6 +268,28 @@ augx lifecycle uninstall --force
161
268
 
162
269
  See [docs/LIFECYCLE.md](./docs/LIFECYCLE.md) for the state model, artifact schema, repair flow, and recovery notes.
163
270
 
271
+ ### CLI information
272
+
273
+ #### `augx version`
274
+
275
+ Print the installed Augx CLI version. The `augx --version`, `augx -V`, and `augx --v` options report the same value.
276
+
277
+ ```bash
278
+ augx version
279
+ augx --version
280
+ augx --v
281
+ ```
282
+
283
+ #### `augx --help`
284
+
285
+ Print application help. The `-h` and `--h` options are aliases, and all three work on Linux and Windows.
286
+
287
+ ```bash
288
+ augx -h
289
+ augx --h
290
+ augx --help
291
+ ```
292
+
164
293
  ### Module discovery
165
294
 
166
295
  Linked-module commands resolve the nearest ancestor .augment/extensions.json within the current Git repository. Nested folders inherit that manifest, while a nested copy with its own manifest uses its own linked-module set.
@@ -474,7 +603,7 @@ Every exported file starts with a five-line HTML-comment banner. For Cursor, the
474
603
 
475
604
  ```text
476
605
  <!-- GENERATED BY augx export - DO NOT EDIT -->
477
- <!-- augx-version: 3.3.0 -->
606
+ <!-- augx-version: 3.4.0 -->
478
607
  <!-- generated-at: 2026-05-25T21:13:00Z -->
479
608
  <!-- source-hash: a1b2c3d4e5f60718 -->
480
609
  <!-- modules: coding-standards/typescript@2.0.0, workflows/cross-platform@1.0.0 -->
@@ -0,0 +1,120 @@
1
+ # Cross-Platform Distribution Workflow
2
+
3
+ **Version:** 1.0.0
4
+ **Type:** Workflow
5
+ **Category:** Interoperability / Multi-Tool Distribution
6
+
7
+ ## Overview
8
+
9
+ This workflow module is the day-to-day reference for sharing a single set of Augx extension modules across **Claude Code**, **Cursor**, **Windsurf**, **GitHub Copilot**, and **Augment Code**. Two CLI surfaces drive the integration; both are opt-in and safe to run together:
10
+
11
+ 1. `augx export --target <tool>` - produces the **single aggregated file** each tool expects.
12
+ 2. `augx link <module> --mirror <tool>` - produces a **per-module file (or directory)** in the tool's native rules location.
13
+
14
+ The Augment Code surface (`.augment/` rules and root `AGENTS.md`) is **never modified** by either command. The cross-platform feature is purely additive.
15
+
16
+ ## Per-Tool Target Paths
17
+
18
+ ### Aggregated Export (`augx export`)
19
+
20
+ | Target | Path | Format |
21
+ |---|---|---|
22
+ | `claude-code` | `CLAUDE.md` | Markdown |
23
+ | `cursor` | `.cursor/rules/augx.mdc` | Markdown + YAML frontmatter |
24
+ | `windsurf` | `.windsurfrules` | Markdown |
25
+ | `copilot` | `.github/copilot-instructions.md` | Markdown |
26
+ | `all` | all of the above | per-format |
27
+
28
+ ### Per-Module Mirror (`augx link --mirror`)
29
+
30
+ | Target | Per-Module Path |
31
+ |---|---|
32
+ | `claude-code` | `.claude/rules/<module>/...` + include stub in `CLAUDE.md` |
33
+ | `cursor` | `.cursor/rules/augx-<module>.mdc` |
34
+ | `windsurf` | `.windsurf/rules/augx-<module>.md` |
35
+ | `copilot` | `.github/instructions/augx-<module>.instructions.md` |
36
+
37
+ ## Usage and Quick Reference
38
+
39
+ ```bash
40
+ # One-shot export for one tool
41
+ augx export --target claude-code
42
+
43
+ # Export to every target listed in .augment/coordination.json.export.targets
44
+ augx export
45
+
46
+ # Preview only (no writes)
47
+ augx export --target all --dry-run
48
+
49
+ # Link a module and mirror it into two tools
50
+ augx link coding-standards/typescript --mirror cursor,windsurf
51
+
52
+ # Reverse a mirrored link (also prunes tracked copies / symlinks)
53
+ augx unlink coding-standards/typescript
54
+ ```
55
+
56
+ ## When To Use Which
57
+
58
+ - **Use `augx export`** when the consuming tool reads a single rules file (Cursor's `augx.mdc`, Windsurf's `.windsurfrules`, Copilot's `copilot-instructions.md`, Claude Code's `CLAUDE.md`). Best for one aggregated handoff per checkout.
59
+ - **Use `augx link --mirror`** when you want per-module attribution (one file per module, faster diffs, finer-grained `unlink`). Best for active development where modules change frequently.
60
+ - The two surfaces are complementary; you can run both in the same project. `augx export` writes the aggregate file; `augx link --mirror` writes the per-module files. They never share a target path.
61
+
62
+ ## MCP-First Task-Context Contract
63
+
64
+ Exported files contain **zero** live task data: no `bd-` IDs, no statuses, no dependency snapshots, no endpoint URLs. When the project declares a Beads MCP server in either `.vscode/mcp.json` or `.augment/mcp/servers.json`, `augx export` inlines a single tool-agnostic snippet (from `augment-extensions/workflows/mcp/templates/beads.md`) directly after the banner. The snippet tells the consuming AI agent to query the `beads` MCP server for task state rather than parsing prose.
65
+
66
+ When neither MCP config declares `beads`, the snippet is omitted entirely. See `rules/mcp-snippet-inlining.md` for the trigger details.
67
+
68
+ ## Drift Refusal (Exit Code 3)
69
+
70
+ If `augx export` finds the target file has been hand-edited (banner hash does not match recomputed body hash), it **refuses to overwrite** and exits with code 3. Resolve drift either by:
71
+
72
+ - Editing canonical module sources under `augment-extensions/` and re-running `augx export` (preferred), or
73
+ - Re-running with `--force` (discards local edits).
74
+
75
+ See `rules/drift-resolution.md` for the full playbook.
76
+
77
+ ## Windows Symlink Fallback
78
+
79
+ On Windows without Developer Mode, `fs.symlinkSync` raises `EPERM`. The mirror hook catches `EPERM`, `EACCES`, and `ENOSYS`, falls back to `copyFile`, and records `mode: 'copy'` in `.augment/coordination.json.mirrors[<module>]`. Subsequent runs see the recorded mode and skip the symlink attempt entirely, so there is no per-run retry storm.
80
+
81
+ See `rules/windows-fallback.md` for the detailed behavior contract.
82
+
83
+ ## Contents and Directory Structure
84
+
85
+ ```
86
+ augment-extensions/workflows/cross-platform/
87
+ ├── module.json # Module metadata
88
+ ├── README.md # This file
89
+ ├── rules/ # Day-to-day guidance
90
+ │ ├── export-guide.md # 'augx export' walkthrough
91
+ │ ├── mirror-guide.md # 'augx link --mirror' walkthrough
92
+ │ ├── drift-resolution.md # Recovering from exit code 3
93
+ │ ├── windows-fallback.md # EPERM -> copy fallback details
94
+ │ └── mcp-snippet-inlining.md # When the Beads MCP snippet appears
95
+ └── examples/ # Worked example
96
+ └── end-to-end-session.md # Full link -> mirror -> export -> unlink walkthrough
97
+ ```
98
+
99
+ ## Related Specs
100
+
101
+ Source-of-truth canonical specs live under `openspec/specs/cross-platform/`:
102
+
103
+ - `export-command.md` - grammar, flags, exit codes, drift detection.
104
+ - `mirror-hook.md` - materialization strategy, idempotency, unlink cleanup.
105
+ - `coordination-export-block.md` - schema for `export` and `mirrors` keys in `.augment/coordination.json`.
106
+ - `mcp-template.md` - canonical Beads MCP snippet contract.
107
+
108
+ This module is the **operator-facing** counterpart; consult the specs for normative grammar and exit-code definitions.
109
+
110
+ ## Installation
111
+
112
+ ```bash
113
+ augx link workflows/cross-platform
114
+ ```
115
+
116
+ No additional setup is required: the workflow module is pure documentation.
117
+
118
+ ## Character Count
119
+
120
+ The `augment.characterCount` value in `module.json` counts decoded text across all module files, including the manifest and this README. Validate with `augx validate workflows/cross-platform` after editing.
@@ -0,0 +1,196 @@
1
+ # End-To-End Session: Link, Mirror, Export, Unlink
2
+
3
+ An illustrative transcript, with example output and byte counts, showing `augx link --mirror` and `augx export` together in a single project from a clean state through to cleanup.
4
+
5
+ ## Scenario
6
+
7
+ A new TypeScript project wants both:
8
+
9
+ - **Cursor** to see per-module rules (one file per module, easy to inspect).
10
+ - **Claude Code** to see one aggregated `CLAUDE.md` (single-file consumption).
11
+ - Live task state queried via the **Beads MCP server** rather than baked into either file.
12
+
13
+ Tools to be linked:
14
+
15
+ - `coding-standards/typescript`
16
+ - `workflows/cross-platform`
17
+
18
+ ## Step 0: Initial State
19
+
20
+ ```bash
21
+ $ ls
22
+ package.json src/
23
+ $ augx list --linked
24
+ (no modules linked)
25
+ $ cat .augment/coordination.json
26
+ {
27
+ "version": "1.0.0",
28
+ "lastUpdated": "2026-05-25T12:00:00.000Z",
29
+ "specs": {},
30
+ "tasks": {}
31
+ }
32
+ ```
33
+
34
+ `.vscode/mcp.json` already declares the `beads` MCP server (assumed for this scenario).
35
+
36
+ ## Step 1: Declare Project Defaults
37
+
38
+ Add to `.augment/coordination.json`:
39
+
40
+ ```json
41
+ {
42
+ "export": {
43
+ "targets": ["claude-code"],
44
+ "ignore": ["**/examples/**"],
45
+ "mirror": false
46
+ }
47
+ }
48
+ ```
49
+
50
+ `export.targets` records the convention "this project's aggregated export goes to Claude Code". `export.mirror: false` keeps the per-module mirror opt-in (we will request it explicitly).
51
+
52
+ ## Step 2: Link Modules With Cursor Mirror
53
+
54
+ ```bash
55
+ $ augx link coding-standards/typescript --mirror cursor
56
+ linked: coding-standards/typescript (v1.0.0)
57
+ cursor wrote symlink .cursor/rules/augx-typescript-standards.mdc
58
+
59
+ $ augx link workflows/cross-platform --mirror cursor
60
+ linked: workflows/cross-platform (v1.0.0)
61
+ cursor wrote symlink .cursor/rules/augx-cross-platform.mdc
62
+ ```
63
+
64
+ Both modules are now mirrored individually into `.cursor/rules/`. The coordination manifest records:
65
+
66
+ ```json
67
+ {
68
+ "mirrors": {
69
+ "coding-standards/typescript": [
70
+ { "tool": "cursor",
71
+ "sourcePath": "augment-extensions/coding-standards/typescript/rules/...",
72
+ "targetPath": ".cursor/rules/augx-typescript-standards.mdc",
73
+ "mode": "symlink" }
74
+ ],
75
+ "workflows/cross-platform": [
76
+ { "tool": "cursor", "sourcePath": "...", "targetPath": ".cursor/rules/augx-cross-platform.mdc", "mode": "symlink" }
77
+ ]
78
+ }
79
+ }
80
+ ```
81
+
82
+ ## Step 3: Aggregated Export For Claude Code
83
+
84
+ ```bash
85
+ $ augx export
86
+ [wrote] claude-code -> CLAUDE.md (14_502 bytes, 2 modules)
87
+ ```
88
+
89
+ `CLAUDE.md` now contains:
90
+
91
+ - The banner (with `source-hash`).
92
+ - The Beads MCP snippet (because `.vscode/mcp.json` declares `beads`).
93
+ - A `## Module: coding-standards/typescript (v1.0.0)` section.
94
+ - A `## Module: workflows/cross-platform (v1.0.0)` section.
95
+ - The footer.
96
+
97
+ ## Step 4: Verify Both Surfaces
98
+
99
+ ```bash
100
+ $ augx export --dry-run
101
+ [dry-run] claude-code -> CLAUDE.md (no-op, byte-identical)
102
+
103
+ $ augx link coding-standards/typescript --mirror cursor
104
+ linked: coding-standards/typescript (v1.0.0)
105
+ cursor reused symlink .cursor/rules/augx-typescript-standards.mdc
106
+ ```
107
+
108
+ Both commands are now no-ops. The system has reached a stable fixed point.
109
+
110
+ ## Step 5: Edit A Module And Re-Sync
111
+
112
+ A new convention is added to `augment-extensions/coding-standards/typescript/rules/naming.md`.
113
+
114
+ ```bash
115
+ $ augx export
116
+ [wrote] claude-code -> CLAUDE.md (14_640 bytes, 2 modules)
117
+
118
+ $ augx link coding-standards/typescript --mirror cursor
119
+ linked: coding-standards/typescript (v1.0.0)
120
+ cursor wrote symlink .cursor/rules/augx-typescript-standards.mdc
121
+ ```
122
+
123
+ The aggregated `CLAUDE.md` and the per-module `.cursor/rules/augx-typescript-standards.mdc` are both refreshed. Modules that did not change are not rewritten.
124
+
125
+ ## Step 6: Handle A Drift Refusal
126
+
127
+ A teammate has manually edited `CLAUDE.md`:
128
+
129
+ ```bash
130
+ $ augx export
131
+ error: CLAUDE.md has been hand-edited since the last 'augx export'.
132
+ (banner source-hash 'a1b2...' does not match body hash 'e5f6...')
133
+ Pass --force to overwrite, or edit module sources and re-run.
134
+ $ echo $?
135
+ 3
136
+ ```
137
+
138
+ Apply the drift-resolution playbook:
139
+
140
+ ```bash
141
+ $ git diff CLAUDE.md
142
+ # review the edit
143
+ $ # decision: the edit belongs in the typescript module
144
+ $ git checkout HEAD -- CLAUDE.md
145
+ $ # move the edit into augment-extensions/coding-standards/typescript/rules/...
146
+ $ augx export
147
+ [wrote] claude-code -> CLAUDE.md (14_780 bytes, 2 modules)
148
+ $ echo $?
149
+ 0
150
+ ```
151
+
152
+ See `rules/drift-resolution.md` for the full decision tree.
153
+
154
+ ## Step 7: Unlink One Module
155
+
156
+ ```bash
157
+ $ augx unlink workflows/cross-platform
158
+ unlinked: workflows/cross-platform
159
+ removed symlink .cursor/rules/augx-cross-platform.mdc
160
+ cleared mirrors["workflows/cross-platform"]
161
+
162
+ $ augx export
163
+ [wrote] claude-code -> CLAUDE.md (8_120 bytes, 1 module)
164
+ ```
165
+
166
+ The Cursor per-module file is gone, the coordination manifest entry is gone, and `CLAUDE.md` is regenerated without the `cross-platform` section.
167
+
168
+ ## Step 8: Full Cleanup
169
+
170
+ ```bash
171
+ $ augx unlink coding-standards/typescript
172
+ unlinked: coding-standards/typescript
173
+ removed symlink .cursor/rules/augx-typescript-standards.mdc
174
+ cleared mirrors["coding-standards/typescript"]
175
+ (mirrors block now empty, removed key)
176
+
177
+ $ rm CLAUDE.md
178
+ $ augx list --linked
179
+ (no modules linked)
180
+ ```
181
+
182
+ The project is back to its initial state. `.augment/coordination.json` is restored to having no `mirrors` block; the `export.targets` convention remains for next time.
183
+
184
+ ## Recap
185
+
186
+ | Step | Surface | Outcome |
187
+ |---|---|---|
188
+ | 2 | Cursor (per-module) | Two `augx-<module>.mdc` files written as symlinks. |
189
+ | 3 | Claude Code (aggregated) | One `CLAUDE.md` written with banner + MCP snippet + 2 module sections. |
190
+ | 4 | Both | No-op rerun confirms idempotency. |
191
+ | 5 | Both | Module edit refreshes both surfaces. |
192
+ | 6 | Claude Code | Drift refusal recovered by moving edit into modules. |
193
+ | 7 | Both | One unlink prunes one Cursor file and one CLAUDE.md section. |
194
+ | 8 | Both | Full unlink restores initial state; coordination manifest stays clean. |
195
+
196
+ The Augment Code surface (`.augment/` rules) was untouched throughout. The Beads MCP server was the source of truth for task state; no task IDs ever appeared in `CLAUDE.md` or `.cursor/rules/augx-*.mdc`.