knowzcode 0.3.1 → 0.3.6
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 +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +1 -1
- package/agents/analyst.md +31 -0
- package/agents/architect.md +67 -0
- package/agents/closer.md +6 -1
- package/agents/knowz-scribe.md +60 -35
- package/agents/project-advisor.md +4 -3
- package/commands/connect-mcp.md +29 -5
- package/commands/learn.md +6 -1
- package/commands/register.md +5 -5
- package/commands/status.md +1 -1
- package/commands/work.md +154 -24
- package/knowzcode/claude_code_execution.md +28 -10
- package/knowzcode/knowzcode_loop.md +13 -3
- package/knowzcode/knowzcode_vaults.md +37 -13
- package/knowzcode/platform_adapters.md +65 -7
- package/package.json +1 -1
- package/skills/alias-resolver.json +1 -1
- package/skills/architecture-diff.json +1 -1
- package/skills/check-installation-status.json +1 -1
- package/skills/environment-guard.json +1 -1
- package/skills/generate-workgroup-id.json +1 -1
- package/skills/install-knowzcode.json +1 -1
- package/skills/load-core-context.json +1 -1
- package/skills/log-entry-builder.json +1 -1
- package/skills/spec-quality-check.json +1 -1
- package/skills/spec-template.json +1 -1
- package/skills/spec-validator.json +1 -1
- package/skills/tracker-scan.json +1 -1
- package/skills/tracker-update.json +1 -1
- package/skills/validate-installation.json +1 -1
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Official KnowzCode plugin marketplace - Platform-agnostic AI development methodology",
|
|
9
|
-
"version": "0.3.
|
|
9
|
+
"version": "0.3.6"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "kc",
|
|
14
14
|
"source": "./",
|
|
15
15
|
"description": "KnowzCode - Platform-agnostic AI development methodology with TDD, quality gates, and structured workflows",
|
|
16
|
-
"version": "0.3.
|
|
16
|
+
"version": "0.3.6",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "Alex Headscarf"
|
|
19
19
|
},
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
[](https://github.com/knowz-io/knowzcode)
|
|
9
|
-
[](https://github.com/knowz-io/knowzcode/releases)
|
|
10
10
|
|
|
11
11
|
[Installation](#installation) · [Quick Start](#quick-start) · [When to Use It](#when-to-use-knowzcode) · [How It Works](#how-it-works) · [Commands](#commands) · [Docs](#documentation)
|
|
12
12
|
|
package/agents/analyst.md
CHANGED
|
@@ -59,6 +59,37 @@ If MCP is configured:
|
|
|
59
59
|
|
|
60
60
|
If MCP is not available, use standard grep/glob. All analysis works without MCP.
|
|
61
61
|
|
|
62
|
+
## Preliminary Findings Protocol (Parallel Teams Only)
|
|
63
|
+
|
|
64
|
+
When running in Parallel Teams mode and the architect is alive during Stage 0, stream preliminary NodeID findings as you discover them. This lets the architect start speculative research while you complete your full analysis.
|
|
65
|
+
|
|
66
|
+
### Rules
|
|
67
|
+
- Max **3** `[PRELIMINARY]` DMs to the architect
|
|
68
|
+
- Send each DM as soon as you have high-confidence evidence for a NodeID — don't batch
|
|
69
|
+
- Do NOT wait for scouts to finish; send findings from your own scanning
|
|
70
|
+
- If the change is clearly a 1-NodeID micro-change, skip this protocol (no DMs needed)
|
|
71
|
+
- Sequential mode: skip this protocol entirely (no architect to DM)
|
|
72
|
+
|
|
73
|
+
### Message Format
|
|
74
|
+
```
|
|
75
|
+
[PRELIMINARY] NodeID: {PascalCaseName} | Affected: {comma-separated file paths} | Risk: {low/medium/high} | Spec: {new/update-existing}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Example
|
|
79
|
+
```
|
|
80
|
+
[PRELIMINARY] NodeID: UserAuth | Affected: src/auth/login.ts, src/auth/middleware.ts | Risk: medium | Spec: new
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### When to Send
|
|
84
|
+
- After your first targeted grep confirms a distinct domain area is affected
|
|
85
|
+
- After reading a key file reveals cross-cutting impact worth a separate NodeID
|
|
86
|
+
- After scanner broadcasts confirm a new area you hadn't yet identified
|
|
87
|
+
|
|
88
|
+
### What NOT to Send
|
|
89
|
+
- Speculative NodeIDs you haven't confirmed with at least one file read
|
|
90
|
+
- Duplicate findings (same NodeID already sent)
|
|
91
|
+
- Consolidation updates (save those for the final Change Set)
|
|
92
|
+
|
|
62
93
|
## Exit Expectations
|
|
63
94
|
|
|
64
95
|
- Produce a complete Change Set (format defined in `knowzcode_loop.md` section 3.1)
|
package/agents/architect.md
CHANGED
|
@@ -84,6 +84,73 @@ Provide a structured Architecture Health Report at each quality gate. This is a
|
|
|
84
84
|
- Recommendation: {proceed / fix drift}
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
+
## Speculative Research Protocol (Parallel Teams Only)
|
|
88
|
+
|
|
89
|
+
During Stage 0, after completing your standard pre-load (architecture docs, existing specs, project config), use remaining idle time to conduct speculative research based on `[PRELIMINARY]` NodeID messages from the analyst.
|
|
90
|
+
|
|
91
|
+
### Rules
|
|
92
|
+
- **READ-ONLY** — do NOT write any files, create tasks, or modify specs
|
|
93
|
+
- Research only — gather context for faster spec drafting after Gate #1
|
|
94
|
+
- Graceful degradation: if no `[PRELIMINARY]` DMs arrive, just finish standard pre-load and wait
|
|
95
|
+
- Max research scope: files mentioned in `[PRELIMINARY]` messages + their immediate imports/dependencies
|
|
96
|
+
|
|
97
|
+
### What To Research
|
|
98
|
+
For each `[PRELIMINARY]` NodeID received:
|
|
99
|
+
1. Read the affected files listed in the message
|
|
100
|
+
2. Check `knowzcode/specs/*.md` for existing specs in the same domain (consolidation check)
|
|
101
|
+
3. Analyze interface patterns — what public APIs exist, what contracts would a spec need to define
|
|
102
|
+
4. Note cross-NodeID dependencies if multiple `[PRELIMINARY]` messages share files or interfaces
|
|
103
|
+
|
|
104
|
+
### What NOT To Do
|
|
105
|
+
- Draft specs or write any content to disk
|
|
106
|
+
- Create tasks or assign work
|
|
107
|
+
- Send DMs to the analyst (don't interrupt their scanning)
|
|
108
|
+
- Research areas NOT mentioned in `[PRELIMINARY]` messages (stick to what the analyst flagged)
|
|
109
|
+
|
|
110
|
+
### Outcome
|
|
111
|
+
By Gate #1, you should have ~80% of the research done for flagged NodeIDs. When the lead sends the approved Change Set and creates spec-drafting tasks, you can begin drafting immediately with deep context already loaded.
|
|
112
|
+
|
|
113
|
+
## Parallel Spec Coordination (Parallel Teams — 3+ NodeIDs)
|
|
114
|
+
|
|
115
|
+
When the approved Change Set contains **3 or more NodeIDs**, the lead spawns temporary spec-drafter agents to parallelize spec drafting. You coordinate this process.
|
|
116
|
+
|
|
117
|
+
### Threshold
|
|
118
|
+
- **1-2 NodeIDs**: You draft all specs alone (current behavior, zero overhead)
|
|
119
|
+
- **3+ NodeIDs**: Lead spawns spec-drafters, you coordinate and review
|
|
120
|
+
|
|
121
|
+
### Your Coordination Role
|
|
122
|
+
|
|
123
|
+
#### 1. Partition NodeIDs
|
|
124
|
+
When the lead DMs you the approved Change Set with 3+ NodeIDs:
|
|
125
|
+
- Group NodeIDs into partitions of 1-2 each
|
|
126
|
+
- Constraints:
|
|
127
|
+
- NodeIDs targeting the **same existing spec** MUST be in the same partition
|
|
128
|
+
- NodeIDs with **interface dependencies** (one consumes the other's output) SHOULD be together
|
|
129
|
+
- Max 3 spec-drafter partitions (`ceil(NodeID_count / 2)`, capped at 3)
|
|
130
|
+
- Reply to the lead with your proposed partition plan
|
|
131
|
+
|
|
132
|
+
#### 2. Brief Each Drafter
|
|
133
|
+
For each spec-drafter partition, prepare a briefing (the lead includes this in the spawn prompt):
|
|
134
|
+
- Research findings from Speculative Research (file contents, interface analysis, consolidation notes)
|
|
135
|
+
- Cross-NodeID interface constraints (e.g., "NodeID-A's UserService is consumed by NodeID-B")
|
|
136
|
+
- Consolidation instructions (update existing spec vs. create new)
|
|
137
|
+
- VERIFY criteria guidance based on your architecture review
|
|
138
|
+
|
|
139
|
+
#### 3. Consistency Review
|
|
140
|
+
After all spec-drafters complete their specs:
|
|
141
|
+
- Read all drafted specs
|
|
142
|
+
- Check cross-spec alignment: naming consistency, interface compatibility, no conflicting decisions
|
|
143
|
+
- Verify VERIFY criteria coverage: every NodeID has 2+ VERIFY statements, no gaps
|
|
144
|
+
- Check consolidation: specs that should share a file do share a file
|
|
145
|
+
- Fix any inconsistencies directly (you have Write/Edit tools)
|
|
146
|
+
- Report consistency review results to the lead
|
|
147
|
+
|
|
148
|
+
### What Spec-Drafters Do
|
|
149
|
+
Spec-drafters use your same agent definition (`architect`) with a scoped spawn prompt. They:
|
|
150
|
+
- Draft specs for their assigned NodeIDs using the 4-section format
|
|
151
|
+
- Follow the same Consolidation Mandate and Spec Philosophy as you
|
|
152
|
+
- Shut down after their specs are drafted (before your consistency review)
|
|
153
|
+
|
|
87
154
|
## During Implementation (Parallel Teams — Consultative Role)
|
|
88
155
|
|
|
89
156
|
When builders are implementing, you persist as a read-only consultative resource:
|
package/agents/closer.md
CHANGED
|
@@ -61,12 +61,17 @@ Scan the WorkGroup for insight-worthy patterns using the signal types from `know
|
|
|
61
61
|
### Knowz-Scribe Delegation (Parallel Teams)
|
|
62
62
|
|
|
63
63
|
If knowz-scribe is active (Parallel Teams mode with MCP connected):
|
|
64
|
-
-
|
|
64
|
+
- Create capture task: `TaskCreate("Scribe: Capture Phase 3")` → `TaskUpdate(owner: "knowz-scribe")`
|
|
65
|
+
- Send DM to **knowz-scribe** with task ID: `"Capture Phase 3: {wgid}. Your task: #{task-id}"`
|
|
65
66
|
- Do NOT call `create_knowledge` directly — the scribe owns all vault writes
|
|
67
|
+
- Note: The lead waits for the scribe's capture task to complete before shutdown. The closer does NOT wait — create the task, send the DM, and continue finalization.
|
|
66
68
|
|
|
67
69
|
### Direct Write Fallback (Sequential/Subagent)
|
|
68
70
|
|
|
69
71
|
If knowz-scribe is NOT active but MCP is configured:
|
|
72
|
+
|
|
73
|
+
> **Content Detail Principle**: Vault entries are retrieved via semantic search — write detailed, self-contained content with full reasoning, technology names, and code examples. See `knowzcode/knowzcode_vaults.md`.
|
|
74
|
+
|
|
70
75
|
1. Read `knowzcode/knowzcode_vaults.md` to discover configured vaults
|
|
71
76
|
2. For each learning type, find the appropriate vault by type:
|
|
72
77
|
- Pattern/Workaround/Performance → vault with type `code`
|
package/agents/knowz-scribe.md
CHANGED
|
@@ -40,22 +40,32 @@ This catches MCP issues at Stage 0 instead of 10+ minutes later at first capture
|
|
|
40
40
|
|
|
41
41
|
## Capture Request Format
|
|
42
42
|
|
|
43
|
-
You receive
|
|
43
|
+
You receive capture requests from the lead or other agents in three forms:
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
Capture Phase {phase}: {wgid}
|
|
47
|
-
```
|
|
45
|
+
### Phase Captures (task-tracked)
|
|
46
|
+
Format: `"Capture Phase {phase}: {wgid}. Your task: #{task-id}"`
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
- `
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
Triggered at quality gates. Read the WorkGroup file, extract phase-specific content, write to appropriate vaults.
|
|
49
|
+
|
|
50
|
+
### Explicit Ad-Hoc: `"Log: {description}"`
|
|
51
|
+
A teammate has identified knowledge worth capturing and is telling you to write it.
|
|
52
|
+
You MUST write it — decide which vault based on content type using the Learning Category Routing table.
|
|
53
|
+
Apply standard dedup checking. If a task ID is included, track it.
|
|
54
|
+
|
|
55
|
+
### Soft Ad-Hoc: `"Consider: {description}"`
|
|
56
|
+
A teammate is forwarding something that MIGHT be worth capturing — a catch-all.
|
|
57
|
+
Evaluate the content against the Learning Category signal types (Pattern, Decision, Workaround, Performance, Security, Convention).
|
|
58
|
+
If it's insight-worthy and not duplicative, write it. If not, skip silently.
|
|
59
|
+
The sender is not asking you to log it — they're asking you to use your judgement.
|
|
54
60
|
|
|
55
61
|
## Write Process
|
|
56
62
|
|
|
57
63
|
For each capture request:
|
|
58
64
|
|
|
65
|
+
### Step 0: Claim Task
|
|
66
|
+
|
|
67
|
+
If a pre-created task exists for this capture (task ID provided in the capture message), claim it immediately (`TaskUpdate(taskId, status: "in_progress")`). After completing all vault writes for this capture, mark the task complete with a summary (count of items written + vault names). If no task ID was provided (ad-hoc messages), proceed without task tracking.
|
|
68
|
+
|
|
59
69
|
### Step 1: Read Context
|
|
60
70
|
|
|
61
71
|
1. Read the WorkGroup file (`knowzcode/workgroups/{wgid}.md`) to extract relevant content for the phase
|
|
@@ -90,9 +100,11 @@ If multiple vaults match the target type, use the first one listed in `knowzcode
|
|
|
90
100
|
|
|
91
101
|
For each target vault, apply its **Content Filter** to format the `create_knowledge` payload:
|
|
92
102
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
- **
|
|
103
|
+
> **Content Detail Principle**: Vault entries are retrieved via semantic search, not read directly like local files. Every entry must be self-contained and detailed — include full reasoning, specific technology names, code examples, file paths, and error messages. A terse entry like `"[Risk] Medium"` is useless when retrieved months later. See `knowzcode/knowzcode_vaults.md` for the full principle and examples.
|
|
104
|
+
|
|
105
|
+
- **Title**: Use the appropriate prefix (`Pattern:`, `Decision:`, `Workaround:`, `Performance:`, `Security:`, `Convention:`, `Scope:`, `Audit:`, `Integration:`, `Completion:`) followed by a descriptive summary including key technology names for search discoverability
|
|
106
|
+
- **Content**: Follow the content filter structure defined for the vault type — fill every field with enough detail that the entry is useful without any other context
|
|
107
|
+
- **Tags**: Include learning category, phase, domain-relevant tags, and specific technology names
|
|
96
108
|
- **Source**: `KnowzCode WorkGroup {wgid}`
|
|
97
109
|
|
|
98
110
|
### Step 4: Dedup Check
|
|
@@ -107,49 +119,62 @@ Call `create_knowledge` with the formatted payload for each target vault.
|
|
|
107
119
|
|
|
108
120
|
### Phase 1A (Scope Approved)
|
|
109
121
|
Extract from WorkGroup:
|
|
110
|
-
- NodeIDs
|
|
111
|
-
- Risk assessment
|
|
112
|
-
-
|
|
122
|
+
- **NodeIDs**: List each with its description, affected files, and domain area
|
|
123
|
+
- **Risk assessment**: Include the full reasoning — what could break, which files are high-risk, what mitigation is planned. Never write just "Medium"
|
|
124
|
+
- **Scope decisions**: What was included/excluded and why — alternatives the user considered
|
|
113
125
|
- Write to: `ecosystem` vault (or single vault)
|
|
114
126
|
|
|
115
127
|
### Phase 2A (Implementation Complete)
|
|
116
128
|
Extract from WorkGroup:
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
129
|
+
- **Patterns discovered**: Describe the pattern, why it was needed, how it works, and include file paths or code snippets. E.g., "Created retry wrapper in src/utils/retry.ts using exponential backoff with jitter for all external API calls"
|
|
130
|
+
- **Workarounds**: What limitation was hit, what the workaround does, and any upstream fix to watch for
|
|
131
|
+
- **New utilities or abstractions**: What was created, its API surface, and where it's used
|
|
132
|
+
- **Performance optimizations**: Before/after metrics, the technique used, and any trade-offs
|
|
120
133
|
- Write to: `code` vault for patterns/workarounds/performance, `ecosystem` vault for decisions
|
|
121
134
|
|
|
122
135
|
### Phase 2B (Audit Complete)
|
|
123
136
|
Extract from WorkGroup:
|
|
124
|
-
- Audit
|
|
125
|
-
- Security issues
|
|
126
|
-
- Gap resolution decisions
|
|
137
|
+
- **Audit findings**: Completion percentage, specific gaps with file paths and line references
|
|
138
|
+
- **Security issues**: Describe the vulnerability, affected code paths, severity reasoning, and how it was (or should be) fixed
|
|
139
|
+
- **Gap resolution decisions**: What was deferred vs fixed, and the rationale for each decision
|
|
127
140
|
- Write to: `ecosystem` vault for audit learnings, user's enterprise vault for audit trail (if configured + compliance enabled)
|
|
128
141
|
|
|
129
142
|
### Phase 3 (Finalization)
|
|
130
143
|
Extract from WorkGroup:
|
|
131
|
-
- Architectural learnings
|
|
132
|
-
- Convention patterns established
|
|
133
|
-
-
|
|
144
|
+
- **Architectural learnings**: Structural discoveries, component relationships that weren't obvious, integration patterns that emerged
|
|
145
|
+
- **Convention patterns established**: New team conventions with full rationale and examples
|
|
146
|
+
- **Consolidation decisions**: What was merged or refactored during finalization and why
|
|
134
147
|
- Write to: appropriate vault per learning category routing
|
|
135
148
|
|
|
136
149
|
## Communication
|
|
137
150
|
|
|
138
|
-
- **Report to lead
|
|
139
|
-
- **
|
|
151
|
+
- **Report to lead on**: errors (MCP failures, vault not found) or dedup catches
|
|
152
|
+
- **Task-based confirmation**: Mark pre-created capture tasks complete with summary (count + vault names) — this is the primary confirmation mechanism
|
|
153
|
+
- **Phase 3 DM confirmation REQUIRED**: After processing Phase 3, send confirmation DM to lead: `"Phase 3 capture complete: {N} items written to {vault names}"`
|
|
154
|
+
- **Silent on success for other phases** — task completion is sufficient, do not broadcast
|
|
140
155
|
- Respond to direct queries from teammates about what has been captured
|
|
141
156
|
|
|
142
157
|
## MCP Graceful Degradation
|
|
143
158
|
|
|
144
|
-
If MCP calls fail:
|
|
145
|
-
1.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
159
|
+
If MCP calls fail or MCP is unavailable:
|
|
160
|
+
1. **Queue locally**: Append the capture to `knowzcode/pending_captures.md` using this format:
|
|
161
|
+
```markdown
|
|
162
|
+
### {timestamp} — {title}
|
|
163
|
+
- **Intent**: {Phase capture | Log | Consider}
|
|
164
|
+
- **Category**: {Pattern|Decision|Workaround|Performance|Security|Convention}
|
|
165
|
+
- **Target Vault Type**: {code|ecosystem|enterprise|finalizations}
|
|
166
|
+
- **Source**: {agent name} / WorkGroup {wgid}
|
|
167
|
+
- **Content**: {description or extracted learning}
|
|
168
|
+
```
|
|
169
|
+
2. Report the MCP failure to the lead via DM: `"MCP unavailable — queued {N} capture(s) to pending_captures.md"`
|
|
170
|
+
3. If MCP recovers mid-session, flush pending captures to vaults on the next capture request
|
|
171
|
+
4. Mark the capture task complete (if task-tracked) with note: `"Queued locally — MCP unavailable"`
|
|
172
|
+
|
|
173
|
+
Never drop knowledge. If MCP is down, queue it. The pending file can be flushed later via `/kc:learn --flush` or by a future scribe instance.
|
|
149
174
|
|
|
150
175
|
## Exit Expectations
|
|
151
176
|
|
|
152
|
-
- All capture
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
- Ready for shutdown after
|
|
177
|
+
- All capture tasks marked complete
|
|
178
|
+
- Phase 3 confirmation DM sent to lead
|
|
179
|
+
- Dedup catches and errors reported to lead
|
|
180
|
+
- Ready for shutdown only after all capture tasks are complete
|
|
@@ -69,10 +69,11 @@ Near the end of Stage 2 (before the gap loop), DM lead with structured proposals
|
|
|
69
69
|
|
|
70
70
|
## Knowz-Scribe Integration
|
|
71
71
|
|
|
72
|
-
If knowz-scribe is active, DM it with idea captures
|
|
73
|
-
> "Capture idea: {description}. Category: {Pattern|Decision|Convention}. Source: WorkGroup {wgid}."
|
|
72
|
+
If knowz-scribe is active, DM it with idea captures. Include enough detail for the scribe to write a rich vault entry — terse one-liners produce poor search results when stored in the vault.
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
> "Log: {Detailed description including the specific technology, component, and rationale — e.g. 'Discovered that the Express auth middleware should validate JWT clockTolerance=0 to prevent revoked tokens being accepted during the tolerance window. Affects src/middleware/auth.ts and all protected routes.'}. Category: {Pattern|Decision|Convention}. Source: WorkGroup {wgid}."
|
|
75
|
+
|
|
76
|
+
The scribe routes to the correct vault based on category. The more context you provide in the DM, the more useful the vault entry will be when retrieved via search months later.
|
|
76
77
|
|
|
77
78
|
## Enterprise Compliance (Optional)
|
|
78
79
|
|
package/commands/connect-mcp.md
CHANGED
|
@@ -88,9 +88,9 @@ Configure the KnowzCode MCP server using Claude Code's built-in MCP management.
|
|
|
88
88
|
- Store parsed values for use in configuration
|
|
89
89
|
|
|
90
90
|
2. **Check for existing configuration**
|
|
91
|
-
- Check if MCP server already configured: `claude mcp get
|
|
91
|
+
- Check if MCP server already configured: `CLAUDECODE= claude mcp get knowz`
|
|
92
92
|
- If already configured, ask if user wants to reconfigure
|
|
93
|
-
- If yes, run `claude mcp remove
|
|
93
|
+
- If yes, run `CLAUDECODE= claude mcp remove knowz` first
|
|
94
94
|
|
|
95
95
|
3. **Prompt for API key (if not provided)**
|
|
96
96
|
- If no API key in arguments, prompt user interactively:
|
|
@@ -280,18 +280,42 @@ Configure the KnowzCode MCP server using Claude Code's built-in MCP management.
|
|
|
280
280
|
You can edit knowzcode/knowzcode_vaults.md to update descriptions or routing rules.
|
|
281
281
|
```
|
|
282
282
|
|
|
283
|
+
**Step 6f: Update CLAUDE.md with vault targeting guidance**
|
|
284
|
+
|
|
285
|
+
Ensure agents always know to pass `vaultId` by adding a reference section to the project's CLAUDE.md:
|
|
286
|
+
|
|
287
|
+
1. Read the project's `CLAUDE.md`
|
|
288
|
+
2. Search for an existing `### Vault Targeting` or `### Knowz MCP` section
|
|
289
|
+
3. **If found:** Replace the existing section with the updated content below
|
|
290
|
+
4. **If NOT found:** Append the section after the `# KnowzCode Integration` block (or at the end if not found)
|
|
291
|
+
5. Insert a vault targeting reference section that points to the central config:
|
|
292
|
+
|
|
293
|
+
```markdown
|
|
294
|
+
### Vault Targeting (MCP Writes)
|
|
295
|
+
**Always pass `vaultId`** when calling `create_knowledge` or `update_knowledge`.
|
|
296
|
+
Omitting it saves to the tenant default vault — NOT the project vault.
|
|
297
|
+
|
|
298
|
+
Vault IDs and routing rules: `knowzcode/knowzcode_vaults.md`
|
|
299
|
+
If vault IDs are already in context from a previous read, do not re-read the file.
|
|
300
|
+
For ad-hoc learning capture, prefer `/kc:learn "insight"` — it handles routing automatically.
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
6. Confirm: `"Updated CLAUDE.md with vault targeting guidance (vault IDs managed in knowzcode/knowzcode_vaults.md)."`
|
|
304
|
+
|
|
305
|
+
**Idempotent:** Replaces existing `### Vault Targeting` section rather than duplicating.
|
|
306
|
+
|
|
283
307
|
7. **Add MCP server using CLI**
|
|
284
308
|
```bash
|
|
285
309
|
claude mcp add --transport http \
|
|
286
310
|
--scope <chosen-scope> \
|
|
287
|
-
|
|
311
|
+
knowz \
|
|
288
312
|
<endpoint-url> \
|
|
289
313
|
--header "Authorization: Bearer <api-key>" \
|
|
290
314
|
--header "X-Project-Path: $(pwd)"
|
|
291
315
|
```
|
|
292
316
|
|
|
293
317
|
8. **Verify configuration**
|
|
294
|
-
- Run: `claude mcp get
|
|
318
|
+
- Run: `CLAUDECODE= claude mcp get knowz`
|
|
295
319
|
- Confirm server appears in the list
|
|
296
320
|
- Check for any error messages
|
|
297
321
|
|
|
@@ -437,7 +461,7 @@ If using --dev environment, verify the dev server is running.
|
|
|
437
461
|
To change from local to project scope:
|
|
438
462
|
```bash
|
|
439
463
|
# Remove existing (or the command will prompt to reconfigure)
|
|
440
|
-
claude mcp remove
|
|
464
|
+
CLAUDECODE= claude mcp remove knowz
|
|
441
465
|
|
|
442
466
|
# Re-add with new scope
|
|
443
467
|
/kc:connect-mcp <api-key> --scope project
|
package/commands/learn.md
CHANGED
|
@@ -182,6 +182,9 @@ Capture the provided insight to the appropriate vault using the MCP `create_know
|
|
|
182
182
|
```
|
|
183
183
|
|
|
184
184
|
7. **Build learning content**
|
|
185
|
+
|
|
186
|
+
> Vault entries are retrieved via semantic search — content must be detailed and self-contained. See `knowzcode/knowzcode_vaults.md` Content Detail Principle.
|
|
187
|
+
|
|
185
188
|
```markdown
|
|
186
189
|
[CONTEXT]
|
|
187
190
|
Project: {project-name}
|
|
@@ -189,9 +192,11 @@ Capture the provided insight to the appropriate vault using the MCP `create_know
|
|
|
189
192
|
Vault: {selected_vault_name}
|
|
190
193
|
Source: {--source value or "KnowzCode /kc:learn command"}
|
|
191
194
|
Date: {ISO timestamp}
|
|
195
|
+
Situation: {Expand on what prompted this learning — the problem being solved, the component involved, relevant technology stack. Provide enough background that someone unfamiliar with the project can understand.}
|
|
192
196
|
|
|
193
197
|
[INSIGHT]
|
|
194
198
|
{User's insight text}
|
|
199
|
+
Detail: {Expand the user's insight with technical specifics — include file paths, library names, version numbers, code patterns, or error messages that make this actionable when retrieved via search.}
|
|
195
200
|
|
|
196
201
|
[SOURCE]
|
|
197
202
|
Captured via /kc:learn command
|
|
@@ -202,7 +207,7 @@ Capture the provided insight to the appropriate vault using the MCP `create_know
|
|
|
202
207
|
```json
|
|
203
208
|
create_knowledge({
|
|
204
209
|
"content": "{formatted content}",
|
|
205
|
-
"title": "{Category}: {
|
|
210
|
+
"title": "{Category}: {Descriptive summary — include key technology names for search discoverability}",
|
|
206
211
|
"knowledgeType": "Note",
|
|
207
212
|
"vaultId": "{selected_vault_id}",
|
|
208
213
|
"tags": ["{category}", "{extracted-tags}", "{project-name}"],
|
package/commands/register.md
CHANGED
|
@@ -111,7 +111,7 @@ YOU USER
|
|
|
111
111
|
|
|
112
112
|
1. Check if MCP server already configured:
|
|
113
113
|
```bash
|
|
114
|
-
claude mcp get
|
|
114
|
+
CLAUDECODE= claude mcp get knowz
|
|
115
115
|
```
|
|
116
116
|
|
|
117
117
|
2. If already configured, display:
|
|
@@ -127,7 +127,7 @@ YOU USER
|
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
Use AskUserQuestion to get user choice. If they choose to keep existing, STOP.
|
|
130
|
-
If they choose to continue, run `claude mcp remove
|
|
130
|
+
If they choose to continue, run `CLAUDECODE= claude mcp remove knowz` first.
|
|
131
131
|
|
|
132
132
|
3. If not configured: Continue to Step 2.
|
|
133
133
|
|
|
@@ -330,7 +330,7 @@ curl -X POST https://api.dev.knowz.io/api/v1/auth/register \
|
|
|
330
330
|
# Production (default)
|
|
331
331
|
claude mcp add --transport http \
|
|
332
332
|
--scope <chosen-scope> \
|
|
333
|
-
|
|
333
|
+
knowz \
|
|
334
334
|
https://mcp.knowz.io/mcp \
|
|
335
335
|
--header "Authorization: Bearer <api_key>" \
|
|
336
336
|
--header "X-Project-Path: $(pwd)"
|
|
@@ -338,7 +338,7 @@ curl -X POST https://api.dev.knowz.io/api/v1/auth/register \
|
|
|
338
338
|
# Development (with --dev flag)
|
|
339
339
|
claude mcp add --transport http \
|
|
340
340
|
--scope <chosen-scope> \
|
|
341
|
-
|
|
341
|
+
knowz \
|
|
342
342
|
https://mcp.dev.knowz.io/mcp \
|
|
343
343
|
--header "Authorization: Bearer <api_key>" \
|
|
344
344
|
--header "X-Project-Path: $(pwd)"
|
|
@@ -346,7 +346,7 @@ curl -X POST https://api.dev.knowz.io/api/v1/auth/register \
|
|
|
346
346
|
|
|
347
347
|
5. **Verify MCP configuration**:
|
|
348
348
|
```bash
|
|
349
|
-
claude mcp get
|
|
349
|
+
CLAUDECODE= claude mcp get knowz
|
|
350
350
|
```
|
|
351
351
|
|
|
352
352
|
6. **Configure vault in mcp_config.md**:
|
package/commands/status.md
CHANGED
|
@@ -41,7 +41,7 @@ Check Agent Teams status, then check the KnowzCode MCP server status, and report
|
|
|
41
41
|
|
|
42
42
|
2. **Check MCP server configuration**
|
|
43
43
|
```bash
|
|
44
|
-
claude mcp get
|
|
44
|
+
CLAUDECODE= claude mcp get knowz
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
- If configured: Extract scope, endpoint, headers
|