@raquezha/norpiv 0.0.6 → 0.0.8

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
@@ -2,12 +2,17 @@
2
2
 
3
3
  RPIV: a gated workflow for reliable AI coding agents.
4
4
 
5
+ RPIV is one implementation of the broader `nothing` Workflow Contract. The contract defines the generic shape for workflows such as RPIV and Research, focusing on 3 Real Modes (Chat, Research, RPIV) tracked by `.workflow/active.json`.
6
+
7
+ Standalone package usage still works: `@raquezha/norpiv` includes the RPIV skills, `distill`, and helper scripts needed for handoff. The local Research workflow lives separately under `packages/workflows/noresearch`. The platform-level contract lives in the source repo at <https://github.com/raquezha/nothing/blob/main/docs/workflow.md>.
8
+
5
9
  ## 🔁 The Lifecycle
6
10
 
7
11
  The RPIV engine splits task execution into separate, focused phases:
8
12
 
9
13
  | Phase | Command | Purpose | Input / Output Files |
10
14
  | :--- | :--- | :--- | :--- |
15
+ | **0. Refine (optional)** | `/refine [source]:[id]` | Repair tracker readiness before RPIV when outcome, acceptance criteria, ownership, dependencies, or decomposition are still unclear. | Proposes tracker edits/child work with ownership/dependency recommendations; no `.workflow/` state |
11
16
  | **1. Ingest** | `/triage [source]:[id]` | Initial task verification and workspace setup. | Creates `.workflow/tasks/[source-id]/WORK.md` & `metadata.json` |
12
17
  | **2. Scoping** | `/frame` | Author a clear, structured task brief. | Populates `WORK.md` ➔ `[BRIEF]` section |
13
18
  | **3. Interrogate**| `/grill-with-docs` | Stress-test brief against rules and docs. | Records decisions in `WORK.md` ➔ `[GRILL]` |
@@ -42,6 +47,10 @@ Rules:
42
47
  - **Measure Twice, Cut Once**: Never implement code during scoping or planning. The agent will wait for an explicit `EXECUTE` statement before modifying files.
43
48
  - **One Source of Truth**: All task state belongs in `.workflow/tasks/[source-id]/WORK.md`. Avoid creating separate `PROBLEM.md` or `PLAN.md` files.
44
49
  - **Safe Branching**: Triage and planning happen on the main branch. Create the feature branch (`feat/*` or `fix/*`) only when starting `/implement`.
50
+ - **Real In-Progress Starts at Implement**: `/refine`, `/triage`, `/frame`, and `/plan` are preparation, not execution. Move the remote Jira/GitHub/GitLab work item to an in-progress state only when `/implement` actually begins.
51
+ - **Refine Preserves Intent**: `/refine` should preserve product-authored text, append acceptance criteria instead of rewriting it, and only assign or link child work when ownership/dependency signals are clear.
52
+ - **Canonical Pointer**: `.workflow/active.json` is the active RPIV pointer. Legacy `active_task.json` is compatibility-only during migration.
53
+ - **Normalized Intake**: `/triage` writes a small local projection into `WORK.md`; tracker snapshots live in `metadata.json`, not raw CLI dumps.
45
54
 
46
55
  ## 📦 Install as a skill bundle
47
56
 
@@ -51,7 +60,7 @@ Best for trying or handing off RPIV skills without installing the full `nothing`
51
60
 
52
61
  ```bash
53
62
  npx -y skills add raquezha/nothing --full-depth -g -a pi \
54
- -s triage frame grill-with-docs plan implement verify sync post-merge-prune update-docs distill \
63
+ -s refine triage frame grill-with-docs plan implement verify sync post-merge-prune update-docs distill \
55
64
  -y
56
65
  ```
57
66
 
@@ -84,7 +93,7 @@ Targets:
84
93
 
85
94
  | Hat | Purpose |
86
95
  | :--- | :--- |
87
- | `pi --rpiv` | Full RPIV workflow. Loads triage, frame, grill-with-docs, plan, implement, verify, sync, post-merge-prune, and update-docs. |
96
+ | `pi --rpiv` | Full RPIV workflow. Loads refine, triage, frame, grill-with-docs, plan, implement, verify, sync, post-merge-prune, and update-docs. |
88
97
  | `pi --notes` | Conversation distiller. Saves useful thinking to Obsidian without RPIV ceremony. |
