beakr-cli 0.1.0__py3-none-any.whl
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.
- beakr_cli/__init__.py +3 -0
- beakr_cli/assets/commands/kb-audit.md +36 -0
- beakr_cli/assets/commands/kb-research.md +27 -0
- beakr_cli/assets/commands/kb-search.md +17 -0
- beakr_cli/assets/commands/kb-write.md +26 -0
- beakr_cli/assets/skills/beakr/SKILL.md +85 -0
- beakr_cli/assets/skills/beakr/examples/answer-org-question.md +30 -0
- beakr_cli/assets/skills/beakr/examples/research-topic.md +49 -0
- beakr_cli/assets/skills/beakr/examples/write-decision-page.md +89 -0
- beakr_cli/assets/skills/beakr/reference/auditing.md +46 -0
- beakr_cli/assets/skills/beakr/reference/provenance.md +49 -0
- beakr_cli/assets/skills/beakr/reference/research-workflow.md +45 -0
- beakr_cli/assets/skills/beakr/reference/writing-pages.md +53 -0
- beakr_cli/client.py +170 -0
- beakr_cli/commands/__init__.py +0 -0
- beakr_cli/commands/auth.py +202 -0
- beakr_cli/commands/install.py +153 -0
- beakr_cli/commands/kb.py +977 -0
- beakr_cli/commands/workspace.py +119 -0
- beakr_cli/config.py +41 -0
- beakr_cli/main.py +138 -0
- beakr_cli/mcp_server.py +1105 -0
- beakr_cli/output.py +90 -0
- beakr_cli-0.1.0.dist-info/METADATA +208 -0
- beakr_cli-0.1.0.dist-info/RECORD +28 -0
- beakr_cli-0.1.0.dist-info/WHEEL +4 -0
- beakr_cli-0.1.0.dist-info/entry_points.txt +2 -0
- beakr_cli-0.1.0.dist-info/licenses/LICENSE +21 -0
beakr_cli/__init__.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Audit the Beakr knowledge base for quality issues: $ARGUMENTS
|
|
2
|
+
|
|
3
|
+
If no specific focus is given, run a general health check. Follow this procedure:
|
|
4
|
+
|
|
5
|
+
1. **Get the full picture.** Call `kb_ls --all` (or `kb_ls` per space) to get every page. Call `kb_stats` per space for counts.
|
|
6
|
+
|
|
7
|
+
2. **Check the graph.** Call `kb_graph` to get all nodes and edges. Look for:
|
|
8
|
+
- **Orphan pages** -- pages with no parent and no incoming links
|
|
9
|
+
- **Broken links** -- `[[links]]` that don't resolve to any page
|
|
10
|
+
- **Dead ends** -- pages with no outgoing links (isolated knowledge)
|
|
11
|
+
- **Missing index pages** -- overview pages that should tie a section together
|
|
12
|
+
|
|
13
|
+
3. **Spot structural issues.** From `kb_ls` results, look for:
|
|
14
|
+
- Duplicate or near-duplicate page titles
|
|
15
|
+
- Pages with slug collisions (same slug across different scopes)
|
|
16
|
+
- Deeply nested hierarchies (more than 3 levels is usually too deep)
|
|
17
|
+
- Pages without a parent (should they be under a section?)
|
|
18
|
+
- Pages with revision 1 that may be stubs
|
|
19
|
+
|
|
20
|
+
4. **Sample content quality.** Read 5-10 pages with `kb_cat`, prioritizing:
|
|
21
|
+
- Pages with high revision counts (heavily edited -- is content coherent?)
|
|
22
|
+
- Pages with revision 1 (potentially stubs or unreviewed)
|
|
23
|
+
- Overview/index pages (are they up to date with their children?)
|
|
24
|
+
|
|
25
|
+
5. **Check provenance.** For key pages, call `kb_provenance` and look for:
|
|
26
|
+
- Sections with no citations (unsourced claims)
|
|
27
|
+
- Sections with only `contradicts` citations (disputed content)
|
|
28
|
+
- Stale provenance (old sources, no recent updates)
|
|
29
|
+
|
|
30
|
+
6. **Report findings** organized as:
|
|
31
|
+
- **Critical** -- broken links, orphaned important pages, contradicted content
|
|
32
|
+
- **Moderate** -- missing sections, stale pages, structural issues
|
|
33
|
+
- **Minor** -- style inconsistencies, missing Related Pages sections
|
|
34
|
+
- **Recommendations** -- specific pages to create, merge, or reorganize
|
|
35
|
+
|
|
36
|
+
Offer to fix issues directly using `kb_edit`, `kb_move`, or `kb_create` if the user approves.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Research the following topic using the Beakr knowledge base and provide a thorough analysis: $ARGUMENTS
|
|
2
|
+
|
|
3
|
+
Follow this procedure:
|
|
4
|
+
|
|
5
|
+
1. **Discover the landscape.** Call `list_spaces` and `list_projects` to understand the org structure. Then `kb_stats` on each space to know where the bulk of knowledge lives.
|
|
6
|
+
|
|
7
|
+
2. **Broad search.** Run `kb_search` with multiple query variations in parallel across spaces. Use different phrasings -- the knowledge base uses hybrid semantic + keyword search, so both precise terms and natural language queries work.
|
|
8
|
+
|
|
9
|
+
3. **Deep read.** Read the top 5-10 most relevant pages with `kb_cat` (in parallel). Pay attention to:
|
|
10
|
+
- Section content and structure
|
|
11
|
+
- `[[links]]` to follow
|
|
12
|
+
- Page type (decision pages have different weight than research_notes)
|
|
13
|
+
|
|
14
|
+
4. **Trace provenance.** For key claims, use `kb_provenance` to see which sources support, contradict, or qualify each section. Use `kb_sources` to understand what raw documents fed each page.
|
|
15
|
+
|
|
16
|
+
5. **Follow the graph.** Use `kb_links` (backlinks) on central pages to discover related pages you may have missed. Use `kb_log` to see revision history and understand how knowledge evolved.
|
|
17
|
+
|
|
18
|
+
6. **Check for conflicts.** Look for provenance entries with stance `contradicts` or `qualifies`. These are the most valuable findings -- they show where the evidence disagrees.
|
|
19
|
+
|
|
20
|
+
7. **Synthesize.** Write up findings organized by theme, not by page. Include:
|
|
21
|
+
- Key findings with page citations (title + slug)
|
|
22
|
+
- Areas of agreement across sources
|
|
23
|
+
- Contradictions or open questions
|
|
24
|
+
- Gaps -- what the knowledge base does NOT cover that it should
|
|
25
|
+
- Temporal context -- when information was written, whether it may be stale
|
|
26
|
+
|
|
27
|
+
8. **Recommend.** If the research reveals gaps or stale pages, suggest specific knowledge base updates. Offer to create or edit pages if appropriate.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Search the Beakr knowledge base for information about: $ARGUMENTS
|
|
2
|
+
|
|
3
|
+
Follow this procedure:
|
|
4
|
+
|
|
5
|
+
1. **Discover scope.** Call `list_spaces` to see available spaces. If the user mentioned a specific space or project, use that. Otherwise search across all spaces.
|
|
6
|
+
|
|
7
|
+
2. **Search in parallel.** If there are multiple spaces, launch parallel `kb_search` calls -- one per space -- with the query. Also run one unscoped (org-wide) search. This catches pages that live at org level.
|
|
8
|
+
|
|
9
|
+
3. **Read the top hits.** For the most relevant results (up to 3-5 pages), call `kb_cat` to read the full content. Do these reads in parallel.
|
|
10
|
+
|
|
11
|
+
4. **Follow links.** If the pages contain `[[links]]` to other relevant pages, read those too. Use `kb_links` (backlinks) to find pages that reference a key page.
|
|
12
|
+
|
|
13
|
+
5. **Check provenance if needed.** If the user needs to know where information came from, use `kb_sources` or `kb_provenance` on the relevant pages.
|
|
14
|
+
|
|
15
|
+
6. **Synthesize and cite.** Present findings with page titles and slugs so the user can navigate to them. Quote specific sections when relevant. Note any contradictions found in provenance (stance: contradicts/qualifies).
|
|
16
|
+
|
|
17
|
+
Do NOT just return search results -- read the actual pages and answer the question.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Create or update a knowledge base page about: $ARGUMENTS
|
|
2
|
+
|
|
3
|
+
Follow this procedure:
|
|
4
|
+
|
|
5
|
+
1. **Check for duplicates.** Search the knowledge base first with `kb_search` across all spaces. If a page already exists on this topic, read it with `kb_cat` and decide whether to update it (via `kb_edit`) or create a new page.
|
|
6
|
+
|
|
7
|
+
2. **Find the right parent.** Use `kb_ls` with the target space to see the page hierarchy. Place the new page under the most logical parent (e.g., a topic page under an overview section). If unsure, ask the user.
|
|
8
|
+
|
|
9
|
+
3. **Choose the right page type.** Pick from: `topic` (most common), `person`, `organization`, `decision`, `meeting`, `overview` (index/section pages), `research_note` (ephemeral analysis).
|
|
10
|
+
|
|
11
|
+
4. **Write the content** following these conventions:
|
|
12
|
+
- Use `<!-- sec:OPAQUE_ID -->` markers before each major section (e.g., `<!-- sec:auth_overview -->`). These are required for section-level provenance tracking.
|
|
13
|
+
- Use `[[Page Title]]` syntax for cross-references to other knowledge base pages. Check that target pages exist first.
|
|
14
|
+
- Use `[[Display Text|slug]]` for links where the display text differs from the page title.
|
|
15
|
+
- Include a "Related Pages" section at the bottom with links to connected pages.
|
|
16
|
+
- Write for a reader who has no prior context -- be specific, not vague.
|
|
17
|
+
- Attribution matters: name WHO made decisions, WHEN things happened.
|
|
18
|
+
- Use tables for structured data. Use code blocks for config/commands.
|
|
19
|
+
|
|
20
|
+
5. **Scope the page correctly.** Always pass the `space` parameter when creating. If the page belongs to a project, pass `project` too.
|
|
21
|
+
|
|
22
|
+
6. **Create the page** with `kb_create`, providing title, content, page_type, summary, parent_page, and space/project.
|
|
23
|
+
|
|
24
|
+
7. **Verify.** Read it back with `kb_cat` to confirm it rendered correctly.
|
|
25
|
+
|
|
26
|
+
Do NOT create stub pages. Every page should have substantive content.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: beakr
|
|
3
|
+
description: "Access your organization's knowledge base, research questions with citations, and manage knowledge base pages using Beakr's MCP tools. Use when the user asks about their organization, team, projects, people, decisions, or processes -- or wants to create/update knowledge base content."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Beakr Knowledge Base
|
|
7
|
+
|
|
8
|
+
Use the Beakr MCP tools to search, read, research, and write to the organization's knowledge base.
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
|
|
12
|
+
- User asks about their organization, team, people, decisions, or processes
|
|
13
|
+
- User wants to look something up ("What do we know about X?", "Who owns Y?")
|
|
14
|
+
- User wants to research a topic across documents and connected services
|
|
15
|
+
- User wants to create, update, or audit knowledge base pages
|
|
16
|
+
|
|
17
|
+
## Core tools
|
|
18
|
+
|
|
19
|
+
| Tool | When to use |
|
|
20
|
+
|------|-------------|
|
|
21
|
+
| `research` | First choice for broad questions. Searches knowledge base, docs, Slack, Gmail, Calendar, Jira in one call. Returns cited answers. |
|
|
22
|
+
| `kb_search` | Find specific pages by semantic or keyword search. |
|
|
23
|
+
| `kb_cat` | Read a page's full content by slug, title, or UUID. |
|
|
24
|
+
| `kb_ls` | Browse pages. Filter by type, parent, or scope. |
|
|
25
|
+
| `kb_timeline` | Find decisions, meetings, and events by date range. |
|
|
26
|
+
| `kb_graph` | Understand how pages connect. Shows top linked pages. |
|
|
27
|
+
|
|
28
|
+
## Quick decision tree
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
User asks a question about their org
|
|
32
|
+
→ Use `research` (it searches everything)
|
|
33
|
+
|
|
34
|
+
User asks about a specific page
|
|
35
|
+
→ Use `kb_cat` with the page title/slug
|
|
36
|
+
|
|
37
|
+
User wants to browse or list pages
|
|
38
|
+
→ Use `kb_ls` (optionally with --type, --roots, --parent)
|
|
39
|
+
|
|
40
|
+
User wants to know what happened on a date
|
|
41
|
+
→ Use `kb_timeline` with date range
|
|
42
|
+
|
|
43
|
+
User wants to verify sources for a claim
|
|
44
|
+
→ Use `kb_provenance` or `kb_blame` on the relevant page
|
|
45
|
+
|
|
46
|
+
User wants to create/update a page
|
|
47
|
+
→ See [reference/writing-pages.md](reference/writing-pages.md)
|
|
48
|
+
|
|
49
|
+
User wants to audit knowledge base quality
|
|
50
|
+
→ See [reference/auditing.md](reference/auditing.md)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Scoping
|
|
54
|
+
|
|
55
|
+
All tools accept an optional `project` parameter:
|
|
56
|
+
- Omit it to search across the entire organization
|
|
57
|
+
- Pass a project ID to scope results (use `list_projects` to discover IDs)
|
|
58
|
+
- Pass `personal_only=true` to limit to the user's personal space
|
|
59
|
+
|
|
60
|
+
## Citing sources
|
|
61
|
+
|
|
62
|
+
Always cite sources when presenting information from the knowledge base:
|
|
63
|
+
- Include the page title so the user can find it
|
|
64
|
+
- For `research` results, the response includes numbered citations -- present them
|
|
65
|
+
- For claims that need verification, use `kb_provenance` to show supporting/contradicting sources
|
|
66
|
+
|
|
67
|
+
## Page references
|
|
68
|
+
|
|
69
|
+
Pages can be referenced by any of:
|
|
70
|
+
- UUID (exact match)
|
|
71
|
+
- Slug (exact match, e.g., `api-design`)
|
|
72
|
+
- Title (search, e.g., `"API Design"`)
|
|
73
|
+
|
|
74
|
+
## Advanced workflows
|
|
75
|
+
|
|
76
|
+
- **Deep research**: See [reference/research-workflow.md](reference/research-workflow.md)
|
|
77
|
+
- **Writing pages**: See [reference/writing-pages.md](reference/writing-pages.md)
|
|
78
|
+
- **Auditing quality**: See [reference/auditing.md](reference/auditing.md)
|
|
79
|
+
- **Understanding provenance**: See [reference/provenance.md](reference/provenance.md)
|
|
80
|
+
|
|
81
|
+
## Examples
|
|
82
|
+
|
|
83
|
+
- [examples/answer-org-question.md](examples/answer-org-question.md) -- Answering "Who owns onboarding?"
|
|
84
|
+
- [examples/research-topic.md](examples/research-topic.md) -- Deep research on a topic
|
|
85
|
+
- [examples/write-decision-page.md](examples/write-decision-page.md) -- Creating a decision record
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Example: Answering "Who owns onboarding?"
|
|
2
|
+
|
|
3
|
+
## User prompt
|
|
4
|
+
"Who owns the onboarding flow?"
|
|
5
|
+
|
|
6
|
+
## Workflow
|
|
7
|
+
|
|
8
|
+
### Step 1: Research
|
|
9
|
+
Call `research` with query "who owns the onboarding flow":
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
research(query="who owns the onboarding flow")
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The response returns a cited answer mentioning Sarah Chen [1] and links to the relevant page.
|
|
16
|
+
|
|
17
|
+
### Step 2: Verify if needed
|
|
18
|
+
If the user wants more detail, read the specific page:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
kb_cat("onboarding-architecture")
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Step 3: Present
|
|
25
|
+
"Based on the knowledge base, Sarah Chen owns the onboarding flow [onboarding-architecture]. She took ownership in Q1 2026 as part of the platform team reorganization [team-structure]."
|
|
26
|
+
|
|
27
|
+
## Key points
|
|
28
|
+
- Start with `research` -- it searches everything in one call
|
|
29
|
+
- Always cite the page title/slug
|
|
30
|
+
- If the answer involves people, check for a `person` page with `kb_cat`
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Example: Deep research on API redesign
|
|
2
|
+
|
|
3
|
+
## User prompt
|
|
4
|
+
"Research everything we know about the API redesign and summarize the current state"
|
|
5
|
+
|
|
6
|
+
## Workflow
|
|
7
|
+
|
|
8
|
+
### Step 1: Broad search
|
|
9
|
+
```
|
|
10
|
+
kb_search(query="API redesign")
|
|
11
|
+
kb_search(query="API architecture changes")
|
|
12
|
+
kb_search(query="REST API migration")
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Step 2: Read top hits
|
|
16
|
+
```
|
|
17
|
+
kb_cat("api-redesign-decision")
|
|
18
|
+
kb_cat("api-architecture")
|
|
19
|
+
kb_cat("v2-migration-plan")
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Step 3: Check timeline
|
|
23
|
+
```
|
|
24
|
+
kb_timeline(query="API", start_date="2026-01-01")
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Step 4: Trace provenance on key claims
|
|
28
|
+
```
|
|
29
|
+
kb_provenance("api-redesign-decision")
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Step 5: Follow links
|
|
33
|
+
```
|
|
34
|
+
kb_links("api-architecture") # what pages link here?
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Step 6: Synthesize
|
|
38
|
+
Present findings by theme:
|
|
39
|
+
- **Decision**: The team decided to migrate to v2 in January 2026 [api-redesign-decision]
|
|
40
|
+
- **Current state**: Migration is 60% complete per the March update [v2-migration-plan]
|
|
41
|
+
- **Open questions**: Authentication approach still under discussion -- two proposals exist with contradicting provenance [api-architecture]
|
|
42
|
+
- **Gap**: No page covers the data migration strategy
|
|
43
|
+
|
|
44
|
+
## Key points
|
|
45
|
+
- Use multiple search queries to cast a wide net
|
|
46
|
+
- Read pages in parallel for speed
|
|
47
|
+
- Check provenance to surface contradictions
|
|
48
|
+
- Organize findings by theme, not by page
|
|
49
|
+
- Call out gaps explicitly
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Example: Creating a decision record
|
|
2
|
+
|
|
3
|
+
## User prompt
|
|
4
|
+
"Document our decision to switch from REST to GraphQL for the internal API"
|
|
5
|
+
|
|
6
|
+
## Workflow
|
|
7
|
+
|
|
8
|
+
### Step 1: Check for duplicates
|
|
9
|
+
```
|
|
10
|
+
kb_search(query="REST GraphQL decision internal API")
|
|
11
|
+
```
|
|
12
|
+
No existing page found.
|
|
13
|
+
|
|
14
|
+
### Step 2: Find parent
|
|
15
|
+
```
|
|
16
|
+
kb_ls(page_type="overview")
|
|
17
|
+
```
|
|
18
|
+
Found "API Architecture" overview page -- use as parent.
|
|
19
|
+
|
|
20
|
+
### Step 3: Research context
|
|
21
|
+
```
|
|
22
|
+
research(query="internal API architecture GraphQL REST")
|
|
23
|
+
```
|
|
24
|
+
Gather background from existing pages to include context.
|
|
25
|
+
|
|
26
|
+
### Step 4: Write the page
|
|
27
|
+
|
|
28
|
+
Create with type `decision`:
|
|
29
|
+
|
|
30
|
+
```markdown
|
|
31
|
+
<!-- sec:summary -->
|
|
32
|
+
## Summary
|
|
33
|
+
|
|
34
|
+
The engineering team decided to migrate the internal API from REST to GraphQL,
|
|
35
|
+
effective Q2 2026. This affects service-to-service communication only; the
|
|
36
|
+
public API remains REST.
|
|
37
|
+
|
|
38
|
+
<!-- sec:context -->
|
|
39
|
+
## Context
|
|
40
|
+
|
|
41
|
+
The internal API serves 12 backend services with ~40 endpoints. Pain points
|
|
42
|
+
included over-fetching, versioning complexity, and inconsistent error handling.
|
|
43
|
+
See [[API Architecture]] for the current state.
|
|
44
|
+
|
|
45
|
+
<!-- sec:decision -->
|
|
46
|
+
## Decision
|
|
47
|
+
|
|
48
|
+
**Date:** 2026-03-15
|
|
49
|
+
**Decision maker:** Sarah Chen (CTO)
|
|
50
|
+
**Participants:** Platform team, Backend leads
|
|
51
|
+
|
|
52
|
+
Adopt GraphQL for internal service communication using Apollo Federation.
|
|
53
|
+
Key factors:
|
|
54
|
+
- Reduces over-fetching by 60% based on traffic analysis
|
|
55
|
+
- Single schema eliminates versioning overhead
|
|
56
|
+
- TypeScript codegen provides type safety end-to-end
|
|
57
|
+
|
|
58
|
+
<!-- sec:alternatives -->
|
|
59
|
+
## Alternatives considered
|
|
60
|
+
|
|
61
|
+
1. **Keep REST, add OpenAPI codegen** -- Lower migration cost but doesn't solve over-fetching
|
|
62
|
+
2. **gRPC** -- Better performance but steeper learning curve and weaker tooling for our stack
|
|
63
|
+
3. **tRPC** -- Good DX but limited to TypeScript services only
|
|
64
|
+
|
|
65
|
+
<!-- sec:consequences -->
|
|
66
|
+
## Consequences
|
|
67
|
+
|
|
68
|
+
- 3-month migration timeline for core services
|
|
69
|
+
- Training needed for team members new to GraphQL
|
|
70
|
+
- Monitoring approach changes (per-field metrics vs per-endpoint)
|
|
71
|
+
|
|
72
|
+
## Related Pages
|
|
73
|
+
|
|
74
|
+
- [[API Architecture]]
|
|
75
|
+
- [[Platform Team]]
|
|
76
|
+
- [[Q2 2026 Roadmap]]
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Step 5: Verify
|
|
80
|
+
```
|
|
81
|
+
kb_cat("rest-to-graphql-decision")
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Key points
|
|
85
|
+
- Always use `decision` page type for decision records
|
|
86
|
+
- Include date, decision maker, and participants
|
|
87
|
+
- Document alternatives that were considered and why they were rejected
|
|
88
|
+
- Link to related pages with `[[Page Title]]` syntax
|
|
89
|
+
- Add section markers for provenance tracking
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Knowledge Base Audit
|
|
2
|
+
|
|
3
|
+
Use this workflow to check knowledge base quality and find issues.
|
|
4
|
+
|
|
5
|
+
## Procedure
|
|
6
|
+
|
|
7
|
+
### 1. Get the full picture
|
|
8
|
+
|
|
9
|
+
Call `kb_ls` to get every page. Call `kb_stats` for counts.
|
|
10
|
+
|
|
11
|
+
### 2. Check the graph
|
|
12
|
+
|
|
13
|
+
Call `kb_graph` to get nodes and edges. Look for:
|
|
14
|
+
- **Orphan pages** -- no parent and no incoming links
|
|
15
|
+
- **Dead ends** -- pages with no outgoing links (isolated knowledge)
|
|
16
|
+
- **Missing index pages** -- overview pages that should tie sections together
|
|
17
|
+
|
|
18
|
+
### 3. Spot structural issues
|
|
19
|
+
|
|
20
|
+
From `kb_ls` results, look for:
|
|
21
|
+
- Duplicate or near-duplicate page titles
|
|
22
|
+
- Deeply nested hierarchies (more than 3 levels is usually too deep)
|
|
23
|
+
- Pages without a parent (should they be under a section?)
|
|
24
|
+
- Pages with revision 1 that may be stubs
|
|
25
|
+
|
|
26
|
+
### 4. Sample content quality
|
|
27
|
+
|
|
28
|
+
Read 5-10 pages with `kb_cat`, prioritizing:
|
|
29
|
+
- Pages with high revision counts (heavily edited -- is content coherent?)
|
|
30
|
+
- Pages with revision 1 (potentially stubs or unreviewed)
|
|
31
|
+
- Overview/index pages (are they up to date with their children?)
|
|
32
|
+
|
|
33
|
+
### 5. Check provenance
|
|
34
|
+
|
|
35
|
+
For key pages, call `kb_provenance` and look for:
|
|
36
|
+
- Sections with no citations (unsourced claims)
|
|
37
|
+
- Sections with only `contradicts` citations (disputed content)
|
|
38
|
+
- Stale provenance (old sources, no recent updates)
|
|
39
|
+
|
|
40
|
+
### 6. Report findings
|
|
41
|
+
|
|
42
|
+
Organize by severity:
|
|
43
|
+
- **Critical** -- broken links, orphaned important pages, contradicted content
|
|
44
|
+
- **Moderate** -- missing sections, stale pages, structural issues
|
|
45
|
+
- **Minor** -- style inconsistencies, missing Related Pages sections
|
|
46
|
+
- **Recommendations** -- specific pages to create, merge, or reorganize
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Understanding Provenance
|
|
2
|
+
|
|
3
|
+
Provenance tracks where knowledge base content came from and how confident the claims are.
|
|
4
|
+
|
|
5
|
+
## Tools
|
|
6
|
+
|
|
7
|
+
### kb_blame
|
|
8
|
+
Shows paragraph-level source attribution. Use to answer "where did this paragraph come from?"
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
kb_blame "page-slug"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Returns: revision number, source title, and text excerpt for each paragraph.
|
|
15
|
+
|
|
16
|
+
### kb_sources
|
|
17
|
+
Lists all source documents that contributed to a page.
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
kb_sources "page-slug"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Returns: source type, title, and ID for each source.
|
|
24
|
+
|
|
25
|
+
### kb_provenance
|
|
26
|
+
Shows section-level citations with stance. This is the most powerful provenance tool.
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
kb_provenance "page-slug"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Returns citations organized by section, each with a stance:
|
|
33
|
+
- **supports** -- the source confirms the claim
|
|
34
|
+
- **contradicts** -- the source disagrees with the claim
|
|
35
|
+
- **qualifies** -- the source adds nuance or conditions to the claim
|
|
36
|
+
|
|
37
|
+
## When to use
|
|
38
|
+
|
|
39
|
+
- User asks "where did this information come from?"
|
|
40
|
+
- User questions the accuracy of a claim
|
|
41
|
+
- You need to verify before presenting information as fact
|
|
42
|
+
- Auditing page quality (see [auditing.md](auditing.md))
|
|
43
|
+
|
|
44
|
+
## Interpreting stances
|
|
45
|
+
|
|
46
|
+
- Multiple `supports` citations = high confidence
|
|
47
|
+
- A `contradicts` citation = flag it to the user, present both sides
|
|
48
|
+
- A `qualifies` citation = include the nuance in your response
|
|
49
|
+
- No citations on a section = unsourced, note this to the user
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Deep Research Workflow
|
|
2
|
+
|
|
3
|
+
Use this workflow when the user needs a thorough, multi-source analysis of a topic.
|
|
4
|
+
|
|
5
|
+
## Procedure
|
|
6
|
+
|
|
7
|
+
### 1. Discover the landscape
|
|
8
|
+
|
|
9
|
+
Call `list_projects` to understand the org structure. Then `kb_stats` on relevant projects to know where knowledge lives.
|
|
10
|
+
|
|
11
|
+
### 2. Broad search
|
|
12
|
+
|
|
13
|
+
Run `kb_search` with multiple query variations in parallel. The knowledge base uses hybrid semantic + keyword search, so both precise terms and natural language work. Try 2-3 phrasings.
|
|
14
|
+
|
|
15
|
+
### 3. Deep read
|
|
16
|
+
|
|
17
|
+
Read the top 5-10 most relevant pages with `kb_cat` (in parallel). Pay attention to:
|
|
18
|
+
- Section content and structure
|
|
19
|
+
- `[[links]]` to follow for related pages
|
|
20
|
+
- Page type (`decision` pages carry different weight than `research_note`)
|
|
21
|
+
|
|
22
|
+
### 4. Trace provenance
|
|
23
|
+
|
|
24
|
+
For key claims, use `kb_provenance` to see which sources support, contradict, or qualify each section. Use `kb_sources` to understand what raw documents fed each page.
|
|
25
|
+
|
|
26
|
+
### 5. Follow the graph
|
|
27
|
+
|
|
28
|
+
Use `kb_links` (backlinks) on central pages to discover related pages you may have missed. Use `kb_log` to see revision history and understand how knowledge evolved.
|
|
29
|
+
|
|
30
|
+
### 6. Check for conflicts
|
|
31
|
+
|
|
32
|
+
Look for provenance entries with stance `contradicts` or `qualifies`. These are the most valuable findings -- they show where evidence disagrees.
|
|
33
|
+
|
|
34
|
+
### 7. Synthesize
|
|
35
|
+
|
|
36
|
+
Write up findings organized by theme, not by page. Include:
|
|
37
|
+
- Key findings with page citations (title + slug)
|
|
38
|
+
- Areas of agreement across sources
|
|
39
|
+
- Contradictions or open questions
|
|
40
|
+
- Gaps -- what the knowledge base does NOT cover
|
|
41
|
+
- Temporal context -- when information was written, whether it may be stale
|
|
42
|
+
|
|
43
|
+
### 8. Recommend
|
|
44
|
+
|
|
45
|
+
If research reveals gaps or stale pages, suggest specific knowledge base updates.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Writing Knowledge Base Pages
|
|
2
|
+
|
|
3
|
+
Use this workflow when the user wants to create or update a page.
|
|
4
|
+
|
|
5
|
+
## Before writing
|
|
6
|
+
|
|
7
|
+
1. **Check for duplicates.** Search with `kb_search` across all spaces. If a page exists on this topic, read it with `kb_cat` and decide whether to update or create new.
|
|
8
|
+
|
|
9
|
+
2. **Find the right parent.** Use `kb_ls` to see the page hierarchy. Place the new page under the most logical parent. If unsure, ask the user.
|
|
10
|
+
|
|
11
|
+
3. **Choose the right page type:**
|
|
12
|
+
|
|
13
|
+
| Type | When to use |
|
|
14
|
+
|------|-------------|
|
|
15
|
+
| `topic` | Most common. Concepts, systems, processes. |
|
|
16
|
+
| `person` | People profiles. |
|
|
17
|
+
| `organization` | Companies, teams, departments. |
|
|
18
|
+
| `decision` | Decisions with rationale and date. |
|
|
19
|
+
| `meeting` | Meeting notes with attendees and outcomes. |
|
|
20
|
+
| `overview` | Index/section pages that tie a section together. |
|
|
21
|
+
| `research_note` | Ephemeral analysis, not canonical knowledge. |
|
|
22
|
+
|
|
23
|
+
## Content conventions
|
|
24
|
+
|
|
25
|
+
### Section markers (required)
|
|
26
|
+
Add `<!-- sec:OPAQUE_ID -->` before each major section. These enable section-level provenance tracking.
|
|
27
|
+
|
|
28
|
+
```markdown
|
|
29
|
+
<!-- sec:auth_overview -->
|
|
30
|
+
## Authentication Overview
|
|
31
|
+
|
|
32
|
+
Our authentication uses JWT tokens issued by Clerk...
|
|
33
|
+
|
|
34
|
+
<!-- sec:auth_flow -->
|
|
35
|
+
## Authentication Flow
|
|
36
|
+
|
|
37
|
+
1. User submits credentials to Clerk...
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Cross-references
|
|
41
|
+
Use `[[Page Title]]` to link to other KB pages. Verify targets exist first with `kb_search`.
|
|
42
|
+
|
|
43
|
+
Use `[[Display Text|slug]]` when display text differs from the page title.
|
|
44
|
+
|
|
45
|
+
### Structure
|
|
46
|
+
- Include a "Related Pages" section at the bottom with links to connected pages
|
|
47
|
+
- Be specific: name WHO made decisions, WHEN things happened, WHY
|
|
48
|
+
- Use tables for structured data, code blocks for config/commands
|
|
49
|
+
- Do not create stub pages -- every page should have substantive content
|
|
50
|
+
|
|
51
|
+
## After writing
|
|
52
|
+
|
|
53
|
+
Read the page back with `kb_cat` to verify it rendered correctly.
|