Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计通过

pkmPKM 搜索

Agent Skill

pkm 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

480

周安装

20

GitHub Stars

38

下载量

160
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pkm(PKM 搜索)
来源仓库:https://github.com/lanej/dotfiles
仓库路径:skills/pkm
安装命令:
npx skills add https://github.com/lanej/dotfiles --skill pkm
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/lanej/dotfiles --skill pkm

简介

主要用例:

  • 具有质量意识的个人知识管理
  • 文档新鲜度的时间跟踪
  • 关系发现和反向链接跟踪
  • 质量审核和知识库维护
  • 通过 MCP 与 Claude 集成
  • 主要优点:
  • 质量过滤(确定性、信息类型)
  • 新鲜度跟踪(时间感知)
  • 混合搜索(语义+全文)
  • 关系跟踪(维基链接、反向链接)
  • Claude 的代币高效结果
  • 用于编辑器自动完成的 LSP 集成
  • 最常见的命令:
  • pkm索引〜/笔记/
  • - 索引工作区
  • pkm 搜索 --facts-only --fresh-only“查询”
  • - 优质搜索
  • pkm 关系 --source note.md
  • - 寻找关系
  • pkm质量审核
  • - 审计知识库
  • pkm 统计数据 -d
  • - 分析工作空间
  • 每周安装量
  • 20
  • 存储库
  • Lanej/点文件
  • GitHub 之星
  • 38
  • 第一次看到
  • 2026 年 1 月 24 日
  • 安全审计
  • Gen Agent Trust Hub 通行证
  • 套接字通行证
  • 斯尼克通行证

SKILL.md

PKM - Personal Knowledge Management Skill

You are a specialist in using pkm, a Personal Knowledge Management system that provides a knowledge layer between Claude Code (MCP) and lancer/LanceDB. PKM offers temporal awareness, quality filtering, token-efficient search, and document curation tools for managing workspace knowledge.

What is PKM?

pkm is an advanced knowledge management system that provides:

  • Temporal awareness: Track document freshness and identify stale content
  • Quality filtering: Filter by certainty level and information type (facts, analysis, ideas)
  • Hybrid search: Combines vector (semantic) and BM25 (full-text) search
  • Relationship tracking: Document wikilinks, references, and backlinks
  • Quality audits: Systematic review of knowledge base quality
  • LSP server: Wikilink autocomplete in editors
  • MCP integration: Claude Desktop integration for intelligent search

Core Capabilities

  1. Index: Index workspace documents (titles and/or content)
  2. Search: Search with quality filters (certainty, info type, freshness)
  3. Relationships: Track document relationships and wikilinks
  4. Backlinks: Query what links to a document
  5. Quality Audit: Review and improve knowledge base quality
  6. Stats: Analyze indexed content statistics
  7. LSP/MCP: Editor integration and Claude Desktop integration

Quick Start

Basic Search

# Search workspace documents
pkm search "kubernetes deployment strategies"

# Search with quality filters
pkm search --facts-only --fresh-only "API authentication"

# Search with result limit
pkm search -n 5 "error handling patterns"

Basic Indexing

# Index current directory (both titles and content)
pkm index

# Index specific directory
pkm index ~/Documents/notes/

# Index specific files
pkm index note1.md note2.md

Document Indexing

Index Command Options

# Index both titles and content (default)
pkm index ./notes/

# Index only titles (LSP autocomplete)
pkm index --titles-only ./notes/

# Index only content (search)
pkm index --content-only ./notes/

# Index to specific table
pkm index --table my_knowledge ./notes/

# Index specific file extensions
pkm index --extensions md,txt,pdf ./documents/

# Force re-index
pkm index --force ./notes/

Index from stdin

# Pipe file paths to index
find ~/Documents -name "*.md" -mtime -7 | pkm index --stdin

# From git changed files
git diff --name-only main | grep "\.md$" | pkm index --stdin

Index Modes

Hybrid index (default):

# Vector + BM25 full-text search
pkm index ./notes/

Vector-only index:

# Skip BM25 (faster indexing, semantic search only)
pkm index --no-hybrid ./notes/

Index Management

# Quiet mode (suppress progress)
pkm index --quiet ./large-corpus/

# Dry run (see what would be indexed)
pkm index --dry-run ./notes/

# Verbose logging
pkm index -v ./notes/

Search Operations

Search Command Options

# Basic search
pkm search "machine learning algorithms"

# Limit results
pkm search -n 10 "API design patterns"

# Set minimum score threshold
pkm search --min-score 0.1 "database optimization"

# Specify database path
pkm search --db-path ~/my-db "query"