89
98
 
90
99
  ## 📝 Pre-RPIV note capture
@@ -112,6 +121,8 @@ Obsidian note → /triage → RPIV (only when ready to commit)
112
121
 
113
122
  `distill` is the missing layer before RPIV. Use `pi --notes` to load it.
114
123
 
124
+ Research is a separate local workflow bundle in `packages/workflows/noresearch` and is loaded by the full `nothing` setup with `pi --research`.
125
+
115
126
  ## 🚀 Quick Start Example
116
127
 
117
128
  1. **Activate the RPIV Hat** from the full `nothing` setup:
@@ -121,34 +132,39 @@ Obsidian note → /triage → RPIV (only when ready to commit)
121
132
 
122
133
  If installed via `npx skills add` or `norpiv-install`, invoke the skills directly in your agent instead.
123
134
 
124
- 2. **Triage an Issue**:
135
+ 2. **Optional Tracker Refinement**:
136
+ ```text
137
+ /refine github:45
138
+ ```
139
+
140
+ 3. **Triage an Issue**:
125
141
  ```text
126
142
  /triage github:45
127
143
  ```
128
144
 
129
- 3. **Frame the Work**:
145
+ 4. **Frame the Work**:
130
146
  ```text
131
147
  /frame
132
148
  ```
133
149
 
134
- 4. **Verify Constraints**:
150
+ 5. **Verify Constraints**:
135
151
  ```text
136
152
  /grill-with-docs
137
153
  ```
138
154
 
139
- 5. **Write the Plan Slices**:
155
+ 6. **Write the Plan Slices**:
140
156
  ```text
141
157
  /plan
142
158
  ```
143
159
 
144
- 6. **Authorize Execution**:
160
+ 7. **Authorize Execution**:
145
161
  Provide the agent explicit permission to implement:
146
162
  ```text
147
163
  EXECUTE
148
164
  /implement
149
165
  ```
150
166
 
151
- 7. **Verify & Close**:
167
+ 8. **Verify & Close**:
152
168
  ```text
153
169
  /verify
154
170
  /sync
@@ -161,39 +177,24 @@ The bundle includes helper scripts used by the workflow skills:
161
177
 
162
178
  - `scripts/triage_helper.sh`
163
179
  - `scripts/validate_active_task.sh`
164
- - `scripts/reposcry-bootstrap.sh`
165
- - `scripts/reposcry-task-context.sh`
166
- - `scripts/reposcry-refresh.sh`
180
+ - `scripts/graphify-grill.sh`
181
+ - `scripts/graphify-grill.py`
167
182
 
168
183
  When skills are loaded directly from this package, relative references like `../scripts/...` resolve against the package root. When skills are installed with `norpiv-install`, the same layout is recreated under the target runtime.
169
184
 
170
- ## 🔎 Optional RepoScry integration
185
+ ## 🔎 Optional Graphify grilling
171
186
 
172
- RepoScry is an optional repo-memory layer for RPIV. norpiv does **not** require it.
187
+ Graphify is an optional grill-only evidence layer for RPIV. norpiv does **not** require it.
173
188
 
174
- If `reposcry` is installed:
189
+ If bootstrap provisions `~/.graphify/venv`, `/grill-with-docs` may run:
175
190
 
176
191
  ```bash
