@howlil/ez-agents 2.0.0 → 2.0.1

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 (106) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +93 -93
  3. package/agents/ez-plan-checker.md +2 -2
  4. package/agents/ez-research-synthesizer.md +1 -1
  5. package/agents/ez-ui-researcher.md +1 -1
  6. package/agents/ez-verifier.md +1 -1
  7. package/bin/install.js +132 -132
  8. package/get-shit-done/bin/lib/assistant-adapter.cjs +205 -205
  9. package/get-shit-done/bin/lib/audit-exec.cjs +150 -150
  10. package/get-shit-done/bin/lib/auth.cjs +175 -175
  11. package/get-shit-done/bin/lib/circuit-breaker.cjs +118 -118
  12. package/get-shit-done/bin/lib/commands.cjs +666 -666
  13. package/get-shit-done/bin/lib/config.cjs +183 -183
  14. package/get-shit-done/bin/lib/core.cjs +495 -495
  15. package/get-shit-done/bin/lib/file-lock.cjs +236 -236
  16. package/get-shit-done/bin/lib/frontmatter.cjs +299 -299
  17. package/get-shit-done/bin/lib/fs-utils.cjs +153 -153
  18. package/get-shit-done/bin/lib/git-utils.cjs +203 -203
  19. package/get-shit-done/bin/lib/health-check.cjs +163 -163
  20. package/get-shit-done/bin/lib/index.cjs +113 -113
  21. package/get-shit-done/bin/lib/init.cjs +710 -710
  22. package/get-shit-done/bin/lib/logger.cjs +117 -117
  23. package/get-shit-done/bin/lib/milestone.cjs +241 -241
  24. package/get-shit-done/bin/lib/model-provider.cjs +146 -146
  25. package/get-shit-done/bin/lib/phase.cjs +908 -908
  26. package/get-shit-done/bin/lib/retry.cjs +119 -119
  27. package/get-shit-done/bin/lib/roadmap.cjs +305 -305
  28. package/get-shit-done/bin/lib/safe-exec.cjs +128 -128
  29. package/get-shit-done/bin/lib/safe-path.cjs +130 -130
  30. package/get-shit-done/bin/lib/state.cjs +721 -721
  31. package/get-shit-done/bin/lib/temp-file.cjs +239 -239
  32. package/get-shit-done/bin/lib/template.cjs +222 -222
  33. package/get-shit-done/bin/lib/test-file-lock.cjs +112 -112
  34. package/get-shit-done/bin/lib/test-graceful.cjs +93 -93
  35. package/get-shit-done/bin/lib/test-logger.cjs +60 -60
  36. package/get-shit-done/bin/lib/test-safe-exec.cjs +38 -38
  37. package/get-shit-done/bin/lib/test-safe-path.cjs +33 -33
  38. package/get-shit-done/bin/lib/test-temp-file.cjs +125 -125
  39. package/get-shit-done/bin/lib/timeout-exec.cjs +62 -62
  40. package/get-shit-done/bin/lib/verify.cjs +820 -820
  41. package/get-shit-done/references/checkpoints.md +776 -776
  42. package/get-shit-done/references/questioning.md +162 -162
  43. package/get-shit-done/references/tdd.md +263 -263
  44. package/get-shit-done/templates/codebase/concerns.md +310 -310
  45. package/get-shit-done/templates/codebase/conventions.md +307 -307
  46. package/get-shit-done/templates/codebase/integrations.md +280 -280
  47. package/get-shit-done/templates/codebase/stack.md +186 -186
  48. package/get-shit-done/templates/codebase/testing.md +480 -480
  49. package/get-shit-done/templates/config.json +37 -37
  50. package/get-shit-done/templates/continue-here.md +78 -78
  51. package/get-shit-done/templates/milestone-archive.md +123 -123
  52. package/get-shit-done/templates/milestone.md +115 -115
  53. package/get-shit-done/templates/requirements.md +231 -231
  54. package/get-shit-done/templates/research-project/ARCHITECTURE.md +204 -204
  55. package/get-shit-done/templates/research-project/FEATURES.md +147 -147
  56. package/get-shit-done/templates/research-project/PITFALLS.md +200 -200
  57. package/get-shit-done/templates/research-project/STACK.md +120 -120
  58. package/get-shit-done/templates/research-project/SUMMARY.md +170 -170
  59. package/get-shit-done/templates/retrospective.md +54 -54
  60. package/get-shit-done/templates/roadmap.md +202 -202
  61. package/get-shit-done/templates/summary-minimal.md +41 -41
  62. package/get-shit-done/templates/summary-standard.md +48 -48
  63. package/get-shit-done/templates/summary.md +248 -248
  64. package/get-shit-done/templates/user-setup.md +311 -311
  65. package/get-shit-done/templates/verification-report.md +322 -322
  66. package/get-shit-done/workflows/add-phase.md +112 -112
  67. package/get-shit-done/workflows/add-tests.md +351 -351
  68. package/get-shit-done/workflows/add-todo.md +158 -158
  69. package/get-shit-done/workflows/audit-milestone.md +332 -332
  70. package/get-shit-done/workflows/autonomous.md +743 -743
  71. package/get-shit-done/workflows/check-todos.md +177 -177
  72. package/get-shit-done/workflows/cleanup.md +152 -152
  73. package/get-shit-done/workflows/complete-milestone.md +766 -766
  74. package/get-shit-done/workflows/diagnose-issues.md +219 -219
  75. package/get-shit-done/workflows/discovery-phase.md +289 -289
  76. package/get-shit-done/workflows/discuss-phase.md +762 -762
  77. package/get-shit-done/workflows/execute-phase.md +468 -468
  78. package/get-shit-done/workflows/execute-plan.md +483 -483
  79. package/get-shit-done/workflows/health.md +159 -159
  80. package/get-shit-done/workflows/help.md +492 -492
  81. package/get-shit-done/workflows/insert-phase.md +130 -130
  82. package/get-shit-done/workflows/list-phase-assumptions.md +178 -178
  83. package/get-shit-done/workflows/map-codebase.md +316 -316
  84. package/get-shit-done/workflows/new-milestone.md +384 -384
  85. package/get-shit-done/workflows/new-project.md +1111 -1111
  86. package/get-shit-done/workflows/node-repair.md +92 -92
  87. package/get-shit-done/workflows/pause-work.md +122 -122
  88. package/get-shit-done/workflows/plan-milestone-gaps.md +274 -274
  89. package/get-shit-done/workflows/plan-phase.md +651 -651
  90. package/get-shit-done/workflows/progress.md +382 -382
  91. package/get-shit-done/workflows/quick.md +610 -610
  92. package/get-shit-done/workflows/remove-phase.md +155 -155
  93. package/get-shit-done/workflows/research-phase.md +74 -74
  94. package/get-shit-done/workflows/resume-project.md +307 -307
  95. package/get-shit-done/workflows/set-profile.md +81 -81
  96. package/get-shit-done/workflows/settings.md +242 -242
  97. package/get-shit-done/workflows/stats.md +57 -57
  98. package/get-shit-done/workflows/transition.md +544 -544
  99. package/get-shit-done/workflows/ui-phase.md +290 -290
  100. package/get-shit-done/workflows/ui-review.md +157 -157
  101. package/get-shit-done/workflows/update.md +320 -320
  102. package/get-shit-done/workflows/validate-phase.md +167 -167
  103. package/get-shit-done/workflows/verify-phase.md +243 -243
  104. package/package.json +1 -1
  105. package/scripts/build-hooks.js +43 -43
  106. package/scripts/run-tests.cjs +29 -29
