@amityco/social-plus-vise 0.4.0 → 0.8.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
@@ -1,92 +1,330 @@
1
- # Vise Skill and CLI
1
+ <p align="center">
2
+ <img src="./social.plus-vise.png" alt="social.plus Vise" width="320" />
3
+ </p>
2
4
 
3
- This package provides deterministic local tooling for social.plus SDK integration assistance.
5
+ <h1 align="center">social.plus Vise</h1>
4
6
 
5
- The bundled skill is the AI workflow layer. It tells host agents how to move from user intent to inspect, plan, docs grounding, edits, validation, and sensor runs.
7
+ <p align="center">
8
+ <strong>The standards harness that keeps AI coding agents on the rails when integrating social.plus SDKs.</strong>
9
+ </p>
6
10
 
7
- The CLI is the deterministic execution layer. It can inspect repositories, detect design/theme signals, search hosted docs, plan harness guides/sensors, produce grounded integration plans with structured intake questions, validate setup patterns, and run detected project sensors.
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/@amityco/social-plus-vise"><img src="https://img.shields.io/npm/v/@amityco/social-plus-vise.svg" alt="npm version" /></a>
13
+ <a href="./LICENSE"><img src="https://img.shields.io/badge/License-Proprietary-blue.svg" alt="License" /></a>
14
+ <a href="https://learn.social.plus"><img src="https://img.shields.io/badge/Docs-learn.social.plus-informational" alt="Docs" /></a>
15
+ </p>
8
16
 
9
- Vise is shipped locally because SDK implementation quality depends on both hosted social.plus docs and the customer's local project context. Local execution lets Vise inspect manifests, app surfaces, design tokens, lifecycle code, and constrained command sensors while keeping source code on the customer's machine.
17
+ <p align="center">
18
+ <code>npm install -g @amityco/social-plus-vise</code>
19
+ </p>
10
20
 
11
- The stdio MCP server is an optional compatibility adapter over the same CLI-backed operations for MCP-capable tools. It is not the primary workflow layer.
21
+ ---
12
22
 
13
- Frequent customer paths have dedicated guardrails:
23
+ ## Quick Start
14
24
 
15
- - feed and post creation: concrete feed target, no invented communityId/targetId/feedId, no inline API keys
16
- - secrets: never request API keys or credentials in chat; create env/config placeholders and have the user fill real values locally
17
- - notification setup: platform credentials, token source, registration after login, unregister on logout/user switch
18
- - Live Objects/Collections: object vs collection, observed domain, lifecycle owner, loading/error states, cleanup
19
- - monorepos: detected app surfaces can be selected with `surfacePath`
25
+ ```sh
26
+ # 1. Install
27
+ npm install -g @amityco/social-plus-vise
28
+
29
+ # 2. Install the AI skill into your coding tool (pick your host)
30
+ vise install-skill --target claude # Claude Code (personal)
31
+ vise install-skill --target cursor . # Cursor (project-local)
32
+ vise install-skill --target copilot . # GitHub Copilot / VS Code
33
+
34
+ # 3. Inside your project, let your AI agent run the Vise loop
35
+ cd your-app
36
+ vise inspect # detect platform, surface, design signals
37
+ vise plan --request "Add a social feed" # produce a grounded implementation plan
38
+ vise init --request "Add a social feed" # write the sp-vise/ compliance contract
39
+
40
+ # 4. After the agent makes edits
41
+ vise check # verify the integration against the contract
42
+ vise run-sensors # run your project's own build/typecheck/lint
43
+ ```
44
+
45
+ That's it. The skill at `skills/social-plus-vise/SKILL.md` (installed in step 2) teaches your AI agent when to run each command. Skip to [Usage Flow](#usage-flow) for the full picture.
46
+
47
+ ---
48
+
49
+ ## What Vise Does
50
+
51
+ Vise is a **local CLI + AI skill** that wraps coding agents in deterministic compliance guardrails when they integrate social.plus SDKs. It inspects your project, grounds the agent in hosted docs, enforces 250+ platform-specific compliance rules, and runs your project's own build/lint/typecheck sensors — all locally. **Your source code never leaves your machine.**
20
52
 
