codingbuddy-rules 4.5.0 → 5.1.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.
Files changed (129) hide show
  1. package/.ai-rules/adapters/aider.md +374 -0
  2. package/.ai-rules/adapters/antigravity.md +6 -6
  3. package/.ai-rules/adapters/claude-code.md +68 -4
  4. package/.ai-rules/adapters/codex.md +5 -5
  5. package/.ai-rules/adapters/cursor.md +2 -2
  6. package/.ai-rules/adapters/kiro.md +8 -8
  7. package/.ai-rules/adapters/opencode.md +7 -7
  8. package/.ai-rules/adapters/q.md +2 -2
  9. package/.ai-rules/adapters/windsurf.md +395 -0
  10. package/.ai-rules/agents/README.md +66 -16
  11. package/.ai-rules/agents/accessibility-specialist.json +8 -1
  12. package/.ai-rules/agents/act-mode.json +8 -1
  13. package/.ai-rules/agents/agent-architect.json +14 -7
  14. package/.ai-rules/agents/ai-ml-engineer.json +7 -0
  15. package/.ai-rules/agents/architecture-specialist.json +7 -0
  16. package/.ai-rules/agents/auto-mode.json +10 -2
  17. package/.ai-rules/agents/backend-developer.json +7 -0
  18. package/.ai-rules/agents/code-quality-specialist.json +7 -0
  19. package/.ai-rules/agents/code-reviewer.json +86 -64
  20. package/.ai-rules/agents/data-engineer.json +14 -7
  21. package/.ai-rules/agents/data-scientist.json +16 -9
  22. package/.ai-rules/agents/devops-engineer.json +7 -0
  23. package/.ai-rules/agents/documentation-specialist.json +7 -0
  24. package/.ai-rules/agents/eval-mode.json +30 -19
  25. package/.ai-rules/agents/event-architecture-specialist.json +7 -0
  26. package/.ai-rules/agents/frontend-developer.json +7 -0
  27. package/.ai-rules/agents/i18n-specialist.json +8 -1
  28. package/.ai-rules/agents/integration-specialist.json +7 -0
  29. package/.ai-rules/agents/migration-specialist.json +7 -0
  30. package/.ai-rules/agents/mobile-developer.json +8 -10
  31. package/.ai-rules/agents/observability-specialist.json +7 -0
  32. package/.ai-rules/agents/parallel-orchestrator.json +352 -0
  33. package/.ai-rules/agents/performance-specialist.json +7 -0
  34. package/.ai-rules/agents/plan-mode.json +9 -1
  35. package/.ai-rules/agents/plan-reviewer.json +211 -0
  36. package/.ai-rules/agents/platform-engineer.json +7 -0
  37. package/.ai-rules/agents/security-engineer.json +15 -8
  38. package/.ai-rules/agents/security-specialist.json +8 -1
  39. package/.ai-rules/agents/seo-specialist.json +7 -0
  40. package/.ai-rules/agents/software-engineer.json +7 -0
  41. package/.ai-rules/agents/solution-architect.json +17 -10
  42. package/.ai-rules/agents/systems-developer.json +15 -8
  43. package/.ai-rules/agents/technical-planner.json +17 -10
  44. package/.ai-rules/agents/test-engineer.json +13 -6
  45. package/.ai-rules/agents/test-strategy-specialist.json +7 -0
  46. package/.ai-rules/agents/tooling-engineer.json +10 -3
  47. package/.ai-rules/agents/ui-ux-designer.json +7 -0
  48. package/.ai-rules/keyword-modes.json +4 -4
  49. package/.ai-rules/rules/clarification-guide.md +14 -14
  50. package/.ai-rules/rules/core.md +73 -0
  51. package/.ai-rules/rules/parallel-execution.md +217 -0
  52. package/.ai-rules/schemas/agent.schema.json +38 -0
  53. package/.ai-rules/skills/README.md +29 -1
  54. package/.ai-rules/skills/agent-design/SKILL.md +5 -0
  55. package/.ai-rules/skills/agent-design/examples/agent-template.json +55 -0
  56. package/.ai-rules/skills/agent-design/references/expertise-guidelines.md +112 -0
  57. package/.ai-rules/skills/agent-discussion/SKILL.md +199 -0
  58. package/.ai-rules/skills/agent-discussion-panel/SKILL.md +448 -0
  59. package/.ai-rules/skills/api-design/SKILL.md +5 -0
  60. package/.ai-rules/skills/api-design/examples/error-response.json +159 -0
  61. package/.ai-rules/skills/api-design/examples/openapi-template.yaml +393 -0
  62. package/.ai-rules/skills/build-fix/SKILL.md +234 -0
  63. package/.ai-rules/skills/code-explanation/SKILL.md +4 -0
  64. package/.ai-rules/skills/context-management/SKILL.md +1 -0
  65. package/.ai-rules/skills/cost-budget/SKILL.md +348 -0
  66. package/.ai-rules/skills/cross-repo-issues/SKILL.md +257 -0
  67. package/.ai-rules/skills/database-migration/SKILL.md +1 -0
  68. package/.ai-rules/skills/deepsearch/SKILL.md +214 -0
  69. package/.ai-rules/skills/deployment-checklist/SKILL.md +1 -0
  70. package/.ai-rules/skills/error-analysis/SKILL.md +1 -0
  71. package/.ai-rules/skills/finishing-a-development-branch/SKILL.md +281 -0
  72. package/.ai-rules/skills/frontend-design/SKILL.md +5 -0
  73. package/.ai-rules/skills/frontend-design/examples/component-template.tsx +203 -0
  74. package/.ai-rules/skills/frontend-design/references/css-patterns.md +243 -0
  75. package/.ai-rules/skills/git-master/SKILL.md +358 -0
  76. package/.ai-rules/skills/incident-response/SKILL.md +1 -0
  77. package/.ai-rules/skills/legacy-modernization/SKILL.md +1 -0
  78. package/.ai-rules/skills/mcp-builder/SKILL.md +7 -0
  79. package/.ai-rules/skills/mcp-builder/examples/resource-example.ts +233 -0
  80. package/.ai-rules/skills/mcp-builder/examples/tool-example.ts +198 -0
  81. package/.ai-rules/skills/mcp-builder/references/protocol-spec.md +215 -0
  82. package/.ai-rules/skills/onboard/SKILL.md +150 -0
  83. package/.ai-rules/skills/performance-optimization/SKILL.md +3 -0
  84. package/.ai-rules/skills/plan-and-review/SKILL.md +115 -0
  85. package/.ai-rules/skills/plan-to-issues/SKILL.md +318 -0
  86. package/.ai-rules/skills/pr-all-in-one/SKILL.md +15 -13
  87. package/.ai-rules/skills/pr-all-in-one/configuration-guide.md +7 -7
  88. package/.ai-rules/skills/pr-all-in-one/pr-templates.md +10 -10
  89. package/.ai-rules/skills/pr-review/SKILL.md +4 -0
  90. package/.ai-rules/skills/receiving-code-review/SKILL.md +347 -0
  91. package/.ai-rules/skills/refactoring/SKILL.md +1 -0
  92. package/.ai-rules/skills/requesting-code-review/SKILL.md +348 -0
  93. package/.ai-rules/skills/retrospective/SKILL.md +192 -0
  94. package/.ai-rules/skills/rule-authoring/SKILL.md +5 -0
  95. package/.ai-rules/skills/rule-authoring/examples/rule-template.md +142 -0
  96. package/.ai-rules/skills/rule-authoring/examples/trigger-patterns.md +126 -0
  97. package/.ai-rules/skills/security-audit/SKILL.md +4 -0
  98. package/.ai-rules/skills/ship/SKILL.md +242 -0
  99. package/.ai-rules/skills/skill-creator/SKILL.md +461 -0
  100. package/.ai-rules/skills/skill-creator/agents/analyzer.md +206 -0
  101. package/.ai-rules/skills/skill-creator/agents/comparator.md +167 -0
  102. package/.ai-rules/skills/skill-creator/agents/grader.md +152 -0
  103. package/.ai-rules/skills/skill-creator/assets/eval_review.html +568 -0
  104. package/.ai-rules/skills/skill-creator/assets/skill-template.md +43 -0
  105. package/.ai-rules/skills/skill-creator/eval-viewer/generate_review.py +496 -0
  106. package/.ai-rules/skills/skill-creator/references/frontmatter-guide.md +632 -0
  107. package/.ai-rules/skills/skill-creator/references/multi-tool-compat.md +480 -0
  108. package/.ai-rules/skills/skill-creator/references/schemas.md +784 -0
  109. package/.ai-rules/skills/skill-creator/scripts/aggregate_benchmark.py +302 -0
  110. package/.ai-rules/skills/skill-creator/scripts/init_skill.sh +196 -0
  111. package/.ai-rules/skills/skill-creator/scripts/run_loop.py +327 -0
  112. package/.ai-rules/skills/systematic-debugging/SKILL.md +1 -0
  113. package/.ai-rules/skills/tech-debt/SKILL.md +1 -0
  114. package/.ai-rules/skills/test-coverage-gate/SKILL.md +303 -0
  115. package/.ai-rules/skills/tmux-master/SKILL.md +491 -0
  116. package/.ai-rules/skills/using-git-worktrees/SKILL.md +368 -0
  117. package/.ai-rules/skills/verification-before-completion/SKILL.md +234 -0
  118. package/.ai-rules/skills/widget-slot-architecture/SKILL.md +6 -0
  119. package/.ai-rules/skills/widget-slot-architecture/examples/parallel-route-setup.tsx +206 -0
  120. package/.ai-rules/skills/widget-slot-architecture/examples/widget-component.tsx +250 -0
  121. package/.ai-rules/skills/writing-plans/SKILL.md +78 -0
  122. package/bin/cli.js +170 -0
  123. package/lib/init/detect-stack.js +162 -0
  124. package/lib/init/generate-config.js +31 -0
  125. package/lib/init/index.js +86 -0
  126. package/lib/init/prompt.js +60 -0
  127. package/lib/init/scaffold.js +67 -0
  128. package/lib/init/suggest-agent.js +57 -0
  129. package/package.json +10 -2
