@groupby/ai-dev 0.5.4 → 0.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@groupby/ai-dev",
3
- "version": "0.5.4",
3
+ "version": "0.5.7",
4
4
  "description": "Interactive installer for Rezolve Ai development content",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,22 @@
1
+ # Jira Ticket Creator
2
+
3
+ Creates well-structured Jira epics, stories, and sub-tasks from product and
4
+ technical specifications using the Atlassian MCP connector.
5
+
6
+ ## What it does
7
+ - Reads product and/or technical specs from Confluence
8
+ - Plans Epics → Stories → Sub-tasks hierarchy
9
+ - Previews all ticket content for approval before creating anything in Jira
10
+ - Creates tickets with correct parent relationships and team assignments
11
+
12
+ ## Prerequisites
13
+ - Atlassian MCP connector connected
14
+ - Write access to the target Jira project
15
+
16
+ ## Trigger phrases
17
+ - "Create Jira tickets from this spec"
18
+ - "Break this PRD into epics and stories"
19
+ - "Generate Jira tickets from this Confluence page"
20
+
21
+ ## Team
22
+ OOF
@@ -0,0 +1,266 @@
1
+ ---
2
+ name: jira-ticket-creator
3
+ description: Create Jira epics, stories and sub-tasks from product and technical specifications. Use this skill whenever a user asks to create epics, stories, sub-tasks, or tickets in Jira from a spec, PRD, product specification, technical specification, or Confluence page. Also trigger when a user says things like "break this spec into epics", "create Jira tickets from this document", "plan this initiative into stories", "generate epics for this project", or any request involving turning requirements or specifications into structured Jira work items. Requires the Atlassian MCP connector.
4
+ ---
5
+
6
+ # Jira Ticket Creator
7
+
8
+ Creates well-structured Jira epics, stories and sub-tasks from product and technical specifications, using the Atlassian MCP connector.
9
+
10
+ ## Prerequisites
11
+
12
+ - **Atlassian MCP connector** must be connected. If not connected, prompt the user to connect it before proceeding.
13
+ - The user must have write access to the target Jira project.
14
+
15
+ ---
16
+
17
+ ## Configuration Parameters
18
+
19
+ Collect ALL mandatory parameters before creating any tickets. Present them clearly and confirm with the user before proceeding.
20
+
21
+ ### Mandatory Parameters
22
+
23
+ | Parameter | Description | Validation |
24
+ |---|---|---|
25
+ | **Jira Team** | The Jira team to assign to ALL tickets. The user MUST choose one of the two fixed options below. | Required. Present as a two-choice selection. Do not advance until the user selects a team. |
26
+ | **Parent** | The Jira initiative key that all epics will be children of (e.g. `BD-7711`). | Required. Must be a valid Jira issue key. Do not advance until provided. |
27
+ | **Product Specification** | A Confluence page URL containing the product spec / PRD. | Required. Must be a valid Confluence URL. Do not advance until provided. |
28
+
29
+ **Jira Team options** (offer these two as selectable choices — do NOT ask the user to type a free-text team name):
30
+
31
+ | Team name | Team ID (`customfield_10700` value) |
32
+ |---|---|
33
+ | **OOF Mobile Solution Team** | `b3f517d4-c4f8-4144-8920-b762ec5a033b` |
34
+ | **OOF Application Solution Team** | `9817d9ca-6170-48e8-9e98-1aeb7c81daa5` |
35
+
36
+ ### Optional Parameters
37
+
38
+ | Parameter | Description | Default |
39
+ |---|---|---|
40
+ | **Technical Specification** | A Confluence page URL containing the technical spec. | None — if not supplied, generate tickets from the product spec only. |
41
+ | **Epic Number** | Maximum number of epics to produce. | LLM decides based on the scope of the specification. |
42
+ | **Ticket Style** | A URL pointing to a Confluence page with guidelines for how to write/format tickets. Always offer the user the choice to accept the default page or enter a new URL. | `https://rezolvetech.atlassian.net/wiki/spaces/CPST/pages/5303500826/Definition+of+user+story+acceptance+criteria` |
43
+ | **Sub Tasks** | Whether to create sub-tasks under each story. `yes` or `no`. | `no` — do not create sub-tasks unless explicitly set to `yes`. |
44
+
45
+ ---
46
+
47
+ ## Workflow
48
+
49
+ ### Step 1 — Collect and Confirm Configuration
50
+
51
+ **Always ask the user for the configuration values interactively before doing anything else.** Go through the parameters **one at a time, in order**. For each parameter:
52
+
53
+ - State the parameter name and a short description.
54
+ - Show its **default value** (or `None` / `LLM decides` where there is no fixed default).
55
+ - Offer the user the choice to **accept the default** or **enter a new value**. Use interactive options where possible (e.g. an "Accept default" choice alongside a free-text input).
56
+ - **For mandatory parameters (Jira Team, Parent, Product Specification), you MUST NOT advance to the next parameter until the user supplies a value.** If the user leaves it blank, skips, or gives an empty answer, re-ask the SAME parameter and keep asking until a value is provided.
57
+ - For **Jira Team**, present the two fixed options (**OOF Mobile Solution Team** and **OOF Application Solution Team**) as a selectable choice. Do NOT accept or ask for a free-text team name. Map the chosen team to its ID for the `customfield_10700` field.
58
+ - For **Ticket Style**, always present an explicit choice to **accept the default Confluence page** or **enter a new ticket style URL**.
59
+
60
+ Use a prompt along these lines, asking for one value at a time:
61
+
62
+ > Let's set up the configuration. For each item, reply **"default"** to accept the shown default, or type a new value.
63
+ >
64
+ > | # | Parameter | Mandatory | Default value |
65
+ > |---|---|---|---|
66
+ > | 1 | **Jira Team** | Yes | None — choose **OOF Mobile Solution Team** or **OOF Application Solution Team** |
67
+ > | 2 | **Parent** | Yes | None — please provide (e.g. `BD-7711`) |
68
+ > | 3 | **Product Specification** | Yes | None — please provide a Confluence URL |
69
+ > | 4 | **Technical Specification** | No | None (skipped if blank) |
70
+ > | 5 | **Epic Number** | No | LLM decides based on spec scope |
71
+ > | 6 | **Ticket Style** | No | `https://rezolvetech.atlassian.net/wiki/spaces/CPST/pages/5303500826/Definition+of+user+story+acceptance+criteria` |
72
+ > | 7 | **Sub Tasks** | No | `no` |
73
+
74
+ Once all values are collected, **display a summary table of the final configuration** — indicating for each parameter whether the default was accepted or a custom value was entered — and ask the user to confirm before proceeding.
75
+
76
+ ### Step 2 — Read the Specifications
77
+
78
+ Use the Atlassian MCP connector to read the Confluence pages:
79
+
80
+ 1. **Read the Product Specification** from the supplied Confluence URL. This is the primary source of requirements.
81
+ 2. **Read the Technical Specification** (if supplied) from the Confluence URL. This supplements the product spec with implementation details.
82
+ 3. **Read the Ticket Style guide** from the Ticket Style URL. This defines how to format epic descriptions, story titles, acceptance criteria, and other ticket fields.
83
+
84
+ If any page cannot be read, inform the user and ask for a corrected URL.
85
+
86
+ ### Step 3 — Jira Field Reference
87
+
88
+ Use the following Jira field IDs and exact payload formats when creating tickets in the BD project. The `parent` field MUST be passed as an object (`{ "key": "..." }`), never as a bare string — passing a string is the usual cause of "can't find / invalid parent field" errors.
89
+
90
+ 1. **Team field** — custom field `customfield_10700` (Atlassian Team field type). It is **mandatory** on every ticket. Set it to the **ID** of the configured **Jira Team** as a **bare string**, e.g. `"customfield_10700": "b3f517d4-c4f8-4144-8920-b762ec5a033b"`. Use the ID, never the team name. **Do NOT wrap the ID in an object** (e.g. `{ "id": "..." }`) — although the field reads back as an object, on write the API rejects the object form with `Team id 'JsonData{data={id=...}}' is not valid`. Pass the raw ID string only:
91
+ - **OOF Mobile Solution Team** → `b3f517d4-c4f8-4144-8920-b762ec5a033b`
92
+ - **OOF Application Solution Team** → `9817d9ca-6170-48e8-9e98-1aeb7c81daa5`
93
+ 2. **Epic → parent initiative** — standard `parent` field: `"parent": { "key": "BD-7711" }` (substitute the configured **Parent** initiative key).
94
+ 3. **Story → parent epic** — standard `parent` field set to the epic's key: `"parent": { "key": "<EPIC-KEY>" }`.
95
+ 4. **Sub-task → parent story** — standard `parent` field: `"parent": { "key": "<STORY-KEY>" }`.
96
+
97
+ All ticket content must be derived exclusively from the Product Specification and Technical Specification provided by the user.
98
+
99
+ ### Step 4 — Plan the Epics and Stories
100
+
101
+ Based on the specifications and ticket style guide, plan the breakdown:
102
+
103
+ 1. **Identify logical epic groupings** from the product spec. Each epic should represent a coherent feature area or workstream.
104
+ 2. If **Epic Number** is set, constrain to that maximum. If not set, choose the number that best represents the natural groupings in the spec.
105
+ 3. For each epic, identify the user stories needed. Stories should be independently deliverable increments of work.
106
+ 4. If **Sub Tasks** is `yes`, further decompose each story into sub-tasks (implementation steps, testing, etc.).
107
+
108
+ **Present the full plan to the user as a high-level tree for initial structural review:**
109
+
110
+ ```
111
+ Epic 1: [Title]
112
+ ├── Story 1.1: [Title]
113
+ ├── Story 1.2: [Title]
114
+ └── Story 1.3: [Title]
115
+
116
+ Epic 2: [Title]
117
+ ├── Story 2.1: [Title]
118
+ └── Story 2.2: [Title]
119
+ ...
120
+ ```
121
+
122
+ Ask the user: **"Does this structure look right? Should I add, remove, merge, or split any epics or stories before I draft the full ticket content?"**
123
+
124
+ Wait for approval or iterate on the structure until the user is satisfied.
125
+
126
+ ### Step 5 — Preview Full Ticket Content
127
+
128
+ **CRITICAL: Do NOT create any tickets in Jira until the user explicitly approves the content in this step.**
129
+
130
+ Once the structure is approved, draft the **complete content** for every ticket and present it to the user for review. Show each ticket exactly as it will be created, including all fields:
131
+
132
+ #### For each Epic, show:
133
+
134
+ ```
135
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
136
+ EPIC: [Title]
137
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
138
+ Type: Epic
139
+ Team: [configured team]
140
+ Parent: [configured initiative key]
141
+ Summary: [epic title]
142
+ Description:
143
+ 📄 Product Spec: [Confluence URL]
144
+ 📄 Tech Spec: [Confluence URL or N/A]
145
+
146
+ [Full epic description per Ticket Style guide]
147
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
148
+ ```
149
+
150
+ #### For each Story, show:
151
+
152
+ ```
153
+ ──────────────────────────────────────
154
+ STORY under [Epic Title]: [Story Title]
155
+ ──────────────────────────────────────
156
+ Type: Story
157
+ Team: [configured team]
158
+ Epic: [parent epic title]
159
+ Summary: [story title]
160
+ Description:
161
+ 📄 Product Spec: [Confluence URL]
162
+ 📄 Tech Spec: [Confluence URL or N/A]
163
+
164
+ [Full story description per Ticket Style guide]
165
+
166
+ Acceptance Criteria:
167
+ [Full acceptance criteria per Ticket Style guide]
168
+ ──────────────────────────────────────
169
+ ```
170
+
171
+ #### For each Sub-Task (if Sub Tasks = yes), show:
172
+
173
+ ```
174
+ · SUB-TASK under [Story Title]: [Sub-task Title]
175
+ Type: Sub-task
176
+ Team: [configured team]
177
+ Parent: [parent story title]
178
+ Summary: [sub-task title]
179
+ Description: [sub-task details]
180
+ ```
181
+
182
+ After presenting ALL ticket content, ask the user:
183
+
184
+ > **"Here is the full content for all tickets I'm about to create. Please review and let me know:**
185
+ > - **Approve** — create all tickets as shown
186
+ > - **Edit** — tell me which tickets to change and what to modify
187
+ > - **Cancel** — abort without creating anything"
188
+
189
+ **Do NOT proceed to Step 6 until the user explicitly says to approve / go ahead / create.** If the user requests edits, make the changes, re-display the affected tickets, and ask for approval again. Repeat until approved.
190
+
191
+ ### Step 6 — Create Tickets in Jira
192
+
193
+ **Only execute this step after the user has explicitly approved the ticket content in Step 5.**
194
+
195
+ Use the Atlassian MCP connector to create the tickets. Follow this order:
196
+
197
+ #### 6a. Create Epics
198
+
199
+ For each epic, create it using the exact content approved in Step 5:
200
+
201
+ - **Issue Type**: Epic
202
+ - **Summary**: As approved
203
+ - **Description**: As approved — Product Spec link at top, Tech Spec link if supplied, full description per Ticket Style
204
+ - **Team**: Set the `customfield_10700` field to the **ID** of the configured Jira Team (mandatory)
205
+ - **Parent**: Set via the standard `parent` field as an object — `"parent": { "key": "<INITIATIVE-KEY>" }` (the user-supplied initiative key)
206
+
207
+ #### 6b. Create Stories
208
+
209
+ For each story, create it using the exact content approved in Step 5:
210
+
211
+ - **Issue Type**: Story
212
+ - **Summary**: As approved
213
+ - **Description**: As approved — Product Spec link at top, Tech Spec link if supplied, acceptance criteria and context per Ticket Style
214
+ - **Team**: Same team as the epics, set via `customfield_10700` to the selected team's ID (mandatory)
215
+ - **Parent**: Set via the standard `parent` field as an object — `"parent": { "key": "<EPIC-KEY>" }` (the epic created in step 6a)
216
+
217
+ #### 6c. Create Sub-Tasks (only if Sub Tasks = yes)
218
+
219
+ For each sub-task, create it using the exact content approved in Step 5:
220
+
221
+ - **Issue Type**: Sub-task
222
+ - **Summary**: As approved
223
+ - **Description**: As approved
224
+ - **Team**: Same team as the epics, set via `customfield_10700` to the selected team's ID (mandatory)
225
+ - **Parent**: Set via the standard `parent` field as an object — `"parent": { "key": "<STORY-KEY>" }` (the parent story)
226
+
227
+ ### Step 7 — Report Results
228
+
229
+ After all tickets are created, present a summary:
230
+
231
+ 1. A table of all created tickets with their keys, titles, types, and parent relationships
232
+ 2. Direct links to each ticket
233
+ 3. A link to the parent initiative showing the new epics
234
+ 4. Any tickets that failed to create, with error details
235
+
236
+ ---
237
+
238
+ ## Ticket Content Rules
239
+
240
+ These rules apply to ALL tickets (epics, stories, and sub-tasks):
241
+
242
+ 1. **Jira Team field is mandatory.** Set it on every ticket (epic, story, sub-task) using the **ID** of the team the user selected (`OOF Mobile Solution Team` → `b3f517d4-c4f8-4144-8920-b762ec5a033b`, `OOF Application Solution Team` → `9817d9ca-6170-48e8-9e98-1aeb7c81daa5`) via `customfield_10700`.
243
+ 2. **Product Specification link** must appear at the top of every story description and every epic description. Format as a clickable Confluence link.
244
+ 3. **Technical Specification link** (if provided) must appear directly below the product spec link in every description.
245
+ 4. **All epics must be children of the parent initiative.** Use the Jira parent field, not just a link.
246
+ 5. **Follow the Ticket Style guide** for all content — titles, descriptions, acceptance criteria, and formatting.
247
+ 6. **Respect the Epic Number** constraint. If a max is set, do not exceed it. Consolidate related work into fewer epics if needed.
248
+
249
+ ---
250
+
251
+ ## Error Handling
252
+
253
+ - If the Atlassian MCP connector is not connected, stop and ask the user to connect it.
254
+ - If a Confluence page cannot be read, report the error and ask for a corrected URL.
255
+ - If a ticket fails to create, log the error, continue with remaining tickets, and report all failures at the end.
256
+ - If the selected team's ID is rejected by Jira, report this and confirm the user's team choice before retrying.
257
+ - If the parent initiative key is invalid, report this and ask for correction.
258
+
259
+ ---
260
+
261
+ ## Tips for Best Results
262
+
263
+ - Provide a detailed product specification — the more complete the spec, the better the epic/story breakdown.
264
+ - Adding a technical specification helps generate more accurate implementation-focused stories.
265
+ - Use the Epic Number parameter to control granularity — fewer epics means broader groupings, more means finer-grained.
266
+ - Review the structure in Step 4 and the full ticket content in Step 5 carefully — nothing is created in Jira until you explicitly approve.
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: address-pr
3
+ description: Work through unresolved GitHub PR review threads on the current branch — fix valid findings in code and reply to invalid ones with an explanation. Use when the user wants to address review comments, respond to PR feedback, or run "/address-pr".
4
+ arguments: pr-number (optional)
5
+ ---
6
+
7
+ # Address PR
8
+
9
+ Work through unresolved GitHub PR review threads: fix the valid ones in code, and reply to the invalid ones with a clear explanation.
10
+
11
+ Argument: `$ARGUMENTS` — optional. Pass the PR number to target a specific PR; omit it to auto-detect from the current branch.
12
+
13
+ ## Quick start
14
+
15
+ ```
16
+ /address-pr
17
+ ```
18
+
19
+ ## Step 1: Find the PR
20
+
21
+ If a PR number was passed in `$ARGUMENTS`, substitute it for `<PR_NUMBER>` in the commands below; otherwise omit `<PR_NUMBER>` entirely and `gh` auto-detects the PR from the current branch:
22
+
23
+ ```bash
24
+ gh pr view <PR_NUMBER> --json number,url,title,headRefName
25
+ gh repo view --json owner,name --jq '.owner.login, .name' # first line = <OWNER>, second = <REPO>
26
+ ```
27
+
28
+ Extract the PR number and `headRefName`. If no open PR exists, stop and report.
29
+
30
+ Make sure the working tree is on the PR's branch before changing any code — fixes must land on the right branch:
31
+ ```bash
32
+ git checkout <headRefName>
33
+ git pull
34
+ ```
35
+
36
+ ## Step 2: Fetch unresolved review threads
37
+
38
+ ```bash
39
+ gh api graphql -f query='
40
+ query($owner: String!, $repo: String!, $number: Int!) {
41
+ repository(owner: $owner, name: $repo) {
42
+ pullRequest(number: $number) {
43
+ reviewThreads(first: 100) {
44
+ nodes {
45
+ id
46
+ isResolved
47
+ isOutdated
48
+ comments(first: 10) {
49
+ nodes { id databaseId body path line author { login } createdAt }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ ' -f owner=<OWNER> -f repo=<REPO> -F number=<PR_NUMBER>
57
+ ```
58
+
59
+ Keep threads where `isResolved` is `false`. Skip threads where `isOutdated` is `true` — they reference lines that have since changed and no longer block review.
60
+
61
+ If there are no unresolved threads, report "No open review threads" and stop.
62
+
63
+ ## Step 3: Evaluate each unresolved thread
64
+
65
+ Read the full comment text and load the referenced file at the path/line for context. Decide for each thread:
66
+ - **Valid** — a real problem or improvement that is technically correct and appropriate for this codebase.
67
+ - **Invalid** — based on a misunderstanding, would be incorrect, or does not apply.
68
+
69
+ ## Step 4: Apply fixes for valid findings
70
+
71
+ Apply each fix in the most specific module that owns the code (respect the `architecture.md` module boundaries). Collect all code changes, then run the tests for each affected module. Skip the build for docs/config-only changes (e.g. `suggest-docs`, `*.adoc`, `*.md`) — there is nothing to test:
72
+
73
+ ```bash
74
+ # Unit tests for an affected module (with upstream deps built):
75
+ mvn -pl <module> -am test
76
+
77
+ # Acceptance tests — run if an acceptance test module exists in the repository (e.g. suggest-tests):
78
+ mvn -pl suggest-tests verify
79
+
80
+ # Full build / static analysis before merge:
81
+ mvn -P verify-project verify
82
+ ```
83
+
84
+ If tests fail, fix the failure before proceeding.
85
+
86
+ ## Step 5: Commit and push (only if code changed)
87
+
88
+ ```bash
89
+ git add <changed files>
90
+ git commit -m "FHR-<number>: address review feedback"
91
+ git push
92
+ ```
93
+
94
+ Confirm with the user before pushing.
95
+
96
+ ## Step 6: Reply to all threads
97
+
98
+ `<MODEL_NAME>` is the model powering this session (e.g., "Sonnet 4.6", "Opus 4.8") and `<MODEL_SLUG>` is its URL slug (e.g., "sonnet", "opus", "haiku") — substitute from your system context.
99
+
100
+ For each **valid** thread that was fixed:
101
+ ```bash
102
+ gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/comments \
103
+ --method POST \
104
+ --field body="Fixed — <one-sentence summary of the change made>.
105
+
106
+ 🤖 Addressed by [Claude <MODEL_NAME>](https://www.anthropic.com/claude/<MODEL_SLUG>)" \
107
+ --field in_reply_to=<FIRST_COMMENT_DATABASE_ID>
108
+ ```
109
+
110
+ For each **invalid** thread:
111
+ ```bash
112
+ gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/comments \
113
+ --method POST \
114
+ --field body="<Clear, professional explanation of why no change is needed.>
115
+
116
+ 🤖 Addressed by [Claude <MODEL_NAME>](https://www.anthropic.com/claude/<MODEL_SLUG>)" \
117
+ --field in_reply_to=<FIRST_COMMENT_DATABASE_ID>
118
+ ```
119
+
120
+ Use the `databaseId` of the first comment in each thread as `in_reply_to`.
121
+
122
+ ## Step 7: Report
123
+
124
+ Summarise how many threads were fixed (with code changes), how many received a reply (no change), any that need manual attention, and the commit SHA if code was pushed.
125
+
126
+ ## Constraints
127
+
128
+ - Never push without explicit user confirmation.
129
+ - Fix failing tests before moving on — do not push a broken build.
@@ -2,6 +2,7 @@
2
2
  name: plan-spec
