@mytechtoday/augment-extensions 3.2.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 (198) hide show
  1. package/AGENTS.md +25 -16
  2. package/README.md +215 -17
  3. package/augment-extensions/coding-standards/java/CHANGELOG.md +12 -0
  4. package/augment-extensions/coding-standards/java/README.md +54 -0
  5. package/augment-extensions/coding-standards/java/examples/SearchRequest.java +13 -0
  6. package/augment-extensions/coding-standards/java/metadata.json +36 -0
  7. package/augment-extensions/coding-standards/java/module.json +35 -0
  8. package/augment-extensions/coding-standards/java/rules/language-and-api-design.md +45 -0
  9. package/augment-extensions/coding-standards/java/rules/reliability-and-concurrency.md +43 -0
  10. package/augment-extensions/coding-standards/java/rules/testing-tooling-and-security.md +39 -0
  11. package/augment-extensions/coding-standards/spring/CHANGELOG.md +12 -0
  12. package/augment-extensions/coding-standards/spring/README.md +61 -0
  13. package/augment-extensions/coding-standards/spring/examples/OrderController.java +40 -0
  14. package/augment-extensions/coding-standards/spring/metadata.json +39 -0
  15. package/augment-extensions/coding-standards/spring/module.json +38 -0
  16. package/augment-extensions/coding-standards/spring/rules/beans-configuration-and-boot.md +39 -0
  17. package/augment-extensions/coding-standards/spring/rules/data-testing-and-transactions.md +36 -0
  18. package/augment-extensions/coding-standards/spring/rules/production-operations.md +40 -0
  19. package/augment-extensions/coding-standards/spring/rules/web-apis-and-security.md +43 -0
  20. package/augment-extensions/visual-design/metadata.json +1 -1
  21. package/augment-extensions/visual-design/module.json +2 -2
  22. package/augment-extensions/workflows/agent-engineering/README.md +67 -0
  23. package/augment-extensions/workflows/agent-engineering/examples/contracts.cjs +89 -0
  24. package/augment-extensions/workflows/agent-engineering/examples/demo.cjs +17 -0
  25. package/augment-extensions/workflows/agent-engineering/examples/evaluation-cases.json +7 -0
  26. package/augment-extensions/workflows/agent-engineering/examples/graphs.cjs +149 -0
  27. package/augment-extensions/workflows/agent-engineering/examples/loop.cjs +125 -0
  28. package/augment-extensions/workflows/agent-engineering/examples/recovery.cjs +51 -0
  29. package/augment-extensions/workflows/agent-engineering/examples/stub.cjs +11 -0
  30. package/augment-extensions/workflows/agent-engineering/examples/verify.cjs +21 -0
  31. package/augment-extensions/workflows/agent-engineering/module.json +24 -0
  32. package/augment-extensions/workflows/agent-engineering/rules/01-adoption.md +30 -0
  33. package/augment-extensions/workflows/agent-engineering/rules/02-agents.md +34 -0
  34. package/augment-extensions/workflows/agent-engineering/rules/03-contracts.md +34 -0
  35. package/augment-extensions/workflows/agent-engineering/rules/04-loops.md +39 -0
  36. package/augment-extensions/workflows/agent-engineering/rules/05-graphs.md +39 -0
  37. package/augment-extensions/workflows/agent-engineering/rules/06-improvement.md +38 -0
  38. package/augment-extensions/workflows/agent-engineering/schemas/contracts.schema.json +1 -0
  39. package/augment-extensions/workflows/agent-engineering/scripts/validate.cjs +32 -0
  40. package/augment-extensions/workflows/agent-engineering/sources.md +12 -0
  41. package/augment-extensions/workflows/agent-engineering/templates/agent.json +40 -0
  42. package/augment-extensions/workflows/agent-engineering/templates/check-tool.json +94 -0
  43. package/augment-extensions/workflows/agent-engineering/templates/evidence.json +29 -0
  44. package/augment-extensions/workflows/agent-engineering/templates/invocation.json +40 -0
  45. package/augment-extensions/workflows/agent-engineering/templates/node.json +27 -0
  46. package/augment-extensions/workflows/agent-engineering/templates/state.json +27 -0
  47. package/augment-extensions/workflows/agent-engineering/templates/task.json +40 -0
  48. package/augment-extensions/workflows/agent-engineering/templates/tool.json +52 -0
  49. package/augment-extensions/workflows/cross-platform/README.md +120 -0
  50. package/augment-extensions/workflows/cross-platform/examples/end-to-end-session.md +196 -0
  51. package/augment-extensions/workflows/cross-platform/module.json +91 -0
  52. package/augment-extensions/workflows/cross-platform/rules/drift-resolution.md +126 -0
  53. package/augment-extensions/workflows/cross-platform/rules/export-guide.md +139 -0
  54. package/augment-extensions/workflows/cross-platform/rules/mcp-snippet-inlining.md +99 -0
  55. package/augment-extensions/workflows/cross-platform/rules/mirror-guide.md +139 -0
  56. package/augment-extensions/workflows/cross-platform/rules/windows-fallback.md +111 -0
  57. package/augment-extensions/workflows/decision-layer/README.md +172 -0
  58. package/augment-extensions/workflows/decision-layer/examples/call-inventory.json +6 -0
  59. package/augment-extensions/workflows/decision-layer/examples/config.json +9 -0
  60. package/augment-extensions/workflows/decision-layer/examples/decision.json +13 -0
  61. package/augment-extensions/workflows/decision-layer/examples/labeled-cases.json +410 -0
  62. package/augment-extensions/workflows/decision-layer/examples/source.txt +3 -0
  63. package/augment-extensions/workflows/decision-layer/examples/task.json +8 -0
  64. package/augment-extensions/workflows/decision-layer/installation/augx-judgments/SKILL.md +14 -0
  65. package/augment-extensions/workflows/decision-layer/installation/package-lock.json +27 -0
  66. package/augment-extensions/workflows/decision-layer/installation/package.json +7 -0
  67. package/augment-extensions/workflows/decision-layer/installation/sources.json +18 -0
  68. package/augment-extensions/workflows/decision-layer/module.json +24 -0
  69. package/augment-extensions/workflows/decision-layer/rules/00-index.md +5 -0
  70. package/augment-extensions/workflows/decision-layer/rules/01-responsibilities.md +15 -0
  71. package/augment-extensions/workflows/decision-layer/rules/02-operation.md +15 -0
  72. package/augment-extensions/workflows/decision-layer/runtime/automatic.cjs +80 -0
  73. package/augment-extensions/workflows/decision-layer/runtime/chat-install.cjs +149 -0
  74. package/augment-extensions/workflows/decision-layer/runtime/chat-server.cjs +71 -0
  75. package/augment-extensions/workflows/decision-layer/runtime/cli.cjs +70 -0
  76. package/augment-extensions/workflows/decision-layer/runtime/common.cjs +85 -0
  77. package/augment-extensions/workflows/decision-layer/runtime/contracts.d.ts +21 -0
  78. package/augment-extensions/workflows/decision-layer/runtime/decisions.cjs +198 -0
  79. package/augment-extensions/workflows/decision-layer/runtime/evaluate.cjs +61 -0
  80. package/augment-extensions/workflows/decision-layer/runtime/install.cjs +199 -0
  81. package/augment-extensions/workflows/decision-layer/runtime/integrations.cjs +64 -0
  82. package/augment-extensions/workflows/decision-layer/runtime/runner.cjs +201 -0
  83. package/augment-extensions/workflows/decision-layer/runtime/worker-child.cjs +15 -0
  84. package/augment-extensions/workflows/decision-layer/runtime/workers.cjs +15 -0
  85. package/augment-extensions/workflows/decision-layer/schemas/automatic-input.schema.json +40 -0
  86. package/augment-extensions/workflows/decision-layer/schemas/config.schema.json +39 -0
  87. package/augment-extensions/workflows/decision-layer/scripts/validate.cjs +16 -0
  88. package/augment-extensions/workflows/decision-layer/sources.md +34 -0
  89. package/cli/MODULES.md +804 -302
  90. package/cli/dist/__test_file-tracking.d.ts +2 -0
  91. package/cli/dist/__test_file-tracking.d.ts.map +1 -0
  92. package/cli/dist/__test_file-tracking.js +4 -0
  93. package/cli/dist/__test_file-tracking.js.map +1 -0
  94. package/cli/dist/analysis/ast-parser.d.ts.map +1 -1
  95. package/cli/dist/analysis/ast-parser.js +25 -9
  96. package/cli/dist/analysis/ast-parser.js.map +1 -1
  97. package/cli/dist/cli.js +43 -9
  98. package/cli/dist/cli.js.map +1 -1
  99. package/cli/dist/commands/context.d.ts +8 -0
  100. package/cli/dist/commands/context.d.ts.map +1 -0
  101. package/cli/dist/commands/context.js +115 -0
  102. package/cli/dist/commands/context.js.map +1 -0
  103. package/cli/dist/commands/decision.d.ts +4 -0
  104. package/cli/dist/commands/decision.d.ts.map +1 -0
  105. package/cli/dist/commands/decision.js +34 -0
  106. package/cli/dist/commands/decision.js.map +1 -0
  107. package/cli/dist/commands/gui-decision.d.ts +6 -0
  108. package/cli/dist/commands/gui-decision.d.ts.map +1 -0
  109. package/cli/dist/commands/gui-decision.js +210 -0
  110. package/cli/dist/commands/gui-decision.js.map +1 -0
  111. package/cli/dist/commands/gui-module-manager.d.ts +14 -0
  112. package/cli/dist/commands/gui-module-manager.d.ts.map +1 -0
  113. package/cli/dist/commands/gui-module-manager.js +328 -0
  114. package/cli/dist/commands/gui-module-manager.js.map +1 -0
  115. package/cli/dist/commands/gui.d.ts +3 -9
  116. package/cli/dist/commands/gui.d.ts.map +1 -1
  117. package/cli/dist/commands/gui.js +7 -293
  118. package/cli/dist/commands/gui.js.map +1 -1
  119. package/cli/dist/commands/link.d.ts +2 -0
  120. package/cli/dist/commands/link.d.ts.map +1 -1
  121. package/cli/dist/commands/link.js +82 -84
  122. package/cli/dist/commands/link.js.map +1 -1
  123. package/cli/dist/commands/search.js +1 -11
  124. package/cli/dist/commands/search.js.map +1 -1
  125. package/cli/dist/commands/show.d.ts.map +1 -1
  126. package/cli/dist/commands/show.js +5 -18
  127. package/cli/dist/commands/show.js.map +1 -1
  128. package/cli/dist/commands/skill.d.ts.map +1 -1
  129. package/cli/dist/commands/skill.js +3 -3
  130. package/cli/dist/commands/skill.js.map +1 -1
  131. package/cli/dist/commands/unlink.d.ts +2 -0
  132. package/cli/dist/commands/unlink.d.ts.map +1 -1
  133. package/cli/dist/commands/unlink.js +51 -45
  134. package/cli/dist/commands/unlink.js.map +1 -1
  135. package/cli/dist/commands/update.js +14 -7
  136. package/cli/dist/commands/update.js.map +1 -1
  137. package/cli/dist/core/compatibility-checker.d.ts.map +1 -1
  138. package/cli/dist/core/compatibility-checker.js +5 -2
  139. package/cli/dist/core/compatibility-checker.js.map +1 -1
  140. package/cli/dist/lib/context-hosts.d.ts +16 -0
  141. package/cli/dist/lib/context-hosts.d.ts.map +1 -0
  142. package/cli/dist/lib/context-hosts.js +395 -0
  143. package/cli/dist/lib/context-hosts.js.map +1 -0
  144. package/cli/dist/lib/context-refresh.d.ts +60 -0
  145. package/cli/dist/lib/context-refresh.d.ts.map +1 -0
  146. package/cli/dist/lib/context-refresh.js +630 -0
  147. package/cli/dist/lib/context-refresh.js.map +1 -0
  148. package/cli/dist/lib/module-resolver.d.ts.map +1 -1
  149. package/cli/dist/lib/module-resolver.js +2 -2
  150. package/cli/dist/lib/module-resolver.js.map +1 -1
  151. package/cli/dist/types/gui.d.ts +4 -0
  152. package/cli/dist/types/gui.d.ts.map +1 -1
  153. package/cli/dist/utils/coordination-queries.js +2 -2
  154. package/cli/dist/utils/coordination-queries.js.map +1 -1
  155. package/cli/dist/utils/decision-runner.d.ts +20 -0
  156. package/cli/dist/utils/decision-runner.d.ts.map +1 -0
  157. package/cli/dist/utils/decision-runner.js +114 -0
  158. package/cli/dist/utils/decision-runner.js.map +1 -0
  159. package/cli/dist/utils/extensions-config.d.ts.map +1 -1
  160. package/cli/dist/utils/extensions-config.js +3 -1
  161. package/cli/dist/utils/extensions-config.js.map +1 -1
  162. package/cli/dist/utils/extractCommandHelp.d.ts +2 -2
  163. package/cli/dist/utils/extractCommandHelp.d.ts.map +1 -1
  164. package/cli/dist/utils/extractCommandHelp.js +54 -24
  165. package/cli/dist/utils/extractCommandHelp.js.map +1 -1
  166. package/cli/dist/utils/file-tracking.js +5 -5
  167. package/cli/dist/utils/file-tracking.js.map +1 -1
  168. package/cli/dist/utils/glob-match.d.ts +6 -0
  169. package/cli/dist/utils/glob-match.d.ts.map +1 -0
  170. package/cli/dist/utils/glob-match.js +8 -0
  171. package/cli/dist/utils/glob-match.js.map +1 -0
  172. package/cli/dist/utils/gui-helpers.d.ts.map +1 -1
  173. package/cli/dist/utils/gui-helpers.js +7 -3
  174. package/cli/dist/utils/gui-helpers.js.map +1 -1
  175. package/cli/dist/utils/mcp-integration.d.ts.map +1 -1
  176. package/cli/dist/utils/mcp-integration.js +5 -7
  177. package/cli/dist/utils/mcp-integration.js.map +1 -1
  178. package/cli/dist/utils/module-system.d.ts +14 -0
  179. package/cli/dist/utils/module-system.d.ts.map +1 -1
  180. package/cli/dist/utils/module-system.js +39 -13
  181. package/cli/dist/utils/module-system.js.map +1 -1
  182. package/cli/dist/utils/modules-catalog.d.ts.map +1 -1
  183. package/cli/dist/utils/modules-catalog.js +5 -0
  184. package/cli/dist/utils/modules-catalog.js.map +1 -1
  185. package/cli/dist/utils/process.d.ts +14 -0
  186. package/cli/dist/utils/process.d.ts.map +1 -0
  187. package/cli/dist/utils/process.js +57 -0
  188. package/cli/dist/utils/process.js.map +1 -0
  189. package/cli/dist/utils/version.d.ts +2 -0
  190. package/cli/dist/utils/version.d.ts.map +1 -0
  191. package/cli/dist/utils/version.js +8 -0
  192. package/cli/dist/utils/version.js.map +1 -0
  193. package/cli/dist/utils/vscode-editor.d.ts.map +1 -1
  194. package/cli/dist/utils/vscode-editor.js +14 -8
  195. package/cli/dist/utils/vscode-editor.js.map +1 -1
  196. package/modules.md +85 -6
  197. package/package.json +36 -16
  198. package/scripts/check-wsl-augx.sh +63 -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`.
@@ -0,0 +1,91 @@
1
+ {
2
+ "name": "cross-platform",
3
+ "version": "1.0.0",
4
+ "displayName": "Cross-Platform Distribution Workflow",
5
+ "description": "Day-to-day guide for distributing Augx extension modules into Claude Code, Cursor, Windsurf, and GitHub Copilot via 'augx export' and 'augx link --mirror'. Covers per-tool target paths, drift resolution, Windows symlink fallback, and the MCP-first task-context contract.",
6
+ "type": "workflows",
7
+ "tags": [
8
+ "augx",
9
+ "cli",
10
+ "cross-platform",
11
+ "claude-code",
12
+ "cursor",
13
+ "windsurf",
14
+ "copilot",
15
+ "interoperability",
16
+ "export",
17
+ "mirror",
18
+ "symlink",
19
+ "workflow"
20
+ ],
21
+ "dependencies": [],
22
+ "augment": {
23
+ "characterCount": 40880,
24
+ "priority": "medium",
25
+ "category": "workflows",
26
+ "appliesTo": {
27
+ "filePatterns": [
28
+ "CLAUDE.md",
29
+ ".claude/rules/**/*",
30
+ ".cursor/rules/**/*",
31
+ ".windsurfrules",
32
+ ".windsurf/rules/**/*",
33
+ ".github/copilot-instructions.md",
34
+ ".github/instructions/**/*",
35
+ ".augment/coordination.json"
36
+ ],
37
+ "languages": ["markdown", "json"],
38
+ "domains": [
39
+ "website",
40
+ "web-app",
41
+ "os-application",
42
+ "linux",
43
+ "windows",
44
+ "dotnet",
45
+ "mobile",
46
+ "ai-prompt-helper"
47
+ ]
48
+ }
49
+ },
50
+ "installation": {
51
+ "required": false,
52
+ "steps": [
53
+ "Link module: augx link workflows/cross-platform",
54
+ "Read rules/export-guide.md for 'augx export' usage",
55
+ "Read rules/mirror-guide.md for 'augx link --mirror' usage",
56
+ "Read rules/drift-resolution.md when 'augx export' exits 3",
57
+ "Read rules/windows-fallback.md when running on Windows without Developer Mode"
58
+ ]
59
+ },
60
+ "features": {
61
+ "export_command": {
62
+ "enabled": true,
63
+ "description": "Aggregate linked modules into the native single-file format of Claude Code, Cursor, Windsurf, or GitHub Copilot."
64
+ },
65
+ "mirror_hook": {
66
+ "enabled": true,
67
+ "description": "Per-module materialization into each tool's per-module rules directory with symlink-or-copy semantics."
68
+ },
69
+ "drift_resolution": {
70
+ "enabled": true,
71
+ "description": "Playbook for resolving the 'exit 3 / hand-edited target' refusal from 'augx export'."
72
+ },
73
+ "windows_fallback": {
74
+ "enabled": true,
75
+ "description": "Documented EPERM/EACCES/ENOSYS fallback from symlink to copy, recorded once in coordination.mirrors."
76
+ },
77
+ "mcp_task_context": {
78
+ "enabled": true,
79
+ "description": "MCP-first contract: exported files contain zero live task data; agents query the Beads MCP server instead."
80
+ }
81
+ },
82
+ "contents": [
83
+ "README.md - Module overview, quick reference, per-tool target paths.",
84
+ "rules/export-guide.md - Day-to-day 'augx export' usage and flags.",
85
+ "rules/mirror-guide.md - Day-to-day 'augx link --mirror' usage and flags.",
86
+ "rules/drift-resolution.md - Recovering from 'exit 3' drift refusal.",
87
+ "rules/windows-fallback.md - Symlink-to-copy fallback behavior on Windows.",
88
+ "rules/mcp-snippet-inlining.md - When and how the Beads MCP snippet is inlined.",
89
+ "examples/end-to-end-session.md - Walkthrough of a full link -> mirror -> export -> unlink session."
90
+ ]
91
+ }
@@ -0,0 +1,126 @@
1
+ # Drift Resolution Playbook
2
+
3
+ ## Symptom
4
+
5
+ ```
6
+ $ augx export --target claude-code
7
+ error: CLAUDE.md has been hand-edited since the last 'augx export'.
8
+ (banner source-hash 'a1b2c3d4...' does not match body hash 'e5f6a7b8...')
9
+ Pass --force to overwrite, or edit module sources and re-run.
10
+ $ echo $?
11
+ 3
12
+ ```
13
+
14
+ `augx export` refuses to overwrite a target file when the banner's recorded `source-hash` does not match a freshly-computed hash of the body. This protects manual edits from being silently clobbered.
15
+
16
+ ## Why Drift Happens
17
+
18
+ | Cause | How It Got There |
19
+ |---|---|
20
+ | Local edit | A human (or another tool) modified the exported file directly. |
21
+ | Different `augx` version | A teammate ran `augx export` from a version with a different rendering pipeline; their banner hash will not match yours after upgrade. |
22
+ | Module mutation outside augx | Files under `augment-extensions/` were edited but `augx export` was not re-run on the original machine. |
23
+ | Merge conflict | A `git merge` left mixed content from two branches inside the exported file. |
24
+
25
+ ## Resolution Decision Tree
26
+
27
+ ```
28
+ Did the exported file change for a real reason?
29
+ ├── No (accidental save, stale clone)
30
+ │ └── git checkout HEAD -- <path-to-exported-file>
31
+ │ Then re-run 'augx export'.
32
+ │
33
+ ├── Yes, the edits should be reflected in modules
34
+ │ └── Move the edits into augment-extensions/<category>/<module>/rules/<file>.md
35
+ │ Run 'augx export' again.
36
+ │ The new banner hash will match the new body.
37
+ │
38
+ └── Yes, but the edits are intentionally local (one-off override)
39
+ └── Run 'augx export --force'.
40
+ Confirm the local edits are gone, then add the override
41
+ somewhere outside the augx-managed file (e.g., .augment/rules/).
42
+ ```
43
+
44
+ ## Recommended Sequence
45
+
46
+ ### Step 1: Inspect
47
+
48
+ ```bash
49
+ git diff CLAUDE.md
50
+ ```
51
+
52
+ Look at what changed. If git also shows changes under `augment-extensions/`, those are the upstream source; the exported diff is downstream.
53
+
54
+ ### Step 2: Decide where the change belongs
55
+
56
+ - **Belongs in a module**: move the edit into the module's `rules/*.md`, commit, then re-export.
57
+ - **Belongs nowhere** (a stray edit, copy/paste mistake): discard with `git checkout`.
58
+ - **Belongs only locally**: accept the loss by running with `--force`, then re-add the local override outside the augx-managed file.
59
+
60
+ ### Step 3: Re-export
61
+
62
+ ```bash
63
+ augx export --target claude-code
64
+ ```
65
+
66
+ Verify exit code 0. The new banner records the new source hash.
67
+
68
+ ### Step 4: Validate
69
+
70
+ ```bash
71
+ augx export --target claude-code --dry-run
72
+ ```
73
+
74
+ Should report `(no-op)` or zero bytes changed.
75
+
76
+ ## Bypassing Drift Detection
77
+
78
+ ```bash
79
+ augx export --target claude-code --force
80
+ ```
81
+
82
+ `--force` writes regardless of drift. Use only after one of:
83
+
84
+ - You have already moved the edits into modules and just want the canonical file to refresh.
85
+ - You are intentionally discarding the local edits.
86
+ - You are running in CI where the drift is known to be from an `augx` version bump.
87
+
88
+ Do NOT use `--force` reflexively. Drift refusal is a feature; it is the only thing standing between an `augx` re-run and silent data loss.
89
+
90
+ ## CI Recipe
91
+
92
+ In CI, the typical sequence is:
93
+
94
+ ```bash
95
+ augx export --target all --dry-run # see what would change
96
+ augx export --target all # write only if no drift
97
+ test $? -eq 0
98
+ ```
99
+
100
+ If CI hits exit 3, it should fail loudly rather than silently `--force`. Drift in CI usually means a stale checkout or a forgotten commit; investigate before forcing.
101
+
102
+ ## Per-Tool Considerations
103
+
104
+ | Tool | Drift Manifests As |
105
+ |---|---|
106
+ | `claude-code` (`CLAUDE.md`) | Comment-stripping by editors (some IDEs auto-format HTML comments). |
107
+ | `cursor` (`.cursor/rules/augx.mdc`) | YAML frontmatter being reformatted (key order changes). |
108
+ | `windsurf` (`.windsurfrules`) | Trailing-whitespace fixes from editor save-on-format. |
109
+ | `copilot` (`.github/copilot-instructions.md`) | GitHub's web editor adding a trailing newline. |
110
+
111
+ The banner is content-stable across whitespace edits **inside the body** (the hash is computed over the body excluding the banner), but a single character change does invalidate the recorded hash. If your editor cannot be told to leave the file alone, consider adding it to `.gitattributes`:
112
+
113
+ ```
114
+ CLAUDE.md text eol=lf -text-conversion
115
+ .cursor/rules/** text eol=lf -text-conversion
116
+ .windsurfrules text eol=lf -text-conversion
117
+ ```
118
+
119
+ ## When To Escalate
120
+
121
+ If `augx export` keeps exiting 3 on a clean checkout and a re-run from a known-good `augx` version, file a Beads task. The expected invariants:
122
+
123
+ - Two runs from the same `augx` version on the same modules MUST produce identical banner and body hashes.
124
+ - A no-op re-run MUST exit 0 with no writes.
125
+
126
+ A reproducible violation is a bug in the export pipeline, not a drift condition.
@@ -0,0 +1,139 @@
1
+ # `augx export` Day-to-Day Guide
2
+
3
+ ## Purpose
4
+
5
+ `augx export` collects every linked Augx module's `rules/` content and writes it into the **single aggregated file** that one or more target tools expect.
6
+
7
+ ## Grammar
8
+
9
+ ```
10
+ augx export --target <claude-code|cursor|windsurf|copilot|all>
11
+ [--output <path>]
12
+ [--dry-run]
13
+ [--force]
14
+ [--verbose]
15
+ ```
16
+
17
+ ## Flags
18
+
19
+ | Flag | Default | Purpose |
20
+ |---|---|---|
21
+ | `--target` | (reads `.augment/coordination.json.export.targets`) | Pick the destination tool. Use `all` to write every target in one invocation. |
22
+ | `--output` | per-target conventional path | Override the destination path. Valid only with a single `--target`. |
23
+ | `--dry-run` | `false` | Print the resolved file list, projected byte counts, and module counts. No writes. |
24
+ | `--force` | `false` | Overwrite even if drift is detected (exit code 3). Use only after reviewing the diff. |
25
+ | `--verbose` | `false` | Print per-module sizes and mirror/symlink decisions. |
26
+
27
+ If `--target` is omitted **and** `.augment/coordination.json.export.targets` is empty or missing, `augx export` exits non-zero with a usage error.
28
+
29
+ ## What Each Run Does
30
+
31
+ 1. Reads `.augment/coordination.json` (and `.vscode/mcp.json`, `.augment/mcp/servers.json` for the MCP snippet check).
32
+ 2. Loads every linked module, applies `export.ignore` glob patterns, computes a deterministic source hash.
33
+ 3. Renders the aggregated content for each requested target.
34
+ 4. Reads the existing target file (if any). If the banner's `source-hash` does not match the recomputed body hash, exits 3 (drift refusal). See `drift-resolution.md`.
35
+ 5. If the new content is byte-identical to the existing content, exits 0 without writing (no-op).
36
+ 6. Otherwise writes the new content with LF line endings.
37
+
38
+ ## Output Anatomy
39
+
40
+ Every exported file begins with a banner:
41
+
42
+ ```
43
+ <!-- GENERATED BY augx export - DO NOT EDIT -->
44
+ <!-- augx-version: <semver> -->
45
+ <!-- generated-at: <ISO-8601> -->
46
+ <!-- source-hash: <16-hex> -->
47
+ <!-- modules: <id>@<ver>, ... -->
48
+ ```
49
+
50
+ Followed (when the Beads MCP server is declared) by the inlined MCP snippet, then per-module sections in **alphabetical order by module ID**, then a footer.
51
+
52
+ For Cursor, a YAML frontmatter precedes the banner:
53
+
54
+ ```yaml
55
+ ---
56
+ description: Augx aggregated rules
57
+ alwaysApply: true
58
+ ---
59
+ ```
60
+
61
+ ## Typical Workflows
62
+
63
+ ### First export in a project
64
+
65
+ ```bash
66
+ augx link coding-standards/typescript
67
+ augx link workflows/cross-platform
68
+ augx export --target cursor
69
+ # writes .cursor/rules/augx.mdc with both modules
70
+ ```
71
+
72
+ ### Multi-target export
73
+
74
+ ```bash
75
+ augx export --target all
76
+ ```
77
+
78
+ Writes `CLAUDE.md`, `.cursor/rules/augx.mdc`, `.windsurfrules`, and `.github/copilot-instructions.md` in one pass. Each is computed independently; a failure on one target does not abort the others (per-target exit status is summarized at the end).
79
+
80
+ ### Preview before writing
81
+
82
+ ```bash
83
+ augx export --target all --dry-run
84
+ ```
85
+
86
+ Output:
87
+
88
+ ```
89
+ [dry-run] claude-code -> CLAUDE.md (12_345 bytes, 7 modules)
90
+ [dry-run] cursor -> .cursor/rules/augx.mdc (13_010 bytes, 7 modules)
91
+ [dry-run] windsurf -> .windsurfrules (12_120 bytes, 7 modules)
92
+ [dry-run] copilot -> .github/copilot-instructions.md (12_405 bytes, 7 modules)
93
+ ```
94
+
95
+ ### Default-target setup
96
+
97
+ Add to `.augment/coordination.json`:
98
+
99
+ ```json
100
+ {
101
+ "export": {
102
+ "targets": ["claude-code", "cursor"],
103
+ "ignore": ["**/examples/**", "**/CHANGELOG.md"]
104
+ }
105
+ }
106
+ ```
107
+
108
+ After this, plain `augx export` writes both files. `export.targets` is the canonical place to record team conventions.
109
+
110
+ ## Exit Codes
111
+
112
+ | Code | Meaning | Action |
113
+ |---|---|---|
114
+ | 0 | Success (including no-op) | Continue. |
115
+ | 1 | Usage error (missing/unknown `--target`, conflicting flags) | Fix the command. |
116
+ | 2 | Resolution error (no linked modules, broken module manifest) | Verify `augx list --linked`. |
117
+ | 3 | Drift refusal (target was hand-edited) | See `drift-resolution.md`. |
118
+ | 4 | I/O error (cannot write inside project root, permission denied) | Check filesystem permissions. |
119
+
120
+ ## Idempotency Invariants
121
+
122
+ - **Same inputs -> byte-identical output.** The timestamp in the banner is only refreshed when the source hash changes; a no-op run leaves the file untouched.
123
+ - **Module order is canonicalized.** Modules are sorted by ID before rendering, so reordering `augx link` calls does not change the output.
124
+ - **Paths in content are forward-slash** regardless of host OS.
125
+ - **Line endings are LF** regardless of host OS.
126
+
127
+ ## Safety Rules
128
+
129
+ - `augx export` never writes outside the project root.
130
+ - It never follows symlinks out of `augment-extensions/` while resolving sources.
131
+ - It does not call out to Beads, the MCP server, or the network.
132
+ - It never touches `.augment/` rules; the Augment Code surface stays as-is.
133
+
134
+ ## What `augx export` Does NOT Do
135
+
136
+ - Does not embed live task state (`bd-` IDs, statuses, dependency lists).
137
+ - Does not modify `augment-extensions/` content.
138
+ - Does not write per-module mirror files; that is `augx link --mirror`'s job.
139
+ - Does not delete files; only overwrites the target path or refuses (exit 3).