cursor-devops-commands 1.0.0

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.
@@ -0,0 +1,302 @@
1
+ ---
2
+ description: Create Architecture Decision Records (ADRs) for technical decisions
3
+ category: Documentation
4
+ aliases: [adr, decision, record]
5
+ ---
6
+
7
+ # Decision Record - Capture Architectural Decisions
8
+
9
+ Capture important technical and architectural decisions as Architecture Decision Records (ADRs).
10
+
11
+ **This is the biggest missing piece** — turns tribal knowledge into institutional memory.
12
+
13
+ ## Usage
14
+
15
+ ```
16
+ /decision-record {TITLE}
17
+ /decision-record {TITLE} --context="{TICKET_OR_PR}"
18
+ /decision-record --list # List all decisions
19
+ /decision-record --search="{KEYWORD}" # Search decisions
20
+ ```
21
+
22
+ ## Examples
23
+
24
+ ```
25
+ /decision-record "Use React Query for data fetching"
26
+ /decision-record "Split ProtectionPackageCard into sub-components" --context="TICKET-123"
27
+ /decision-record "Migrate from styled-components to CSS modules" --context="PR#23100"
28
+ ```
29
+
30
+ ## Why This Matters
31
+
32
+ Without decision records:
33
+
34
+ - ❌ Repeated debates on the same topics
35
+ - ❌ Inconsistent enforcement
36
+ - ❌ Loss of architectural intent
37
+ - ❌ "Why was this done?" questions forever
38
+
39
+ With decision records:
40
+
41
+ - ✅ Single source of truth
42
+ - ✅ Onboarding accelerated
43
+ - ✅ Consistent enforcement
44
+ - ✅ Architectural alignment
45
+
46
+ ## What This Creates
47
+
48
+ Creates a file at: `/docs/decisions/ADR-{NUMBER}-{slug}.md`
49
+
50
+ ```markdown
51
+ # ADR-042: Use React Query for Data Fetching
52
+
53
+ ## Status
54
+
55
+ Accepted | Proposed | Deprecated | Superseded by ADR-XXX
56
+
57
+ ## Date
58
+
59
+ 2024-12-23
60
+
61
+ ## Context
62
+
63
+ What is the issue that we're seeing that is motivating this decision?
64
+
65
+ ## Decision
66
+
67
+ What is the change that we're proposing and/or doing?
68
+
69
+ ## Consequences
70
+
71
+ What becomes easier or more difficult to do because of this change?
72
+
73
+ ## Alternatives Considered
74
+
75
+ What other options were evaluated?
76
+
77
+ ## Evidence
78
+
79
+ Links to PRs, metrics, incidents, or discussions that informed this decision.
80
+ ```
81
+
82
+ ## Decision Record Format
83
+
84
+ ```
85
+ ════════════════════════════════════════════════════════════════
86
+ DECISION RECORD: {TITLE}
87
+ ════════════════════════════════════════════════════════════════
88
+
89
+ 📋 CONTEXT
90
+ Triggered by: {ticket/PR/discussion}
91
+ Problem: {what issue we're solving}
92
+ Scope: {what areas this affects}
93
+
94
+ 🤔 OPTIONS CONSIDERED
95
+
96
+ Option A: {description}
97
+ ✅ Pros: {benefits}
98
+ ❌ Cons: {drawbacks}
99
+ 📊 Evidence: {data/examples}
100
+
101
+ Option B: {description}
102
+ ✅ Pros: {benefits}
103
+ ❌ Cons: {drawbacks}
104
+ 📊 Evidence: {data/examples}
105
+
106
+ Option C: {description}
107
+ ✅ Pros: {benefits}
108
+ ❌ Cons: {drawbacks}
109
+ 📊 Evidence: {data/examples}
110
+
111
+ ✅ DECISION
112
+ Chosen: Option {X}
113
+ Rationale: {why this option}
114
+
115
+ ⚖️ TRADEOFFS
116
+ We accept:
117
+ - {tradeoff_1}
118
+ - {tradeoff_2}
119
+ In exchange for:
120
+ - {benefit_1}
121
+ - {benefit_2}
122
+
123
+ 📈 SUCCESS CRITERIA
124
+ - {metric_1}
125
+ - {metric_2}
126
+
127
+ 🔗 REFERENCES
128
+ - Jira: {ticket}
129
+ - PR: #{number}
130
+ - Confluence: {link}
131
+ - Incident: {if applicable}
132
+
133
+ ════════════════════════════════════════════════════════════════
134
+ ```
135
+
136
+ ## Common Decision Categories
137
+
138
+ ### Architecture Decisions
139
+
140
+ - State management approach
141
+ - Data fetching patterns
142
+ - Component structure
143
+ - Module boundaries
144
+ - API design
145
+
146
+ ### Technology Decisions
147
+
148
+ - Library choices
149
+ - Build tool changes
150
+ - Testing frameworks
151
+ - Styling approaches
152
+
153
+ ### Process Decisions
154
+
155
+ - Code review standards
156
+ - PR size limits
157
+ - Branch strategy
158
+ - Release process
159
+
160
+ ### Migration Decisions
161
+
162
+ - Deprecation plans
163
+ - Upgrade paths
164
+ - Breaking changes
165
+
166
+ ## AI Execution
167
+
168
+ When user runs `/decision-record {TITLE}`:
169
+
170
+ ### Step 1: Gather Context
171
+
172
+ ```
173
+ I'll help you document this decision.
174
+
175
+ 1. What problem or question prompted this decision?
176
+ 2. What options did you consider?
177
+ 3. What did you decide and why?
178
+ 4. What are the tradeoffs?
179
+ ```
180
+
181
+ ### Step 2: Generate ADR
182
+
183
+ ```bash
184
+ # Determine next ADR number
185
+ NEXT_NUM=$(ls docs/decisions/ADR-*.md 2>/dev/null | wc -l | xargs -I{} expr {} + 1)
186
+
187
+ # Create ADR file
188
+ touch docs/decisions/ADR-${NEXT_NUM}-{slug}.md
189
+ ```
190
+
191
+ ### Step 3: Link to Context
192
+
193
+ ```bash
194
+ # If Jira ticket provided
195
+ jira issue comment add {TICKET} "📝 Decision recorded: ADR-${NEXT_NUM}"
196
+
197
+ # If PR provided
198
+ gh pr comment {PR} --body "📝 Decision recorded: ADR-${NEXT_NUM}"
199
+ ```
200
+
201
+ ### Step 4: Confirm
202
+
203
+ ```
204
+ ════════════════════════════════════════════════════════════════
205
+ ✅ DECISION RECORDED
206
+ ════════════════════════════════════════════════════════════════
207
+
208
+ 📄 File: docs/decisions/ADR-042-use-react-query-for-data-fetching.md
209
+ 🔗 Linked to: TICKET-123, PR #23043
210
+
211
+ This decision is now:
212
+ - Searchable in the codebase
213
+ - Referenced in project docs
214
+ - Available for future discussions
215
+
216
+ View all decisions: /decision-record --list
217
+ ```
218
+
219
+ ## Decision Lifecycle
220
+
221
+ ```
222
+ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌────────────┐
223
+ │ Proposed │ ──▶ │ Accepted │ ──▶ │ Active │ ──▶ │ Deprecated │
224
+ └──────────┘ └──────────┘ └──────────┘ └────────────┘
225
+
226
+
227
+ ┌────────────────┐
228
+ │ Superseded by │
229
+ │ ADR-XXX │
230
+ └────────────────┘
231
+ ```
232
+
233
+ ## Searching Decisions
234
+
235
+ ```
236
+ /decision-record --search="state management"
237
+ ```
238
+
239
+ Output:
240
+
241
+ ```
242
+ ════════════════════════════════════════════════════════════════
243
+ DECISIONS MATCHING: "state management"
244
+ ════════════════════════════════════════════════════════════════
245
+
246
+ 1. ADR-015: Use Context for shared component state (Active)
247
+ Date: 2024-03-15
248
+ Scope: Component-level state
249
+
250
+ 2. ADR-023: Use React Query for server state (Active)
251
+ Date: 2024-06-20
252
+ Scope: API data caching
253
+
254
+ 3. ADR-008: Redux for global app state (Deprecated)
255
+ Date: 2023-09-10
256
+ Superseded by: ADR-023
257
+
258
+ View details: /decision-record --view=ADR-023
259
+ ```
260
+
261
+ ## Quick Decision Template
262
+
263
+ For informal decisions that don't need full ADR:
264
+
265
+ ```
266
+ /decision-record "Use OXTypography for all text" --quick
267
+ ```
268
+
269
+ Creates a lightweight record:
270
+
271
+ ```markdown
272
+ # Quick Decision: Use OXTypography for all text
273
+
274
+ **Date:** 2024-12-23
275
+ **Decided by:** @team-lead
276
+ **Reason:** Consistency with design system, automatic theme support
277
+ **Enforcement:** Code review, linting rule
278
+ ```
279
+
280
+ ## Integration with Other Commands
281
+
282
+ | Command | Integration |
283
+ | --------------------------- | --------------------------------------------------------- |
284
+ | `/full-flow` | Prompts for decision record if significant pattern change |
285
+ | `/refactor-new` | Links to relevant ADRs before refactoring |
286
+ | `/pr-review --architecture` | Checks alignment with ADRs |
287
+ | `/pattern-drift` | Flags violations of recorded decisions |
288
+ | `/learn-from-prs` | Suggests new ADRs based on repeated patterns |
289
+
290
+ ## Directory Structure
291
+
292
+ ```
293
+ docs/
294
+ └── decisions/
295
+ ├── README.md # Index and guidelines
296
+ ├── ADR-001-*.md
297
+ ├── ADR-002-*.md
298
+ ├── ...
299
+ └── templates/
300
+ ├── full-adr.md
301
+ └── quick-decision.md
302
+ ```
@@ -0,0 +1,104 @@
1
+ # Find Similar Code to Reuse
2
+
3
+ ## Overview
4
+
5
+ Search the monorepo for similar code patterns, components, utilities, or logic that can be reused instead of reimplementing. Helps maintain DRY principles and identify opportunities for code sharing across apps and libraries.
6
+
7
+ ## Analyze Current Context
8
+
9
+ ### Understanding the Need
10
+
11
+ - [ ] What is the core functionality required?
12
+ - [ ] What problem does it solve?
13
+ - [ ] Are there similar features already implemented in other parts of the codebase?
14
+ - [ ] Is this UI component, business logic, utility function, or API client?
15
+
16
+ ### Search Priority by Type
17
+
18
+ **For UI Components:**
19
+
20
+ 1. Check OXIDE design system first: `src/design-system/src/ui/components/`
21
+ 2. Check shared business components: `src/components/src/components/`
22
+ 3. Search domain libraries: `libraries/yourcompany/*/src/components/`
23
+ 4. Look in similar apps: `apps/*/src/components/`
24
+
25
+ **For Utilities/Helpers:**
26
+
27
+ 1. Common utilities: `libraries/core/core-common/src/` (datetime, validation, encoding, helper)
28
+ 2. Browser utilities: `libraries/core/core-browser/src/` (storage, URL, device, hooks)
29
+ 3. Business utilities: `libraries/yourcompany/*/src/utils/` or `*/src/helpers/`
30
+
31
+ **For API Clients:**
32
+
33
+ 1. Existing API libraries: `libraries/yourcompany/api-*/`
34
+ 2. Check naming pattern: `api-{service-name}`
35
+
36
+ **For Hooks:**
37
+
38
+ 1. Common hooks: `libraries/core/core-common/src/hooks/`
39
+ 2. Browser hooks: `libraries/core/core-browser/src/hooks/`
40
+ 3. Business hooks: `libraries/yourcompany/*/src/hooks/`
41
+
42
+ **For Types/Interfaces:**
43
+
44
+ 1. Common data models: `libraries/core/core-common/src/dataModels/`
45
+ 2. Domain types: `libraries/yourcompany/*/src/types/` or `*/src/dataModels/`
46
+
47
+ **For Styling:**
48
+
49
+ 1. Design tokens: `src/design-system/src/utils/` (spacing, color, borderRadius, rem)
50
+ 2. Enums: `src/design-system/src/enums/` (OXBiggerThan, Kind)
51
+
52
+ ### Search Strategies
53
+
54
+ **Semantic Search** (use codebase_search tool):
55
+
56
+ - "How does [similar feature] work?"
57
+ - "Where is [functionality] implemented?"
58
+ - "What components handle [use case]?"
59
+ - "Which utilities exist for [purpose]?"
60
+
61
+ **Pattern Search** (use grep tool):
62
+
63
+ - Find similar function names
64
+ - Search for interface patterns
65
+ - Look for hook implementations
66
+ - Find component usage patterns
67
+
68
+ ### Decision Framework
69
+
70
+ **✅ Reuse if:**
71
+
72
+ - Matches 80%+ of requirements
73
+ - Minimal modifications needed
74
+
75
+ **🔧 Adapt if:**
76
+
77
+ - Matches 60-80% of requirements
78
+ - Can be extended without breaking changes
79
+ - Located in appropriate library
80
+
81
+ **🆕 Create new if:**
82
+
83
+ - No similar implementation exists
84
+ - Existing code is deprecated or low quality
85
+ - Requirements differ significantly (>50%)
86
+ - Modifications would be too extensive
87
+
88
+ **📦 Extract to library if:**
89
+
90
+ - Similar code exists in 2+ apps
91
+ - Functionality is generic and stable
92
+ - Can benefit other teams
93
+
94
+ ## Output Format
95
+
96
+ Provide findings in this structure:
97
+
98
+ ### Found Similar Code
99
+
100
+ **Location**: `path/to/file`
101
+ **Match %**: 85%
102
+ **Pros**: [List benefits]
103
+ **Cons**: [List limitations]
104
+ **Recommendation**: Reuse / Modify / Create New
@@ -0,0 +1,237 @@
1
+ ---
2
+ description: Suggest optimal PR reviewers based on CODEOWNERS, expertise, and availability
3
+ category: PR Management
4
+ aliases: [reviewers, who-reviews]
5
+ ---
6
+
7
+ # Suggest Reviewers - Smart Reviewer Selection
8
+
9
+ Intelligently suggest optimal reviewers based on code ownership, expertise, and availability.
10
+
11
+ ## Usage
12
+
13
+ ```
14
+ /suggest-reviewers
15
+ /suggest-reviewers {PR_NUMBER}
16
+ /suggest-reviewers --add # Auto-add suggested reviewers
17
+ ```
18
+
19
+ ## How It Works
20
+
21
+ ### 1. Analyze Changed Files
22
+
23
+ ```bash
24
+ # Get files changed in PR
25
+ gh pr view {PR} --json files --jq '.files[].path'
26
+ ```
27
+
28
+ ### 2. Map to CODEOWNERS
29
+
30
+ ```bash
31
+ # For each file, find owner
32
+ for file in $(gh pr view {PR} --json files --jq '.files[].path'); do
33
+ grep "$file" .github/CODEOWNERS | awk '{print $NF}'
34
+ done
35
+ ```
36
+
37
+ ### 3. Check Expertise (Git History)
38
+
39
+ ```bash
40
+ # Find developers with most commits in affected files
41
+ git log --format='%an' --since='6 months ago' -- {FILE} | sort | uniq -c | sort -rn
42
+ ```
43
+
44
+ ### 4. Check Availability
45
+
46
+ ```bash
47
+ # Check reviewer workload (open review requests)
48
+ gh api graphql -f query='
49
+ query {
50
+ user(login: "{USERNAME}") {
51
+ pullRequests(states: OPEN, first: 10) {
52
+ totalCount
53
+ }
54
+ }
55
+ }
56
+ '
57
+ ```
58
+
59
+ ## Suggestion Output
60
+
61
+ ```
62
+ ════════════════════════════════════════════════════════════════
63
+ 📋 REVIEWER SUGGESTIONS FOR PR #23043
64
+ ════════════════════════════════════════════════════════════════
65
+
66
+ Files changed: 6 files across 3 teams
67
+
68
+ ════════════════════════════════════════════════════════════════
69
+ RECOMMENDED REVIEWERS
70
+ ════════════════════════════════════════════════════════════════
71
+
72
+ 🥇 PRIMARY (Required - CODEOWNER)
73
+ ┌─────────────────────────────────────────────────────────────┐
74
+ │ @team-lead │
75
+ │ Team: @YourOrg/team-a │
76
+ │ Owns: src/features/checkout/* (4 files changed) │
77
+ │ Expertise: 45 commits in affected files │
78
+ │ Workload: 2 pending reviews (✅ Available) │
79
+ └─────────────────────────────────────────────────────────────┘
80
+
81
+ 🥈 SECONDARY (Recommended)
82
+ ┌─────────────────────────────────────────────────────────────┐
83
+ │ @teammate-1 │
84
+ │ Team: @YourOrg/team-b │
85
+ │ Owns: src/components/* (2 files) │
86
+ │ Expertise: 30 commits in affected files │
87
+ │ Workload: 1 pending review (✅ Available) │
88
+ └─────────────────────────────────────────────────────────────┘
89
+
90
+ 🥉 OPTIONAL (Good to have)
91
+ ┌─────────────────────────────────────────────────────────────┐
92
+ │ @senior-dev │
93
+ │ Team: @YourOrg/platform │
94
+ │ Reason: Recent work on similar tooltip feature │
95
+ │ Expertise: 12 commits in affected patterns │
96
+ │ Workload: 5 pending reviews (⚠️ Busy) │
97
+ └─────────────────────────────────────────────────────────────┘
98
+
99
+ ════════════════════════════════════════════════════════════════
100
+ SKIP SUGGESTIONS
101
+ ════════════════════════════════════════════════════════════════
102
+
103
+ ❌ @busy-dev - 8 pending reviews (overloaded)
104
+ ❌ @vacation-dev - OOO until Jan 5
105
+ ❌ @new-dev - < 1 month on team (limited context)
106
+
107
+ ════════════════════════════════════════════════════════════════
108
+
109
+ Add recommended reviewers? (y/n)
110
+ - Primary: @team-lead
111
+ - Secondary: @teammate-1
112
+ ```
113
+
114
+ ## Selection Criteria
115
+
116
+ ### Scoring System
117
+
118
+ | Factor | Weight | Description |
119
+ | ------------ | ------ | ------------------------------- |
120
+ | CODEOWNER | 40% | Required for files they own |
121
+ | Expertise | 25% | Commits in affected files (6mo) |
122
+ | Recency | 15% | Recent work in area |
123
+ | Availability | 15% | Pending review count |
124
+ | Team Balance | 5% | Avoid overloading one person |
125
+
126
+ ### Expertise Score
127
+
128
+ ```
129
+ Commits in last 6 months:
130
+ 50+ commits → Expert (score: 100)
131
+ 20-49 commits → Proficient (score: 75)
132
+ 5-19 commits → Familiar (score: 50)
133
+ 1-4 commits → Aware (score: 25)
134
+ 0 commits → Unknown (score: 0)
135
+ ```
136
+
137
+ ### Availability Score
138
+
139
+ ```
140
+ Pending reviews:
141
+ 0-2 reviews → Available (score: 100)
142
+ 3-4 reviews → Moderate (score: 70)
143
+ 5-6 reviews → Busy (score: 40)
144
+ 7+ reviews → Overloaded (score: 10)
145
+ ```
146
+
147
+ ## Smart Features
148
+
149
+ ### 1. Cross-Team Coverage
150
+
151
+ ```
152
+ Your PR affects multiple teams:
153
+ - @YourOrg/team-a (4 files)
154
+ - @YourOrg/team-b (2 files)
155
+
156
+ Suggesting one reviewer from each team for complete coverage.
157
+ ```
158
+
159
+ ### 2. Related PR Context
160
+
161
+ ```
162
+ Found related PRs by these developers:
163
+ - @teammate-1: PR #22900 (similar tooltip work)
164
+ - @senior-dev: PR #22800 (ProtectionPackageCard refactor)
165
+
166
+ Consider adding for context continuity.
167
+ ```
168
+
169
+ ### 3. Review History
170
+
171
+ ```
172
+ Previous reviewers for this component:
173
+ - @team-lead (reviewed 5 PRs)
174
+ - @teammate-1 (reviewed 3 PRs)
175
+
176
+ Maintaining consistency with established reviewers.
177
+ ```
178
+
179
+ ### 4. Load Balancing
180
+
181
+ ```
182
+ Team review distribution (this week):
183
+ @team-lead: 8 reviews
184
+ @teammate-1: 3 reviews
185
+ @teammate-2: 2 reviews
186
+
187
+ Suggesting @teammate-2 to balance load.
188
+ ```
189
+
190
+ ## Commands Reference
191
+
192
+ ```bash
193
+ # Add reviewers to PR
194
+ gh pr edit {PR} --add-reviewer @user1,@user2
195
+
196
+ # Check current reviewers
197
+ gh pr view {PR} --json reviewRequests
198
+
199
+ # Check user's pending reviews
200
+ gh api /users/{USER}/received_events | jq '[.[] | select(.type=="PullRequestReviewEvent")] | length'
201
+ ```
202
+
203
+ ## Integration with /full-flow
204
+
205
+ After PR creation:
206
+
207
+ ```
208
+ ════════════════════════════════════════════════════════════════
209
+ 📤 PR CREATED: #23043
210
+ ════════════════════════════════════════════════════════════════
211
+
212
+ Suggested reviewers based on files changed:
213
+ ✅ @team-lead (CODEOWNER, available)
214
+ ✅ @teammate-1 (expertise in area)
215
+
216
+ Add these reviewers? (y/n)
217
+ ```
218
+
219
+ ## Auto-Add Mode
220
+
221
+ ```
222
+ /suggest-reviewers --add
223
+ ```
224
+
225
+ Automatically adds:
226
+
227
+ - All CODEOWNER reviewers (required)
228
+ - Top 1-2 expertise-based reviewers
229
+ - Skips overloaded reviewers
230
+
231
+ ## Learning
232
+
233
+ I remember your preferences:
234
+
235
+ - "always add @team-lead" → Added to default list
236
+ - "never add @slow-reviewer" → Excluded from suggestions
237
+ - "prefer @fast-reviewer" → Boosted in scoring