@raquezha/norpiv 0.0.3 → 0.0.5

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
@@ -24,6 +24,19 @@ Auxiliary hygiene:
24
24
 
25
25
  ---
26
26
 
27
+ ## notrace relationship
28
+
29
+ notrace is an optional retrospective layer around RPIV.
30
+
31
+ Rules:
32
+
33
+ - **RPIV must work without notrace**.
34
+ - **notrace may attach to RPIV when task state exists**.
35
+ - `WORK.md` remains the RPIV source of truth whether notrace is installed or not.
36
+ - `.notrace/` owns notrace artifacts.
37
+ - `.workflow/` owns RPIV task state.
38
+ - notrace artifacts and reviews may be referenced from `WORK.md [LOG]`, but RPIV phases must not depend on those files being present.
39
+
27
40
  ## 🛡️ Critical Guardrails
28
41
 
29
42
  - **Measure Twice, Cut Once**: Never implement code during scoping or planning. The agent will wait for an explicit `EXECUTE` statement before modifying files.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raquezha/norpiv",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Bundled RPIV workflow skills for Pi, Claude, and Codex-style coding agents",
5
5
  "type": "commonjs",
6
6
  "bin": {
@@ -0,0 +1,27 @@
1
+ #!/bin/bash
2
+ # Deterministically grabs the active Pi model from the current session logs
3
+
4
+ # Format PWD to match Pi's session directory naming convention
5
+ SAFE_PWD=$(pwd | sed 's/\//-/g' | sed 's/^-/--/')
6
+ TARGET_DIR="$HOME/.pi/agent/sessions/${SAFE_PWD}--"
7
+
8
+ if [ -d "$TARGET_DIR" ]; then
9
+ LATEST_FILE=$(ls -t "$TARGET_DIR" | head -n 1 2>/dev/null)
10
+ if [ -n "$LATEST_FILE" ]; then
11
+ PROVIDER=$(cat "$TARGET_DIR/$LATEST_FILE" | grep -o '"provider":"[^"]*"' | tail -n 1 | cut -d'"' -f4)
12
+ MODEL=$(cat "$TARGET_DIR/$LATEST_FILE" | grep -o '"model":"[^"]*"' | tail -n 1 | cut -d'"' -f4)
13
+
14
+ if [ -n "$MODEL" ]; then
15
+ # If provider exists, prefix it, otherwise just return model
16
+ if [ -n "$PROVIDER" ]; then
17
+ echo "$PROVIDER:$MODEL"
18
+ else
19
+ echo "UnknownProvider:$MODEL"
20
+ fi
21
+ exit 0
22
+ fi
23
+ fi
24
+ fi
25
+
26
+ # Fallback if no active session log can be parsed
27
+ echo "UnknownAgent:UnknownModel"
@@ -42,6 +42,30 @@ reposcry_indexed_files() {
42
42
  reposcry stats 2>/dev/null | awk '/Files indexed:/ {print $3; exit}'
43
43
  }
44
44
 
45
+ # Quick health check for Pulse info
46
+ check_pulse() {
47
+ if ! command -v reposcry >/dev/null 2>&1; then
48
+ echo "PULSE: Missing (Not installed)"
49
+ return
50
+ fi
51
+ if [[ ! -d .reposcry ]]; then
52
+ echo "PULSE: Cold (No cache)"
53
+ return
54
+ fi
55
+ local files
56
+ files=$(reposcry_indexed_files || echo "0")
57
+ if [[ "$files" == "0" ]]; then
58
+ echo "PULSE: Cold (Zero files)"
59
+ else
60
+ echo "PULSE: Warm ($files files)"
61
+ fi
62
+ }
63
+
64
+ if [[ "${1:-}" == "--pulse" ]]; then
65
+ check_pulse
66
+ exit 0
67
+ fi
68
+
45
69
  ensure_reposcry_gitignore
46
70
  refuse_tracked_reposcry_cache
47
71
 
@@ -20,7 +20,15 @@ cd "$REPO_ROOT"
20
20
  "$SCRIPT_DIR/reposcry-bootstrap.sh" || true
21
21
 
22
22
  mkdir -p .reposcry
23
- BUDGET=${REPOSCRY_CONTEXT_BUDGET:-20000}
23
+
24
+ # Detect low-token modes (Caveman, etc.)
25
+ DEFAULT_BUDGET=20000
26
+ if [[ "${CAVEMAN_MODE:-off}" != "off" ]] || [[ "${LOW_TOKEN_MODE:-0}" == "1" ]]; then
27
+ DEFAULT_BUDGET=5000
28
+ echo "Low-token mode detected: reducing context budget to $DEFAULT_BUDGET"
29
+ fi
30
+
31
+ BUDGET=${REPOSCRY_CONTEXT_BUDGET:-$DEFAULT_BUDGET}
24
32
  OUTPUT_PATH=".reposcry/AI_CONTEXT.md"
25
33
 
26
34
  echo "Generating RepoScry task context at $OUTPUT_PATH..."
package/triage/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: triage
3
- description: "Ingest or resume a tracked/local task in the RPIV workspace. Use when starting or returning to jira:, github:, gitlab:, or local: work and you need canonical WORK.md state without duplicating scaffold."
3
+ description: "Ingest or resume a tracked/local task in the RPIV workspace. Use when starting or returning to jira:, github:, gitlab:, or local: work and you need canonical WORK.md state without duplicating the scaffold."
4
4
  ---
5
5
 
6
6
  # Skill: triage
@@ -8,10 +8,10 @@ description: "Ingest or resume a tracked/local task in the RPIV workspace. Use w
8
8
  Start RPIV by creating, resuming, or explicitly reopening a task workspace.
9
9
 
10
10
  ## Guardrails
11
- - READ: user argument, `.workflow/active_task.json` when present, target `metadata.json`, and target `WORK.md` when resuming.
12
- - WRITE: `.workflow/tasks/[source-id]/WORK.md`, `.workflow/tasks/[source-id]/metadata.json`, `.workflow/active_task.json`; optional `.reposcry/` cache files only when RepoScry is installed.
11
+ - READ: user argument, `.workflow/active_task.json` if present, target `metadata.json`, and target `WORK.md` if resuming.
12
+ - WRITE: `.workflow/tasks/[source-id]/WORK.md`, `.workflow/tasks/[source-id]/metadata.json`, `.workflow/active_task.json`; optional `.reposcry/` cache files only if RepoScry is installed.
13
13
  - On **create**, initialize required guarded sections only if absent: `[BRIEF]`, `[GRILL]`, `[PLAN]`, `[LOG]`, `[META]`.
14
- - On **resume**, only update `.workflow/active_task.json`, metadata timestamps/state as needed, `[META]`, and append one concise `[LOG]` entry.
14
+ - On **resume**, only update `.workflow/active_task.json`, metadata timestamps/state as needed, and `[META]`, then append one concise `[LOG]` entry.
15
15
  - NEVER: duplicate guarded sections.
16
16
  - NEVER: overwrite existing `[BRIEF]`, `[GRILL]`, or `[PLAN]` during triage.
17
17
  - NEVER: create `PROBLEM.md`, `PRD.md`, `PLAN.md`, or `EVIDENCE.md`.
@@ -21,49 +21,34 @@ Start RPIV by creating, resuming, or explicitly reopening a task workspace.
21
21
  - NEVER: mutate `done` or `archived` tasks unless the user explicitly requested `reopen`, `fresh`, or `reset`.
22
22
 
23
23
  ## Command forms
24
- - `/triage local:setup-v2` — auto mode: create if missing, resume if active/blocked.
25
- - `/triage resume local:setup-v2` — resume existing task; create if missing only when helper reports that behavior.
26
- - `/triage reopen local:setup-v2` — explicitly reopen a done/archived task and mark it active.
27
- - `/triage fresh local:setup-v2` — archive/reset the previous task workspace and create a fresh one.
28
- - `/triage reset local:setup-v2` — alias for fresh/reset behavior when supported by the helper.
29
24
 
30
- ## Semantics
31
-
32
- ### Create
33
- Use when the target task folder does not exist.
34
- - Fetch remote issue data for `github:`, `gitlab:`, or `jira:` sources.
35
- - Create `.workflow/tasks/[source-id]/metadata.json` with at least `id`, `source`, `taskFolder`, `branch`, `status`, `phase`, `createdAt`, `updatedAt`.
36
- - Create `.workflow/tasks/[source-id]/WORK.md` with guarded RPIV sections.
37
- - Set `status=active` and `phase=triaged`.
38
- - Write canonical `.workflow/active_task.json`.
39
-
40
- ### Resume
41
- Use when the task exists and `status` is `active`, `blocked`, or missing/legacy.
42
- - Do not refetch remote data.
43
- - Do not rewrite the brief, grill notes, or plan.
25
+ ### /triage local:setup-v2
26
+ - **Standard/auto mode**: create if missing, resume if active/blocked.
27
+ - Will not rewrite brief, grill notes, or plan.
44
28
  - Backfill missing metadata fields without destroying unknown fields.
45
29
  - Refresh active pointer and human-readable `[META]`.
46
30
  - Append one timestamped `[LOG]` entry such as `Task resumed via /triage`.
47
31
 
48
- ### Reopen
49
- Use only when the user explicitly asks to reopen a task that is `done` or `archived`.
32
+ ### /triage local:setup-v2 reopen
33
+ - Use only if user explicitly asks to reopen a task that is `done` or `archived`.
50
34
  - Mark `status=active`.
51
35
  - Preserve existing `WORK.md` history.
52
36
  - Append a `[LOG]` entry explaining the reopen.
53
37
  - Recommend returning to the next valid RPIV stage based on existing sections.
54
38
 
55
- ### Fresh / reset
56
- Use only when the user explicitly asks to start over.
57
- - Preserve or archive the old task workspace before creating a new one when the helper supports it.
58
- - Create a new task workspace with clean guarded sections.
39
+ ### /triage local:setup-v2 fresh / reset
40
+ - Use only if user explicitly asks to start over.
41
+ - Preserve or archive old task workspace before creating new one when helper supports it.
42
+ - Create new task workspace with clean guarded sections.
59
43
  - Do not silently delete task history.
60
44
 
61
45
  ### Refuse
62
- Use when auto/resume mode targets a `done` or `archived` task.
46
+ - Use when auto/resume mode targets a `done` or `archived` task.
63
47
  - Stop instead of mutating.
64
- - Tell the user to choose `reopen` or `fresh/reset`.
48
+ - Tell user to choose `reopen` or `fresh/reset`.
65
49
 
66
50
  ## Workflow
51
+
67
52
  1. Parse optional mode and required namespace:
68
53
  - `jira:PROJ-123` -> `jira-PROJ-123`
69
54
  - `github:42` -> `github-42`
@@ -72,23 +57,24 @@ Use when auto/resume mode targets a `done` or `archived` task.
72
57
  2. Run the bundled helper script: `../scripts/triage_helper.sh <source> <id> [mode]`.
73
58
  - Preferred absolute path: `<skill_dir>/../scripts/triage_helper.sh`.
74
59
  3. Read the resulting active pointer, metadata, and `WORK.md`.
75
- 4. Determine action from helper output and task state: `created`, `resumed`, `reopened`, `refused`, or `fresh/reset`.
76
- 5. Optional RepoScry bootstrap: if the bundled `../scripts/reposcry-bootstrap.sh` is available, run it to seed `.reposcry/` for later `/frame` and `/grill-with-docs`. The helper must ensure `.reposcry/` is ignored, must stop if `.reposcry/` is tracked/staged, and should continue normally when RepoScry is unavailable.
77
- 6. **Technical Pre-check (Repo Pulse)** for created/reopened/resumed tasks:
78
- - Extract key filenames, classes, commands, or keywords from the issue/task description.
79
- - Verify existence on the current branch when concrete files are named.
80
- - Check recent commits or open PRs only when relevant to the named files/scope.
81
- - Version-check environment/dependencies only when the task depends on a version claim.
82
- 7. Classify the task: Problem / Proposal.
83
- 8. **Log Findings**: append concise Repo Pulse and classification findings to `[LOG]` only. Do not edit `[BRIEF]`, `[GRILL]`, or `[PLAN]`.
84
- 9. **Branch Guidance**: record the current branch in `[META]`. For `jira:` tasks, also preserve the Jira key in `[META]` and mention that `/implement` must use it in the commit subject. Planning on `main`/`master` is allowed; implementation must use `/implement` branch enforcement.
85
- 10. End by recommending the next valid command:
86
- - newly created -> `/frame`
87
- - existing with empty `[BRIEF]` -> `/frame`
88
- - framed but not grilled -> `/grill-with-docs`
89
- - grilled but not planned -> `/plan`
90
- - planned -> await explicit `/implement` or `EXECUTE`
91
- - refused -> ask user to choose `reopen` or `fresh/reset`
60
+ 4. Determine action based on helper output and task state: `created`, `resumed`, `reopened`, `refused`, `fresh/reset`.
61
+ 5. Optional RepoScry bootstrap: if bundled `../scripts/reposcry-bootstrap.sh` available, run it to seed `.reposcry/` for later `/frame` and `/grill-with-docs`.
62
+ - Run `../scripts/reposcry-bootstrap.sh --pulse` to determine "Repo Pulse" (Warm/Cold/Missing) for the output contract.
63
+ - Run `../scripts/reposcry-bootstrap.sh` to ensure the local cache is initialized.
64
+ - The helper must ensure `.reposcry/` is ignored, must stop if `.reposcry/` tracked/staged, and continue normally if RepoScry is unavailable.
65
+ 6. Verify branch: ensure current branch matches metadata `branch` (or is `main`/`master` for planning).
66
+ 7. If task was newly created, infer classification:
67
+ - `github:`, `gitlab:`, `jira:` labels/type often indicate Problem (bug) or Proposal (feature).
68
+ - Local tasks default to Proposal unless specified.
69
+ 8. If resuming, check `[BRIEF]` and `[PLAN]` completion status.
70
+ 9. **Final Guidance**: record current branch in `[META]`. For `jira:` tasks, also preserve the Jira key in `[META]` and mention `/implement` must use it in the commit subject. Planning on `main`/`master` allowed; implementation will use `/implement` branch enforcement.
71
+ 10. End by recommending next valid command:
72
+ - newly created -> `/frame`
73
+ - existing empty `[BRIEF]` -> `/frame`
74
+ - framed but not grilled -> `/grill-with-docs`
75
+ - grilled but not planned -> `/plan`
76
+ - planned -> await explicit `/implement` or `EXECUTE`
77
+ - refused -> ask user to choose `reopen` or `fresh/reset`
92
78
 
93
79
  ## Output contract
94
80
  End with:
@@ -97,6 +83,6 @@ End with:
97
83
  - **Status**: active / blocked / done / archived / unknown
98
84
  - **Phase**: triaged / framed / grilled / planned / implementing / verifying / synced / closed / unknown
99
85
  - **Branch**: current branch
100
- - **Repo Pulse**: Found / Missing / Outdated / Not applicable
86
+ - **Repo Pulse**: Warm / Cold / Missing / Not applicable
101
87
  - **Classification**: Problem / Proposal
102
88
  - **Next step**: `/frame`, `/grill-with-docs`, `/plan`, `/implement`, or explicit reopen/fresh choice
package/verify/SKILL.md CHANGED
@@ -19,7 +19,7 @@ The final gate for a slice or task. Verify truth before reporting progress.
19
19
  2. Run stated verification commands and available quality gates.
20
20
  3. If RepoScry is available, optionally add graph-aware evidence with commands such as `reposcry validate main HEAD` and `reposcry --repo . get_affected_flows main HEAD`. Treat RepoScry as supplemental evidence, not a hard requirement. Verify `.reposcry/` is not staged or tracked before reporting review readiness.
21
21
  4. Check for AI artifacts: placeholder comments, fake APIs, dead code, inconsistent naming.
22
- 5. Confirm commit messages include Conventional Commit format and `Assisted-by: [AGENT]:[MODEL] [tools]` when AI contributed.
22
+ 5. Confirm commit messages include Conventional Commit format. When AI contributed, you MUST append an `Assisted-by` trailer. Do NOT guess or hallucinate the model name from your system prompt. You must run `bash ~/RQZ/personal/nothing/packages/norpiv/scripts/get-pi-model.sh` and use its exact output to construct the trailer: `Assisted-by: <EXACT_OUTPUT> [tools]`.
23
23
  6. If passing, mark the slice checkbox complete in `[PLAN]` and append verification evidence to `[LOG]` (Format: `YYYY-MM-DD hh:mm AM/PM`).
24
24
  7. Recommend `/sync` for tracker update, or cleanup if the task is fully merged and user approves.
25
25