3
3
  description: Read a spec file and produce a detailed design and implementation plan — with BDD acceptance tests and TDD test cases per task — written into the spec's "Design and Implementation Plan" section, then committed. Use when user references a spec file and wants a plan, implementation design, or test specifications derived from requirements.
4
4
  arguments: spec-file
5
+ model: claude-opus-4-8
5
6
  ---
6
7
 
7
8
  # Plan Spec
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: ready-pr
3
+ description: Check that all GitHub PR review threads are resolved, then promote the PR from draft to ready for review. Stops with a clear message if any unresolved threads remain. Use when the user wants to mark a PR ready, promote a draft, or run "/ready-pr".
4
+ arguments: pr-number (optional)
5
+ ---
6
+
7
+ # Ready PR
8
+
9
+ Check the PR's review threads. If all are resolved, mark the PR ready for review. If any are still open, stop and say what to do.
10
+
11
+ Argument: `$ARGUMENTS` — optional. Pass the PR number to target a specific PR; omit it to auto-detect from the current branch.
12
+
13
+ ## Quick start
14
+
15
+ ```
16
+ /ready-pr
17
+ ```
18
+
19
+ ## Step 1: Find the PR
20
+
21
+ If a PR number was passed in `$ARGUMENTS`, substitute it for `<PR_NUMBER>` in the commands below; otherwise omit `<PR_NUMBER>` entirely and `gh` auto-detects the PR from the current branch:
22
+
23
+ ```bash
24
+ gh pr view <PR_NUMBER> --json number,url,title,isDraft,state
25
+ gh repo view --json owner,name --jq '.owner.login, .name' # first line = <OWNER>, second = <REPO>
26
+ ```
27
+
28
+ Stop and report if any of these hold — do not continue:
29
+ - No PR is found.
30
+ - `state` is not `OPEN` (the PR is merged or closed — there is nothing to promote).
31
+ - `isDraft` is `false` (the PR is already marked ready for review).
32
+
33
+ ## Step 2: Check for unresolved review threads
34
+
35
+ ```bash
36
+ gh api graphql -f query='
37
+ query($owner: String!, $repo: String!, $number: Int!) {
38
+ repository(owner: $owner, name: $repo) {
39
+ pullRequest(number: $number) {
40
+ reviewThreads(first: 100) {
41
+ nodes {
42
+ isResolved
43
+ isOutdated
44
+ comments(first: 1) {
45
+ nodes { body path line author { login } }
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ ' -f owner=<OWNER> -f repo=<REPO> -F number=<PR_NUMBER>
53
+ ```
54
+
55
+ Keep threads where `isResolved` is `false` AND `isOutdated` is `false`. Outdated threads do not block readiness.
56
+
57
+ ## Step 3: If unresolved threads exist — STOP
58
+
59
+ Report and do nothing further:
60
+
61
+ > **Not ready:** N unresolved review thread(s) remain:
62
+ >
63
+ > - `path:line` — "comment text" (by @reviewer)
64
+ > - …
65
+ >
66
+ > Run `/address-pr` to fix or reply to each thread, or resolve them manually on GitHub, then run `/ready-pr` again.
67
+
68
+ ## Step 4: If all threads are resolved — mark ready
69
+
70
+ ```bash
71
+ gh pr ready <PR_NUMBER>
72
+ ```
73
+
74
+ Report the PR URL and confirm it is now ready for review.
@@ -2,6 +2,7 @@
2
2
  name: refine-spec
