prjct-cli 2.2.4 → 2.2.7

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.2.7] - 2026-04-24
4
+
5
+ ### Added
6
+ - current work
7
+
8
+ ## [2.2.6] - 2026-04-24
9
+
10
+ ### Added
11
+ - current work
12
+
13
+ ## [2.2.5] - 2026-04-24
14
+
15
+ ### Bug Fixes
16
+
17
+ - seed main-branch gate + trailing newline in writeJson (#255)
18
+
19
+
3
20
  ## [2.2.4] - 2026-04-24
4
21
 
5
22
  ### Bug Fixes
package/README.md CHANGED
@@ -1,21 +1,18 @@
1
1
  # prjct
2
2
 
3
- **Persona-aware context broker for AI coding agents.**
3
+ **Context layer for AI coding agents.**
4
4
 
5
- Works with Claude Code, Gemini CLI, OpenAI Codex, Antigravity, Cursor IDE, Windsurf, and more.
5
+ Works with Claude Code, Gemini CLI, Cursor IDE, Windsurf, OpenAI Codex, Antigravity, and more.
6
6
 
7
7
  [![npm](https://img.shields.io/npm/v/prjct-cli)](https://www.npmjs.com/package/prjct-cli)
8
8
  [![Claude Code](https://img.shields.io/badge/Claude%20Code-Ready-6366f1)]()
9
9
  [![Gemini CLI](https://img.shields.io/badge/Gemini%20CLI-Ready-4285F4)]()
10
- [![OpenAI Codex](https://img.shields.io/badge/OpenAI%20Codex-Ready-10A37F)]()
11
10
  [![Cursor IDE](https://img.shields.io/badge/Cursor%20IDE-Ready-00D4AA)]()
12
11
  [![Windsurf](https://img.shields.io/badge/Windsurf-Ready-7C3AED)]()
13
12
 
14
- > **v2.x is alpha.** Install with `npm install -g prjct-cli@alpha`. v1.56.x remains on `latest` while the v2 surface stabilizes.
15
-
16
13
  ## What is prjct?
17
14
 
18
- prjct is a **context broker**, not a task manager. It declares **who your agent is in this project** (PM, founder, DEV, research…), routes the right MCPs + memory types + workflow slots for that persona, and feeds everything back to the LLM through native hooks — no skills to remember, no prescriptive pipelines.
15
+ prjct is the **context layer** your AI agents read before they write code. It keeps project memory (decisions, learnings, gotchas, shipped work) in a local SQLite database, builds code-intelligence indexes (BM25, import graph, git co-change), and feeds the right slice back to your agent through native hooks — no skills to remember, no prompts to copy-paste.
19
16
 
20
17
  The contract is simple: **prjct exposes the WHAT, the agent decides the HOW.**
21
18
 
@@ -24,68 +21,71 @@ Claude Code / Gemini / Cursor prjct
24
21
  | |
25
22
  | SessionStart hook fires |
26
23
  | -----------------------------------> | reads .prjct/prjct.config.json
27
- | | resolves persona + memory + MCPs
24
+ | | resolves persona + memory + indexes
28
25
  | You are <role> for <project>. |
29
- | MCPs: Linear, PostHog. |
30
- | Recent insights: … |
26
+ | Active task: |
27
+ | Recent learnings: … |
31
28
  | <----------------------------------- |
32
29
  v |
33
30
  Writes code / specs / updates |
34
31
  with full project context |
35
32
  ```
36
33
 
34
+ State lives in SQLite. prjct also emits an **agent-readable markdown export** at `~/Documents/prjct/<slug>/_generated/` so any tool with `Read`/`Glob` (Claude Code, Gemini CLI, Cursor, your own scripts) can consume project context without a CLI round-trip. The export is a regenerated **snapshot** — never hand-edited; hooks rebuild it from the database. It happens to be a valid Obsidian vault, so you can browse it visually for free.
35
+
37
36
  ## Install
38
37
 
39
38
  ```bash
40
- # v2 alpha (recommended for early adopters)
41
- npm install -g prjct-cli@alpha
42
-
43
- # v1 stable (backwards-compatible)
44
39
  npm install -g prjct-cli
45
40
  ```
46
41
 
42
+ Requires Node.js 22.22.2+ or Bun 1.0+.
43
+
47
44
  ## Quick Start
48
45
 
49
46
  ```bash
50
- # 1. One-time global setup (installs routers, MCP config, skills)
47
+ # 1. One-time setup configure AI providers + install commands into ~/.claude
51
48
  prjct start
52
49
 
53
- # 2. Initialize your project with a persona + pack
50
+ # 2. Initialize a project
54
51
  cd my-project
55
- prjct init --pack code,daily # DEV persona, default
56
- prjct init --pack pm,research,daily # PM persona
57
- prjct init --pack founder,daily # Founder persona
52
+ prjct init
58
53
 
59
- # 3. Install Claude Code hooks (7 passive hooks in ~/.claude/settings.json)
54
+ # 3. Install the 7 passive Claude Code hooks
60
55
  prjct install
61
56
 
62
- # 4. Open in your agent and work normally hooks inject context automatically.
57
+ # 4. Open in Claude Code / Gemini CLI / Cursor and run:
58
+ p. sync # analyze the project; build indexes
63
59
  ```
64
60
 
65
- ### Core verbs
66
-
67
- | Verb | What it does |
68
- |---|---|
69
- | `prjct capture "<anything>"` | GTD-style universal inbox. Bare `prjct "<text>"` also routes here. |
70
- | `prjct task "<desc>"` / `prjct task` | Register a task or show the active one. |
71
- | `prjct tag <k:v>` | Tag the active task (`type:bug`, `domain:auth`, …). |
72
- | `prjct status <value>` | Inline status change on the active task. |
73
- | `prjct remember <type> "<content>"` | Persist a memory entry (fact, decision, learning, insight, …). |
74
- | `prjct ship [name]` | Run the project's `ship` workflow (commit, push, PR, persist shipped). |
75
- | `prjct workflow run <name>` | Run any registered workflow (`script`, `mcp`, `persona:context` steps). |
76
- | `prjct seed <add\|list>` | Manage packs (persona, memory types, workflow slots). |
77
- | `prjct sync` | Sync project state and regenerate skills / wiki. |
61
+ Hooks now inject persona, active task, and topical memory automatically every session.
78
62
 
79
- ### Inside Claude Code / Gemini CLI
63
+ ## Inside Claude Code / Gemini CLI
80
64
 
81
65
  ```bash
82
- p. capture "llamar a Ana re: pricing"
83
- p. task "add OAuth refresh"
66
+ p. capture "llamar a Ana re: pricing" # GTD inbox — anything goes
67
+ p. task "add OAuth refresh" # start tracking work
84
68
  p. remember decision "we chose JWT + refresh rotation"
85
- p. ship "auth"
69
+ p. status done # close the active task
70
+ p. ship # commit, push, open PR
86
71
  ```
87
72
 
88
- Cursor / Windsurf use the same commands with `/` prefix: `/capture`, `/task`, `/ship`.
73
+ Cursor / Windsurf use the same commands with a `/` prefix: `/capture`, `/task`, `/ship`.
74
+
75
+ ### Core verbs
76
+
77
+ | Verb | What it does |
78
+ |---|---|
79
+ | `prjct capture "<text>"` | GTD-style universal inbox. Bare `prjct "<text>"` also routes here. |
80
+ | `prjct task ["<desc>"]` | Register a task or show the active one. |
81
+ | `prjct status <value>` | Inline status change on the active task (`done`, `paused`, `active`, …). |
82
+ | `prjct tag <k:v>` | Tag the active task (`type:bug`, `domain:auth`, …). |
83
+ | `prjct remember <type> "<content>"` | Persist a memory entry (decision, learning, gotcha, …). |
84
+ | `prjct ship [name]` | Run the project's ship workflow (commit, push, PR, persist). |
85
+ | `prjct sync` | Re-index files, git co-change, imports; refresh project analysis. |
86
+ | `prjct regen` | Full rebuild of the Obsidian vault snapshot from SQLite. |
87
+ | `prjct suggest` | Smart recommendations based on current project state. |
88
+ | `prjct seed <add\|list>` | Manage packs (persona, memory types, workflow slots). |
89
89
 
90
90
  ## Personas & Packs
91
91
 
@@ -113,56 +113,61 @@ Five built-in packs (manifests, not bash pipelines):
113
113
  | `founder` | Founder | `goal`, `okr`, `person`, `stakeholder`, `decision` | `ship`, `review` |
114
114
  | `research` | Research | `source`, `claim`, `question`, `insight` | `research`, `review` |
115
115
 
116
- Slots ship **empty** — the human or the agent authors the scripts on demand.
116
+ Slots ship **empty** — the human or the agent fills them on demand.
117
117
 
118
- ## Hooks (v2, opt-in)
118
+ ## Hooks (opt-in)
119
119
 
120
- `prjct install` writes 7 passive hooks to `~/.claude/settings.json`. They inject `additionalContext`; none of them block unless a hand-rolled workflow rule says so.
120
+ `prjct install` writes 7 passive hooks to `~/.claude/settings.json`. They inject `additionalContext`; none block by default.
121
121
 
122
122
  | Event | Injects |
123
123
  |---|---|
124
- | `SessionStart` | Persona + active task + last 3 learnings |
125
- | `UserPromptSubmit` | Topical recall from memory (≤500 chars) |
126
- | `PreToolUse` (Bash git commit) | Surfaces anti-patterns tagged with touched files |
124
+ | `SessionStart` | Persona + active task + recent learnings; regenerates vault from DB |
125
+ | `UserPromptSubmit` | Topical recall from memory matching the prompt |
126
+ | `PreToolUse` (Bash git commit) | Anti-patterns tagged with touched files |
127
127
  | `PostToolUse` (Edit/Write) | Silently annotates `files_touched` on active task |
128
- | `Stop` | Async prompt: "learned anything reusable?" |
129
- | `SubagentStart` | Injects persona + memories for fresh-brain subagents |
128
+ | `Stop` | Async prompt: "learn anything reusable?"; ingests captured/ then regenerates vault |
129
+ | `SubagentStart` | Persona + memories for fresh-brain subagents |
130
130
  | `CwdChanged` | Re-contextualizes on project switch |
131
131
 
132
- `prjct uninstall` cleanly removes them.
132
+ Remove with `prjct claude uninstall` (hooks only) or `prjct uninstall` (everything).
133
133
 
134
134
  ## MCP Server
135
135
 
136
- prjct exposes an MCP server with 5 tool groups (was 9 in v1):
136
+ prjct exposes an MCP server with 5 tool groups:
137
137
 
138
138
  | Group | Tools |
139
139
  |---|---|
140
- | **memory** | `prjct_mem_save`, `_list`, `_similar`, `_forget` |
141
- | **project** | `prjct_patterns`, status, summary |
142
- | **files** | `prjct_files`, `prjct_recent` |
143
- | **workflow** | `prjct_workflow_list`, `_run`, `_log` |
144
- | **code-intel** | `prjct_related`, `_impact`, `_stale` |
140
+ | **memory** | save, list, similar, forget |
141
+ | **project** | patterns, status, summary |
142
+ | **files** | files, recent |
143
+ | **workflow** | list, run, log |
144
+ | **code-intel** | related, impact, stale |
145
145
 
146
- The broker model: if you already have `linear`, `jira`, `posthog`, `gmail` MCPs wired, prjct **does not duplicate them** — it just tells Claude they're available for the current persona and caches your insights locally.
146
+ The broker model: if you already have `linear`, `jira`, `posthog`, `gmail` MCPs wired, prjct **does not duplicate them** — it tells your agent they're available for the current persona and caches your insights locally.
147
147
 
148
148
  ## CLI
149
149
 
150
150
  ```bash
151
- prjct start First-time setup wizard
152
- prjct init [--pack …] Initialize project with persona + packs
153
- prjct install Install Claude Code hooks
154
- prjct uninstall Remove hooks / complete uninstall
155
- prjct sync Sync project state + regenerate wiki
156
- prjct serve Start web dashboard (port 3478)
151
+ prjct start First-time setup wizard (AI providers + commands)
152
+ prjct init Initialize project in current directory
153
+ prjct install Install Claude Code hooks (merge-safe)
154
+ prjct uninstall Complete system removal
155
+ prjct sync Sync project state, rebuild indexes
156
+ prjct regen Full vault rebuild from SQLite
157
+ prjct serve [port] Start web dashboard (default port 3478)
157
158
  prjct watch Auto-sync on file changes
158
159
  prjct doctor Check system health
159
- prjct hooks Manage git hooks for auto-sync
160
- prjct context Smart context filtering for agents
160
+ prjct hooks <install|uninstall|status> Git hooks for auto-sync
161
+ prjct context <files|signatures|imports|recent|summary> Smart context filters
162
+ prjct workflow ["config"] Configure hooks via natural language
161
163
  prjct stop / restart Background daemon control
164
+ prjct login / logout / auth Cloud sync authentication
162
165
  prjct update Update CLI system-wide
163
166
  prjct --version / --help
164
167
  ```
165
168
 
169
+ Every command supports `--md` to emit LLM-optimized markdown for agent consumption.
170
+
166
171
  ## Memory
167
172
 
168
173
  14 built-in types + user-defined lowercase identifiers:
@@ -170,33 +175,33 @@ prjct --version / --help
170
175
  `fact`, `decision`, `learning`, `gotcha`, `pattern`, `anti-pattern`, `shipped`, `inbox`, `todo`, `idea`, `insight`, `question`, `source`, `person` — plus anything you invent (`recipe`, `workout`, `interview`, …).
171
176
 
172
177
  ```bash
173
- prjct remember decision "we chose SQLite because app is local"
178
+ prjct remember decision "we chose SQLite because the app is local"
174
179
  prjct capture "check why webhook retries on 502"
175
- prjct memory list --type insight --since 2026-04-01
176
- prjct memory similar "auth refresh"
180
+ prjct context memory "auth refresh"
177
181
  ```
178
182
 
179
- Memory is FTS5-backed (SQLite), persona-filtered by default, and regenerated into an Obsidian-compatible wiki at `.prjct/wiki/_generated/` on each `remember` / `ship` / `sync`.
183
+ Memory is FTS5-backed (SQLite) and persona-filtered. Every `remember`, `capture`, `ship`, and the SessionStart / Stop hooks regenerate the agent-readable markdown export at `~/Documents/prjct/<slug>/_generated/`.
180
184
 
181
- ## Workflows
185
+ > SQLite is the source of truth. The export is a snapshot — never hand-edit `_generated/`; if data is missing, fix the pipeline.
182
186
 
183
- Workflow slots declared by packs are **empty scripts**. You (or the agent) fill them:
187
+ ### Capture from any markdown editor
184
188
 
185
- ```bash
186
- prjct workflow list # shows `ship (unassigned)`, `review (unassigned)`, …
187
- prjct workflow edit ship # opens in $EDITOR
189
+ Drop a markdown file into `~/Documents/prjct/<slug>/captured/` with a YAML frontmatter:
188
190
 
189
- # Or: ask the agent — "Claude, author me a ship.sh for investor updates"
190
- # It reads the pack manifest + memory, authors the script, you approve.
191
+ ```markdown
192
+ ---
193
+ type: learning
194
+ tags:
195
+ domain: auth
196
+ ---
197
+ JWT refresh rotation needs the prior token's `iat` to detect replay.
191
198
  ```
192
199
 
193
- Three step types beyond plain bash actions:
200
+ The Stop hook (or `prjct context wiki sync`) ingests it into SQLite, then moves it to `captured/_ingested/<timestamp>/`. Works from Obsidian, vim, iA Writer, or anything that writes a `.md` file. Frontmatter is scanned for secrets before ingest.
194
201
 
195
- - `script:<path>` runs `.prjct/workflows/<path>.sh` with `PRJCT_BRANCH`, `PRJCT_FILES_CHANGED`, `PRJCT_TAGS` in env.
196
- - `mcp:<server>:<tool>` — calls an MCP tool and passes the result to the next step.
197
- - `persona:context` — re-injects the persona block mid-workflow.
202
+ ### Why a markdown export?
198
203
 
199
- Declarative `when_expr` filters (`tags:key=value`, `branch~main`, `files:*.ts`) survived the v2 sweep the bilingual NL parser did not.
204
+ Two reasons: (1) any agent with `Read`/`Glob` consumes it without an SDK or MCP handshake — the markdown tree is paged into ~5K-token chunks so a single file read stays cheap; (2) it survives `prjct uninstall` and remains human-readable. Obsidian compatibility is a side effect — `prjct install` auto-registers the vault so `obsidian://open?vault=<slug>` works in one click, but Obsidian is never required.
200
205
 
201
206
  ## Code Intelligence
202
207
 
@@ -208,23 +213,24 @@ Declarative `when_expr` filters (`tags:key=value`, `branch~main`, `files:*.ts`)
208
213
  | Import graph | Forward + reverse dependency edges |
209
214
  | Git co-change | Files that change together |
210
215
 
211
- These power `prjct_related`, `prjct_impact`, and `prjct_stale` in the MCP.
216
+ A combined ranker fuses the three signals (`core/domain/file-ranker.ts`) and powers `prjct context files`, plus `prjct_related`, `prjct_impact`, and `prjct_stale` in the MCP server.
212
217
 
213
218
  ## Web Dashboard
214
219
 
215
220
  ```bash
216
- prjct serve
221
+ prjct serve # default port 3478 ("prjct" on a phone keypad)
217
222
  ```
218
223
 
219
- Hono-based HTTP server on port 3478. REST API for tasks / ideas / roadmap / shipped, SSE for real-time updates, status bar endpoint for IDE integration.
224
+ Hono-based HTTP server with REST endpoints for tasks / inbox / shipped / memory, SSE for real-time updates, and a status-bar endpoint for IDE integration.
220
225
 
221
226
  ## Issue Tracker Integration
222
227
 
223
228
  Bring your own MCP — prjct doesn't duplicate trackers.
224
229
 
225
- - **Linear**: configure the official Linear MCP in your agent, declare it in `persona.mcps`.
230
+ - **Linear**: configure the official Linear MCP in your agent and declare it in `persona.mcps`.
226
231
  - **Jira**: same — use the official Atlassian MCP.
227
- - The `linear` and `jira` CLI sub-commands are v1 helpers kept for backwards compat; MCP is the v2 path.
232
+
233
+ (The legacy v1 `linear` / `jira` sub-commands were removed in v2; MCP is the only path now.)
228
234
 
229
235
  ## Environment Variables
230
236
 
@@ -234,7 +240,7 @@ Bring your own MCP — prjct doesn't duplicate trackers.
234
240
  | `PRJCT_DEBUG` | — | Enable debug logging (`1`, `true`, log level) |
235
241
  | `PRJCT_NO_DAEMON` | — | Force non-daemon path (debugging) |
236
242
  | `DEBUG` | — | Fallback debug flag |
237
- | `CI` | — | Skips interactive prompts |
243
+ | `CI` | — | Skip interactive prompts |
238
244
 
239
245
  ## Architecture
240
246
 
@@ -242,20 +248,20 @@ Bring your own MCP — prjct doesn't duplicate trackers.
242
248
  prjct-cli/
243
249
  bin/prjct Thin JS shim (daemon-first)
244
250
  core/
245
- commands/ CLI command handlers
251
+ cli/ CLI command handlers + dispatcher
246
252
  hooks/ 7 passive Claude Code hook subcommands
247
253
  packs/ Pack manifests + pack-manager
248
254
  mcp/ MCP server (5 tool groups)
249
- memory/ projectMemory (v2 unified surface)
250
- workflow/ Engine + state-machine + when-evaluator
251
- domain/ BM25, import-graph, git-cochange
252
- services/ sync, skill-generator, wiki-generator
253
- storage/ SQLite (one DB per project)
254
- schemas/ Zod — source of truth
255
+ domain/ BM25, import-graph, git-cochange, file-ranker
256
+ services/ wiki-generator, wiki-ingest, sync, skill-generator
257
+ storage/ SQLite (one DB per project) — source of truth
258
+ schemas/ Zod runtime validation
259
+ infrastructure/ path-manager, ai-provider, command-installer
255
260
  daemon/ Background daemon (file watching)
256
261
  server/ Hono HTTP + SSE
257
- sync/ Cloud sync client
262
+ sync/ Cloud sync client + auth-config
258
263
  templates/
264
+ commands/ Thin per-command templates (defer to CLI --md)
259
265
  packs/ JSON pack manifests
260
266
  global/ Per-editor router templates
261
267
  ```
@@ -263,7 +269,7 @@ prjct-cli/
263
269
  ## Requirements
264
270
 
265
271
  - Node.js 22.22.2+ or Bun 1.0+
266
- - One of: Claude Code, Gemini CLI, OpenAI Codex, Antigravity, Cursor IDE, Windsurf
272
+ - One of: Claude Code, Gemini CLI, Cursor IDE, Windsurf, OpenAI Codex, Antigravity
267
273
 
268
274
  ## Links
269
275