21
- `run_sensors` is constrained to detected project commands. It does not accept arbitrary shell input.
53
+ | Layer | Purpose |
54
+ |---|---|
55
+ | **Skill** (`SKILL.md`) | Tells your AI agent when to inspect, plan, fetch docs, edit, validate, and attest |
56
+ | **CLI** (`vise`) | Deterministic engine: inspects repos, searches docs, validates setup, runs sensors, manages attestations |
57
+ | **MCP adapter** | Optional stdio server for MCP-capable tools (Claude Code, Cursor, Codex, VS Code, Copilot) |
22
58
 
23
- ## Commands
59
+ ### Why "Vise"
24
60
 
25
- Install Vise globally:
61
+ A bench vise holds the workpiece steady so the craftsman's hands are free to shape it. Without one, the workpiece drifts and cuts wander. Vise does the same for AI agents integrating SDKs: it clamps the integration to a known-good position (the real docs, the real project structure, the real compliance rules) so the agent can focus on creative work instead of guessing.
62
+
63
+ ---
64
+
65
+ ## Supported Platforms
66
+
67
+ | Platform | Coverage | Sensors |
68
+ |---|---|---|
69
+ | **TypeScript / Next.js / React** | ✅ Full | `tsc`, `npm build`, `npm lint`, SDK import smoke |
70
+ | **React Native** | ✅ Full | `tsc`, `npm lint`, SDK import smoke |
71
+ | **Flutter / Dart** | ✅ Full | `flutter analyze`, `flutter test` |
72
+ | **Android (Kotlin)** | ✅ Full | Gradle assemble, unit tests |
73
+ | **iOS (Swift)** | ✅ Full | (static rule checks; runtime sensors WIP) |
74
+
75
+ Each platform has 50–55 rules across 10 compliance domains (feed, comments, moderation, chat, secrets, session & auth, notifications, live objects, logging hygiene, design tokens).
76
+
77
+ ---
78
+
79
+ ## Installation
80
+
81
+ ### Install the CLI
26
82
 
27
83
  ```sh
28
84
  npm install -g @amityco/social-plus-vise
29
- vise doctor
85
+ vise doctor # verify install
30
86
  ```
31
87
 
32
- Local development:
88
+ Or install per-project:
33
89
 
34
90
  ```sh
35
- npm install
36
- npm run build
37
- npm start
91
+ npm install -D @amityco/social-plus-vise
92
+ npx vise --help
38
93
  ```
39
94
 
40
- CLI:
95
+ ### Install the Skill Into Your Coding Tool
41
96
 