# Specify workspace root
pkm search --workspace-root ~/Documents "query"

# Custom table name
pkm search --table-name custom_table "query"

Quality Filters

Filter by information type:

# Show only facts
pkm search --info-type fact "kubernetes architecture"
pkm search --facts-only "docker commands"

# Show only analysis
pkm search --info-type analysis "performance bottlenecks"

# Show only ideas
pkm search --info-type idea "feature proposals"

Filter by certainty:

# High certainty only
pkm search --certainty high "security best practices"

# Medium certainty
pkm search --certainty medium "migration strategies"

# Low certainty (speculative)
pkm search --certainty low "future trends"

Filter by freshness:

# Maximum age in days
pkm search --max-age 30 "recent updates"

# Only fresh documents
pkm search --fresh-only "current status"

# Exclude stale documents
pkm search --exclude-stale "active projects"

Combined Filters

# Facts from last 30 days
pkm search \
  --facts-only \
  --max-age 30 \
  "authentication implementation"

# High certainty analysis (fresh)
pkm search \
  --info-type analysis \
  --certainty high \
  --fresh-only \
  "performance optimization"

# Recent ideas with threshold
pkm search \
  --info-type idea \
  --max-age 14 \
  --min-score 0.15 \
  -n 5 \
  "feature enhancements"

Output Formats

# Text output (default)
pkm search "query"

# JSON output for scripting
pkm search --output json "query" | jq '.results[] | .path'

# Verbose logging
pkm search -v "query"

Relationship Tracking

Query Outgoing Relationships

# Show all links from a document
pkm relationships --source notes/architecture.md

# Filter by relationship type
pkm relationships --source notes/api.md --rel-type wikilink

# JSON output
pkm relationships --source notes/design.md --output json

Query Backlinks

# Show what links to a document
pkm backlinks notes/concepts/auth.md

# Filter by relationship type
pkm backlinks notes/api-spec.md --rel-type reference

# JSON output
pkm backlinks notes/design.md --output json

Relationship Use Cases

# Find related documents
pkm relationships --source current-work.md

# Discover document impact
pkm backlinks important-concept.md

# Build knowledge graph
pkm relationships --source index.md --output json | \
  jq '.relationships[] | .target'

# Find orphaned documents (no backlinks)
pkm backlinks my-note.md | grep -q "No backlinks" && \
  echo "Orphaned document"

Index a Single Document

# Index document for relationship tracking
pkm index-doc notes/new-concept.md

# With custom database
pkm index-doc --db-path ~/kb notes/article.md

# Verbose output
pkm index-doc -v notes/research.md

Quality Management

Quality Audit

# Audit entire workspace
pkm quality-audit

# Audit specific area/topic
pkm quality-audit --area kubernetes

# JSON output
pkm quality-audit --output json

# Verbose audit
pkm quality-audit -v

What quality-audit checks:

  • Documents missing quality metadata
  • Stale documents needing updates
  • Low certainty information
  • Missing or unclear info types
  • Document completeness

Find Stale Documents

# Find documents exceeding freshness threshold
pkm find-stale

# With workspace root
pkm find-stale --workspace-root ~/Documents/notes

# Verbose output
pkm find-stale -v

Verification Queue

# Show documents needing review
pkm verify-queue

# With specific workspace
pkm verify-queue --workspace-root ~/kb

# Verbose output
pkm verify-queue -v

Statistics and Analysis

Workspace Statistics

# Show basic stats
pkm stats

# Detailed breakdown by file extension
pkm stats -d

# Detailed stats with custom database
pkm stats --db-path ~/my-kb -d

# JSON output
pkm stats --output json

Stats include:

  • Total documents indexed
  • Document counts by type
  • Table information
  • Embedding models used
  • Index sizes

Table Management

List Tables

# List all tables in database
pkm tables

# With custom database path
pkm tables --db-path ~/my-kb

# Verbose output
pkm tables -v

Server Modes

LSP Server (Wikilink Autocomplete)

# Start LSP server for editor integration
pkm lsp

# With verbose logging
pkm lsp -v

Purpose: Provides wikilink autocomplete in editors (VSCode, Neovim, etc.)

MCP Server (Claude Desktop)

# Start MCP server
pkm mcp

# With verbose logging
pkm mcp -v

Purpose: Integrates PKM search into Claude Desktop for intelligent document retrieval.

Environment Variables

# Set default database path
export PKM_DB_PATH=~/my-knowledge-base
pkm search "query"

# Set workspace root
export PKM_ROOT=~/Documents/notes
pkm index

# Both together
export PKM_DB_PATH=~/kb
export PKM_ROOT=~/notes
pkm search "query"

Common Workflows

