@justestif/pk 0.2.2 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -32
- package/dist/index.js +16227 -36551
- package/package.json +2 -3
- package/skill/SKILL.md +67 -32
- package/skill/references/knowledge-model.md +1 -1
package/README.md
CHANGED
|
@@ -30,55 +30,47 @@ Non-interactive:
|
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
pk init my-project --harness claude
|
|
33
|
-
pk init my-project --harness claude,
|
|
33
|
+
pk init my-project --harness claude,codex # multiple harnesses
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
**Git integration:** `pk init` creates a git repository in `~/.pk/<name>/.git` and tracks all knowledge operations via commits and git notes.
|
|
37
|
+
|
|
38
|
+
Available harnesses: `claude` (Claude Code), `codex` (Codex), `opencode` (OpenCode).
|
|
37
39
|
|
|
38
40
|
`pk init` does three things:
|
|
39
41
|
|
|
40
42
|
1. Creates `~/.pk/<name>/` as the knowledge home for this project
|
|
41
|
-
2.
|
|
42
|
-
3. Installs
|
|
43
|
-
|
|
44
|
-
| Harness | Files written |
|
|
45
|
-
|---|---|
|
|
46
|
-
| `claude` | `.mcp.json`, `CLAUDE.md`, `.claude/hooks/pk-eval.ts`, `.claude/settings.json` | (also works for Claude Desktop) |
|
|
47
|
-
| `cursor` | `.cursor/mcp.json`, `.cursor/rules/pk.mdc`, `.cursor/hooks/pk-eval.sh`, `.cursor/hooks.json` |
|
|
48
|
-
| `gemini` | `.gemini/settings.json`, `GEMINI.md`, `.gemini/hooks/pk-eval.sh` |
|
|
49
|
-
| `codex` | `.codex/config.toml`, `AGENTS.md`, `.codex/hooks/pk-eval.sh`, `.codex/hooks.json` |
|
|
50
|
-
| `opencode` | `opencode.json`, `AGENTS.md`, `CLAUDE.md`, `.opencode/plugins/pk-eval.ts` |
|
|
43
|
+
2. Installs a hook or plugin that calls `pk prime` at session start to inject context into your agent
|
|
44
|
+
3. Installs the pk skill so your agent knows how to use the CLI
|
|
51
45
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
|
57
|
-
|---|---|
|
|
58
|
-
| `pk_search` | Full-text search over the knowledge base (BM25, porter stemming) |
|
|
59
|
-
| `pk_synthesize` | Ranked context dump — by query, session start, or all notes |
|
|
60
|
-
| `pk_read` | Read the full content of a note by path |
|
|
61
|
-
| `pk_new` | Create a new typed note skeleton, returns path to fill in |
|
|
62
|
-
| `pk_lint` | Validate all notes for schema and quality rules |
|
|
63
|
-
|
|
64
|
-
The agent calls these tools directly — no hooks, no shell extensions, no prompt injection. Agents should never read or write knowledge files directly.
|
|
46
|
+
| Harness | Files written | Mechanism |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| `claude` | `.claude/hooks/pk-eval.ts`, `.claude/settings.json` | Hook spawns `pk prime` on every prompt |
|
|
49
|
+
| `codex` | `AGENTS.md` | Codex reads AGENTS.md natively |
|
|
50
|
+
| `opencode` | `.opencode/plugins/pk-eval.ts` | Plugin spawns `pk prime` at session start |
|
|
65
51
|
|
|
66
52
|
## Commands
|
|
67
53
|
|
|
68
54
|
```bash
|
|
69
|
-
pk init [name] [--harness h1,h2,…] # set up project +
|
|
70
|
-
pk mcp # start MCP server (stdio)
|
|
55
|
+
pk init [name] [--harness h1,h2,…] # set up project + hooks
|
|
71
56
|
|
|
72
57
|
pk new <type> <title> [--tags t1,t2]
|
|
73
|
-
pk
|
|
58
|
+
pk edit <path> [--editor <cmd>] # edit existing note
|
|
59
|
+
pk delete <path> [--yes] # delete note with confirmation
|
|
60
|
+
pk search <query> [--limit 5] [--type] [--status] [--tag]
|
|
74
61
|
pk synthesize [query] [--all]
|
|
62
|
+
pk history [--limit 20] [--type <type>] [--filter-type <type>] [--filter-tag <tag>] [--filter-operation <op>]
|
|
63
|
+
pk read <path> [--json]
|
|
75
64
|
pk vocab [--json]
|
|
76
65
|
pk rebuild
|
|
77
|
-
pk lint
|
|
66
|
+
pk lint [paths...] [--json]
|
|
67
|
+
pk prime # output priming context for hooks
|
|
78
68
|
pk instructions <command>
|
|
79
69
|
pk config
|
|
80
70
|
```
|
|
81
71
|
|
|
72
|
+
Every command supports `--json` for machine-readable output.
|
|
73
|
+
|
|
82
74
|
### Note types
|
|
83
75
|
|
|
84
76
|
| Type | Purpose |
|
|
@@ -103,7 +95,7 @@ pk synthesize
|
|
|
103
95
|
## Knowledge structure
|
|
104
96
|
|
|
105
97
|
Notes live in `~/.pk/<name>/` as plain markdown files — human-editable and git-diffable.
|
|
106
|
-
Agents access them exclusively through the
|
|
98
|
+
Agents access them exclusively through the CLI; humans can read and edit them directly.
|
|
107
99
|
|
|
108
100
|
```
|
|
109
101
|
~/.pk/
|
|
@@ -119,8 +111,9 @@ Agents access them exclusively through the MCP tools; humans can read and edit t
|
|
|
119
111
|
Search is powered by SQLite FTS5 with BM25 ranking and porter stemming.
|
|
120
112
|
Partial word matching works — `pk search migr` matches "migration", "migrate", etc.
|
|
121
113
|
|
|
122
|
-
`pk vocab` lists all tags by frequency — useful for orienting
|
|
123
|
-
|
|
114
|
+
`pk vocab` lists all tags by frequency — useful for orienting before searching.
|
|
115
|
+
|
|
116
|
+
`pk history` shows all knowledge operations (create, update, delete) as git commits and synthesize operations as git notes. Supports filtering by type, tag, and operation.
|
|
124
117
|
|
|
125
118
|
## License
|
|
126
119
|
|