3
3
  description: Conduct a structured requirements-refinement interview against a spec file, using the project's ubiquitous language from glossary.md, until scope and acceptance criteria are clear, then update the spec file in place. Use when user references a spec file and wants to clarify requirements, define scope, or sharpen acceptance criteria — but not write code or tests.
4
4
  arguments: spec-file
5
+ model: claude-opus-4-8
5
6
  ---
6
7
 
7
8
  # Refine Spec
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: review-pr
3
+ description: Review the current branch's GitHub PR — fetch its description and diff, compare against the spec/plan if present, and submit a GitHub PR review with inline comments for every finding. Use when the user wants to review a PR, run an AI review pass, or run "/review-pr".
4
+ arguments: pr-number (optional)
5
+ ---
6
+
7
+ # Review PR
8
+
9
+ Review the open GitHub PR for this branch by acting as a code reviewer. The output is a **submitted GitHub PR review with inline comments** — not a local file.
10
+
11
+ Argument: `$ARGUMENTS` — optional. Pass the PR number to review a specific PR; omit it to auto-detect from the current branch.
12
+
13
+ ## Quick start
14
+
15
+ ```
16
+ /review-pr
17
+ ```
18
+
19
+ ## Step 1: Find the PR
20
+
21
+ If a PR number was passed in `$ARGUMENTS`, substitute it for `<PR_NUMBER>` in the commands below; otherwise omit `<PR_NUMBER>` entirely and `gh` auto-detects the PR from the current branch:
22
+
23
+ ```bash
24
+ gh pr view <PR_NUMBER> --json number,url,title,state,body,headRefName,baseRefName
25
+ ```
26
+
27
+ Extract the PR number, title, description, and base branch. If no PR is found, stop and ask the user to run `/write-pr` first.
28
+
29
+ Get the latest commit SHA (required to anchor inline comments):
30
+ ```bash
31
+ gh pr view <PR_NUMBER> --json commits --jq '.commits[-1].oid'
32
+ ```
33
+
34
+ ## Step 2: Fetch the diff
35
+
36
+ ```bash
37
+ gh pr diff <PR_NUMBER>
38
+ gh pr view <PR_NUMBER> --json files --jq '[.files[].path]'
39
+ ```
40
+
41
+ ## Step 3: Load spec/plan and project standards (if available)
42
+
43
+ Detect the ticket number from the branch name (pattern `FHR-\d+`).
44
+
45
+ Read if present (the spec may be in any of these locations):
46
+ - `.claude/resources/FHR-<number>-*.md`
47
+ - `suggest-docs/src/main/docs/specs/FHR-<number>-*.md`
48
+ - `documentation/releases/*/FHR-<number>-*.md`
49
+
50
+ The plan is embedded in the spec's `## Design and Implementation Plan` section — there is no separate plan file.
51
+
52
+ Also read:
53
+ - `coding-guidelines.md`, `architecture.md`, `glossary.md` (project root) — the standards to review against.
54
+
55
+ If the spec is missing, proceed and review code quality only.
56
+
57
+ ## Step 4: Review the PR
58
+
59
+ Review the diff and PR description against `coding-guidelines.md` and `architecture.md`.
60
+
61
+ **What to check:**
62
+
63
+ 1. **PR description accuracy** — does the body describe what actually changed? Are diagrams present and correct for complex changes?
64
+ 2. **Spec compliance** (if a spec was found) — does the implementation satisfy each acceptance criterion? Are there missing tests for any plan task?
65
+ 3. **Code quality:**
66
+ - Correctness and edge cases (nulls, boundary values, empty inputs)
67
+ - Error handling and resilience (no swallowed exceptions)
68
+ - Security and input validation (no injection, no hardcoded secrets)
69
+ - Test coverage (every new/changed conditional branch has a dedicated test)
70
+ - Readability, naming, complexity, duplication
71
+ - Architecture and module boundaries (refer to `architecture.md` for module structure and dependency rules; no circular dependencies)
72
+ - Domain language matches `glossary.md`
73
+ - Logging and observability (no secrets or PII in logs)
74
+
75
+ **For each finding, record:**
76
+ - `path` — relative file path in the repo
77
+ - `line` — absolute line number in the new version of the file
78
+ - `side` — always `"RIGHT"` for added or unchanged lines
79
+ - `severity` — `BLOCKER` | `MAJOR` | `MINOR` | `NIT`
80
+ - `body` — comment text prefixed with the severity tag, e.g. `BLOCKER: Missing null check. Add a guard before line 42.`
81
+
82
+ Only raise a finding if the evidence is clear from the diff. Do not speculate about code you cannot see.
83
+
84
+ **Inline comments can only anchor to lines that are part of the PR's diff hunks** (added or directly-adjacent context lines). The GitHub reviews API rejects the whole submission (HTTP 422) if any comment targets a line outside the diff. If a finding concerns an unchanged line, put it in the review `body` instead of inline.
85
+
86
+ ## Step 5: Submit the GitHub PR review
87
+
88
+ Get the owner and repo (printed on separate lines — the first is `<OWNER>`, the second is `<REPO>`):
89
+ ```bash
90
+ gh repo view --json owner,name --jq '.owner.login, .name'
91
+ ```
92
+
93
+ Choose the review `event` from the highest finding severity:
94
+ - `REQUEST_CHANGES` — at least one `BLOCKER` or `MAJOR` finding (these block the PR).
95
+ - `COMMENT` — only `MINOR`/`NIT` findings (non-blocking, so the severity tags carry weight).
96
+
97
+ Submit the full review in a single API call:
98
+ ```bash
99
+ gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/reviews \
100
+ --method POST \
101
+ --field commit_id=<LATEST_COMMIT_SHA> \
102
+ --field body="Review: <N> finding(s) — <X> blocker(s), <Y> major, <Z> minor, <W> nit(s)." \
103
+ --field event="<REQUEST_CHANGES or COMMENT>" \
104
+ --raw-field comments='[
105
+ {"path":"suggest-api/src/main/java/Foo.java","line":42,"side":"RIGHT","body":"BLOCKER: …"},
106
+ {"path":"suggest-lucene/src/main/java/Bar.java","line":17,"side":"RIGHT","body":"MINOR: …"}
107
+ ]'
108
+ ```
109
+
110
+ If a finding cannot be anchored to a specific file line (e.g. a description-level issue), include it in the review `body` instead of as an inline comment.
111
+
112
+ If there are **no findings**, approve:
113
+ ```bash
114
+ gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/reviews \
115
+ --method POST \
116
+ --field body="LGTM — all quality gates pass." \
117
+ --field event="APPROVE"
118
+ ```
119
+
120
+ ## Step 6: Report
121
+
122
+ Output the PR URL, the review decision (`REQUEST_CHANGES` or `APPROVE`), finding counts by severity, and any findings placed in the review body rather than inline.
@@ -2,6 +2,7 @@
2
2
  name: tdd-green