Workflow 1: Initial Workspace Setup

# 1. Index your workspace
cd ~/Documents/notes
pkm index

# 2. Check statistics
pkm stats -d

# 3. Test search
pkm search "recent projects"

# 4. Run quality audit
pkm quality-audit

Workflow 2: Daily Knowledge Work

# 1. Find stale documents to review
pkm find-stale

# 2. Search for high-quality facts
pkm search --facts-only --certainty high "project status"

# 3. Index new/modified documents
find . -name "*.md" -mtime -1 | pkm index --stdin

# 4. Check relationships
pkm relationships --source today-notes.md

Workflow 3: Research and Analysis

# 1. Search for recent analysis
pkm search \
  --info-type analysis \
  --max-age 30 \
  --certainty high \
  -n 20 \
  "performance optimization"

# 2. Find related documents
pkm relationships --source research-notes.md

# 3. Discover citations
pkm backlinks key-concept.md

# 4. Export for review
pkm search --output json "research topic" | \
  jq '.results[] | {path, score, summary}' > research.json

Workflow 4: Knowledge Base Maintenance

# 1. Find documents needing review
pkm verify-queue

# 2. Run quality audit
pkm quality-audit --output json > audit-results.json

# 3. Find stale content
pkm find-stale

# 4. Re-index updated documents
pkm index --force ./updated-notes/

# 5. Verify improvements
pkm stats -d

Workflow 5: Incremental Updates

# 1. Find recently modified files
find ~/notes -name "*.md" -mtime -7 > recent.txt

# 2. Index only recent changes
pkm index --stdin < recent.txt

# 3. Search fresh content
pkm search --max-age 7 "latest updates"

# 4. Update statistics
pkm stats -d

Workflow 6: Integration with Git

# Index files changed in current branch
git diff --name-only main | \
  grep "\.md$" | \
  pkm index --stdin

# Index uncommitted changes
git diff --name-only | \
  grep "\.md$" | \
  pkm index --stdin

# Re-index entire repository
pkm index --force .

Best Practices

1. Index Strategically

Title indexing (fast, for autocomplete):

pkm index --titles-only ~/notes/

Content indexing (comprehensive, for search):

pkm index --content-only ~/important-docs/

Full indexing (both):

pkm index ~/knowledge-base/

2. Use Quality Filters Effectively

For verified information:

pkm search --facts-only --certainty high "API endpoints"

For recent insights:

pkm search --info-type analysis --max-age 14 "optimization"

For brainstorming:

pkm search --info-type idea --exclude-stale "features"

3. Maintain Freshness

# Regular freshness check
pkm find-stale

# Periodic re-indexing
pkm index --force ./active-projects/

# Exclude stale from searches
pkm search --exclude-stale "current work"

4. Track Relationships

# After creating new note with wikilinks
pkm index-doc new-note.md
pkm relationships --source new-note.md

# Understand impact before editing
pkm backlinks important-concept.md

5. Regular Quality Audits

# Weekly audit
pkm quality-audit --output json > audit-$(date +%Y%m%d).json

# Area-specific review
pkm quality-audit --area architecture

# Track verification queue
pkm verify-queue

6. Organize with Extensions

# Index markdown notes
pkm index --extensions md ~/notes/

# Include PDFs and markdown
pkm index --extensions md,pdf ~/research/

# Text files only
pkm index --extensions txt ~/logs/

7. Use Appropriate Thresholds

Broad exploration:

pkm search --min-score 0.05 "general topic"

Balanced results:

pkm search --min-score 0.1 "specific concept"

High precision:

pkm search --min-score 0.2 "exact information"

Integration Setups

Claude Desktop (MCP)

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "pkm": {
      "command": "pkm",
      "args": ["mcp"],
      "env": {
        "PKM_ROOT": "/Users/username/Documents/notes",
        "PKM_DB_PATH": "/Users/username/.pkm/db"
      }
    }
  }
}

VSCode (LSP)

  1. Start LSP server: pkm lsp
  2. Configure editor to connect to LSP endpoint
  3. Get wikilink autocomplete in markdown files

Advanced Usage

Custom Database Locations

# Work with multiple knowledge bases
pkm search --db-path ~/work-kb "work queries"
pkm search --db-path ~/personal-kb "personal queries"

# Separate workspace and database
pkm index \
  --workspace-root ~/Documents/notes \
  --db-path ~/kb/notes-index

Scripting and Automation

# Daily index automation
#!/bin/bash
cd ~/notes
find . -name "*.md" -mtime -1 | pkm index --quiet --stdin
pkm stats --output json > ~/stats/$(date +%Y%m%d).json

