@groupby/ai-dev 0.1.1 → 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.
Files changed (50) hide show
  1. package/README.md +9 -0
  2. package/dist/index.js +260 -21
  3. package/package.json +16 -11
  4. package/toolsets/rzlv-flow/README.md +57 -0
  5. package/toolsets/rzlv-flow/docs/mcp-setup.md +126 -0
  6. package/toolsets/rzlv-flow/resources/README.md +16 -0
  7. package/toolsets/rzlv-flow/resources/confluence-file-structure.md +179 -0
  8. package/toolsets/rzlv-flow/resources/confluence-page-templates/README.md +19 -0
  9. package/toolsets/rzlv-flow/resources/confluence-page-templates/decisions.md +36 -0
  10. package/toolsets/rzlv-flow/resources/confluence-page-templates/initiative-overview.md +40 -0
  11. package/toolsets/rzlv-flow/resources/confluence-page-templates/strategic-context.md +44 -0
  12. package/toolsets/rzlv-flow/resources/confluence-page-templates/technical-architecture.md +48 -0
  13. package/toolsets/rzlv-flow/resources/fcmp-protocol.md +331 -0
  14. package/toolsets/rzlv-flow/resources/jira-file-structure.md +177 -0
  15. package/toolsets/rzlv-flow/resources/sync-state-format.md +209 -0
  16. package/toolsets/rzlv-flow/skills/atlassian-orchestrator/SKILL.md +643 -0
  17. package/toolsets/rzlv-flow/skills/context-analyst/SKILL.md +265 -0
  18. package/toolsets/rzlv-flow/skills/jira-comment/SKILL.md +89 -0
  19. package/toolsets/rzlv-flow/skills/jira-daily-triage/SKILL.md +135 -0
  20. package/toolsets/rzlv-flow/skills/jira-sprint-status/SKILL.md +116 -0
  21. package/toolsets/rzlv-flow/skills/jira-status/SKILL.md +97 -0
  22. package/toolsets/rzlv-flow/skills/jira-sync/SKILL.md +148 -0
  23. package/toolsets/rzlv-flow/skills/jira-ticket-focus/SKILL.md +240 -0
  24. package/toolsets/rzlv-flow/skills/jira-ticket-trace/SKILL.md +112 -0
  25. package/toolsets/rzlv-flow/skills/jira-wrap-sync/SKILL.md +227 -0
  26. package/toolsets/toolsets/rzlv-flow/README.md +102 -0
  27. package/toolsets/toolsets/rzlv-flow/docs/getting-started.md +102 -0
  28. package/toolsets/toolsets/rzlv-flow/docs/mcp-setup.md +126 -0
  29. package/toolsets/toolsets/rzlv-flow/resources/README.md +16 -0
  30. package/toolsets/toolsets/rzlv-flow/resources/confluence-file-structure.md +285 -0
  31. package/toolsets/toolsets/rzlv-flow/resources/confluence-page-templates/README.md +19 -0
  32. package/toolsets/toolsets/rzlv-flow/resources/confluence-page-templates/decisions.md +36 -0
  33. package/toolsets/toolsets/rzlv-flow/resources/confluence-page-templates/initiative-overview.md +40 -0
  34. package/toolsets/toolsets/rzlv-flow/resources/confluence-page-templates/strategic-context.md +44 -0
  35. package/toolsets/toolsets/rzlv-flow/resources/confluence-page-templates/technical-architecture.md +48 -0
  36. package/toolsets/toolsets/rzlv-flow/resources/fcmp-protocol.md +331 -0
  37. package/toolsets/toolsets/rzlv-flow/resources/jira-file-structure.md +177 -0
  38. package/toolsets/toolsets/rzlv-flow/resources/sync-state-format.md +318 -0
  39. package/toolsets/toolsets/rzlv-flow/skills/atlassian-orchestrator/SKILL.md +643 -0
  40. package/toolsets/toolsets/rzlv-flow/skills/confluence-fetch/SKILL.md +189 -0
  41. package/toolsets/toolsets/rzlv-flow/skills/confluence-publish/SKILL.md +178 -0
  42. package/toolsets/toolsets/rzlv-flow/skills/context-analyst/SKILL.md +265 -0
  43. package/toolsets/toolsets/rzlv-flow/skills/jira-comment/SKILL.md +89 -0
  44. package/toolsets/toolsets/rzlv-flow/skills/jira-daily-triage/SKILL.md +143 -0
  45. package/toolsets/toolsets/rzlv-flow/skills/jira-sprint-status/SKILL.md +143 -0
  46. package/toolsets/toolsets/rzlv-flow/skills/jira-status/SKILL.md +97 -0
  47. package/toolsets/toolsets/rzlv-flow/skills/jira-sync/SKILL.md +148 -0
  48. package/toolsets/toolsets/rzlv-flow/skills/jira-ticket-focus/SKILL.md +245 -0
  49. package/toolsets/toolsets/rzlv-flow/skills/jira-ticket-trace/SKILL.md +112 -0
  50. package/toolsets/toolsets/rzlv-flow/skills/jira-wrap-sync/SKILL.md +260 -0
