@hhsw2015/task-master-ai 0.43.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 (57) hide show
  1. package/CHANGELOG.md +4072 -0
  2. package/LICENSE +25 -0
  3. package/README-task-master.md +648 -0
  4. package/README.md +415 -0
  5. package/dist/ai-services-unified-BgdcS4fE.js +7 -0
  6. package/dist/ai-services-unified-DVAKOPK0.js +1 -0
  7. package/dist/assets/.windsurfrules +524 -0
  8. package/dist/assets/AGENTS.md +435 -0
  9. package/dist/assets/GEMINI.md +110 -0
  10. package/dist/assets/claude/TM_COMMANDS_GUIDE.md +147 -0
  11. package/dist/assets/config.json +34 -0
  12. package/dist/assets/env.example +12 -0
  13. package/dist/assets/example_prd.txt +47 -0
  14. package/dist/assets/example_prd_rpg.txt +511 -0
  15. package/dist/assets/gitignore +25 -0
  16. package/dist/assets/hamster-art.txt +49 -0
  17. package/dist/assets/kiro-hooks/tm-code-change-task-tracker.kiro.hook +23 -0
  18. package/dist/assets/kiro-hooks/tm-complexity-analyzer.kiro.hook +16 -0
  19. package/dist/assets/kiro-hooks/tm-daily-standup-assistant.kiro.hook +13 -0
  20. package/dist/assets/kiro-hooks/tm-git-commit-task-linker.kiro.hook +13 -0
  21. package/dist/assets/kiro-hooks/tm-pr-readiness-checker.kiro.hook +13 -0
  22. package/dist/assets/kiro-hooks/tm-task-dependency-auto-progression.kiro.hook +17 -0
  23. package/dist/assets/kiro-hooks/tm-test-success-task-completer.kiro.hook +23 -0
  24. package/dist/assets/roocode/.roo/rules-architect/architect-rules +93 -0
  25. package/dist/assets/roocode/.roo/rules-ask/ask-rules +89 -0
  26. package/dist/assets/roocode/.roo/rules-code/code-rules +61 -0
  27. package/dist/assets/roocode/.roo/rules-debug/debug-rules +68 -0
  28. package/dist/assets/roocode/.roo/rules-orchestrator/orchestrator-rules +181 -0
  29. package/dist/assets/roocode/.roo/rules-test/test-rules +61 -0
  30. package/dist/assets/roocode/.roomodes +63 -0
  31. package/dist/assets/rules/cursor_rules.mdc +53 -0
  32. package/dist/assets/rules/dev_workflow.mdc +424 -0
  33. package/dist/assets/rules/hamster.mdc +173 -0
  34. package/dist/assets/rules/self_improve.mdc +72 -0
  35. package/dist/assets/rules/taskmaster.mdc +573 -0
  36. package/dist/assets/rules/taskmaster_hooks_workflow.mdc +59 -0
  37. package/dist/assets/scripts_README.md +445 -0
  38. package/dist/commands-D7m4KWx1.js +329 -0
  39. package/dist/config-manager-CvbfYtIR.js +1 -0
  40. package/dist/config-manager-cjltSxIS.js +270 -0
  41. package/dist/dependency-manager-CyOxi5uo.js +1078 -0
  42. package/dist/git-utils-DllbRE35.js +1 -0
  43. package/dist/git-utils-PBP1PRVP.js +1 -0
  44. package/dist/mcp-server.js +44 -0
  45. package/dist/profiles-DcD-JxPM.js +3528 -0
  46. package/dist/research-DN4RyyJY.js +1 -0
  47. package/dist/response-language-C5AwQSfD.js +1 -0
  48. package/dist/response-language-LzM2RD6-.js +1 -0
  49. package/dist/sentry-CBAZ4LSk.js +1 -0
  50. package/dist/tag-management-6HOtYZMj.js +1 -0
  51. package/dist/task-manager-BtFURFe0.js +1 -0
  52. package/dist/task-master.js +2 -0
  53. package/dist/update-subtask-by-id-DiWMqGfw.js +1 -0
  54. package/dist/update-task-by-id-eyL-PNVX.js +1 -0
  55. package/dist/utils-CGk8TL6x.js +1 -0
  56. package/index.js +160 -0
  57. package/package.json +183 -0