42
- ```sh
43
- vise doctor
44
- vise install-skill --target codex
45
- vise install-skill --target claude
46
- vise install-skill --target claude-project .
47
- vise install-skill --target agents .
48
- vise install-skill --target cursor .
49
- vise install-skill --target vscode .
50
- vise install-skill --target copilot .
51
- vise print-skill
52
- vise search-docs "create post"
53
- vise get-doc-page social-plus-sdk/social/content-management/posts/creation/text-post
54
- vise inspect
55
- vise plan-harness --request "Add a social feed"
56
- vise plan --request "Add a social feed"
57
- vise init --request "Add a social feed"
58
- vise check
59
- vise sync
60
- vise attest --rule typescript.client.region --confidence high --signer host-agent --evidence-file evidence.json --rationale "..."
61
- vise explain typescript.client.region
62
- vise status
63
- vise engagement init --tier pro --customer-id acme --scope add-feed,setup-push
64
- vise engagement show
65
- vise validate
66
- vise run-sensors --dry-run
67
- vise mcp
97
+ The skill is what teaches your AI agent how to use Vise. Pick the matching host:
98
+
99
+ | Host | Install command |
100
+ |---|---|
101
+ | Claude Code (personal scope) | `vise install-skill --target claude` |
102
+ | Claude Code (project scope) | `vise install-skill --target claude-project .` |
103
+ | OpenAI Codex | `vise install-skill --target codex` |
104
+ | Cursor (native skills) | `vise install-skill --target cursor .` |
105
+ | Cursor (legacy rules) | `vise install-skill --target cursor-rules .` |
106
+ | GitHub Copilot / VS Code | `vise install-skill --target vscode .` |
107
+ | Copilot CLI / project | `vise install-skill --target copilot .` |
108
+ | Generic agent project | `vise install-skill --target agents .` |
109
+ | Other coding agents | `vise print-skill` (paste output into the host's project instructions) |
110
+
111
+ The skill is plain Markdown; you can read it any time with `vise print-skill`.
112
+
113
+ ---
114
+
115
+ ## Usage Flow
116
+
117
+ ```mermaid
118
+ flowchart LR
119
+ A[User asks AI agent<br/>'Add a social feed'] --> B[Agent runs<br/>vise inspect]
120
+ B --> C[Agent runs<br/>vise plan --request &quot;...&quot;]
121
+ C --> D{Intake<br/>questions?}
122
+ D -->|Yes| E[Agent asks user<br/>for feed target,<br/>design source, etc.]
123
+ D -->|No| F
124
+ E --> F[Agent runs<br/>vise init]
125
+ F --> G[Agent runs<br/>vise search-docs<br/>vise get-doc-page]
126
+ G --> H[Agent edits<br/>your code]
127
+ H --> I[Agent runs<br/>vise check]
128
+ I --> J{Green?}
129
+ J -->|No, fixable| K[Agent fixes<br/>findings]
130
+ K --> I
131
+ J -->|No, attest| L[Agent calls<br/>vise attest with<br/>evidence]
132
+ L --> I
133
+ J -->|Yes| M[Agent runs<br/>vise run-sensors]
134
+ M --> N[Done.<br/>sp-vise/ contract<br/>committed]
68
135
  ```
69
136
 
70
- Bundled skill guidance ships in `skills/social-plus-vise/SKILL.md` for coding tools that support Agent Skills or instruction-pack installation. Use `vise install-skill --target codex`, `vise install-skill --target claude`, `vise install-skill --target claude-project .`, `vise install-skill --target agents .`, `vise install-skill --target cursor .`, `vise install-skill --target vscode .`, `vise install-skill --target copilot .`, or `vise print-skill`. The Cursor target installs native project skills under `.cursor/skills`; the VS Code and Copilot targets install native project skills under `.github/skills`; `--target cursor-rules` remains available for Cursor project-rule fallback installs.
137
+ The flow above is what the skill teaches your AI agent. You the human drive intent and approve edits; the agent runs Vise commands deterministically; Vise grounds the agent in real docs and real compliance rules.
71
138
 
72
- Full local validation:
139
+ ---
73
140
 
74
- ```sh
75
- npm run validate
141
+ ## CLI Reference
142
+
143
+ ### Project inspection and planning
144
+
145
+ | Command | Purpose |
146
+ |---|---|
147
+ | `vise doctor` | Verify install; print version, install path, docs source |
148
+ | `vise inspect [path]` | Detect platform, monorepo surfaces, design signals, available sensors |
149
+ | `vise plan [path] --request "..."` | Produce a grounded implementation plan with intake questions and docs citations |
150
+ | `vise plan-harness [path] --request "..."` | (Pre-planning step) Build the harness around the request |
151
+ | `vise init [path] --request "..."` | Write the `sp-vise/` compliance contract for this project |
152
+
153
+ ### Documentation grounding
154
+
155
+ | Command | Purpose |
156
+ |---|---|
157
+ | `vise search-docs "<query>"` | Search social.plus docs for relevant pages |
158
+ | `vise get-doc-page <path>` | Fetch a specific doc page by path |
159
+
160
+ ### Compliance verification
161
+
162
+ | Command | Purpose |
163
+ |---|---|
164
+ | `vise check [path]` | Re-validate against the recorded contract; reports `green`, `needs-attestation`, `deterministic-failures`, `blocked`, or `contract-drift` |
165
+ | `vise check [path] --ci` | Same as `check`, but read-only and exits non-zero unless green (for CI pipelines) |
166
+ | `vise validate [path]` | Run the deterministic validators (subset of `check` that doesn't compare against attestations) |
167
+ | `vise sync [path]` | Persist deterministic-pass evidence to `sp-vise/attestations/` |
168
+ | `vise attest [path] --rule <id> --signer host-agent --confidence high --evidence-file evidence.json --rationale "..."` | Record an attestation when a rule passes through customer-specific architecture that the deterministic check can't see |
169
+ | `vise explain <ruleId>` | Print the rule's rationale, evidence requirements, and remediation guidance |
170
+ | `vise status [path]` | Summarize the current compliance state |
171
+
172
+ ### Sensors
173
+
174
+ | Command | Purpose |
175
+ |---|---|
176
+ | `vise run-sensors [path]` | Run detected project commands (npm scripts, Gradle, Flutter, lint, typecheck, SDK import smokes); never executes arbitrary shell |
177
+ | `vise run-sensors [path] --dry-run` | List what would run without executing |
178
+
179
+ ### Skill management
180
+
181
+ | Command | Purpose |
182
+ |---|---|
183
+ | `vise install-skill --target <host>` | Install the bundled skill into a coding host (see [Installation](#installation)) |
184
+ | `vise print-skill` | Print the skill markdown to stdout |
185
+
186
+ ### Engagement scope (optional contractual metadata)
187
+
188
+ | Command | Purpose |
189
+ |---|---|
190
+ | `vise engagement init [path] [--tier ...] [--customer-id ...] [--scope ...]` | Record the contractual scope for this integration |
191
+ | `vise engagement show [path]` | Print the recorded engagement metadata |
192
+
193
+ ### MCP server
194
+
195
+ | Command | Purpose |
196
+ |---|---|
197
+ | `vise mcp` | Start the stdio MCP compatibility adapter |
198
+
199
+ ---
200
+
201
+ ## MCP Integration
202
+
203
+ MCP-capable hosts can call Vise as structured tool calls instead of shell commands.
204
+
205
+ ### Config
206
+
207
+ ```json
208
+ {
209
+ "mcpServers": {
210
+ "social-plus": {
211
+ "command": "vise",
212
+ "args": ["mcp"]
213
+ }
214
+ }
215
+ }
76
216
  ```
77
217
 
78
- Product-oriented Vise improvement discovery:
218
+ ### Tool names (snake_case per MCP convention)
79
219
 
80
- ```sh
81
- npm run test:improvements
220
+ `inspect_project`, `plan_harness`, `plan_integration`, `init_compliance`, `check_compliance`, `sync_compliance`, `attest_rule`, `explain_rule`, `init_engagement`, `show_engagement`, `search_docs`, `get_doc_page`, `validate_setup`, `run_sensors`.
221
+
222
+ These are the same operations as the CLI commands above, exposed as MCP tools.
223
+
224
+ ---
225
+
226
+ ## CI Compliance
227
+
228
+ Add `vise check --ci` to your CI pipeline after committing `sp-vise/compliance.json` to your repository:
229
+
230
+ ```yaml
231
+ name: Vise Compliance
232
+
233
+ on:
234
+ pull_request:
235
+ push:
236
+ branches: [main]
237
+
238
+ jobs:
239
+ vise-compliance:
240
+ runs-on: ubuntu-latest
241
+ steps:
242
+ - uses: actions/checkout@v4
243
+ - uses: actions/setup-node@v4
244
+ with:
245
+ node-version: 20
246
+ - run: npm install -g @amityco/social-plus-vise
247
+ - run: vise check . --ci
82
248
  ```
83
249
 
84
- ## Docs Source
250
+ **Exit codes:**
251
+
252
+ | Code | Meaning |
253
+ |---|---|
254
+ | `0` | All rules pass (deterministic or attested) |
255
+ | `1` | One or more rules need attestation |
256
+ | `2` | One or more rules have deterministic failures |
257
+ | `3` | One or more blockers fired (missing prerequisite, e.g. `google-services.json`) |
258
+ | `4` | Contract drift — rules in `sp-vise/compliance.json` no longer match the current ruleset |
259
+
260
+ `vise check --ci` is read-only. It never updates `sp-vise/`. The JSON output includes a `ci` block with structured details for pipeline logs.
261
+
262
+ ---
263
+
264
+ ## Compliance Contract
265
+
266
+ After `vise init`, your project gets a `sp-vise/` directory. These files become part of your repo and travel through code review:
267
+
268
+ | File | Created by | What it contains |
269
+ |---|---|---|
270
+ | `sp-vise/compliance.json` | `vise init` | The rules selected for this integration, the Vise version, the ruleset digest, the target app surface, and an optional engagement link. |
271
+ | `sp-vise/attestations/*.json` | `vise sync` (deterministic) or `vise attest` (host-agent / human) | Per-rule evidence: signer, confidence, rationale, cited files (with source fingerprints for drift detection). |
272
+ | `sp-vise/inspection.json` | `vise init` | The platform, monorepo surface, and design-token signals detected at init time. |
273
+ | `sp-vise/engagement.json` | `vise engagement init` (optional) | Contractual scope: tier, customer ID, contracted outcomes, reviewer assignment. |
85
274
 
86
- By default, docs are read from:
275
+ **Commit `sp-vise/` to your repo.** `vise check` re-validates against the recorded contract on every run, comparing current code against the recorded attestations. If code changes and breaks a rule, the next `check` reports `deterministic-fail`, `attestation-needed`, or `blocked` — never a silent regression.
87
276
 
88
- ```text
89
- https://learn.social.plus/llms-full.txt
277
+ If a rule passes through customer-specific architecture the validator can't see (a DI wrapper, an unconventional file layout, etc.), record an attestation:
278
+
279
+ ```sh
280
+ vise attest . \
281
+ --rule typescript.client.region \
282
+ --signer host-agent \
283
+ --confidence high \
284
+ --evidence-file evidence.json \
285
+ --rationale "Region is read from NEXT_PUBLIC_AMITY_REGION env var in lib/amity.ts:6"
90
286
  ```
91
287
 
92
- Maintainers can set `SOCIAL_PLUS_DOCS_ROOT` to test against a local `social-plus-docs` checkout.
288
+ Attestation files record source fingerprints (SHA-256 of cited files) so subsequent edits invalidate stale attestations.
289
+
290
+ ---
291
+
292
+ ## Benchmark Headline
293
+
294
+ | Platform | Pure MCP findings | Vise findings | Pure MCP CI | Vise CI |
295
+ |---|---|---|---|---|
296
+ | React / Next.js | 7 (3 errors) | 2 (warnings) | ❌ FAIL | ✅ PASS |
297
+ | React Native | 6 | 2 | ❌ FAIL | ✅ PASS |
298
+ | Flutter | 9 | 2 | ❌ FAIL | ✅ PASS |
299
+ | Android (Kotlin) | 9 | 0 | ❌ FAIL | ✅ PASS |
300
+ | iOS (Swift) | 8 | 0 | ❌ FAIL | ✅ PASS |
301
+
302
+ Measured runs of the same AI agent (Claude Sonnet 4.6) implementing "add a global feed" on each platform, with and without Vise. Without Vise: every run ships a hardcoded API key (a deterministic failure that cannot be attested). With Vise: every run passes CI with zero deterministic failures.
303
+
304
+ For full methodology, per-cell scorecards, and the v0.7 multi-outcome cross-tool validation (chat / comments / push on React + Flutter, plus Antigravity/Gemini cross-tool), see [`benchmarks/RESULTS.md`](./benchmarks/RESULTS.md) in the installed npm package.
305
+
306
+ ---
307
+
308
+ ## Changelog
309
+
310
+ See [`CHANGELOG.md`](./CHANGELOG.md) for the full version history.
311
+
312
+ ---
313
+
314
+ ## Support
315
+
316
+ - **Bugs / feature requests:** contact your social.plus account team or file an issue with your integration partner.
317
+ - **Documentation:** [https://learn.social.plus](https://learn.social.plus)
318
+ - **Skill installation issues:** `vise doctor` prints diagnostic info; share the output with support.
319
+
320
+ ---
321
+
322
+ ## License
323
+
324
+ Proprietary. See [`LICENSE`](./LICENSE) for terms. social.plus Vise is provided to social.plus customers and integration partners under the same agreement as the social.plus SDK.
325
+
326
+ ---
327
+
328
+ <p align="center">
329
+ Built with <code>vise</code>. Holding compliance steady so agents can build.
330
+ </p>