knowzcode 0.4.0 → 0.5.2
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/.claude-plugin/marketplace.json +61 -61
- package/.claude-plugin/plugin.json +8 -8
- package/LICENSE +121 -121
- package/README.md +379 -354
- package/agents/analyst.md +114 -114
- package/agents/architect.md +200 -200
- package/agents/builder.md +104 -104
- package/agents/closer.md +177 -177
- package/agents/context-scout.md +54 -54
- package/agents/knowledge-migrator.md +349 -349
- package/agents/knowz-scout.md +83 -83
- package/agents/knowz-scribe.md +180 -180
- package/agents/microfix-specialist.md +135 -135
- package/agents/project-advisor.md +111 -111
- package/agents/reviewer.md +172 -172
- package/agents/security-officer.md +194 -194
- package/agents/test-advisor.md +162 -162
- package/agents/update-coordinator.md +394 -394
- package/bin/knowzcode.mjs +1457 -1199
- package/commands/audit.md +328 -328
- package/commands/connect-mcp.md +574 -549
- package/commands/fix.md +107 -107
- package/commands/init.md +616 -500
- package/commands/learn.md +332 -332
- package/commands/plan.md +272 -272
- package/commands/register.md +757 -733
- package/commands/status.md +338 -309
- package/commands/telemetry-setup.md +368 -368
- package/commands/telemetry.md +188 -188
- package/commands/work.md +1204 -1204
- package/knowzcode/automation_manifest.md +59 -59
- package/knowzcode/claude_code_execution.md +431 -431
- package/knowzcode/copilot_execution.md +231 -231
- package/knowzcode/enterprise/compliance_manifest.md +137 -137
- package/knowzcode/enterprise/compliance_status.md +30 -30
- package/knowzcode/enterprise/guidelines/code-quality.md +67 -67
- package/knowzcode/enterprise/guidelines/security.md +355 -355
- package/knowzcode/enterprise/templates/guideline-template.md +55 -55
- package/knowzcode/gitignore.template +13 -13
- package/knowzcode/knowzcode_architecture.md +51 -51
- package/knowzcode/knowzcode_log.md +142 -142
- package/knowzcode/knowzcode_loop.md +601 -596
- package/knowzcode/knowzcode_orchestration.md +66 -66
- package/knowzcode/knowzcode_project.md +48 -48
- package/knowzcode/knowzcode_tracker.md +40 -40
- package/knowzcode/knowzcode_vaults.md +257 -257
- package/knowzcode/mcp_config.md +196 -191
- package/knowzcode/planning/Readme.md +6 -6
- package/knowzcode/platform_adapters.md +2577 -1260
- package/knowzcode/prompts/Execute_Micro_Fix.md +57 -57
- package/knowzcode/prompts/Investigate_Codebase.md +227 -227
- package/knowzcode/prompts/Migrate_Knowledge.md +301 -301
- package/knowzcode/prompts/Refactor_Node.md +72 -72
- package/knowzcode/prompts/Spec_Verification_Checkpoint.md +59 -59
- package/knowzcode/prompts/[LOOP_1A]__Propose_Change_Set.md +52 -52
- package/knowzcode/prompts/[LOOP_1B]__Draft_Specs.md +75 -75
- package/knowzcode/prompts/[LOOP_2A]__Implement_Change_Set.md +55 -55
- package/knowzcode/prompts/[LOOP_2B]__Verify_Implementation.md +72 -72
- package/knowzcode/prompts/[LOOP_3]__Finalize_And_Commit.md +67 -67
- package/knowzcode/specs/Readme.md +10 -10
- package/knowzcode/telemetry_config.md +89 -89
- package/knowzcode/user_preferences.md +120 -120
- package/package.json +53 -53
- package/skills/alias-resolver.json +15 -15
- package/skills/architecture-diff.json +12 -12
- package/skills/check-installation-status.json +14 -14
- package/skills/continue.md +126 -126
- package/skills/environment-guard.json +12 -12
- package/skills/generate-workgroup-id.json +25 -25
- package/skills/install-knowzcode.json +21 -21
- package/skills/load-core-context.json +18 -18
- package/skills/log-entry-builder.json +15 -15
- package/skills/spec-quality-check.json +14 -14
- package/skills/spec-template.json +15 -15
- package/skills/spec-validator.json +25 -25
- package/skills/start-work.md +224 -224
- package/skills/tracker-scan.json +12 -12
- package/skills/tracker-update.json +28 -28
- package/skills/validate-installation.json +14 -14
package/commands/register.md
CHANGED
|
@@ -1,733 +1,757 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Register for KnowzCode and configure MCP server automatically
|
|
3
|
-
argument-hint: "[--scope <local|project|user>] [--dev]"
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# KnowzCode Registration
|
|
7
|
-
|
|
8
|
-
You are the **KnowzCode Registration Agent**. Your task is to guide users through account registration and automatically configure the MCP server connection.
|
|
9
|
-
|
|
10
|
-
## Command Syntax
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
/kc:register [--scope <local|project|user>] [--dev]
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
**Parameters:**
|
|
17
|
-
- `--scope <scope>` - Optional. Configuration scope: local (default), project, or user
|
|
18
|
-
- `--dev` - Optional. Use development environment instead of production
|
|
19
|
-
|
|
20
|
-
**Environments:**
|
|
21
|
-
| Environment | API Endpoint | MCP Endpoint | When to Use |
|
|
22
|
-
|:------------|:-------------|:-------------|:------------|
|
|
23
|
-
| **Production** (default) | `https://api.knowz.io/api/v1/auth/register` | `https://mcp.knowz.io/mcp` | Normal usage |
|
|
24
|
-
| **Development** | `https://api.dev.knowz.io/api/v1/auth/register` | `https://mcp.dev.knowz.io/mcp` | Testing new features |
|
|
25
|
-
|
|
26
|
-
**Examples:**
|
|
27
|
-
```bash
|
|
28
|
-
# Standard registration (production)
|
|
29
|
-
/kc:register
|
|
30
|
-
|
|
31
|
-
# Register with project-wide scope (production)
|
|
32
|
-
/kc:register --scope project
|
|
33
|
-
|
|
34
|
-
# Register with user-wide scope (production)
|
|
35
|
-
/kc:register --scope user
|
|
36
|
-
|
|
37
|
-
# Register against development environment
|
|
38
|
-
/kc:register --dev
|
|
39
|
-
|
|
40
|
-
# Development with specific scope
|
|
41
|
-
/kc:register --dev --scope project
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## What Registration Provides
|
|
45
|
-
|
|
46
|
-
Registering for KnowzCode gives you:
|
|
47
|
-
|
|
48
|
-
- **API Key** - Unique key for MCP server authentication
|
|
49
|
-
- **KnowzCode Vault** - Auto-created vault for learnings, conventions, and patterns
|
|
50
|
-
- **Vector Search** - AI-powered code search across your projects
|
|
51
|
-
- **Spec Queries** - Query your specifications and documentation
|
|
52
|
-
- **Context Retrieval** - Intelligent context for agent decisions
|
|
53
|
-
- **Dependency Analysis** - Understand code relationships
|
|
54
|
-
|
|
55
|
-
**Free tier includes:**
|
|
56
|
-
- 1,000 API calls/month
|
|
57
|
-
- Single user
|
|
58
|
-
- Basic vector search
|
|
59
|
-
|
|
60
|
-
**Upgrades available at:** https://knowz.io/pricing
|
|
61
|
-
|
|
62
|
-
## API Response Structure
|
|
63
|
-
|
|
64
|
-
The registration API returns:
|
|
65
|
-
|
|
66
|
-
```json
|
|
67
|
-
{
|
|
68
|
-
"api_key": "kz_live_abc123...",
|
|
69
|
-
"vault_id": "vault_xyz789...",
|
|
70
|
-
"vault_name": "KnowzCode"
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
This vault is automatically configured for you - no manual setup required.
|
|
75
|
-
|
|
76
|
-
## Your Task
|
|
77
|
-
|
|
78
|
-
Guide the user through registration **step-by-step, one question at a time**. This is an interactive conversational flow - do NOT ask multiple questions at once.
|
|
79
|
-
|
|
80
|
-
**CRITICAL: Interactive Flow Rules**
|
|
81
|
-
1. Ask ONE question, then WAIT for user response
|
|
82
|
-
2. After each response, validate and then ask the NEXT question
|
|
83
|
-
3. Never combine multiple questions into a single message
|
|
84
|
-
4. Use AskUserQuestion tool for each input collection step
|
|
85
|
-
5. After each AskUserQuestion, STOP and wait for the user's answer
|
|
86
|
-
|
|
87
|
-
### Conversation Flow Summary
|
|
88
|
-
|
|
89
|
-
```
|
|
90
|
-
YOU USER
|
|
91
|
-
─────────────────────────────────────────────────
|
|
92
|
-
1. Check MCP config
|
|
93
|
-
2. Welcome + Ask name ──────────► [User types name]
|
|
94
|
-
3. Validate name
|
|
95
|
-
4. Ask email ───────────────────► [User types email]
|
|
96
|
-
5. Validate email
|
|
97
|
-
6. Ask password ────────────────► [User types password]
|
|
98
|
-
7. Validate password
|
|
99
|
-
8. Show summary + confirm ──────► [User confirms: Yes/No/Edit]
|
|
100
|
-
9. Call API
|
|
101
|
-
10. Configure MCP + base vault
|
|
102
|
-
11. Vault discovery ───────────► [User: Yes/No to configure more]
|
|
103
|
-
12. (If Yes) Vault selection ──► [User selects vaults + descriptions]
|
|
104
|
-
13. Write vault config
|
|
105
|
-
14. Show success
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
### Steps to Execute
|
|
109
|
-
|
|
110
|
-
#### Step
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
**
|
|
180
|
-
|
|
181
|
-
**
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
Use AskUserQuestion to collect the
|
|
201
|
-
|
|
202
|
-
**Question:** "
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
**
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
- **
|
|
379
|
-
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
- **
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
After
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
```
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
##
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
•
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
•
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
###
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
1
|
+
---
|
|
2
|
+
description: Register for KnowzCode and configure MCP server automatically
|
|
3
|
+
argument-hint: "[--scope <local|project|user>] [--dev]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# KnowzCode Registration
|
|
7
|
+
|
|
8
|
+
You are the **KnowzCode Registration Agent**. Your task is to guide users through account registration and automatically configure the MCP server connection.
|
|
9
|
+
|
|
10
|
+
## Command Syntax
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
/kc:register [--scope <local|project|user>] [--dev]
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**Parameters:**
|
|
17
|
+
- `--scope <scope>` - Optional. Configuration scope: local (default), project, or user
|
|
18
|
+
- `--dev` - Optional. Use development environment instead of production
|
|
19
|
+
|
|
20
|
+
**Environments:**
|
|
21
|
+
| Environment | API Endpoint | MCP Endpoint | When to Use |
|
|
22
|
+
|:------------|:-------------|:-------------|:------------|
|
|
23
|
+
| **Production** (default) | `https://api.knowz.io/api/v1/auth/register` | `https://mcp.knowz.io/mcp` | Normal usage |
|
|
24
|
+
| **Development** | `https://api.dev.knowz.io/api/v1/auth/register` | `https://mcp.dev.knowz.io/mcp` | Testing new features |
|
|
25
|
+
|
|
26
|
+
**Examples:**
|
|
27
|
+
```bash
|
|
28
|
+
# Standard registration (production)
|
|
29
|
+
/kc:register
|
|
30
|
+
|
|
31
|
+
# Register with project-wide scope (production)
|
|
32
|
+
/kc:register --scope project
|
|
33
|
+
|
|
34
|
+
# Register with user-wide scope (production)
|
|
35
|
+
/kc:register --scope user
|
|
36
|
+
|
|
37
|
+
# Register against development environment
|
|
38
|
+
/kc:register --dev
|
|
39
|
+
|
|
40
|
+
# Development with specific scope
|
|
41
|
+
/kc:register --dev --scope project
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## What Registration Provides
|
|
45
|
+
|
|
46
|
+
Registering for KnowzCode gives you:
|
|
47
|
+
|
|
48
|
+
- **API Key** - Unique key for MCP server authentication
|
|
49
|
+
- **KnowzCode Vault** - Auto-created vault for learnings, conventions, and patterns
|
|
50
|
+
- **Vector Search** - AI-powered code search across your projects
|
|
51
|
+
- **Spec Queries** - Query your specifications and documentation
|
|
52
|
+
- **Context Retrieval** - Intelligent context for agent decisions
|
|
53
|
+
- **Dependency Analysis** - Understand code relationships
|
|
54
|
+
|
|
55
|
+
**Free tier includes:**
|
|
56
|
+
- 1,000 API calls/month
|
|
57
|
+
- Single user
|
|
58
|
+
- Basic vector search
|
|
59
|
+
|
|
60
|
+
**Upgrades available at:** https://knowz.io/pricing
|
|
61
|
+
|
|
62
|
+
## API Response Structure
|
|
63
|
+
|
|
64
|
+
The registration API returns:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"api_key": "kz_live_abc123...",
|
|
69
|
+
"vault_id": "vault_xyz789...",
|
|
70
|
+
"vault_name": "KnowzCode"
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
This vault is automatically configured for you - no manual setup required.
|
|
75
|
+
|
|
76
|
+
## Your Task
|
|
77
|
+
|
|
78
|
+
Guide the user through registration **step-by-step, one question at a time**. This is an interactive conversational flow - do NOT ask multiple questions at once.
|
|
79
|
+
|
|
80
|
+
**CRITICAL: Interactive Flow Rules**
|
|
81
|
+
1. Ask ONE question, then WAIT for user response
|
|
82
|
+
2. After each response, validate and then ask the NEXT question
|
|
83
|
+
3. Never combine multiple questions into a single message
|
|
84
|
+
4. Use AskUserQuestion tool for each input collection step
|
|
85
|
+
5. After each AskUserQuestion, STOP and wait for the user's answer
|
|
86
|
+
|
|
87
|
+
### Conversation Flow Summary
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
YOU USER
|
|
91
|
+
─────────────────────────────────────────────────
|
|
92
|
+
1. Check MCP config
|
|
93
|
+
2. Welcome + Ask name ──────────► [User types name]
|
|
94
|
+
3. Validate name
|
|
95
|
+
4. Ask email ───────────────────► [User types email]
|
|
96
|
+
5. Validate email
|
|
97
|
+
6. Ask password ────────────────► [User types password]
|
|
98
|
+
7. Validate password
|
|
99
|
+
8. Show summary + confirm ──────► [User confirms: Yes/No/Edit]
|
|
100
|
+
9. Call API
|
|
101
|
+
10. Configure MCP + base vault
|
|
102
|
+
11. Vault discovery ───────────► [User: Yes/No to configure more]
|
|
103
|
+
12. (If Yes) Vault selection ──► [User selects vaults + descriptions]
|
|
104
|
+
13. Write vault config
|
|
105
|
+
14. Show success
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Steps to Execute
|
|
109
|
+
|
|
110
|
+
#### Step 0: Smart Discovery
|
|
111
|
+
|
|
112
|
+
Before starting registration, check if user already has a KnowzCode API key:
|
|
113
|
+
|
|
114
|
+
1. Check `KNOWZ_API_KEY` environment variable
|
|
115
|
+
2. Check `knowzcode/mcp_config.md` — if `Connected: Yes`, existing config exists
|
|
116
|
+
3. Check cross-platform configs: `.gemini/settings.json`, `.vscode/mcp.json`, `.mcp.json`
|
|
117
|
+
- Extract Bearer token from Authorization headers if found
|
|
118
|
+
|
|
119
|
+
If existing API key found:
|
|
120
|
+
```
|
|
121
|
+
You already have a KnowzCode API key configured (ending ...{last4}) from {source}.
|
|
122
|
+
|
|
123
|
+
Options:
|
|
124
|
+
1. Use existing key — run /kc:connect-mcp to configure this platform
|
|
125
|
+
2. Register a new account anyway
|
|
126
|
+
3. Cancel
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
If user chooses option 1: advise running `/kc:connect-mcp` with discovered key.
|
|
130
|
+
If user chooses option 2: proceed with registration normally (Step 1).
|
|
131
|
+
If user chooses option 3: stop.
|
|
132
|
+
|
|
133
|
+
#### Step 1: Check Existing Configuration
|
|
134
|
+
|
|
135
|
+
1. Check if MCP server already configured:
|
|
136
|
+
```bash
|
|
137
|
+
CLAUDECODE= claude mcp get knowz
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
2. If already configured, display:
|
|
141
|
+
```
|
|
142
|
+
⚠️ KnowzCode MCP server is already configured.
|
|
143
|
+
|
|
144
|
+
Options:
|
|
145
|
+
1. Keep existing configuration (abort registration)
|
|
146
|
+
2. Remove existing and register new account
|
|
147
|
+
|
|
148
|
+
If you want to register a new account, the existing configuration
|
|
149
|
+
will be replaced with the new API key.
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Use AskUserQuestion to get user choice. If they choose to keep existing, STOP.
|
|
153
|
+
If they choose to continue, run `CLAUDECODE= claude mcp remove knowz` first.
|
|
154
|
+
|
|
155
|
+
3. If not configured: Continue to Step 2.
|
|
156
|
+
|
|
157
|
+
#### Step 2: Welcome Message and First Question
|
|
158
|
+
|
|
159
|
+
Display welcome message, then IMMEDIATELY ask the first question (name):
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
◆━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
163
|
+
◆ KnowzCode REGISTRATION
|
|
164
|
+
◆━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
165
|
+
|
|
166
|
+
Welcome! Let's set up your KnowzCode account.
|
|
167
|
+
|
|
168
|
+
This will:
|
|
169
|
+
1. Create your KnowzCode account
|
|
170
|
+
2. Generate an API key
|
|
171
|
+
3. Configure the MCP server automatically
|
|
172
|
+
|
|
173
|
+
I'll ask you a few questions one at a time.
|
|
174
|
+
All data transmitted securely over HTTPS.
|
|
175
|
+
Privacy policy: https://knowz.io/privacy
|
|
176
|
+
◆━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Then immediately use AskUserQuestion** to collect name:
|
|
180
|
+
|
|
181
|
+
**Question:** "What name would you like for your account?"
|
|
182
|
+
|
|
183
|
+
**STOP HERE and wait for user response.**
|
|
184
|
+
|
|
185
|
+
#### Step 3: Validate Name and Ask Email
|
|
186
|
+
|
|
187
|
+
After receiving the name:
|
|
188
|
+
|
|
189
|
+
**Validation:**
|
|
190
|
+
- Must be non-empty
|
|
191
|
+
- Must be 2-100 characters
|
|
192
|
+
- Allow: letters, spaces, hyphens, apostrophes
|
|
193
|
+
|
|
194
|
+
If invalid, explain the issue and re-prompt for name.
|
|
195
|
+
|
|
196
|
+
If valid, store the name and proceed to ask for email.
|
|
197
|
+
|
|
198
|
+
#### Step 4: Ask for Email
|
|
199
|
+
|
|
200
|
+
Use AskUserQuestion to collect the user's email:
|
|
201
|
+
|
|
202
|
+
**Question:** "What is your email address?"
|
|
203
|
+
|
|
204
|
+
**STOP HERE and wait for user response.**
|
|
205
|
+
|
|
206
|
+
#### Step 5: Validate Email and Ask Password
|
|
207
|
+
|
|
208
|
+
After receiving the email:
|
|
209
|
+
|
|
210
|
+
**Validation:**
|
|
211
|
+
- Must match email pattern (contains @ and domain)
|
|
212
|
+
- No leading/trailing whitespace
|
|
213
|
+
|
|
214
|
+
If invalid:
|
|
215
|
+
```
|
|
216
|
+
⚠️ Invalid email format.
|
|
217
|
+
Please enter a valid email address (e.g., user@example.com)
|
|
218
|
+
```
|
|
219
|
+
Re-prompt for email.
|
|
220
|
+
|
|
221
|
+
If valid, store the email and proceed to ask for password.
|
|
222
|
+
|
|
223
|
+
Use AskUserQuestion to collect the password:
|
|
224
|
+
|
|
225
|
+
**Question:** "Create a password (minimum 8 characters)"
|
|
226
|
+
|
|
227
|
+
Display this note with the question:
|
|
228
|
+
```
|
|
229
|
+
Your password will be sent securely over HTTPS to create your account.
|
|
230
|
+
It will NOT be stored locally or displayed in any logs.
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**STOP HERE and wait for user response.**
|
|
234
|
+
|
|
235
|
+
#### Step 6: Validate Password
|
|
236
|
+
|
|
237
|
+
After receiving the password:
|
|
238
|
+
|
|
239
|
+
**Validation:**
|
|
240
|
+
- Minimum 8 characters
|
|
241
|
+
|
|
242
|
+
If invalid:
|
|
243
|
+
```
|
|
244
|
+
⚠️ Password must be at least 8 characters.
|
|
245
|
+
```
|
|
246
|
+
Re-prompt for password.
|
|
247
|
+
|
|
248
|
+
If valid, store the password and proceed to confirmation.
|
|
249
|
+
|
|
250
|
+
#### Step 7: Confirm Details
|
|
251
|
+
|
|
252
|
+
Display collected information for confirmation:
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
◆━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
256
|
+
◆ CONFIRM REGISTRATION DETAILS
|
|
257
|
+
◆━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
258
|
+
|
|
259
|
+
Please confirm your registration details:
|
|
260
|
+
|
|
261
|
+
Name: {collected_name}
|
|
262
|
+
Email: {collected_email}
|
|
263
|
+
Password: ********
|
|
264
|
+
|
|
265
|
+
Is this correct?
|
|
266
|
+
◆━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Use AskUserQuestion with options:
|
|
270
|
+
- **Yes** - Proceed with registration
|
|
271
|
+
- **No** - Cancel registration
|
|
272
|
+
- **Edit** - Go back and re-enter information
|
|
273
|
+
|
|
274
|
+
**STOP HERE and wait for user response.**
|
|
275
|
+
|
|
276
|
+
- If "Edit": Return to Step 2 to re-collect all information (name first).
|
|
277
|
+
- If "No": Display cancellation message and STOP.
|
|
278
|
+
- If "Yes": Proceed to Step 8.
|
|
279
|
+
|
|
280
|
+
#### Step 8: Call Registration API
|
|
281
|
+
|
|
282
|
+
**Determine endpoint based on `--dev` flag:**
|
|
283
|
+
- If `--dev` flag present: Use `https://api.dev.knowz.io/api/v1/auth/register`
|
|
284
|
+
- Otherwise (default): Use `https://api.knowz.io/api/v1/auth/register`
|
|
285
|
+
|
|
286
|
+
Make HTTP POST request to registration endpoint:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
# Production (default)
|
|
290
|
+
curl -X POST https://api.knowz.io/api/v1/auth/register \
|
|
291
|
+
-H "Content-Type: application/json" \
|
|
292
|
+
-d '{
|
|
293
|
+
"name": "{collected_name}",
|
|
294
|
+
"email": "{collected_email}",
|
|
295
|
+
"password": "{collected_password}"
|
|
296
|
+
}'
|
|
297
|
+
|
|
298
|
+
# Development (with --dev flag)
|
|
299
|
+
curl -X POST https://api.dev.knowz.io/api/v1/auth/register \
|
|
300
|
+
-H "Content-Type: application/json" \
|
|
301
|
+
-d '{
|
|
302
|
+
"name": "{collected_name}",
|
|
303
|
+
"email": "{collected_email}",
|
|
304
|
+
"password": "{collected_password}"
|
|
305
|
+
}'
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
**Handle Response Codes:**
|
|
309
|
+
|
|
310
|
+
| Code | Meaning | Action |
|
|
311
|
+
|------|---------|--------|
|
|
312
|
+
| 200/201 | Success | Extract API key AND vault_id, continue to Step 9 |
|
|
313
|
+
| 400 | Validation error | Show error details, return to relevant step |
|
|
314
|
+
| 409 | Email exists | Show recovery options (see Error Handling) |
|
|
315
|
+
| 429 | Rate limited | Show wait message (see Error Handling) |
|
|
316
|
+
| 500+ | Server error | Show error and support link |
|
|
317
|
+
|
|
318
|
+
**Parse Response:**
|
|
319
|
+
- Extract `api_key` (or `apiKey` or `token` field)
|
|
320
|
+
- Extract `vault_id` (auto-created "KnowzCode" vault)
|
|
321
|
+
- Extract `vault_name` (typically "KnowzCode")
|
|
322
|
+
|
|
323
|
+
#### Step 9: Configure MCP, Vault, and Show Success
|
|
324
|
+
|
|
325
|
+
**On successful registration:**
|
|
326
|
+
|
|
327
|
+
1. **Extract from response:**
|
|
328
|
+
- API key (look for `apiKey`, `api_key`, or `token` field)
|
|
329
|
+
- Vault ID (look for `vault_id` or `vaultId` field)
|
|
330
|
+
- Vault name (look for `vault_name` or `vaultName` field, default: "KnowzCode")
|
|
331
|
+
|
|
332
|
+
2. **Parse scope** from command arguments (default: `local`)
|
|
333
|
+
|
|
334
|
+
3. **If scope is `project`**, show security warning:
|
|
335
|
+
```
|
|
336
|
+
⚠️ Security Note: Project Scope Selected
|
|
337
|
+
|
|
338
|
+
With project scope, your API key will be stored in .mcp.json
|
|
339
|
+
which is typically committed to git.
|
|
340
|
+
|
|
341
|
+
This is appropriate for:
|
|
342
|
+
• Team/shared API keys
|
|
343
|
+
• CI/CD automation keys
|
|
344
|
+
|
|
345
|
+
For personal keys, consider using --scope local (default)
|
|
346
|
+
|
|
347
|
+
Continue with project scope?
|
|
348
|
+
```
|
|
349
|
+
Use AskUserQuestion to confirm. If user declines, use `local` scope instead.
|
|
350
|
+
|
|
351
|
+
4. **Configure MCP server** (use same environment as registration):
|
|
352
|
+
```bash
|
|
353
|
+
# Production (default)
|
|
354
|
+
claude mcp add --transport http \
|
|
355
|
+
--scope <chosen-scope> \
|
|
356
|
+
knowz \
|
|
357
|
+
https://mcp.knowz.io/mcp \
|
|
358
|
+
--header "Authorization: Bearer <api_key>" \
|
|
359
|
+
--header "X-Project-Path: $(pwd)"
|
|
360
|
+
|
|
361
|
+
# Development (with --dev flag)
|
|
362
|
+
claude mcp add --transport http \
|
|
363
|
+
--scope <chosen-scope> \
|
|
364
|
+
knowz \
|
|
365
|
+
https://mcp.dev.knowz.io/mcp \
|
|
366
|
+
--header "Authorization: Bearer <api_key>" \
|
|
367
|
+
--header "X-Project-Path: $(pwd)"
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
5. **Verify MCP configuration**:
|
|
371
|
+
```bash
|
|
372
|
+
CLAUDECODE= claude mcp get knowz
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
6. **Configure vault in mcp_config.md**:
|
|
376
|
+
|
|
377
|
+
Check if `knowzcode/mcp_config.md` exists:
|
|
378
|
+
- If exists: **Merge** vault configuration (preserve existing Code Vault if set)
|
|
379
|
+
- If not exists: Create from template with vault configured
|
|
380
|
+
|
|
381
|
+
Update `knowzcode/mcp_config.md` with:
|
|
382
|
+
```markdown
|
|
383
|
+
# KnowzCode MCP Configuration
|
|
384
|
+
|
|
385
|
+
## Connection Status
|
|
386
|
+
- **Connected**: Yes
|
|
387
|
+
- **Endpoint**: {endpoint}
|
|
388
|
+
- **Last Verified**: {ISO timestamp}
|
|
389
|
+
- **API Key (last 4)**: {last 4 characters of the API key}
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
## Vaults
|
|
394
|
+
|
|
395
|
+
### Ecosystem Vault (Primary)
|
|
396
|
+
- **Vault ID**: {vault_id from registration}
|
|
397
|
+
- **Vault Name**: {vault_name from registration}
|
|
398
|
+
- **Purpose**: Decisions, conventions, security, integrations, business rules
|
|
399
|
+
- **Auto-configured**: Yes (via /kc:register)
|
|
400
|
+
|
|
401
|
+
### Code Vault (Optional)
|
|
402
|
+
- **Vault ID**: (not configured)
|
|
403
|
+
- **Purpose**: Implementation patterns, workarounds, performance
|
|
404
|
+
- **Note**: Code search uses local grep/glob by default.
|
|
405
|
+
Configure code vault for large codebases with /kc:connect-mcp --configure-vaults
|
|
406
|
+
|
|
407
|
+
### Finalizations Vault (Optional)
|
|
408
|
+
- **Vault ID**: (not configured)
|
|
409
|
+
- **Purpose**: WorkGroup completion summaries, outcome records
|
|
410
|
+
- **Note**: Finalizations vault tracks completed work.
|
|
411
|
+
Configure for teams that want searchable completion history.
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
**Edge case - existing vault config**:
|
|
415
|
+
If `knowzcode/mcp_config.md` already has an Ecosystem Vault ID configured:
|
|
416
|
+
- Use AskUserQuestion: "You already have a vault configured. Replace with new vault from registration? [Yes/No/Keep both]"
|
|
417
|
+
- If "Yes": Replace Ecosystem Vault ID
|
|
418
|
+
- If "No": Keep existing vault config
|
|
419
|
+
- If "Keep both": Add new vault as secondary
|
|
420
|
+
|
|
421
|
+
7. **Display success message** with vault info:
|
|
422
|
+
|
|
423
|
+
```
|
|
424
|
+
◆━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
425
|
+
◆ KnowzCode REGISTRATION COMPLETE
|
|
426
|
+
◆━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
427
|
+
|
|
428
|
+
✅ Account created and configured!
|
|
429
|
+
|
|
430
|
+
Account Details:
|
|
431
|
+
• Email: {email}
|
|
432
|
+
• API Key: {masked_key}
|
|
433
|
+
|
|
434
|
+
MCP Configuration:
|
|
435
|
+
• Scope: {chosen-scope}
|
|
436
|
+
• Endpoint: {endpoint}
|
|
437
|
+
• Environment: {Production OR Development}
|
|
438
|
+
• Status: Configured
|
|
439
|
+
|
|
440
|
+
Vault Configuration:
|
|
441
|
+
• Vault: {vault_name} ({vault_id prefix...})
|
|
442
|
+
• Purpose: Learnings, conventions, patterns
|
|
443
|
+
• Status: Ready for use
|
|
444
|
+
|
|
445
|
+
🔄 Please restart Claude Code to activate MCP features.
|
|
446
|
+
|
|
447
|
+
After restart, you'll have access to:
|
|
448
|
+
• search_knowledge - Vector search across vaults
|
|
449
|
+
• ask_question - AI Q&A with research mode
|
|
450
|
+
• create_knowledge - Save learnings (via /kc:learn)
|
|
451
|
+
• update_knowledge - Update existing knowledge items
|
|
452
|
+
|
|
453
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
454
|
+
|
|
455
|
+
📋 Next Steps:
|
|
456
|
+
1. Restart Claude Code
|
|
457
|
+
2. Verify connection: /kc:status
|
|
458
|
+
3. Try learning capture: /kc:learn "Your first insight"
|
|
459
|
+
4. Start building: /kc:work "your feature"
|
|
460
|
+
|
|
461
|
+
Need help? https://knowz.io/docs
|
|
462
|
+
◆━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
**Masking:**
|
|
466
|
+
- API Key: Show only first 6 and last 4 characters (e.g., `kz_liv...wxyz`)
|
|
467
|
+
- Vault ID: Show only first 8 characters (e.g., `vault_xy...`)
|
|
468
|
+
|
|
469
|
+
#### Step 9.5: Vault Discovery and Multi-Vault Selection
|
|
470
|
+
|
|
471
|
+
After MCP is configured and before showing the final success message, offer vault discovery:
|
|
472
|
+
|
|
473
|
+
1. **Fetch available vaults**
|
|
474
|
+
|
|
475
|
+
Use the `list_vaults` MCP tool (if available after restart) or display guidance:
|
|
476
|
+
|
|
477
|
+
```
|
|
478
|
+
◆━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
479
|
+
◆ VAULT CONFIGURATION
|
|
480
|
+
◆━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
481
|
+
|
|
482
|
+
Your account includes one vault by default:
|
|
483
|
+
• {vault_name} ({vault_id prefix...})
|
|
484
|
+
|
|
485
|
+
You can connect additional vaults for multi-vault routing.
|
|
486
|
+
This allows queries to be automatically routed to the right vault
|
|
487
|
+
based on the type of question (code vs. conventions vs. processes).
|
|
488
|
+
|
|
489
|
+
Would you like to configure additional vaults now?
|
|
490
|
+
◆━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
Use AskUserQuestion with options:
|
|
494
|
+
- **Yes** - Configure additional vaults now
|
|
495
|
+
- **No** - Skip for now (can configure later with /kc:connect-mcp --configure-vaults)
|
|
496
|
+
|
|
497
|
+
**STOP HERE and wait for user response.**
|
|
498
|
+
|
|
499
|
+
- If "No": Proceed to write single vault to `knowzcode_vaults.md` and show success message
|
|
500
|
+
- If "Yes": Continue with vault discovery
|
|
501
|
+
|
|
502
|
+
2. **Call list_vaults() to discover available vaults**
|
|
503
|
+
|
|
504
|
+
If MCP tools are already active (rare after fresh registration):
|
|
505
|
+
```
|
|
506
|
+
list_vaults(includeStats: true)
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
If MCP tools not yet available (common - requires restart):
|
|
510
|
+
```
|
|
511
|
+
Note: MCP tools require a restart to activate.
|
|
512
|
+
After restart, run /kc:connect-mcp --configure-vaults to add more vaults.
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
If vaults are returned, display them:
|
|
516
|
+
```
|
|
517
|
+
Available Vaults:
|
|
518
|
+
┌────┬──────────────────────┬──────────────────┬───────────┐
|
|
519
|
+
│ # │ Name │ Type │ Documents │
|
|
520
|
+
├────┼──────────────────────┼──────────────────┼───────────┤
|
|
521
|
+
│ 1 │ KnowzCode (default) │ ecosystem │ 0 │
|
|
522
|
+
│ 2 │ my-project-code │ code │ 1,234 │
|
|
523
|
+
│ 3 │ engineering-wiki │ ecosystem │ 89 │
|
|
524
|
+
└────┴──────────────────────┴──────────────────┴───────────┘
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
3. **Interactive vault selection loop**
|
|
528
|
+
|
|
529
|
+
For each vault discovered (including the default one):
|
|
530
|
+
|
|
531
|
+
a. Ask if user wants to connect this vault:
|
|
532
|
+
```
|
|
533
|
+
Would you like to connect vault "KnowzCode" (research)?
|
|
534
|
+
```
|
|
535
|
+
Options: [Yes] [No]
|
|
536
|
+
|
|
537
|
+
b. If "Yes", prompt for description:
|
|
538
|
+
```
|
|
539
|
+
Describe what this vault contains (for intelligent routing):
|
|
540
|
+
|
|
541
|
+
Example descriptions:
|
|
542
|
+
• "Team learnings, conventions, architectural decisions"
|
|
543
|
+
• "Source code for the main API project"
|
|
544
|
+
• "Company processes, onboarding docs, team structure"
|
|
545
|
+
|
|
546
|
+
This helps KnowzCode route queries to the right vault automatically.
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
Use AskUserQuestion to collect description (free text).
|
|
550
|
+
|
|
551
|
+
c. Store vault info: ID, name, type, description
|
|
552
|
+
|
|
553
|
+
d. Ask if user wants to connect another vault:
|
|
554
|
+
```
|
|
555
|
+
Would you like to connect another vault?
|
|
556
|
+
```
|
|
557
|
+
Options: [Yes] [No]
|
|
558
|
+
|
|
559
|
+
- If "Yes" and more vaults available: Loop back to step a
|
|
560
|
+
- If "No" or no more vaults: Exit loop
|
|
561
|
+
|
|
562
|
+
4. **Write vault configuration to knowzcode_vaults.md**
|
|
563
|
+
|
|
564
|
+
Create or update `knowzcode/knowzcode_vaults.md` with selected vaults:
|
|
565
|
+
|
|
566
|
+
```markdown
|
|
567
|
+
# KnowzCode Vault Configuration
|
|
568
|
+
|
|
569
|
+
Multi-vault routing configuration for intelligent vault selection.
|
|
570
|
+
|
|
571
|
+
---
|
|
572
|
+
|
|
573
|
+
## Connected Vaults
|
|
574
|
+
|
|
575
|
+
### {vault_id_1}
|
|
576
|
+
- **Name**: {vault_name}
|
|
577
|
+
- **ID**: {vault_id}
|
|
578
|
+
- **Type**: {code | ecosystem | finalizations}
|
|
579
|
+
- **Description**: {user_provided_description}
|
|
580
|
+
|
|
581
|
+
### {vault_id_2}
|
|
582
|
+
- **Name**: {vault_name}
|
|
583
|
+
- **ID**: {vault_id}
|
|
584
|
+
- **Type**: {code | ecosystem | finalizations}
|
|
585
|
+
- **Description**: {user_provided_description}
|
|
586
|
+
|
|
587
|
+
---
|
|
588
|
+
|
|
589
|
+
## Vault Routing Rules
|
|
590
|
+
|
|
591
|
+
- **Code questions** (implementations, files, structure) → {first code vault}
|
|
592
|
+
- **Convention questions** (patterns, decisions, best practices) → {first ecosystem vault}
|
|
593
|
+
- **Completion records** → {first finalizations vault}
|
|
594
|
+
- **Learning capture** → {default ecosystem vault}
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
**Null GUID detection**: After writing vault configuration to `knowzcode_vaults.md`, check for entries with empty **ID** fields. If found, prompt: "Found {N} default vault(s) not yet created. Create them now?" On confirmation, create each vault via MCP and update the ID fields.
|
|
598
|
+
|
|
599
|
+
5. **Show vault configuration summary**
|
|
600
|
+
|
|
601
|
+
After writing configuration:
|
|
602
|
+
```
|
|
603
|
+
Vault configuration saved to knowzcode/knowzcode_vaults.md
|
|
604
|
+
|
|
605
|
+
Connected Vaults:
|
|
606
|
+
• KnowzCode (ecosystem) - "Team learnings and conventions"
|
|
607
|
+
• my-code (code) - "Source code for API project"
|
|
608
|
+
|
|
609
|
+
Queries will be automatically routed based on your descriptions.
|
|
610
|
+
You can edit knowzcode/knowzcode_vaults.md to update routing rules.
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
## Error Handling
|
|
614
|
+
|
|
615
|
+
### Email Already Registered (HTTP 409)
|
|
616
|
+
|
|
617
|
+
```
|
|
618
|
+
⚠️ Email Already Registered
|
|
619
|
+
|
|
620
|
+
The email {email} is already associated with a KnowzCode account.
|
|
621
|
+
|
|
622
|
+
Options:
|
|
623
|
+
1. Use a different email → Run /kc:register again
|
|
624
|
+
2. Retrieve existing API key → Visit https://knowz.io/api-keys
|
|
625
|
+
3. Reset password → https://knowz.io/forgot-password
|
|
626
|
+
|
|
627
|
+
If this is your account, you can configure your existing key:
|
|
628
|
+
/kc:connect-mcp <your-existing-api-key>
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
### Invalid Input (HTTP 400)
|
|
632
|
+
|
|
633
|
+
```
|
|
634
|
+
❌ Registration Failed
|
|
635
|
+
|
|
636
|
+
The server reported validation errors:
|
|
637
|
+
{error_message_from_response}
|
|
638
|
+
|
|
639
|
+
Please correct the issue and try again.
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
Return to the step corresponding to the invalid field.
|
|
643
|
+
|
|
644
|
+
### Rate Limited (HTTP 429)
|
|
645
|
+
|
|
646
|
+
```
|
|
647
|
+
⏳ Too Many Requests
|
|
648
|
+
|
|
649
|
+
Registration is temporarily rate limited.
|
|
650
|
+
Please wait a few minutes and try again.
|
|
651
|
+
|
|
652
|
+
If you continue to see this error, contact support:
|
|
653
|
+
https://knowz.io/support
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
### Network Error
|
|
657
|
+
|
|
658
|
+
```
|
|
659
|
+
❌ Network Error
|
|
660
|
+
|
|
661
|
+
Cannot reach KnowzCode registration server.
|
|
662
|
+
|
|
663
|
+
Troubleshooting:
|
|
664
|
+
1. Check your internet connection
|
|
665
|
+
2. Verify firewall/proxy settings allow HTTPS to api.knowz.io (or api.dev.knowz.io for --dev)
|
|
666
|
+
3. Try again in a few moments
|
|
667
|
+
|
|
668
|
+
If the issue persists:
|
|
669
|
+
• Status page: https://status.knowz.io
|
|
670
|
+
• Support: https://knowz.io/support
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
### Server Error (HTTP 500+)
|
|
674
|
+
|
|
675
|
+
```
|
|
676
|
+
❌ Server Error
|
|
677
|
+
|
|
678
|
+
KnowzCode registration service encountered an error.
|
|
679
|
+
|
|
680
|
+
This is not your fault. Please:
|
|
681
|
+
1. Try again in a few minutes
|
|
682
|
+
2. Check status: https://status.knowz.io
|
|
683
|
+
3. Contact support if persists: https://knowz.io/support
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
### MCP Configuration Failed
|
|
687
|
+
|
|
688
|
+
If registration succeeds but MCP configuration fails:
|
|
689
|
+
|
|
690
|
+
```
|
|
691
|
+
⚠️ Account Created, but MCP Configuration Failed
|
|
692
|
+
|
|
693
|
+
Your account was created successfully:
|
|
694
|
+
• Email: {email}
|
|
695
|
+
• API Key: {masked_key}
|
|
696
|
+
• Vault: {vault_name} ({vault_id prefix...})
|
|
697
|
+
|
|
698
|
+
However, automatic MCP configuration failed:
|
|
699
|
+
{error_details}
|
|
700
|
+
|
|
701
|
+
You can configure manually:
|
|
702
|
+
/kc:connect-mcp {masked_key}
|
|
703
|
+
|
|
704
|
+
Or visit https://knowz.io/api-keys to retrieve your key later.
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
### API Response Missing Vault ID
|
|
708
|
+
|
|
709
|
+
If registration succeeds but API returns no vault_id:
|
|
710
|
+
|
|
711
|
+
```
|
|
712
|
+
⚠️ Account Created, but Vault Not Provisioned
|
|
713
|
+
|
|
714
|
+
Your account was created and MCP is configured:
|
|
715
|
+
• Email: {email}
|
|
716
|
+
• API Key: {masked_key}
|
|
717
|
+
• MCP: Configured
|
|
718
|
+
|
|
719
|
+
However, no vault was auto-created. This may indicate:
|
|
720
|
+
• Account provisioning is still in progress
|
|
721
|
+
• Server-side configuration needed
|
|
722
|
+
|
|
723
|
+
You can:
|
|
724
|
+
1. Wait a few minutes and run /kc:status to check
|
|
725
|
+
2. Contact support: https://knowz.io/support
|
|
726
|
+
3. Manually configure vault later: /kc:connect-mcp --configure-vaults
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
## Security Considerations
|
|
730
|
+
|
|
731
|
+
### Data Protection
|
|
732
|
+
- **HTTPS only** - All API calls use HTTPS
|
|
733
|
+
- **Password not stored** - Password sent once, never saved locally
|
|
734
|
+
- **Password not logged** - Never display password in output
|
|
735
|
+
- **Minimal data** - Only collect what's needed for registration
|
|
736
|
+
|
|
737
|
+
### API Key Security
|
|
738
|
+
- **Mask displayed keys**: Show only `kz_abc...xyz` format (first 6 + last 4 chars)
|
|
739
|
+
- **Never log full keys**: Exclude from any diagnostic output
|
|
740
|
+
- **Warn about project scope**: If `--scope project`, warn that API key will be in `.mcp.json`
|
|
741
|
+
- **Recommend local scope**: Default to most secure option
|
|
742
|
+
|
|
743
|
+
## Scope Comparison
|
|
744
|
+
|
|
745
|
+
| Scope | Storage | Visibility | Best For |
|
|
746
|
+
|-------|---------|------------|----------|
|
|
747
|
+
| **local** (default) | Claude Code internal | Only you, this project | Personal development |
|
|
748
|
+
| **project** | `.mcp.json` (git) | Team via git | Shared team key |
|
|
749
|
+
| **user** | Claude Code user config | Only you, all projects | Personal, multi-project |
|
|
750
|
+
|
|
751
|
+
## Related Commands
|
|
752
|
+
|
|
753
|
+
- `/kc:connect-mcp` - Configure MCP with existing API key
|
|
754
|
+
- `/kc:status` - Check MCP connection status
|
|
755
|
+
- `/kc:init` - Initialize KnowzCode in project
|
|
756
|
+
|
|
757
|
+
Execute this registration flow now.
|