@@ -0,0 +1,243 @@
1
+ # CSS Design Patterns Reference
2
+
3
+ Reusable CSS patterns for building distinctive, production-grade interfaces. These patterns avoid generic "AI slop" aesthetics and prioritize intentional design choices.
4
+
5
+ ## Typography Systems
6
+
7
+ ### Font Pairing Strategy
8
+
9
+ ```css
10
+ /* Display + Body pairing — choose contrast, not similarity */
11
+ :root {
12
+ --font-display: 'Playfair Display', serif; /* Headlines: high personality */
13
+ --font-body: 'Source Sans 3', sans-serif; /* Body: high readability */
14
+ --font-mono: 'JetBrains Mono', monospace; /* Code: developer-friendly */
15
+ }
16
+
17
+ /* Typographic scale (Major Third — ratio 1.25) */
18
+ :root {
19
+ --text-xs: 0.64rem; /* 10.24px */
20
+ --text-sm: 0.8rem; /* 12.8px */
21
+ --text-base: 1rem; /* 16px */
22
+ --text-md: 1.25rem; /* 20px */
23
+ --text-lg: 1.563rem; /* 25px */
24
+ --text-xl: 1.953rem; /* 31.25px */
25
+ --text-2xl: 2.441rem; /* 39px */
26
+ --text-3xl: 3.052rem; /* 48.83px */
27
+ }
28
+ ```
29
+
30
+ ### Fluid Typography
31
+
32
+ ```css
33
+ /* Responsive type that scales smoothly between breakpoints */
34
+ h1 {
35
+ font-size: clamp(2rem, 1rem + 3vw, 4rem);
36
+ line-height: 1.1;
37
+ letter-spacing: -0.02em;
38
+ }
39
+
40
+ p {
41
+ font-size: clamp(1rem, 0.9rem + 0.25vw, 1.125rem);
42
+ line-height: 1.65;
43
+ max-width: 65ch; /* Optimal reading width */
44
+ }
45
+ ```
46
+
47
+ ## Color Systems
48
+
49
+ ### HSL-Based Theme Tokens
50
+
51
+ ```css
52
+ /* HSL gives intuitive control over lightness/saturation variants */
53
+ :root {
54
+ --hue-primary: 230;
55
+ --hue-accent: 350;
56
+
57
+ --color-primary: hsl(var(--hue-primary), 65%, 50%);
58
+ --color-primary-light: hsl(var(--hue-primary), 65%, 95%);
59
+ --color-primary-dark: hsl(var(--hue-primary), 65%, 30%);
60
+
61
+ --color-accent: hsl(var(--hue-accent), 80%, 55%);
62
+
63
+ --color-surface: hsl(0, 0%, 100%);
64
+ --color-surface-raised: hsl(0, 0%, 98%);
65
+ --color-text: hsl(0, 0%, 12%);
66
+ --color-text-muted: hsl(0, 0%, 45%);
67
+ }
68
+
69
+ /* Dark mode — adjust lightness, not hue */
70
+ @media (prefers-color-scheme: dark) {
71
+ :root {
72
+ --color-primary: hsl(var(--hue-primary), 70%, 65%);
73
+ --color-surface: hsl(0, 0%, 8%);
74
+ --color-surface-raised: hsl(0, 0%, 14%);
75
+ --color-text: hsl(0, 0%, 92%);
76
+ --color-text-muted: hsl(0, 0%, 60%);
77
+ }
78
+ }
79
+ ```
80
+
81
+ ## Layout Patterns
82
+
83
+ ### Asymmetric Grid
84
+
85
+ ```css
86
+ /* Break the 12-column monotony */
87
+ .asymmetric-grid {
88
+ display: grid;
89
+ grid-template-columns: 2fr 1fr;
90
+ gap: clamp(1.5rem, 3vw, 4rem);
91
+ }
92
+
93
+ /* Overlap elements for depth */
94
+ .overlap-layout {
95
+ display: grid;
96
+ grid-template-columns: repeat(12, 1fr);
97
+ }
98
+ .overlap-layout > .primary {
99
+ grid-column: 1 / 9;
100
+ grid-row: 1;
101
+ }
102
+ .overlap-layout > .accent {
103
+ grid-column: 7 / 13;
104
+ grid-row: 1;
105
+ margin-top: 4rem; /* Intentional offset */
106
+ z-index: 1;
107
+ }
108
+ ```
109
+
110
+ ### Container Queries
111
+
112
+ ```css
113
+ /* Component-level responsive design */
114
+ .card-container {
115
+ container-type: inline-size;
116
+ container-name: card;
117
+ }
118
+
119
+ @container card (min-width: 400px) {
120
+ .card { flex-direction: row; }
121
+ .card__image { width: 40%; }
122
+ }
123
+
124
+ @container card (min-width: 700px) {
125
+ .card { gap: 2rem; }
126
+ .card__image { width: 50%; }
127
+ }
128
+ ```
129
+
130
+ ## Motion & Animation
131
+
132
+ ### Staggered Reveal
133
+
134
+ ```css
135
+ /* Page load animation with staggered children */
136
+ @keyframes reveal-up {
137
+ from {
138
+ opacity: 0;
139
+ transform: translateY(1.5rem);
140
+ }
141
+ to {
142
+ opacity: 1;
143
+ transform: translateY(0);
144
+ }
145
+ }
146
+
147
+ .stagger-reveal > * {
148
+ opacity: 0;
149
+ animation: reveal-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
150
+ }
151
+
152
+ .stagger-reveal > *:nth-child(1) { animation-delay: 0.1s; }
153
+ .stagger-reveal > *:nth-child(2) { animation-delay: 0.2s; }
154
+ .stagger-reveal > *:nth-child(3) { animation-delay: 0.3s; }
155
+ .stagger-reveal > *:nth-child(4) { animation-delay: 0.4s; }
156
+ ```
157
+
158
+ ### Hover Interactions
159
+
160
+ ```css
161
+ /* Magnetic lift with shadow depth */
162
+ .interactive-card {
163
+ transition:
164
+ transform 0.25s cubic-bezier(0.33, 1, 0.68, 1),
165
+ box-shadow 0.25s ease;
166
+ }
167
+
168
+ .interactive-card:hover {
169
+ transform: translateY(-4px);
170
+ box-shadow:
171
+ 0 4px 6px -1px rgba(0, 0, 0, 0.06),
172
+ 0 10px 15px -3px rgba(0, 0, 0, 0.08),
173
+ 0 20px 25px -5px rgba(0, 0, 0, 0.04);
174
+ }
175
+
176
+ .interactive-card:active {
177
+ transform: translateY(-1px);
178
+ transition-duration: 0.1s;
179
+ }
180
+ ```
181
+
182
+ ## Background & Texture
183
+
184
+ ### Gradient Mesh
185
+
186
+ ```css
187
+ /* Multi-stop gradient for organic feel */
188
+ .gradient-mesh {
189
+ background:
190
+ radial-gradient(ellipse at 20% 50%, hsla(200, 80%, 70%, 0.3), transparent 50%),
191
+ radial-gradient(ellipse at 80% 20%, hsla(340, 80%, 70%, 0.2), transparent 50%),
192
+ radial-gradient(ellipse at 50% 80%, hsla(260, 60%, 60%, 0.25), transparent 50%),
193
+ hsl(0, 0%, 98%);
194
+ }
195
+ ```
196
+
197
+ ### Noise Texture Overlay
198
+
199
+ ```css
200
+ /* Subtle grain for depth — use a tiny noise PNG or SVG data URI */
201
+ .grain-overlay::after {
202
+ content: '';
203
+ position: absolute;
204
+ inset: 0;
205
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
206
+ pointer-events: none;
207
+ z-index: 1;
208
+ }
209
+ ```
210
+
211
+ ## Utility Patterns
212
+
213
+ ### Accessible Focus Styles
214
+
215
+ ```css
216
+ /* Visible focus ring that works on any background */
217
+ :focus-visible {
218
+ outline: 2px solid var(--color-primary);
219
+ outline-offset: 3px;
220
+ border-radius: 2px;
221
+ }
222
+
223
+ /* Remove default outline only when :focus-visible is supported */
224
+ :focus:not(:focus-visible) {
225
+ outline: none;
226
+ }
227
+ ```
228
+
229
+ ### Scroll-Triggered Animations
230
+
231
+ ```css
232
+ /* Native CSS scroll-driven animations (modern browsers) */
233
+ @keyframes fade-in-up {
234
+ from { opacity: 0; transform: translateY(2rem); }
235
+ to { opacity: 1; transform: translateY(0); }
236
+ }
237
+
238
+ .scroll-reveal {
239
+ animation: fade-in-up linear both;
240
+ animation-timeline: view();
241
+ animation-range: entry 0% entry 40%;
242
+ }
243
+ ```
@@ -0,0 +1,358 @@
1
+ ---
2
+ name: git-master
3
+ description: Use when performing git operations - commits, rebasing, cherry-picking, history cleanup, or conflict resolution. Ensures atomic commits, clean history, and consistent commit message style.
4
+ allowed-tools: Read, Grep, Glob, Bash
5
+ ---
6
+
7
+ # Git Master
8
+
9
+ ## Overview
10
+
11
+ Messy git history obscures intent, makes debugging harder, and wastes reviewer time. Clean history tells the story of WHY changes were made, not just WHAT changed.
12
+
13
+ **Core principle:** Every commit should be a single, complete, logical change that can be understood, reverted, or cherry-picked independently.
14
+
15
+ **Violating the letter of this process is violating the spirit of clean version control.**
16
+
17
+ ## The Iron Law
18
+
19
+ ```
20
+ ONE LOGICAL CHANGE PER COMMIT. NO EXCEPTIONS.
21
+ ```
22
+
23
+ If a commit does two things, it should be two commits. If a commit is incomplete, it should not exist yet.
24
+
25
+ **No exceptions:**
26
+ - "I'll split it later" → Split it now
27
+ - "It's a small extra change" → Separate commit
28
+ - "They're related" → Related is not identical
29
+
30
+ ## When to Use
31
+
32
+ Use for ANY git operation beyond trivial:
33
+ - Creating commits (single or multiple)
34
+ - Rebasing branches (interactive or standard)
35
+ - Cherry-picking commits across branches
36
+ - Cleaning up history (amend, squash, fixup)
37
+ - Resolving merge conflicts
38
+ - Preparing branches for review
39
+
40
+ **Use this ESPECIALLY when:**
41
+ - Repository has established commit conventions
42
+ - Branch has messy work-in-progress commits before PR
43
+ - Cherry-picking between release branches
44
+ - Resolving complex merge conflicts
45
+ - History needs cleanup before merging
46
+
47
+ **Don't skip when:**
48
+ - "It's just a quick fix" (quick fixes deserve clean commits too)
49
+ - "Nobody reads commit history" (future-you does, during `git bisect`)
50
+ - "I'll squash on merge anyway" (squash merges lose valuable context)
51
+
52
+ ## When NOT to Use
53
+
54
+ - **Initial prototyping** — Experiment freely, clean up before PR
55
+ - **Throwaway branches** — No need for perfect history on disposable work
56
+ - **Automated commits** — CI/CD generated commits follow their own patterns
57
+
58
+ ## The Six Phases
59
+
60
+ ### Phase 1: Style Detection
61
+
62
+ **BEFORE making any commit, understand the repo's conventions:**
63
+
64
+ 1. **Analyze Recent History**
65
+ ```bash
66
+ git log --oneline -20
67
+ ```
68
+
69
+ 2. **Detect Commit Message Pattern**
70
+
71
+ | Pattern | Example | Convention |
72
+ |---------|---------|------------|
73
+ | **Conventional Commits** | `feat(auth): add OAuth2 flow` | `type(scope): description` |
74
+ | **Imperative mood** | `Add user validation` | Verb-first, present tense |
75
+ | **Ticket prefix** | `[PROJ-123] Fix login bug` | `[TICKET] description` |
76
+ | **Emoji prefix** | `:bug: Fix null pointer` | Emoji + description |
77
+ | **Freeform** | `Fixed the login thing` | No consistent pattern |
78
+
79
+ 3. **Match the Detected Style**
80
+ - Use the same pattern for your commits
81
+ - If no pattern detected, default to Conventional Commits
82
+ - Never mix styles within a PR
83
+
84
+ **Completion criteria:**
85
+ - [ ] `style_detected` — Commit message pattern identified
86
+ - [ ] `convention_noted` — Will follow detected convention
87
+
88
+ ### Phase 2: Atomic Commits
89
+
90
+ **Every commit must be atomic — one logical change, complete and self-contained.**
91
+
92
+ 1. **Stage Selectively**
93
+ ```bash
94
+ # Stage specific files, not everything
95
+ git add src/auth/login.ts src/auth/login.test.ts
96
+
97
+ # For partial file staging
98
+ git add -p src/utils/helpers.ts
99
+ ```
100
+
101
+ **Never use `git add .` or `git add -A` unless you have verified every change belongs together.**
102
+
103
+ 2. **Verify Staged Content**
104
+ ```bash
105
+ git diff --cached # Review what you're about to commit
106
+ git diff # Check what's NOT staged
107
+ ```
108
+
109
+ 3. **Write the Commit Message**
110
+
111
+ **Structure:**
112
+ ```
113
+ <type>(<scope>): <what changed> (max 72 chars)
114
+
115
+ <why this change was needed>
116
+ <any important context>
117
+
118
+ Refs: #issue-number (if applicable)
119
+ ```
120
+
121
+ **Good vs Bad:**
122
+
123
+ | Bad | Good |
124
+ |-----|------|
125
+ | `fix stuff` | `fix(auth): prevent session timeout on token refresh` |
126
+ | `WIP` | `feat(cart): add quantity validation for checkout` |
127
+ | `updates` | `refactor(api): extract retry logic into shared middleware` |
128
+ | `fix tests` | `test(auth): cover edge case for expired JWT tokens` |
129
+
130
+ 4. **Verify Atomicity**
131
+ - Does this commit do exactly ONE thing?
132
+ - Could someone revert JUST this commit safely?
133
+ - Does the codebase compile/pass tests at this commit?
134
+
135
+ **Completion criteria:**
136
+ - [ ] `changes_staged_selectively` — No unrelated changes staged
137
+ - [ ] `message_follows_convention` — Matches repo's detected style
138
+ - [ ] `commit_is_atomic` — Single logical change
139
+
140
+ ### Phase 3: Rebase Workflows
141
+
142
+ **Use rebase to maintain a clean, linear history.**
143
+
144
+ 1. **Standard Rebase (update branch)**
145
+ ```bash
146
+ git fetch origin
147
+ git rebase origin/main
148
+ ```
149
+
150
+ 2. **Interactive Rebase (clean up commits)**
151
+ ```bash
152
+ git rebase -i HEAD~N # N = number of commits to review
153
+ ```
154
+
155
+ **Action guide:**
156
+
157
+ | Action | When to Use |
158
+ |--------|-------------|
159
+ | `pick` | Keep commit as-is |
160
+ | `reword` | Fix commit message only |
161
+ | `squash` | Merge into previous, combine messages |
162
+ | `fixup` | Merge into previous, discard message |
163
+ | `drop` | Remove commit entirely |
164
+
165
+ 3. **Safe Rebase Checklist**
166
+ - [ ] Branch is NOT shared with others (or team agrees on force-push)
167
+ - [ ] All changes are committed (no uncommitted work)
168
+ - [ ] You understand what each commit does before reordering
169
+
170
+ > **AI Agent Note:** Interactive commands (`rebase -i`, `add -p`) require terminal interaction. AI agents without interactive input support should use non-interactive alternatives (e.g., `git rebase --onto`, `git add <specific-files>`) or prepare the rebase todo list programmatically.
171
+
172
+ 4. **If Rebase Goes Wrong**
173
+ ```bash
174
+ git rebase --abort # Cancel in-progress rebase
175
+ git reflog # Find pre-rebase state
176
+ git reset --hard HEAD@{N} # Restore (DESTRUCTIVE — uncommitted changes lost)
177
+ ```
178
+
179
+ **Completion criteria:**
180
+ - [ ] `history_is_linear` — No unnecessary merge commits
181
+ - [ ] `commits_are_clean` — WIP commits squashed
182
+
183
+ ### Phase 4: Cherry-Pick
184
+
185
+ **Safely move individual commits between branches.**
186
+
187
+ 1. **Before Cherry-Picking**
188
+ - Identify the exact commit(s): `git log --oneline source-branch`
189
+ - Verify the commit is self-contained (atomic)
190
+ - Check for dependencies on other commits
191
+
192
+ 2. **Execute Cherry-Pick**
193
+ ```bash
194
+ git cherry-pick <commit-hash>
195
+
196
+ # For multiple commits
197
+ git cherry-pick <hash1> <hash2> <hash3>
198
+
199
+ # For a range
200
+ git cherry-pick <older-hash>..<newer-hash>
201
+ ```
202
+
203
+ 3. **Handle Cherry-Pick Conflicts**
204
+ ```bash
205
+ # View conflicting files
206
+ git status
207
+
208
+ # Resolve conflicts, then
209
+ git add <resolved-files>
210
+ git cherry-pick --continue
211
+
212
+ # Or abort if too complex
213
+ git cherry-pick --abort
214
+ ```
215
+
216
+ 4. **Verify After Cherry-Pick**
217
+ - Tests pass on the target branch
218
+ - No unintended side effects
219
+ - Commit message still makes sense in new context
220
+
221
+ **Completion criteria:**
222
+ - [ ] `commit_identified` — Correct commit(s) selected
223
+ - [ ] `conflicts_resolved` — All conflicts handled
224
+ - [ ] `tests_pass` — Target branch is green
225
+
226
+ ### Phase 5: History Cleanup
227
+
228
+ **Fix mistakes without breaking history for others.**
229
+
230
+ 1. **Amend Last Commit**
231
+ ```bash
232
+ # Add forgotten changes
233
+ git add <forgotten-file>
234
+ git commit --amend
235
+
236
+ # Fix message only
237
+ git commit --amend -m "corrected message"
238
+ ```
239
+ **Only amend unpushed commits.** Amending pushed commits requires force-push.
240
+
241
+ 2. **Fixup Older Commits**
242
+ ```bash
243
+ # Create a fixup commit
244
+ git commit --fixup=<target-hash>
245
+
246
+ # Auto-squash during rebase
247
+ git rebase -i --autosquash HEAD~N
248
+ ```
249
+
250
+ 3. **Recovery with Reflog**
251
+ ```bash
252
+ # View recent HEAD movements
253
+ git reflog
254
+
255
+ # Restore accidentally deleted commit
256
+ git cherry-pick <reflog-hash>
257
+
258
+ # Restore to a previous state (DESTRUCTIVE — all uncommitted changes are lost)
259
+ git reset --hard HEAD@{N}
260
+ ```
261
+
262
+ 4. **Safety Rules**
263
+ - Never rewrite history on shared branches without team agreement
264
+ - Always verify `git reflog` shows the state you want to restore
265
+ - Create a backup branch before destructive operations: `git branch backup-before-cleanup`
266
+
267
+ **Completion criteria:**
268
+ - [ ] `history_corrected` — Mistakes fixed
269
+ - [ ] `no_shared_history_rewritten` — Shared branches untouched
270
+ - [ ] `backup_created` — Safety branch exists for risky operations
271
+
272
+ ### Phase 6: Conflict Resolution
273
+
274
+ **Resolve merge conflicts systematically, not by guessing.**
275
+
276
+ 1. **Understand the Conflict**
277
+ ```bash
278
+ # See which files conflict
279
+ git status
280
+
281
+ # See what both sides changed
282
+ git diff --merge
283
+ git log --merge --oneline
284
+ ```
285
+
286
+ 2. **Resolve Each File**
287
+ - Read BOTH sides of the conflict markers
288
+ - Understand WHY each side made their change
289
+ - Choose the resolution that preserves BOTH intents
290
+ - If unsure, check the original commits for context
291
+
292
+ 3. **Resolution Strategies**
293
+
294
+ | Situation | Strategy |
295
+ |-----------|----------|
296
+ | One side is clearly correct | Take that side |
297
+ | Both changes needed | Combine manually |
298
+ | Changes are incompatible | Consult the other author |
299
+ | Complex logic conflict | Write a new implementation that satisfies both |
300
+
301
+ 4. **After Resolving**
302
+ ```bash
303
+ git add <resolved-files>
304
+ git commit # or git rebase --continue / git merge --continue
305
+ ```
306
+
307
+ 5. **Verify Resolution**
308
+ - Run tests — conflicts often introduce subtle bugs
309
+ - Review the merge commit diff — ensure nothing was lost
310
+ - Check that both features still work as intended
311
+
312
+ **Completion criteria:**
313
+ - [ ] `all_conflicts_resolved` — No remaining conflict markers
314
+ - [ ] `both_intents_preserved` — No changes silently dropped
315
+ - [ ] `tests_pass` — Resolution doesn't break anything
316
+
317
+ ## Verification Checklist
318
+
319
+ Before completing any git operation:
320
+
321
+ - [ ] Commit message matches repo's detected convention
322
+ - [ ] Each commit contains exactly one logical change
323
+ - [ ] No `git add .` used without reviewing all changes
324
+ - [ ] Shared branch history not rewritten without team agreement
325
+ - [ ] Tests pass at every commit (not just the last one)
326
+ - [ ] No conflict markers left in code (`<<<<<<<`, `=======`, `>>>>>>>`)
327
+ - [ ] Backup branch created before destructive operations
328
+
329
+ ## Red Flags — STOP
330
+
331
+ | Thought | Reality |
332
+ |---------|---------|
333
+ | "I'll clean up the history later" | Later never comes. Clean it now. |
334
+ | "Just one big commit is fine" | Big commits are impossible to review, revert, or bisect. |
335
+ | "Nobody reads commit messages" | `git blame` and `git bisect` users do. Future-you does. |
336
+ | "Force push is fine, I'm the only one on this branch" | Verify first. CI, bots, and reviewers may have fetched. |
337
+ | "The merge conflict is obvious, just take mine" | Obvious conflicts hide subtle logic bugs. Read both sides. |
338
+ | "I'll squash on merge anyway" | Squash loses the story. Clean history beats squashed history. |
339
+ | "Rebase is scary, I'll just merge" | Merge commits obscure linear history. Learn rebase. |
340
+ | "This commit message is good enough" | Future readers have zero context. Be specific. |
341
+
342
+ **ALL of these mean: STOP. Follow the relevant phase.**
343
+
344
+ ## Related Skills
345
+
346
+ | Skill | Relationship |
347
+ |-------|-------------|
348
+ | `refactoring` | Refactoring produces commits — use git-master for commit hygiene |
349
+ | `test-driven-development` | TDD cycle maps to atomic commits: one test + impl per commit |
350
+ | `pr-all-in-one` | PR preparation requires clean history — git-master feeds into it |
351
+ | `deployment-checklist` | Deploy from clean branches with verified history |
352
+
353
+ ## Related Agents
354
+
355
+ | Agent | When to Involve |
356
+ |-------|----------------|
357
+ | Code Reviewer | When commit organization affects review quality |
358
+ | DevOps Engineer | When branch strategy impacts CI/CD pipeline |
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: incident-response
3
3
  description: Use when production incident occurs, alerts fire, service degradation detected, or on-call escalation needed - guides systematic organizational response before technical fixes