3
3
  description: Implement production code (green phase) for the next incomplete task in a spec file's Design and Implementation Plan, writing only enough code to make the failing tests pass, then refactor while keeping tests green, mark the Production code sub-task done, and commit the green and refactor work separately. Use when user references a spec file and wants to implement a feature, or says "green phase", "make tests pass", "tdd green", or "green and refactor".
4
4
  arguments: spec-file
5
+ model: claude-haiku-4-5-20251001
5
6
  ---
6
7
 
7
8
  # TDD Green
@@ -2,6 +2,7 @@
2
2
  name: tdd-red
3
3
  description: Write failing tests (red phase) for the next incomplete task in a spec file's Design and Implementation Plan — acceptance tests (JGiven BDD) and unit tests (JUnit Jupiter) — then mark the Acceptance tests and Unit tests sub-tasks done and commit. Use when user references a spec file and wants to write the failing tests before implementing a feature, or says "red phase", "write tests", or "tdd red".
4
4
  arguments: spec-file
5
+ model: claude-haiku-4-5-20251001
5
6
  ---
6
7
 
7
8
  # TDD Red
@@ -2,6 +2,7 @@
2
2
  name: tdd-workflow
3
3
  description: Drive the full red-green-refactor TDD cycle across every task in a spec file's Design and Implementation Plan — picking the next incomplete task, then running the red, green, and refactor phases for it, then looping to the next task until the plan is complete. Use when user references a spec file and wants to implement the whole plan end to end, or says "run the tdd workflow", "implement the plan", or "tdd workflow".
