predicate-skill 1.2.0 → 2.0.1

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.
Files changed (37) hide show
  1. package/.claude-plugin/plugin.json +6 -5
  2. package/README.md +88 -17
  3. package/cli.bundle.mjs +29269 -234
  4. package/dashboard/index.html +180 -0
  5. package/hooks/codex-cli/README.md +30 -0
  6. package/hooks/codex-cli/config.toml.template +10 -0
  7. package/hooks/codex-cli/pre-compact.sh +4 -0
  8. package/hooks/codex-cli/session-start.sh +7 -0
  9. package/hooks/codex-cli/stop.sh +4 -0
  10. package/hooks/cursor/README.md +46 -0
  11. package/hooks/cursor/mcp.json.template +12 -0
  12. package/hooks/cursor/pre-compact.sh +7 -0
  13. package/hooks/cursor/session-start.sh +7 -0
  14. package/hooks/cursor/stop.sh +5 -0
  15. package/hooks/gemini-cli/README.md +38 -0
  16. package/hooks/gemini-cli/pre-compact.sh +5 -0
  17. package/hooks/gemini-cli/session-start.sh +6 -0
  18. package/hooks/gemini-cli/settings.json.template +17 -0
  19. package/hooks/gemini-cli/stop.sh +20 -0
  20. package/hooks/hooks.json +25 -7
  21. package/hooks/opencode/README.md +40 -0
  22. package/hooks/opencode/opencode.json.template +18 -0
  23. package/hooks/opencode/pre-compact.sh +5 -0
  24. package/hooks/opencode/session-start.sh +6 -0
  25. package/hooks/opencode/stop.sh +20 -0
  26. package/hooks/post-tool-use.sh +10 -0
  27. package/hooks/pre-tool-use.sh +11 -0
  28. package/hooks/session-start.sh +7 -19
  29. package/hooks/stop.sh +20 -0
  30. package/hooks/vscode-copilot/README.md +43 -0
  31. package/hooks/vscode-copilot/pre-compact.sh +4 -0
  32. package/hooks/vscode-copilot/session-start.sh +7 -0
  33. package/hooks/vscode-copilot/settings.json.template +12 -0
  34. package/hooks/vscode-copilot/stop.sh +5 -0
  35. package/package.json +2 -1
  36. package/server.bundle.mjs +28422 -18694
  37. package/skills/predicate/SKILL.md +193 -1
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "predicate",
3
- "version": "1.0.0",
4
- "description": "Local reasoning knowledge graph (RDF/OWL) for AI agents.",
3
+ "version": "2.0.1",
4
+ "description": "Local reasoning knowledge graph (RDF/OWL) for AI agents — 9 kg_* MCP tools + cross-platform Stop-hook turn extraction (Claude Code + Gemini CLI + OpenCode) + reasoning bridge for action data.",
5
5
  "author": {
6
- "name": "MX Research"
6
+ "name": "Nordic Agents Research",
7
+ "email": "midhunxavier@outlook.com"
7
8
  },
8
- "homepage": "https://github.com/mxresearch/predicate#readme",
9
- "repository": "https://github.com/mxresearch/predicate",
9
+ "homepage": "https://github.com/NordicAgents/predicate#readme",
10
+ "repository": "https://github.com/NordicAgents/predicate",
10
11
  "license": "Apache-2.0",
11
12
  "keywords": ["mcp", "knowledge-graph", "rdf", "owl", "sparql", "reasoning"],
12
13
  "mcpServers": {
package/README.md CHANGED
@@ -1,35 +1,93 @@
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: **2.0.0** (`v2.0.0-domain-agnostic-bootstrap`).
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 (then init on first run)
53
+ predicate init # initialize kg:tbox (community ontology / upload / empty)
54
+ predicate down # stop fuseki, keep the volume
55
+ predicate doctor # health checks (docker, fuseki, tbox)
56
+ predicate stats # current kg_stats output
57
+ predicate sessionstart # one-line KG status banner (used by hook scripts)
58
+ predicate maintain # reaper + generalizer + promotion sweeper
59
+ predicate capture # record a tool invocation in kg:usage (opt-in: PREDICATE_RAW_CAPTURE=1)
60
+ predicate extract # read a Stop-hook payload and assert typed triples to kg:abox
61
+ predicate --version
62
+ predicate --help
63
+ ```
64
+
65
+ ## MCP tools
66
+
67
+ The bundled server exposes 11 tools over stdio: `kg_explore_schema`,
68
+ `kg_ask`, `kg_assert`, `kg_explain`, `kg_propose_schema`,
69
+ `kg_research_goal`, `kg_stats`, `kg_maintain`, `kg_capture`,
70
+ `kg_config_get`, `kg_config_set`.
71
+
72
+ Env vars consumed at runtime:
73
+
74
+ - `FUSEKI_URL` (default `http://localhost:3030`)
75
+ - `PREDICATE_DATASET` (default `predicate`)
76
+ - `PREDICATE_CAPTURE_SKIP` (comma list of tool names to suppress in `kg_capture`, default empty)
77
+ - `PREDICATE_CAPTURE_TRUNCATE` (max chars per captured input/output field, default `500`)
78
+
20
79
  ## What's in this directory
21
80
 
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.
81
+ - `.claude-plugin/plugin.json` — MCP server + skills + hooks registration for the Claude Code marketplace path.
82
+ - `server.bundle.mjs` — bundled MCP server (no `node_modules` required at runtime).
83
+ - `cli.bundle.mjs` — bundled `predicate` CLI, surfaced via this package's `bin` entry.
84
+ - `skills/predicate/SKILL.md` — host-agent contract: triggers, workflow, HARD-GATE anti-patterns, worked examples.
85
+ - `skills/predicate-doctor/SKILL.md`, `skills/predicate-stats/SKILL.md` operator skills.
86
+ - `commands/{up,down,doctor,stats,ask}.md` — slash-command definitions for `/predicate:*`.
87
+ - `hooks/hooks.json` — Claude Code hook registration (SessionStart, PreToolUse, PostToolUse).
88
+ - `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.
89
+ - `hooks/{cursor,gemini-cli,vscode-copilot,opencode,codex-cli}/` — per-platform hook scripts + config templates + per-platform README.
90
+ - `compose/docker-compose.yml`, `compose/fuseki/config.ttl` — Fuseki + TDB2 config that `predicate up` launches.
33
91
 
34
92
  ## Rebuilding the bundles
35
93
 
@@ -40,8 +98,21 @@ Bundles are committed so the marketplace install path works without
40
98
  pnpm --filter predicate-skill bundle
41
99
  ```
42
100
 
43
- Or rebuild everything:
101
+ Or rebuild everything (all workspace packages plus the bundles):
44
102
 
45
103
  ```bash
46
104
  pnpm build
47
105
  ```
106
+
107
+ ## Tests
108
+
109
+ The full workspace test suite runs against a live Fuseki:
110
+
111
+ ```bash
112
+ predicate up
113
+ pnpm test # 160 tests across 5 packages
114
+ ```
115
+
116
+ ## License
117
+
118
+ Apache-2.0. See `LICENSE`.