@raquezha/norpiv 0.1.0 → 0.2.1
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/package.json +1 -1
- package/sync/SKILL.md +89 -85
package/package.json
CHANGED
package/sync/SKILL.md
CHANGED
|
@@ -7,19 +7,24 @@ description: Synchronizes local RPIV task state (WORK.md) to external trackers (
|
|
|
7
7
|
|
|
8
8
|
# Skill: sync
|
|
9
9
|
|
|
10
|
-
Maintains consistency between local `.workflow` state and
|
|
10
|
+
Maintains consistency between local `.workflow` state and external remote trackers (Jira, GitHub, GitLab) across primary tasks and all related items (parents, sub-issues, mentioned items, linked PRs/MRs).
|
|
11
11
|
|
|
12
12
|
## Guardrails
|
|
13
13
|
- **Pre-flight**: Always read `.workflow/active.json` first, then compatibility `.workflow/active_task.json` only if needed, and the active `WORK.md` before executing.
|
|
14
|
+
- **Context-First Verification (100% Certainty Rule)**: Read the primary issue and trace all related issues (parents, sub-issues, mentioned issues `#123`, linked PRs/MRs) BEFORE executing remote mutations. Gather full context first and only update descriptions, tick checkboxes, or change issue statuses when 100% certain based on verified code and test evidence.
|
|
15
|
+
- **Universal Multi-Issue Sync**: Regardless of platform (Jira, GitHub, GitLab), evaluate and update all related items in the task tree:
|
|
16
|
+
- **Primary Child Item**: Update description checkboxes (`- [x]`), post/update living status comment (`<!-- pi-sync-marker -->`), and close/transition to Done/Closed when work and acceptance criteria are complete.
|
|
17
|
+
- **Parent / Track Item**: Update parent track descriptions to tick off child issue progress (e.g. `- [x] #174 ...`) and parent acceptance criteria. Keep umbrella parent issues open for high-level tracking unless all child items are complete.
|
|
18
|
+
- **Mentioned / Linked Items**: Inspect mentioned or linked items (`Refs #123`, `Fixes #123`, sub-tasks) and update their checkboxes and status when verified.
|
|
14
19
|
- **Privacy**: NEVER sync secrets, environment variables, or private notes not intended for stakeholders.
|
|
15
|
-
- **Integrity**: Do not modify `[BRIEF]` or `[GRILL]` sections.
|
|
16
|
-
- **Idempotency**: If
|
|
17
|
-
- **Human
|
|
18
|
-
- **
|
|
19
|
-
- **Shell
|
|
20
|
+
- **Integrity**: Do not modify `[BRIEF]` or `[GRILL]` sections in local `WORK.md`.
|
|
21
|
+
- **Idempotency**: If remote descriptions, statuses, and Pi status comments already reflect current local state, do not post duplicate comments or redundant updates.
|
|
22
|
+
- **Human Safety**: NEVER edit human-authored comments. Only update status comments containing `<!-- pi-sync-marker -->`.
|
|
23
|
+
- **Hyperlinks**: Format issue references (e.g. `[#140](https://github.com/owner/repo/issues/140)`), file paths, git branches, commit hashes (`[\`35bd81b\`](url)`), and PR/MR links as explicit Markdown hyperlinks in sync comments whenever applicable.
|
|
24
|
+
- **Shell Safety**: Never pass markdown bodies inline through shell strings. Write bodies to files and use `--body-file` or JSON `--input` API calls so backticks and `$()` cannot execute.
|
|
20
25
|
|
|
21
26
|
## Living status marker
|
|
22
|
-
Every sync
|
|
27
|
+
Every sync status comment MUST include this marker at the end:
|
|
23
28
|
|
|
24
29
|
```md
|
|
25
30
|
<!-- pi-sync-marker -->
|
|
@@ -47,96 +52,95 @@ Do **not** use latest-comment ownership as the primary decision. Latest-comment-
|
|
|
47
52
|
|
|
48
53
|
## Workflow
|
|
49
54
|
|
|
50
|
-
### 1.
|
|
51
|
-
- Identify
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
gh issue view <id> --json parent,subIssues
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
### 2.
|
|
60
|
-
|
|
61
|
-
- **
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
55
|
+
### 1. Context Gathering & Traversal (Read-First Protocol)
|
|
56
|
+
- Identify primary task platform and ID from `.workflow/active.json` / `WORK.md`.
|
|
57
|
+
- **Fetch Primary Item**: Read primary issue details (title, body, state, acceptance criteria, labels).
|
|
58
|
+
- **Trace Related Graph**:
|
|
59
|
+
- **GitHub**: Fetch parent issue (`gh issue view <id> --json parent,subIssues`), mentioned issues in `WORK.md` intake/brief (e.g. `Parent track: #166`, `Refs #174`), and linked PRs (`gh issue view <id> --json closingPRs`).
|
|
60
|
+
- **Jira**: Fetch parent epic, sub-tasks, linked issues, and issue links (`jira issue view <id>`).
|
|
61
|
+
- **GitLab**: Fetch parent epic, child issues, related merge requests (`glab issue view <id>`).
|
|
62
|
+
- **Verify Evidence**: Confirm test runs, commit hashes, merged PRs/MRs, and acceptance criteria in `WORK.md`.
|
|
63
|
+
|
|
64
|
+
### 2. Multi-Item Update Strategy (100% Certainty Check)
|
|
65
|
+
Only proceed with remote mutations after confirming complete context:
|
|
66
|
+
- **Descriptions & Checkboxes**:
|
|
67
|
+
- Update primary issue body to tick completed acceptance criteria (`- [x]`).
|
|
68
|
+
- Update parent track body to tick completed child track items (`- [x] #174 ...`).
|
|
69
|
+
- Use JSON payload `--input` or `--body-file` to safely update issue descriptions without escaping errors.
|
|
70
|
+
- **Status & Transitions**:
|
|
71
|
+
- Close/transition executable child items to `Closed` / `Done` after PR merge and acceptance criteria verification.
|
|
72
|
+
- Preserve umbrella parent issues as `Open` until all child items in the track are complete.
|
|
73
|
+
- **Living Status Comment**:
|
|
74
|
+
- Prepare and publish/update the living status comment with `<!-- pi-sync-marker -->` on the primary task item (and parent item if requested).
|
|
75
|
+
|
|
76
|
+
### 3. Execution Helpers by Platform
|
|
66
77
|
|
|
67
78
|
#### Jira
|
|
68
|
-
Use the
|
|
79
|
+
Use the centralized smart sync helper for status comments:
|
|
69
80
|
|
|
70
81
|
```bash
|
|
71
82
|
cat body.md | <skill_location>/jira_smart_sync.sh <ISSUE_ID>
|
|
72
83
|
```
|
|
73
84
|
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
- find newest marker comment anywhere in the fetched window
|
|
78
|
-
- update marker comment by ID, no-op if identical, create only if no marker exists
|
|
85
|
+
For issue description/checkbox and status updates:
|
|
86
|
+
- Update description: use `acli` or Jira REST API with JSON body payload.
|
|
87
|
+
- Transition status: `acli transitionIssue --issue <ID> --step "Done"` or API transition.
|
|
79
88
|
|
|
80
89
|
#### GitHub Issues / PRs
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
--
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
-
|
|
90
|
+
- **Fetch Related Context**:
|
|
91
|
+
```bash
|
|
92
|
+
gh issue view <id> --json parent,subIssues,body,state
|
|
93
|
+
```
|
|
94
|
+
- **Update Description (Checkboxes)**:
|
|
95
|
+
```bash
|
|
96
|
+
jq -n --rawfile body updated_issue_body.md '{body: $body}' > update_payload.json
|
|
97
|
+
gh api -X PATCH repos/:owner/:repo/issues/<id> --input update_payload.json
|
|
98
|
+
```
|
|
99
|
+
- **Update Status Comment**:
|
|
100
|
+
Check:
|
|
101
|
+
```bash
|
|
102
|
+
gh api repos/:owner/:repo/issues/<id>/comments --paginate \
|
|
103
|
+
--jq 'map(select(.body | contains("<!-- pi-sync-marker -->"))) | last'
|
|
104
|
+
```
|
|
105
|
+
Update existing comment:
|
|
106
|
+
```bash
|
|
107
|
+
jq -n --rawfile body comment_body.md '{body: $body}' > comment_payload.json
|
|
108
|
+
gh api -X PATCH repos/:owner/:repo/issues/comments/<comment_id> --input comment_payload.json
|
|
109
|
+
```
|
|
110
|
+
Create comment if missing:
|
|
111
|
+
```bash
|
|
112
|
+
gh issue comment <id> --body-file comment_body.md
|
|
113
|
+
```
|
|
114
|
+
- **Close Executable Child Issue**:
|
|
115
|
+
```bash
|
|
116
|
+
gh issue close <id> --comment "Completed and verified in PR #<pr_number>."
|
|
117
|
+
```
|
|
106
118
|
|
|
107
119
|
#### GitLab Issues / MRs
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
-f body=@
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
Create MR note:
|
|
123
|
-
```bash
|
|
124
|
-
glab mr note <iid> --message "$(cat body.md)"
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
Rules:
|
|
128
|
-
- update only a note containing the marker
|
|
129
|
-
- no-op when normalized body is already current
|
|
130
|
-
- create only when no marker note exists
|
|
120
|
+
- **Fetch Context**:
|
|
121
|
+
```bash
|
|
122
|
+
glab issue view <id>
|
|
123
|
+
```
|
|
124
|
+
- **Update Description & Status**:
|
|
125
|
+
```bash
|
|
126
|
+
glab issue update <id> --description "$(cat updated_body.md)"
|
|
127
|
+
glab issue close <id>
|
|
128
|
+
```
|
|
129
|
+
- **Update Status Note**:
|
|
130
|
+
```bash
|
|
131
|
+
glab api -X PUT projects/:id/issues/<id>/notes/<note_id> -f body=@comment_body.md
|
|
132
|
+
```
|
|
131
133
|
|
|
132
|
-
### 4. Local Confirmation
|
|
133
|
-
- Append a timestamped sync
|
|
134
|
-
-
|
|
134
|
+
### 4. Local Confirmation & Logging
|
|
135
|
+
- Append a timestamped sync entry to `WORK.md` `[LOG]` recording:
|
|
136
|
+
- Primary target updated (description checkboxes, status comment, closed/transitioned).
|
|
137
|
+
- Related items updated (parent track checkboxes, sub-issue statuses).
|
|
138
|
+
- Explicit URLs for status comments and PRs/MRs.
|
|
139
|
+
- Preserve guarded `[BRIEF]` and `[GRILL]` sections untouched.
|
|
135
140
|
|
|
136
141
|
## Output Contract
|
|
137
142
|
Return a concise summary:
|
|
138
|
-
- **Target**: platform and issue
|
|
139
|
-
- **
|
|
140
|
-
- **
|
|
141
|
-
- **
|
|
142
|
-
- **Next step**: review, verify, post-merge-prune, or continue implementation
|
|
143
|
+
- **Primary Target**: platform and issue ID, status transition (e.g. `Closed`), description checkboxes updated.
|
|
144
|
+
- **Related Items Updated**: list of parent tracks (`#166`), sub-issues, or mentioned issues updated (`- [x] #174`).
|
|
145
|
+
- **Living Status Comment**: `no-op` / `updated` / `created` with remote comment URL.
|
|
146
|
+
- **Next Step**: review, post-merge-prune, or proceed to next RPIV task.
|