predicate-skill 1.2.0 → 1.6.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.
package/README.md CHANGED
@@ -1,35 +1,91 @@
1
1
  # predicate-skill
2
2
 
3
- Claude Code plugin packaging the Predicate MCP server + SKILL.md + SessionStart
4
- hook + operator skills. This is the install target for the marketplace path.
3
+ Distributable Predicate package: bundled MCP server + `predicate` CLI +
4
+ Claude Code plugin (SKILL.md + hooks + slash commands) + per-platform
5
+ hook adapters for Cursor, Gemini CLI, VS Code Copilot, OpenCode, and
6
+ Codex CLI. This is the install target for both the Claude Code
7
+ marketplace and the npm path.
5
8
 
6
- ## Install (via marketplace)
9
+ Current version: **1.5.0** (`v1.5.0-stop-extract`).
10
+
11
+ ## Install
12
+
13
+ Prerequisites everywhere: **Docker** (for Fuseki) and **Node 20+**.
14
+
15
+ ### Claude Code marketplace
7
16
 
8
17
  ```
9
- /plugin marketplace add mxresearch/predicate
18
+ /plugin marketplace add NordicAgents/predicate
10
19
  /plugin install predicate@predicate
11
20
  ```
12
21
 
13
- After install, bring Fuseki up:
22
+ ### npm (any MCP-capable host)
14
23
 
15
24
  ```bash
25
+ npm install -g predicate-skill
16
26
  predicate up
17
27
  predicate doctor
18
28
  ```
19
29
 
30
+ Or one-shot without a global install:
31
+
32
+ ```bash
33
+ claude mcp add predicate -- npx -y predicate-skill
34
+ ```
35
+
36
+ ### Other platforms
37
+
38
+ See the platform-specific config templates and READMEs under `hooks/`:
39
+
40
+ | Platform | Subdirectory | Hook events wired |
41
+ |---|---|---|
42
+ | Claude Code | `hooks/` (root) | SessionStart, PreToolUse, PostToolUse, Stop |
43
+ | Gemini CLI | `hooks/gemini-cli/` | sessionStart, preCompress, stop |
44
+ | Cursor | `hooks/cursor/` | manual / cron only (no native events) |
45
+ | VS Code Copilot | `hooks/vscode-copilot/` | manual / VS Code tasks |
46
+ | OpenCode | `hooks/opencode/` | session.started, session.compacted, session.stopped |
47
+ | Codex CLI | `hooks/codex-cli/` | manual / shell alias / cron |
48
+
49
+ ## CLI
50
+
51
+ ```
52
+ predicate up # docker compose up + bootstrap graphs + load TBox
53
+ predicate down # stop fuseki, keep the volume
54
+ predicate doctor # health checks (docker, fuseki, tbox)
55
+ predicate stats # current kg_stats output
56
+ predicate sessionstart # one-line KG status banner (used by hook scripts)
57
+ predicate maintain # reaper + generalizer + promotion sweeper
58
+ predicate capture # record a tool invocation in kg:usage (opt-in: PREDICATE_RAW_CAPTURE=1)
59
+ predicate extract # read a Stop-hook payload and assert typed triples to kg:abox
60
+ predicate --version
61
+ predicate --help
62
+ ```
63
+
64
+ ## MCP tools
65
+
66
+ The bundled server exposes 9 tools over stdio: `kg_explore_schema`,
67
+ `kg_ask`, `kg_assert`, `kg_explain`, `kg_propose_schema`,
68
+ `kg_research_goal`, `kg_stats`, `kg_maintain`, `kg_capture`.
69
+
70
+ Env vars consumed at runtime:
71
+
72
+ - `FUSEKI_URL` (default `http://localhost:3030`)
73
+ - `PREDICATE_DATASET` (default `predicate`)
74
+ - `PREDICATE_CAPTURE_SKIP` (comma list of tool names to suppress in `kg_capture`, default empty)
75
+ - `PREDICATE_CAPTURE_TRUNCATE` (max chars per captured input/output field, default `500`)
76
+
20
77
  ## What's in this directory
21
78
 
22
- - `.claude-plugin/plugin.json` — MCP server + skills + hooks registration.
23
- - `server.bundle.mjs` — bundled MCP server (no `node_modules` required).
24
- - `cli.bundle.mjs` — bundled `predicate` CLI, surfaced via the package's `bin`.
25
- - `skills/predicate/SKILL.md` — host-agent contract: triggers, workflow,
26
- HARD-GATE anti-patterns, four worked examples.
27
- - `skills/predicate-doctor/SKILL.md`, `skills/predicate-stats/SKILL.md` —
28
- operator skills.
29
- - `hooks/hooks.json` + `hooks/session-start.sh` — SessionStart hook that
30
- surfaces current goal/class counts.
31
- - `compose/docker-compose.yml`, `compose/fuseki/config.ttl` — Fuseki config
32
- the CLI launches.
79
+ - `.claude-plugin/plugin.json` — MCP server + skills + hooks registration for the Claude Code marketplace path.
80
+ - `server.bundle.mjs` — bundled MCP server (no `node_modules` required at runtime).
81
+ - `cli.bundle.mjs` — bundled `predicate` CLI, surfaced via this package's `bin` entry.
82
+ - `skills/predicate/SKILL.md` — host-agent contract: triggers, workflow, HARD-GATE anti-patterns, worked examples.
83
+ - `skills/predicate-doctor/SKILL.md`, `skills/predicate-stats/SKILL.md` operator skills.
84
+ - `commands/{up,down,doctor,stats,ask}.md` — slash-command definitions for `/predicate:*`.
85
+ - `hooks/hooks.json` — Claude Code hook registration (SessionStart, PreToolUse, PostToolUse).
86
+ - `hooks/session-start.sh`, `hooks/pre-tool-use.sh`, `hooks/post-tool-use.sh` — Claude Code lifecycle hooks; each delegates to a `predicate` CLI subcommand.
87
+ - `hooks/{cursor,gemini-cli,vscode-copilot,opencode,codex-cli}/` — per-platform hook scripts + config templates + per-platform README.
88
+ - `compose/docker-compose.yml`, `compose/fuseki/config.ttl` — Fuseki + TDB2 config that `predicate up` launches.
33
89
 
34
90
  ## Rebuilding the bundles
35
91
 
@@ -40,8 +96,21 @@ Bundles are committed so the marketplace install path works without
40
96
  pnpm --filter predicate-skill bundle
41
97
  ```
42
98
 
43
- Or rebuild everything:
99
+ Or rebuild everything (all workspace packages plus the bundles):
44
100
 
45
101
  ```bash
46
102
  pnpm build
47
103
  ```
104
+
105
+ ## Tests
106
+
107
+ The full workspace test suite runs against a live Fuseki:
108
+
109
+ ```bash
110
+ predicate up
111
+ pnpm test # 160 tests across 5 packages
112
+ ```
113
+
114
+ ## License
115
+
116
+ Apache-2.0. See `LICENSE`.