rapidkit 0.29.1 → 0.31.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
@@ -131,6 +131,7 @@ npx rapidkit create # Prompts: workspace | project
131
131
  npx rapidkit create workspace <name> [--profile <profile>] [--author <name>] [--yes]
132
132
  npx rapidkit bootstrap [--profile <profile>] [--json]
133
133
  npx rapidkit setup <python|node|go|java> [--warm-deps]
134
+ npx rapidkit analyze [--workspace <path>] [--json] [--strict] [--output <file>]
134
135
  npx rapidkit readiness [--json] [--strict]
135
136
  npx rapidkit autopilot release [--mode <audit|safe-fix|enforce>] [--json] [--output <file>] [--since <ref>] [--parallel] [--max-workers <n>]
136
137
  ```
@@ -145,6 +146,15 @@ npx rapidkit doctor workspace [--fix] [--plan] [--apply]
145
146
  npx rapidkit doctor project [--fix] [--plan] [--apply]
146
147
  npx rapidkit workspace list # Display all workspaces created on this system
147
148
  npx rapidkit workspace share [--output <file>] [--include-paths] [--no-doctor]
149
+ npx rapidkit workspace contract init [--force] [--json]
150
+ npx rapidkit workspace contract inspect [--json]
151
+ npx rapidkit workspace contract verify [--strict] [--json]
152
+ npx rapidkit workspace contract graph [--json]
153
+ npx rapidkit workspace export --output team-workspace.rapidkit-archive.zip
154
+ npx rapidkit workspace archive inspect team-workspace.rapidkit-archive.zip [--json]
155
+ npx rapidkit workspace archive verify team-workspace.rapidkit-archive.zip [--strict] [--json]
156
+ npx rapidkit workspace archive doctor team-workspace.rapidkit-archive.zip [--strict] [--json]
157
+ npx rapidkit workspace hydrate team-workspace.rapidkit-archive.zip --output ./team-workspace
148
158
  npx rapidkit import <path|git-url> [--workspace <path>] [--name <project-name>] [--git] [--json]
149
159
  npx rapidkit snapshot create [name] [--include-projects] [--reason <text>] [--json]
150
160
  npx rapidkit snapshot list [--json]
@@ -247,6 +257,53 @@ Bundle content includes:
247
257
 
248
258
  `--include-paths` is intended for internal teams only because it includes absolute filesystem paths.
249
259
 
260
+ ### Workspace contract registry
261
+
262
+ Use `workspace contract` when multiple projects in one workspace need a shared source of truth for
263
+ services, ports, APIs, events, owners, dependencies, and required environment variables.
264
+
265
+ ```bash
266
+ npx rapidkit workspace contract init
267
+ npx rapidkit workspace contract inspect
268
+ npx rapidkit workspace contract verify --strict
269
+ npx rapidkit workspace contract graph
270
+ ```
271
+
272
+ The contract is written to `.rapidkit/workspace.contract.json`. It starts from discovered RapidKit
273
+ projects and gives teams a stable place to declare cross-project service contracts. Verification
274
+ checks schema validity, duplicate project slugs, invalid or colliding ports, and dependencies that
275
+ point to unknown projects.
276
+
277
+ RapidKit keeps this contract alive during normal workspace work:
278
+
279
+ - `create project` syncs the contract after successful project creation inside a workspace.
280
+ - `workspace sync` reconciles discovered projects into the contract without overwriting manually declared APIs, events, owners, dependencies, env vars, or custom ports.
281
+ - New projects receive a framework-aware default HTTP port when possible, and the next free port is selected if the default is already claimed.
282
+ - `workspace share` includes the contract snapshot so teammates can inspect service topology before reproducing or importing the workspace.
283
+ - `workspace contract graph` renders the service/dependency/event topology for humans or returns a JSON graph for tools and UI surfaces.
284
+
285
+ ### Portable workspace archives
286
+
287
+ Use `workspace export` when you need to send a full workspace to a teammate or move it to another machine.
288
+ Export excludes dependency folders, build output, git history, logs, `.env` files, and private keys by default.
289
+
290
+ ```bash
291
+ npx rapidkit workspace export --output team-workspace.rapidkit-archive.zip
292
+ npx rapidkit workspace archive inspect team-workspace.rapidkit-archive.zip
293
+ npx rapidkit workspace archive verify team-workspace.rapidkit-archive.zip --strict
294
+ npx rapidkit workspace archive doctor team-workspace.rapidkit-archive.zip
295
+ npx rapidkit workspace hydrate team-workspace.rapidkit-archive.zip --output ./team-workspace
296
+
297
+ # Preview a hydrate without writing files
298
+ npx rapidkit workspace hydrate team-workspace.rapidkit-archive.zip --output ./team-workspace --dry-run
299
+ ```
300
+
301
+ Archives include a RapidKit/Workspai manifest with file sizes and SHA-256 checksums. `workspace hydrate`
302
+ verifies the archive before writing files. Use `workspace archive verify --strict` as a handoff or CI gate,
303
+ and `workspace archive doctor` when you want human-readable readiness/security guidance before a teammate
304
+ imports the workspace. Use `--include-env` only for trusted internal handoffs when you intentionally need
305
+ environment files inside the archive.
306
+
250
307
  ### Command ownership
251
308
 
252
309
  RapidKit keeps the wrapper boundary explicit so users know which layer owns each action.
@@ -267,6 +324,7 @@ RapidKit keeps the wrapper boundary explicit so users know which layer owns each
267
324
  | `workspace run` | Workspace orchestrator | Stage execution across discovered projects with optional affected-only, blast-radius expansion, and policy-gated pre-checks |
268
325
 
269
326
  Use `npx rapidkit doctor` for a quick host pre-flight, `npx rapidkit doctor project` for a service-level check, and `npx rapidkit doctor workspace` for the full workspace picture.
327
+ Use `npx rapidkit analyze --json` to generate CI-friendly workspace health evidence and save it under `.rapidkit/reports/`.
270
328
  Use `npx rapidkit doctor workspace --plan` or `npx rapidkit doctor project --plan` to preview remediation safely.
271
329
  Use `npx rapidkit doctor workspace --apply` or `npx rapidkit doctor project --apply` for non-interactive remediation runs.
272
330
  Use `npx rapidkit readiness` when you need machine-readable release evidence or strict CI gating.
@@ -474,13 +532,17 @@ npx rapidkit workspace run test --parallel
474
532
  # Test only affected projects since last commit
475
533
  npx rapidkit workspace run test --affected --since HEAD~1
476
534
 
477
- # Test affected + their dependents (requires dependency graph)
535
+ # Test affected + downstream dependents from workspace.contract.json
478
536
  npx rapidkit workspace run test --affected --blast-radius
479
537
 
480
538
  # Build specific projects with custom stages (if defined in .rapidkit/context.json)
481
539
  npx rapidkit workspace run build --json --max-workers 8
482
540
  ```
483
541
 
542
+ `--blast-radius` uses `.rapidkit/workspace.contract.json` when available. It expands direct
543
+ `dependsOn` relationships and event relationships where one project `publishes` an event and another
544
+ project `consumes` it. Legacy `.rapidkit/workspace-dependency-graph.json` remains supported as a fallback.
545
+
484
546
  ### Supported Runtimes & Frameworks
485
547
 
486
548
  | Runtime | Frameworks | Status |
@@ -580,6 +642,14 @@ npm run install:local
580
642
  npx rapidkit --version
581
643
  ```
582
644
 
645
+ > Packaging note: `npm run prepack` will regenerate `data/modules-embeddings.json` from the mock embeddings script before `npm pack` / `npm publish`.
646
+ >
647
+ > If you need to refresh the local test embeddings manually, run:
648
+ >
649
+ > ```bash
650
+ > npm run test:prepare-embeddings
651
+ > ```
652
+
583
653
  ## Troubleshooting
584
654
 
585
655
  ### Quick fixes matrix