@lifesavertech/archguard-guidance 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,6 +4,6 @@ Generates `AGENTS.md` and `.archguard/ARCHITECTURE_RULES.md` from `architecture.
4
4
 
5
5
  Most users should install `@lifesavertech/archguard-cli` rather than depending on this package directly.
6
6
 
7
- v2.2 will add `archguard sync` to keep guidance files aligned with config.
7
+ `archguard sync` keeps guidance files aligned with `architecture.yaml`.
8
8
 
9
9
  Documentation: [github.com/lindseystead/ArchGuard](https://github.com/lindseystead/ArchGuard)
package/dist/index.d.ts CHANGED
@@ -2,3 +2,5 @@
2
2
  import { ArchitectureConfig } from "@lifesavertech/archguard-core";
3
3
  export declare function generateEditorGuide(architecture: ArchitectureConfig): string;
4
4
  export declare function generateAgentsGuide(architecture: ArchitectureConfig): string;
5
+ export declare function generateCursorRules(architecture: ArchitectureConfig): string;
6
+ export declare function generateCopilotInstructions(architecture: ArchitectureConfig): string;
package/dist/index.js CHANGED
@@ -3,6 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.generateEditorGuide = generateEditorGuide;
5
5
  exports.generateAgentsGuide = generateAgentsGuide;
6
+ exports.generateCursorRules = generateCursorRules;
7
+ exports.generateCopilotInstructions = generateCopilotInstructions;
6
8
  const archguard_core_1 = require("@lifesavertech/archguard-core");
7
9
  function generateEditorGuide(architecture) {
8
10
  const layerDescriptions = buildLayerDescriptions(architecture);
@@ -68,6 +70,53 @@ ${rules.join("\n")}
68
70
  These instructions are reference material for tooling and contributors. The enforceable source of truth is \`architecture.yaml\`, and validation happens through the ArchGuard CLI.
69
71
  `;
70
72
  }
73
+ function generateCursorRules(architecture) {
74
+ const layerDescriptions = buildLayerDescriptions(architecture);
75
+ const rules = buildRuleDescriptions(architecture);
76
+ return `---
77
+ description: ArchGuard layer boundaries for this repository
78
+ alwaysApply: true
79
+ ---
80
+
81
+ # ArchGuard architecture rules
82
+
83
+ Treat \`architecture.yaml\` as the enforceable source of truth. Run \`archguard check\` before finishing structural changes.
84
+
85
+ ## Layers
86
+
87
+ ${layerDescriptions}
88
+
89
+ ${buildUiLayerDescription(architecture)}
90
+
91
+ ## Constraints
92
+
93
+ ${rules.join("\n")}
94
+
95
+ ## When editing code
96
+
97
+ - Do not add imports that violate layer boundaries.
98
+ - Move shared logic to an allowed layer instead of bypassing rules.
99
+ - After changing \`architecture.yaml\`, run \`archguard sync\`.
100
+ `;
101
+ }
102
+ function generateCopilotInstructions(architecture) {
103
+ const layerDescriptions = buildLayerDescriptions(architecture);
104
+ const rules = buildRuleDescriptions(architecture);
105
+ return `# Copilot instructions (ArchGuard)
106
+
107
+ This repository enforces architecture with ArchGuard. Source of truth: \`architecture.yaml\`.
108
+
109
+ ## Layers
110
+
111
+ ${layerDescriptions}
112
+
113
+ ## Rules
114
+
115
+ ${rules.join("\n")}
116
+
117
+ When suggesting code changes, respect layer import boundaries and run \`archguard check\` for structural edits.
118
+ `;
119
+ }
71
120
  function buildLayerDescriptions(architecture) {
72
121
  return Object.keys(architecture.layers)
73
122
  .map((layer) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifesavertech/archguard-guidance",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Project guidance document generator for ArchGuard",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  "test": "npm run build:test && node --test dist-test/index.test.js"
26
26
  },
27
27
  "dependencies": {
28
- "@lifesavertech/archguard-core": "2.0.1",
28
+ "@lifesavertech/archguard-core": "2.2.0",
29
29
  "yaml": "^2.3.0"
30
30
  },
31
31
  "devDependencies": {