Skip to content

Commit b2e6354

Browse files
Add comprehensive PR review for Smart Accounts Kit troubleshooting docs
- Review PR #2768 (Invalid signature) and PR #2766 (Invalid delegator) - Check alignment with Consensys style guide - Identify issues with conversational tone, contractions, and formatting - Provide prioritized recommendations for improvements Co-authored-by: Ayush Bherwani <ayush.bherwani1998@gmail.com>
1 parent 867eacb commit b2e6354

1 file changed

Lines changed: 359 additions & 0 deletions

File tree

pr-review.md

Lines changed: 359 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,359 @@
1+
# PR Review: Smart Accounts Kit Documentation Style Alignment
2+
3+
**Date:** March 17, 2026
4+
**Reviewer:** Cloud Agent
5+
**Style Guide Reference:** https://docs-template.consensys.io/contribute/style-guide
6+
7+
## PRs Under Review
8+
9+
1. **PR #2768** - [Smart Accounts Kit][Troubleshooting Section] Add invalid signature
10+
- URL: https://github.com/MetaMask/metamask-docs/pull/2768
11+
- Files: `smart-accounts-kit/troubleshooting/invalid-signature.md` (new)
12+
13+
2. **PR #2766** - [Smart Accounts Kit][Troubleshoot] Invalid Delegator
14+
- URL: https://github.com/MetaMask/metamask-docs/pull/2766
15+
- Files: `smart-accounts-kit/troubleshooting/invalid-delegator.md` (new)
16+
17+
---
18+
19+
## Overall Assessment
20+
21+
Both PRs add troubleshooting documentation for error codes in the Smart Accounts Kit. The content is generally well-written and aligned with the Consensys style guide, but there are several areas for improvement.
22+
23+
---
24+
25+
## PR #2768: Invalid Signature Troubleshooting
26+
27+
### ✅ Strengths
28+
29+
1. **Well-organized content** - Clear structure with distinct problem scenarios
30+
2. **Developer-focused** - Includes practical code samples
31+
3. **Scannable content** - Good use of headings and sections
32+
4. **Sentence case headings** - Properly follows formatting guidelines
33+
34+
### ⚠️ Issues & Recommendations
35+
36+
#### 1. **Conversational Tone - Use Contractions**
37+
38+
**Location:** Multiple places in the document
39+
**Issue:** The document doesn't use common contractions, making it less conversational.
40+
41+
**Current:**
42+
```markdown
43+
If the smart account has not been deployed yet, it has no code at its address,
44+
so the Delegation Manager treats it as an EOA and attempts ECDSA signature recovery.
45+
```
46+
47+
**Recommended:**
48+
```markdown
49+
If the smart account hasn't been deployed yet, it has no code at its address,
50+
so the Delegation Manager treats it as an EOA and attempts ECDSA signature recovery.
51+
```
52+
53+
**Other instances:**
54+
- "has not been deployed" → "hasn't been deployed"
55+
- "do not match" → "don't match"
56+
- "will not match" → "won't match"
57+
58+
---
59+
60+
#### 2. **Passive Voice Usage**
61+
62+
**Location:** Line 12-13
63+
**Issue:** Uses passive voice instead of active voice.
64+
65+
**Current:**
66+
```markdown
67+
The root delegation's delegator must be a MetaMask smart account. The Delegation Manager
68+
checks delegator code length to determine whether the delegator is an EOA or a smart account.
69+
```
70+
71+
**Recommended:**
72+
```markdown
73+
The root delegation's delegator must be a MetaMask smart account. The Delegation Manager
74+
checks the delegator code length to determine whether the delegator is an EOA or a smart account.
75+
```
76+
77+
---
78+
79+
#### 3. **Clarity and Conciseness**
80+
81+
**Location:** Lines 62-65
82+
**Issue:** Sentence could be more concise and direct.
83+
84+
**Current:**
85+
```markdown
86+
The delegation was signed with an account that does not correspond to the delegator
87+
address. When the delegator is an EOA, the Delegation Manager recovers the signer from
88+
the EIP-712 typed data hash and compares it to the `delegator` field. If they do not
89+
match, the transaction reverts.
90+
```
91+
92+
**Recommended:**
93+
```markdown
94+
The delegation was signed with an account that doesn't correspond to the delegator
95+
address. When the delegator is an EOA, the Delegation Manager recovers the signer from
96+
the EIP-712 typed data hash and compares it to the `delegator` field. If they don't
97+
match, the transaction reverts.
98+
```
99+
100+
---
101+
102+
#### 4. **Code Comment Clarity**
103+
104+
**Location:** Lines 44-48
105+
**Issue:** Comments in code sample are lengthy and could be more concise.
106+
107+
**Current:**
108+
```typescript
109+
// The address to which EOA has delegated. According to EIP-7702, 0xef0100 || address
110+
// represents the delegation.
111+
//
112+
// You need to remove the first 8 characters (0xef0100) to get the delegator address.
113+
const delegatorAddress = `0x${code.substring(8)}`;
114+
```
115+
116+
**Recommended:**
117+
```typescript
118+
// According to EIP-7702, the code format is 0xef0100 || address.
119+
// Remove the first 8 characters (0xef0100) to get the delegator address.
120+
const delegatorAddress = `0x${code.substring(8)}`;
121+
```
122+
123+
---
124+
125+
#### 5. **Inconsistent Terminology**
126+
127+
**Location:** Line 51
128+
**Issue:** Mix of "upgrade" terminology.
129+
130+
**Current:**
131+
```markdown
132+
// If account is not upgraded to MetaMask smart account, you can
133+
```
134+
135+
**Recommended:**
136+
```markdown
137+
// If the account isn't upgraded to a MetaMask smart account, you can
138+
```
139+
140+
---
141+
142+
#### 6. **Link Text Improvement**
143+
144+
**Location:** Line 56
145+
**Issue:** Link text could be more descriptive.
146+
147+
**Current:**
148+
```markdown
149+
If the EOA is not upgraded to MetaMask smart account, [learn how to upgrade an EOA to MetaMask smart account](../get-started/smart-account-quickstart/eip7702.md).
150+
```
151+
152+
**Recommended:**
153+
```markdown
154+
If the EOA isn't upgraded to a MetaMask smart account, see the [EIP-7702 quickstart guide](../get-started/smart-account-quickstart/eip7702.md).
155+
```
156+
157+
---
158+
159+
#### 7. **Article Usage**
160+
161+
**Location:** Multiple places
162+
**Issue:** Missing article "a" before "MetaMask smart account".
163+
164+
**Current:**
165+
```markdown
166+
If the EOA is not upgraded to MetaMask smart account
167+
```
168+
169+
**Recommended:**
170+
```markdown
171+
If the EOA isn't upgraded to a MetaMask smart account
172+
```
173+
174+
---
175+
176+
#### 8. **Typo in Implementation Name**
177+
178+
**Location:** Line 49
179+
**Issue:** "DeleGator" appears to have incorrect capitalization.
180+
181+
**Current:**
182+
```typescript
183+
.EIP7702StatelessDeleGatorImpl;
184+
```
185+
186+
**Verify:** Is this the correct spelling/capitalization of the implementation name? If it's a typo in the codebase reference, it should be corrected. If it's the actual name, it should remain as-is.
187+
188+
---
189+
190+
## PR #2766: Invalid Delegator Troubleshooting
191+
192+
### ✅ Strengths
193+
194+
1. **Clear and concise** - Gets to the point quickly
195+
2. **Good code example** - Practical TypeScript sample
196+
3. **Proper formatting** - Sentence case headings, code formatting for references
197+
4. **Scannable content** - Well-structured with clear sections
198+
199+
### ⚠️ Issues & Recommendations
200+
201+
#### 1. **Conversational Tone - Use Contractions**
202+
203+
**Location:** Multiple places
204+
**Issue:** Missing contractions throughout.
205+
206+
**Examples to fix:**
207+
- "is not the delegator" → "isn't the delegator"
208+
- "has not been deployed" → "hasn't been deployed"
209+
210+
---
211+
212+
#### 2. **Error Code Reference Typo**
213+
214+
**Location:** error-codes.md, line 18
215+
**Issue:** Spelling error in table.
216+
217+
**Current:**
218+
```markdown
219+
The caller is not the delegator specificed in the delegation.
220+
```
221+
222+
**Recommended:**
223+
```markdown
224+
The caller isn't the delegator specified in the delegation.
225+
```
226+
227+
(Also adds contraction per style guide)
228+
229+
---
230+
231+
#### 3. **Grammar and Article Usage**
232+
233+
**Location:** Line 17
234+
**Issue:** Missing article.
235+
236+
**Current:**
237+
```markdown
238+
Verify that the transaction is sent from the delegator's account. If the delegator is a smart account, submit an user operation through the smart account.
239+
```
240+
241+
**Recommended:**
242+
```markdown
243+
Verify that the transaction is sent from the delegator's account. If the delegator is a smart account, submit a user operation through the smart account.
244+
```
245+
246+
---
247+
248+
#### 4. **Passive Voice**
249+
250+
**Location:** Line 16-17
251+
**Issue:** Could be more direct with active voice.
252+
253+
**Current:**
254+
```markdown
255+
Verify that the transaction is sent from the delegator's account.
256+
```
257+
258+
**Recommended:**
259+
```markdown
260+
Verify that you're sending the transaction from the delegator's account.
261+
```
262+
263+
---
264+
265+
#### 5. **Code Comment Spacing**
266+
267+
**Location:** Line 23
268+
**Issue:** Comment formatting could be cleaner.
269+
270+
**Current:**
271+
```typescript
272+
const disableCalldata = DelegationManager.encode.disableDelegation({
273+
// Signed delegation from delegatorSmartAccount.
274+
delegation: signedDelegation,
275+
});
276+
```
277+
278+
**Recommended:**
279+
```typescript
280+
// Generate calldata to disable the delegation.
281+
const disableCalldata = DelegationManager.encode.disableDelegation({
282+
delegation: signedDelegation, // Signed by delegatorSmartAccount
283+
});
284+
```
285+
286+
---
287+
288+
## Common Issues Across Both PRs
289+
290+
### 1. **Lack of Contractions**
291+
Both documents avoid contractions, which makes them less conversational than the style guide recommends. This is the most significant deviation from the style guide.
292+
293+
**Style Guide Reference:**
294+
> Use common contractions, such as "it's" and "you're," as if you're speaking to the reader.
295+
296+
### 2. **Article Usage**
297+
Both PRs occasionally omit articles ("a", "the") where they should be included, particularly before "MetaMask smart account" and "user operation."
298+
299+
### 3. **Consistent Terminology**
300+
Ensure consistent use of:
301+
- "smart account" (not switching between "smart account" and "MetaMask smart account" without clarity)
302+
- "user operation" (with article "a")
303+
- "delegator" vs "delegator's"
304+
305+
---
306+
307+
## Style Guide Compliance Scorecard
308+
309+
### PR #2768: Invalid Signature
310+
311+
| Criterion | Score | Notes |
312+
|-----------|-------|-------|
313+
| Organize content by function | ✅ Excellent | Well-structured how-to/troubleshooting guide |
314+
| Use conversational tone | ⚠️ Needs work | Lacks contractions, some passive voice |
315+
| Write for developers | ✅ Good | Includes code samples and prerequisites |
316+
| Create scannable content | ✅ Good | Well-organized with clear sections |
317+
| Format text properly | ✅ Good | Proper sentence case, code formatting |
318+
| **Overall** | **7/10** | Strong content, needs tone adjustments |
319+
320+
### PR #2766: Invalid Delegator
321+
322+
| Criterion | Score | Notes |
323+
|-----------|-------|-------|
324+
| Organize content by function | ✅ Excellent | Clear, focused troubleshooting content |
325+
| Use conversational tone | ⚠️ Needs work | Lacks contractions, minor passive voice |
326+
| Write for developers | ✅ Good | Practical code example included |
327+
| Create scannable content | ✅ Excellent | Concise and well-structured |
328+
| Format text properly | ⚠️ Good | One typo in referenced file |
329+
| **Overall** | **7.5/10** | Strong, concise content with minor issues |
330+
331+
---
332+
333+
## Priority Recommendations
334+
335+
### High Priority (Should Fix)
336+
337+
1. **Add contractions throughout both documents** - This is a key style guide requirement
338+
2. **Fix typo in PR #2766** - "specificed" → "specified"
339+
3. **Add missing articles** - "an user operation" → "a user operation"
340+
4. **Verify "DeleGatorImpl" spelling** in PR #2768
341+
342+
### Medium Priority (Should Consider)
343+
344+
1. **Convert passive voice to active** where appropriate
345+
2. **Simplify code comments** for better readability
346+
3. **Make link text more descriptive**
347+
348+
### Low Priority (Nice to Have)
349+
350+
1. **Further condense lengthy sentences** for scannability
351+
2. **Standardize terminology** references throughout
352+
353+
---
354+
355+
## Conclusion
356+
357+
Both PRs provide valuable troubleshooting documentation that is well-organized and developer-focused. The main area for improvement is adopting a more conversational tone through the use of contractions, as recommended by the Consensys style guide. With these adjustments, the content will better match the overall Smart Accounts Kit documentation style.
358+
359+
The content demonstrates strong technical accuracy and practical guidance. After addressing the high-priority recommendations, these pages will be excellent additions to the troubleshooting section.

0 commit comments

Comments
 (0)