177
- ./scripts/reposcry-bootstrap.sh
178
- ./scripts/reposcry-task-context.sh "fix dependency graph rebuild"
179
- # edit code
180
- ./scripts/reposcry-refresh.sh main
181
- reposcry validate main HEAD
192
+ ./scripts/graphify-grill.sh
182
193
  ```
183
194
 
184
- Typical usage by phase:
185
-
186
- - `/triage`: optionally seed `.reposcry/` with `scripts/reposcry-bootstrap.sh`
187
- - `/frame`: optionally generate `.reposcry/AI_CONTEXT.md` with `scripts/reposcry-task-context.sh`
188
- - `/grill-with-docs`: optionally use `reposcry query_graph`, `get_architecture_overview`, and `get_impact_radius`
189
- - `/implement`: optionally run `scripts/reposcry-refresh.sh` after edit batches
190
- - `/verify`: optionally add `reposcry validate main HEAD` and affected-flow output as extra evidence
191
-
192
- If RepoScry is absent, the helpers no-op and RPIV continues with normal repo reading, grep, and tests.
193
-
194
- RepoScry guardrails:
195
+ Guardrails:
195
196
 
196
- - `.reposcry/` is generated local cache and must not be committed.
197
- - `scripts/reposcry-bootstrap.sh` automatically adds `.reposcry/` to the project `.gitignore` before initializing RepoScry.
198
- - If `.reposcry/` is already tracked or staged, bootstrap stops and tells you to remove it from the index.
199
- - `.reposcryignore` is indexing policy, not cache. Review and commit it when you want stable RepoScry behavior across machines.
197
+ - input is a temporary `git archive HEAD` extraction, not the live repository root
198
+ - extraction is structural only by default
199
+ - Graphify warnings never block grilling; normal source reading remains the fallback
200
+ - `INFERRED` or `AMBIGUOUS` edges are leads that still require source verification
package/frame/SKILL.md CHANGED
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  name: frame
3
+ workflow: rpiv
4
+ workflowPhase: frame
3
5
  description: Define the task brief inside the active WORK.md. Use after /triage to convert issue data into a clear Problem or Proposal brief without creating separate PROBLEM.md or PRD.md files.
4
6
  ---
5
7
 
@@ -8,15 +10,14 @@ description: Define the task brief inside the active WORK.md. Use after /triage
8
10
  Turn raw task context into the stable "what/why" brief.
9
11
 
10
12
  ## Guardrails
11
- - READ: `.workflow/active_task.json`, `.workflow/tasks/[active_task]/WORK.md`, and `.reposcry/AI_CONTEXT.md` when present.
12
- - WRITE: `WORK.md` -> `[BRIEF]` section and append to `[LOG]` only; optional `.reposcry/AI_CONTEXT.md` when RepoScry is installed.
13
+ - READ: `.workflow/active.json` first, then legacy compatibility `.workflow/active_task.json` only if needed, and active `WORK.md`.
14
+ - WRITE: `WORK.md` -> `[BRIEF]` section and append to `[LOG]` only.
13
15
  - NEVER: create `PROBLEM.md`, `PRD.md`, or extra planning files.
14
16
  - NEVER: overwrite `[PLAN]` or `[GRILL]`.
15
17
  - NEVER: ask whether to frame if the user invoked `/frame`; do it.
16
18
 
17
19
  ## Workflow
18
20
  1. Read the active task and remote metadata.
19
- 2. If RepoScry is available, run the bundled `../scripts/reposcry-task-context.sh "<task summary>"` helper to generate `.reposcry/AI_CONTEXT.md`, then use that file as supplemental repo context. The helper path must preserve RepoScry guardrails: `.reposcry/` ignored, cache never tracked, `.reposcryignore` treated as reviewable indexing policy. Continue normally when unavailable.
20
21
  3. Determine brief type:
21
22
  - **Problem** for bugs, regressions, crashes, broken behavior.
22
23
  - **Proposal** for features, enhancements, refactors, new behavior.
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  name: grill-with-docs
3
+ workflow: rpiv
4
+ workflowPhase: grill-with-docs
3
5
  description: Stress-test the active WORK.md brief against docs, code, and domain language. Use after /frame before planning to clarify assumptions and update durable docs only when decisions are stable.
4
6
  ---
5
7
 
@@ -8,31 +10,25 @@ description: Stress-test the active WORK.md brief against docs, code, and domain
8
10
  Challenge the brief before planning. This replaces passive ubiquitous-language collection with active clarification.
9
11
 
10
12
  ## Guardrails
11
- - READ: `.workflow/active_task.json`, active `WORK.md` `[BRIEF]`, `CONTEXT.md`, relevant `docs/agents/*`, and `.reposcry/AI_CONTEXT.md` when present.
13
+ - READ: `.workflow/active.json` first, then legacy compatibility `.workflow/active_task.json` only if needed, plus active `WORK.md` `[BRIEF]`, `CONTEXT.md`, and relevant `docs/agents/*`.
12
14
  - WRITE: `WORK.md` -> append to `[GRILL]` and `[LOG]` only; durable docs only when a stable rule is confirmed.
13
15
  - NEVER: edit `[BRIEF]` silently; propose brief changes if contradictions are found.
14
16
  - NEVER: plan or implement during grilling.
15
17
  - NEVER: ask questions the codebase can answer; inspect first.
16
18
 
17
19
  ## Workflow
18
- 1. **Context Loading**: Read the active brief, `CONTEXT.md`, relevant `docs/agents/*`, and `.reposcry/AI_CONTEXT.md` when available.
20
+ 1. **Context Loading**: Read the active brief, `CONTEXT.md`, and relevant `docs/agents/*`.
19
21
  2. **Investigation & Trace**:
20
22
  - Locate the files/lines mentioned in the brief.
21
23
  - Trace the data flow related to the problem/proposal.
22
24
  - Search for "Impact Surface": Who else uses or depends on these components?
23
- 3. **Optional RepoScry graph pass**: if `reposcry` is available, use it to ground architecture and blast radius. Before relying on it, ensure the bundled bootstrap/context helper has kept `.reposcry/` ignored and untracked. Use commands such as:
24
- - `reposcry --repo . get_architecture_overview --format json`
25
- - `reposcry --repo . query_graph "callers_of <symbol>"`
26
- - `reposcry --repo . query_graph "tests_for <symbol>"`
27
- - `reposcry --repo . get_impact_radius <symbol> --depth 4`
28
- Proceed normally when RepoScry is absent.
25
+ 3. **Optional Graphify pass**: run `../scripts/graphify-grill.sh` once for bounded structural evidence. It reads only a temporary `git archive HEAD` extraction and warns instead of failing when unavailable. Treat `INFERRED` or `AMBIGUOUS` edges as leads: verify them in source before recording conclusions.
29
26
  4. **Cross-check**: Compare findings against docs, ADRs, and repo patterns.
30
- 5. **Relentless Interview**:
31
- - Ask one question at a time to resolve contradictions or clarify ambiguity.
32
- - Challenge the brief if the code behaves differently than described.
33
- 6. **Log Evidence**: Append resolved decisions, technical findings, edge cases, and constraints to `[GRILL]`.
34
- 7. **Log Activity**: Append a timestamped summary of the grilling session to `[LOG]` (Format: `YYYY-MM-DD hh:mm AM/PM`).
35
- 8. **Context Curation**: If a durable term/rule emerges, propose or apply a concise `docs/agents/*` update.
27
+ 5. **Challenge**: record confirmed constraints, challenged assumptions, chosen decisions, open blockers / HITL questions, and risks handed to `/plan` or `/implement`.
28
+ 6. **Interview**: ask one question at a time only for execution-blocking ambiguity the repository cannot answer.
29
+ 7. **Log Evidence**: Append resolved decisions, technical findings, edge cases, and constraints to `[GRILL]`.
30
+ 8. **Log Activity**: Append a timestamped summary of the grilling session to `[LOG]` (Format: `YYYY-MM-DD hh:mm AM/PM`).
31
+ 9. **Context Curation**: If a durable term/rule emerges, propose or apply a concise `docs/agents/*` update.
36
32
 
37
33
  ## Output contract
38
34
  End with:
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  name: implement
3
+ workflow: rpiv
4
+ workflowPhase: implement
3
5
  description: Implement the next approved vertical slice from the active WORK.md and prepare a Draft PR/MR. Use when the plan is approved and the user explicitly asks to implement.
4
6
  ---
5
7
 
@@ -8,34 +10,34 @@ description: Implement the next approved vertical slice from the active WORK.md
8
10
  Execute one functional vertical slice and hand it to the human for review.
9
11
 
10
12
  ## Guardrails
11
- - READ: `.workflow/active_task.json` then active `WORK.md` `[PLAN]`, `[BRIEF]`, and relevant `[LOG]` evidence.
12
- - WRITE: code changes and `WORK.md` -> append to `[LOG]` only; optional `.reposcry/` cache refresh when RepoScry is installed.
13
+ - READ: `.workflow/active.json` first, then compatibility `.workflow/active_task.json` only if needed, then active `WORK.md` `[PLAN]`, `[BRIEF]`, and relevant `[LOG]` evidence.
14
+ - WRITE: code changes and `WORK.md` -> append to `[LOG]` only.
13
15
  - NEVER: edit `[BRIEF]` or `[GRILL]`.
14
16
  - NEVER: implement without explicit user instruction.
15
- - NEVER: commit a Jira-tracked task with a Jira-less subject; if the active task source is `jira`, the commit subject MUST include the Jira key from `.workflow/active_task.json` (e.g. `fix(PROJ-123): ...`).
16
- - NEVER: hide the Jira key only in the commit body/footer when the task is Jira-tracked; the subject itself must carry the key.
17
17
  - NEVER: add `Signed-off-by`; only the human can certify DCO.
18
18
  - NEVER: freestyle PR/MR descriptions; use the Draft PR/MR body contract below.
19
19
 
20
20
  ## Workflow
21
21
  1. Identify the first approved unchecked slice in `[PLAN]`.
22
- 2. Move tracked task to **In Progress** only when implementation actually starts.
23
- 3. **Mandatory Branch Check**: You MUST run the branch enforcement script before modifying any code.
22
+ 2. **Mandatory Branch Check**: You MUST run the branch enforcement script before modifying any code.
24
23
  - Use the absolute path if possible: `<skill_location>/scripts/enforce-branch.sh`.
25
24
  - This script prevents accidental implementation on `main`/`master`.
26
25
  - If the script switches branches, you must update the `[META]` section of `WORK.md` to reflect the new branch name.
27
26
  - If the script fails, STOP and ask the human for help. Do not proceed with code changes.
28
- 4. Optional RepoScry blast-radius pass: if `reposcry` is available, inspect impact before wide edits (`reposcry --repo . get_impact_radius <symbol> --depth 4` or related graph queries). Continue normally when RepoScry is absent.
27
+ 3. Select the executable child item, not an umbrella parent; if it is unclear, STOP and ask.
28
+ 4. Move that remote item to **In Progress** immediately before code changes.
29
+ - Jira: transition only when an `In Progress`-style state exists.
30
+ - GitHub / GitLab: use an existing repository-specific status mapping only; do not invent a label, comment, or MR change. If none exists, leave the item unchanged and record why in `[LOG]`.
31
+ - If a configured transition fails, STOP and ask the human; do not begin code changes.
32
+ - Do not mark work in progress during `/refine`, `/triage`, `/frame`, or `/plan`.
29
33
  5. Implement test-first where practical; otherwise document why not in `[LOG]`.
30
- 6. After each edit batch, if the bundled `../scripts/reposcry-refresh.sh` helper is present and `reposcry-update` is installed, run it. RepoScry refresh failure should not block implementation. Never stage or commit `.reposcry/`; it is generated cache. `.reposcryignore` may be committed only after review as indexing policy.
31
- 7. Run the slice verification command and available quality gates.
32
- 8. Commit with a Conventional Commit header and `Assisted-by: [AGENT]:[MODEL] [tools]` footer (populating the agent name and model ID from the current session context).
33
- - For Jira-tracked tasks, the header MUST include the Jira key in the scope position: `fix(PROJ-123): ...` or `feat(PROJ-123): ...`.
34
- - If release-note tooling also needs the key in parsed text, add `Refs: PROJ-123` in the body/footer as well.
35
- 9. Push and open a Draft PR/MR with `gh` or `glab` when a remote exists.
36
- - For Jira-tracked tasks, the PR/MR title MUST also include the Jira key and should mirror the commit subject.
37
- 10. Use a temporary body file (`--body-file` or API equivalent) for PR/MR descriptions to avoid shell quoting and markdown escaping bugs.
38
- 11. Append summary, commit hash, and PR/MR link to `[LOG]` (Format: `YYYY-MM-DD hh:mm AM/PM`).
34
+ 6. Run the slice verification command and available quality gates.
35
+ 7. Commit using the repository's normal conventions and hooks/CI rules.
36
+ - If the repo or tracker expects a Jira key, preserve it where that repository normally requires it.
37
+ - If AI attribution trailers are required, obtain them from the repository's documented policy rather than hard-coding RPIV-specific formatting.
38
+ 8. Push and open a Draft PR/MR with `gh` or `glab` when a remote exists.
39
+ 9. Use a temporary body file (`--body-file` or API equivalent) for PR/MR descriptions to avoid shell quoting and markdown escaping bugs.
40
+ 10. Append summary, commit hash, and PR/MR link to `[LOG]` (Format: `YYYY-MM-DD hh:mm AM/PM`).
39
41
 
40
42
  ## Draft PR/MR body contract
41
43
 
@@ -44,22 +44,32 @@ json_pretty() {
44
44
 
45
45
  # Find repo root to ensure paths are absolute and reliable
46
46
  REPO_ROOT=$(git rev-parse --show-toplevel)
47
+ ACTIVE_WORKFLOW_FILE="$REPO_ROOT/.workflow/active.json"
48
+ # Deprecated compatibility fallback during active.json migration. Remove once all readers stop depending on active_task.json.
47
49
  ACTIVE_TASK_FILE="$REPO_ROOT/.workflow/active_task.json"
48
-
49
- if [[ ! -f "$ACTIVE_TASK_FILE" ]]; then
50
- echo "ERROR: No active task found at $ACTIVE_TASK_FILE."
50
+ POINTER_FILE=""
51
+ POINTER_LABEL=""
52
+
53
+ if [[ -f "$ACTIVE_WORKFLOW_FILE" ]]; then
54
+ POINTER_FILE="$ACTIVE_WORKFLOW_FILE"
55
+ POINTER_LABEL="active.json"
56
+ elif [[ -f "$ACTIVE_TASK_FILE" ]]; then
57
+ POINTER_FILE="$ACTIVE_TASK_FILE"
58
+ POINTER_LABEL="active_task.json"
59
+ else
60
+ echo "ERROR: No active task found at $ACTIVE_WORKFLOW_FILE or $ACTIVE_TASK_FILE."
51
61
  echo "Please run /triage [source]:[id] first."
52
62
  exit 1
53
63
  fi
54
64
 
55
65
  # Read canonical active task fields
56
- TASK_SOURCE=$(json_read "$ACTIVE_TASK_FILE" '.source // empty')
57
- TASK_ID=$(json_read "$ACTIVE_TASK_FILE" '.sourceId // .id // empty')
58
- TASK_PATH=$(json_read "$ACTIVE_TASK_FILE" '.taskPath // .path // empty')
66
+ TASK_SOURCE=$(json_read "$POINTER_FILE" '.source // empty')
67
+ TASK_ID=$(json_read "$POINTER_FILE" '.sourceId // .id // empty')
68
+ TASK_PATH=$(json_read "$POINTER_FILE" '.taskPath // .path // empty')
59
69
 
60
70
  # Prefer explicit taskPath when available (most reliable)
61
71
  if [[ -n "$TASK_PATH" ]]; then
62
- echo "INFO: Using taskPath from active_task.json: $TASK_PATH"
72
+ echo "INFO: Using taskPath from $POINTER_LABEL: $TASK_PATH"
63
73
  if [[ "$TASK_PATH" = /* ]]; then
64
74
  WORK_MD="$TASK_PATH/WORK.md"
65
75
  else
@@ -77,9 +87,9 @@ elif [[ -n "$TASK_ID" ]]; then
77
87
  WORK_MD="$REPO_ROOT/.workflow/tasks/$TASK_FOLDER/WORK.md"
78
88
 
79
89
  else
80
- echo "ERROR: No 'sourceId' or 'taskPath' found in $ACTIVE_TASK_FILE."
81
- echo "Please run /triage [source]:[id] to initialize a task. Here are the file contents for debugging:"
82
- json_pretty "$ACTIVE_TASK_FILE" || true
90
+ echo "ERROR: No 'sourceId' or 'taskPath' found in $POINTER_LABEL."
91
+ echo "Please run /triage [source]:[id] to initialize a task. Here are the file contents for debugging:"
92
+ json_pretty "$POINTER_FILE" || true
83
93
  exit 1
84
94
  fi
85
95
 
@@ -88,8 +98,8 @@ echo "DEBUG: Computed WORK.md path: $WORK_MD"
88
98
 
89
99
  if [[ ! -f "$WORK_MD" ]]; then
90
100
  echo "ERROR: WORK.md not found at $WORK_MD."
91
- echo "Checked active_task.json values:"
92
- json_pretty "$ACTIVE_TASK_FILE" || true
101
+ echo "Checked $POINTER_LABEL values:"
102
+ json_pretty "$POINTER_FILE" || true
93
103
  echo "Please ensure the task was initialized with /triage and that WORK.md exists."
94
104
  exit 1
95
105
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raquezha/norpiv",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Bundled RPIV workflow skills for Pi, Claude, and Codex-style coding agents",
5
5
  "type": "commonjs",
6
6
  "bin": {
@@ -12,6 +12,7 @@
12
12
  "distill",
13
13
  "frame",
14
14
  "grill-with-docs",
15
+ "refine",
15
16
  "implement",
16
17
  "plan",
17
18
  "scripts",
@@ -36,6 +37,7 @@
36
37
  },
37
38
  "pi": {
38
39
  "skills": [
40
+ "refine",
39
41
  "triage",
40
42
  "frame",
41
43
  "grill-with-docs",
package/plan/SKILL.md CHANGED
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  name: plan
3
+ workflow: rpiv
4
+ workflowPhase: plan
3
5
  description: Create or revise vertical implementation slices in the active WORK.md. Use after /grill-with-docs to produce a concise, reviewable plan for implementation.
4
6
  ---
5
7
 
@@ -8,7 +10,7 @@ description: Create or revise vertical implementation slices in the active WORK.
8
10
  Map the "how" into tracer-bullet vertical slices.
9
11
 
10
12
  ## Guardrails
11
- - READ: `.workflow/active_task.json` then active `WORK.md` `[BRIEF]` and `[GRILL]`.
13
+ - READ: `.workflow/active.json` / `.workflow/active_task.json` then active `WORK.md` `[BRIEF]` and `[GRILL]`.
12
14
  - WRITE: `WORK.md` -> `[PLAN]` and append to `[LOG]` only.
13
15
  - NEVER: implement code during planning.
14
16
  - NEVER: create standalone `PLAN.md`.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: refine
3
+ workflow: pre-rpiv
4
+ workflowPhase: refine
5
+ description: "Repair tracker work-item readiness before RPIV intake. Use for jira:, github:, or gitlab: items that still need clarified outcome, acceptance criteria, or child work before /triage."
6
+ ---
7
+
8
+ # Skill: refine
9
+
10
+ Make a tracker item ready for engineering handoff without inventing product decisions.
11
+
12
+ ## Guardrails
13
+ - READ: tracker item, linked/child work, relevant comments, and targeted repo context only when needed for ownership or feasibility.
14
+ - WRITE: proposals in chat first; tracker comments/field edits/child creation only after explicit human approval.
15
+ - NEVER: implement code, create branches, or start RPIV task state.
16
+ - NEVER: invent missing product intent when a human decision is required.
17
+ - NEVER: duplicate existing child work or spam repeated agent comments.
18
+ - NEVER: move work across trackers.
19
+
20
+ ## Workflow
21
+ 1. Parse namespaced source: `jira:KEY`, `github:ID`, or `gitlab:ID`.
22
+ 2. Read the item, current structure, and recent comments.
23
+ 3. Classify readiness gaps: missing outcome, acceptance criteria, ownership, dependencies, blockers, or decomposition.
24
+ 4. For every proposed child item, state intended owner, confidence, and fallback `unassigned`. Auto-assign only when the signal is strong from the tracker, comments, or existing team ownership patterns.
25
+ 5. Decide dependency handling explicitly for each child pair or blocker:
26
+ - no dependency
27
+ - description note only
28
+ - real tracker link
29
+ Prefer actual Jira `Blocks` links when child A must precede child B.
30
+ 6. Return one outcome:
31
+ - `ready-single`: one executable owner, no decomposition needed
32
+ - `ready-decomposed`: split is needed and children, links, and owners are clear
33
+ - `needs-decision`: missing product decision or not truly ready-decomposed because ownership/dependencies are still muddy
34
+ 7. Propose the smallest useful tracker edits and child items before mutating anything.
35
+ 8. Before any approved mutation, walk this checklist in order:
36
+ - preserve product-authored text
37
+ - append acceptance criteria instead of rewriting existing acceptance criteria
38
+ - create child?
39
+ - assign child?
40
+ - link child?
41
+ - then mutate parent text/fields
42
+ 9. On explicit approval, apply the approved tracker edits only.
43
+ 10. Re-run idempotently: reuse existing child items and any prior agent-owned refinement marker/comment.
44
+ 11. Recommend `/triage` only once the item is execution-ready.
45
+
46
+ ## Output contract
47
+ End with:
48
+ - **Outcome**: ready-single / ready-decomposed / needs-decision
49
+ - **Missing information**
50
+ - **Proposed tracker edits**
51
+ - **Proposed child work**
52
+ - **Proposed ownership**
53
+ - **Proposed dependency links**
54
+ - **Next step**: approve edits / answer question / `/triage`
@@ -0,0 +1,42 @@
1
+ """Emit bounded structural Graphify evidence from a disposable archive."""
2
+ import json
3
+ import sys
4
+ from contextlib import redirect_stdout
5
+ from pathlib import Path
6
+
7
+ EDGE_LIMIT = 100
8
+
9
+
10
+ def normalize_edge(edge):
11
+ return {
12
+ "confidence": edge.get("confidence", "EXTRACTED"),
13
+ "source": edge.get("source", edge.get("from", "")),
14
+ "target": edge.get("target", edge.get("to", "")),
15
+ "type": edge.get("type", edge.get("relation", "")),
16
+ }
17
+
18
+
19
+ def render_evidence(graph, limit=EDGE_LIMIT):
20
+ edges = graph.get("edges", [])[:limit]
21
+ return {
22
+ "edges": [normalize_edge(edge) for edge in edges],
23
+ "truncated": len(graph.get("edges", [])) > len(edges),
24
+ }
25
+
26
+
27
+ def main(root_arg):
28
+ root = Path(root_arg)
29
+ out = root / "graphify-out"
30
+ from graphify.extract import collect_files, extract
31
+
32
+ with redirect_stdout(sys.stderr):
33
+ graph = extract(collect_files(root), cache_root=out, root=root, parallel=False)
34
+ print(json.dumps(render_evidence(graph)))
35
+
36
+
37
+ if __name__ == "__main__":
38
+ try:
39
+ main(sys.argv[1])
40
+ except Exception as error:
41
+ print(f"Graphify extraction failed: {error}", file=sys.stderr)
42
+ raise
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env bash
2
+ # Optional structural Graphify pass over committed HEAD only.
3
+ set -u
4
+
5
+ repo_root=$(git rev-parse --show-toplevel 2>/dev/null) || { echo "WARN: Graphify skipped: not a git repository." >&2; exit 0; }
6
+ python=${GRAPHIFY_PYTHON:-"$HOME/.graphify/venv/bin/python"}
7
+ if [[ ! -x "$python" ]]; then
8
+ python="$repo_root/.graphify/venv/bin/python"
9
+ fi
10
+ script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
11
+ temp=$(mktemp -d "${TMPDIR:-/tmp}/norpiv-graphify.XXXXXX") || { echo "WARN: Graphify skipped: cannot create temporary directory." >&2; exit 0; }
12
+ trap 'rm -rf "$temp"' EXIT
13
+
14
+ if [[ ! -x "$python" ]]; then
15
+ echo "WARN: Graphify skipped: machine-wide or repo-local Python is unavailable." >&2
16
+ exit 0
17
+ fi
18
+ if ! git -C "$repo_root" archive HEAD | tar -x -C "$temp"; then
19
+ echo "WARN: Graphify skipped: cannot archive HEAD." >&2
20
+ exit 0
21
+ fi
22
+ if ! "$python" "$script_dir/graphify-grill.py" "$temp"; then
23
+ echo "WARN: Graphify failed; continue with normal source reading." >&2
24
+ fi
@@ -0,0 +1,21 @@
1
+ import importlib.util
2
+ from pathlib import Path
3
+
4
+ module_path = Path(__file__).with_name("graphify-grill.py")
5
+ spec = importlib.util.spec_from_file_location("graphify_grill", module_path)
6
+ module = importlib.util.module_from_spec(spec)
7
+ spec.loader.exec_module(module)
8
+
9
+ edge = module.normalize_edge({"from": "a", "to": "b", "relation": "calls"})
10
+ assert edge == {
11
+ "confidence": "EXTRACTED",
12
+ "source": "a",
13
+ "target": "b",
14
+ "type": "calls",
15
+ }
16
+
17
+ rendered = module.render_evidence({"edges": [{"source": str(i)} for i in range(105)]}, limit=100)
18
+ assert len(rendered["edges"]) == 100
19
+ assert rendered["truncated"] is True
20
+
21
+ print("graphify-grill.py self-check passed")