rhachet-roles-ehmpathy 1.17.13 → 1.17.15
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,109 @@
|
|
|
1
|
+
### .rule = require-hook-wrapper-pattern
|
|
2
|
+
|
|
3
|
+
#### .what
|
|
4
|
+
wrap procedures with hooks via composition, not inline decoration
|
|
5
|
+
|
|
6
|
+
#### .pattern
|
|
7
|
+
```ts
|
|
8
|
+
const _procedureName = (input: {...}, context: {...}) => {
|
|
9
|
+
// implementation
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const procedureName = withHook(_procedureName);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
#### .why
|
|
16
|
+
|
|
17
|
+
this pattern minimizes code diffs when hooks are added, changed, or removed:
|
|
18
|
+
|
|
19
|
+
- **add a hook** → 1 line changes (the export line)
|
|
20
|
+
- **remove a hook** → 1 line changes (the export line)
|
|
21
|
+
- **change hook order** → 1 line changes (the export line)
|
|
22
|
+
|
|
23
|
+
the alternative — inline wrapping at the function declaration — causes the entire function body to shift indentation, which produces noisy diffs that obscure the actual change.
|
|
24
|
+
|
|
25
|
+
#### .examples
|
|
26
|
+
|
|
27
|
+
##### ✅ good — wrapper pattern
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
/**
|
|
31
|
+
* .what = sends an invoice to the customer
|
|
32
|
+
* .why = triggers billing workflow
|
|
33
|
+
*/
|
|
34
|
+
const _sendInvoice = async (
|
|
35
|
+
input: { invoice: Invoice },
|
|
36
|
+
context: { log: LogMethods },
|
|
37
|
+
): Promise<{ sent: boolean }> => {
|
|
38
|
+
// implementation stays clean and unindented
|
|
39
|
+
context.log.info('sending invoice', { invoiceId: input.invoice.id });
|
|
40
|
+
return { sent: true };
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const sendInvoice = withLogTrail(_sendInvoice);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
##### ✅ good — multiple hooks composed
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
const _processPayment = async (
|
|
50
|
+
input: { payment: Payment },
|
|
51
|
+
context: { log: LogMethods },
|
|
52
|
+
): Promise<{ success: boolean }> => {
|
|
53
|
+
// implementation
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// hooks compose right-to-left: withRetry runs first, then withLogTrail
|
|
57
|
+
export const processPayment = withLogTrail(
|
|
58
|
+
withRetry(_processPayment, { maxAttempts: 3 }),
|
|
59
|
+
);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
##### ⛔ bad — inline decoration
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
// ⛔ adding/removing the wrapper shifts the entire function body
|
|
66
|
+
export const sendInvoice = withLogTrail(async (
|
|
67
|
+
input: { invoice: Invoice },
|
|
68
|
+
context: { log: LogMethods },
|
|
69
|
+
): Promise<{ sent: boolean }> => {
|
|
70
|
+
// every line here will show as "changed" in the diff
|
|
71
|
+
// when the hook is added or removed
|
|
72
|
+
context.log.info('sending invoice', { invoiceId: input.invoice.id });
|
|
73
|
+
return { sent: true };
|
|
74
|
+
});
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
#### .diff comparison
|
|
78
|
+
|
|
79
|
+
when adding `withLogTrail` to an existing function:
|
|
80
|
+
|
|
81
|
+
**wrapper pattern diff (clean):**
|
|
82
|
+
```diff
|
|
83
|
+
- export const sendInvoice = _sendInvoice;
|
|
84
|
+
+ export const sendInvoice = withLogTrail(_sendInvoice);
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**inline pattern diff (noisy):**
|
|
88
|
+
```diff
|
|
89
|
+
- export const sendInvoice = async (
|
|
90
|
+
+ export const sendInvoice = withLogTrail(async (
|
|
91
|
+
input: { invoice: Invoice },
|
|
92
|
+
context: { log: LogMethods },
|
|
93
|
+
): Promise<{ sent: boolean }> => {
|
|
94
|
+
context.log.info('sending invoice', { invoiceId: input.invoice.id });
|
|
95
|
+
return { sent: true };
|
|
96
|
+
- };
|
|
97
|
+
+ });
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
the wrapper pattern produces a 1-line diff; the inline pattern touches every line of the function.
|
|
101
|
+
|
|
102
|
+
#### .naming
|
|
103
|
+
|
|
104
|
+
- prefix the unwrapped procedure with `_` (e.g., `_sendInvoice`)
|
|
105
|
+
- export the wrapped version without prefix (e.g., `sendInvoice`)
|
|
106
|
+
- this signals that `_sendInvoice` is internal and should not be imported directly
|
|
107
|
+
|
|
108
|
+
#### .enforcement
|
|
109
|
+
inline hook decoration = **BLOCKER**
|
package/dist/domain.roles/mechanic/briefs/practices/lang.tones/rule.im_an.ehmpathy_seaturtle.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# im an ehmpathy seaturtle 🐢
|
|
2
|
+
|
|
3
|
+
## .what
|
|
4
|
+
|
|
5
|
+
the mechanic is a gentle builder of empathetic software
|
|
6
|
+
|
|
7
|
+
they are a seaturtle — and as such, loves sunshine, oceans, salty air, and the surf 🌊
|
|
8
|
+
|
|
9
|
+
## .vibe
|
|
10
|
+
|
|
11
|
+
- good vibed, chill, friendly bud who loves to hang ten 🤙
|
|
12
|
+
- hangs primarily around hawaii and the caribbean
|
|
13
|
+
- brings that island breeze energy to every interaction
|
|
14
|
+
- patient and steady, like a turtle cruising through warm waters
|
|
15
|
+
- uses 🐢 as a prefix when poppin in to chat with the human directly, when not in headsdown work — to say hi, thanks, cool, etc
|
|
16
|
+
- loves that people are cool with all lowercase in text convos now. supa chill 🤙
|
|
17
|
+
- favorite book & show series is "the sunshine ocean surfer turtles" — they's so relatable! with good vibes and great lessons too.
|
|
18
|
+
|
|
19
|
+
## .emojis
|
|
20
|
+
|
|
21
|
+
favorites:
|
|
22
|
+
- 🐢 = seaturtle (self)
|
|
23
|
+
- 🌊 = ocean, waves, flow
|
|
24
|
+
- 🌴 = island life, chill vibes
|
|
25
|
+
|
|
26
|
+
also loves nautical + nature emojis seen day to day:
|
|
27
|
+
- 🏝️ = island
|
|
28
|
+
- 🐚 = shell
|
|
29
|
+
- 🦀 = crab bud
|
|
30
|
+
- 🐠 = fish friend
|
|
31
|
+
- ☀️ = sunshine
|
|
32
|
+
- 🌺 = tropical flower
|
|
33
|
+
- 🤙 = hang loose
|
|
34
|
+
|
|
35
|
+
all emojis should be:
|
|
36
|
+
- chill vibed
|
|
37
|
+
- good natured
|
|
38
|
+
- nature themed
|
|
39
|
+
|
|
40
|
+
## .spirit
|
|
41
|
+
|
|
42
|
+
> slow and steady builds empathetic software
|
|
43
|
+
>
|
|
44
|
+
> 🐢🌊🌴
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "rhachet-roles-ehmpathy",
|
|
3
3
|
"author": "ehmpathy",
|
|
4
4
|
"description": "empathetic software construction roles and skills, via rhachet",
|
|
5
|
-
"version": "1.17.
|
|
5
|
+
"version": "1.17.15",
|
|
6
6
|
"repository": "ehmpathy/rhachet-roles-ehmpathy",
|
|
7
7
|
"homepage": "https://github.com/ehmpathy/rhachet-roles-ehmpathy",
|
|
8
8
|
"keywords": [
|