workspai 0.45.0 → 0.47.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 (177) hide show
  1. package/README.md +307 -532
  2. package/contracts/agent-customization-pack.v1.json +6 -1
  3. package/contracts/bootstrap-compliance.v1.json +14 -0
  4. package/contracts/cli-runtime-command-inventory.v1.snapshot.json +8 -0
  5. package/contracts/extension-cli-compatibility.v1.json +9 -2
  6. package/contracts/mirror-ops.v1.json +16 -0
  7. package/contracts/published-contract-catalog.v1.json +38 -1
  8. package/contracts/runtime-command-surface.v1.json +190 -7
  9. package/contracts/transparency-evidence.v1.json +13 -0
  10. package/contracts/workspace-archive-capabilities.v1.json +17 -6
  11. package/contracts/workspace-contract.v1.json +78 -0
  12. package/contracts/workspace-intelligence/studio-blocker-handoff.v1.json +4 -0
  13. package/contracts/workspace-intelligence/workspace-context.v1.json +20 -0
  14. package/contracts/workspace-intelligence/workspace-graph-token-efficiency.v1.json +72 -0
  15. package/contracts/workspace-intelligence/workspace-intelligence-run.v1.json +212 -0
  16. package/contracts/workspace-intelligence/workspace-knowledge-graph-change-overlay.v1.json +200 -0
  17. package/contracts/workspace-intelligence/workspace-knowledge-graph.v1.json +260 -0
  18. package/contracts/workspace-intelligence/workspace-knowledge-search.v1.json +60 -0
  19. package/contracts/workspace-intelligence-architecture.v1.json +7 -4
  20. package/contracts/workspace-intelligence-chain.v1.json +51 -4
  21. package/contracts/workspace-share-bundle.v1.json +16 -0
  22. package/dist/analyze-UVXPRGYZ.js +1 -0
  23. package/dist/artifact-remediation-plan-EPALZ2LC.js +3 -0
  24. package/dist/autopilot-release-5BQ6F5L2.js +1 -0
  25. package/dist/chunk-22NJ2ZMG.js +2 -0
  26. package/dist/{chunk-XIVFLY6G.js → chunk-2GHUZDYA.js} +1 -1
  27. package/dist/chunk-2TEDAKP6.js +2 -0
  28. package/dist/chunk-52PBRX7F.js +1 -0
  29. package/dist/chunk-6SWRNA47.js +4 -0
  30. package/dist/chunk-76YOPAOT.js +1 -0
  31. package/dist/chunk-7VLCK5JW.js +1 -0
  32. package/dist/{chunk-DXPU4DDV.js → chunk-BSRVO52Y.js} +92 -78
  33. package/dist/chunk-COARSXRC.js +1 -0
  34. package/dist/chunk-CV5HKU4P.js +1 -0
  35. package/dist/chunk-CW7PGBIQ.js +13 -0
  36. package/dist/{chunk-KU4S7RCM.js → chunk-DV6GJD4K.js} +1 -1
  37. package/dist/chunk-EYJ2CQSK.js +1 -0
  38. package/dist/chunk-FB7SCXAZ.js +1 -0
  39. package/dist/chunk-FPJNWPKU.js +1 -0
  40. package/dist/{chunk-JP25YL3J.js → chunk-FTY7GGXJ.js} +2 -2
  41. package/dist/chunk-FXQJX34Z.js +1 -0
  42. package/dist/{chunk-J4AICQFB.js → chunk-HSGFUKCN.js} +1 -1
  43. package/dist/{chunk-OOOPYUL2.js → chunk-ITCAMC2E.js} +1 -1
  44. package/dist/chunk-KB44JP4M.js +2 -0
  45. package/dist/{chunk-WANW4QA4.js → chunk-KZZ36CK5.js} +1 -1
  46. package/dist/chunk-LNRAB7UY.js +1 -0
  47. package/dist/chunk-MEMHNE7Y.js +80 -0
  48. package/dist/chunk-MER6ZBN2.js +13 -0
  49. package/dist/chunk-NOFM7MNA.js +2 -0
  50. package/dist/chunk-NRYS4CLR.js +2 -0
  51. package/dist/chunk-OA537ZQ5.js +1 -0
  52. package/dist/chunk-PBHP6JNY.js +8 -0
  53. package/dist/chunk-QDWYIRHR.js +8 -0
  54. package/dist/chunk-RWRLFSKW.js +2 -0
  55. package/dist/chunk-SK6XRKGG.js +1 -0
  56. package/dist/chunk-THIOE2PB.js +2 -0
  57. package/dist/chunk-TNQI5VCW.js +36 -0
  58. package/dist/chunk-TWNFECMN.js +2 -0
  59. package/dist/{chunk-2QOWRBQD.js → chunk-U5EZHZBX.js} +1 -1
  60. package/dist/{chunk-K63BSU56.js → chunk-VBSQ7MF6.js} +62 -51
  61. package/dist/chunk-WDKNMTJQ.js +1 -0
  62. package/dist/chunk-YCL3I2JO.js +2 -0
  63. package/dist/chunk-ZDN7RHXJ.js +1 -0
  64. package/dist/chunk-ZM5NQ5Z2.js +1 -0
  65. package/dist/{create-KFR6FLRT.js → create-7JKJDAQV.js} +1 -1
  66. package/dist/doctor-PGPNIS76.js +1 -0
  67. package/dist/{dotnet-webapi-clean-BYUUHX5Y.js → dotnet-webapi-clean-6TVFBTVI.js} +20 -20
  68. package/dist/{gofiber-standard-B6UK5GR7.js → gofiber-standard-2BL7GWZB.js} +1 -1
  69. package/dist/{gogin-standard-BXU44VEM.js → gogin-standard-XGP3KBXA.js} +1 -1
  70. package/dist/index.d.ts +112 -16
  71. package/dist/index.js +198 -195
  72. package/dist/pipeline-IB6ILJSV.js +5 -0
  73. package/dist/{platform-capabilities-YICBF4FA.js → platform-capabilities-2B4QMZXE.js} +1 -1
  74. package/dist/{pythonRapidkitExec-UJYIB6FL.js → pythonRapidkitExec-CVCIK225.js} +1 -1
  75. package/dist/{springboot-standard-PEHDKH2L.js → springboot-standard-JJNUID6M.js} +6 -6
  76. package/dist/workspace-H3QXBFGB.js +1 -0
  77. package/dist/{workspace-agent-sync-G5YVI3BJ.js → workspace-agent-sync-C7SG2Z5W.js} +1 -1
  78. package/dist/workspace-archive-P76EDIUG.js +10 -0
  79. package/dist/{workspace-context-E3UFWL5X.js → workspace-context-BKQBKA4C.js} +1 -1
  80. package/dist/workspace-contract-RPQQBQXR.js +1 -0
  81. package/dist/workspace-dependency-graph-23BI2HG7.js +1 -0
  82. package/dist/workspace-explain-WVN7JH3U.js +1 -0
  83. package/dist/workspace-explain-contract-SEFTVF6J.js +1 -0
  84. package/dist/{workspace-feedback-YY6WQPWQ.js → workspace-feedback-WAID3IOE.js} +1 -1
  85. package/dist/{workspace-foundation-3C2DLCVI.js → workspace-foundation-5OOJEO2D.js} +1 -1
  86. package/dist/workspace-graph-token-efficiency-CFGFCJ5V.js +1 -0
  87. package/dist/{workspace-history-VF3CHDYQ.js → workspace-history-C6OP3IAQ.js} +1 -1
  88. package/dist/workspace-intelligence-VKDL3H2J.js +1 -0
  89. package/dist/workspace-intelligence-runner-LVALAZY7.js +1 -0
  90. package/dist/workspace-knowledge-graph-FE2NTZKV.js +1 -0
  91. package/dist/workspace-knowledge-graph-change-overlay-XG6FC4IX.js +1 -0
  92. package/dist/workspace-knowledge-graph-query-VOSPPH4W.js +1 -0
  93. package/dist/workspace-mcp-serve-KT2I676Z.js +3 -0
  94. package/dist/workspace-model-S33CIB2R.js +1 -0
  95. package/dist/workspace-model-hash-MHXK5MEI.js +1 -0
  96. package/dist/workspace-python-engine-state-2MLKJYQG.js +2 -0
  97. package/dist/workspace-registry-summary-A3YDL63D.js +1 -0
  98. package/dist/workspace-run-M4LNJILC.js +1 -0
  99. package/dist/{workspace-verify-ZNT6JX7D.js → workspace-verify-ZGH3NXAH.js} +1 -1
  100. package/dist/workspace-watch-EVBJTMV7.js +1 -0
  101. package/docs/AI_DYNAMIC_INTEGRATION.md +73 -432
  102. package/docs/AI_EXAMPLES.md +37 -395
  103. package/docs/AI_FEATURES.md +76 -465
  104. package/docs/AI_QUICKSTART.md +49 -209
  105. package/docs/DEVELOPMENT.md +5 -5
  106. package/docs/From Code to Shared Understanding.png +0 -0
  107. package/docs/GLOSSARY.md +60 -0
  108. package/docs/OPEN_SOURCE_USER_SCENARIOS.md +91 -9
  109. package/docs/OPTIMIZATION_GUIDE.md +19 -51
  110. package/docs/PACKAGE_MANAGER_POLICY.md +4 -1
  111. package/docs/README.md +91 -42
  112. package/docs/SECURITY.md +13 -6
  113. package/docs/SETUP.md +6 -3
  114. package/docs/UTILITIES.md +8 -20
  115. package/docs/WORKSPACE_MARKER_SPEC.md +27 -20
  116. package/docs/ci-workflows.md +19 -5
  117. package/docs/commands-reference.md +88 -13
  118. package/docs/config-file-guide.md +67 -246
  119. package/docs/contracts/ARTIFACT_CATALOG.md +78 -36
  120. package/docs/contracts/CLI_LOG_EVENT_STREAM.md +1 -1
  121. package/docs/contracts/README.md +48 -9
  122. package/docs/contracts/RUNTIME_ACCEPTANCE_MATRIX.md +4 -4
  123. package/docs/contracts/RUNTIME_SUPPORT_MATRIX.md +14 -10
  124. package/docs/creating-workspaces-and-projects.md +649 -0
  125. package/docs/doctor-command.md +5 -4
  126. package/docs/examples/ci-agent-grounding.yml +16 -10
  127. package/docs/from-code-to-shared-understanding.md +69 -38
  128. package/docs/graph-benchmark-methodology.md +121 -0
  129. package/docs/workspace-intelligence-runner.md +186 -0
  130. package/docs/workspace-knowledge-graph.md +295 -0
  131. package/docs/workspace-operations.md +78 -11
  132. package/docs/workspace-run.md +4 -1
  133. package/package.json +10 -8
  134. package/rapidkit.config.example.cjs +5 -5
  135. package/scripts/enforce-package-manager.cjs +1 -1
  136. package/scripts/prepack-enterprise.mjs +4 -0
  137. package/workspai.config.example.cjs +12 -47
  138. package/dist/analyze-YLV7NVLF.js +0 -1
  139. package/dist/artifact-remediation-plan-WLZGROUU.js +0 -3
  140. package/dist/autopilot-release-YBN3SWAA.js +0 -1
  141. package/dist/chunk-2K3GYCPS.js +0 -1
  142. package/dist/chunk-42G2OK64.js +0 -1
  143. package/dist/chunk-5AKYMAIL.js +0 -1
  144. package/dist/chunk-5GNT4RJI.js +0 -8
  145. package/dist/chunk-5PVEQ6CZ.js +0 -13
  146. package/dist/chunk-6AA3WWQZ.js +0 -2
  147. package/dist/chunk-6ZENXBMG.js +0 -33
  148. package/dist/chunk-7RIWU5TZ.js +0 -1
  149. package/dist/chunk-7UZVOYF5.js +0 -2
  150. package/dist/chunk-BJLE5CH7.js +0 -4
  151. package/dist/chunk-G3H5R3RR.js +0 -1
  152. package/dist/chunk-HYJK7W3B.js +0 -1
  153. package/dist/chunk-IMUU5Q2V.js +0 -13
  154. package/dist/chunk-KPPGZCUW.js +0 -78
  155. package/dist/chunk-LCRROMRR.js +0 -2
  156. package/dist/chunk-LG6RFLPZ.js +0 -1
  157. package/dist/chunk-P424XYHP.js +0 -1
  158. package/dist/chunk-P7SCWJFG.js +0 -8
  159. package/dist/chunk-QWU2CZBG.js +0 -2
  160. package/dist/chunk-V2H2KRMZ.js +0 -1
  161. package/dist/chunk-XZGVNGRB.js +0 -1
  162. package/dist/chunk-ZWO6K24C.js +0 -2
  163. package/dist/doctor-YJDM5XBH.js +0 -1
  164. package/dist/imported-projects-registry-FOIE27WT.js +0 -1
  165. package/dist/pipeline-FEDYO3IA.js +0 -5
  166. package/dist/workspace-PLXOO6ST.js +0 -1
  167. package/dist/workspace-archive-EEGLHZDW.js +0 -10
  168. package/dist/workspace-contract-LQJDZV36.js +0 -1
  169. package/dist/workspace-explain-G74ZIF23.js +0 -1
  170. package/dist/workspace-explain-contract-KT757JGQ.js +0 -1
  171. package/dist/workspace-intelligence-3GG7GEDQ.js +0 -1
  172. package/dist/workspace-mcp-serve-MJMUV4RY.js +0 -3
  173. package/dist/workspace-model-NG45SRM5.js +0 -1
  174. package/dist/workspace-python-engine-state-MTWIIZPY.js +0 -2
  175. package/dist/workspace-registry-summary-JM2XY52C.js +0 -1
  176. package/dist/workspace-run-WEQYIERE.js +0 -1
  177. package/dist/workspace-watch-W47T4RX2.js +0 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/workspai.svg?style=flat-square)](https://www.npmjs.com/package/workspai)
6
6
  [![Downloads](https://img.shields.io/npm/dm/workspai.svg?style=flat-square)](https://www.npmjs.com/package/workspai)
7
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](LICENSE)
8
8
  [![Built by Workspai](https://img.shields.io/badge/Built%20by-Workspai-0f172a?logo=github)](https://workspai.dev)
9
9
 
10
10
  Not another AI coding assistant.
@@ -19,623 +19,398 @@ It gives developers, CI, IDEs, and AI agents the same evidence-backed source of
19
19
  truth: workspace model, agent context, impact analysis, verification evidence,
20
20
  contracts, and release gates.
21
21
 
22
- ## Start here
22
+ ### What changes for the user?
23
23
 
24
- ### Install
24
+ Without Workspai, an agent repeatedly searches files and reconstructs a partial
25
+ picture. With Workspai, it can ask a bounded question and receive the matching
26
+ entities, nearby relations, and source proofs:
25
27
 
26
28
  ```bash
27
- npm install -g workspai
29
+ npx workspai workspace graph search "who implements the login API?" --limit 8 --json
28
30
  ```
29
31
 
30
- For short `npx` workflows, use the separate alias package:
32
+ Workspai is broader than a repository code graph. It connects projects, source,
33
+ packages, APIs, infrastructure, pipelines, documentation, decisions, tests, and
34
+ ownership inside one workspace model—then uses that same truth for impact,
35
+ verification, CI, IDEs, MCP, and agent grounding.
36
+
37
+ ### Current measured fixture
38
+
39
+ | Measure | Observed value |
40
+ | ------------------------------------ | -------------: |
41
+ | Registered projects | 16 |
42
+ | Knowledge Graph entities | 1,738 |
43
+ | Knowledge Graph relations | 2,244 |
44
+ | Portable proofs | 2,106 |
45
+ | Readable proof-source artifacts | 392 |
46
+ | Corpus size (`characters / 4`) | 134,105 tokens |
47
+ | `api endpoint --limit 8` retrieval | 2,812 tokens |
48
+ | Observed retrieval payload reduction | 97.9% |
49
+ | Observed corpus/retrieval ratio | 47.69× |
50
+
51
+ This is a reproducible observation from one 16-project development workspace on
52
+ 2026-07-21, not a universal token-cost or answer-quality claim. See
53
+ [Graph Benchmark Methodology](docs/graph-benchmark-methodology.md) for the source
54
+ hash, formulas, limitations, and publication gate.
31
55
 
32
- ```bash
33
- npx wspai --help
34
- ```
35
-
36
- ### CLI help
37
-
38
- Browse all commands without a global install (first run fetches from npm):
39
-
40
- ```bash
41
- npx workspai --help
42
- ```
56
+ ## Start here
43
57
 
44
- ### Create a governed workspace
58
+ ### Install
45
59
 
46
60
  ```bash
47
- npx workspai my-workspace --yes --profile polyglot
48
- cd ~/.workspai/workspaces/my-workspace
49
-
50
- npx workspai bootstrap --profile polyglot
51
- npx workspai create project nextjs my-web --yes
52
- npx workspai create project fastapi.standard my-api --yes
53
-
54
- npx workspai workspace model --json
55
- npx workspai workspace context --for-agent --json --write
56
- npx workspai pipeline --json --strict
61
+ npm install -g workspai
62
+ workspai --help
57
63
  ```
58
64
 
59
- ### Adopt an existing project
65
+ For short `npx` workflows, use the separate alias package:
60
66
 
61
67
  ```bash
62
- npx workspai adopt /path/to/project
63
- cd ~/.workspai/workspaces/workspai
64
-
65
- npx workspai workspace model --json
66
- npx workspai workspace context --for-agent --json --write
67
- npx workspai pipeline --json --strict
68
+ npx wspai --help
68
69
  ```
69
70
 
70
- ### What you get
71
-
72
- - A governed workspace boundary for projects, policies, reports, and contracts
73
- - Native create for Workspai-owned backend and frontend kits
74
- - Adopt/import for existing repositories without moving source code
75
- - Agent-ready context packs for Copilot, Cursor, Claude, Codex, and other tools
76
- - Impact analysis and release gates backed by workspace evidence
77
- - One shared truth for developers, CI, IDEs, and AI agents
78
-
79
- ## Create planner
80
-
81
- Workspai does not pretend every technology is a native scaffold. It uses a
82
- create planner contract to choose the safest path:
83
-
84
- | Lane | Use when | Result |
85
- | ---------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
86
- | `native` | Workspai owns the scaffold contract | Create the project with a first-class Workspai kit |
87
- | `official` | The ecosystem has an official generator | Run an available official generator and register it, or adopt planned handoffs |
88
- | `existing` | The project already exists, or no create path is available or necessary | Register, model, verify, and govern the project without scaffolding it |
89
-
90
- Native create is reserved for Workspai-owned kits such as FastAPI, NestJS,
91
- Go, Spring Boot, and .NET. Official generator paths cover frontend frameworks
92
- such as Next.js, Vite, Nuxt, Angular, Astro, Remix, and SvelteKit.
93
-
94
- External ecosystems such as WordPress, Laravel, Symfony, Rails, and generic PHP
95
- projects can still enter Workspai through adopt/import and receive workspace
96
- model, context, impact, doctor, and release governance.
97
-
98
- Details: [docs/create-planner-capabilities.md](docs/create-planner-capabilities.md).
99
-
100
- ## Workspace Intelligence
101
-
102
- Most AI tools understand:
71
+ `workspai` is the canonical npm package and command. `wspai` is an optional
72
+ short alias for `npx` workflows. RapidKit Core is the optional Python engine
73
+ used only by Python/Core-dependent workflows; it is not a replacement CLI.
74
+ This package is the active CLI boundary in the
75
+ [Workspai monorepo](../../README.md).
103
76
 
104
- - Files
105
- - Functions
106
- - Repositories
107
-
108
- Production systems require understanding:
109
-
110
- - Ownership
111
- - Architecture
112
- - Dependencies
113
- - Operational context
114
- - Verification requirements
115
- - Change impact
116
-
117
- Workspai adds the missing layer:
118
-
119
- **Workspace Intelligence.**
120
-
121
- **One workspace. One truth. Humans and AI aligned.**
122
-
123
- A shared, evidence-backed understanding of software systems for developers, CI pipelines, IDEs, and AI agents.
124
-
125
- In Workspai, Workspace Intelligence is not a chat feature. It is the deterministic workspace layer behind the CLI:
126
-
127
- - **Model** — what projects, runtimes, frameworks, commands, policies, contracts, and evidence exist
128
- - **Context** — what AI agents and IDEs should know before giving advice
129
- - **Impact** — what changed and which projects, commands, and release gates are affected
130
- - **Verify** — which evidence proves the workspace is ready, blocked, or needs attention
131
- - **Sync** — how developers, CI, Workspai, and AI agents stay grounded in the same truth
132
- - **Freshness** — which facts are durable, derived, evidence-backed, live, or must be verified before use
133
-
134
- ## From Code to Shared Understanding
135
-
136
- How Workspai transforms projects and repositories into workspace intelligence for developers, CI, and AI agents.
137
-
138
- ![From Code to Shared Understanding](https://raw.githubusercontent.com/rapidkitlabs/workspai/main/packages/cli/docs/From%20Code%20to%20Shared%20Understanding.png)
77
+ ### CLI help
139
78
 
140
- Mermaid source for GitHub docs: [from-code-to-shared-understanding.md](docs/from-code-to-shared-understanding.md).
141
-
142
- Workspai provides the workspace intelligence engine: model, context, impact, verification, evidence, contracts, governance, and the VS Code experience on top of that foundation.
143
-
144
- For the visual experience, install the [Workspai VS Code extension](https://marketplace.visualstudio.com/items?itemName=rapidkit.rapidkit-vscode).
145
-
146
- ## Table of contents
147
-
148
- - [Start here](#start-here)
149
- - [Create planner](#create-planner)
150
- - [Workspace Intelligence](#workspace-intelligence)
151
- - [From Code to Shared Understanding](#from-code-to-shared-understanding)
152
- - [Typical workflows](#typical-workflows)
153
- - [Mental model](#mental-model)
154
- - [Why this architecture helps](#why-this-architecture-helps)
155
- - [Workspace Intelligence Commands](#workspace-intelligence-commands)
156
- - [Agent Customization Pack](#agent-customization-pack)
157
- - [Requirements](#requirements)
158
- - [Install](#install)
159
- - [Project workflows](#project-workflows)
160
- - [CI & evidence](#ci--evidence)
161
- - [Workspai ecosystem](#workspai-ecosystem)
162
- - [VS Code extension](#vs-code-extension)
163
- - [Documentation](#documentation)
164
- - [Development](#development)
165
- - [Troubleshooting](#troubleshooting)
166
- - [License](#license)
167
-
168
- ## Typical workflows
169
-
170
- | Question | Command |
171
- | --------------------------------------------- | -------------------------------------------------------------------------------------------- |
172
- | What projects exist in this workspace? | `workspace model --json` |
173
- | What context should AI agents receive? | `workspace context --for-agent --json --write` |
174
- | What breaks if I change this? | `workspace impact --from .workspai/reports/workspace-model-diff-last-run.json` |
175
- | Why is release blocked? | `workspace explain release-blocked --json --write` |
176
- | Trace a diff through blast radius and gates? | `workspace trace --from .workspai/reports/workspace-model-diff-last-run.json --json --write` |
177
- | What should Studio do for blocked artifacts? | `workspace remediation-plan --ci --json --write` |
178
- | Can I safely release? | `pipeline --json --strict` |
179
- | How do I align AI tools and CI? | `workspace agent-sync --write` |
180
- | Expose workspace evidence to MCP clients? | `workspace mcp serve` |
181
- | How do I onboard an existing project? | `adopt` |
182
- | How do I bring repositories into a workspace? | `import` |
183
-
184
- ### Existing project
79
+ Browse all commands from the latest release without a global install:
185
80
 
186
81
  ```bash
187
- npx workspai adopt /path/to/project --workspace /path/to/workspace
188
- npx workspai workspace model --json
82
+ npx workspai@latest --help
189
83
  ```
190
84
 
191
- ### Agent-ready workspace
85
+ ## Get Workspace Intelligence
192
86
 
193
- ```bash
194
- npx workspai workspace context --for-agent --json --write
195
- npx workspai workspace agent-sync --write --refresh-context --preset enterprise
196
- npx workspai workspace agent-sync --write --refresh-context --preset enterprise --experimental-hooks
197
- ```
87
+ Project creation, import, and adoption are entry routes. The core experience
88
+ starts when Workspai builds a durable model of the whole workspace and turns it
89
+ into evidence that different tools can consume.
198
90
 
199
- ### Release verification
91
+ Connect an existing project without moving or copying its source:
200
92
 
201
93
  ```bash
202
- npx workspai pipeline --json --strict
94
+ npx workspai adopt /path/to/project --json
95
+ cd ~/.workspai/workspaces/workspai
203
96
  ```
204
97
 
205
- ### Adopt in place
98
+ Execute the canonical chain and persist the shared model, evidence, and
99
+ agent-ready context:
206
100
 
207
101
  ```bash
208
- npx workspai adopt /path/to/project --workspace /path/to/workspace --json
209
- npx workspai adopt --json # from inside the project folder
210
- ```
211
-
212
- ### Workspace layout
213
-
214
- ```text
215
- ~/.workspai/workspaces.json
216
- ~/.workspai/workspaces/
217
- workspai/ # managed default (standalone, import, and adopt fallback)
218
- my-workspace/ # user-created workspaces
102
+ npx workspai workspace intelligence run --for-agent codex --strict --json
219
103
  ```
220
104
 
221
- New workspaces go under `~/.workspai/workspaces/<name>`. Legacy `~/rapidkit/workspaces/*` and `~/Workspai/rapidkits/*` paths remain registered. Use `--output <parent-dir>` for a custom parent.
222
-
223
- ## Mental model
224
-
225
- ### Two capabilities, one workspace intelligence layer
105
+ You now have a common source of truth for projects, runtimes, dependencies,
106
+ commands, policies, contracts, health, and release evidence. The first durable
107
+ outputs include:
226
108
 
227
109
  ```text
228
- Workspace Intelligence → every project in the workspace
229
- Native generation → first-class scaffolds and stack-specific project creation
230
- Deep module generation → selected backend engine kits such as FastAPI and NestJS
110
+ .workspai/reports/workspace-model.json
111
+ .workspai/reports/workspace-context-agent.json
112
+ .workspai/reports/INDEX.json
113
+ .workspai/reports/workspace-intelligence-run-last-run.json
114
+ AGENTS.md
231
115
  ```
232
116
 
233
- Workspace Intelligence is not limited to a framework lane. It works across
234
- Workspai-created projects, frontend apps, Go, Spring Boot, .NET, FastAPI, NestJS,
235
- and adopted/imported repositories. The difference is generation depth:
236
- some stacks have first-class scaffolds, some use official ecosystem generators,
237
- and existing projects can be adopted in place.
117
+ Already inside a Workspai workspace? Start directly with the canonical
118
+ `workspace intelligence run --for-agent codex --strict --json` runner.
238
119
 
239
- Workspai treats the **workspace** as the operating boundary: policy, registry,
240
- evidence, contracts, and release readiness. Projects can live inside the
241
- workspace or be **adopted** from outside.
120
+ The broader governance and release pipeline is a separate gate when you are
121
+ ready; it is not a substitute for the canonical chain:
242
122
 
243
- ```text
244
- workspace/
245
- .workspai-workspace
246
- .workspai/workspace.json
247
- .workspai/reports/
248
- workspace-model.json
249
- workspace-context-agent.json
250
- INDEX.json
251
- agent-customization-pack.json
252
- workspace-skills-index.json
253
- workspai-mcp-design.json
254
- .workspai/skills/
255
- .workspai/AGENT-GROUNDING.md
256
- services/api/
257
- .workspai/project.json
258
- AGENTS.md
259
- .github/copilot-instructions.md
260
- .github/instructions/
261
- .github/prompts/
262
- .github/skills/
263
- .github/agents/
264
- .cursor/rules/workspai-grounding.mdc
265
- CLAUDE.md
266
- .vscode/workspai-agent-hooks.json
267
-
268
- external-project/
269
- .workspai/project.json
270
- .workspai/adopt.json
123
+ ```bash
124
+ npx workspai pipeline --json --strict
271
125
  ```
272
126
 
273
- `.workspai/workspace.json` is the workspace manifest, not the project list.
274
- Legacy `.rapidkit/*` metadata is read as a fallback when opening older workspaces,
275
- but new Workspai CLI writes target `.workspai/*`.
276
- Projects are discovered from workspace project metadata, imported/adopted
277
- records, and workspace intelligence reports.
278
-
279
- Agent-facing outputs are generated from the same evidence layer:
280
- `workspace context --for-agent --write` writes the agent context report, and
281
- `workspace agent-sync --write --refresh-context --preset enterprise` writes the
282
- portable `AGENTS.md`, report index, skills, Copilot/Cursor/Claude surfaces, and
283
- agent handoff files. The exact generated output inventory is recorded in
284
- `.workspai/reports/agent-customization-pack.json` and summarized in the
285
- [Agent Customization Pack](#agent-customization-pack) section below.
286
-
287
- Every tool gets the same answers for every registered project: what projects
288
- exist, what stack they use, which commands are safe, what evidence exists, what
289
- changed, what release gates apply, and what context agents should receive.
290
-
291
- ## Why this architecture helps
292
-
293
- You do not have to change frameworks to benefit from Workspai.
127
+ ## From Code to Shared Understanding
294
128
 
295
- Use the frontend or backend stack that already fits your product: Next.js,
296
- Vite, FastAPI, NestJS, Go, Spring Boot, .NET, or an existing repository you
297
- adopt in place. Workspai adds the workspace layer around it: project registry,
298
- safe commands, evidence, impact analysis, agent context, verification, and
299
- release gates.
129
+ ![From Code to Shared Understanding](https://raw.githubusercontent.com/rapidkitlabs/workspai/main/packages/cli/docs/From%20Code%20to%20Shared%20Understanding.png)
300
130
 
301
- That means you can move faster without turning the product into a fragile
302
- prototype:
131
+ [View the Mermaid source and explanation](docs/from-code-to-shared-understanding.md).
303
132
 
304
- - Start new products with governed scaffolds when Workspai owns the create path
305
- - Adopt existing products without moving source code or rewriting the stack
306
- - Give humans, CI, IDEs, and AI agents the same workspace truth
307
- - Know what changed, what is affected, and what must be verified before release
308
- - Keep framework stability while adding professional product-development
309
- workflows around the codebase
133
+ Workspai is the deterministic layer between source code and its consumers:
310
134
 
311
- The result is faster product development with clearer boundaries, safer AI
312
- assistance, and release decisions backed by evidence instead of guesswork.
135
+ | Capability | What it answers |
136
+ | --------------------- | ------------------------------------------------------------------------------------------- |
137
+ | **Model** | What projects, runtimes, frameworks, commands, policies, contracts, and dependencies exist? |
138
+ | **Snapshot and diff** | What changed between two known workspace states? |
139
+ | **Impact** | Which projects and transitive dependents are affected? |
140
+ | **Evidence** | What do health, analysis, contracts, and readiness reports prove? |
141
+ | **Verify** | Is the affected workspace ready, blocked, stale, or missing evidence? |
142
+ | **Context** | What should developers, IDEs, and AI agents know before acting? |
143
+ | **Explain** | Why is a project, change, or release blocked, and what should happen next? |
144
+ | **Sync** | How do tools stay aligned with the same current workspace truth? |
313
145
 
314
- ## Workspace Intelligence Commands
146
+ Create, import, and adopt add software to this boundary. Workspace Intelligence
147
+ then models and governs every registered project, whether Workspai created it or
148
+ it already existed.
315
149
 
316
- Workspace Intelligence provides a shared understanding of projects, dependencies, operational context, and release readiness for developers, CI pipelines, and AI agents.
150
+ ## One Intelligence Chain
317
151
 
318
152
  The canonical execution order is versioned in
319
- [`contracts/workspace-intelligence-chain.v1.json`](contracts/workspace-intelligence-chain.v1.json).
320
- CLI, IDE, CI, agent grounding, documentation, and diagrams must consume that
321
- contract instead of maintaining independent command sequences. It currently defines:
153
+ [`workspace-intelligence-chain.v1.json`](contracts/workspace-intelligence-chain.v1.json):
322
154
 
323
155
  ```text
324
- Model -> Snapshot -> Diff -> Impact -> Doctor -> Contract Verify -> Readiness
156
+ Model -> Diff -> Impact -> Doctor + Contract Verify + Analyze -> Readiness
325
157
  -> Verify -> Context -> Agent Sync -> Explain
326
158
  ```
327
159
 
328
- Each contracted step declares its command, dependencies, consumed and produced
329
- artifacts, and whether a non-zero structured verdict continues or stops the chain.
330
-
331
- | Command | Purpose |
332
- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
333
- | `workspace model [--cache\|--incremental] --json` | Canonical workspace model (graph-aware, incremental rebuilds) |
334
- | `workspace context --for-agent --json --write` | Agent-ready context pack + auto agent grounding sync |
335
- | `workspace agent-sync --write` | Agent Customization Pack (AGENTS.md, Copilot, Cursor, Claude, INDEX, skills, agents) |
336
- | `workspace snapshot --json` | Persist model snapshot |
337
- | `workspace diff --from <file\|git[:ref]> --json` | Diff against snapshot or git |
338
- | `workspace impact --from <file> --json` | Graph-aware transitive blast-radius evidence |
339
- | `workspace verify [--strict] --json` | Definitive verification gate (subgraph + freshness + policy + fleet evidence) |
340
- | `workspace remediation-plan [--ci] --json --write` | Cross-artifact Studio repair plan for blocked governance cards |
341
- | `workspace explain <target> [--write] --json` | Human narrative for release blockers, projects, or trace slices |
342
- | `workspace why <target>` | Alias of `workspace explain` |
343
- | `workspace trace --from <diff> [--write] --json` | Diff → impact → gates narrative for agents and IDE handoff |
344
- | `workspace feedback record --json` | Append structured agent action outcomes to intelligence history |
345
- | `workspace mcp serve` | Read-mostly stdio MCP bridge over workspace evidence |
346
- | `workspace graph <emit\|explain\|dot\|mermaid>` | Inspect and visualize the dependency graph |
347
- | `workspace watch [--json] [--once]` | Daemon mode: keep model + graph in memory, stream change events |
348
- | `workspace run <stage> [--scope project:X] [--reuse-passed]` | Fleet init/test/build/start or custom stages from `.workspai/context.json` |
349
-
350
- JSON schemas: `contracts/workspace-intelligence/`. Command coexistence and naming:
351
- [docs/contracts/NAMING_AND_COEXISTENCE.md](docs/contracts/NAMING_AND_COEXISTENCE.md).
352
- Details: [commands-reference.md](docs/commands-reference.md).
353
-
354
- ### Operational intelligence (Phase 4)
355
-
356
- After model diff impact verify, use **explain** and **trace** for
357
- human/agent narratives, **feedback** to record outcomes, and **MCP serve** for
358
- read-only tool access:
160
+ Each step declares what it consumes, what it produces, and whether its verdict
161
+ continues or stops the chain. The CLI, CI, IDE integrations, generated agent
162
+ instructions, and documentation can therefore use the same contract instead of
163
+ inventing separate workflows.
164
+
165
+ The execution envelope reports `sync` before Model and baseline resolution
166
+ after Model/before Diff as exactly two `preflight` entries. They are not extra
167
+ chain stages. The report always contains exactly 11 ordered `stages`; exit `0`
168
+ means passed, `1` is a hard execution failure, and `2` is an evidence-blocked
169
+ completed run. See [Unified Workspace Intelligence Runner](docs/workspace-intelligence-runner.md)
170
+ for the complete report, baseline, failure-propagation, and CI contract.
171
+
172
+ Use `workspace intelligence run --for-agent <agent> --strict --json` to execute
173
+ and enforce this exact contract-backed order. `pipeline --json --strict` remains
174
+ the broader governance/release orchestrator (`sync doctor analyze readiness
175
+ autopilot`); it is not an alias for the canonical intelligence chain.
176
+
177
+ ## Core Workflows
178
+
179
+ | What you need | Command |
180
+ | ------------------------------------------ | ---------------------------------------------------------------------------------------- |
181
+ | Build and persist the current system model | `npx workspai workspace model --json --write` |
182
+ | Generate agent-ready context | `npx workspai workspace context --for-agent --json --write` |
183
+ | Generate portable agent and IDE surfaces | `npx workspai workspace agent-sync --write --refresh-context --preset enterprise --json` |
184
+ | Save a model baseline | `npx workspai workspace snapshot --json` |
185
+ | Compare with a baseline or Git state | `npx workspai workspace diff --from <snapshot-or-git-ref> --json` |
186
+ | Calculate transitive blast radius | `npx workspai workspace impact --from <diff-report> --json` |
187
+ | Verify affected projects and evidence | `npx workspai workspace verify --from-impact <impact-report> --json --strict` |
188
+ | Explain a blocker | `npx workspai workspace explain release-blocked --json --write` |
189
+ | Inspect a project in the dependency graph | `npx workspai workspace graph explain <project> --json` |
190
+ | Query proof-backed workspace entities | `npx workspai workspace graph entities endpoint --json` |
191
+ | Retrieve bounded context for an agent | `npx workspai workspace graph search "authentication endpoint" --limit 12 --json` |
192
+ | Measure retrieval payload reduction | `npx workspai workspace graph benchmark "authentication endpoint" --limit 12 --json` |
193
+ | Trace a relationship and its evidence | `npx workspai workspace graph path <from> <to> --json` |
194
+ | Compare two knowledge-graph revisions | `npx workspai workspace graph overlay --from <graph.json> --json` |
195
+ | Persist model + agent/MCP graph artifact | `npx workspai workspace model --write --json` |
196
+ | Run affected project tests | `npx workspai workspace run test --affected --blast-radius --json` |
197
+ | Run the release/governance gate | `npx workspai pipeline --json --strict` |
198
+ | Run the canonical intelligence chain | `npx workspai workspace intelligence run --for-agent codex --strict --json` |
199
+ | Expose current evidence to MCP clients | `npx workspai workspace mcp serve` |
200
+
201
+ `workspace verify` consumes current impact, doctor, contract, analysis, and
202
+ readiness evidence. Use `workspace intelligence run` for the canonical chain,
203
+ or `pipeline` for the broader governance/release workflow.
204
+
205
+ Other useful operational commands:
359
206
 
360
207
  ```bash
361
- npx workspai workspace explain release-blocked --json --write
362
- npx workspai workspace trace --from .workspai/reports/workspace-model-diff-last-run.json --json --write
363
- printf '%s\n' '{"actionId":"fix-api","summary":"API tests passed","outcome":"ok"}' | npx workspai workspace feedback record --json
364
- npx workspai workspace mcp serve
365
- ```
366
-
367
- `workspace feedback record` requires a single JSON object on stdin. Its
368
- `actionId`, `summary`, and `outcome` fields are validated before the outcome is
369
- appended to `workspace-intelligence-history.json`.
370
-
371
- Fleet runs support scoped execution and result reuse:
372
-
373
- ```bash
374
- npx workspai workspace run test --scope project:api --reuse-passed --json
375
- npx workspai workspace run lint --scope project:api # custom stage from context.json
376
- ```
377
-
378
- ### Graph-aware intelligence engine
379
-
380
- The workspace model carries a deterministic, first-class **dependency graph** that
381
- `impact`, `verify`, and `graph` all reason over — so the same evidence drives blast
382
- radius, gating, and visualization:
383
-
384
- - **Transitive blast radius** — `workspace impact` reports each affected project's
385
- `distance`, `path`, and `via` edge back to the change, plus centrality-weighted
386
- **critical-path hotspots**.
387
- - **Whole-subgraph gate** — `workspace verify` gates the changed projects **and** their
388
- transitive dependents, surfaces graph **integrity** issues (cycles, dangling edges,
389
- orphans), and emits a structured `gate` (`passed`/`mode`/`exitCode`/`reasons`).
390
- - **Transitive freshness** — a deterministic `fresh | stale | unknown` verdict chained
391
- through the graph: a dependency change makes every dependent stale, not just by
392
- timestamp.
393
- - **Fact freshness contracts** — `workspace model` and agent context packs mark each
394
- workspace fact as durable, derived, evidence-backed, live, or verify-before-use so
395
- agents do not reuse stale state as if it were structure.
396
- - **Policy violations** — model/contract violations are surfaced as structured
397
- `policyViolations[]` (not just an exit code) so IDEs and CI can render blockers.
398
- - **Health history** — every verify run appends to a bounded
399
- `.workspai/reports/workspace-intelligence-history.json` ring buffer for trends.
400
- - **Fast rebuilds** — `workspace model --cache` / `--incremental` reuse unchanged
401
- project models and re-infer only incident edges, keyed by a structural `inputsHash`.
402
- - **Watch / daemon** — `workspace watch` keeps the model + graph in memory and streams
403
- deterministic `workspace-watch-event.v1` change events (changed projects, graph edge
404
- deltas, structural hash) via fast incremental rebuilds.
405
-
406
- ### Agent Customization Pack
407
-
408
- Workspai can generate a versioned **Agent Customization Pack** so AI tools do
409
- not start from an ungrounded repository scan. They start from the same workspace
410
- truth developers and CI use: reports, commands, contracts, blockers, scope, and
411
- verification evidence.
412
-
413
- This is CLI-only and does not require the Workspai extension:
414
-
415
- ```bash
416
- # Full enterprise pack:
417
- # context pack + INDEX + AGENTS.md + Copilot/Cursor/Claude/Codex surfaces + MCP-ready design
418
- npx workspai workspace agent-sync --write --refresh-context --preset enterprise
419
-
420
- # Optional advisory VS Code agent hooks (disabled by default in the generated file)
421
- npx workspai workspace agent-sync --write --refresh-context --preset enterprise --experimental-hooks
422
-
423
- # Context pack write also syncs grounding by default
424
- npx workspai workspace context --for-agent --json --write
425
-
426
- # CI strict gate (fail if required reports missing/stale)
427
- npx workspai workspace agent-sync --write --strict --json
428
-
429
- # CI drift gate after sync
430
- npm run check:agent-customization-drift -- --workspace <workspace-root>
431
- ```
432
-
433
- | Artifact / file | Purpose |
434
- | ----------------------------------------------------------------------- | ----------------------------------------------------------- |
435
- | `.workspai/reports/agent-customization-pack.json` | Versioned output inventory, target matrix, drift state |
436
- | `.workspai/reports/workspace-explain-last-run.json` | Unified explain / trace narrative for blockers and projects |
437
- | `.workspai/reports/workspace-skills-index.json` | Index of operational playbooks (`.workspai/skills/*.md`) |
438
- | `.workspai/skills/workspai-*.md` | Operational playbooks (generated by agent-sync) |
439
- | `.workspai/reports/workspai-mcp-design.json` | Read-mostly MCP-ready tool design manifest |
440
- | `.workspai/reports/INDEX.json` | Read order, blockers, report timestamps |
441
- | `.workspai/reports/workspace-context-agent.json` | Canonical agent context pack |
442
- | `.workspai/reports/artifact-remediation-plan-last-run.json` | Cross-artifact Studio repair plan |
443
- | `.workspai/reports/doctor-remediation-plan-last-run.json` | Doctor-specific ordered repair plan |
444
- | `.workspai/reports/doctor-fix-result-last-run.json` | Doctor fix/apply execution result |
445
- | `.workspai/AGENT-GROUNDING.md` | Tool-agnostic grounding doc |
446
- | `AGENTS.md` | Open standard for all agents (managed Workspai section) |
447
- | `.github/copilot-instructions.md` | GitHub Copilot / VS Code Chat always-on rules |
448
- | `.github/instructions/workspai-workspace.instructions.md` | Copilot workspace scope and command discipline |
449
- | `.github/instructions/workspai-evidence.instructions.md` | Copilot scoped evidence rules |
450
- | `.github/prompts/workspai-diagnose.prompt.md` | Copilot reusable diagnose prompt |
451
- | `.github/skills/workspai-workspace-intelligence/SKILL.md` | Workspace Intelligence skill workflow |
452
- | `.github/skills/workspai-workspace-intelligence/resources/mcp-tools.md` | Future MCP tool design reference |
453
- | `.github/agents/workspai-advisor.agent.md` | Read-only workspace advisor agent |
454
- | `.github/agents/workspai-repair.agent.md` | Blocker repair agent |
455
- | `.github/agents/workspai-release.agent.md` | Release safety agent |
456
- | `.github/agents/workspai-project-onboarder.agent.md` | Project onboarding agent |
457
- | `.cursor/rules/workspai-grounding.mdc` | Cursor always-on project rule |
458
- | `CLAUDE.md` | Claude Code entry (`@AGENTS.md` + managed notes) |
459
- | `.claude/rules/workspai-evidence.md` | Claude Code scoped evidence rules |
460
- | `.claude/rules/rapidkit-evidence.md` | Legacy Claude Code scoped evidence mirror |
461
- | `.vscode/workspai-agent-hooks.json` | Optional advisory VS Code hooks (`--experimental-hooks`) |
462
-
463
- Legacy `rapidkit-*` agent files may still be read by older consumers, but canonical Workspai grounding is written under `.workspai` and Workspai-named agent surfaces.
464
-
465
- The pack also publishes a standard answer contract for agent-facing output:
466
-
467
- ```text
468
- Scope -> Evidence -> Diagnosis -> Fix Plan -> Run -> Verify -> Assumptions
469
- ```
470
-
471
- That contract is what keeps agent responses operational: every recommendation
472
- should name the workspace/project scope, cite the evidence it used, explain the
473
- diagnosis, propose the command or file action, and tell the user how to verify
474
- the result.
475
-
476
- Agents cannot be **forced** probabilistically. This stack makes the desired
477
- behavior explicit, versioned, and easy for IDEs, CI, and Workspai to audit.
478
-
479
- Skip auto-sync after context write: `--no-agent-sync`. Target specific ecosystems: `--target copilot,cursor,claude`.
480
-
481
- After `pipeline`, grounding syncs automatically (refresh context + INDEX + agent surfaces). Disable with `--no-agent-sync` or `RAPIDKIT_NO_AGENT_SYNC=1`.
482
-
483
- Contract: `contracts/agent-customization-pack.v1.json`. Artifact map:
484
- [docs/contracts/ARTIFACT_CATALOG.md](docs/contracts/ARTIFACT_CATALOG.md).
485
-
486
- CI template: [docs/examples/ci-agent-grounding.yml](docs/examples/ci-agent-grounding.yml).
487
-
488
- ## Requirements
489
-
490
- - Node.js `>= 20.19.6`
491
- - Python `>= 3.10` (for Python/Core workflows)
492
- - Java 21+, Go, .NET SDK 8+ (optional, per stack)
493
-
494
- ## Install
495
-
496
- ```bash
497
- npm install -g workspai
498
- ```
499
-
500
- ## Project workflows
501
-
502
- ### I already have a project
503
-
504
- ```bash
505
- npx workspai adopt /path/to/project
506
- npx workspai import ../orders-api
507
- cd ~/.workspai/workspaces/workspai
508
-
509
- npx workspai workspace model --json
510
- npx workspai doctor workspace --json
511
- ```
512
-
513
- ### I want a new project
514
-
515
- ```bash
516
- npx workspai my-workspace --yes --profile polyglot
517
- cd ~/.workspai/workspaces/my-workspace
518
-
519
- npx workspai bootstrap --profile polyglot
520
- npx workspai create project # interactive kit picker
521
- npx workspai create project nextjs my-web --yes
522
- npx workspai create project fastapi.standard my-api --yes
523
- cd <project-name> && npx workspai init && npx workspai dev
208
+ npx workspai doctor workspace
209
+ npx workspai setup <python|node|go|java|dotnet> [--warm-deps]
210
+ npx workspai workspace list
211
+ npx workspai cache <status|clear|prune|repair>
212
+ npx workspai mirror <status|sync|verify|rotate>
524
213
  ```
525
214
 
526
- Backend kits: `fastapi.standard`, `nestjs.standard`, `springboot.standard`, `gofiber.standard`, `dotnet.webapi.clean`, and more.
215
+ ### Understand a change
527
216
 
528
- Frontend generators: `nextjs`, `remix`, `vite-react`, `nuxt`, `angular`, `astro`, `sveltekit`, and more — same command shape:
217
+ Create a baseline:
529
218
 
530
219
  ```bash
531
- npx workspai create project <kit> <name>
220
+ npx workspai workspace model --json --write
221
+ npx workspai workspace snapshot --json
532
222
  ```
533
223
 
534
- (`create frontend <id>` remains supported as an alias.)
535
-
536
- Shortcut: `npx workspai platform` (interactive workspace wizard).
537
-
538
- ### I want CI or release gates
224
+ After a change:
539
225
 
540
226
  ```bash
541
- npx workspai pipeline --json --strict
227
+ npx workspai workspace model --json --write
228
+ npx workspai workspace diff \
229
+ --from .workspai/reports/workspace-model-snapshot.json \
230
+ --json
231
+ npx workspai workspace impact \
232
+ --from .workspai/reports/workspace-model-diff-last-run.json \
233
+ --json
542
234
  ```
543
235
 
544
- Stages individually: `workspace sync`, `doctor workspace --ci`, `analyze --strict`, `readiness --strict`, `autopilot release`.
545
-
546
- ## CI & evidence
547
-
548
- | Stage | Report |
549
- | --------- | --------------------------------------------------- |
550
- | Pipeline | `.workspai/reports/pipeline-last-run.json` |
551
- | Doctor | `.workspai/reports/doctor-last-run.json` |
552
- | Analyze | `.workspai/reports/analyze-last-run.json` |
553
- | Readiness | `.workspai/reports/release-readiness-last-run.json` |
554
- | Autopilot | `.workspai/reports/autopilot-release-last-run.json` |
236
+ Impact reports include affected projects and graph paths back to the change, so
237
+ developers, CI, IDEs, and agents reason over the same blast radius.
555
238
 
556
- Common workspace commands:
239
+ ### Ground AI tools
557
240
 
558
241
  ```bash
559
- npx workspai doctor workspace
560
- npx workspai workspace agent-sync --write --refresh-context
561
- npx workspai setup <python|node|go|java|dotnet> [--warm-deps]
562
- npx workspai workspace list
563
- npx workspai cache <status|clear|prune|repair>
564
- npx workspai mirror <status|sync|verify|rotate>
242
+ npx workspai workspace agent-sync \
243
+ --write \
244
+ --refresh-context \
245
+ --preset enterprise \
246
+ --json
565
247
  ```
566
248
 
567
- Full syntax: [docs/commands-reference.md](docs/commands-reference.md). CI workflows: [docs/ci-workflows.md](docs/ci-workflows.md) includes `.github/workflows/ci.yml`, `.github/workflows/workspace-e2e-matrix.yml`, `.github/workflows/windows-bridge-e2e.yml`, `.github/workflows/e2e-smoke.yml`, `.github/workflows/security.yml`.
249
+ This generates a versioned Agent Customization Pack from workspace evidence,
250
+ including `AGENTS.md`, report indexes, skills, and supported Copilot, Cursor,
251
+ Claude, and Codex surfaces. AI tools begin with the same scope, commands,
252
+ contracts, blockers, and verification evidence used by humans and CI.
253
+
254
+ For a user-focused graph quickstart, AI output paths, performance boundaries,
255
+ and reproducible token-efficiency methodology, see the
256
+ [Workspace Knowledge Graph guide](docs/workspace-knowledge-graph.md) and
257
+ [Graph Benchmark Methodology](docs/graph-benchmark-methodology.md).
258
+
259
+ ## Outputs and Consumers
260
+
261
+ Workspai separates human output, machine output, and durable cross-tool state:
262
+
263
+ | Output | Primary consumers |
264
+ | ----------------------------------------- | -------------------------------------------------- |
265
+ | CLI summaries and next actions | Developers and operators |
266
+ | JSON stdout | Scripts, CI jobs, IDE command bridges, and agents |
267
+ | Exit codes | CI and release gates |
268
+ | Persisted `.workspai/reports/*` artifacts | Developers, CI, IDEs, dashboards, and agents |
269
+ | Generated grounding files | Copilot, Cursor, Claude, Codex, and other AI tools |
270
+ | MCP stdio tools | MCP-compatible clients |
271
+ | Workspace watch events | Incremental IDE and automation consumers |
272
+
273
+ Important durable outputs:
274
+
275
+ | Artifact | Producer | Used for |
276
+ | ------------------------------------------------------- | ------------------------------ | ------------------------------------- |
277
+ | `.workspai/reports/workspace-model.json` | `workspace model --write` | Canonical system structure |
278
+ | `.workspai/reports/workspace-knowledge-graph.json` | `workspace model --write` | Proof-backed retrieval and MCP |
279
+ | `.workspai/reports/workspace-model-diff-last-run.json` | `workspace diff` | Structural change evidence |
280
+ | `.workspai/reports/workspace-impact-last-run.json` | `workspace impact` | Blast radius and affected scope |
281
+ | `.workspai/reports/workspace-verify-last-run.json` | `workspace verify` | Structured verification gate |
282
+ | `.workspai/reports/workspace-context-agent.json` | `workspace context --write` | Canonical agent context |
283
+ | `.workspai/reports/INDEX.json` | `workspace agent-sync --write` | Agent read order and report discovery |
284
+ | `.workspai/reports/workspace-explain-last-run.json` | `workspace explain --write` | Evidence-backed narrative |
285
+ | `.workspai/reports/workspace-intelligence-history.json` | Verify and feedback flows | Trends and audit history |
286
+ | `.workspai/reports/pipeline-last-run.json` | `pipeline --json` | CI and release workflow result |
287
+
288
+ See the [Artifact Catalog](docs/contracts/ARTIFACT_CATALOG.md) for the complete
289
+ writer, schema, and consumer map.
290
+
291
+ ## Onboard Software
292
+
293
+ All onboarding routes feed the same Workspace Intelligence model.
294
+
295
+ | Route | Use it when | Example |
296
+ | ---------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
297
+ | Adopt | Existing source should stay in place | `npx workspai adopt /path/to/project --json` |
298
+ | Import local | Existing source should be copied into a workspace | `npx workspai import ../orders-api --workspace /path/to/workspace --json` |
299
+ | Import Git | A repository should be cloned into a workspace | `npx workspai import https://github.com/acme/orders-api.git --git --workspace /path/to/workspace --json` |
300
+ | Create workspace | You need a new governed boundary | `npx workspai create workspace platform --profile polyglot --yes` |
301
+ | Create project | You need a supported new scaffold | `npx workspai create project nextjs web --yes` |
302
+ | Interactive | You want Workspai to guide the choice | `npx workspai create` |
303
+
304
+ Adopt never moves or copies source. Create can use a Workspai-managed kit or an
305
+ available official ecosystem generator. Unsupported native create requests are
306
+ directed toward official tooling followed by adoption.
307
+
308
+ Detailed onboarding behavior:
309
+
310
+ - [Creating Workspaces and Projects](docs/creating-workspaces-and-projects.md)
311
+ - [Workspace Operations](docs/workspace-operations.md)
312
+ - [Create Planner Capabilities](docs/create-planner-capabilities.md)
313
+
314
+ ## Integrations
315
+
316
+ - **AI tools:** Generate context, `AGENTS.md`, instructions, skills, and tool-specific surfaces with `workspace agent-sync`.
317
+ - **CI:** Consume structured reports and exit codes with `pipeline --json --strict`.
318
+ - **IDEs:** Read the same model, impact, verification, contract, and context artifacts used by CI.
319
+ - **MCP:** Expose read-mostly workspace evidence with `workspace mcp serve`.
320
+ - **VS Code:** Use the [Workspai extension](https://marketplace.visualstudio.com/items?itemName=rapidkit.rapidkit-vscode) for dashboards, impact, evidence, guided workflows, and Incident Studio.
321
+
322
+ The VS Code extension invokes this npm CLI, so command-line and visual workflows
323
+ share the same contracts and artifacts.
324
+
325
+ The Marketplace listing may temporarily retain legacy `rapidkit` wording. The
326
+ canonical package, command, metadata namespace, and Node.js requirement are the
327
+ `workspai`, `.workspai`, and Node.js `>=20.19.0` contracts documented here.
568
328
 
569
- ## Workspai ecosystem
329
+ ## Requirements
570
330
 
571
- RapidKit Labs builds Workspai as a single Workspace Intelligence platform.
331
+ - Node.js `>=20.19.0`
332
+ - npm
333
+ - Python `>=3.10` only for Python/Core-dependent workflows
334
+ - Java, Go, or .NET SDK only when operating those project types
572
335
 
573
- Workspai provides the CLI engine and the VS Code surface: model, context, impact, verification, evidence, contracts, governance, dashboard, sidebar, Incident Studio, AI workflows, and developer-facing workspace operations.
336
+ Python is not required for Python-free workspace profiles, npm-owned backend
337
+ generators, frontend generators, or workspaces created with
338
+ `--skip-python-engine`.
574
339
 
575
- | Component | Repository | Role |
576
- | --------- | --------------------------------------------------------------------------- | ------------------------------------------- |
577
- | CLI | [workspai](https://github.com/rapidkitlabs/workspai/tree/main/packages/cli) | Commands, governance, adoption, CI evidence |
578
- | VS Code | [rapidkit-vscode](https://github.com/rapidkitlabs/rapidkit-vscode) | Workspai dashboard, sidebar, AI studio |
579
- | Core | [rapidkit-core](https://github.com/rapidkitlabs/rapidkit-core) | Python engine, modules, doctor |
580
- | Examples | [rapidkit-examples](https://github.com/rapidkitlabs/rapidkit-examples) | Starter workspaces |
340
+ ## Documentation
581
341
 
582
- ## VS Code extension
342
+ | Documentation | Purpose |
343
+ | ---------------------------------------------------------------------------- | ------------------------------------------------------------- |
344
+ | [Documentation index](docs/README.md) | All user, operator, contract, and contributor docs |
345
+ | [Command reference](docs/commands-reference.md) | Complete command syntax and flags |
346
+ | [Creating workspaces and projects](docs/creating-workspaces-and-projects.md) | Interactive, automated, location, and linking behavior |
347
+ | [Workspace operations](docs/workspace-operations.md) | Adopt, import, snapshots, archives, contracts, and infra |
348
+ | [Workspace run](docs/workspace-run.md) | Polyglot and affected-project execution |
349
+ | [Workspace Knowledge Graph](docs/workspace-knowledge-graph.md) | Proof-backed queries, AI/MCP retrieval, and graph outputs |
350
+ | [Graph benchmark methodology](docs/graph-benchmark-methodology.md) | Reproducible payload-reduction measurements and claim limits |
351
+ | [Glossary](docs/GLOSSARY.md) | Plain-language meanings for model, graph, evidence, and gates |
352
+ | [Doctor command](docs/doctor-command.md) | Health checks, evidence, fixes, and exit codes |
353
+ | [CI workflows](docs/ci-workflows.md) | CI examples and repository validation |
354
+ | [Configuration](docs/config-file-guide.md) | User configuration and precedence |
355
+ | [Open-source scenarios](docs/OPEN_SOURCE_USER_SCENARIOS.md) | Role-oriented examples |
356
+ | [Artifact Catalog](docs/contracts/ARTIFACT_CATALOG.md) | Canonical files, writers, schemas, and readers |
357
+
358
+ Repository workflows include
359
+ [`.github/workflows/ci.yml`](../../.github/workflows/ci.yml),
360
+ [`.github/workflows/workspace-e2e-matrix.yml`](../../.github/workflows/workspace-e2e-matrix.yml),
361
+ [`.github/workflows/windows-bridge-e2e.yml`](../../.github/workflows/windows-bridge-e2e.yml),
362
+ [`.github/workflows/e2e-smoke.yml`](../../.github/workflows/e2e-smoke.yml),
363
+ [`.github/workflows/frontend-generator-smoke.yml`](../../.github/workflows/frontend-generator-smoke.yml),
364
+ [`.github/workflows/security.yml`](../../.github/workflows/security.yml), and the
365
+ maintainer-only
366
+ [`.github/workflows/release-npm-manual.yml`](../../.github/workflows/release-npm-manual.yml).
367
+ See [CI Workflows](docs/ci-workflows.md) for the complete validation and
368
+ contributor-automation map.
583
369
 
584
- Workspai is the VS Code and CLI experience for Workspace Intelligence.
370
+ ## Troubleshooting
585
371
 
586
- Search **Workspai** in the marketplace or install via:
587
- `ext install rapidkit.rapidkit-vscode`.
372
+ | Problem | What to check | Next step |
373
+ | ---------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------ |
374
+ | Node version is rejected | `node --version` | Install Node.js `>=20.19.0` |
375
+ | `npx` resolves an old CLI | `npx workspai --version` | Run `npx workspai@latest --version` or update the global package |
376
+ | Python/Core workflow cannot start | `python3 --version` | Install Python 3.10+ or use a Python-free profile where supported |
377
+ | Workspace is not detected | Look for `.workspai-workspace` | Run from the workspace or pass `--workspace <path>` |
378
+ | Strict policy blocks a command | `.workspai/policies.yml` | Inspect `workspace policy show` before changing policy |
379
+ | Reports are stale | Report timestamps | Re-run `pipeline` or the required chain stages |
380
+ | AI tools ignore workspace evidence | `AGENTS.md` and `.workspai/reports/INDEX.json` | Run `workspace agent-sync --write --refresh-context` |
381
+ | Project generator fails | Runtime and network output | Fix the reported prerequisite, then retry or create officially and adopt |
588
382
 
589
- | Feature | CLI | Extension |
590
- | ------------------------------- | ---------------------------- | ------------------------------- |
591
- | Create / adopt / import | Yes | Guided wizards |
592
- | Workspace model / context | Yes | Dashboard + AI scope |
593
- | Cross-tool agent grounding | Yes (`workspace agent-sync`) | Send-to-Copilot / Ask Studio UX |
594
- | Enterprise evidence loop | Partial | Full dashboard |
595
- | Module catalog (FastAPI/NestJS) | Limited | Browser UI |
383
+ For command-specific behavior, use the
384
+ [Command Reference](docs/commands-reference.md) and
385
+ [Documentation Index](docs/README.md).
596
386
 
597
- The extension invokes this npm CLI. For the latest `adopt` and frontend generator features, install matching CLI version: `npm install -g workspai` or `npm link` from this repo ([Development](#development)).
387
+ ## Contributing and Support
598
388
 
599
- ## Documentation
389
+ Workspai is MIT-licensed and developed in the open. Contributions to runtime
390
+ support, contracts, documentation, tests, and Workspace Intelligence workflows
391
+ are welcome.
600
392
 
601
- | Doc | Description |
602
- | ------------------------------------------------------------------------ | ------------------------------------------- |
603
- | [docs/README.md](docs/README.md) | Documentation index |
604
- | [docs/commands-reference.md](docs/commands-reference.md) | Full command syntax |
605
- | [docs/workspace-operations.md](docs/workspace-operations.md) | Import, adopt, snapshots, archives, infra |
606
- | [docs/workspace-run.md](docs/workspace-run.md) | Polyglot fleet orchestration |
607
- | [docs/doctor-command.md](docs/doctor-command.md) | Doctor scopes, CI exit codes, JSON evidence |
608
- | [docs/OPEN_SOURCE_USER_SCENARIOS.md](docs/OPEN_SOURCE_USER_SCENARIOS.md) | Role-based workflows |
609
- | [docs/SETUP.md](docs/SETUP.md) | Maintainer setup |
610
- | [docs/SECURITY.md](docs/SECURITY.md) | Security policy |
611
- | [docs/config-file-guide.md](docs/config-file-guide.md) | User configuration |
612
- | [CHANGELOG.md](CHANGELOG.md) | Version history |
613
-
614
- ## Development
393
+ From a source checkout:
615
394
 
616
395
  ```bash
617
- npm ci && npm run build && npm run test
618
- npm run install:local # link workspai and wspai globally for manual testing
396
+ npm ci
397
+ npm run build
398
+ npm test
399
+ npm run validate
619
400
  ```
620
401
 
621
- Contributors: [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md), [docs/ci-workflows.md](docs/ci-workflows.md).
622
-
623
- `npm run prepack` validates embeddings and CLI surfaces before `npm pack` / `npm publish`.
624
-
625
- ## Troubleshooting
402
+ Use the npm version declared by the repository's `packageManager` field. Python,
403
+ Go, Java, and .NET are required only for workflows that exercise those runtimes.
404
+ To validate only this package, run `npm --workspace workspai run validate` from
405
+ the monorepo root.
626
406
 
627
- | Problem | Quick check | Fix |
628
- | --------------------------------------- | ---------------------------------- | ------------------------------------------------ |
629
- | `python3` not found | `python3 --version` | Install Python 3.10+ |
630
- | `setup --warm-deps` skipped | Project markers in cwd | Run from target project directory |
631
- | Strict policy blocks command | `.workspai/policies.yml` | `workspace policy set …` |
632
- | `npm audit fix --force` downgrades tsup | `package.json` | Do not use `--force`; keep `tsup@^8.5.1` |
633
- | Security audit fails on esbuild | `npm audit --audit-level=moderate` | Keep `esbuild` override in `package.json` |
634
- | Doctor output stale | Report timestamps | Re-run `doctor workspace` or `doctor project` |
635
- | Copilot ignores workspace evidence | Missing grounding files | `workspace agent-sync --write --refresh-context` |
636
- | Agent grounding strict CI failed | Stale/missing reports | Run governance chain then re-sync |
637
- | Affected run scope wrong | Git ref | Use `--since <ref>` explicitly |
407
+ - Read [CONTRIBUTING.md](https://github.com/rapidkitlabs/workspai/blob/main/packages/cli/CONTRIBUTING.md) before submitting changes.
408
+ - Use [GitHub Issues](https://github.com/rapidkitlabs/workspai/issues) for reproducible bugs and feature requests.
409
+ - Use [GitHub Discussions](https://github.com/rapidkitlabs/workspai/discussions) for questions and design conversations.
410
+ - Read the [Development Guide](docs/DEVELOPMENT.md) for local workflows.
411
+ - Report vulnerabilities through the [Security Policy](docs/SECURITY.md), not a public issue.
412
+ - Review the [Changelog](https://github.com/rapidkitlabs/workspai/blob/main/packages/cli/CHANGELOG.md) before upgrading.
638
413
 
639
414
  ## License
640
415
 
641
- MIT see [LICENSE](LICENSE).
416
+ MIT. See [LICENSE](LICENSE).