# Weekly quality report
#!/bin/bash
pkm quality-audit --output json > audit.json
pkm find-stale > stale.txt
pkm verify-queue > queue.txt

Batch Processing

# Process multiple directories
for dir in ~/notes/*/; do
  echo "Indexing $dir"
  pkm index "$dir"
done

# Selective re-indexing
pkm stats --output json | \
  jq -r '.tables[] | select(.doc_count < 10) | .name' | \
  xargs -I {} pkm index --force --table {}

Troubleshooting

Issue: Search returns no results

Solutions:

# Check if content is indexed
pkm stats -d

# Lower score threshold
pkm search --min-score 0.01 "query"

# Remove quality filters
pkm search "query"  # No filters

# Verify database path
pkm search --db-path ~/kb -v "query"

Issue: Stale documents not detected

Solutions:

# Force re-index
pkm index --force .

# Check verbose output
pkm find-stale -v

# Verify workspace root
pkm find-stale --workspace-root ~/notes

Issue: Relationships not tracked

Solutions:

# Index document for relationships
pkm index-doc document.md

# Verbose indexing
pkm index-doc -v document.md

# Re-index entire workspace
pkm index --force .

Issue: Poor search quality

Solutions:

# Enable hybrid search (vector + BM25)
pkm index .  # Default is hybrid

# Adjust filters
pkm search --min-score 0.05 "query"

# Check for sufficient indexed content
pkm stats -d

Issue: LSP/MCP not working

Solutions:

# Verify server starts
pkm lsp -v
pkm mcp -v

# Check environment variables
echo $PKM_ROOT
echo $PKM_DB_PATH

# Restart server
pkill -f "pkm lsp"
pkm lsp -v

Quick Reference

# Indexing
pkm index                                # Index current directory
pkm index ~/notes/                       # Index specific directory
pkm index --titles-only ~/notes/         # Titles only (LSP)
pkm index --force ~/notes/               # Force re-index
pkm index --extensions md,pdf ~/docs/    # Specific file types

# Searching
pkm search "query"                       # Basic search
pkm search -n 10 "query"                 # Limit results
pkm search --facts-only "query"          # Facts only
pkm search --fresh-only "query"          # Fresh only
pkm search --certainty high "query"      # High certainty
pkm search --max-age 30 "query"          # Last 30 days

# Relationships
pkm relationships --source note.md       # Show outgoing links
pkm backlinks note.md                    # Show incoming links
pkm index-doc note.md                    # Index for relationships

# Quality management
pkm quality-audit                        # Audit workspace
pkm find-stale                          # Find stale documents
pkm verify-queue                        # Documents needing review
pkm stats -d                            # Detailed statistics

# Servers
pkm mcp                                 # Start MCP server
pkm lsp                                 # Start LSP server

# Output formats
pkm search --output json "query"        # JSON output
pkm stats --output json                 # JSON stats
pkm quality-audit --output json         # JSON audit

Common Patterns

Pattern 1: Quick Fact Lookup

pkm search --facts-only --certainty high -n 5 "API authentication"

Pattern 2: Recent Analysis

pkm search --info-type analysis --max-age 30 --fresh-only "optimization"

Pattern 3: Explore Related Content

pkm relationships --source research.md && \
pkm backlinks research.md

Pattern 4: Daily Maintenance

find . -name "*.md" -mtime -1 | pkm index --quiet --stdin && \
pkm find-stale

Pattern 5: Quality-Focused Search

pkm search \
  --facts-only \
  --certainty high \
  --fresh-only \
  --min-score 0.15 \
  -n 10 \
  "deployment procedures"

Summary

Primary use cases:

  • Personal knowledge management with quality awareness
  • Temporal tracking of document freshness
  • Relationship discovery and backlink tracking
  • Quality audits and knowledge base maintenance
  • Integration with Claude via MCP

Key advantages:

  • Quality filtering (certainty, info type)
  • Freshness tracking (temporal awareness)
  • Hybrid search (semantic + full-text)
  • Relationship tracking (wikilinks, backlinks)
  • Token-efficient results for Claude
  • LSP integration for editor autocomplete

Most common commands:

  • pkm index ~/notes/ - Index workspace
  • pkm search --facts-only --fresh-only "query" - Quality search
  • pkm relationships --source note.md - Find relationships
  • pkm quality-audit - Audit knowledge base
  • pkm stats -d - Analyze workspace

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.02%
按下载量换算43

OpenCode

25.07%
按下载量换算40

Codex

19.11%
按下载量换算31

Antigravity

13.04%
按下载量换算21

Gemini CLI

8.2%
按下载量换算13

windsurf

3.16%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills