Skip to content

Commit 3df2b89

Browse files
author
FirstUnicorn
committed
docs(commit-workflow): add universal lesson on prioritizing user intent
## Starting point During this session, we encountered a pattern where commit scope selection focused on technical implementation details (number of lines changed, most interesting code change) rather than the user's actual intent (what problem they were solving). When the integration guide was fixed with multiple changes (4 import path corrections, installation section rewrite, CDC description update), the initial suggestion was `docs(imports)` because 4 import corrections seemed significant. However, the user's PRIMARY intent was fixing "unclear installation instructions + incorrect CDC publishing description". The import corrections were secondary cleanup discovered along the way. ## Changes Created `memories/lessons-for-ai/universal/git/prioritize-user-intent-in-commits.md`: **Critical rule (first 30 lines):** - Focus on what problem user solving, not what code changed - Check conversation context FIRST before asking - If unclear, ask with RATED options (85/100 vs 30/100) - Scope reflects PRIMARY user intent, not implementation details **Pattern guidance:** - Wrong: count lines, lead with technical details, skip context check - Correct: identify changes → check context → ask with ratings if unclear → use their stated intent → structure body with primary issues first **Concrete example:** - Shows wrong approach (technical focus) - Shows correct approach (user intent focus with rated options) - Includes actual ratings: installation (85/100), CDC (85/100), imports (30/100) **Lesson learned section:** - Documents the actual incident from this session - Shows the mistake (didn't check context, led with technical count) - Shows correct approach (should have asked with rated options) ## Result Universal lesson now available in `memories/lessons-for-ai/universal/git/` alongside other git workflow lessons. Emphasizes checking context first, then asking with rated options only if intent is unclear. Commit scopes now reflect what problem user was solving (user intent) rather than what code changed (implementation details).
1 parent 40a8651 commit 3df2b89

1 file changed

Lines changed: 124 additions & 0 deletions

File tree

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Prioritize user intent over technical details in commit messages
2+
3+
**[Intent](#intent)****[Pattern](#pattern)****[Example](#example)****[Why](#why)**
4+
5+
## Critical rule
6+
7+
**Focus on what user problem solving, not what code changed.**
8+
9+
Commit scope must reflect PRIMARY user intent, not implementation details.
10+
11+
## Required format
12+
13+
When user makes changes with multiple concerns AND you don't know initial issue:
14+
15+
```
16+
1. Review git diff (silently)
17+
2. Ask: "What was the PRIMARY problem you were solving?"
18+
A) [User-facing issue 1] (rating: X/100)
19+
B) [User-facing issue 2] (rating: Y/100)
20+
C) [Technical detail] (rating: Z/100)
21+
D) All equally important
22+
23+
Recommendation: [Highest rated option and why]
24+
3. Wait for user answer
25+
4. Generate scope options based on their stated PRIMARY intent
26+
```
27+
28+
## Intent
29+
30+
Technical changes are means to an end. The commit message should describe the END (user's goal), not the MEANS (code changes).
31+
32+
## Pattern
33+
34+
**Wrong approach:**
35+
- Count lines changed
36+
- Lead with most technically interesting change
37+
- Suggest scope before checking context OR asking user
38+
- Treat secondary fixes as primary
39+
- Don't rate options when asking
40+
41+
**Correct approach:**
42+
1. Identify all changes
43+
2. Check context for initial issue
44+
3. If unclear, ASK user which problem was primary WITH RATED OPTIONS
45+
4. Wait for explicit answer
46+
5. Scope reflects their stated intent
47+
6. Commit body: primary issues first, secondary fixes last
48+
49+
## Example
50+
51+
**Changes made:**
52+
- 4 import corrections (`eventing.*``messaging.*`)
53+
- Installation section rewrite (10 lines)
54+
- CDC description update (8 lines)
55+
56+
**Wrong (technical focus):**
57+
```
58+
Scope: docs(imports)
59+
Body: Fixed 4 import paths...
60+
```
61+
62+
**Correct (user intent focus):**
63+
```
64+
Ask first:
65+
"What was the PRIMARY problem you were solving?
66+
A) Unclear installation instructions (rating: 85/100)
67+
B) Incorrect CDC description (rating: 85/100)
68+
C) Wrong import paths (rating: 30/100)
69+
70+
Recommendation: A and B - user-facing onboarding blockers"
71+
72+
Then scope based on their answer:
73+
Scope: docs(integration-guide): fix unclear installation and incorrect CDC description
74+
75+
Body:
76+
## Starting point
77+
Integration guide had two critical issues:
78+
1. Unclear installation instructions
79+
2. Incorrect CDC publishing description
80+
81+
## Changes
82+
### Installation section
83+
...
84+
85+
### CDC publishing section
86+
...
87+
88+
### Secondary fixes
89+
- Corrected import paths from eventing.* to messaging.*
90+
```
91+
92+
## Why this matters
93+
94+
**User intent reveals:**
95+
- What was broken
96+
- Why they cared enough to fix it
97+
- What problem is now solved
98+
- Priority of changes
99+
100+
**Technical details reveal:**
101+
- How it was fixed
102+
- But not WHY or for WHOM
103+
104+
## When to apply
105+
106+
- Multi-concern commits where initial issue is unclear from context
107+
- Documentation fixes
108+
- Refactoring with side fixes
109+
- Any commit where you're tempted to count lines to pick scope
110+
111+
**Always check context first before asking user.**
112+
113+
## Lesson learned from
114+
115+
Integration guide commit where AI initially suggested `docs(imports)` scope because 4 import corrections seemed significant, but user's PRIMARY intent was fixing "unclear installation + incorrect CDC description".
116+
117+
**Mistake:** Didn't check context or ask user first. Led with technical detail count.
118+
119+
**Correct approach:** Should have asked with rated options:
120+
- A) Unclear installation (85/100)
121+
- B) Incorrect CDC (85/100)
122+
- C) Wrong imports (30/100)
123+
124+
This would have immediately revealed user priorities. Import fixes were secondary cleanup discovered while addressing primary issues.

0 commit comments

Comments
 (0)