@tony0721/pi-j-space
J-Space Cognition Suite for Pi — inference-time cognitive control layer for deep reasoning, long-horizon work, tool use, verification, and recovery. Ships the j-space skill plus a per-turn forcing extension.
Package details
Install @tony0721/pi-j-space from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@tony0721/pi-j-space- Package
@tony0721/pi-j-space- Version
1.1.0- Published
- Aug 18, 2026
- Downloads
- 266/mo · 266/wk
- Author
- tony0721
- License
- unknown
- Types
- extension, skill
- Size
- 243.9 KB
- Dependencies
- 0 dependencies · 0 peers
Pi manifest JSON
{
"extensions": [
"./index.js"
],
"skills": [
"./skills"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
j-space — Pi package
The J-Space Cognition Suite packaged for Pi as an official plugin: a skill + a forcing extension that keeps the operating protocol active in every conversation turn.
J-Space is an inference-time cognitive control layer built on the accessible representational space the model is poised to say. It manages what stays active, preserves constraints across long tasks, externalizes durable state, detects reasoning failure, and returns verified results in clean language. No weight changes, no fine-tuning, no hidden service.
The package is published on npm as
@tony0721/pi-j-space(npm:@tony0721/pi-j-space, public). The full research suite lives at J-Space-Cognition-Suite-V3.6 (README, benchmarks, citation, license).
Install
pi install npm:@tony0721/pi-j-space
Restart Pi after installation. The package registers:
- Skill
skills/j-space— the complete suite:SKILL.md+modules/(9 modules) +references/+scripts/. - Extension
index.js— keeps j-space active every turn.
How it works
Three independent injection layers (verified against the Pi main loop; default mode is compact so context stays lean):
| Layer | Hook | Effect (≈tokens) |
|---|---|---|
| Per-message gate | input |
Prepends a one-line gate header to every user message, unless it is a slash command (~40 tk) |
| System prompt | before_agent_start |
Injects the compact protocol block into the system prompt per submission (~200 tk) |
| Payload fallback | before_provider_request |
Ensures the [[J-SPACE-ACTIVE]] marker is present in the final LLM request payload |
Injection modes (/jspace):
compact(default) — ~200-token protocol block; the model loadsSKILL.md/ modules on demand viaread, following j-space's own selective-loading design.full— injects the entireSKILL.md(~3.8k tk); use only when needed.reminder— no system block; the per-message gate header carries the frame.
Usage
Commands must start with / (Pi command prefix):
/jspace Status (shown as a TUI notification)
/jspace on|off Enable / disable forcing
/jspace compact|full|reminder Switch injection mode
Runtime state persists in <agent dir>/j-space/state.json — ~/.pi/agent/ under Pi, ~/.prime/agent/ under Prime Agent (auto-detected; override with JSPACE_STATE_DIR).
Configuration
| Env var | Purpose |
|---|---|
JSPACE_SKILL_PATH |
Override the skill SKILL.md path (default: the copy inside this package) |
JSPACE_STATE_DIR |
Override the runtime state dir (default: auto-detected <agent dir>/j-space, Pi → ~/.pi/agent, Prime Agent → ~/.prime/agent) |
JSPACE_DEBUG=1 |
Write an inject.log under the runtime state dir |
Development
npm pack --dry-run # inspect the published tarball
node verify.mjs # self-check: factory loads, skill/module paths resolve, payload escort works
pi -e ./index.js -p "hi" # smoke-test the extension in print mode
License
Apache-2.0. See LICENSE and the suite repository for authors, citation, and provenance.