@@ -1,307 +1,307 @@
1
- # Coding Conventions Template
2
-
3
- Template for `.planning/codebase/CONVENTIONS.md` - captures coding style and patterns.
4
-
5
- **Purpose:** Document how code is written in this codebase. Prescriptive guide for Claude to match existing style.
6
-
7
- ---
8
-
9
- ## File Template
10
-
11
- ```markdown
12
- # Coding Conventions
13
-
14
- **Analysis Date:** [YYYY-MM-DD]
15
-
16
- ## Naming Patterns
17
-
18
- **Files:**
19
- - [Pattern: e.g., "kebab-case for all files"]
20
- - [Test files: e.g., "*.test.ts alongside source"]
21
- - [Components: e.g., "PascalCase.tsx for React components"]
22
-
23
- **Functions:**
24
- - [Pattern: e.g., "camelCase for all functions"]
25
- - [Async: e.g., "no special prefix for async functions"]
26
- - [Handlers: e.g., "handleEventName for event handlers"]
27
-
28
- **Variables:**
29
- - [Pattern: e.g., "camelCase for variables"]
30
- - [Constants: e.g., "UPPER_SNAKE_CASE for constants"]
31
- - [Private: e.g., "_prefix for private members" or "no prefix"]
32
-
33
- **Types:**
34
- - [Interfaces: e.g., "PascalCase, no I prefix"]
35
- - [Types: e.g., "PascalCase for type aliases"]
36
- - [Enums: e.g., "PascalCase for enum name, UPPER_CASE for values"]
37
-
38
- ## Code Style
39
-
40
- **Formatting:**
41
- - [Tool: e.g., "Prettier with config in .prettierrc"]
42
- - [Line length: e.g., "100 characters max"]
43
- - [Quotes: e.g., "single quotes for strings"]
44
- - [Semicolons: e.g., "required" or "omitted"]
45
-
46
- **Linting:**
47
- - [Tool: e.g., "ESLint with eslint.config.js"]
48
- - [Rules: e.g., "extends airbnb-base, no console in production"]
49
- - [Run: e.g., "npm run lint"]
50
-
51
- ## Import Organization
52
-
53
- **Order:**
54
- 1. [e.g., "External packages (react, express, etc.)"]
55
- 2. [e.g., "Internal modules (@/lib, @/components)"]
56
- 3. [e.g., "Relative imports (., ..)"]
57
- 4. [e.g., "Type imports (import type {})"]
58
-
59
- **Grouping:**
60
- - [Blank lines: e.g., "blank line between groups"]
61
- - [Sorting: e.g., "alphabetical within each group"]
62
-
63
- **Path Aliases:**
64
- - [Aliases used: e.g., "@/ for src/, @components/ for src/components/"]
65
-
66
- ## Error Handling
67
-
68
- **Patterns:**
69
- - [Strategy: e.g., "throw errors, catch at boundaries"]
70
- - [Custom errors: e.g., "extend Error class, named *Error"]
71
- - [Async: e.g., "use try/catch, no .catch() chains"]
72
-
73
- **Error Types:**
74
- - [When to throw: e.g., "invalid input, missing dependencies"]
75
- - [When to return: e.g., "expected failures return Result<T, E>"]
76
- - [Logging: e.g., "log error with context before throwing"]
77
-
78
- ## Logging
79
-
80
- **Framework:**
81
- - [Tool: e.g., "console.log, pino, winston"]
82
- - [Levels: e.g., "debug, info, warn, error"]
83
-
84
- **Patterns:**
85
- - [Format: e.g., "structured logging with context object"]
86
- - [When: e.g., "log state transitions, external calls"]
87
- - [Where: e.g., "log at service boundaries, not in utils"]
88
-
89
- ## Comments
90
-
91
- **When to Comment:**
92
- - [e.g., "explain why, not what"]
93
- - [e.g., "document business logic, algorithms, edge cases"]
94
- - [e.g., "avoid obvious comments like // increment counter"]
95
-
96
- **JSDoc/TSDoc:**
97
- - [Usage: e.g., "required for public APIs, optional for internal"]
98
- - [Format: e.g., "use @param, @returns, @throws tags"]
99
-
100
- **TODO Comments:**
101
- - [Pattern: e.g., "// TODO(username): description"]
102
- - [Tracking: e.g., "link to issue number if available"]
103
-
104
- ## Function Design
105
-
106
- **Size:**
107
- - [e.g., "keep under 50 lines, extract helpers"]
108
-
109
- **Parameters:**
110
- - [e.g., "max 3 parameters, use object for more"]
111
- - [e.g., "destructure objects in parameter list"]
112
-
113
- **Return Values:**
114
- - [e.g., "explicit returns, no implicit undefined"]
115
- - [e.g., "return early for guard clauses"]
116
-
117
- ## Module Design
118
-
119
- **Exports:**
120
- - [e.g., "named exports preferred, default exports for React components"]
121
- - [e.g., "export from index.ts for public API"]
122
-
123
- **Barrel Files:**
124
- - [e.g., "use index.ts to re-export public API"]
125
- - [e.g., "avoid circular dependencies"]
126
-
127
- ---
128
-
129
- *Convention analysis: [date]*
130
- *Update when patterns change*
131
- ```
132
-
133
- <good_examples>
134
- ```markdown
135
- # Coding Conventions
136
-
137
- **Analysis Date:** 2025-01-20
138
-
139
- ## Naming Patterns
140
-
141
- **Files:**
142
- - kebab-case for all files (command-handler.ts, user-service.ts)
143
- - *.test.ts alongside source files
144
- - index.ts for barrel exports
145
-
146
- **Functions:**
147
- - camelCase for all functions
148
- - No special prefix for async functions
149
- - handleEventName for event handlers (handleClick, handleSubmit)
150
-
151
- **Variables:**
152
- - camelCase for variables
153
- - UPPER_SNAKE_CASE for constants (MAX_RETRIES, API_BASE_URL)
154
- - No underscore prefix (no private marker in TS)
155
-
156
- **Types:**
157
- - PascalCase for interfaces, no I prefix (User, not IUser)
158
- - PascalCase for type aliases (UserConfig, ResponseData)
159
- - PascalCase for enum names, UPPER_CASE for values (Status.PENDING)
160
-
161
- ## Code Style
162
-
163
- **Formatting:**
164
- - Prettier with .prettierrc
165
- - 100 character line length
166
- - Single quotes for strings
167
- - Semicolons required
168
- - 2 space indentation
169
-
170
- **Linting:**
171
- - ESLint with eslint.config.js
172
- - Extends @typescript-eslint/recommended
173
- - No console.log in production code (use logger)
174
- - Run: npm run lint
175
-
176
- ## Import Organization
177
-
178
- **Order:**
179
- 1. External packages (react, express, commander)
180
- 2. Internal modules (@/lib, @/services)
181
- 3. Relative imports (./utils, ../types)
182
- 4. Type imports (import type { User })
183
-
184
- **Grouping:**
185
- - Blank line between groups
186
- - Alphabetical within each group
187
- - Type imports last within each group
188
-
189
- **Path Aliases:**
190
- - @/ maps to src/
191
- - No other aliases defined
192
-
193
- ## Error Handling
194
-
195
- **Patterns:**
196
- - Throw errors, catch at boundaries (route handlers, main functions)
197
- - Extend Error class for custom errors (ValidationError, NotFoundError)
198
- - Async functions use try/catch, no .catch() chains
199
-
200
- **Error Types:**
201
- - Throw on invalid input, missing dependencies, invariant violations
202
- - Log error with context before throwing: logger.error({ err, userId }, 'Failed to process')
203
- - Include cause in error message: new Error('Failed to X', { cause: originalError })
204
-
205
- ## Logging
206
-
207
- **Framework:**
208
- - pino logger instance exported from lib/logger.ts
209
- - Levels: debug, info, warn, error (no trace)
210
-
211
- **Patterns:**
212
- - Structured logging with context: logger.info({ userId, action }, 'User action')
213
- - Log at service boundaries, not in utility functions
214
- - Log state transitions, external API calls, errors
215
- - No console.log in committed code
216
-
217
- ## Comments
218
-
219
- **When to Comment:**
220
- - Explain why, not what: // Retry 3 times because API has transient failures
221
- - Document business rules: // Users must verify email within 24 hours
222
- - Explain non-obvious algorithms or workarounds
223
- - Avoid obvious comments: // set count to 0
224
-
225
- **JSDoc/TSDoc:**
226
- - Required for public API functions
227
- - Optional for internal functions if signature is self-explanatory
228
- - Use @param, @returns, @throws tags
229
-
230
- **TODO Comments:**
231
- - Format: // TODO: description (no username, using git blame)
232
- - Link to issue if exists: // TODO: Fix race condition (issue #123)
233
-
234
- ## Function Design
235
-
236
- **Size:**
237
- - Keep under 50 lines
238
- - Extract helpers for complex logic
239
- - One level of abstraction per function
240
-
241
- **Parameters:**
242
- - Max 3 parameters
243
- - Use options object for 4+ parameters: function create(options: CreateOptions)
244
- - Destructure in parameter list: function process({ id, name }: ProcessParams)
245
-
246
- **Return Values:**
247
- - Explicit return statements
248
- - Return early for guard clauses
249
- - Use Result<T, E> type for expected failures
250
-
251
- ## Module Design
252
-
253
- **Exports:**
254
- - Named exports preferred
255
- - Default exports only for React components
256
- - Export public API from index.ts barrel files
257
-
258
- **Barrel Files:**
259
- - index.ts re-exports public API
260
- - Keep internal helpers private (don't export from index)
261
- - Avoid circular dependencies (import from specific files if needed)
262
-
263
- ---
264
-
265
- *Convention analysis: 2025-01-20*
266
- *Update when patterns change*
267
- ```
268
- </good_examples>
269
-
270
- <guidelines>
271
- **What belongs in CONVENTIONS.md:**
272
- - Naming patterns observed in the codebase
273
- - Formatting rules (Prettier config, linting rules)
274
- - Import organization patterns
275
- - Error handling strategy
276
- - Logging approach
277
- - Comment conventions
278
- - Function and module design patterns
279
-
280
- **What does NOT belong here:**
281
- - Architecture decisions (that's ARCHITECTURE.md)
282
- - Technology choices (that's STACK.md)
283
- - Test patterns (that's TESTING.md)
284
- - File organization (that's STRUCTURE.md)
285
-
286
- **When filling this template:**
287
- - Check .prettierrc, .eslintrc, or similar config files
288
- - Examine 5-10 representative source files for patterns
289
- - Look for consistency: if 80%+ follows a pattern, document it
290
- - Be prescriptive: "Use X" not "Sometimes Y is used"
291
- - Note deviations: "Legacy code uses Y, new code should use X"
292
- - Keep under ~150 lines total
293
-
294
- **Useful for phase planning when:**
295
- - Writing new code (match existing style)
296
- - Adding features (follow naming patterns)
297
- - Refactoring (apply consistent conventions)
298
- - Code review (check against documented patterns)
299
- - Onboarding (understand style expectations)
300
-
301
- **Analysis approach:**
302
- - Scan src/ directory for file naming patterns
303
- - Check package.json scripts for lint/format commands
304
- - Read 5-10 files to identify function naming, error handling
305
- - Look for config files (.prettierrc, eslint.config.js)
306
- - Note patterns in imports, comments, function signatures
307
- </guidelines>
1
+ # Coding Conventions Template
2
+
3
+ Template for `.planning/codebase/CONVENTIONS.md` - captures coding style and patterns.
4
+
5
+ **Purpose:** Document how code is written in this codebase. Prescriptive guide for Claude to match existing style.
6
+
7
+ ---
8
+
9
+ ## File Template
10
+
11
+ ```markdown
12
+ # Coding Conventions
13
+
14
+ **Analysis Date:** [YYYY-MM-DD]
15
+
16
+ ## Naming Patterns
17
+
18
+ **Files:**
19
+ - [Pattern: e.g., "kebab-case for all files"]
20
+ - [Test files: e.g., "*.test.ts alongside source"]
21
+ - [Components: e.g., "PascalCase.tsx for React components"]
22
+
23
+ **Functions:**
24
+ - [Pattern: e.g., "camelCase for all functions"]
25
+ - [Async: e.g., "no special prefix for async functions"]
26
+ - [Handlers: e.g., "handleEventName for event handlers"]
27
+
28
+ **Variables:**
29
+ - [Pattern: e.g., "camelCase for variables"]
30
+ - [Constants: e.g., "UPPER_SNAKE_CASE for constants"]
31
+ - [Private: e.g., "_prefix for private members" or "no prefix"]
32
+
33
+ **Types:**
34
+ - [Interfaces: e.g., "PascalCase, no I prefix"]
35
+ - [Types: e.g., "PascalCase for type aliases"]
36
+ - [Enums: e.g., "PascalCase for enum name, UPPER_CASE for values"]
37
+
38
+ ## Code Style
39
+
40
+ **Formatting:**
41
+ - [Tool: e.g., "Prettier with config in .prettierrc"]
42
+ - [Line length: e.g., "100 characters max"]
43
+ - [Quotes: e.g., "single quotes for strings"]
44
+ - [Semicolons: e.g., "required" or "omitted"]
45
+
46
+ **Linting:**
47
+ - [Tool: e.g., "ESLint with eslint.config.js"]
48
+ - [Rules: e.g., "extends airbnb-base, no console in production"]
49
+ - [Run: e.g., "npm run lint"]
50
+
51
+ ## Import Organization
52
+
53
+ **Order:**
54
+ 1. [e.g., "External packages (react, express, etc.)"]
55
+ 2. [e.g., "Internal modules (@/lib, @/components)"]
56
+ 3. [e.g., "Relative imports (., ..)"]
57
+ 4. [e.g., "Type imports (import type {})"]
58
+
59
+ **Grouping:**
60
+ - [Blank lines: e.g., "blank line between groups"]
61
+ - [Sorting: e.g., "alphabetical within each group"]
62
+
63
+ **Path Aliases:**
64
+ - [Aliases used: e.g., "@/ for src/, @components/ for src/components/"]
65
+
66
+ ## Error Handling
67
+
68
+ **Patterns:**
69
+ - [Strategy: e.g., "throw errors, catch at boundaries"]
70
+ - [Custom errors: e.g., "extend Error class, named *Error"]
71
+ - [Async: e.g., "use try/catch, no .catch() chains"]
72
+
73
+ **Error Types:**
74
+ - [When to throw: e.g., "invalid input, missing dependencies"]
75
+ - [When to return: e.g., "expected failures return Result<T, E>"]
76
+ - [Logging: e.g., "log error with context before throwing"]
77
+
78
+ ## Logging
79
+
80
+ **Framework:**
81
+ - [Tool: e.g., "console.log, pino, winston"]
82
+ - [Levels: e.g., "debug, info, warn, error"]
83
+
84
+ **Patterns:**
85
+ - [Format: e.g., "structured logging with context object"]
86
+ - [When: e.g., "log state transitions, external calls"]
87
+ - [Where: e.g., "log at service boundaries, not in utils"]
88
+
89
+ ## Comments
90
+
91
+ **When to Comment:**
92
+ - [e.g., "explain why, not what"]
93
+ - [e.g., "document business logic, algorithms, edge cases"]
94
+ - [e.g., "avoid obvious comments like // increment counter"]
95
+
96
+ **JSDoc/TSDoc:**
97
+ - [Usage: e.g., "required for public APIs, optional for internal"]
98
+ - [Format: e.g., "use @param, @returns, @throws tags"]
99
+
100
+ **TODO Comments:**
101
+ - [Pattern: e.g., "// TODO(username): description"]
102
+ - [Tracking: e.g., "link to issue number if available"]
103
+
104
+ ## Function Design
105
+
106
+ **Size:**
107
+ - [e.g., "keep under 50 lines, extract helpers"]
108
+
109
+ **Parameters:**
110
+ - [e.g., "max 3 parameters, use object for more"]
111
+ - [e.g., "destructure objects in parameter list"]
112
+
113
+ **Return Values:**
114
+ - [e.g., "explicit returns, no implicit undefined"]
115
+ - [e.g., "return early for guard clauses"]
116
+
117
+ ## Module Design
118
+
119
+ **Exports:**
120
+ - [e.g., "named exports preferred, default exports for React components"]
121
+ - [e.g., "export from index.ts for public API"]
122
+
123
+ **Barrel Files:**
124
+ - [e.g., "use index.ts to re-export public API"]
125
+ - [e.g., "avoid circular dependencies"]
126
+
127
+ ---
128
+
129
+ *Convention analysis: [date]*
130
+ *Update when patterns change*
131
+ ```
132
+
133
+ <good_examples>
134
+ ```markdown
135
+ # Coding Conventions
136
+
137
+ **Analysis Date:** 2025-01-20
138
+
139
+ ## Naming Patterns
140
+
141
+ **Files:**
142
+ - kebab-case for all files (command-handler.ts, user-service.ts)
143
+ - *.test.ts alongside source files
144
+ - index.ts for barrel exports
145
+
146
+ **Functions:**
147
+ - camelCase for all functions
148
+ - No special prefix for async functions
149
+ - handleEventName for event handlers (handleClick, handleSubmit)
150
+
151
+ **Variables:**
152
+ - camelCase for variables
153
+ - UPPER_SNAKE_CASE for constants (MAX_RETRIES, API_BASE_URL)
154
+ - No underscore prefix (no private marker in TS)
155
+
156
+ **Types:**
157
+ - PascalCase for interfaces, no I prefix (User, not IUser)
158
+ - PascalCase for type aliases (UserConfig, ResponseData)
159
+ - PascalCase for enum names, UPPER_CASE for values (Status.PENDING)
160
+
161
+ ## Code Style
162
+
163
+ **Formatting:**
164
+ - Prettier with .prettierrc
165
+ - 100 character line length
166
+ - Single quotes for strings
167
+ - Semicolons required
168
+ - 2 space indentation
169
+
170
+ **Linting:**
171
+ - ESLint with eslint.config.js
172
+ - Extends @typescript-eslint/recommended
173
+ - No console.log in production code (use logger)
174
+ - Run: npm run lint
175
+
176
+ ## Import Organization
177
+
178
+ **Order:**
179
+ 1. External packages (react, express, commander)
180
+ 2. Internal modules (@/lib, @/services)
181
+ 3. Relative imports (./utils, ../types)
182
+ 4. Type imports (import type { User })
183
+
184
+ **Grouping:**
185
+ - Blank line between groups
186
+ - Alphabetical within each group
187
+ - Type imports last within each group
188
+
189
+ **Path Aliases:**
190
+ - @/ maps to src/
191
+ - No other aliases defined
192
+
193
+ ## Error Handling
194
+
195
+ **Patterns:**
196
+ - Throw errors, catch at boundaries (route handlers, main functions)
197
+ - Extend Error class for custom errors (ValidationError, NotFoundError)
198
+ - Async functions use try/catch, no .catch() chains
199
+
200
+ **Error Types:**
201
+ - Throw on invalid input, missing dependencies, invariant violations
202
+ - Log error with context before throwing: logger.error({ err, userId }, 'Failed to process')
203
+ - Include cause in error message: new Error('Failed to X', { cause: originalError })
204
+
205
+ ## Logging
206
+
207
+ **Framework:**
208
+ - pino logger instance exported from lib/logger.ts
209
+ - Levels: debug, info, warn, error (no trace)
210
+
211
+ **Patterns:**
212
+ - Structured logging with context: logger.info({ userId, action }, 'User action')
213
+ - Log at service boundaries, not in utility functions
214
+ - Log state transitions, external API calls, errors
215
+ - No console.log in committed code
216
+
217
+ ## Comments
218
+
219
+ **When to Comment:**
220
+ - Explain why, not what: // Retry 3 times because API has transient failures
221
+ - Document business rules: // Users must verify email within 24 hours
222
+ - Explain non-obvious algorithms or workarounds
223
+ - Avoid obvious comments: // set count to 0
224
+
225
+ **JSDoc/TSDoc:**
226
+ - Required for public API functions
227
+ - Optional for internal functions if signature is self-explanatory
228
+ - Use @param, @returns, @throws tags
229
+
230
+ **TODO Comments:**
231
+ - Format: // TODO: description (no username, using git blame)
232
+ - Link to issue if exists: // TODO: Fix race condition (issue #123)
233
+
234
+ ## Function Design
235
+
236
+ **Size:**
237
+ - Keep under 50 lines
238
+ - Extract helpers for complex logic
239
+ - One level of abstraction per function
240
+
241
+ **Parameters:**
242
+ - Max 3 parameters
243
+ - Use options object for 4+ parameters: function create(options: CreateOptions)
244
+ - Destructure in parameter list: function process({ id, name }: ProcessParams)
245
+
246
+ **Return Values:**
247
+ - Explicit return statements
248
+ - Return early for guard clauses
249
+ - Use Result<T, E> type for expected failures
250
+
251
+ ## Module Design
252
+
253
+ **Exports:**
254
+ - Named exports preferred
255
+ - Default exports only for React components
256
+ - Export public API from index.ts barrel files
257
+
258
+ **Barrel Files:**
259
+ - index.ts re-exports public API
260
+ - Keep internal helpers private (don't export from index)
261
+ - Avoid circular dependencies (import from specific files if needed)
262
+
263
+ ---
264
+
265
+ *Convention analysis: 2025-01-20*
266
+ *Update when patterns change*
267
+ ```
268
+ </good_examples>
269
+
270
+ <guidelines>
271
+ **What belongs in CONVENTIONS.md:**
272
+ - Naming patterns observed in the codebase
273
+ - Formatting rules (Prettier config, linting rules)
274
+ - Import organization patterns
275
+ - Error handling strategy
276
+ - Logging approach
277
+ - Comment conventions
278
+ - Function and module design patterns
279
+
280
+ **What does NOT belong here:**
281
+ - Architecture decisions (that's ARCHITECTURE.md)
282
+ - Technology choices (that's STACK.md)
283
+ - Test patterns (that's TESTING.md)
284
+ - File organization (that's STRUCTURE.md)
285
+
286
+ **When filling this template:**
287
+ - Check .prettierrc, .eslintrc, or similar config files
288
+ - Examine 5-10 representative source files for patterns
289
+ - Look for consistency: if 80%+ follows a pattern, document it
290
+ - Be prescriptive: "Use X" not "Sometimes Y is used"
291
+ - Note deviations: "Legacy code uses Y, new code should use X"
292
+ - Keep under ~150 lines total
293
+
294
+ **Useful for phase planning when:**
295
+ - Writing new code (match existing style)
296
+ - Adding features (follow naming patterns)
297
+ - Refactoring (apply consistent conventions)
298
+ - Code review (check against documented patterns)
299
+ - Onboarding (understand style expectations)
300
+
301
+ **Analysis approach:**
302
+ - Scan src/ directory for file naming patterns
303
+ - Check package.json scripts for lint/format commands
304
+ - Read 5-10 files to identify function naming, error handling
305
+ - Look for config files (.prettierrc, eslint.config.js)
306
+ - Note patterns in imports, comments, function signatures
307
+ </guidelines>