@raquezha/norpiv 0.0.7 → 0.1.0
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 +30 -34
- package/frame/SKILL.md +13 -7
- package/grill-with-docs/SKILL.md +15 -15
- package/implement/SKILL.md +18 -17
- package/implement/scripts/enforce-branch.sh +22 -12
- package/package.json +3 -1
- package/plan/SKILL.md +10 -2
- package/refine/SKILL.md +54 -0
- package/scripts/graphify-grill.py +42 -0
- package/scripts/graphify-grill.sh +24 -0
- package/scripts/test_graphify_grill.py +21 -0
- package/scripts/triage_helper.sh +133 -36
- package/scripts/validate_active_task.sh +63 -37
- package/sync/SKILL.md +12 -3
- package/triage/SKILL.md +10 -13
- package/verify/SKILL.md +3 -3
- package/scripts/reposcry-bootstrap.sh +0 -108
- package/scripts/reposcry-refresh.sh +0 -19
- package/scripts/reposcry-task-context.sh +0 -40
package/README.md
CHANGED
|
@@ -12,6 +12,7 @@ The RPIV engine splits task execution into separate, focused phases:
|
|
|
12
12
|
|
|
13
13
|
| Phase | Command | Purpose | Input / Output Files |
|
|
14
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 |
|
|
15
16
|
| **1. Ingest** | `/triage [source]:[id]` | Initial task verification and workspace setup. | Creates `.workflow/tasks/[source-id]/WORK.md` & `metadata.json` |
|
|
16
17
|
| **2. Scoping** | `/frame` | Author a clear, structured task brief. | Populates `WORK.md` ➔ `[BRIEF]` section |
|
|
17
18
|
| **3. Interrogate**| `/grill-with-docs` | Stress-test brief against rules and docs. | Records decisions in `WORK.md` ➔ `[GRILL]` |
|
|
@@ -46,6 +47,11 @@ Rules:
|
|
|
46
47
|
- **Measure Twice, Cut Once**: Never implement code during scoping or planning. The agent will wait for an explicit `EXECUTE` statement before modifying files.
|
|
47
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.
|
|
48
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.
|
|
54
|
+
- **Evidence Classification & Gate**: `/frame` classifies task evidence requirements into `UI-sensitive`, `Formula-sensitive`, or `Backend-safe`, and records evidence status as `present`, `missing`, or `n/a`. Direct Zeplin screen links (`https://zpl.io/<id>`) or Figma frame URLs (`node-id`) are required for UI-sensitive work; attachments, generic links, and parent ticket links do not mark evidence `present`. For `UI-sensitive` work, `/plan` automatically consumes NoDesign preflight (`nodesign preflight`) to verify design evidence status, save task evidence to `.workflow/tasks/<task-id>/evidence/`, and distinguish missing provider access from missing design truth. Human waivers (`waived: <reason>`) unblock planning while preserving waiver audit records. Missing evidence causes `/plan` to flag dependent slices as `[BLOCKED]` and `/implement` to refuse code execution until unblocked or explicitly overridden. Backend-safe work uses status `n/a`.
|
|
49
55
|
|
|
50
56
|
## 📦 Install as a skill bundle
|
|
51
57
|
|
|
@@ -55,7 +61,7 @@ Best for trying or handing off RPIV skills without installing the full `nothing`
|
|
|
55
61
|
|
|
56
62
|
```bash
|
|
57
63
|
npx -y skills add raquezha/nothing --full-depth -g -a pi \
|
|
58
|
-
-s triage frame grill-with-docs plan implement verify sync post-merge-prune update-docs distill \
|
|
64
|
+
-s refine triage frame grill-with-docs plan implement verify sync post-merge-prune update-docs distill \
|
|
59
65
|
-y
|
|
60
66
|
```
|
|
61
67
|
|
|
@@ -88,7 +94,7 @@ Targets:
|
|
|
88
94
|
|
|
89
95
|
| Hat | Purpose |
|
|
90
96
|
| :--- | :--- |
|
|
91
|
-
| `pi --rpiv` | Full RPIV workflow. Loads triage, frame, grill-with-docs, plan, implement, verify, sync, post-merge-prune, and update-docs. |
|
|
97
|
+
| `pi --rpiv` | Full RPIV workflow. Loads refine, triage, frame, grill-with-docs, plan, implement, verify, sync, post-merge-prune, and update-docs. |
|
|
92
98
|
| `pi --notes` | Conversation distiller. Saves useful thinking to Obsidian without RPIV ceremony. |
|
|
93
99
|
|
|
94
100
|
## 📝 Pre-RPIV note capture
|
|
@@ -127,34 +133,39 @@ Research is a separate local workflow bundle in `packages/workflows/noresearch`
|
|
|
127
133
|
|
|
128
134
|
If installed via `npx skills add` or `norpiv-install`, invoke the skills directly in your agent instead.
|
|
129
135
|
|
|
130
|
-
2. **
|
|
136
|
+
2. **Optional Tracker Refinement**:
|
|
137
|
+
```text
|
|
138
|
+
/refine github:45
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
3. **Triage an Issue**:
|
|
131
142
|
```text
|
|
132
143
|
/triage github:45
|
|
133
144
|
```
|
|
134
145
|
|
|
135
|
-
|
|
146
|
+
4. **Frame the Work**:
|
|
136
147
|
```text
|
|
137
148
|
/frame
|
|
138
149
|
```
|
|
139
150
|
|
|
140
|
-
|
|
151
|
+
5. **Verify Constraints**:
|
|
141
152
|
```text
|
|
142
153
|
/grill-with-docs
|
|
143
154
|
```
|
|
144
155
|
|
|
145
|
-
|
|
156
|
+
6. **Write the Plan Slices**:
|
|
146
157
|
```text
|
|
147
158
|
/plan
|
|
148
159
|
```
|
|
149
160
|
|
|
150
|
-
|
|
161
|
+
7. **Authorize Execution**:
|
|
151
162
|
Provide the agent explicit permission to implement:
|
|
152
163
|
```text
|
|
153
164
|
EXECUTE
|
|
154
165
|
/implement
|
|
155
166
|
```
|
|
156
167
|
|
|
157
|
-
|
|
168
|
+
8. **Verify & Close**:
|
|
158
169
|
```text
|
|
159
170
|
/verify
|
|
160
171
|
/sync
|
|
@@ -167,39 +178,24 @@ The bundle includes helper scripts used by the workflow skills:
|
|
|
167
178
|
|
|
168
179
|
- `scripts/triage_helper.sh`
|
|
169
180
|
- `scripts/validate_active_task.sh`
|
|
170
|
-
- `scripts/
|
|
171
|
-
- `scripts/
|
|
172
|
-
- `scripts/reposcry-refresh.sh`
|
|
181
|
+
- `scripts/graphify-grill.sh`
|
|
182
|
+
- `scripts/graphify-grill.py`
|
|
173
183
|
|
|
174
184
|
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.
|
|
175
185
|
|
|
176
|
-
## 🔎 Optional
|
|
186
|
+
## 🔎 Optional Graphify grilling
|
|
177
187
|
|
|
178
|
-
|
|
188
|
+
Graphify is an optional grill-only evidence layer for RPIV. norpiv does **not** require it.
|
|
179
189
|
|
|
180
|
-
If `
|
|
190
|
+
If bootstrap provisions `~/.graphify/venv`, `/grill-with-docs` may run:
|
|
181
191
|
|
|
182
192
|
```bash
|
|
183
|
-
./scripts/
|
|
184
|
-
./scripts/reposcry-task-context.sh "fix dependency graph rebuild"
|
|
185
|
-
# edit code
|
|
186
|
-
./scripts/reposcry-refresh.sh main
|
|
187
|
-
reposcry validate main HEAD
|
|
193
|
+
./scripts/graphify-grill.sh
|
|
188
194
|
```
|
|
189
195
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
- `/triage`: optionally seed `.reposcry/` with `scripts/reposcry-bootstrap.sh`
|
|
193
|
-
- `/frame`: optionally generate `.reposcry/AI_CONTEXT.md` with `scripts/reposcry-task-context.sh`
|
|
194
|
-
- `/grill-with-docs`: optionally use `reposcry query_graph`, `get_architecture_overview`, and `get_impact_radius`
|
|
195
|
-
- `/implement`: optionally run `scripts/reposcry-refresh.sh` after edit batches
|
|
196
|
-
- `/verify`: optionally add `reposcry validate main HEAD` and affected-flow output as extra evidence
|
|
197
|
-
|
|
198
|
-
If RepoScry is absent, the helpers no-op and RPIV continues with normal repo reading, grep, and tests.
|
|
199
|
-
|
|
200
|
-
RepoScry guardrails:
|
|
196
|
+
Guardrails:
|
|
201
197
|
|
|
202
|
-
-
|
|
203
|
-
-
|
|
204
|
-
-
|
|
205
|
-
-
|
|
198
|
+
- input is a temporary `git archive HEAD` extraction, not the live repository root
|
|
199
|
+
- extraction is structural only by default
|
|
200
|
+
- Graphify warnings never block grilling; normal source reading remains the fallback
|
|
201
|
+
- `INFERRED` or `AMBIGUOUS` edges are leads that still require source verification
|
package/frame/SKILL.md
CHANGED
|
@@ -10,27 +10,33 @@ description: Define the task brief inside the active WORK.md. Use after /triage
|
|
|
10
10
|
Turn raw task context into the stable "what/why" brief.
|
|
11
11
|
|
|
12
12
|
## Guardrails
|
|
13
|
-
- READ: `.workflow/active.json`
|
|
14
|
-
- WRITE: `WORK.md` -> `[BRIEF]` section and append to `[LOG]` only
|
|
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.
|
|
15
15
|
- NEVER: create `PROBLEM.md`, `PRD.md`, or extra planning files.
|
|
16
16
|
- NEVER: overwrite `[PLAN]` or `[GRILL]`.
|
|
17
17
|
- NEVER: ask whether to frame if the user invoked `/frame`; do it.
|
|
18
18
|
|
|
19
19
|
## Workflow
|
|
20
20
|
1. Read the active task and remote metadata.
|
|
21
|
-
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.
|
|
22
21
|
3. Determine brief type:
|
|
23
22
|
- **Problem** for bugs, regressions, crashes, broken behavior.
|
|
24
23
|
- **Proposal** for features, enhancements, refactors, new behavior.
|
|
25
|
-
4.
|
|
24
|
+
4. Classify task evidence requirements:
|
|
25
|
+
- **Evidence Category**: `UI-sensitive` (UI components, screens, layout), `Formula-sensitive` (math, rate tables, tier logic), or `Backend-safe` (pure backend, refactoring, infra).
|
|
26
|
+
- **Evidence Status**: `present`, `missing`, or `n/a`.
|
|
27
|
+
- **UI Evidence Rule**: `present` requires a direct Zeplin screen URL (`https://zpl.io/<id>` or `*.zeplin.io/.../screen/...`) or direct Figma screen/frame URL (`https://figma.com/design/...` with `node-id` / frame parameter) on the source ticket. Attachments, screenshots, generic project links, and links on parent/linked tickets do NOT satisfy `present` (parent links are logged as repair hints).
|
|
28
|
+
- **Formula Evidence Rule**: `present` requires explicit formula spec, truth table, or exact logic definition on ticket.
|
|
29
|
+
- **Backend-safe Exemption**: Evidence status is `n/a`.
|
|
30
|
+
5. Create or replace only the `[BRIEF]` section with:
|
|
26
31
|
- type and source id
|
|
32
|
+
- evidence classification (category and status)
|
|
27
33
|
- current understanding
|
|
28
34
|
- desired outcome
|
|
29
35
|
- constraints / non-goals
|
|
30
36
|
- acceptance hints if available
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
6. Keep the brief concise and reviewable.
|
|
38
|
+
7. **Log Activity**: Append a timestamped summary of the framing/re-framing to `[LOG]` (Format: `YYYY-MM-DD hh:mm AM/PM`). Include why the change was made if it is a pivot.
|
|
39
|
+
8. End by recommending `/grill-with-docs`.
|
|
34
40
|
|
|
35
41
|
## Output contract
|
|
36
42
|
End with:
|
package/grill-with-docs/SKILL.md
CHANGED
|
@@ -10,31 +10,31 @@ description: Stress-test the active WORK.md brief against docs, code, and domain
|
|
|
10
10
|
Challenge the brief before planning. This replaces passive ubiquitous-language collection with active clarification.
|
|
11
11
|
|
|
12
12
|
## Guardrails
|
|
13
|
-
- READ: `.workflow/active.json`
|
|
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/*`.
|
|
14
14
|
- WRITE: `WORK.md` -> append to `[GRILL]` and `[LOG]` only; durable docs only when a stable rule is confirmed.
|
|
15
15
|
- NEVER: edit `[BRIEF]` silently; propose brief changes if contradictions are found.
|
|
16
16
|
- NEVER: plan or implement during grilling.
|
|
17
17
|
- NEVER: ask questions the codebase can answer; inspect first.
|
|
18
|
+
- EVIDENCE ISOLATION: Resolve task evidence from `.workflow/tasks/<task-id>/evidence/` or explicit active state references. Do not substitute arbitrary repository-root files as task evidence.
|
|
18
19
|
|
|
19
20
|
## Workflow
|
|
20
|
-
1. **Context Loading**: Read the active brief, `CONTEXT.md`, relevant `docs/agents
|
|
21
|
+
1. **Context Loading**: Read the active brief, `CONTEXT.md`, and relevant `docs/agents/*`.
|
|
21
22
|
2. **Investigation & Trace**:
|
|
22
23
|
- Locate the files/lines mentioned in the brief.
|
|
23
24
|
- Trace the data flow related to the problem/proposal.
|
|
24
25
|
- Search for "Impact Surface": Who else uses or depends on these components?
|
|
25
|
-
3. **Optional
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
- `
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
5. **
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
8. **Context Curation**: If a durable term/rule emerges, propose or apply a concise `docs/agents/*` update.
|
|
26
|
+
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.
|
|
27
|
+
4. **Cross-check & Evidence Verification**:
|
|
28
|
+
- Compare findings against docs, ADRs, and repo patterns.
|
|
29
|
+
- **Evaluate Evidence Classification**: Check evidence status (`present`, `missing`, `n/a`).
|
|
30
|
+
- For `UI-sensitive` work: Verify the source ticket explicitly contains a direct Zeplin screen URL (`https://zpl.io/<id>` or `*.zeplin.io/.../screen/...`) or direct Figma screen/frame URL (`https://figma.com/design/...` with `node-id`). Reject attachments, screenshots, generic design links, and links present only on parent/linked tickets as direct evidence. If design links are discovered on parent/linked tickets, report them in `[GRILL]` as diagnostic context to help repair the ticket, but record evidence status as `missing`.
|
|
31
|
+
- For `Formula-sensitive` work: Verify explicit formula specifications or truth tables are on the ticket; if absent, record evidence status as `missing`.
|
|
32
|
+
- For `Backend-safe` work: Evidence status is `n/a`.
|
|
33
|
+
5. **Challenge**: record confirmed constraints, challenged assumptions, chosen decisions, open blockers / HITL questions, and risks handed to `/plan` or `/implement`.
|
|
34
|
+
6. **Interview**: ask one question at a time only for execution-blocking ambiguity the repository cannot answer.
|
|
35
|
+
7. **Log Evidence**: Append resolved decisions, technical findings, edge cases, and constraints to `[GRILL]`.
|
|
36
|
+
8. **Log Activity**: Append a timestamped summary of the grilling session to `[LOG]` (Format: `YYYY-MM-DD hh:mm AM/PM`).
|
|
37
|
+
9. **Context Curation**: If a durable term/rule emerges, propose or apply a concise `docs/agents/*` update.
|
|
38
38
|
|
|
39
39
|
## Output contract
|
|
40
40
|
End with:
|
package/implement/SKILL.md
CHANGED
|
@@ -10,34 +10,35 @@ description: Implement the next approved vertical slice from the active WORK.md
|
|
|
10
10
|
Execute one functional vertical slice and hand it to the human for review.
|
|
11
11
|
|
|
12
12
|
## Guardrails
|
|
13
|
-
- READ: `.workflow/active.json`
|
|
14
|
-
- WRITE: code changes and `WORK.md` -> append to `[LOG]` only
|
|
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.
|
|
15
15
|
- NEVER: edit `[BRIEF]` or `[GRILL]`.
|
|
16
16
|
- NEVER: implement without explicit user instruction.
|
|
17
|
-
-
|
|
18
|
-
- 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
|
+
- EVIDENCE REJECTION GATE: Before modifying code, `/implement` MUST verify that the target slice is not flagged `[BLOCKED: missing UI/formula evidence]` and evidence status is not `missing`. If blocked, STOP immediately, refuse code changes, surface what evidence is missing (direct Zeplin screen link `https://zpl.io/<id>`, direct Figma frame URL, or formula spec), and ask the human for explicit clarification or override. Never guess product UI or formula truth around a blocked state.
|
|
19
18
|
- NEVER: add `Signed-off-by`; only the human can certify DCO.
|
|
20
19
|
- NEVER: freestyle PR/MR descriptions; use the Draft PR/MR body contract below.
|
|
21
20
|
|
|
22
21
|
## Workflow
|
|
23
|
-
1. Identify the first approved unchecked slice in `[PLAN]`.
|
|
24
|
-
2.
|
|
25
|
-
3. **Mandatory Branch Check**: You MUST run the branch enforcement script before modifying any code.
|
|
22
|
+
1. Identify the first approved unchecked slice in `[PLAN]`. Verify the slice is not marked `[BLOCKED: missing UI/formula evidence]`. If blocked, STOP and ask the human for missing direct evidence or explicit override.
|
|
23
|
+
2. **Mandatory Branch Check**: You MUST run the branch enforcement script before modifying any code.
|
|
26
24
|
- Use the absolute path if possible: `<skill_location>/scripts/enforce-branch.sh`.
|
|
27
25
|
- This script prevents accidental implementation on `main`/`master`.
|
|
28
26
|
- If the script switches branches, you must update the `[META]` section of `WORK.md` to reflect the new branch name.
|
|
29
27
|
- If the script fails, STOP and ask the human for help. Do not proceed with code changes.
|
|
30
|
-
|
|
28
|
+
3. Select the executable child item, not an umbrella parent; if it is unclear, STOP and ask.
|
|
29
|
+
4. Move that remote item to **In Progress** immediately before code changes.
|
|
30
|
+
- Jira: transition only when an `In Progress`-style state exists.
|
|
31
|
+
- 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]`.
|
|
32
|
+
- If a configured transition fails, STOP and ask the human; do not begin code changes.
|
|
33
|
+
- Do not mark work in progress during `/refine`, `/triage`, `/frame`, or `/plan`.
|
|
31
34
|
5. Implement test-first where practical; otherwise document why not in `[LOG]`.
|
|
32
|
-
6.
|
|
33
|
-
7.
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
9.
|
|
38
|
-
|
|
39
|
-
10. Use a temporary body file (`--body-file` or API equivalent) for PR/MR descriptions to avoid shell quoting and markdown escaping bugs.
|
|
40
|
-
11. Append summary, commit hash, and PR/MR link to `[LOG]` (Format: `YYYY-MM-DD hh:mm AM/PM`).
|
|
35
|
+
6. Run the slice verification command and available quality gates.
|
|
36
|
+
7. Commit using the repository's normal conventions and hooks/CI rules.
|
|
37
|
+
- If the repo or tracker expects a Jira key, preserve it where that repository normally requires it.
|
|
38
|
+
- If AI attribution trailers are required, obtain them from the repository's documented policy rather than hard-coding RPIV-specific formatting.
|
|
39
|
+
8. Push and open a Draft PR/MR with `gh` or `glab` when a remote exists.
|
|
40
|
+
9. Use a temporary body file (`--body-file` or API equivalent) for PR/MR descriptions to avoid shell quoting and markdown escaping bugs.
|
|
41
|
+
10. Append summary, commit hash, and PR/MR link to `[LOG]` (Format: `YYYY-MM-DD hh:mm AM/PM`).
|
|
41
42
|
|
|
42
43
|
## Draft PR/MR body contract
|
|
43
44
|
|
|
@@ -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
|
-
|
|
50
|
-
|
|
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 "$
|
|
57
|
-
TASK_ID=$(json_read "$
|
|
58
|
-
TASK_PATH=$(json_read "$
|
|
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
|
|
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 $
|
|
81
|
-
echo "Please run /triage [source]:[id] to initialize a task. Here are the file contents for debugging:"
|
|
82
|
-
json_pretty "$
|
|
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
|
|
92
|
-
json_pretty "$
|
|
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
|
|
3
|
+
"version": "0.1.0",
|
|
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
|
@@ -15,16 +15,24 @@ Map the "how" into tracer-bullet vertical slices.
|
|
|
15
15
|
- NEVER: implement code during planning.
|
|
16
16
|
- NEVER: create standalone `PLAN.md`.
|
|
17
17
|
- NEVER: ask whether to plan if the user invoked `/plan`; produce the plan.
|
|
18
|
+
- EVIDENCE BLOCKING GATE: If task evidence status is `missing` for `UI-sensitive` or `Formula-sensitive` work, `/plan` MUST flag dependent slices as `[BLOCKED: missing UI/formula evidence]` and preserve blocked status instead of marking slices ready for implementation.
|
|
19
|
+
- AUTOMATIC NODESIGN PREFLIGHT: For `UI-sensitive` work, `/plan` MUST automatically consume or run NoDesign preflight (`nodesign preflight --json --path . --task <source>:<id>`) without requiring manual preflight CLI execution.
|
|
20
|
+
- EVIDENCEMAPPING: Map NoDesign preflight evidence status to RPIV evidence status: `ready` -> `present`, `missing` or `ambiguous` -> `missing`.
|
|
21
|
+
- PROVIDER FAULT ISOLATION: Distinguish provider auth/access failures (`AUTH_REQUIRED`, `AUTH_REJECTED`, `ACCESS_DENIED`, `RATE_LIMITED`, `API_UNAVAILABLE`) from missing design evidence truth (`DESIGN_NOT_FOUND`, missing direct `node-id` / screen URL). Surface missing credentials or API access cleanly without treating provider auth errors as product specification failure.
|
|
22
|
+
- CREDENTIAL SAFETY: Never request or pass NoDesign API tokens through model context; resolve credentials from OS keychain, environment variables, or `~/.pi-secrets/.env`.
|
|
23
|
+
- HUMAN WAIVER: Allow explicit human waivers (recorded distinctly as `waived: <reason>` in `WORK.md`). Human waivers unblock implementation-ready planning while preserving explicit waiver audit state.
|
|
24
|
+
- EVIDENCE ISOLATION: Resolve task evidence from active workspace `.workflow/tasks/<task-id>/evidence/` or task state. Do not scan arbitrary repository files as task evidence.
|
|
18
25
|
|
|
19
26
|
## Workflow
|
|
20
27
|
1. Read the brief and grill decisions.
|
|
21
|
-
2. **
|
|
28
|
+
2. **Automatic NoDesign Preflight (UI-sensitive)**: If evidence category is `UI-sensitive`, invoke or consume `nodesign preflight --json --path . --task <source>:<id>`. Map `ready` status to `present`, and `missing` or `ambiguous` to `missing`. If credentials or provider access are missing (`AUTH_REQUIRED`, `ACCESS_DENIED`), surface the provider issue explicitly instead of mistaking it for a missing product design URL.
|
|
29
|
+
3. **Branch Check**: Verify the current git branch. Planning on `main` is safe and encouraged. If you are on an unrelated feature branch, warn the human that the plan is being made on a stale or mismatched context.
|
|
22
30
|
3. Draft thin vertical slices that are independently verifiable.
|
|
23
31
|
4. Mark each slice:
|
|
24
32
|
- **AFK**: agent can implement with clear checks.
|
|
25
33
|
- **HITL**: human judgment, product decision, external access, or manual review required.
|
|
26
34
|
5. Include dependencies and verification command(s) per slice.
|
|
27
|
-
6. Write the plan into `[PLAN]` with checkboxes.
|
|
35
|
+
6. Write the plan into `[PLAN]` with checkboxes. If evidence status is `missing`, mark the slice as `[BLOCKED: missing UI/formula evidence]` and explain what is needed (direct Zeplin `https://zpl.io/<id>` screen URL, direct Figma `node-id` frame URL, or formula spec).
|
|
28
36
|
7. **Log Activity**: Append a timestamped entry to `[LOG]` summarizing the plan or revision (Format: `YYYY-MM-DD hh:mm AM/PM`).
|
|
29
37
|
8. Recommend `/sync` if the task has a tracker, then `/implement`.
|
|
30
38
|
|
package/refine/SKILL.md
ADDED
|
@@ -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")
|