4
+ disable-model-invocation: true
4
5
  ---
5
6
 
6
7
  # Incident Response
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: legacy-modernization
3
3
  description: Use when modernizing legacy code or migrating outdated patterns to current best practices. Covers assessment, strangler fig pattern, incremental migration, and risk management.
4
+ argument-hint: [target-module-or-path]
4
5
  ---
5
6
 
6
7
  # Legacy Modernization
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: mcp-builder
3
3
  description: Use when building or extending MCP (Model Context Protocol) servers. Covers NestJS-based server design, Tools/Resources/Prompts capability design, transport implementation (stdio/SSE), and testing strategies.
4
+ argument-hint: [capability-name]
4
5
  ---
5
6
 
6
7
  # MCP Builder
@@ -354,3 +355,9 @@ Server:
354
355
  | No error handling in tools | Always catch and return isError: true |
355
356
  | Breaking stdio with console.log | Use stderr for logs: `process.stderr.write(...)` |
356
357
  | Hardcoded paths | Use env vars or config injection |
358
+
359
+ ## Additional resources
360
+
361
+ - [Tool implementation example](examples/tool-example.ts) — Complete MCP Tool handler with schema, validation, and error handling
362
+ - [Resource implementation example](examples/resource-example.ts) — Complete MCP Resource handler with URI routing and templates
363
+ - [MCP protocol quick reference](references/protocol-spec.md) — JSON-RPC message formats, capability methods, transport modes, and error codes