@groupby/ai-dev 0.5.5 → 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.5",
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,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.