ai-spector 0.9.14 → 0.9.16

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 (112) hide show
  1. package/README.md +53 -288
  2. package/README.vi.md +62 -294
  3. package/dist/cli.js +79 -2
  4. package/dist/cli.js.map +1 -1
  5. package/dist/core/comments/ids.d.ts +11 -0
  6. package/dist/core/comments/ids.d.ts.map +1 -0
  7. package/dist/core/comments/ids.js +23 -0
  8. package/dist/core/comments/ids.js.map +1 -0
  9. package/dist/core/comments/storage.d.ts +44 -1
  10. package/dist/core/comments/storage.d.ts.map +1 -1
  11. package/dist/core/comments/storage.js +209 -2
  12. package/dist/core/comments/storage.js.map +1 -1
  13. package/dist/core/config/language-from-docops.d.ts +15 -0
  14. package/dist/core/config/language-from-docops.d.ts.map +1 -0
  15. package/dist/core/config/language-from-docops.js +97 -0
  16. package/dist/core/config/language-from-docops.js.map +1 -0
  17. package/dist/core/config/load.d.ts.map +1 -1
  18. package/dist/core/config/load.js +25 -11
  19. package/dist/core/config/load.js.map +1 -1
  20. package/dist/core/course/catalog.js +1 -1
  21. package/dist/core/course/catalog.js.map +1 -1
  22. package/dist/core/docops/assess.d.ts +7 -0
  23. package/dist/core/docops/assess.d.ts.map +1 -1
  24. package/dist/core/docops/assess.js +29 -0
  25. package/dist/core/docops/assess.js.map +1 -1
  26. package/dist/core/docops/bootstrap.d.ts.map +1 -1
  27. package/dist/core/docops/bootstrap.js +1 -0
  28. package/dist/core/docops/bootstrap.js.map +1 -1
  29. package/dist/core/docops/config.d.ts.map +1 -1
  30. package/dist/core/docops/config.js +2 -7
  31. package/dist/core/docops/config.js.map +1 -1
  32. package/dist/core/docops/entity-keying.d.ts +27 -0
  33. package/dist/core/docops/entity-keying.d.ts.map +1 -0
  34. package/dist/core/docops/entity-keying.js +127 -0
  35. package/dist/core/docops/entity-keying.js.map +1 -0
  36. package/dist/core/docops/init.d.ts.map +1 -1
  37. package/dist/core/docops/init.js +4 -0
  38. package/dist/core/docops/init.js.map +1 -1
  39. package/dist/core/docops/migrate.d.ts.map +1 -1
  40. package/dist/core/docops/migrate.js +7 -0
  41. package/dist/core/docops/migrate.js.map +1 -1
  42. package/dist/core/operations/check.d.ts.map +1 -1
  43. package/dist/core/operations/check.js +23 -0
  44. package/dist/core/operations/check.js.map +1 -1
  45. package/dist/core/operations/comments.d.ts +31 -1
  46. package/dist/core/operations/comments.d.ts.map +1 -1
  47. package/dist/core/operations/comments.js +41 -1
  48. package/dist/core/operations/comments.js.map +1 -1
  49. package/dist/core/operations/contract.d.ts +7 -0
  50. package/dist/core/operations/contract.d.ts.map +1 -1
  51. package/dist/core/operations/contract.js +32 -2
  52. package/dist/core/operations/contract.js.map +1 -1
  53. package/dist/core/operations/docops.d.ts.map +1 -1
  54. package/dist/core/operations/docops.js +15 -0
  55. package/dist/core/operations/docops.js.map +1 -1
  56. package/dist/core/operations/hooks.js +1 -1
  57. package/dist/core/operations/hooks.js.map +1 -1
  58. package/dist/core/operations/index.d.ts.map +1 -1
  59. package/dist/core/operations/index.js +20 -0
  60. package/dist/core/operations/index.js.map +1 -1
  61. package/dist/core/operations/setup.d.ts.map +1 -1
  62. package/dist/core/operations/setup.js +3 -2
  63. package/dist/core/operations/setup.js.map +1 -1
  64. package/dist/core/package-registry.d.ts +7 -0
  65. package/dist/core/package-registry.d.ts.map +1 -0
  66. package/dist/core/package-registry.js +11 -0
  67. package/dist/core/package-registry.js.map +1 -0
  68. package/dist/core/scaffold/claude-from-cursor.js +2 -2
  69. package/dist/interfaces/cli/format/comments.d.ts +3 -1
  70. package/dist/interfaces/cli/format/comments.d.ts.map +1 -1
  71. package/dist/interfaces/cli/format/comments.js +28 -0
  72. package/dist/interfaces/cli/format/comments.js.map +1 -1
  73. package/dist/interfaces/mcp/schemas.d.ts +36 -27
  74. package/dist/interfaces/mcp/schemas.d.ts.map +1 -1
  75. package/dist/interfaces/mcp/schemas.js +24 -2
  76. package/dist/interfaces/mcp/schemas.js.map +1 -1
  77. package/dist/interfaces/mcp/server.js +1 -1
  78. package/dist/interfaces/mcp/server.js.map +1 -1
  79. package/dist/interfaces/mcp/tools/lang.d.ts +1 -1
  80. package/package.json +1 -1
  81. package/scaffold/.ai-spector/.docflow/config/doc-types/srs/dag.graph-seeds.json +1 -0
  82. package/scaffold/.ai-spector/.docflow/config/doc-types/srs/dag.json +10 -1
  83. package/scaffold/.ai-spector/.docflow/config/doc-types/srs/readiness-criteria.json +2 -3
  84. package/scaffold/claude/.claude/rules/ai-spector-after-doc-edit.mdc +2 -2
  85. package/scaffold/claude/.claude/skills/ai-spector/references/cli-failures.md +1 -1
  86. package/scaffold/claude/.claude/skills/ai-spector/references/cli-reference.md +5 -2
  87. package/scaffold/claude/.claude/skills/ai-spector/references/generate-graph.md +3 -1
  88. package/scaffold/claude/.claude/skills/ai-spector/references/generate-workflow.md +7 -5
  89. package/scaffold/claude/.claude/skills/ai-spector/references/graph.md +4 -2
  90. package/scaffold/claude/.claude/skills/ai-spector/references/language-picker.md +3 -1
  91. package/scaffold/claude/.claude/skills/ai-spector/references/plan-and-briefing.md +33 -6
  92. package/scaffold/claude/.claude/skills/ai-spector/references/project-conventions.md +1 -1
  93. package/scaffold/claude/.claude/skills/ai-spector/references/runbook.md +3 -3
  94. package/scaffold/claude/.claude/skills/ai-spector-generate/references/runbook.md +4 -3
  95. package/scaffold/claude/.claude/skills/ai-spector-graph/references/impact.md +9 -7
  96. package/scaffold/claude/.claude/skills/ai-spector-graph/references/visualize-graph.md +1 -1
  97. package/scaffold/claude/CLAUDE.md +4 -4
  98. package/scaffold/claude/WORKFLOW.md +2 -2
  99. package/scaffold/cursor/WORKFLOW.md +2 -2
  100. package/scaffold/cursor/rules/ai-spector-after-doc-edit.mdc +2 -2
  101. package/scaffold/cursor/skills/ai-spector/references/cli-failures.md +1 -1
  102. package/scaffold/cursor/skills/ai-spector/references/cli-reference.md +5 -2
  103. package/scaffold/cursor/skills/ai-spector/references/generate-graph.md +3 -1
  104. package/scaffold/cursor/skills/ai-spector/references/generate-workflow.md +7 -5
  105. package/scaffold/cursor/skills/ai-spector/references/graph.md +4 -2
  106. package/scaffold/cursor/skills/ai-spector/references/language-picker.md +3 -1
  107. package/scaffold/cursor/skills/ai-spector/references/plan-and-briefing.md +33 -6
  108. package/scaffold/cursor/skills/ai-spector/references/project-conventions.md +1 -1
  109. package/scaffold/cursor/skills/ai-spector/references/runbook.md +3 -3
  110. package/scaffold/cursor/skills/ai-spector-generate/references/runbook.md +4 -3
  111. package/scaffold/cursor/skills/ai-spector-graph/references/impact.md +10 -8
  112. package/scaffold/cursor/skills/ai-spector-graph/references/visualize-graph.md +1 -1