@@ -0,0 +1,245 @@
1
+ ---
2
+ name: jira-ticket-focus
3
+ description: Deep-load a Jira ticket with full context for focused work. Fetches ticket details, detects the parent epic, creates or navigates the local file structure, loads linked requirements, checks git branch status, and presents quick actions (branch creation, status transition, assignment). Use when you want to focus on a specific Jira ticket.
4
+ ---
5
+
6
+ Deep-load a single Jira ticket for focused development work. Fetches full ticket context via MCP, determines the correct local file location using epic detection and smart structure rules, sets up the developer workspace, checks git branch status, and presents actionable quick actions.
7
+
8
+ ## Requirements
9
+
10
+ Requires: Atlassian MCP (`atlassian-rovo`). See the rzlv-flow toolset README for setup.
11
+ Optional: Git CLI for branch detection and creation.
12
+
13
+ ## Resources to Load
14
+
15
+ Before executing, read these resource files — they are critical for correct behavior:
16
+
17
+ - `docs/ai/resources/fcmp-protocol.md` — follow for all Jira read/write operations
18
+ - `docs/ai/resources/jira-file-structure.md` — **critical** for file placement logic and ownership rules
19
+ - `docs/ai/resources/sync-state-format.md` — YAML frontmatter format for ticket files
20
+
21
+ ## Process
22
+
23
+ ### Step 1: Resolve Ticket Reference
24
+
25
+ - If the user provides a **number** (e.g. "3"), look it up from the `numbered_ticket_list` stored in conversational context from a prior `jira-daily-triage` run.
26
+ - If the user provides a **Jira key** (e.g. "PROJ-123"), use it directly.
27
+ - If the key is **incomplete** (e.g. "123"), prepend the `confirmed_project` key from session context (e.g. "PROJ-123").
28
+ - If neither a number mapping nor a project key is available, attempt fallback detection:
29
+ 1. **Git branch:** Check the current branch name for a `{PROJECT}-{n}` pattern (e.g. `feature/PROJ-123` → project is `PROJ`).
30
+ 2. **Config file:** Check for a `.jira.json` file in the project root containing `{ "project": "PROJ", "instance": "rezolve" }`.
31
+ 3. If neither yields a project key, ask the user for the full ticket key.
32
+
33
+ ### Step 2: Fetch Ticket Details (FCMP Fetch Step)
34
+
35
+ Use `mcp_atlassian-rovo_fetch()` to retrieve:
36
+
37
+ - Summary, description, acceptance criteria
38
+ - Comments and recent history
39
+ - Sprint information (use `active_sprint_name` from session context if available)
40
+ - Linked Confluence documents (if any)
41
+ - **Subtasks** — fetch all subtasks of the ticket via JQL: `parent = {TICKET-KEY} ORDER BY status ASC, priority DESC`
42
+ - **Linked issues** — fetch linked issues (blocks, is blocked by, relates to)
43
+
44
+ **Parent Epic detection** — check in this order:
45
+
46
+ 1. Check `fields.parent` — if `parent.fields.issuetype.name == "Epic"`, that is the epic.
47
+ 2. Check for an Epic Link custom field (varies by instance; commonly `customfield_10014` or similar).
48
+ 3. If no epic is found, the ticket is **orphaned**.
49
+
50
+ Store the epic key and summary for context display and file placement.
51
+
52
+ ### Step 3: Determine Ticket Location (Smart Structure Detection)
53
+
54
+ Determine where the ticket file lives (or should be created) in the local Jira file structure. Follow the rules from `jira-file-structure.md`:
55
+
56
+ ```
57
+ Base directory: docs/jira/{instance}/{project}/
58
+ ```
59
+
60
+ **If an epic parent was found:**
61
+
62
+ 1. Check if an epic folder already exists locally:
63
+ ```
64
+ {base}/*{EPIC-KEY}*/
65
+ ```
66
+ (Glob match — the folder may include a slug, e.g. `PROJ-100-user-authentication/`)
67
+
68
+ 2. If the epic folder **exists**, place the ticket at:
69
+ ```
70
+ {base}/{epic-folder}/stories/{TICKET-KEY}/{TICKET-KEY}.md
71
+ ```
72
+
73
+ 3. If the epic folder **does not exist**, create it:
74
+ ```
75
+ {base}/{EPIC-KEY}-{epic-summary-slug}/
76
+ {base}/{EPIC-KEY}-{epic-summary-slug}/stories/
77
+ ```
78
+ Then place the ticket at:
79
+ ```
80
+ {base}/{EPIC-KEY}-{epic-summary-slug}/stories/{TICKET-KEY}/{TICKET-KEY}.md
81
+ ```
82
+ Note in output: "Created new epic folder structure for {EPIC-KEY}"
83
+
84
+ **If no epic parent (orphan):**
85
+ ```
86
+ {base}/_orphans/{TICKET-KEY}/{TICKET-KEY}.md
87
+ ```
88
+
89
+ **If the parent is a Story or Task (i.e. ticket is a subtask):**
90
+ ```
91
+ {base}/.../{PARENT-KEY}/subtasks/{TICKET-KEY}/{TICKET-KEY}.md
92
+ ```
93
+
94
+ ### Step 4: Load Requirements Context
95
+
96
+ - **If an epic parent was detected:**
97
+ - Search for `epic.md` in the epic folder and load it for goals, scope, and technical approach.
98
+ - Check for a `_docs/` folder with generated documentation (architecture, decisions, strategic context).
99
+ - Check for linked Confluence documents in the epic or ticket metadata.
100
+ - If the epic folder was just created and `epic.md` doesn't exist, note that epic context is missing.
101
+
102
+ - **If no epic or epic folder was not found:**
103
+ - Search for any related documentation by keyword matching in the project's `_docs/` folders.
104
+ - Note the gap — the user may want to run `atlassian-orchestrator` to generate context.
105
+
106
+ ### Step 5: Prepare Local Environment
107
+
108
+ 1. **Create or update `{TICKET-KEY}.md`** with sync state frontmatter following the schema in `sync-state-format.md`:
109
+ - Populate all `sync` fields from the fetched Jira data.
110
+ - Set `structure.type` based on the issue type.
111
+ - Set `structure.parent` as a relative path to the parent file (if applicable).
112
+ - Set `structure.epic` to the epic key (if applicable).
113
+ - Set `agile_companion.last_focused` to the current timestamp.
114
+
115
+ 2. **Create `_work/` folder** in the ticket directory for developer notes (this folder is gitignored).
116
+
117
+ 3. **Store the fetched Jira state** locally so that future FCMP operations can compare against it.
118
+
119
+ ### Step 6: Check Git Branch Status
120
+
121
+ Run these git commands to detect branch state:
122
+
123
+ ```bash
124
+ # Current branch
125
+ git branch --show-current
126
+
127
+ # Local branches matching ticket key
128
+ git branch --list "*{TICKET-KEY}*"
129
+
130
+ # Remote branches matching ticket key
131
+ git branch -r --list "*{TICKET-KEY}*"
132
+ ```
133
+
134
+ Common branch naming patterns to check:
135
+ - `feature/{TICKET-KEY}`
136
+ - `feature/{TICKET-KEY}-*`
137
+ - `{TICKET-KEY}`
138
+ - `{TICKET-KEY}-*`
139
+
140
+ Determine which scenario applies:
141
+
142
+ | Scenario | Condition | Action |
143
+ |----------|-----------|--------|
144
+ | No branch exists | Local and remote checks both empty | Offer to create `feature/{TICKET-KEY}` |
145
+ | Local branch exists, not current | Found in local list, not current branch | Offer to switch |
146
+ | Remote branch exists, not local | Found in remote list, not in local | Offer to checkout |
147
+ | Already on correct branch | Current branch contains ticket key | Show checkmark, no action needed |
148
+
149
+ ### Step 7: Present Work Context
150
+
151
+ Display the full ticket details, acceptance criteria as a checklist, requirements from loaded context, and technical notes — all in a scannable format.
152
+
153
+ ### Step 8: Offer Quick Actions
154
+
155
+ Present numbered quick actions based on detected state:
156
+
157
+ - **Git branch actions** (from Step 6 — only the relevant scenario).
158
+ - **Assignment:** If the ticket is unassigned, offer to assign to the current user.
159
+ - **Status transition:** If the ticket status is "To Do" or "Open", offer to move to "In Progress".
160
+ - Always include a "Skip quick actions" option as the last number.
161
+
162
+ ## Output Format
163
+
164
+ ```
165
+ ## 🎯 Focus: {TICKET-KEY} — {Summary}
166
+
167
+ **Project:** {confirmed_project} | **Epic:** {Epic Key}: {Epic Summary} (or "No Epic (Orphaned)")
168
+ **Assignee:** {assignee or "Unassigned"} | **Status:** {status}
169
+ **Points:** {story_points} | **Priority:** {priority}
170
+ **Sprint:** {active_sprint_name}
171
+ **Current Branch:** {current_git_branch}
172
+ **Local Path:** {relative path to ticket file}
173
+
174
+ {IF epic folder was just created:}
175
+ ✨ Created new epic folder structure for {EPIC-KEY}
176
+
177
+ ### Acceptance Criteria
178
+ - [ ] {criterion 1}
179
+ - [ ] {criterion 2}
180
+ - [ ] {criterion 3}
181
+
182
+ ### Requirements Context
183
+ {Content from epic.md, _docs/, or linked Confluence pages.
184
+ If no context available: "No requirements context found. Consider running atlassian-orchestrator to generate epic documentation."}
185
+
186
+ ### Technical Notes
187
+ {From architecture docs, epic technical notes, or _docs/ folder.
188
+ If none: "No technical notes available."}
189
+
190
+ ### Recent Activity
191
+ - {commenter}: "{comment excerpt}" ({time ago})
192
+ - {commenter}: "{comment excerpt}" ({time ago})
193
+
194
+ ---
195
+ **Quick Actions:**
196
+
197
+ {Based on git branch detection scenario — show only the relevant one:}
198
+
199
+ {IF NO BRANCH EXISTS:}
200
+ 1. Create and switch to new branch: feature/{TICKET-KEY}
201
+
202
+ {IF LOCAL BRANCH EXISTS BUT NOT CURRENT:}
203
+ 1. Switch to existing branch: {branch_name}
204
+
205
+ {IF REMOTE BRANCH EXISTS BUT NOT LOCAL:}
206
+ 1. Checkout remote branch: {branch_name}
207
+
208
+ {IF ALREADY ON CORRECT BRANCH:}
209
+ ✓ Already on feature branch: {branch_name}
210
+
211
+ {Additional actions based on ticket state:}
212
+
213
+ {IF UNASSIGNED:}
214
+ {N}. Assign to me and move to "In Progress"
215
+
216
+ {IF ASSIGNED BUT STATUS IS "To Do"/"Open":}
217
+ {N}. Move to "In Progress"
218
+
219
+ {ALWAYS:}
220
+ {last}. Skip quick actions — start working as-is
221
+
222
+ Choose [1]:
223
+ ```
224
+
225
+ ## Quick Action Execution
226
+
227
+ When the user selects a numbered action:
228
+
229
+ - **Branch creation:** `git checkout -b feature/{TICKET-KEY}`
230
+ - **Branch switch:** `git checkout {branch_name}`
231
+ - **Remote checkout:** `git checkout -b {branch_name} origin/{branch_name}`
232
+ - **Assign to me:** Update the assignee field via MCP, following FCMP protocol. Fetch current state first, then update.
233
+ - **Status transition:** Fetch available transitions via `mcp_atlassian-rovo_fetch()` (or equivalent MCP call for transitions), then execute the transition. Follow FCMP protocol — fetch current state, confirm transition is valid, then push.
234
+
235
+ After executing any action, confirm what was done and re-display the relevant updated field.
236
+
237
+ ## Session Context
238
+
239
+ After running, update conversational context with:
240
+
241
+ - **focused_ticket** — The Jira ticket key currently being worked on
242
+ - **focused_ticket_path** — The local file path for the ticket
243
+ - **working_branch** — The git branch being used (after any branch action)
244
+
245
+ The user may say "wrap" after completing work, which invokes the `jira-wrap-sync` skill using this context.
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: jira-ticket-trace
3
+ description: Trace code back to its Jira requirements. Uses git blame to find the commit, extracts the ticket reference, fetches the ticket and its epic context, and presents the full "why" chain (business context, technical decisions, original requirements). Use when you need to understand why code exists or trace a feature to its origin.
4
+ ---
5
+
6
+ Context recovery — trace code back to its Jira requirements. Performs git archaeology to find the originating commit and ticket key, then fetches the full context chain from Jira (ticket, epic, linked docs) to explain *why* the code exists.
7
+
8
+ ## Requirements
9
+
10
+ Requires: Atlassian MCP (`atlassian-rovo`). See the rzlv-flow toolset README for setup.
11
+ Also uses: Git CLI (`git blame`, `git log`).
12
+
13
+ ## Resources to Load
14
+
15
+ Before executing, read this resource file:
16
+
17
+ - `docs/ai/resources/fcmp-protocol.md` — follow read protocols for Jira fetch operations
18
+
19
+ ## Process
20
+
21
+ ### Step 1: Identify Target
22
+
23
+ Determine what code the user wants to trace. Accept any of:
24
+
25
+ - A **selected code block** in the editor
26
+ - A **file and line reference** (e.g. `src/auth.ts:42`)
27
+ - A **feature or function name** (e.g. "the rate limiting logic")
28
+
29
+ If the user provides a feature description rather than a specific location, search the codebase to find the relevant file(s) and line(s) first.
30
+
31
+ ### Step 2: Git Archaeology
32
+
33
+ Trace the code to its originating commit:
34
+
35
+ 1. Run `git blame -L {start},{end} {file}` to find the commit(s) that introduced the target code.
36
+ 2. For the most relevant commit, extract:
37
+ - Commit hash, author, date
38
+ - Full commit message: `git log -1 --format="%B" {hash}`
39
+ 3. Look for a Jira ticket key in the commit message (pattern: `[A-Z]+-\d+`).
40
+ 4. If no ticket key in the commit message, check:
41
+ - The PR/MR associated with the commit: `git log -1 --format="%s" {hash}` may reference a PR number
42
+ - The branch name at the time of merge (often contains ticket keys)
43
+ - Adjacent commits for context
44
+ 5. If still no ticket key found, report to the user and offer to search Jira by keyword.
45
+
46
+ ### Step 3: Trace to Jira
47
+
48
+ Once a ticket key is found:
49
+
50
+ 1. **Fetch ticket details** via `mcp_atlassian-rovo_fetch()` — summary, description, status, acceptance criteria.
51
+ 2. **Get the parent epic** — use the same epic detection logic as `jira-ticket-focus`:
52
+ - Check `fields.parent` for an epic type
53
+ - Check for Epic Link custom field
54
+ 3. **Get linked initiative** (if the epic has a parent or linked initiative).
55
+ 4. **Check for linked Confluence docs** in the ticket or epic metadata.
56
+
57
+ ### Step 4: Load Context Chain
58
+
59
+ Build the full "why" chain by loading available context:
60
+
61
+ - **Original requirements** — from the ticket description, acceptance criteria, and any linked Confluence requirement pages.
62
+ - **Decision logs** — from `_docs/decisions.md` in the epic folder if it exists locally.
63
+ - **Assumptions** — from technical notes in the ticket or epic documentation.
64
+ - **Strategic context** — from `_docs/strategic-context.md` if available.
65
+
66
+ If local `_docs/` folders don't exist, note what's available from Jira/Confluence only.
67
+
68
+ ### Step 5: Present the "Why"
69
+
70
+ Assemble and present the full trace from code to business context.
71
+
72
+ ## Output Format
73
+
74
+ ```
75
+ ## 🔍 Why: {code reference}
76
+
77
+ ### Git Trail
78
+ - **Commit:** {hash} by {author} on {date}
79
+ - **Message:** "{commit message}"
80
+ - **Ticket:** {TICKET-KEY}
81
+ {IF PR FOUND:}
82
+ - **PR:** #{pr_number} — {pr_title}
83
+
84
+ ### Business Context
85
+ {From epic or initiative context — the high-level "why" this feature exists.
86
+ If no epic context: "No epic context available for this ticket."}
87
+
88
+ ### Technical Decision
89
+ {From decision logs or technical notes — why this approach was chosen over alternatives.
90
+ If none available: "No decision log found."}
91
+
92
+ ### Original Requirement
93
+ > "{Quote from the ticket description or acceptance criteria that drove this code}"
94
+ — {TICKET-KEY}: {ticket summary}
95
+
96
+ {IF CONFLUENCE DOCS LINKED:}
97
+ ### Related Documentation
98
+ - {Confluence page title}: {url}
99
+
100
+ ### Key Assumptions
101
+ - {Assumption that drove this implementation choice}
102
+ - {Constraint that shaped the approach}
103
+
104
+ ---
105
+ Need more context? I can load the full epic documentation or search for related tickets.
106
+ ```
107
+
108
+ ## Edge Cases
109
+
110
+ - **No ticket key found in git history:** Report the commit details and offer to search Jira by keywords from the commit message or code context.
111
+ - **Ticket deleted or inaccessible:** Report the ticket key and note that it may have been moved, deleted, or is in a project you don't have access to.
112
+ - **Multiple commits / multiple tickets:** If git blame shows multiple commits for the target code, trace the most significant one (largest change) and note the others.
@@ -0,0 +1,260 @@
1
+ ---
2
+ name: jira-wrap-sync
3
+ description: Wrap up your current work on a Jira ticket. Analyzes local ticket changes and code changes (git diff), drafts a comprehensive Jira comment, runs FCMP sync, and presents multi-select actions (sync fields, add comment, transition status, create PR, update Confluence). Use when you're done working on a ticket or want to sync progress.
4
+ ---
5
+
6
+ Wrap up work on the currently focused Jira ticket. Detects what changed (ticket fields and code), drafts a Jira comment summarizing progress, runs the FCMP protocol before syncing, and presents a multi-select action menu so you can sync fields, comment, transition status, and create a PR in one pass.
7
+
8
+ ## Requirements
9
+
10
+ Requires: Atlassian MCP (`atlassian-rovo`). See the rzlv-flow toolset README for setup.
11
+ Optional: GitHub MCP for Pull Request creation (action 4).
12
+
13
+ ## Resources to Load
14
+
15
+ Before executing, read these resource files:
16
+
17
+ - `docs/ai/resources/fcmp-protocol.md` — **critical** for the sync protocol before any Jira writes
18
+ - `docs/ai/resources/sync-state-format.md` — YAML frontmatter schema for reading/updating ticket files
19
+
20
+ ## Process
21
+
22
+ ### Step 1: Identify the Ticket
23
+
24
+ - Use `focused_ticket` from conversation context (set by `jira-ticket-focus`).
25
+ - If not available, ask the user for the ticket key.
26
+ - Locate the local ticket file at the path stored in `focused_ticket_path`, or find it using the `jira-file-structure.md` rules.
27
+
28
+ ### Step 2: Analyze All Changes
29
+
30
+ **a) Local ticket file changes:**
31
+ - Read the current `{TICKET-KEY}.md` file.
32
+ - Compare the content against the last synced state stored in the `sync` frontmatter fields.
33
+ - Detect changes to: description, story points, acceptance criteria, labels, priority.
34
+ - Note which fields were modified locally.
35
+
36
+ **b) Code changes:**
37
+ - Run `git diff --stat` for an overview of changes.
38
+ - Run `git diff` (or `git diff --staged` if changes are staged) for details.
39
+ - Check recent commits on the working branch: `git log --oneline -10`.
40
+ - Map code changes to acceptance criteria where possible.
41
+ - Summarize: files changed, insertions, deletions.
42
+
43
+ **c) Acceptance criteria progress:**
44
+ - Read the AC list from the ticket file.
45
+ - Based on code changes and commit messages, infer which AC items have been completed.
46
+ - Show checkbox progress:
47
+ ```
48
+ - [x] AC 1 — Completed (matches changes in auth-controller.ts)
49
+ - [x] AC 2 — Completed (matches changes in rate-limiter.ts)
50
+ - [ ] AC 3 — Not yet addressed
51
+ ```
52
+ - Note: this is a best-effort inference. The user confirms the final state.
53
+
54
+ ### Step 3: Draft Jira Comment
55
+
56
+ Build a comprehensive comment with the standardized prefix `[rzlv-flow Update]`:
57
+
58
+ ```
59
+ [rzlv-flow Update]
60
+
61
+ {IF TICKET FIELD CHANGES:}
62
+ **Ticket Updates:**
63
+ - {field change 1}
64
+ - {field change 2}
65
+
66
+ {IF CODE CHANGES:}
67
+ **Implementation Progress:**
68
+ - {code change summary line 1}
69
+ - {code change summary line 2}
70
+
71
+ **Files Modified:**
72
+ - {file1}: {brief description}
73
+ - {file2}: {brief description}
74
+
75
+ **Acceptance Criteria:**
76
+ - [x] {completed AC 1}
77
+ - [x] {completed AC 2}
78
+ - [ ] {remaining AC 3}
79
+ **Progress:** {X}/{Y} completed
80
+
81
+ **Next Steps:** {suggested next action}
82
+
83
+ Context: {optional PR link or Confluence doc link}
84
+ ```
85
+
86
+ ### Step 4: FCMP Preview (Prepare PUSH — Dry Run)
87
+
88
+ Before executing any write operations, run the full FCMP cycle and present a dry-run preview:
89
+
90
+ 1. **FETCH** — Get the current ticket state from Jira via MCP.
91
+ 2. **COMPARE** — Check for remote changes since last sync (compare `sync.version` and `sync.remote_updated`).
92
+ 3. **MERGE** — If conflicts detected, show a diff of remote changes vs local changes and resolve with the user.
93
+ 4. **Preview** — Show a dry-run diff of what will change if the user proceeds:
94
+
95
+ ```
96
+ ### FCMP Preview (Dry Run)
97
+ {IF NO REMOTE CHANGES:}
98
+ ✓ Remote is unchanged since last sync — safe to push.
99
+
100
+ {IF REMOTE CHANGES DETECTED:}
101
+ ⚠️ Remote changes detected since last sync:
102
+ - {field}: {old_value} → {new_value}
103
+
104
+ **Proposed local → remote changes:**
105
+ - Description: {diff summary}
106
+ - Story Points: {old} → {new}
107
+ - Status: {current} (no change)
108
+
109
+ Proceed with sync? (y/n)
110
+ ```
111
+
112
+ Only proceed to the action menu after the FCMP preview is confirmed.
113
+
114
+ ### Step 5: Present Multi-Select Action Menu
115
+
116
+ Present all detected changes, the draft comment, and a multi-select numbered menu. The user picks multiple actions via comma-separated numbers.
117
+
118
+ ```
119
+ ### Available Actions (Multi-Select)
120
+
121
+ {IF TICKET FIELD CHANGES DETECTED:}
122
+ 1. Sync ticket fields to Jira (description, points, AC)
123
+
124
+ {IF CODE CHANGES OR TICKET CHANGES:}
125
+ 2. Add comment to Jira (with the draft summary above)
126
+
127
+ 3. Transition status (you'll specify the target status)
128
+
129
+ {IF CODE CHANGES AND COMMITS EXIST:}
130
+ 4. Create Pull Request (via GitHub MCP)
131
+
132
+ {IF SIGNIFICANT CHANGES:}
133
+ 5. Update Confluence technical docs
134
+
135
+ 6. Cancel (do nothing)
136
+
137
+ **Choose actions (comma-separated):** [1,2,3,4]
138
+
139
+ Examples:
140
+ - "1,2,3,4" = Sync ticket + comment + transition + create PR
141
+ - "2,3" = Comment + transition only
142
+ - "6" = Cancel all actions
143
+ ```
144
+
145
+ ### Step 6: Execute Selected Actions
146
+
147
+ Parse the comma-separated input. Execute each selected action in order:
148
+
149
+ **Action 1 — Sync ticket fields:**
150
+ - Update description, story points, AC, and any other changed fields via MCP.
151
+ - Include the `version` field for optimistic locking per FCMP.
152
+ - On 409 conflict, re-run FCMP from Fetch.
153
+
154
+ **Action 2 — Add comment:**
155
+ - Push the draft comment via MCP.
156
+ - For detailed comment procedures, see the `jira-comment` skill.
157
+
158
+ **Action 3 — Transition status:**
159
+ - Fetch available transitions via MCP.
160
+ - Present as a numbered list for the user to select target status.
161
+ - Execute the transition via MCP.
162
+ - For detailed transition procedures, see the `jira-status` skill.
163
+
164
+ **Action 4 — Create Pull Request (via GitHub MCP):**
165
+ 1. Check for unpushed commits: `git log origin/{branch}..HEAD`
166
+ 2. If unpushed commits exist, ask: "Push commits first? (y/n)"
167
+ 3. If yes: `git push origin {branch}`
168
+ 4. Detect base branch (check git config or default to `main`).
169
+ 5. Build PR details:
170
+ - **Title:** `{TICKET-KEY}: {ticket summary}`
171
+ - **Body:**
172
+ ```
173
+ ## {TICKET-KEY}: {Ticket Summary}
174
+
175
+ **Jira:** https://{instance}/browse/{TICKET-KEY}
176
+ {IF CONFLUENCE DOCS:}
177
+ **Confluence:** {confluence_link}
178
+
179
+ ### Changes
180
+ {ticket updates + code changes from the draft comment}
181
+
182
+ ### Acceptance Criteria
183
+ - [x] {completed criterion}
184
+ - [ ] {remaining criterion}
185
+
186
+ ### Testing Notes
187
+ {Any notes from _work/ folder if they exist}
188
+ ```
189
+ 6. Create PR via GitHub MCP: `create_pull_request()`
190
+ 7. Return and display the PR URL.
191
+
192
+ **Action 5 — Update Confluence:**
193
+ - Prompt the user for what to update and where.
194
+ - Follow FCMP protocol for the Confluence update.
195
+
196
+ **Action 6 — Cancel:**
197
+ - Exit without performing any actions. Ignore all other selections if "6" is included.
198
+
199
+ ### Step 7: Post-Execution
200
+
201
+ After all selected MCP operations:
202
+
203
+ 1. **FETCH** the final ticket state from Jira.
204
+ 2. Update the local `{TICKET-KEY}.md` with the new sync state (version, last_synced, status).
205
+ 3. Confirm what was completed:
206
+ - List each action and its result.
207
+ - If a PR was created, display the PR URL.
208
+ - Suggest a next action if remaining work exists.
209
+
210
+ ### Error Handling
211
+
212
+ - If any MCP operation fails, report which step failed and continue with remaining operations.
213
+ - If the GitHub MCP is not configured, skip PR creation with a warning: "GitHub MCP not configured. Skipping PR creation."
214
+ - On optimistic locking conflicts (409), re-run FCMP from Fetch and retry.
215
+
216
+ ## Output Format
217
+
218
+ ```
219
+ ## 🎬 Wrap Up: {TICKET-KEY}
220
+
221
+ ### Local Ticket Changes Detected
222
+ {IF FIELD CHANGES:}
223
+ - **Description:** {change summary or "No changes"}
224
+ - **Story Points:** {old} → {new} (or "No change")
225
+ - **Acceptance Criteria:** {added/removed items} (or "No changes")
226
+
227
+ {IF NO CHANGES:}
228
+ _(No local ticket changes detected)_
229
+
230
+ ### Code Changes Detected
231
+ {IF GIT DIFF:}
232
+ {n} files changed, {lines added} insertions(+), {lines deleted} deletions(-)
233
+
234
+ Modified files:
235
+ - {file1}
236
+ - {file2}
237
+
238
+ {IF NO CHANGES:}
239
+ _(No code changes detected)_
240
+
241
+ ### Acceptance Criteria Status
242
+ - [x] {Completed criterion}
243
+ - [ ] {Remaining criterion}
244
+
245
+ **Progress:** {X}/{Y} completed
246
+
247
+ ### Draft Comment for Jira
248
+ {The full draft comment from Step 3}
249
+
250
+ ---
251
+
252
+ ### Available Actions (Multi-Select)
253
+ {Numbered action list from Step 5}
254
+ ```
255
+
256
+ ## Session Context
257
+
258
+ After running, update conversational context:
259
+ - **last_wrap_actions** — Which actions were executed
260
+ - **pr_url** — The PR URL if one was created