archgate 0.3.0 → 0.5.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.
package/README.md CHANGED
@@ -33,7 +33,9 @@ Archgate has two layers:
33
33
 
34
34
  When a rule is violated, `archgate check` reports the file, line, and which ADR was broken. Exit code 1 means violations — wire it into CI and it blocks merges automatically.
35
35
 
36
- **The AI integration layer** is a Claude Code plugin that gives AI agents live access to your ADRs through the MCP server (`archgate mcp`). Agents read the decisions before writing code, validate changes after, and capture new patterns into the governance base. Archgate ships as its own governance subject — its own development is governed by the ADRs in `.archgate/adrs/`.
36
+ **The CLI is free and open source.** Writing ADRs, enforcing rules, running checks in CI, and wiring up pre-commit hooks all work without an account or subscription.
37
+
38
+ **Editor plugins are an optional paid add-on** for teams that want AI agents (Claude Code, Cursor) to read ADRs, validate changes, and capture new patterns automatically. Plugins are distributed from [plugins.archgate.dev](https://plugins.archgate.dev). See [Editor plugins](#editor-plugins) for details.
37
39
 
38
40
  ## Installation
39
41
 
@@ -41,7 +43,7 @@ When a rule is violated, `archgate check` reports the file, line, and which ADR
41
43
  npm install -g archgate
42
44
  ```
43
45
 
44
- **Requirements:** macOS (arm64) or Linux (x86_64). Node.js is only needed to run the wrapper — the CLI itself is a standalone binary.
46
+ **Requirements:** macOS (arm64), Linux (x86_64), or Windows (x86_64). Node.js is only needed to run the wrapper — the CLI itself is a standalone binary.
45
47
 
46
48
  > **Using [proto](https://moonrepo.dev/proto)?** Add the following to `~/.proto/config.toml` and your shell profile so globals persist across Node.js version switches:
47
49
  >
@@ -76,7 +78,9 @@ archgate init
76
78
  archgate check
77
79
  ```
78
80
 
79
- `archgate init` creates the `.archgate/adrs/` directory, an example ADR with a companion rules file to show the pattern, and configures the Claude Code plugin if you use it.
81
+ `archgate init` creates the `.archgate/adrs/` directory with an example ADR and rules file, and configures editor settings. No account or login is needed — the CLI is fully functional without plugins.
82
+
83
+ **Want AI agent integration?** See [Editor plugins](#editor-plugins) to add the optional paid plugin for Claude Code or Cursor.
80
84
 
81
85
  ## Writing rules
82
86
 
@@ -117,15 +121,37 @@ Rules receive the list of files to check (filtered by the ADR's `files` glob if
117
121
 
118
122
  ## Commands
119
123
 
124
+ ### `archgate login`
125
+
126
+ Authenticate with GitHub to access the optional paid editor plugins.
127
+
128
+ ```bash
129
+ archgate login # authenticate via GitHub Device Flow
130
+ archgate login status # show current auth status
131
+ archgate login logout # remove stored credentials
132
+ archgate login refresh # re-authenticate and claim a new token
133
+ ```
134
+
135
+ Opens a browser-based GitHub Device Flow. Once authorized, an archgate plugin token is stored in `~/.archgate/credentials`. This token is used by `archgate init` to install the editor plugin. Not required for CLI-only usage.
136
+
120
137
  ### `archgate init`
121
138
 
122
139
  Initialize governance in the current project.
123
140
 
124
141
  ```bash
125
- archgate init
142
+ archgate init # Claude Code (default)
143
+ archgate init --editor cursor # Cursor
144
+ archgate init --install-plugin # force plugin install attempt
126
145
  ```
127
146
 
128
- Creates `.archgate/adrs/` with an example ADR and rules file, and optionally wires up the Claude Code plugin.
147
+ Creates `.archgate/adrs/` with an example ADR and rules file and configures editor settings. Works without an account — plugin installation only happens when you are logged in.
148
+
149
+ **Plugin install behavior** (optional — requires `archgate login`):
150
+
151
+ - If you are logged in, init auto-detects your credentials and installs the plugin.
152
+ - For **Claude Code**: if the `claude` CLI is on PATH, the plugin is installed automatically via `claude plugin marketplace add` and `claude plugin install`. If not, the manual commands are printed.
153
+ - For **Cursor**: the plugin bundle is downloaded from [plugins.archgate.dev](https://plugins.archgate.dev) and extracted into `.cursor/`.
154
+ - Use `--install-plugin` to explicitly request plugin installation (useful if auto-detection is skipped).
129
155
 
130
156
  ### `archgate check`
131
157
 
@@ -183,7 +209,7 @@ Start the MCP server for AI agent integration.
183
209
  archgate mcp
184
210
  ```
185
211
 
186
- Exposes four tools to MCP-compatible clients (Claude Code, Cursor, etc.):
212
+ Exposes five tools to MCP-compatible clients (Claude Code, Cursor, etc.):
187
213
 
188
214
  | Tool | Description |
189
215
  | ----------------------------- | ----------------------------------------------------------------- |
@@ -191,6 +217,7 @@ Exposes four tools to MCP-compatible clients (Claude Code, Cursor, etc.):
191
217
  | `list_adrs` | List all ADRs with metadata |
192
218
  | `review_context` | Get changed files grouped by domain with applicable ADR briefings |
193
219
  | `claude_code_session_context` | Read the current Claude Code session transcript |
220
+ | `cursor_session_context` | Read Cursor agent session transcripts |
194
221
 
195
222
  Also exposes `adr://{id}` resources for reading individual ADRs by ID.
196
223
 
@@ -229,15 +256,41 @@ pre-commit:
229
256
  run: archgate check --staged
230
257
  ```
231
258
 
232
- ## Claude Code plugin
259
+ ## Editor plugins
260
+
261
+ > **Plugins are an optional paid add-on.** The CLI works fully without them. Plugins add AI agent integration — your AI coding agent reads ADRs before writing code, validates changes after implementation, and captures new patterns back into ADRs.
262
+
263
+ Plugins are distributed from [plugins.archgate.dev](https://plugins.archgate.dev).
264
+
265
+ ### Setup
266
+
267
+ ```bash
268
+ # 1. Log in (one-time) — links your GitHub account and issues a plugin token
269
+ archgate login
270
+
271
+ # 2. Initialize a project with the plugin
272
+ archgate init # Claude Code (default)
273
+ archgate init --editor cursor # or Cursor
274
+ ```
275
+
276
+ If you are logged in, `archgate init` auto-detects your credentials and installs the plugin. You can also pass `--install-plugin` explicitly.
277
+
278
+ ### Claude Code
279
+
280
+ If the `claude` CLI is on your PATH, the plugin is installed automatically. Otherwise, run the printed commands manually:
281
+
282
+ ```bash
283
+ claude plugin marketplace add https://<user>:<token>@plugins.archgate.dev/archgate.git
284
+ claude plugin install archgate@archgate
285
+ ```
286
+
287
+ Once installed, run `archgate:onboard` in Claude Code to initialize governance for your project.
233
288
 
234
- The Claude Code plugin (`archgate:developer`) gives AI agents a full governance workflow:
289
+ ### Cursor
235
290
 
236
- - Reads applicable ADRs before writing code
237
- - Validates changes after implementation
238
- - Captures new patterns back into ADRs
291
+ The Cursor plugin bundle is downloaded from [plugins.archgate.dev](https://plugins.archgate.dev) and extracted into `.cursor/` automatically.
239
292
 
240
- Install the plugin from [archgate/claude-code-plugin](https://github.com/archgate/claude-code-plugin), then run `archgate:onboard` once in your project to initialize governance.
293
+ Once installed, run the `ag-onboard` skill in Cursor to initialize governance for your project.
241
294
 
242
295
  ## Contributing
243
296
 
package/bin/archgate.cjs CHANGED
@@ -9,16 +9,18 @@ function getPlatformPackageName() {
9
9
  const { platform, arch } = process;
10
10
  if (platform === "darwin" && arch === "arm64") return "archgate-darwin-arm64";
11
11
  if (platform === "linux" && arch === "x64") return "archgate-linux-x64";
12
+ if (platform === "win32" && arch === "x64") return "archgate-win32-x64";
12
13
  throw new Error(
13
- `Unsupported platform: ${platform}/${arch}\narchgate supports darwin/arm64 and linux/x64 only.`
14
+ `Unsupported platform: ${platform}/${arch}\narchgate supports darwin/arm64, linux/x64, and win32/x64.`
14
15
  );
15
16
  }
16
17
 
17
18
  function getBinaryPath() {
18
19
  const pkgName = getPlatformPackageName();
20
+ const binaryName = process.platform === "win32" ? "archgate.exe" : "archgate";
19
21
  try {
20
22
  const pkgDir = path.dirname(require.resolve(`${pkgName}/package.json`));
21
- const binaryPath = path.join(pkgDir, "bin", "archgate");
23
+ const binaryPath = path.join(pkgDir, "bin", binaryName);
22
24
  if (fs.existsSync(binaryPath)) return binaryPath;
23
25
  } catch {
24
26
  /* platform package not installed */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archgate",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Enforce Architecture Decision Records as executable rules — for both humans and AI agents",
5
5
  "readme": "README.md",
6
6
  "license": "FSL-1.1-ALv2",
@@ -33,7 +33,8 @@
33
33
  },
34
34
  "os": [
35
35
  "darwin",
36
- "linux"
36
+ "linux",
37
+ "win32"
37
38
  ],
38
39
  "scripts": {
39
40
  "cli": "bun run src/cli.ts",
@@ -44,35 +45,34 @@
44
45
  "format:check": "prettier --check .",
45
46
  "test": "bun test --timeout 60000",
46
47
  "test:watch": "bun test --watch --timeout 60000",
47
- "build:check": "bun build src/cli.ts --compile --bytecode --outfile dist/.build-check && rm -f dist/.build-check",
48
+ "build:check": "bun build src/cli.ts --compile --bytecode --outfile dist/.build-check && rm -f dist/.build-check dist/.build-check.exe",
48
49
  "validate": "bun run lint && bun run typecheck && bun run format:check && bun test && bun run check && bun run build:check",
49
50
  "commit": "cz",
50
51
  "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
51
52
  },
52
53
  "type": "module",
53
- "dependencies": {
54
- "@commander-js/extra-typings": "14.0.0",
55
- "@modelcontextprotocol/sdk": "1.26.0",
56
- "inquirer": "12.9.4",
57
- "zod": "4.3.6"
58
- },
59
54
  "devDependencies": {
55
+ "@commander-js/extra-typings": "14.0.0",
60
56
  "@commitlint/cli": "19.8.1",
61
57
  "@commitlint/config-conventional": "19.8.1",
62
58
  "@commitlint/cz-commitlint": "19.8.1",
59
+ "@modelcontextprotocol/sdk": "1.26.0",
63
60
  "@simple-release/npm": "2.3.0",
64
61
  "@types/bun": "1.3.9",
65
62
  "commitizen": "4.3.1",
66
63
  "conventional-changelog": "7.1.1",
67
64
  "conventional-changelog-angular": "8.0.0",
65
+ "inquirer": "12.9.4",
68
66
  "oxlint": "1.14.0",
69
- "prettier": "3.6.2"
67
+ "prettier": "3.6.2",
68
+ "zod": "4.3.6"
70
69
  },
71
70
  "peerDependencies": {
72
71
  "typescript": "^5"
73
72
  },
74
73
  "optionalDependencies": {
75
74
  "archgate-darwin-arm64": ">=0.1.1",
76
- "archgate-linux-x64": ">=0.1.1"
75
+ "archgate-linux-x64": ">=0.1.1",
76
+ "archgate-win32-x64": ">=0.1.1"
77
77
  }
78
78
  }
@@ -1,5 +1,3 @@
1
- import { z } from "zod";
2
-
3
1
  // --- Severity ---
4
2
 
5
3
  export type Severity = "error" | "warning" | "info";
@@ -63,20 +61,6 @@ export type RuleSet = {
63
61
  rules: Record<string, RuleConfig>;
64
62
  };
65
63
 
66
- export const RuleSetSchema = z.object({
67
- rules: z.record(
68
- z.string(),
69
- z.object({
70
- description: z.string(),
71
- severity: z.enum(["error", "warning", "info"]).optional(),
72
- check: z.custom<(ctx: RuleContext) => Promise<void>>(
73
- (val) => typeof val === "function",
74
- "Expected a function"
75
- ),
76
- })
77
- ),
78
- });
79
-
80
64
  /**
81
65
  * Define rules in a .rules.ts companion file.
82
66
  * Keys become rule IDs, preventing duplicates.