4
4
  arguments: spec-file
5
+ model: claude-haiku-4-5-20251001
5
6
  ---
6
7
 
7
8
  # TDD Workflow
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: write-pr
3
+ description: Render the repo PR template from the current branch's diff, and create (or update) a draft GitHub PR. Use when the user wants to open a PR, write a PR description, or run "/write-pr" on a branch.
4
+ arguments: extra-context (optional)
5
+ ---
6
+
7
+ # Write PR
8
+
9
+ Render the `.github/pull_request_template.md` from the current branch's changes and open a **draft** GitHub PR. PRs are always created as drafts — use `/ready-pr` to promote them once review is complete.
10
+
11
+ Argument: `$ARGUMENTS` — optional free text treated as extra context for the description.
12
+
13
+ ## Quick start
14
+
15
+ ```
16
+ /write-pr
17
+ ```
18
+
19
+ ## Workflow
20
+
21
+ 1. **Detect the ticket and diff**
22
+ - Read the ticket number from the branch name (pattern `FHR-\d+`). If the branch name has no ticket, ask the user for the ticket number before continuing.
23
+ - Make sure the branch is committed — `git diff origin/master...HEAD` only shows committed work, not uncommitted or untracked files. Get the diff vs `master`:
24
+ ```bash
25
+ git diff origin/master...HEAD --stat
26
+ git diff origin/master...HEAD
27
+ ```
28
+
29
+ 2. **Render the template** — fill in `.github/pull_request_template.md`:
30
+ - Set the Jira link to `https://attraqt.atlassian.net/browse/FHR-<number>`.
31
+ - Tick the AI Development Checklist items that genuinely apply (spec present, tests present, docs present, AI review pass, etc.). Leave unticked anything not yet true.
32
+ - Prepend a `## Summary of changes` section (the template has no such section) describing what changed and why.
33
+
34
+ 4. **Approve before publishing** — present the title and rendered body and wait for explicit approval. Support correction cycles.
35
+
36
+ 5. **Publish** — write the approved body to a temp file (e.g. `pr-body.md`), then with confirmation push the branch and create or update the draft PR:
37
+ ```bash
38
+ gh pr create --draft --title "FHR-<number>: <Title>" --body-file pr-body.md
39
+ # or, if a PR already exists for this branch (omit the number — gh auto-detects it):
40
+ gh pr edit --title "FHR-<number>: <Title>" --body-file pr-body.md
41
+ ```
42
+ Delete the temp file afterwards and report the PR URL.
43
+
44
+ ## Constraints
45
+
46
+ - Always create the PR as a **draft**.
47
+ - Never push without explicit user confirmation.
48
+ - The title MUST match `FHR-<number>: <description>` — the `pull-request.yml` CI check fails otherwise.
49
+ - Only tick checklist items that are actually true.
@@ -0,0 +1,475 @@
1
+ ---
2
+ name: code-review-github
3
+ description: Use when the user wants to add Claude Code Agent + GitHub Copilot AI tooling to a repository — automatic PR code review, on-demand `@claude` assistance, a Copilot setup workflow, a structured PR template, and AI context files (`CLAUDE.md`, `.github/copilot-instructions.md`, `docs/*`). Triggered by `/code-review-github` or requests like "set up Claude PR review", "add the AI agent setup", "configure the copilot workflows", "bootstrap AI agents in this repo". Originally built for GroupBy Java/Micronaut repos but adapts to any stack.
4
+ ---
5
+
6
+ # code-review-github
7
+
8
+ Bootstrap a repository with the standard Claude Code Agent + GitHub Copilot
9
+ setup: GitHub Actions for automatic PR review and `@claude` assistance, a
10
+ Copilot environment-setup workflow, a PR template with an AI checklist, and the
11
+ AI context files agents read on every session.
12
+
13
+ This skill is **self-contained** — every file template lives below, verified
14
+ against a working reference implementation. Do not fetch anything external.
15
+
16
+ ## What this setup provides
17
+
18
+ | Capability | Tool | Trigger |
19
+ |---|---|---|
20
+ | Automatic PR code review | Claude Code | PR opened |
21
+ | On-demand AI assistance | Claude Code | `@claude` in PR comment |
22
+ | Copilot workspace environment | GitHub Copilot | workflow_dispatch / file change |
23
+ | Structured PR descriptions | PR template | PR creation |
24
+ | AI context for IDE Copilot | `copilot-instructions.md` | IDE session |
25
+ | AI context for Claude | `CLAUDE.md` | Claude session |
26
+
27
+ ## Files this skill creates or updates
28
+
29
+ | # | File | Action | Project-specific? |
30
+ |---|---|---|---|
31
+ | 1 | `.github/workflows/claude.yml` | Create | No — copy verbatim |
32
+ | 2 | `.github/workflows/claude-pr-review.yml` | Create | Yes — tune review prompt |
33
+ | 3 | `.github/workflows/copilot-setup-steps.yml` | Create | Yes — match build/runtime |
34
+ | 4 | `.github/PULL_REQUEST_TEMPLATE.md` | Create | Yes — Jira/issue prefix |
35
+ | 5 | `.github/copilot-instructions.md` | Create | Yes — full rewrite |
36
+ | 6 | `CLAUDE.md` | Create | Yes — full rewrite |
37
+ | 7 | `.gitignore` | Update | No — append AI section |
38
+ | 8 | `docs/source-control.md` | Create | No — universal |
39
+ | 9 | `docs/project-rule.md` | Create | Yes — tune tech rules |
40
+ | 10 | `docs/project-structure.md` | Create | Yes — full rewrite |
41
+ | 11 | `docs/<service-name>.md` | Create | Yes — main service doc |
42
+
43
+ ## Procedure
44
+
45
+ ### 1. Scan the repo first — never guess
46
+
47
+ Before writing anything, gather the facts that drive the project-specific files:
48
+
49
+ - **Build & runtime:** `build.gradle`/`pom.xml`/`package.json`/`go.mod`/etc. —
50
+ language + version, framework, build commands, test commands.
51
+ - **Submodules:** check for `.gitmodules`. Drives whether the Copilot workflow
52
+ needs `submodules: recursive` and a `GIT_TOKEN`.
53
+ - **Issue tracker prefix:** infer from existing branch names / commit history
54
+ (e.g. `S4R-`, `PROJ-`). Drives the PR template link.
55
+ - **Existing files:** if any target file already exists, read it and propose a
56
+ merge rather than overwriting. Never clobber a hand-maintained `CLAUDE.md`.
57
+ - **CI:** existing `.github/workflows/` — note the runner, JDK/Node version,
58
+ and cache strategy already in use so the Copilot workflow matches.
59
+
60
+ Announce what you found and what you intend to create before writing.
61
+
62
+ ### 2. Confirm prerequisites with the user
63
+
64
+ These are configured outside the repo and the skill cannot do them. List them
65
+ and ask the user to confirm they are (or will be) set:
66
+
67
+ - **GitHub secret `ANTHROPIC_API_KEY`** — from console.anthropic.com.
68
+ - **GitHub secret `GIT_TOKEN`** — a PAT with `contents:read`, only if the repo
69
+ uses submodules.
70
+ - **Claude GitHub App** installed for the repo
71
+ (https://github.com/apps/claude) with `contents:read` and
72
+ `pull_requests:write`.
73
+ - **Branch protection** on the default branch: require PR before merge, require
74
+ status checks, allow GitHub Actions to create/approve PRs.
75
+
76
+ ### 3. Create the workflow files (verbatim templates below)
77
+
78
+ Write files 1–3 from the templates in the **Templates** section. Apply the
79
+ ✏️ edits noted there: review focus areas, JDK/Node version, submodule handling,
80
+ and the build/dependency command.
81
+
82
+ ### 4. Create the PR template
83
+
84
+ Write `.github/PULL_REQUEST_TEMPLATE.md` from the template, replacing the
85
+ issue-tracker prefix with the one detected in step 1.
86
+
87
+ ### 5. Update `.gitignore`
88
+
89
+ Append the AI section from the template. Skip any line already present (e.g.
90
+ don't add `/.cursor/` if `.cursor` already appears).
91
+
92
+ ### 6. Create the documentation files
93
+
94
+ - `docs/source-control.md` — copy verbatim (universal).
95
+ - `docs/project-rule.md` — copy, then tune the tech-specific lines (language
96
+ version, framework name).
97
+ - `docs/project-structure.md` — write from the repo scan: top-level layout,
98
+ main source packages and their purpose, test layout, key config files.
99
+ - `docs/<service-name>.md` — write for the main service/entry point: main
100
+ endpoint, request flow, key methods, dependencies, feature flags, error
101
+ handling.
102
+
103
+ ### 7. Write the AI context files (`CLAUDE.md` + `copilot-instructions.md`)
104
+
105
+ These are fully project-specific and mirror each other. **Verify every claim**
106
+ against source before including it: confirm each build/test command exists,
107
+ quote exact config keys, list directories before describing them, and never
108
+ instruct placing credentials in a repo-tracked file (use `~/.gradle/...`,
109
+ `~/.m2/...`, `~/.npmrc`, or env vars). Keep `CLAUDE.md` a thin index that points
110
+ into `docs/`. Use the skeletons in the Templates section.
111
+
112
+ If the repo already follows the `docs-init` canonical structure (architecture /
113
+ local-setup / conventions / operations / decisions), point `CLAUDE.md` at those
114
+ files instead of inventing new ones — don't duplicate.
115
+
116
+ ### 8. Verify
117
+
118
+ Run through the checklist and report status to the user:
119
+
120
+ - [ ] `ANTHROPIC_API_KEY` secret set (and `GIT_TOKEN` if submodules used).
121
+ - [ ] Claude GitHub App installed for the repo.
122
+ - [ ] `copilot-setup-steps.yml` job is named exactly `copilot-setup-steps`.
123
+ - [ ] Review prompt tuned to the project's real concerns.
124
+ - [ ] JDK/Node version in the Copilot workflow matches the build file.
125
+ - [ ] All `docs/*.md` exist and the links in `CLAUDE.md` resolve.
126
+ - [ ] Suggest a test PR to confirm `claude-pr-review.yml` triggers and posts,
127
+ and an `@claude` comment to confirm `claude.yml` triggers.
128
+ - [ ] Suggest a commit message (e.g. `chore: add Claude Code + Copilot AI setup`).
129
+
130
+ ## Hard rules
131
+
132
+ - **Never overwrite an existing hand-maintained file silently.** Read it,
133
+ propose a merge, confirm.
134
+ - **The Copilot job MUST be named `copilot-setup-steps`** or Copilot won't pick
135
+ it up.
136
+ - **Verify every command and config key** in `CLAUDE.md` /
137
+ `copilot-instructions.md` against source. Don't fabricate tasks.
138
+ - **Never put credentials in repo-tracked files.** Secrets live in GitHub
139
+ Actions secrets; local creds live in user-home config.
140
+ - **Pin the action and model versions** as written; only bump when the user
141
+ asks. Update the `--model` value if the user wants a specific model.
142
+ - **`submodules: recursive` + `GIT_TOKEN`** only if the repo actually has
143
+ submodules — remove both otherwise.
144
+
145
+ ---
146
+
147
+ ## Templates
148
+
149
+ ### 1. `.github/workflows/claude.yml` — copy verbatim
150
+
151
+ ```yaml
152
+ name: Claude Code
153
+
154
+ # Triggers: new PR opened or @claude mentioned in a PR comment
155
+ on:
156
+ pull_request:
157
+ types: [ opened ]
158
+ issue_comment:
159
+ types: [ created ]
160
+
161
+ # Cancel redundant runs on the same PR
162
+ concurrency:
163
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number }}
164
+ cancel-in-progress: true
165
+
166
+ jobs:
167
+ claude:
168
+ name: Run Claude Code Agent
169
+ # Run on new PRs or when @claude is mentioned in a PR comment
170
+ if: |
171
+ (github.event_name == 'pull_request' && github.event.action == 'opened') ||
172
+ (github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@claude'))
173
+ runs-on: ubuntu-latest
174
+ timeout-minutes: 30
175
+ permissions:
176
+ contents: write
177
+ pull-requests: write
178
+ issues: write
179
+ id-token: write
180
+ actions: read # Required for Claude to read CI results on PRs
181
+
182
+ steps:
183
+ - name: Checkout repository
184
+ uses: actions/checkout@v4
185
+ with:
186
+ fetch-depth: 0
187
+
188
+ - name: Run Claude Code
189
+ id: claude
190
+ uses: anthropics/claude-code-action@v1
191
+ with:
192
+ anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
193
+ github_token: ${{ github.token }}
194
+ claude_args: |
195
+ --model claude-opus-4-5
196
+ ```
197
+
198
+ ### 2. `.github/workflows/claude-pr-review.yml` — ✏️ tune the `prompt` focus areas
199
+
200
+ ```yaml
201
+ name: Claude Code PR Review
202
+
203
+ # Triggers: new PR opened or @claude mentioned in a PR comment
204
+ on:
205
+ pull_request:
206
+ types: [ opened ]
207
+ issue_comment:
208
+ types: [ created ]
209
+
210
+ # Cancel redundant runs on the same PR
211
+ concurrency:
212
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number }}
213
+ cancel-in-progress: true
214
+
215
+ jobs:
216
+ claude-pr-review:
217
+ name: Run Claude PR Review
218
+ # Run on new PRs or when @claude is mentioned in a PR comment
219
+ if: |
220
+ (github.event_name == 'pull_request' && github.event.action == 'opened') ||
221
+ (github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@claude'))
222
+ runs-on: ubuntu-latest
223
+ timeout-minutes: 30
224
+ permissions:
225
+ contents: read
226
+ pull-requests: write
227
+ id-token: write
228
+
229
+ steps:
230
+ - name: Checkout repository
231
+ uses: actions/checkout@v4
232
+ with:
233
+ fetch-depth: 0
234
+
235
+ - name: PR Review with Progress Tracking
236
+ uses: anthropics/claude-code-action@v1
237
+ with:
238
+ anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
239
+ github_token: ${{ github.token }}
240
+
241
+ # Enable progress tracking
242
+ track_progress: true
243
+
244
+ # ✏️ UPDATE these focus areas for your project
245
+ prompt: |
246
+ REPO: ${{ github.repository }}
247
+ PR NUMBER: ${{ github.event.pull_request.number }}
248
+
249
+ Perform a comprehensive code review with the following focus areas:
250
+
251
+ 1. **Code Quality**
252
+ - Clean code principles and best practices (Single responsibility principle)
253
+ - Code clarity, readability and maintainability
254
+ - Proper error handling and edge cases
255
+ - Check for unnecessary complexity and nesting
256
+ - Check for redundant code and abstractions
257
+ - Ensure consistency with project standards
258
+ - Check for overly compact or clever code
259
+
260
+ 2. **Security**
261
+ - Check for potential security vulnerabilities
262
+ - Validate input sanitization
263
+ - Review authentication/authorization logic
264
+
265
+ 3. **Performance**
266
+ - Identify potential performance bottlenecks
267
+ - Review database queries for efficiency
268
+ - Check for memory leaks or resource issues
269
+
270
+ 4. **Testing**
271
+ - Verify adequate test coverage
272
+ - Review test quality and edge cases
273
+ - Check for missing test scenarios
274
+ - Check for superfluous tests
275
+
276
+ 5. **Documentation**
277
+ - Ensure code is properly documented
278
+ - Verify README updates for new features
279
+ - Check API documentation accuracy
280
+
281
+ Provide detailed feedback using inline comments for specific issues.
282
+ Do not include your todo list in the final review.
283
+ Use top-level comments for general observations or praise.
284
+ At the end of the review, add a wit quatrain describing the PR. (Do it only once per PR)
285
+
286
+ # Tools for comprehensive PR review
287
+ claude_args: |
288
+ --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Read,Glob,Grep,TodoWrite,Task,Skill"
289
+ --model claude-opus-4-5
290
+ ```
291
+
292
+ ### 3. `.github/workflows/copilot-setup-steps.yml` — ✏️ match build/runtime
293
+
294
+ Java/Gradle reference below. For Node/Python/Go, swap the setup step, cache key,
295
+ and the final "Download dependencies" command (`npm ci`, `pip install -r ...`,
296
+ `go mod download`). **Keep the job name `copilot-setup-steps`.**
297
+
298
+ ```yaml
299
+ name: "Copilot Setup Steps"
300
+
301
+ # Automatically run the setup steps when they are changed to allow for easy validation, and
302
+ # allow manual testing through the repository's "Actions" tab
303
+ on:
304
+ workflow_dispatch:
305
+ push:
306
+ paths:
307
+ - .github/workflows/copilot-setup-steps.yml
308
+ pull_request:
309
+ paths:
310
+ - .github/workflows/copilot-setup-steps.yml
311
+
312
+ jobs:
313
+ # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
314
+ copilot-setup-steps:
315
+ runs-on: ubuntu-latest
316
+
317
+ # Set the permissions to the lowest permissions possible needed for your steps.
318
+ # Copilot will be given its own token for its operations.
319
+ permissions:
320
+ contents: read
321
+
322
+ steps:
323
+ - name: Set up JDK 21 # ✏️ UPDATE: language/version (or use setup-node / setup-python / setup-go)
324
+ uses: actions/setup-java@v4
325
+ with:
326
+ java-version: '21'
327
+ distribution: 'temurin'
328
+
329
+ - name: Checkout
330
+ uses: actions/checkout@v4
331
+ with:
332
+ submodules: recursive # ✏️ REMOVE this + token line if no submodules
333
+ fetch-depth: 0
334
+ token: ${{ secrets.GIT_TOKEN }}
335
+
336
+ - name: Grant execute permission for gradlew
337
+ run: chmod +x gradlew
338
+
339
+ - name: Cache Gradle packages
340
+ uses: actions/cache@v4
341
+ with:
342
+ key: v1-dependencies-${{ hashFiles('build.gradle') }}
343
+ path: |
344
+ ~/.gradle/caches
345
+ ~/.gradle/wrapper
346
+
347
+ - name: Download dependencies
348
+ run: ./gradlew dependencies # ✏️ UPDATE: npm ci / pip install / go mod download
349
+ ```
350
+
351
+ ### 4. `.github/PULL_REQUEST_TEMPLATE.md` — ✏️ replace the issue-tracker prefix
352
+
353
+ ```markdown
354
+ [S4R-1234](https://rezolvetech.atlassian.net/browse/S4R-1234)
355
+ <!-- ✏️ UPDATE: replace S4R with your Jira/issue project prefix and the base URL -->
356
+
357
+ ## Description
358
+
359
+ A high-level description of what is changed by this PR.
360
+
361
+ ## Checks
362
+
363
+ - [ ] Unit Tests
364
+ - [ ] Update 'vault' variables
365
+ - [ ] Feature flag added / updated / removed
366
+ - [ ] Update documentation (diagram, confluence pages, content inside "/docs" directory, swagger)
367
+
368
+ ## AI Development Checklist
369
+
370
+ - [ ] Spec/requirement linked: <!-- link here -->
371
+ - [ ] AI tool used: <!-- Copilot / @claude / Agent / Other -->
372
+ - [ ] Tests generated/refined with AI
373
+ - [ ] AI review pass completed
374
+ - [ ] Repo context files are still accurate (update if not)
375
+ ```
376
+
377
+ ### 5. `.gitignore` — append (skip any line already present)
378
+
379
+ ```gitignore
380
+ # AI docs
381
+ /.claude/
382
+ /.serena/
383
+ /docs/archive/
384
+ /docs/prompts/
385
+ /docs/review/
386
+ /docs/templates/
387
+ ```
388
+
389
+ ### 6. `docs/source-control.md` — copy verbatim (universal)
390
+
391
+ ```markdown
392
+ # Source Control
393
+
394
+ ## Branches
395
+ - Branch names must start with the Jira ticket number followed by a short description in kebab-case.
396
+ - Prefixes: `feature/`, `bugfix/`, `hotfix/`, `chore/`
397
+ - Example: `feature/S4R-1234-add-search-caching`
398
+ - `main` is the protected default branch; direct pushes are not allowed.
399
+
400
+ ## Commits
401
+ - Messages must start with the Jira ticket number: `S4R-1234: add search result caching`
402
+ - Write in **imperative mood** and **lowercase** after the ticket prefix.
403
+ - Explain *what* and *why*, not *how*.
404
+
405
+ ## Pull Requests
406
+ - PR title: `S4R-1234: Add result caching for autocomplete`
407
+ - Fill in PR description using the PR template — all checklist items must be reviewed.
408
+ - PRs must be reviewed and approved before merging.
409
+ - Use **Squash and Merge** to keep `main` history clean.
410
+ - Delete the source branch after merging.
411
+ ```
412
+
413
+ ### 7. `docs/project-rule.md` — ✏️ tune the tech-specific lines
414
+
415
+ ```markdown
416
+ - Do not look at Linter errors until the user explicitly asks.
417
+ - Do not reformat existing code or imports unrelated to implementation changes.
418
+ - Use `var` for new variables' declaration with new operator. <!-- ✏️ language-specific -->
419
+ - Use the same naming and style patterns as in the existing code.
420
+ - Use Java 21 with preview features for all new code. <!-- ✏️ UPDATE language/version -->
421
+ - <Framework> is used as the framework. Check official docs for actual APIs. <!-- ✏️ UPDATE -->
422
+ - Ensure app build and tests pass before committing any changes.
423
+ ```
424
+
425
+ ### 8. `CLAUDE.md` — thin index, fully project-specific
426
+
427
+ ```markdown
428
+ # CLAUDE.md
429
+
430
+ ## Project Overview
431
+ <2-3 sentences: what the service does, framework, main purpose>
432
+
433
+ ## Project Guidelines
434
+ - Coding standards: @docs/project-rule.md
435
+ - Project structure: @docs/project-structure.md
436
+ - Source control: @docs/source-control.md
437
+ - <service name> specifics: @docs/<service-name>.md
438
+ - Configuration reference: @docs/configuration-reference.md
439
+ - API reference: @docs/api-reference.md
440
+
441
+ ## Tech Stack
442
+ <table: Framework, Language, Build, Databases, Cache, Messaging, Testing, Monitoring>
443
+
444
+ ## Essential Commands
445
+ <Local Development, Build & Test, Docker — real, verified commands only>
446
+
447
+ ## Architecture
448
+ <Package structure table, request flow, key patterns>
449
+
450
+ ## Critical Logic
451
+ <the most important business logic / algorithm>
452
+
453
+ ## Development Guidelines
454
+ <code style, how to add a feature step-by-step, testing approach>
455
+
456
+ ## Important Files
457
+ <table: file → purpose>
458
+
459
+ ## Local Development Notes
460
+ <prerequisites, credentials (user-home only), environment variables>
461
+
462
+ ## Common Issues
463
+ <table: issue → solution>
464
+ ```
465
+
466
+ ### 9. `.github/copilot-instructions.md` — mirrors `CLAUDE.md` for Copilot
467
+
468
+ Required sections:
469
+
470
+ 1. **Title** — `# AI Coding Agent Instructions for <Project Name>`
471
+ 2. **Build, Test, and Development Commands** — all real build-tool commands.
472
+ 3. **High-Level Architecture** — core components, integration points, design decisions.
473
+ 4. **Development Guidelines** — code style, framework patterns, testing, how to add a service.
474
+ 5. **Project Guidelines** — links to `/docs/*.md`.
475
+ 6. **Claude Code PR Reviewer Setup** — GitHub config, what Claude reviews, how to disable.