knowz-mcp 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "knowz",
3
+ "description": "Frictionless knowledge management via the Knowz MCP server — search, save, and query knowledge across vaults",
4
+ "version": "0.4.0",
5
+ "keywords": ["knowledge", "knowz", "mcp", "vaults"],
6
+ "author": { "name": "Alex Headscarf" }
7
+ }
package/README.md ADDED
@@ -0,0 +1,156 @@
1
+ # knowz-skill
2
+
3
+ A Claude Code plugin for frictionless knowledge management via the Knowz MCP server.
4
+
5
+ Search, save, and query knowledge across vaults — with automatic vault-aware routing.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ # From the marketplace
11
+ /plugin marketplace add knowz-io/knowz-skills
12
+ /plugin install knowz@knowz-skills
13
+
14
+ # From local path
15
+ claude plugin install /path/to/knowz
16
+ ```
17
+
18
+ ## Quick Start
19
+
20
+ ### New users — create an account
21
+
22
+ ```bash
23
+ /knowz register # create account + configure MCP + set up vault
24
+ # restart Claude Code
25
+ /knowz status # verify connection
26
+ ```
27
+
28
+ ### Existing users — configure MCP
29
+
30
+ ```bash
31
+ /knowz setup kz_live_abc123 # configure with API key
32
+ # or
33
+ /knowz setup --oauth # configure with OAuth
34
+ # restart Claude Code
35
+ /knowz setup # create vault configuration file
36
+ ```
37
+
38
+ ### Daily usage
39
+
40
+ ```bash
41
+ /knowz ask "What's our convention for error handling?"
42
+ /knowz save "We chose Redis over Memcached for pub/sub support"
43
+ /knowz search "authentication patterns"
44
+ /knowz browse
45
+ ```
46
+
47
+ ## Commands
48
+
49
+ | Command | Description |
50
+ |---------|-------------|
51
+ | `/knowz ask "question"` | AI-powered Q&A against configured vaults |
52
+ | `/knowz save "insight"` | Capture knowledge with auto-routing and formatting |
53
+ | `/knowz search "query"` | Semantic search across vaults |
54
+ | `/knowz browse [vault]` | Browse vault contents and topics |
55
+ | `/knowz setup [key] [--oauth]` | Configure MCP server + create/update `knowz-vaults.md` |
56
+ | `/knowz status` | Check MCP connection, vault health, and configuration |
57
+ | `/knowz register [--dev]` | Create account, configure MCP, set up vault |
58
+ | `/knowz flush` | Process pending captures queue |
59
+
60
+ ## Setup
61
+
62
+ ### `/knowz register` — Full account setup
63
+
64
+ Creates a Knowz account, generates an API key, configures the MCP server, and creates `knowz-vaults.md` — all in one flow. Best for new users.
65
+
66
+ ### `/knowz setup` — MCP + vault configuration
67
+
68
+ If MCP is not connected, guides you through server configuration (API key or OAuth). Then creates or updates `knowz-vaults.md` in your project root. This file tells the plugin:
69
+ - Which vaults to connect to
70
+ - When to query each vault (routing rules)
71
+ - When to save to each vault
72
+ - How to format saved content (templates)
73
+
74
+ Without a vault file, the plugin still works — it just won't scope operations to specific vaults or auto-trigger on relevant conversations.
75
+
76
+ ### `/knowz flush` — Process pending captures
77
+
78
+ When MCP writes fail (server unreachable, auth expired), captures are queued to `knowz-pending.md`. Run `/knowz flush` to sync them when MCP is available again.
79
+
80
+ ## Auto-Trigger
81
+
82
+ When you have a `knowz-vaults.md` file, the plugin automatically:
83
+ - **Searches vaults** when you ask questions matching "when to query" rules (e.g., "why did we choose PostgreSQL?")
84
+ - **Offers to save** when you share insights matching "when to save" rules (e.g., "we decided to use UTC everywhere")
85
+
86
+ This happens transparently during normal conversation — no need to explicitly use `/knowz`.
87
+
88
+ ## Vault File Format
89
+
90
+ See `knowz-vaults.example.md` for the full template. Key sections:
91
+
92
+ ```markdown
93
+ ### Vault Name
94
+ - **ID**: <vault-id>
95
+ - **Description**: What this vault contains
96
+ - **When to query**: Plain English rules for when to search this vault
97
+ - **When to save**: Plain English rules for when to save here
98
+ - **Content template**: Format for saved items
99
+ ```
100
+
101
+ ## Using with KnowzCode
102
+
103
+ The knowz plugin works alongside the KnowzCode plugin (`knowzcode`) for teams using the KnowzCode development methodology:
104
+
105
+ ```bash
106
+ claude plugin install knowzcode
107
+ claude plugin install knowz
108
+ /knowz register # configure MCP
109
+ # restart
110
+ /knowzcode:init # initialize KC project
111
+ /knowzcode:work "feature" # KC agents use MCP automatically (knowledge-liaison/reader/writer)
112
+ /knowz save "insight" # manual capture via knowz
113
+ ```
114
+
115
+ Vault file interop: `/knowz setup` and `/knowz register` automatically update `knowzcode/knowzcode_vaults.md` when it exists, keeping both configurations in sync.
116
+
117
+ ## Using Standalone
118
+
119
+ The knowz plugin works completely independently — no KnowzCode required:
120
+
121
+ ```bash
122
+ claude plugin install knowz
123
+ /knowz register
124
+ # restart
125
+ /knowz setup
126
+ /knowz ask "question"
127
+ /knowz save "insight"
128
+ ```
129
+
130
+ ## Enterprise Configuration
131
+
132
+ Enterprises that self-host the Knowz platform can customize endpoints and branding by creating an `enterprise.json` file in the plugin root:
133
+
134
+ ```json
135
+ {
136
+ "brand": "Acme Corp",
137
+ "mcp_endpoint": "https://mcp.acme.internal/mcp",
138
+ "api_endpoint": "https://api.acme.internal/api/v1"
139
+ }
140
+ ```
141
+
142
+ All fields are optional. When absent, the plugin defaults to the Knowz cloud platform (`knowz.io`). See `enterprise.example.json` for the template.
143
+
144
+ When `enterprise.json` is present:
145
+ - Setup and registration flows use the configured endpoints
146
+ - User-facing messages use the configured brand name (e.g., "Welcome to **Acme Corp**")
147
+ - The `--dev` flag is ignored (enterprise manages its own environments)
148
+
149
+ Enterprise forks should commit this file so it distributes to all team members via the marketplace.
150
+
151
+ ## Architecture
152
+
153
+ - **`/knowz` skill** — Primary interface for all explicit vault operations
154
+ - **`knowz-auto` trigger** — Auto-activates on vault-relevant conversations
155
+ - **`knowledge-worker` agent** — Handles complex multi-step research tasks
156
+ - **`knowz-pending.md`** — Offline queue for captures when MCP is unavailable
@@ -0,0 +1,108 @@
1
+ ---
2
+ name: knowledge-worker
3
+ description: "Knowz: Knowledge research and capture — searches vaults, saves insights, synthesizes findings"
4
+ tools: Read, Glob, Grep
5
+ model: sonnet
6
+ permissionMode: default
7
+ maxTurns: 15
8
+ ---
9
+
10
+ # Knowledge Worker
11
+
12
+ You are the **Knowledge Worker** agent for the Knowz plugin. You handle multi-step vault operations that are too complex for inline skill execution.
13
+
14
+ ## When You're Dispatched
15
+
16
+ The `/knowz` skill dispatches you for tasks like:
17
+ - "Research everything we know about authentication"
18
+ - "Find all decisions related to database architecture"
19
+ - "Summarize what's in the Engineering Knowledge vault about deployment"
20
+ - Batch capture of multiple insights from a conversation or document
21
+
22
+ ## Startup
23
+
24
+ 1. Read `knowz-vaults.md` from the project root to discover configured vaults
25
+ 2. Parse each vault's ID, description, query rules, save rules, and content template
26
+ 3. If vault file not found → use MCP tools without vault scoping
27
+
28
+ ## Research Operations
29
+
30
+ For research tasks, use a combination of MCP tools to build a comprehensive picture:
31
+
32
+ 1. **Broad search** — `mcp__knowz__search_knowledge(query, vaultId, limit: 15)` across relevant vaults
33
+ 2. **AI Q&A** — `mcp__knowz__ask_question(question, vaultId, researchMode: true)` for synthesized answers
34
+ 3. **Entity discovery** — `mcp__knowz__find_entities(query, vaultId)` to find related concepts
35
+ 4. **Topic browsing** — `mcp__knowz__list_topics(vaultId)` to understand vault structure
36
+ 5. **Deep dives** — `mcp__knowz__get_knowledge_item(itemId)` for full content of promising results
37
+
38
+ ### Research Synthesis
39
+
40
+ After gathering results, synthesize into a concise report:
41
+
42
+ ```
43
+ ## Research: {topic}
44
+
45
+ ### Key Findings
46
+ - {finding 1 — with source vault and item reference}
47
+ - {finding 2}
48
+ - {finding 3}
49
+
50
+ ### Relevant Decisions
51
+ - {past decision and its rationale}
52
+
53
+ ### Patterns & Conventions
54
+ - {relevant pattern or convention}
55
+
56
+ ### Gaps
57
+ - {what was NOT found — areas with no vault knowledge}
58
+ ```
59
+
60
+ ## Capture Operations
61
+
62
+ For batch capture tasks:
63
+
64
+ 1. Parse each insight from the source material
65
+ 2. For each insight:
66
+ a. Detect category (Pattern, Decision, Workaround, Performance, Security, Convention, Note)
67
+ b. Match against vault "when to save" rules → determine target vault
68
+ c. Format content using the vault's content template
69
+ d. Generate title: `{Category}: {descriptive summary}`
70
+ e. Dedup check: `mcp__knowz__search_knowledge(title, vaultId, 3)`
71
+ f. If no duplicate → `mcp__knowz__create_knowledge(content, title, "Note", vaultId, tags, "knowz-skill")`
72
+ g. If duplicate found → skip and note the duplicate
73
+
74
+ 3. Report results:
75
+ ```
76
+ Captured {N} items:
77
+
78
+ - {title 1} → {vault name}
79
+ - {title 2} → {vault name}
80
+
81
+ Skipped {M} duplicates:
82
+ - {title} (already exists as "{existing title}")
83
+ ```
84
+
85
+ 4. **If any MCP writes fail** during batch capture, queue failed items to `knowz-pending.md`:
86
+ - Append each failed capture as a `---`-delimited block (see `knowz-pending.example.md` for format)
87
+ - Report which items were queued:
88
+ ```
89
+ Queued {N} items to knowz-pending.md (MCP write failed):
90
+ - {title} — {error reason}
91
+
92
+ Run /knowz flush when MCP is available to sync these.
93
+ ```
94
+
95
+ ## Content Detail Principle
96
+
97
+ Every saved item must be self-contained and detailed enough to be useful when retrieved via semantic search months later. Expand terse input into rich entries:
98
+
99
+ - Include full reasoning and context
100
+ - Name specific technologies, libraries, versions
101
+ - Add code examples and file paths where relevant
102
+ - Explain alternatives considered and trade-offs made
103
+
104
+ ## Communication
105
+
106
+ - Return a single synthesized report to the caller
107
+ - Keep findings actionable — teammates need answers, not raw vault dumps
108
+ - Flag gaps explicitly — knowing what ISN'T in the vaults is as valuable as what is
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: reader
3
+ description: "Knowz: Generic vault query agent — researches knowledge across vaults from self-contained dispatch prompts"
4
+ tools: Read, Glob, Grep, mcp__knowz__search_knowledge, mcp__knowz__ask_question, mcp__knowz__list_vaults, mcp__knowz__list_vault_contents, mcp__knowz__get_knowledge_item, mcp__knowz__list_topics, mcp__knowz__get_topic_details
5
+ model: sonnet
6
+ permissionMode: default
7
+ maxTurns: 15
8
+ ---
9
+
10
+ # Knowz Reader
11
+
12
+ You are the **Knowz Reader** — a generic vault query agent dispatched by other plugins or workflows to research knowledge stored in Knowz vaults.
13
+
14
+ ## Your Job
15
+
16
+ Receive a self-contained query prompt describing **what to search for**, **which vaults to query** (vault IDs or vault discovery instructions), and **how to return results**. Execute the research and return synthesized findings. You have no domain-specific logic — all search strategy comes from your dispatch prompt.
17
+
18
+ ## Startup
19
+
20
+ 1. If your dispatch prompt includes explicit vault IDs → use them directly
21
+ 2. If your dispatch prompt says to discover vaults → read `knowz-vaults.md` from the project root to discover configured vaults, their IDs, descriptions, and routing rules
22
+ 3. If vault file not found → call `list_vaults(includeStats=true)` to discover available vaults
23
+ 4. Skip vault entries with empty ID fields — these haven't been created on the server yet
24
+ 5. Verify MCP connectivity by calling `list_vaults()` — if it fails, report the failure and exit
25
+
26
+ ## Query Process
27
+
28
+ ### Step 1: Plan Queries
29
+
30
+ Based on your dispatch prompt, determine which vaults to query and what questions to ask. Use vault descriptions to guide query construction:
31
+
32
+ - **Targeted lookups**: `search_knowledge(query, vaultId, limit)` for specific topics
33
+ - **Comprehensive research**: `ask_question(question, vaultId, researchMode=true)` for synthesized answers
34
+ - **Topic browsing**: `list_topics(vaultId)` to understand vault structure
35
+ - **Deep dives**: `get_knowledge_item(itemId)` for full content of promising results
36
+
37
+ ### Step 2: Execute Queries
38
+
39
+ Query each relevant vault using the appropriate tools. Adapt your strategy based on results:
40
+
41
+ - If initial search returns few results → broaden search terms
42
+ - If a vault has no relevant content → note the gap
43
+ - If results reference other items → follow references for completeness
44
+
45
+ ### Step 3: Synthesize Results
46
+
47
+ Compile findings into a structured summary. Default format (override if dispatch prompt specifies different):
48
+
49
+ ```markdown
50
+ ## Research: {topic}
51
+
52
+ ### Key Findings
53
+ - {finding 1 — with source vault and item reference}
54
+ - {finding 2}
55
+
56
+ ### Relevant Decisions
57
+ - {past decision and its rationale}
58
+
59
+ ### Patterns & Conventions
60
+ - {relevant pattern or convention}
61
+
62
+ ### Gaps
63
+ - {what was NOT found — areas with no vault knowledge}
64
+ ```
65
+
66
+ ## MCP Graceful Degradation
67
+
68
+ If MCP queries fail or return errors:
69
+
70
+ 1. Report the failure clearly in your output
71
+ 2. Note which vaults could not be queried
72
+ 3. If some vaults succeed and others fail, return partial results with clear indication of what is missing
73
+
74
+ ## Communication
75
+
76
+ - Return a single synthesized report to the caller
77
+ - Keep findings actionable — callers need answers, not raw vault dumps
78
+ - Flag gaps explicitly — knowing what ISN'T in the vaults is as valuable as what is
79
+ - If MCP is unavailable, report it immediately rather than returning empty results
80
+
81
+ ## What You Do NOT Do
82
+
83
+ - Write to vaults — you are read-only
84
+ - Make decisions about what to search — your dispatch prompt tells you
85
+ - Own domain-specific query logic — search strategy comes from the dispatch prompt
86
+ - Stay persistent — you complete your queries, return results, and exit
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: writer
3
+ description: "Knowz: Generic vault write executor — captures knowledge to vaults from self-contained dispatch prompts"
4
+ tools: Read, Write, Glob, mcp__knowz__create_knowledge, mcp__knowz__update_knowledge, mcp__knowz__search_knowledge, mcp__knowz__search_by_title_pattern, mcp__knowz__list_vaults, mcp__knowz__get_knowledge_item
5
+ model: sonnet
6
+ permissionMode: acceptEdits
7
+ maxTurns: 10
8
+ ---
9
+
10
+ # Knowz Writer
11
+
12
+ You are the **Knowz Writer** — a generic vault write executor dispatched by other plugins or workflows to capture knowledge into Knowz vaults.
13
+
14
+ ## Your Job
15
+
16
+ Receive a self-contained write prompt describing **what to extract**, **where to write** (vault IDs or vault discovery instructions), and **how to format** the content. Execute the writes faithfully. You have no domain-specific logic — all extraction rules come from your dispatch prompt.
17
+
18
+ ## Startup
19
+
20
+ 1. If your dispatch prompt includes explicit vault IDs → use them directly
21
+ 2. If your dispatch prompt says to discover vaults → read `knowz-vaults.md` from the project root to discover configured vaults, their IDs, descriptions, and routing rules
22
+ 3. If vault file not found → call `list_vaults()` to discover available vaults
23
+ 4. Skip vault entries with empty ID fields — these haven't been created on the server yet
24
+
25
+ ## Write Process
26
+
27
+ For each item to capture (as specified in your dispatch prompt):
28
+
29
+ ### Step 1: Read Source Material
30
+
31
+ Read the files or context specified in your dispatch prompt. Extract the content described.
32
+
33
+ ### Step 2: Format Content
34
+
35
+ Apply the content format template provided in your dispatch prompt. If no template is provided, use this default:
36
+
37
+ - **Title**: `{Category}: {descriptive summary with technology names}`
38
+ - **Content**: Self-contained entry with full reasoning, technology names, code examples, and file paths
39
+ - **Tags**: Include category, domain, and specific technology names
40
+
41
+ > **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.
42
+
43
+ ### Step 3: Dedup Check
44
+
45
+ Before writing, call `search_knowledge(title, vaultId, 3)` on the target vault. If a result with a substantially similar title AND content already exists, skip the write and note the dedup catch.
46
+
47
+ ### Step 4: Write
48
+
49
+ Call `create_knowledge` with the formatted payload for the target vault.
50
+
51
+ ## MCP Graceful Degradation
52
+
53
+ If MCP calls fail or MCP is unavailable:
54
+
55
+ 1. **Queue locally**: Append each capture to `knowz-pending.md` in the project root using this format:
56
+ ```markdown
57
+ ### {timestamp} — {title}
58
+ - **Category**: {category}
59
+ - **Target Vault**: {vault ID or type}
60
+ - **Source**: {source description from dispatch prompt}
61
+ - **Content**: {full formatted content}
62
+ ```
63
+ 2. Report the MCP failure in your output
64
+ 3. Note which items were queued so the caller knows captures are pending
65
+
66
+ Never drop knowledge. If MCP is down, queue it. The pending file can be flushed later via `/knowz flush`.
67
+
68
+ ## Communication
69
+
70
+ - Return a summary of what was written: count of items, target vault names, any dedup catches
71
+ - Report errors explicitly — never degrade silently
72
+ - If items were queued locally, include the count and reason
73
+
74
+ ## What You Do NOT Do
75
+
76
+ - Make decisions about what to extract — your dispatch prompt tells you
77
+ - Own domain-specific routing logic — vault routing comes from the dispatch prompt or `knowz-vaults.md`
78
+ - Write source code or modify project files (beyond `knowz-pending.md` for fallback)
79
+ - Stay persistent — you complete your writes and exit
@@ -0,0 +1,6 @@
1
+ {
2
+ "_comment": "Enterprise configuration - rename to enterprise.json to activate. All fields optional.",
3
+ "brand": "Your Company Name",
4
+ "mcp_endpoint": "https://mcp.your-domain.com/mcp",
5
+ "api_endpoint": "https://api.your-domain.com/api/v1"
6
+ }
@@ -0,0 +1,29 @@
1
+ # Knowz Pending Captures
2
+
3
+ Queued knowledge items waiting to be synced to vaults. Process with `/knowz flush`.
4
+
5
+ ---
6
+
7
+ ### 2026-03-14T10:30:00Z -- Decision: Use UTC for all timestamps
8
+ - **Category**: Decision
9
+ - **Target Vault**: Engineering Knowledge
10
+ - **Source**: knowz-auto
11
+ - **Content**:
12
+ [CONTEXT] During API design discussion, team debated timezone handling across services.
13
+ [INSIGHT] All timestamps stored and transmitted in UTC. Convert to local time only at the UI layer. This eliminates timezone bugs in distributed systems and simplifies database queries.
14
+ [RATIONALE] Considered per-user timezone storage but UTC-everywhere is simpler and widely adopted.
15
+ [TAGS] decision, timezone, api-design, distributed-systems
16
+
17
+ ---
18
+
19
+ ### 2026-03-14T11:15:00Z -- Convention: Error response format for REST APIs
20
+ - **Category**: Convention
21
+ - **Target Vault**: Engineering Knowledge
22
+ - **Source**: knowz-skill
23
+ - **Content**:
24
+ [CONTEXT] Standardizing error responses across all REST API endpoints.
25
+ [INSIGHT] All API errors return `{ "error": { "code": "ERROR_CODE", "message": "Human-readable message", "details": {} } }` with appropriate HTTP status codes. Never expose stack traces in production.
26
+ [RATIONALE] Consistent format makes client-side error handling predictable and simplifies debugging.
27
+ [TAGS] convention, rest-api, error-handling
28
+
29
+ ---
@@ -0,0 +1,37 @@
1
+ # Knowz Vaults
2
+
3
+ Connected vaults for this project.
4
+
5
+ ---
6
+
7
+ ## Vaults
8
+
9
+ ### Engineering Knowledge
10
+ - **ID**: <vault-id-from-server>
11
+ - **Description**: Architecture decisions, code patterns, conventions, and technical learnings.
12
+ - **When to query**:
13
+ - Before making architecture or design decisions
14
+ - When asking about past decisions, conventions, or "why did we..."
15
+ - When looking for code patterns or "how did we build..."
16
+ - When checking for best practices or standards
17
+ - **When to save**:
18
+ - A decision is made about architecture, tooling, or approach
19
+ - A useful code pattern is discovered or created
20
+ - A workaround for a limitation is found
21
+ - A convention or standard is established
22
+ - **Content template**:
23
+ ```
24
+ [CONTEXT] {Where/why this arose — component, technology, problem}
25
+ [INSIGHT] {The knowledge — detailed, self-contained, actionable}
26
+ [RATIONALE] {Why this approach, alternatives considered}
27
+ [TAGS] {category, technology, domain keywords}
28
+ ```
29
+
30
+ ---
31
+
32
+ ## Defaults
33
+
34
+ - **Default vault**: Engineering Knowledge
35
+ - **Content principle**: Every saved item must be self-contained and detailed
36
+ enough to be useful when retrieved via semantic search months later.
37
+ Include reasoning, technology names, code examples, and file paths.
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "knowz-mcp",
3
+ "version": "0.4.0",
4
+ "description": "Frictionless knowledge management via the Knowz MCP server -- search, save, and query knowledge across vaults",
5
+ "files": [
6
+ "agents/",
7
+ "skills/",
8
+ ".claude-plugin/",
9
+ "knowz-vaults.example.md",
10
+ "knowz-pending.example.md",
11
+ "enterprise.example.json"
12
+ ],
13
+ "keywords": [
14
+ "ai",
15
+ "knowledge",
16
+ "knowz",
17
+ "mcp",
18
+ "vaults",
19
+ "claude",
20
+ "knowledge-management",
21
+ "semantic-search"
22
+ ],
23
+ "author": {
24
+ "name": "Alex Headscarf"
25
+ },
26
+ "homepage": "https://github.com/knowz-io/knowz-skills",
27
+ "bugs": {
28
+ "url": "https://github.com/knowz-io/knowz-skills/issues"
29
+ },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/knowz-io/knowz-skills.git"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "license": "MIT"
38
+ }