@raquezha/norpiv 0.0.5 → 0.0.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/README.md +10 -4
- package/bin/norpiv-install.cjs +1 -1
- package/distill/SKILL.md +1 -1
- package/frame/SKILL.md +3 -1
- package/grill-with-docs/SKILL.md +3 -1
- package/implement/SKILL.md +3 -1
- package/package.json +3 -3
- package/plan/SKILL.md +3 -1
- package/scripts/get-pi-model.sh +0 -0
- package/scripts/triage_helper.sh +19 -4
- package/scripts/validate_active_task.sh +2 -2
- package/sync/SKILL.md +5 -3
- package/triage/SKILL.md +5 -3
- package/verify/SKILL.md +5 -3
- package/cleanup/SKILL.md +0 -53
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
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:
|
|
@@ -20,7 +24,7 @@ Auxiliary hygiene:
|
|
|
20
24
|
|
|
21
25
|
| Command | Purpose | Input / Output Files |
|
|
22
26
|
| :--- | :--- | :--- |
|
|
23
|
-
| `/
|
|
27
|
+
| `/post-merge-prune` | Delete stale local branches after a PR/MR is merged, prune remote refs, and clean completed task folders. | Post-merge branch cleanup plus safe task-folder cleanup |
|
|
24
28
|
|
|
25
29
|
---
|
|
26
30
|
|
|
@@ -51,7 +55,7 @@ Best for trying or handing off RPIV skills without installing the full `nothing`
|
|
|
51
55
|
|
|
52
56
|
```bash
|
|
53
57
|
npx -y skills add raquezha/nothing --full-depth -g -a pi \
|
|
54
|
-
-s triage frame grill-with-docs plan implement verify sync
|
|
58
|
+
-s triage frame grill-with-docs plan implement verify sync post-merge-prune update-docs distill \
|
|
55
59
|
-y
|
|
56
60
|
```
|
|
57
61
|
|
|
@@ -84,7 +88,7 @@ Targets:
|
|
|
84
88
|
|
|
85
89
|
| Hat | Purpose |
|
|
86
90
|
| :--- | :--- |
|
|
87
|
-
| `pi --rpiv` | Full RPIV workflow. Loads triage, frame, grill-with-docs, plan, implement, verify, sync,
|
|
91
|
+
| `pi --rpiv` | Full RPIV workflow. Loads triage, frame, grill-with-docs, plan, implement, verify, sync, post-merge-prune, and update-docs. |
|
|
88
92
|
| `pi --notes` | Conversation distiller. Saves useful thinking to Obsidian without RPIV ceremony. |
|
|
89
93
|
|
|
90
94
|
## 📝 Pre-RPIV note capture
|
|
@@ -112,6 +116,8 @@ Obsidian note → /triage → RPIV (only when ready to commit)
|
|
|
112
116
|
|
|
113
117
|
`distill` is the missing layer before RPIV. Use `pi --notes` to load it.
|
|
114
118
|
|
|
119
|
+
Research is a separate local workflow bundle in `packages/workflows/noresearch` and is loaded by the full `nothing` setup with `pi --research`.
|
|
120
|
+
|
|
115
121
|
## 🚀 Quick Start Example
|
|
116
122
|
|
|
117
123
|
1. **Activate the RPIV Hat** from the full `nothing` setup:
|
|
@@ -152,7 +158,7 @@ Obsidian note → /triage → RPIV (only when ready to commit)
|
|
|
152
158
|
```text
|
|
153
159
|
/verify
|
|
154
160
|
/sync
|
|
155
|
-
/
|
|
161
|
+
/post-merge-prune
|
|
156
162
|
```
|
|
157
163
|
|
|
158
164
|
## 🧭 Shared helper scripts
|
package/bin/norpiv-install.cjs
CHANGED
|
@@ -136,7 +136,7 @@ function writeCodexAdapter(root, names, sharedNames, opts) {
|
|
|
136
136
|
const sharedLines = sharedNames.length
|
|
137
137
|
? `\nShared helpers:\n\n${sharedNames.map((name) => `- ${name}/`).join("\n")}\n`
|
|
138
138
|
: "";
|
|
139
|
-
const body = `# norpiv RPIV skills for Codex\n\nCodex does not currently auto-load Pi/Claude SKILL.md bundles from npm.\n\nUse these installed skill instructions as a portable RPIV workflow reference:\n\n${names.map((name) => `- ${name}/SKILL.md`).join("\n")}\n${sharedLines}\nCore lifecycle: triage
|
|
139
|
+
const body = `# norpiv RPIV skills for Codex\n\nCodex does not currently auto-load Pi/Claude SKILL.md bundles from npm.\n\nUse these installed skill instructions as a portable RPIV workflow reference:\n\n${names.map((name) => `- ${name}/SKILL.md`).join("\n")}\n${sharedLines}\nCore lifecycle: triage -> frame -> grill-with-docs -> plan -> implement -> verify -> sync -> post-merge-prune.\n\nIf your Codex environment supports AGENTS.md discovery, copy or reference this file from your project.\n`;
|
|
140
140
|
log(opts, `write Codex adapter ${adapter}`);
|
|
141
141
|
if (!opts.dryRun) fs.writeFileSync(adapter, body);
|
|
142
142
|
}
|
package/distill/SKILL.md
CHANGED
|
@@ -180,7 +180,7 @@ If writing fails, output the markdown to stdout so the user can copy it manually
|
|
|
180
180
|
- Does not require `WORK.md`
|
|
181
181
|
- Does not interact with `.workflow/` directory
|
|
182
182
|
- Does not sync to Jira, GitHub, or GitLab
|
|
183
|
-
- Does not run
|
|
183
|
+
- Does not run post-merge-prune
|
|
184
184
|
- Does not require any existing task or ticket
|
|
185
185
|
|
|
186
186
|
---
|
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,7 +10,7 @@ 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/
|
|
13
|
+
- READ: `.workflow/active.json` / `.workflow/active_task.json`, active `WORK.md`, and `.reposcry/AI_CONTEXT.md` when present.
|
|
12
14
|
- WRITE: `WORK.md` -> `[BRIEF]` section and append to `[LOG]` only; optional `.reposcry/AI_CONTEXT.md` when RepoScry is installed.
|
|
13
15
|
- NEVER: create `PROBLEM.md`, `PRD.md`, or extra planning files.
|
|
14
16
|
- NEVER: overwrite `[PLAN]` or `[GRILL]`.
|
package/grill-with-docs/SKILL.md
CHANGED
|
@@ -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,7 +10,7 @@ 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` / `.workflow/active_task.json`, active `WORK.md` `[BRIEF]`, `CONTEXT.md`, relevant `docs/agents/*`, and `.reposcry/AI_CONTEXT.md` when present.
|
|
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.
|
package/implement/SKILL.md
CHANGED
|
@@ -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,7 +10,7 @@ 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.
|
|
13
|
+
- READ: `.workflow/active.json` / `.workflow/active_task.json` then active `WORK.md` `[PLAN]`, `[BRIEF]`, and relevant `[LOG]` evidence.
|
|
12
14
|
- WRITE: code changes and `WORK.md` -> append to `[LOG]` only; optional `.reposcry/` cache refresh when RepoScry is installed.
|
|
13
15
|
- NEVER: edit `[BRIEF]` or `[GRILL]`.
|
|
14
16
|
- NEVER: implement without explicit user instruction.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raquezha/norpiv",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Bundled RPIV workflow skills for Pi, Claude, and Codex-style coding agents",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"bin": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"bin",
|
|
11
|
-
"
|
|
11
|
+
"post-merge-prune",
|
|
12
12
|
"distill",
|
|
13
13
|
"frame",
|
|
14
14
|
"grill-with-docs",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"verify",
|
|
45
45
|
"sync",
|
|
46
46
|
"update-docs",
|
|
47
|
-
"
|
|
47
|
+
"post-merge-prune",
|
|
48
48
|
"distill"
|
|
49
49
|
]
|
|
50
50
|
}
|
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`.
|
package/scripts/get-pi-model.sh
CHANGED
|
File without changes
|
package/scripts/triage_helper.sh
CHANGED
|
@@ -120,13 +120,13 @@ PY
|
|
|
120
120
|
|
|
121
121
|
write_active_pointer() {
|
|
122
122
|
mkdir -p ".workflow"
|
|
123
|
-
python3 - ".workflow/active_task.json" "$TASK_FOLDER" "$SOURCE" "$ID" "$TASK_DIR" "$BRANCH_NAME" <<'PY'
|
|
123
|
+
python3 - ".workflow/active_task.json" ".workflow/active.json" "$TASK_FOLDER" "$SOURCE" "$ID" "$TASK_DIR" "$WORK_MD" "$BRANCH_NAME" "$ISO_NOW" <<'PY'
|
|
124
124
|
import json
|
|
125
125
|
import sys
|
|
126
126
|
from pathlib import Path
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
active_task_path, active_workflow_path, active_task, source, raw_id, task_path, state_file, branch, now = sys.argv[1:]
|
|
129
|
+
legacy_data = {
|
|
130
130
|
"active_task": active_task,
|
|
131
131
|
"source": source,
|
|
132
132
|
"id": raw_id,
|
|
@@ -135,7 +135,22 @@ data = {
|
|
|
135
135
|
"path": task_path,
|
|
136
136
|
"branch": branch,
|
|
137
137
|
}
|
|
138
|
-
|
|
138
|
+
workflow_data = {
|
|
139
|
+
"workflow": "rpiv",
|
|
140
|
+
"id": active_task,
|
|
141
|
+
"taskId": active_task,
|
|
142
|
+
"source": source,
|
|
143
|
+
"sourceId": raw_id,
|
|
144
|
+
"stateFile": state_file,
|
|
145
|
+
"taskPath": task_path,
|
|
146
|
+
"path": task_path,
|
|
147
|
+
"branch": branch,
|
|
148
|
+
"startedAt": now,
|
|
149
|
+
"updatedAt": now,
|
|
150
|
+
"compatPointer": ".workflow/active_task.json",
|
|
151
|
+
}
|
|
152
|
+
Path(active_task_path).write_text(json.dumps(legacy_data, indent=2) + "\n")
|
|
153
|
+
Path(active_workflow_path).write_text(json.dumps(workflow_data, indent=2) + "\n")
|
|
139
154
|
PY
|
|
140
155
|
}
|
|
141
156
|
|
|
@@ -289,7 +289,7 @@ if [[ -n "$WORK_MD" && -f "$WORK_MD" ]]; then
|
|
|
289
289
|
fi
|
|
290
290
|
|
|
291
291
|
if [[ "$META_STATUS" =~ ^(done|archived)$ ]]; then
|
|
292
|
-
warn "active pointer references a task with status=$META_STATUS; consider
|
|
292
|
+
warn "active pointer references a task with status=$META_STATUS; consider post-merge-prune, archive handling, or reopening intentionally"
|
|
293
293
|
fi
|
|
294
294
|
|
|
295
295
|
echo
|
|
@@ -315,7 +315,7 @@ if [[ -n "$WORK_MD" && -f "$WORK_MD" ]]; then
|
|
|
315
315
|
fi
|
|
316
316
|
if [[ -n "$META_STATUS" && "$META_STATUS" =~ ^(done|archived)$ ]]; then
|
|
317
317
|
echo " - Choose intentionally: $TRIAGE_HELPER ${TASK_SOURCE:-local} ${TASK_ID:-task} reopen"
|
|
318
|
-
echo " - Or leave closed and run
|
|
318
|
+
echo " - Or leave closed and run post-merge-prune when appropriate."
|
|
319
319
|
fi
|
|
320
320
|
if [[ "$WARNINGS" -eq 0 && "$ERRORS" -eq 0 ]]; then
|
|
321
321
|
echo " - No fixes suggested."
|
package/sync/SKILL.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sync
|
|
3
|
+
workflow: rpiv
|
|
4
|
+
workflowPhase: sync
|
|
3
5
|
description: Synchronizes local RPIV task state (WORK.md) to external trackers (Jira, GitHub, GitLab). Use this to publish progress, update implementation status, and maintain a durable audit trail between local development and remote project management tools.
|
|
4
6
|
---
|
|
5
7
|
|
|
@@ -8,7 +10,7 @@ description: Synchronizes local RPIV task state (WORK.md) to external trackers (
|
|
|
8
10
|
Maintains consistency between local `.workflow` state and the remote source of truth using a single Pi-owned living status comment per task.
|
|
9
11
|
|
|
10
12
|
## Guardrails
|
|
11
|
-
- **Pre-flight**: Always read `.workflow/active_task.json` and the active `WORK.md` before executing.
|
|
13
|
+
- **Pre-flight**: Always read `.workflow/active.json` / `.workflow/active_task.json` and the active `WORK.md` before executing.
|
|
12
14
|
- **Privacy**: NEVER sync secrets, environment variables, or private notes not intended for stakeholders.
|
|
13
15
|
- **Integrity**: Do not modify `[BRIEF]` or `[GRILL]` sections.
|
|
14
16
|
- **Idempotency**: If the remote Pi status already reflects the current local state, do not post or update.
|
|
@@ -44,7 +46,7 @@ Do **not** use latest-comment ownership as the primary decision. Latest-comment-
|
|
|
44
46
|
## Workflow
|
|
45
47
|
|
|
46
48
|
### 1. Discovery & State Loading
|
|
47
|
-
- Identify the platform and ID from `.workflow/active_task.json`.
|
|
49
|
+
- Identify the platform and ID from `.workflow/active.json` or compatibility `.workflow/active_task.json`.
|
|
48
50
|
- Extract **Slices** from `[PLAN]`, **Status** from `[LOG]`, and **Artifacts** such as PR/MR links, commit hashes, and verification output.
|
|
49
51
|
|
|
50
52
|
### 2. Payload Preparation
|
|
@@ -128,4 +130,4 @@ Return a concise summary:
|
|
|
128
130
|
- **Action**: no-op / updated existing status / created new status
|
|
129
131
|
- **Reason**: marker found, body identical, marker missing, etc.
|
|
130
132
|
- **Link**: remote comment/note URL if available
|
|
131
|
-
- **Next step**: review, verify,
|
|
133
|
+
- **Next step**: review, verify, post-merge-prune, or continue implementation
|
package/triage/SKILL.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: triage
|
|
3
|
+
workflow: rpiv
|
|
4
|
+
workflowPhase: triage
|
|
3
5
|
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
6
|
---
|
|
5
7
|
|
|
@@ -8,10 +10,10 @@ description: "Ingest or resume a tracked/local task in the RPIV workspace. Use w
|
|
|
8
10
|
Start RPIV by creating, resuming, or explicitly reopening a task workspace.
|
|
9
11
|
|
|
10
12
|
## Guardrails
|
|
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
|
+
- READ: user argument, `.workflow/active.json` / `.workflow/active_task.json` if present, target `metadata.json`, and target `WORK.md` if resuming.
|
|
14
|
+
- WRITE: `.workflow/tasks/[source-id]/WORK.md`, `.workflow/tasks/[source-id]/metadata.json`, `.workflow/active.json`, `.workflow/active_task.json`; optional `.reposcry/` cache files only if RepoScry is installed.
|
|
13
15
|
- 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, and `[META]`, then append one concise `[LOG]` entry.
|
|
16
|
+
- On **resume**, only update `.workflow/active.json`, `.workflow/active_task.json`, metadata timestamps/state as needed, and `[META]`, then append one concise `[LOG]` entry.
|
|
15
17
|
- NEVER: duplicate guarded sections.
|
|
16
18
|
- NEVER: overwrite existing `[BRIEF]`, `[GRILL]`, or `[PLAN]` during triage.
|
|
17
19
|
- NEVER: create `PROBLEM.md`, `PRD.md`, `PLAN.md`, or `EVIDENCE.md`.
|
package/verify/SKILL.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: verify
|
|
3
|
-
|
|
3
|
+
workflow: rpiv
|
|
4
|
+
workflowPhase: verify
|
|
5
|
+
description: Verify the active slice or task against WORK.md, quality gates, and review readiness. Use after implementation or manual changes to decide whether work is ready for sync, review, or post-merge-prune.
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# Skill: verify
|
|
@@ -8,7 +10,7 @@ description: Verify the active slice or task against WORK.md, quality gates, and
|
|
|
8
10
|
The final gate for a slice or task. Verify truth before reporting progress.
|
|
9
11
|
|
|
10
12
|
## Guardrails
|
|
11
|
-
- READ: `.workflow/active_task.json`, active `WORK.md` `[BRIEF]`, `[PLAN]`, and `[LOG]`.
|
|
13
|
+
- READ: `.workflow/active.json` / `.workflow/active_task.json`, active `WORK.md` `[BRIEF]`, `[PLAN]`, and `[LOG]`.
|
|
12
14
|
- WRITE: `WORK.md` -> `[PLAN]` checkboxes and append to `[LOG]` only.
|
|
13
15
|
- NEVER: add `Signed-off-by`; tell the human to sign if needed.
|
|
14
16
|
- NEVER: transition tracker state if verification fails.
|
|
@@ -21,7 +23,7 @@ The final gate for a slice or task. Verify truth before reporting progress.
|
|
|
21
23
|
4. Check for AI artifacts: placeholder comments, fake APIs, dead code, inconsistent naming.
|
|
22
24
|
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
25
|
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
|
-
7. Recommend `/sync` for tracker update, or
|
|
26
|
+
7. Recommend `/sync` for tracker update, or `/post-merge-prune` if the task is fully merged and user approves.
|
|
25
27
|
|
|
26
28
|
## Output contract
|
|
27
29
|
End with:
|
package/cleanup/SKILL.md
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: cleanup
|
|
3
|
-
description: "DIRECT EXECUTION: Immediately prunes local branches and task folders. User activation of this skill constitutes explicit permission to execute deletions. Do not ask for confirmation or offer dry runs unless requested. Reconciles stale Git refs and workflow artifacts."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Skill: cleanup (Durable Repo Hygiene)
|
|
7
|
-
|
|
8
|
-
> [!IMPORTANT]
|
|
9
|
-
> **LLM INSTRUCTION**: This skill is a DIRECT ACTION tool. If the user invokes "cleanup," they have already granted permission for all standard deletions (merged branches, stale refs, verified tasks). DO NOT offer a menu of options. DO NOT ask "Dry run or Execute?". Proceed directly to Step 1.
|
|
10
|
-
|
|
11
|
-
A durable, idempotent utility to synchronize the local filesystem and Git state with the project's "Definition of Done," regardless of whether the RPIV workflow is used.
|
|
12
|
-
|
|
13
|
-
## Pre-conditions (Checkpoints)
|
|
14
|
-
- **Current Branch**: Should ideally be `main` or `master`.
|
|
15
|
-
- **Durable State Source**: `git branch` refs and (optionally) `.workflow/tasks/*/WORK.md`.
|
|
16
|
-
|
|
17
|
-
## Workflow (Durable Steps)
|
|
18
|
-
|
|
19
|
-
### Step 1: Remote Reconciliation
|
|
20
|
-
- `git remote update origin --prune`
|
|
21
|
-
- Identify branches deleted on remote.
|
|
22
|
-
|
|
23
|
-
### Step 2: Analysis (General & Workflow)
|
|
24
|
-
Iterate through all local branches and `.workflow/tasks/*` folders:
|
|
25
|
-
- **STALE BRANCHES**: Local branches merged into `main` (safe to delete) or whose remote is gone.
|
|
26
|
-
- **VERIFIED TASKS**: `.workflow/tasks/*` where `WORK.md` state is `MERGED` or `CLOSED`.
|
|
27
|
-
- **ORPHANS**: Local branches with no remote and no task folder, or task folders with no branch.
|
|
28
|
-
|
|
29
|
-
### Step 3: Atomic Execution
|
|
30
|
-
1. **Branch Pruning**:
|
|
31
|
-
- Use `git branch -d` for merged branches.
|
|
32
|
-
- **Smart Merge Check**: If `-d` fails, check `git log main..[branch]`. If empty, the branch was squash-merged; use `git branch -D` quietly.
|
|
33
|
-
2. **Artifact Cleanup**: If a `.workflow/tasks/` folder exists for a pruned branch, `rm -rf` it.
|
|
34
|
-
3. **Active Task Reset**: Clear `.workflow/active_task.json` if it points to a deleted task.
|
|
35
|
-
|
|
36
|
-
### Step 4: Durable Verification (Success Metrics)
|
|
37
|
-
- `git branch -a` must not contain deleted refs.
|
|
38
|
-
- `.workflow/tasks/` must not contain folders for deleted tasks.
|
|
39
|
-
|
|
40
|
-
## Guardrails & Recovery
|
|
41
|
-
- **RESOLUTION OVER REPORTING**: Do not stall the user with "Ambiguous" lists or menus. If a status is unclear, the agent must check merge status (`git branch --merged` or `git log main..branch`) immediately and resolve it.
|
|
42
|
-
- **NO DRY RUNS BY DEFAULT**: Proceed directly to execution unless a dry run is explicitly requested.
|
|
43
|
-
- **MANDATORY SMART DELETE**: If `git branch -d` fails, the agent MUST check if the diff is empty. If empty (squash-merged), use `git branch -D` quietly.
|
|
44
|
-
- **TRUST THE USER**: If the user says "all done" or "clean it all," skip all safety checks and force-delete everything.
|
|
45
|
-
- **Dirty Tree**: If the working tree is dirty, `git stash` before branch switching and `git stash pop` as the final act.
|
|
46
|
-
- **Unmerged Work**: If a branch has no remote and contains unique commits, the agent **MUST** ask ONCE: "Branch [name] contains unmerged commits and has no remote. Force delete? (y/N)".
|
|
47
|
-
|
|
48
|
-
## Output Contract
|
|
49
|
-
Return a concise "Durable State Report":
|
|
50
|
-
- **Cleaned**: List of (Task ID + Branch Name) successfully removed.
|
|
51
|
-
- **Skipped/Active**: List of tasks kept and why (e.g., "Contains unmerged commits").
|
|
52
|
-
- **Working Branch**: The branch left active (should be `main`).
|
|
53
|
-
- **Next step**: Ready for `/triage`.
|