package/README.md CHANGED
@@ -1,179 +1,56 @@
1
1
  # AI Spector
2
2
 
3
- Documentation workflow in **Cursor** or **Claude Code**: traceability graph, SRS, basic design, and UI prototypes (static HTML or SPA). **Describe what you need in chat** — the agent matches one of **4 skills**, reads its runbook, and runs `ai-spector` MCP tools. You rarely touch the terminal.
3
+ Documentation workflow in **Cursor** or **Claude Code**: traceability graph, SRS, basic/detail design, prototypes. **Say what you need in chat** — the agent picks one of **4 skills** and runs MCP tools. You rarely touch the terminal.
4
4
 
5
- **Kari Writer** owns the `.docops/` contract only (no agent skills). ai-spector is an optional local tool that implements that contract via git files.
5
+ **Needs:** Node 20+, Git, Cursor and/or Claude Code · Python 3.11+ optional (CocoIndex search)
6
6
 
7
- **Needs:** Node 20+, Git, [Cursor](https://cursor.com) and/or [Claude Code](https://docs.anthropic.com/en/docs/claude-code), Python 3.11+ *(optional — CocoIndex semantic search)*.
8
-
9
- **Learn:** `npm run docs:dev` · [Course](website/docs/en/README.md) · Tiếng Việt: `/vi/docs/` · Offline: `npx ai-spector course serve --open`
10
-
11
- **Tiếng Việt:** [README.vi.md](README.vi.md)
7
+ **Learn:** `npx ai-spector course serve --open` · [Course](website/docs/en/README.md) · [Tiếng Việt](README.vi.md)
12
8
 
13
9
  ---
14
10
 
15
- ## Setup (once)
16
-
17
- ### Prerequisites
18
-
19
- | Requirement | Check |
20
- |-------------|-------|
21
- | Node.js ≥ 20 | `node --version` |
22
- | Git repository | `git status` |
23
- | Cursor and/or Claude Code | IDE open in project root |
24
- | Python ≥ 3.11 *(optional)* | CocoIndex semantic search |
11
+ ## Quick start
25
12
 
26
- ### Step 1 Install & scaffold *(CLI)*
27
-
28
- Run once at your project root. **Install the package first**, then run the init wizard.
29
-
30
- **Internal registry** (Verdaccio — no `npm login` required):
13
+ **1. Install once** (project root):
31
14
 
32
15
  ```bash
33
16
  npm install ai-spector --registry http://10.101.0.239:4873
34
17
  npx ai-spector init
35
18
  ```
36
19
 
37
- **Public npm:**
38
-
39
- ```bash
40
- npm install ai-spector
41
- npx ai-spector init
42
- ```
43
-
44
- The init wizard prompts for editor (Cursor, Claude Code, or both), languages, git hook, and optional CocoIndex.
45
-
46
- Creates:
47
-
48
- - `.docops/` — Writer contract (`docops.config.json`, comments, review-queue, prototype metadata)
49
- - `.ai-spector/` — engine store (`engine.json`, graph, registry, work sessions)
50
- - `docs/data-source/`, `docs/srs/`, `docs/basic-design/`
51
- - **Cursor:** `.cursor/` — **4 skills**, rules, `mcp.json`
52
- - **Claude Code:** `CLAUDE.md` + `.claude/skills/` (4 skills) + `.mcp.json`
53
- - Pre-commit hook (when git is available)
54
-
55
- No `docflow.config.json` — fresh `init` writes the two-config model below.
56
-
57
- ### Configuration (2 files)
58
-
59
- | File | Owner | Purpose |
60
- |------|-------|---------|
61
- | `.docops/docops.config.json` | **Writer contract** (shared) | Languages, doc layers, paths, **capabilities** |
62
- | `.ai-spector/engine.json` | ai-spector engine (local only) | Graph/task artifact paths, readiness, CocoIndex, `scaffoldVersion` |
63
-
64
- **Writer** defines the contract schema (`kari-writer/contracts/CONTRACT.md` in the docs-ops meta-repo). It ships **no agent skills**. **Capabilities** in `docops.config.json` gate Writer web UI, ai-spector CLI/MCP, skill install, and `check` rules.
65
-
66
- **`.docops/guide/`** is for human tool authors only — agents and skills must **not** load or link to it at runtime.
67
-
68
- **Docops CLI** (Writer contract bootstrap — no full ai-spector scaffold):
69
-
70
- ```bash
71
- npx ai-spector docops status # human-readable layout + readiness
72
- npx ai-spector docops status --json # machine-readable for agents
73
-
74
- npx ai-spector docops init --lang en # scaffold Writer-ready .docops/
75
- npx ai-spector docops init --dry-run # preview planned files
76
- npx ai-spector docops init --force # fill gaps when config already exists
77
-
78
- npx ai-spector docops migrate --dry-run # preview legacy → .docops/ migration
79
- npx ai-spector docops migrate # migrate layout + copy templates
80
- npx ai-spector docops migrate --from-docflow # split docflow.config.json → contract + engine
81
- npx ai-spector docops migrate --templates-only # copy templates only
82
- npx ai-spector docops migrate --repair # fill gaps without overwriting existing files
83
- ```
84
-
85
- Upgrade from a legacy project that still has `docflow.config.json`:
86
-
87
- ```bash
88
- npx ai-spector docops migrate --from-docflow
89
- ```
90
-
91
- Then run `npx ai-spector upgrade apply` to sync the 4-skill scaffold. Full migration steps: [`kari-writer/contracts/MIGRATION.md`](../../kari-writer/contracts/MIGRATION.md) in the docs-ops meta-repo.
20
+ Public npm: drop `--registry …`.
92
21
 
93
- ### Upgrade (guided workflow)
94
-
95
- In chat: **"upgrade ai-spector"**
96
-
97
- Or CLI:
98
-
99
- ```bash
100
- npm install ai-spector@latest # public npm; add --registry … for Verdaccio
101
- npx ai-spector upgrade scan
102
- npx ai-spector upgrade apply --auto
103
- # complete manual steps from scan (MCP reload, enable skills, …)
104
- npx ai-spector upgrade validate
105
- ```
106
-
107
- The upgrade workflow scans a package checklist, syncs the **4-skill** scaffold, backfills config, and stamps `scaffoldVersion` in `engine.json` when complete.
108
-
109
- Legacy skills-only refresh:
110
-
111
- ```bash
112
- npx ai-spector sync-cursor # Cursor → .cursor/skills/, .cursor/rules/
113
- npx ai-spector sync-claude # Claude Code → CLAUDE.md, .claude/skills/
114
- ```
115
-
116
- Then **reload MCP** in your editor (`.cursor/mcp.json` or `.mcp.json`).
117
-
118
- | Command | What it updates |
119
- |---------|-----------------|
120
- | `upgrade scan` | Detect stale scaffold + config drift; list checklist items |
121
- | `upgrade apply` | Auto-fix scaffold sync, config backfill, hooks |
122
- | `upgrade validate` | Verify checklist complete; stamp `scaffoldVersion` |
123
- | `sync-cursor` | Cursor skills, routing rules, `WORKFLOW.md` under `.cursor/` |
124
- | `sync-claude` | `CLAUDE.md`, Claude skills and rules under `.claude/` |
125
-
126
- ### Step 2 — Finish setup in chat
22
+ **2. Finish in chat:**
127
23
 
128
24
  ```text
129
25
  setup ai-spector project
130
26
  ```
131
27
 
132
- The agent installs the npm dependency (if needed), verifies the checklist, and reminds you of any manual steps.
133
-
134
- ### Step 3 — Enable the agent *(manual, one-time)*
28
+ **3. Enable skills** (one-time): Settings Agent Skills turn on all four folders under `.cursor/skills/` (or `.claude/skills/`). Reload MCP.
135
29
 
136
- Enable the **4 skills** (not the retired 23-skill bundle):
137
-
138
- | Skill | Role |
139
- |-------|------|
140
- | `ai-spector` | Setup, upgrade, adopt, check, work sessions |
141
- | `ai-spector-generate` | SRS, basic/detail design, prototype, template import |
142
- | `ai-spector-graph` | Analyze, index, validate, impact, search, sync audit |
143
- | `ai-spector-contract` | Review sign-off, comments, prototype comments, translation |
144
-
145
- **Cursor:** Settings → Rules → **Agent Skills** — enable all four folders under `.cursor/skills/`. Reload MCP (`.cursor/mcp.json`).
146
-
147
- **Claude Code:** Skills load from `.claude/skills/`. Reload MCP (`.mcp.json`).
148
-
149
- ### Step 4 — Add source material
150
-
151
- Drop requirements into `docs/data-source/` (`.md`, `.txt`, `.pdf`).
152
-
153
- ### Step 5 — Start the pipeline
30
+ **4. Add sources** to `docs/data-source/`, then:
154
31
 
155
32
  ```text
156
33
  analyze my data source
157
34
  ```
158
35
 
159
- Continue in chat see [Workflow](#workflow) below.
36
+ Full routing map lives in `.cursor/WORKFLOW.md` or `CLAUDE.md` after init.
160
37
 
161
38
  ---
162
39
 
163
- ## Workflow
164
-
165
- After `init`, see `.cursor/WORKFLOW.md` (Cursor) or `CLAUDE.md` (Claude Code) for the 4-skill map.
40
+ ## What to say
166
41
 
167
- ### How chat routing works
42
+ Four skills say the goal; the agent reads the runbook and calls tools.
168
43
 
169
- | Piece | Role |
170
- |-------|------|
171
- | **Routing** | `_skill-router.md` + `ai-spector-routing.mdc` classify your message one of 4 skills; `workflow_route` when ambiguous |
172
- | **Skill** | One of four workflows (setup/work, generate, graph, contract) with a runbook under `references/` |
44
+ | Skill | You want to… | Say (examples) |
45
+ |-------|----------------|----------------|
46
+ | **ai-spector** | Setup, upgrade, adopt, check, docops, work sessions | `setup ai-spector project` · `upgrade ai-spector` · `check my workspace` · `migrate existing docs to docops` · `resume my SRS` |
47
+ | **ai-spector-generate** | SRS, design, prototype, one feature/section | `generate the SRS` · `generate basic design` · `generate prototype with Vue` · `I want to add login with Google` |
48
+ | **ai-spector-graph** | Index, validate, impact, search, drift | `validate the graph` · `re-index the graph` · `what's the impact of my changes` · `find mentions of rate limiting` |
49
+ | **ai-spector-contract** | Review, comments, translation | `review documents` · `approve srs/01-overview` · `resolve comments` · `add language vi` |
173
50
 
174
- Say what you want in natural language same in Cursor and Claude Code. The agent reads the matching skill and follows its runbook. If intent is unclear (especially **“approve”**), it asks once before acting.
51
+ **Approve** is ambiguous (document sign-off vs plan vs comment). The agent asks once if unclear.
175
52
 
176
- ### First run
53
+ ### Typical first run
177
54
 
178
55
  ```text
179
56
  analyze the data source
@@ -181,175 +58,63 @@ validate the graph
181
58
  generate the SRS
182
59
  ```
183
60
 
184
- Generation is **gated**: workspace check clarifying questions → plan table → your **yes, go ahead** → waves of writing → optional **SPEC-NNN** approval → index.
61
+ Generation is gated: clarify → plan table → your **yes, go ahead** → writing waves → optional spec approval → index.
185
62
 
186
63
  Then as needed:
187
64
 
188
65
  ```text
189
66
  generate basic design
190
67
  generate prototype
191
- refresh the index
192
68
  review documents
193
69
  ```
194
70
 
195
- **Prototype** — static HTML (default) or SPA (React/Vue → `prototype/dist/`). Say **“generate prototype”** or **“generate prototype with Vue”**. For themes: **“help me pick a theme”** or **“prototype with stripe theme”**. SPA: run framework build, then `npx ai-spector prototype sync`.
196
-
197
71
  ### Day to day
198
72
 
199
- | When | Say (examples) |
200
- |------|----------------|
201
- | New or changed sources | analyze data source |
202
- | Check graph | “validate the graph”, “graph report” |
203
- | Regenerate docs | “generate SRS”, “generate basic design” |
204
- | Pause / resume work | “active work”, “resume my SRS”, “pause work” |
205
- | One feature or section | “I want to add login with Google”, “update the auth section” |
206
- | After doc edits | “refresh the index”, “re-index the graph” |
207
- | Document sign-off | “review documents”, “approve srs/01-overview”, “what needs review” |
208
- | Comment threads | “resolve comments”, “show open comments” |
209
- | Impact / what to redo | “what’s the impact of my changes” |
210
- | Prototype | “generate prototype”, “prototype with stripe theme” |
211
- | Multi-language | “add language vi”, “resolve translations” — [course](docs/course/05-prototype/01-translations.md) |
212
- | Custom templates | “set up template pack”, `generate <pack-name>` — [course](docs/course/07-advanced/01-custom-templates.md) |
213
- | Semantic search *(CocoIndex)* | “find all mentions of rate limiting” |
214
- | Explore graph | “show the graph”, `npx ai-spector graph visualize --open` |
215
- | Check workspace | “check my workspace”, “why did pre-commit block me” |
216
-
217
- ### Typical path
218
-
219
- ```text
220
- docs/data-source/ → analyze → validate
221
- → generate SRS (clarify → plan → waves → specs) → index
222
- → basic design → prototype → review documents
223
- ```
224
-
225
- ---
226
-
227
- ## Optional — CocoIndex
228
-
229
- Enables semantic search MCP tools (`docs_search`, `graph_query_fuzzy`). Requires Python ≥ 3.11.
230
-
231
- ```text
232
- enable CocoIndex for this project
233
- ```
234
-
235
- See [docs/setup-guide.md](docs/setup-guide.md) for Postgres / embedding options.
73
+ | When | Say |
74
+ |------|-----|
75
+ | New or changed sources | `analyze data source` |
76
+ | After editing docs | `re-index the graph` |
77
+ | One section / feature | `update the auth section` · `I want to add …` |
78
+ | Stuck on setup | `check ai-spector setup` · `help` |
79
+ | Stale skills after upgrade | `upgrade ai-spector` |
80
+ | Optional semantic search | `enable CocoIndex for this project` |
236
81
 
237
82
  ---
238
83
 
239
- ## CLI *(scripts & debugging)*
240
-
241
- Most users stay in chat. Useful commands:
84
+ ## When chat is not enough
242
85
 
243
- ```bash
244
- npx ai-spector course serve --open # interactive course in browser
245
- npx ai-spector setup --check
246
- npx ai-spector docops status # assess .docops/ layout and Writer readiness
247
- npx ai-spector docops init --lang en # scaffold Writer-ready .docops/ contract
248
- npx ai-spector docops migrate --from-docflow # split legacy docflow.config.json
249
- npx ai-spector work list # active/paused work sessions (replaces task)
250
- npx ai-spector work resume <workId>
251
- npx ai-spector contract review queue # sign-off queue (capability: review)
252
- npx ai-spector contract comments inbox # open comment threads (capability: comments)
253
- npx ai-spector graph validate
254
- npx ai-spector graph visualize --open
255
- npx ai-spector graph impact --git
256
- npx ai-spector sync audit --fail-on-drift # CI: design-layer drift since baseline
257
- npx ai-spector prototype validate --strict
258
- ```
86
+ | Situation | Prompt first | CLI fallback |
87
+ |-----------|--------------|----------------|
88
+ | Audit setup | `check ai-spector setup` | `npx ai-spector setup --check` |
89
+ | Writer contract only | `docops status` | `npx ai-spector docops status --json` |
90
+ | Open course | `open the ai-spector course` | `npx ai-spector course serve --open` |
91
+ | Graph in browser | `show the graph` | `npx ai-spector graph visualize --open` |
259
92
 
260
- MCP tools are grouped: `work_*` (session lifecycle), `contract_review` / `contract_comments` / `contract_prototype` / `contract_translate` (Writer contract ops). Legacy `task_*` and flat review/comments tools remain as deprecation wrappers for one release.
261
-
262
- Full list: `npx ai-spector --help`.
93
+ Command reference: `npx ai-spector --help` · [cli-reference](scaffold/cursor/skills/ai-spector/references/cli-reference.md)
263
94
 
264
95
  ---
265
96
 
266
97
  ## If something breaks
267
98
 
268
- | Issue | Fix |
269
- |-------|-----|
270
- | MCP tools unavailable | Reload MCP; confirm `.cursor/mcp.json` or `.mcp.json` has `ai-spector` server |
271
- | Setup incomplete | **“check ai-spector setup”** |
272
- | Skills not routing (Cursor) | Re-enable all **4** skill folders under `.cursor/skills/` |
273
- | Validate errors after edits | **“re-index the graph”** |
274
- | Pre-commit hook missing | **“install ai-spector git hook”** |
275
- | Agent stuck on CLI error | `.cursor/skills/ai-spector/references/cli-failures.md` |
276
- | Stale skills after upgrade | [Upgrade (refresh skills & rules)](#upgrade-refresh-skills--rules) — `sync-cursor` / `sync-claude`, then reload MCP |
277
-
278
- ---
279
-
280
- ## Node SDK
281
-
282
- For scripts, CI, or custom backends:
283
-
284
- - **[SDK guide](docs/plan/sdk.md)** — install, entry points, API reference
285
-
286
- ```bash
287
- npm install ai-spector
288
- ```
289
-
290
- ```ts
291
- import { runIndex, runGraphImpact, validateGraph } from "ai-spector";
292
- ```
293
-
294
- ---
295
-
296
- ## Web / graph SDK
297
-
298
- For browser dashboards (read-only graph UI): npm package **`ai-spector-graph`**.
299
-
300
- - **[Integration guide](docs/ai-spector-graph-integration-guide.md)**
301
- - **[API reference](docs/ai-spector-graph.md)**
302
-
303
- ```bash
304
- npm install ai-spector-graph
305
- ```
99
+ | Issue | Say in chat |
100
+ |-------|-------------|
101
+ | MCP tools missing | Reload MCP; confirm `ai-spector` server in `.cursor/mcp.json` or `.mcp.json` |
102
+ | Setup incomplete | `check ai-spector setup` |
103
+ | Skills not routing | Re-enable all **4** skill folders |
104
+ | Validate errors after edits | `re-index the graph` |
105
+ | CLI errors | Agent uses [cli-failures](scaffold/cursor/skills/ai-spector/references/cli-failures.md) |
306
106
 
307
107
  ---
308
108
 
309
- ## Develop
310
-
311
- ```bash
312
- npm install && npm run build && npm test
313
- ```
314
-
315
- ### Release (bump version & publish)
316
-
317
- Version lives in `package.json`. Use the deploy script — it runs tests, optionally bumps semver, builds, and publishes.
109
+ ## More
318
110
 
319
- **Public npm:**
320
-
321
- ```bash
322
- npm run deploy:npm
323
- ```
324
-
325
- **Internal Verdaccio** (copy `.env.example` → `.env` first):
326
-
327
- ```bash
328
- npm run deploy
329
- ```
330
-
331
- The script prompts to bump **patch** (default), **minor**, or **major**. Override with env vars:
332
-
333
- | Variable | Effect |
334
- |----------|--------|
335
- | `BUMP=minor` | Bump minor instead of patch |
336
- | `SKIP_BUMP=1` | Publish current `package.json` version as-is |
337
- | `SKIP_TEST=1` | Skip `npm test` before publish |
338
-
339
- **Manual bump only** (no publish):
340
-
341
- ```bash
342
- npm version patch --no-git-tag-version # or minor | major
343
- ```
344
-
345
- `prepublishOnly` runs `npm run build` automatically before publish — fix build errors before retrying.
346
-
347
- Publish is implemented in **`scripts/deploy.sh`** (`npm run deploy` / `npm run deploy:npm`). Edit that script for registry URLs, auth prompts, or bump behavior.
348
-
349
- **Update scaffold bundles** (after editing `scaffold/cursor/`):
350
-
351
- ```bash
352
- npm run build:claude-scaffold # regenerate scaffold/claude/ from scaffold/cursor/
353
- ```
111
+ | Topic | Doc |
112
+ |-------|-----|
113
+ | Config (`.docops/` + `.ai-spector/`) | [CONTRACT.md](../kari-writer/contracts/CONTRACT.md) |
114
+ | Legacy migration | [MIGRATION.md](../kari-writer/contracts/MIGRATION.md) |
115
+ | Node SDK (scripts / CI) | [docs/plan/sdk.md](docs/plan/sdk.md) |
116
+ | Browser graph UI | [docs/ai-spector-graph-integration-guide.md](docs/ai-spector-graph-integration-guide.md) |
117
+ | CocoIndex setup | [docs/setup-guide.md](docs/setup-guide.md) |
118
+ | Contribute / publish | `npm install && npm run build && npm test` · `npm run deploy` (internal) · `npm run deploy:npm` (public) |
354
119
 
355
120
  MIT — [LICENSE](LICENSE).