@@ -0,0 +1,524 @@
1
+ Below you will find a variety of important rules spanning:
2
+
3
+ - the dev_workflow
4
+ - the .windsurfrules document self-improvement workflow
5
+ - the template to follow when modifying or adding new sections/rules to this document.
6
+
7
+ ---
8
+
9
+ ## DEV_WORKFLOW
10
+
11
+ description: Guide for using meta-development script (scripts/dev.js) to manage task-driven development workflows
12
+ globs: **/\*
13
+ filesToApplyRule: **/\*
14
+ alwaysApply: true
15
+
16
+ ---
17
+
18
+ - **Global CLI Commands**
19
+
20
+ - Task Master now provides a global CLI through the `task-master` command
21
+ - All functionality from `scripts/dev.js` is available through this interface
22
+ - Install globally with `npm install -g claude-task-master` or use locally via `npx`
23
+ - Use `task-master <command>` instead of `node scripts/dev.js <command>`
24
+ - Examples:
25
+ - `task-master list` instead of `node scripts/dev.js list`
26
+ - `task-master next` instead of `node scripts/dev.js next`
27
+ - `task-master expand --id=3` instead of `node scripts/dev.js expand --id=3`
28
+ - All commands accept the same options as their script equivalents
29
+ - The CLI provides additional commands like `task-master init` for project setup
30
+
31
+ - **Development Workflow Process**
32
+
33
+ - Start new projects by running `task-master init` or `node scripts/dev.js parse-prd --input=<prd-file.txt>` to generate initial tasks.json
34
+ - Begin coding sessions with `task-master list` to see current tasks, status, and IDs
35
+ - Analyze task complexity with `task-master analyze-complexity --research` before breaking down tasks
36
+ - Select tasks based on dependencies (all marked 'done'), priority level, and ID order
37
+ - Clarify tasks by checking task files in tasks/ directory or asking for user input
38
+ - View specific task details using `task-master show <id>` to understand implementation requirements
39
+ - Break down complex tasks using `task-master expand --id=<id>` with appropriate flags
40
+ - Clear existing subtasks if needed using `task-master clear-subtasks --id=<id>` before regenerating
41
+ - Implement code following task details, dependencies, and project standards
42
+ - Verify tasks according to test strategies before marking as complete
43
+ - Mark completed tasks with `task-master set-status --id=<id> --status=done`
44
+ - Update dependent tasks when implementation differs from original plan
45
+ - Generate task files with `task-master generate` after updating tasks.json
46
+ - Maintain valid dependency structure with `task-master fix-dependencies` when needed
47
+ - Respect dependency chains and task priorities when selecting work
48
+ - Report progress regularly using the list command
49
+
50
+ - **Task Complexity Analysis**
51
+
52
+ - Run `node scripts/dev.js analyze-complexity --research` for comprehensive analysis
53
+ - Review complexity report in scripts/task-complexity-report.json
54
+ - Or use `node scripts/dev.js complexity-report` for a formatted, readable version of the report
55
+ - Focus on tasks with highest complexity scores (8-10) for detailed breakdown
56
+ - Use analysis results to determine appropriate subtask allocation
57
+ - Note that reports are automatically used by the expand command
58
+
59
+ - **Task Breakdown Process**
60
+
61
+ - For tasks with complexity analysis, use `node scripts/dev.js expand --id=<id>`
62
+ - Otherwise use `node scripts/dev.js expand --id=<id> --subtasks=<number>`
63
+ - Add `--research` flag to leverage Perplexity AI for research-backed expansion
64
+ - Use `--prompt="<context>"` to provide additional context when needed
65
+ - Review and adjust generated subtasks as necessary
66
+ - Use `--all` flag to expand multiple pending tasks at once
67
+ - If subtasks need regeneration, clear them first with `clear-subtasks` command
68
+
69
+ - **Implementation Drift Handling**
70
+
71
+ - When implementation differs significantly from planned approach
72
+ - When future tasks need modification due to current implementation choices
73
+ - When new dependencies or requirements emerge
74
+ - Call `node scripts/dev.js update --from=<futureTaskId> --prompt="<explanation>"` to update tasks.json
75
+
76
+ - **Task Status Management**
77
+
78
+ - Use 'pending' for tasks ready to be worked on
79
+ - Use 'done' for completed and verified tasks
80
+ - Use 'deferred' for postponed tasks
81
+ - Add custom status values as needed for project-specific workflows
82
+
83
+ - **Task File Format Reference**
84
+
85
+ ```
86
+ # Task ID: <id>
87
+ # Title: <title>
88
+ # Status: <status>
89
+ # Dependencies: <comma-separated list of dependency IDs>
90
+ # Priority: <priority>
91
+ # Description: <brief description>
92
+ # Details:
93
+ <detailed implementation notes>
94
+
95
+ # Test Strategy:
96
+ <verification approach>
97
+ ```
98
+
99
+ - **Command Reference: parse-prd**
100
+
101
+ - Legacy Syntax: `node scripts/dev.js parse-prd --input=<prd-file.txt>`
102
+ - CLI Syntax: `task-master parse-prd --input=<prd-file.txt>`
103
+ - Description: Parses a PRD document and generates a tasks.json file with structured tasks
104
+ - Parameters:
105
+ - `--input=<file>`: Path to the PRD text file (default: sample-prd.txt)
106
+ - Example: `task-master parse-prd --input=requirements.txt`
107
+ - Notes: Will overwrite existing tasks.json file. Use with caution.
108
+
109
+ - **Command Reference: update**
110
+
111
+ - Legacy Syntax: `node scripts/dev.js update --from=<id> --prompt="<prompt>"`
112
+ - CLI Syntax: `task-master update --from=<id> --prompt="<prompt>"`
113
+ - Description: Updates tasks with ID >= specified ID based on the provided prompt
114
+ - Parameters:
115
+ - `--from=<id>`: Task ID from which to start updating (required)
116
+ - `--prompt="<text>"`: Explanation of changes or new context (required)
117
+ - Example: `task-master update --from=4 --prompt="Now we are using Express instead of Fastify."`
118
+ - Notes: Only updates tasks not marked as 'done'. Completed tasks remain unchanged.
119
+
120
+ - **Command Reference: generate**
121
+
122
+ - Legacy Syntax: `node scripts/dev.js generate`
123
+ - CLI Syntax: `task-master generate`
124
+ - Description: Generates individual task files based on tasks.json
125
+ - Parameters:
126
+ - `--file=<path>, -f`: Use alternative tasks.json file (default: '.taskmaster/tasks/tasks.json')
127
+ - `--output=<dir>, -o`: Output directory (default: '.taskmaster/tasks')
128
+ - Example: `task-master generate`
129
+ - Notes: Overwrites existing task files. Creates output directory if needed.
130
+
131
+ - **Command Reference: set-status**
132
+
133
+ - Legacy Syntax: `node scripts/dev.js set-status --id=<id> --status=<status>`
134
+ - CLI Syntax: `task-master set-status --id=<id> --status=<status>`
135
+ - Description: Updates the status of a specific task in tasks.json
136
+ - Parameters:
137
+ - `--id=<id>`: ID of the task to update (required)
138
+ - `--status=<status>`: New status value (required)
139
+ - Example: `task-master set-status --id=3 --status=done`
140
+ - Notes: Common values are 'done', 'pending', and 'deferred', but any string is accepted.
141
+
142
+ - **Command Reference: list**
143
+
144
+ - Legacy Syntax: `node scripts/dev.js list`
145
+ - CLI Syntax: `task-master list`
146
+ - Description: Lists all tasks in tasks.json with IDs, titles, and status
147
+ - Parameters:
148
+ - `--status=<status>, -s`: Filter by status
149
+ - `--with-subtasks`: Show subtasks for each task
150
+ - `--file=<path>, -f`: Use alternative tasks.json file (default: 'tasks/tasks.json')
151
+ - Example: `task-master list`
152
+ - Notes: Provides quick overview of project progress. Use at start of sessions.
153
+
154
+ - **Command Reference: expand**
155
+
156
+ - Legacy Syntax: `node scripts/dev.js expand --id=<id> [--num=<number>] [--research] [--prompt="<context>"]`
157
+ - CLI Syntax: `task-master expand --id=<id> [--num=<number>] [--research] [--prompt="<context>"]`
158
+ - Description: Expands a task with subtasks for detailed implementation
159
+ - Parameters:
160
+ - `--id=<id>`: ID of task to expand (required unless using --all)
161
+ - `--all`: Expand all pending tasks, prioritized by complexity
162
+ - `--num=<number>`: Number of subtasks to generate (default: from complexity report)
163
+ - `--research`: Use Perplexity AI for research-backed generation
164
+ - `--prompt="<text>"`: Additional context for subtask generation
165
+ - `--force`: Regenerate subtasks even for tasks that already have them
166
+ - Example: `task-master expand --id=3 --num=5 --research --prompt="Focus on security aspects"`
167
+ - Notes: Uses complexity report recommendations if available.
168
+
169
+ - **Command Reference: analyze-complexity**
170
+
171
+ - Legacy Syntax: `node scripts/dev.js analyze-complexity [options]`
172
+ - CLI Syntax: `task-master analyze-complexity [options]`
173
+ - Description: Analyzes task complexity and generates expansion recommendations
174
+ - Parameters:
175
+ - `--output=<file>, -o`: Output file path (default: scripts/task-complexity-report.json)
176
+ - `--model=<model>, -m`: Override LLM model to use
177
+ - `--threshold=<number>, -t`: Minimum score for expansion recommendation (default: 5)
178
+ - `--file=<path>, -f`: Use alternative tasks.json file
179
+ - `--research, -r`: Use Perplexity AI for research-backed analysis
180
+ - Example: `task-master analyze-complexity --research`
181
+ - Notes: Report includes complexity scores, recommended subtasks, and tailored prompts.
182
+
183
+ - **Command Reference: clear-subtasks**
184
+
185
+ - Legacy Syntax: `node scripts/dev.js clear-subtasks --id=<id>`
186
+ - CLI Syntax: `task-master clear-subtasks --id=<id>`
187
+ - Description: Removes subtasks from specified tasks to allow regeneration
188
+ - Parameters:
189
+ - `--id=<id>`: ID or comma-separated IDs of tasks to clear subtasks from
190
+ - `--all`: Clear subtasks from all tasks
191
+ - Examples:
192
+ - `task-master clear-subtasks --id=3`
193
+ - `task-master clear-subtasks --id=1,2,3`
194
+ - `task-master clear-subtasks --all`
195
+ - Notes:
196
+ - Task files are automatically regenerated after clearing subtasks
197
+ - Can be combined with expand command to immediately generate new subtasks
198
+ - Works with both parent tasks and individual subtasks
199
+
200
+ - **Task Structure Fields**
201
+
202
+ - **id**: Unique identifier for the task (Example: `1`)
203
+ - **title**: Brief, descriptive title (Example: `"Initialize Repo"`)
204
+ - **description**: Concise summary of what the task involves (Example: `"Create a new repository, set up initial structure."`)
205
+ - **status**: Current state of the task (Example: `"pending"`, `"done"`, `"deferred"`)
206
+ - **dependencies**: IDs of prerequisite tasks (Example: `[1, 2]`)
207
+ - Dependencies are displayed with status indicators (✅ for completed, ⏱️ for pending)
208
+ - This helps quickly identify which prerequisite tasks are blocking work
209
+ - **priority**: Importance level (Example: `"high"`, `"medium"`, `"low"`)
210
+ - **details**: In-depth implementation instructions (Example: `"Use GitHub client ID/secret, handle callback, set session token."`)
211
+ - **testStrategy**: Verification approach (Example: `"Deploy and call endpoint to confirm 'Hello World' response."`)
212
+ - **subtasks**: List of smaller, more specific tasks (Example: `[{"id": 1, "title": "Configure OAuth", ...}]`)
213
+
214
+ - **Environment Variables Configuration**
215
+
216
+ - **ANTHROPIC_API_KEY** (Required): Your Anthropic API key for Claude (Example: `ANTHROPIC_API_KEY=sk-ant-api03-...`)
217
+ - **MODEL** (Default: `"claude-3-7-sonnet-20250219"`): Claude model to use (Example: `MODEL=claude-3-opus-20240229`)
218
+ - **MAX_TOKENS** (Default: `"4000"`): Maximum tokens for responses (Example: `MAX_TOKENS=8000`)
219
+ - **TEMPERATURE** (Default: `"0.7"`): Temperature for model responses (Example: `TEMPERATURE=0.5`)
220
+ - **DEBUG** (Default: `"false"`): Enable debug logging (Example: `DEBUG=true`)
221
+ - **TASKMASTER_LOG_LEVEL** (Default: `"info"`): Console output level (Example: `TASKMASTER_LOG_LEVEL=debug`)
222
+ - **DEFAULT_SUBTASKS** (Default: `"3"`): Default subtask count (Example: `DEFAULT_SUBTASKS=5`)
223
+ - **DEFAULT_PRIORITY** (Default: `"medium"`): Default priority (Example: `DEFAULT_PRIORITY=high`)
224
+ - **PROJECT_NAME** (Default: `"MCP SaaS MVP"`): Project name in metadata (Example: `PROJECT_NAME=My Awesome Project`)
225
+ - **PROJECT_VERSION** (Default: `"1.0.0"`): Version in metadata (Example: `PROJECT_VERSION=2.1.0`)
226
+ - **PERPLEXITY_API_KEY**: For research-backed features (Example: `PERPLEXITY_API_KEY=pplx-...`)
227
+ - **PERPLEXITY_MODEL** (Default: `"sonar-medium-online"`): Perplexity model (Example: `PERPLEXITY_MODEL=sonar-large-online`)
228
+
229
+ - **Determining the Next Task**
230
+
231
+ - Run `task-master next` to show the next task to work on
232
+ - The next command identifies tasks with all dependencies satisfied
233
+ - Tasks are prioritized by priority level, dependency count, and ID
234
+ - The command shows comprehensive task information including:
235
+ - Basic task details and description
236
+ - Implementation details
237
+ - Subtasks (if they exist)
238
+ - Contextual suggested actions
239
+ - Recommended before starting any new development work
240
+ - Respects your project's dependency structure
241
+ - Ensures tasks are completed in the appropriate sequence
242
+ - Provides ready-to-use commands for common task actions
243
+
244
+ - **Viewing Specific Task Details**
245
+
246
+ - Run `task-master show <id>` or `task-master show --id=<id>` to view a specific task
247
+ - Use dot notation for subtasks: `task-master show 1.2` (shows subtask 2 of task 1)
248
+ - Displays comprehensive information similar to the next command, but for a specific task
249
+ - For parent tasks, shows all subtasks and their current status
250
+ - For subtasks, shows parent task information and relationship
251
+ - Provides contextual suggested actions appropriate for the specific task
252
+ - Useful for examining task details before implementation or checking status
253
+
254
+ - **Managing Task Dependencies**
255
+
256
+ - Use `task-master add-dependency --id=<id> --depends-on=<id>` to add a dependency
257
+ - Use `task-master remove-dependency --id=<id> --depends-on=<id>` to remove a dependency
258
+ - The system prevents circular dependencies and duplicate dependency entries
259
+ - Dependencies are checked for existence before being added or removed
260
+ - Task files are automatically regenerated after dependency changes
261
+ - Dependencies are visualized with status indicators in task listings and files
262
+
263
+ - **Command Reference: add-dependency**
264
+
265
+ - Legacy Syntax: `node scripts/dev.js add-dependency --id=<id> --depends-on=<id>`
266
+ - CLI Syntax: `task-master add-dependency --id=<id> --depends-on=<id>`
267
+ - Description: Adds a dependency relationship between two tasks
268
+ - Parameters:
269
+ - `--id=<id>`: ID of task that will depend on another task (required)
270
+ - `--depends-on=<id>`: ID of task that will become a dependency (required)
271
+ - Example: `task-master add-dependency --id=22 --depends-on=21`
272
+ - Notes: Prevents circular dependencies and duplicates; updates task files automatically
273
+
274
+ - **Command Reference: remove-dependency**
275
+
276
+ - Legacy Syntax: `node scripts/dev.js remove-dependency --id=<id> --depends-on=<id>`
277
+ - CLI Syntax: `task-master remove-dependency --id=<id> --depends-on=<id>`
278
+ - Description: Removes a dependency relationship between two tasks
279
+ - Parameters:
280
+ - `--id=<id>`: ID of task to remove dependency from (required)
281
+ - `--depends-on=<id>`: ID of task to remove as a dependency (required)
282
+ - Example: `task-master remove-dependency --id=22 --depends-on=21`
283
+ - Notes: Checks if dependency actually exists; updates task files automatically
284
+
285
+ - **Command Reference: validate-dependencies**
286
+
287
+ - Legacy Syntax: `node scripts/dev.js validate-dependencies [options]`
288
+ - CLI Syntax: `task-master validate-dependencies [options]`
289
+ - Description: Checks for and identifies invalid dependencies in tasks.json and task files
290
+ - Parameters:
291
+ - `--file=<path>, -f`: Use alternative tasks.json file (default: 'tasks/tasks.json')
292
+ - Example: `task-master validate-dependencies`
293
+ - Notes:
294
+ - Reports all non-existent dependencies and self-dependencies without modifying files
295
+ - Provides detailed statistics on task dependency state
296
+ - Use before fix-dependencies to audit your task structure
297
+
298
+ - **Command Reference: fix-dependencies**
299
+
300
+ - Legacy Syntax: `node scripts/dev.js fix-dependencies [options]`
301
+ - CLI Syntax: `task-master fix-dependencies [options]`
302
+ - Description: Finds and fixes all invalid dependencies in tasks.json and task files
303
+ - Parameters:
304
+ - `--file=<path>, -f`: Use alternative tasks.json file (default: 'tasks/tasks.json')
305
+ - Example: `task-master fix-dependencies`
306
+ - Notes:
307
+ - Removes references to non-existent tasks and subtasks
308
+ - Eliminates self-dependencies (tasks depending on themselves)
309
+ - Regenerates task files with corrected dependencies
310
+ - Provides detailed report of all fixes made
311
+
312
+ - **Command Reference: complexity-report**
313
+
314
+ - Legacy Syntax: `node scripts/dev.js complexity-report [options]`
315
+ - CLI Syntax: `task-master complexity-report [options]`
316
+ - Description: Displays the task complexity analysis report in a formatted, easy-to-read way
317
+ - Parameters:
318
+ - `--file=<path>, -f`: Path to the complexity report file (default: 'scripts/task-complexity-report.json')
319
+ - Example: `task-master complexity-report`
320
+ - Notes:
321
+ - Shows tasks organized by complexity score with recommended actions
322
+ - Provides complexity distribution statistics
323
+ - Displays ready-to-use expansion commands for complex tasks
324
+ - If no report exists, offers to generate one interactively
325
+
326
+ - **Command Reference: add-task**
327
+
328
+ - CLI Syntax: `task-master add-task [options]`
329
+ - Description: Add a new task to tasks.json using AI
330
+ - Parameters:
331
+ - `--file=<path>, -f`: Path to the tasks file (default: 'tasks/tasks.json')
332
+ - `--prompt=<text>, -p`: Description of the task to add (required)
333
+ - `--dependencies=<ids>, -d`: Comma-separated list of task IDs this task depends on
334
+ - `--priority=<priority>`: Task priority (high, medium, low) (default: 'medium')
335
+ - Example: `task-master add-task --prompt="Create user authentication using Auth0"`
336
+ - Notes: Uses AI to convert description into structured task with appropriate details
337
+
338
+ - **Command Reference: init**
339
+
340
+ - CLI Syntax: `task-master init`
341
+ - Description: Initialize a new project with Task Master structure
342
+ - Parameters: None
343
+ - Example: `task-master init`
344
+ - Notes:
345
+ - Creates initial project structure with required files
346
+ - Prompts for project settings if not provided
347
+ - Merges with existing files when appropriate
348
+ - Can be used to bootstrap a new Task Master project quickly
349
+
350
+ - **Code Analysis & Refactoring Techniques**
351
+ - **Top-Level Function Search**
352
+ - Use grep pattern matching to find all exported functions across the codebase
353
+ - Command: `grep -E "export (function|const) \w+|function \w+\(|const \w+ = \(|module\.exports" --include="*.js" -r ./`
354
+ - Benefits:
355
+ - Quickly identify all public API functions without reading implementation details
356
+ - Compare functions between files during refactoring (e.g., monolithic to modular structure)
357
+ - Verify all expected functions exist in refactored modules
358
+ - Identify duplicate functionality or naming conflicts
359
+ - Usage examples:
360
+ - When migrating from `scripts/dev.js` to modular structure: `grep -E "function \w+\(" scripts/dev.js`
361
+ - Check function exports in a directory: `grep -E "export (function|const)" scripts/modules/`
362
+ - Find potential naming conflicts: `grep -E "function (get|set|create|update)\w+\(" -r ./`
363
+ - Variations:
364
+ - Add `-n` flag to include line numbers
365
+ - Add `--include="*.ts"` to filter by file extension
366
+ - Use with `| sort` to alphabetize results
367
+ - Integration with refactoring workflow:
368
+ - Start by mapping all functions in the source file
369
+ - Create target module files based on function grouping
370
+ - Verify all functions were properly migrated
371
+ - Check for any unintentional duplications or omissions
372
+
373
+ ---
374
+
375
+ ## WINDSURF_RULES
376
+
377
+ description: Guidelines for creating and maintaining Windsurf rules to ensure consistency and effectiveness.
378
+ globs: .windsurfrules
379
+ filesToApplyRule: .windsurfrules
380
+ alwaysApply: true
381
+
382
+ ---
383
+
384
+ The below describes how you should be structuring new rule sections in this document.
385
+
386
+ - **Required Rule Structure:**
387
+
388
+ ```markdown
389
+ ---
390
+ description: Clear, one-line description of what the rule enforces
391
+ globs: path/to/files/*.ext, other/path/**/*
392
+ alwaysApply: boolean
393
+ ---
394
+
395
+ - **Main Points in Bold**
396
+ - Sub-points with details
397
+ - Examples and explanations
398
+ ```
399
+
400
+ - **Section References:**
401
+
402
+ - Use `ALL_CAPS_SECTION` to reference files
403
+ - Example: `WINDSURF_RULES`
404
+
405
+ - **Code Examples:**
406
+
407
+ - Use language-specific code blocks
408
+
409
+ ```typescript
410
+ // ✅ DO: Show good examples
411
+ const goodExample = true;
412
+
413
+ // ❌ DON'T: Show anti-patterns
414
+ const badExample = false;
415
+ ```
416
+
417
+ - **Rule Content Guidelines:**
418
+
419
+ - Start with high-level overview
420
+ - Include specific, actionable requirements
421
+ - Show examples of correct implementation
422
+ - Reference existing code when possible
423
+ - Keep rules DRY by referencing other rules
424
+
425
+ - **Rule Maintenance:**
426
+
427
+ - Update rules when new patterns emerge
428
+ - Add examples from actual codebase
429
+ - Remove outdated patterns
430
+ - Cross-reference related rules
431
+
432
+ - **Best Practices:**
433
+ - Use bullet points for clarity
434
+ - Keep descriptions concise
435
+ - Include both DO and DON'T examples
436
+ - Reference actual code over theoretical examples
437
+ - Use consistent formatting across rules
438
+
439
+ ---
440
+
441
+ ## SELF_IMPROVE
442
+
443
+ description: Guidelines for continuously improving this rules document based on emerging code patterns and best practices.
444
+ globs: **/\*
445
+ filesToApplyRule: **/\*
446
+ alwaysApply: true
447
+
448
+ ---
449
+
450
+ - **Rule Improvement Triggers:**
451
+
452
+ - New code patterns not covered by existing rules
453
+ - Repeated similar implementations across files
454
+ - Common error patterns that could be prevented
455
+ - New libraries or tools being used consistently
456
+ - Emerging best practices in the codebase
457
+
458
+ - **Analysis Process:**
459
+
460
+ - Compare new code with existing rules
461
+ - Identify patterns that should be standardized
462
+ - Look for references to external documentation
463
+ - Check for consistent error handling patterns
464
+ - Monitor test patterns and coverage
465
+
466
+ - **Rule Updates:**
467
+
468
+ - **Add New Rules When:**
469
+
470
+ - A new technology/pattern is used in 3+ files
471
+ - Common bugs could be prevented by a rule
472
+ - Code reviews repeatedly mention the same feedback
473
+ - New security or performance patterns emerge
474
+
475
+ - **Modify Existing Rules When:**
476
+ - Better examples exist in the codebase
477
+ - Additional edge cases are discovered
478
+ - Related rules have been updated
479
+ - Implementation details have changed
480
+
481
+ - **Example Pattern Recognition:**
482
+
483
+ ```typescript
484
+ // If you see repeated patterns like:
485
+ const data = await prisma.user.findMany({
486
+ select: { id: true, email: true },
487
+ where: { status: "ACTIVE" },
488
+ });
489
+
490
+ // Consider adding a PRISMA section in the .windsurfrules:
491
+ // - Standard select fields
492
+ // - Common where conditions
493
+ // - Performance optimization patterns
494
+ ```
495
+
496
+ - **Rule Quality Checks:**
497
+
498
+ - Rules should be actionable and specific
499
+ - Examples should come from actual code
500
+ - References should be up to date
501
+ - Patterns should be consistently enforced
502
+
503
+ - **Continuous Improvement:**
504
+
505
+ - Monitor code review comments
506
+ - Track common development questions
507
+ - Update rules after major refactors
508
+ - Add links to relevant documentation
509
+ - Cross-reference related rules
510
+
511
+ - **Rule Deprecation:**
512
+
513
+ - Mark outdated patterns as deprecated
514
+ - Remove rules that no longer apply
515
+ - Update references to deprecated rules
516
+ - Document migration paths for old patterns
517
+
518
+ - **Documentation Updates:**
519
+ - Keep examples synchronized with code
520
+ - Update references to external docs
521
+ - Maintain links between related rules
522
+ - Document breaking changes
523
+
524
+ Follow WINDSURF_RULES for proper rule formatting and structure of windsurf rule sections.