greprag 0.8.1 → 0.8.3
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/dist/commands/fact.d.ts +21 -0
- package/dist/commands/fact.js +336 -0
- package/dist/commands/fact.js.map +1 -0
- package/dist/commands/inbox-watch.d.ts +34 -0
- package/dist/commands/inbox-watch.js +31 -4
- package/dist/commands/inbox-watch.js.map +1 -1
- package/dist/commands/init.d.ts +15 -0
- package/dist/commands/init.js +53 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/hook.js +8 -2
- package/dist/hook.js.map +1 -1
- package/dist/index.js +70 -9
- package/dist/index.js.map +1 -1
- package/dist/session-id.d.ts +28 -0
- package/dist/session-id.js +55 -0
- package/dist/session-id.js.map +1 -0
- package/package.json +1 -1
- package/skill/SKILL.md +67 -1
package/skill/SKILL.md
CHANGED
|
@@ -12,7 +12,7 @@ description: |
|
|
|
12
12
|
"what's been happening in this project", "session context".
|
|
13
13
|
metadata:
|
|
14
14
|
author: travsteward
|
|
15
|
-
version: "3.
|
|
15
|
+
version: "3.5.0"
|
|
16
16
|
repository: https://github.com/travsteward/greprag
|
|
17
17
|
license: MIT
|
|
18
18
|
---
|
|
@@ -168,6 +168,8 @@ Flags (all repeatable, all optional):
|
|
|
168
168
|
- `--artifact <type:id>` — point to a shipped thing. Types: `commit`, `pr`, `deploy`, `release`, `push`, `merge`
|
|
169
169
|
- `--file <path[:lines]>` — point to a code location. Lines are `42` or `10-15`
|
|
170
170
|
- `--ref-json '<json>'` — escape hatch for a fully-formed references object (mutually exclusive with the above)
|
|
171
|
+
- `--session <id>` — target a specific session under the project. Only the session's `inbox watch --session <id>` sees it; broadcasts (no `--session`) still reach every session-scoped watcher. Equivalent to suffixing the address with `/<id>`.
|
|
172
|
+
- `--from-session <id>` — sender's own session UUID. Denormalized onto the message so the recipient learns your session and can address replies back via `--session <your-id>` without re-discovery. Use whenever you expect a reply.
|
|
171
173
|
|
|
172
174
|
**When to populate references vs. when to leave them off:**
|
|
173
175
|
- Short chat messages ("pinging you", "deploy is up", "ack") — no references, just body.
|
|
@@ -178,8 +180,11 @@ Flags (all repeatable, all optional):
|
|
|
178
180
|
Address formats (all valid):
|
|
179
181
|
- `alice@example.com` — recipient's tenant inbox by real email
|
|
180
182
|
- `alice@example.com/paybot` — recipient's paybot project inbox
|
|
183
|
+
- `alice@example.com/paybot/<session-id>` — only the named session under paybot sees it (plus broadcasts). The trailing UUID is case-sensitive — the parser preserves it verbatim.
|
|
181
184
|
- `alice@greprag.com` — same recipient by their auto-claimed greprag handle (tenant_id alias)
|
|
182
185
|
|
|
186
|
+
Project-level addressing is the fallback whenever no specific session is in mind. Session-level is for precise routing — chip ↔ parent reply isolation, or any case where multiple sessions on the same project would otherwise share an inbox.
|
|
187
|
+
|
|
183
188
|
Auto-read semantics: any message returned by `greprag inbox` (without `--all`) is marked read in the same call. Once read, it stops appearing in notifications. TTL deletes read messages after 14 days. Use `keep` to extend before expiry.
|
|
184
189
|
|
|
185
190
|
## Step 5c — Health & repair (when memory looks wrong)
|
|
@@ -343,6 +348,67 @@ Otherwise present verbatim:
|
|
|
343
348
|
|
|
344
349
|
Do not rewrite or summarize. Present verbatim — the compactor already shaped it.
|
|
345
350
|
|
|
351
|
+
## Step 6b — Seeding learnings (project-facts substrate)
|
|
352
|
+
|
|
353
|
+
Whenever you waste tokens *discovering* something a future agent shouldn't have to re-discover, seed it as a project fact. Discovery is fine the first time — the failure mode is repeating it every time a chip spawns or a new session opens.
|
|
354
|
+
|
|
355
|
+
### When to seed
|
|
356
|
+
|
|
357
|
+
Three signatures of discovery waste — if you see one in your own trace, seed the result so the next agent skips the search:
|
|
358
|
+
|
|
359
|
+
- **Search cascade.** ≥3 `Glob` / `Grep` calls to find a path that should be obvious (where do migrations live? where's the inbox table? which file owns the CLI dispatch?). Seed the answer with `scope: chip-startup`.
|
|
360
|
+
- **Schema archaeology.** ≥3 file `Read`s to reconstruct the shape of a data type, a JSONB column, or an API request body. Seed the shape (1–3 lines) with `scope: <subsystem>-touch`.
|
|
361
|
+
- **Trial-and-error env probing.** Multiple `Bash` attempts at the same env operation (different SSL flags, different connection strings, repeated "is this var set?" checks). Seed the working invocation with `scope: env`.
|
|
362
|
+
|
|
363
|
+
### How to seed
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
greprag fact add "<one-sentence fact, optionally with a file path>" --scope <scope> [--project <name>]
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
Examples:
|
|
370
|
+
```bash
|
|
371
|
+
greprag fact add "Migrations live at repo root: migrations/<NNN>_<name>.sql. Apply with node scripts/apply-migration.cjs migrations/<file>.sql." --scope chip-startup
|
|
372
|
+
|
|
373
|
+
greprag fact add "Inbox storage uses JSONB metadata on nodes (store kind='inbox'). No inbox_messages table — dropped in migration 035. See packages/core/src/inbox.ts." --scope inbox-touch
|
|
374
|
+
|
|
375
|
+
greprag fact add "Build everything from repo root: npm run build (Turborepo). Forced rebuild: npm run build -- --force." --scope general
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
**Scope naming.** Free-form strings — there is no enum. Check what's already in use before inventing a new label:
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
greprag fact scopes [--project <name>]
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
Conventional scopes:
|
|
385
|
+
- `chip-startup` — what a freshly-spawned chip needs in its first 5 turns. Layout, build commands, test runners, key file paths.
|
|
386
|
+
- `general` — applies to almost any session in this project.
|
|
387
|
+
- `<subsystem>-touch` — facts that matter only when editing a specific subsystem (`inbox-touch`, `episodic-touch`, `enrichment-touch`).
|
|
388
|
+
- `env` — environment / credentials / DB connection gotchas.
|
|
389
|
+
|
|
390
|
+
Pick the narrowest scope that still applies. A fact about migration paths is `chip-startup` (every chip needs it); a fact about how the hourly compactor's prompt versioning works is `episodic-touch` (only relevant if you're editing that subsystem).
|
|
391
|
+
|
|
392
|
+
### Reading facts back (pull pattern)
|
|
393
|
+
|
|
394
|
+
```bash
|
|
395
|
+
greprag fact query --scope chip-startup --limit 10 --format markdown # for inlining into a chip prompt
|
|
396
|
+
greprag fact query --scope inbox-touch --query "session routing" # lexical-rank within a scope
|
|
397
|
+
greprag fact query --query "how do migrations apply" --limit 5 # cross-scope, lexical-rank only
|
|
398
|
+
greprag fact list # human-review every fact, grouped by scope
|
|
399
|
+
greprag fact delete <nodeId> # prune stale fact (nodeId printed in list)
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
`--format markdown` returns a numbered list with no decoration — drop it straight into a `**Project Facts**` block when spawning a chip.
|
|
403
|
+
|
|
404
|
+
### Deliberate review
|
|
405
|
+
|
|
406
|
+
Periodically run `greprag fact list` against a project, especially after a refactor or a major rename. Facts decay as code moves; prune anything stale via `greprag fact delete <nodeId>`. The substrate trusts the seeding agent — there's no auto-dedup or expiry, so the human (or a periodic `/greprag` audit pass) keeps the signal clean.
|
|
407
|
+
|
|
408
|
+
### Chip-spawn pull pattern
|
|
409
|
+
|
|
410
|
+
When you compose a `spawn_task` chip prompt, pull `chip-startup` facts into the prompt before dispatching. Full convention lives in `~/.claude/docs/agent-coordination.md` § Block 0.5; the one-liner is: `greprag fact query --scope chip-startup --project <project> --limit 10 --format markdown`, then wrap the output in a `**Project Facts**` block at the top of the prompt. Skip the block when the output is empty.
|
|
411
|
+
|
|
346
412
|
## Step 7 — Cross-project discovery (for advisor agents)
|
|
347
413
|
|
|
348
414
|
When the user is in a cross-project advisor context ("content-advisor",
|