an_post_return 0.2.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.
- checksums.yaml +7 -0
- data/.cursor/mcp.json +21 -0
- data/.cursor/rules/cursor_rules.mdc +53 -0
- data/.cursor/rules/dev_workflow.mdc +215 -0
- data/.cursor/rules/self_improve.mdc +73 -0
- data/.cursor/rules/taskmaster.mdc +353 -0
- data/.env.example +14 -0
- data/.rspec +3 -0
- data/.standard.yml +3 -0
- data/.windsurfrules +474 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/LICENSE.txt +21 -0
- data/README-task-master.md +645 -0
- data/README.md +166 -0
- data/Rakefile +10 -0
- data/lib/an_post_return/client.rb +82 -0
- data/lib/an_post_return/configuration.rb +47 -0
- data/lib/an_post_return/errors.rb +21 -0
- data/lib/an_post_return/objects/base.rb +70 -0
- data/lib/an_post_return/objects/return_label.rb +11 -0
- data/lib/an_post_return/resources/return_label_resource.rb +123 -0
- data/lib/an_post_return/sftp/client.rb +132 -0
- data/lib/an_post_return/sftp/errors.rb +12 -0
- data/lib/an_post_return/sftp/tracking_parser.rb +116 -0
- data/lib/an_post_return/tracker.rb +97 -0
- data/lib/an_post_return/version.rb +5 -0
- data/lib/an_post_return.rb +45 -0
- data/scripts/example_prd.txt +47 -0
- data/scripts/prd.txt +147 -0
- data/scripts/sftp_test.rb +185 -0
- data/scripts/task-complexity-report.json +131 -0
- data/sig/anpost_api.rbs +4 -0
- metadata +302 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4609d8eb53a1f34be10898fd7b0b8da8090b183390ae416099e2cc0efe88c558
|
4
|
+
data.tar.gz: 38c143808c26f0bd6106cee3c5a8d72c3d18097d4e3ff2ff27a2cbc1d587d1b3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b06f6eb026df0f3bad9606755a04b123a2c21e8b870bd4a424e8f1d36b9a3a133fa16b6591920ce987eee3696cc8e992d92444c666a5df089756ff929605980e
|
7
|
+
data.tar.gz: d4701e1ce01ba99060799f9e86f2c6ace063f75dc4cc488c3aeec14e9a7b1ac86f0b2ffaa7e45f753d457daccf013db5478b0d96a928735df1c7047bfb934150
|
data/.cursor/mcp.json
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"mcpServers": {
|
3
|
+
"task-master-ai": {
|
4
|
+
"command": "npx",
|
5
|
+
"args": [
|
6
|
+
"-y",
|
7
|
+
"task-master-mcp"
|
8
|
+
],
|
9
|
+
"env": {
|
10
|
+
"ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY",
|
11
|
+
"PERPLEXITY_API_KEY": "YOUR_PERPLEXITY_API_KEY",
|
12
|
+
"MODEL": "claude-3-7-sonnet-20250219",
|
13
|
+
"PERPLEXITY_MODEL": "sonar-pro",
|
14
|
+
"MAX_TOKENS": "64000",
|
15
|
+
"TEMPERATURE": "0.2",
|
16
|
+
"DEFAULT_SUBTASKS": "5",
|
17
|
+
"DEFAULT_PRIORITY": "medium"
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
---
|
2
|
+
description: Guidelines for creating and maintaining Cursor rules to ensure consistency and effectiveness.
|
3
|
+
globs: .cursor/rules/*.mdc
|
4
|
+
alwaysApply: true
|
5
|
+
---
|
6
|
+
|
7
|
+
- **Required Rule Structure:**
|
8
|
+
```markdown
|
9
|
+
---
|
10
|
+
description: Clear, one-line description of what the rule enforces
|
11
|
+
globs: path/to/files/*.ext, other/path/**/*
|
12
|
+
alwaysApply: boolean
|
13
|
+
---
|
14
|
+
|
15
|
+
- **Main Points in Bold**
|
16
|
+
- Sub-points with details
|
17
|
+
- Examples and explanations
|
18
|
+
```
|
19
|
+
|
20
|
+
- **File References:**
|
21
|
+
- Use `[filename](mdc:path/to/file)` ([filename](mdc:filename)) to reference files
|
22
|
+
- Example: [prisma.mdc](mdc:.cursor/rules/prisma.mdc) for rule references
|
23
|
+
- Example: [schema.prisma](mdc:prisma/schema.prisma) for code references
|
24
|
+
|
25
|
+
- **Code Examples:**
|
26
|
+
- Use language-specific code blocks
|
27
|
+
```typescript
|
28
|
+
// ✅ DO: Show good examples
|
29
|
+
const goodExample = true;
|
30
|
+
|
31
|
+
// ❌ DON'T: Show anti-patterns
|
32
|
+
const badExample = false;
|
33
|
+
```
|
34
|
+
|
35
|
+
- **Rule Content Guidelines:**
|
36
|
+
- Start with high-level overview
|
37
|
+
- Include specific, actionable requirements
|
38
|
+
- Show examples of correct implementation
|
39
|
+
- Reference existing code when possible
|
40
|
+
- Keep rules DRY by referencing other rules
|
41
|
+
|
42
|
+
- **Rule Maintenance:**
|
43
|
+
- Update rules when new patterns emerge
|
44
|
+
- Add examples from actual codebase
|
45
|
+
- Remove outdated patterns
|
46
|
+
- Cross-reference related rules
|
47
|
+
|
48
|
+
- **Best Practices:**
|
49
|
+
- Use bullet points for clarity
|
50
|
+
- Keep descriptions concise
|
51
|
+
- Include both DO and DON'T examples
|
52
|
+
- Reference actual code over theoretical examples
|
53
|
+
- Use consistent formatting across rules
|
@@ -0,0 +1,215 @@
|
|
1
|
+
---
|
2
|
+
description: Guide for using Task Master to manage task-driven development workflows
|
3
|
+
globs: **/*
|
4
|
+
alwaysApply: true
|
5
|
+
---
|
6
|
+
|
7
|
+
# Task Master Development Workflow
|
8
|
+
|
9
|
+
This guide outlines the typical process for using Task Master to manage software development projects.
|
10
|
+
|
11
|
+
## Primary Interaction: MCP Server vs. CLI
|
12
|
+
|
13
|
+
Task Master offers two primary ways to interact:
|
14
|
+
|
15
|
+
1. **MCP Server (Recommended for Integrated Tools)**:
|
16
|
+
- For AI agents and integrated development environments (like Cursor), interacting via the **MCP server is the preferred method**.
|
17
|
+
- The MCP server exposes Task Master functionality through a set of tools (e.g., `get_tasks`, `add_subtask`).
|
18
|
+
- This method offers better performance, structured data exchange, and richer error handling compared to CLI parsing.
|
19
|
+
- Refer to [`mcp.mdc`](mdc:.cursor/rules/mcp.mdc) for details on the MCP architecture and available tools.
|
20
|
+
- A comprehensive list and description of MCP tools and their corresponding CLI commands can be found in [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc).
|
21
|
+
- **Restart the MCP server** if core logic in `scripts/modules` or MCP tool/direct function definitions change.
|
22
|
+
|
23
|
+
2. **`task-master` CLI (For Users & Fallback)**:
|
24
|
+
- The global `task-master` command provides a user-friendly interface for direct terminal interaction.
|
25
|
+
- It can also serve as a fallback if the MCP server is inaccessible or a specific function isn't exposed via MCP.
|
26
|
+
- Install globally with `npm install -g task-master-ai` or use locally via `npx task-master-ai ...`.
|
27
|
+
- The CLI commands often mirror the MCP tools (e.g., `task-master list` corresponds to `get_tasks`).
|
28
|
+
- Refer to [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc) for a detailed command reference.
|
29
|
+
|
30
|
+
## Standard Development Workflow Process
|
31
|
+
|
32
|
+
- Start new projects by running `init` tool / `task-master init` or `parse_prd` / `task-master parse-prd --input='<prd-file.txt>'` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to generate initial tasks.json
|
33
|
+
- Begin coding sessions with `get_tasks` / `task-master list` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to see current tasks, status, and IDs
|
34
|
+
- Determine the next task to work on using `next_task` / `task-master next` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
35
|
+
- Analyze task complexity with `analyze_complexity` / `task-master analyze-complexity --research` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) before breaking down tasks
|
36
|
+
- Review complexity report using `complexity_report` / `task-master complexity-report` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
37
|
+
- Select tasks based on dependencies (all marked 'done'), priority level, and ID order
|
38
|
+
- Clarify tasks by checking task files in tasks/ directory or asking for user input
|
39
|
+
- View specific task details using `get_task` / `task-master show <id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to understand implementation requirements
|
40
|
+
- Break down complex tasks using `expand_task` / `task-master expand --id=<id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) with appropriate flags
|
41
|
+
- Clear existing subtasks if needed using `clear_subtasks` / `task-master clear-subtasks --id=<id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) before regenerating
|
42
|
+
- Implement code following task details, dependencies, and project standards
|
43
|
+
- Verify tasks according to test strategies before marking as complete (See [`tests.mdc`](mdc:.cursor/rules/tests.mdc))
|
44
|
+
- Mark completed tasks with `set_task_status` / `task-master set-status --id=<id> --status=done` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc))
|
45
|
+
- Update dependent tasks when implementation differs from original plan using `update` / `task-master update --from=<id> --prompt="..."` or `update_task` / `task-master update-task --id=<id> --prompt="..."` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc))
|
46
|
+
- Add new tasks discovered during implementation using `add_task` / `task-master add-task --prompt="..."` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
47
|
+
- Add new subtasks as needed using `add_subtask` / `task-master add-subtask --parent=<id> --title="..."` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
48
|
+
- Append notes or details to subtasks using `update_subtask` / `task-master update-subtask --id=<subtaskId> --prompt='Add implementation notes here...\nMore details...'` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
49
|
+
- Generate task files with `generate` / `task-master generate` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) after updating tasks.json
|
50
|
+
- Maintain valid dependency structure with `add_dependency`/`remove_dependency` tools or `task-master add-dependency`/`remove-dependency` commands, `validate_dependencies` / `task-master validate-dependencies`, and `fix_dependencies` / `task-master fix-dependencies` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) when needed
|
51
|
+
- Respect dependency chains and task priorities when selecting work
|
52
|
+
- Report progress regularly using `get_tasks` / `task-master list`
|
53
|
+
|
54
|
+
## Task Complexity Analysis
|
55
|
+
|
56
|
+
- Run `analyze_complexity` / `task-master analyze-complexity --research` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) for comprehensive analysis
|
57
|
+
- Review complexity report via `complexity_report` / `task-master complexity-report` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) for a formatted, readable version.
|
58
|
+
- Focus on tasks with highest complexity scores (8-10) for detailed breakdown
|
59
|
+
- Use analysis results to determine appropriate subtask allocation
|
60
|
+
- Note that reports are automatically used by the `expand` tool/command
|
61
|
+
|
62
|
+
## Task Breakdown Process
|
63
|
+
|
64
|
+
- For tasks with complexity analysis, use `expand_task` / `task-master expand --id=<id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc))
|
65
|
+
- Otherwise use `expand_task` / `task-master expand --id=<id> --num=<number>`
|
66
|
+
- Add `--research` flag to leverage Perplexity AI for research-backed expansion
|
67
|
+
- Use `--prompt="<context>"` to provide additional context when needed
|
68
|
+
- Review and adjust generated subtasks as necessary
|
69
|
+
- Use `--all` flag with `expand` or `expand_all` to expand multiple pending tasks at once
|
70
|
+
- If subtasks need regeneration, clear them first with `clear_subtasks` / `task-master clear-subtasks` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
71
|
+
|
72
|
+
## Implementation Drift Handling
|
73
|
+
|
74
|
+
- When implementation differs significantly from planned approach
|
75
|
+
- When future tasks need modification due to current implementation choices
|
76
|
+
- When new dependencies or requirements emerge
|
77
|
+
- Use `update` / `task-master update --from=<futureTaskId> --prompt='<explanation>\nUpdate context...'` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to update multiple future tasks.
|
78
|
+
- Use `update_task` / `task-master update-task --id=<taskId> --prompt='<explanation>\nUpdate context...'` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to update a single specific task.
|
79
|
+
|
80
|
+
## Task Status Management
|
81
|
+
|
82
|
+
- Use 'pending' for tasks ready to be worked on
|
83
|
+
- Use 'done' for completed and verified tasks
|
84
|
+
- Use 'deferred' for postponed tasks
|
85
|
+
- Add custom status values as needed for project-specific workflows
|
86
|
+
|
87
|
+
## Task Structure Fields
|
88
|
+
|
89
|
+
- **id**: Unique identifier for the task (Example: `1`, `1.1`)
|
90
|
+
- **title**: Brief, descriptive title (Example: `"Initialize Repo"`)
|
91
|
+
- **description**: Concise summary of what the task involves (Example: `"Create a new repository, set up initial structure."`)
|
92
|
+
- **status**: Current state of the task (Example: `"pending"`, `"done"`, `"deferred"`)
|
93
|
+
- **dependencies**: IDs of prerequisite tasks (Example: `[1, 2.1]`)
|
94
|
+
- Dependencies are displayed with status indicators (✅ for completed, ⏱️ for pending)
|
95
|
+
- This helps quickly identify which prerequisite tasks are blocking work
|
96
|
+
- **priority**: Importance level (Example: `"high"`, `"medium"`, `"low"`)
|
97
|
+
- **details**: In-depth implementation instructions (Example: `"Use GitHub client ID/secret, handle callback, set session token."`)
|
98
|
+
- **testStrategy**: Verification approach (Example: `"Deploy and call endpoint to confirm 'Hello World' response."`)
|
99
|
+
- **subtasks**: List of smaller, more specific tasks (Example: `[{"id": 1, "title": "Configure OAuth", ...}]`)
|
100
|
+
- Refer to [`tasks.mdc`](mdc:.cursor/rules/tasks.mdc) for more details on the task data structure.
|
101
|
+
|
102
|
+
## Environment Variables Configuration
|
103
|
+
|
104
|
+
- Task Master behavior is configured via environment variables:
|
105
|
+
- **ANTHROPIC_API_KEY** (Required): Your Anthropic API key for Claude.
|
106
|
+
- **MODEL**: Claude model to use (e.g., `claude-3-opus-20240229`).
|
107
|
+
- **MAX_TOKENS**: Maximum tokens for AI responses.
|
108
|
+
- **TEMPERATURE**: Temperature for AI model responses.
|
109
|
+
- **DEBUG**: Enable debug logging (`true`/`false`).
|
110
|
+
- **LOG_LEVEL**: Console output level (`debug`, `info`, `warn`, `error`).
|
111
|
+
- **DEFAULT_SUBTASKS**: Default number of subtasks for `expand`.
|
112
|
+
- **DEFAULT_PRIORITY**: Default priority for new tasks.
|
113
|
+
- **PROJECT_NAME**: Project name used in metadata.
|
114
|
+
- **PROJECT_VERSION**: Project version used in metadata.
|
115
|
+
- **PERPLEXITY_API_KEY**: API key for Perplexity AI (for `--research` flags).
|
116
|
+
- **PERPLEXITY_MODEL**: Perplexity model to use (e.g., `sonar-medium-online`).
|
117
|
+
- See [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc) for default values and examples.
|
118
|
+
|
119
|
+
## Determining the Next Task
|
120
|
+
|
121
|
+
- Run `next_task` / `task-master next` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to show the next task to work on
|
122
|
+
- The command identifies tasks with all dependencies satisfied
|
123
|
+
- Tasks are prioritized by priority level, dependency count, and ID
|
124
|
+
- The command shows comprehensive task information including:
|
125
|
+
- Basic task details and description
|
126
|
+
- Implementation details
|
127
|
+
- Subtasks (if they exist)
|
128
|
+
- Contextual suggested actions
|
129
|
+
- Recommended before starting any new development work
|
130
|
+
- Respects your project's dependency structure
|
131
|
+
- Ensures tasks are completed in the appropriate sequence
|
132
|
+
- Provides ready-to-use commands for common task actions
|
133
|
+
|
134
|
+
## Viewing Specific Task Details
|
135
|
+
|
136
|
+
- Run `get_task` / `task-master show <id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to view a specific task
|
137
|
+
- Use dot notation for subtasks: `task-master show 1.2` (shows subtask 2 of task 1)
|
138
|
+
- Displays comprehensive information similar to the next command, but for a specific task
|
139
|
+
- For parent tasks, shows all subtasks and their current status
|
140
|
+
- For subtasks, shows parent task information and relationship
|
141
|
+
- Provides contextual suggested actions appropriate for the specific task
|
142
|
+
- Useful for examining task details before implementation or checking status
|
143
|
+
|
144
|
+
## Managing Task Dependencies
|
145
|
+
|
146
|
+
- Use `add_dependency` / `task-master add-dependency --id=<id> --depends-on=<id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to add a dependency
|
147
|
+
- Use `remove_dependency` / `task-master remove-dependency --id=<id> --depends-on=<id>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to remove a dependency
|
148
|
+
- The system prevents circular dependencies and duplicate dependency entries
|
149
|
+
- Dependencies are checked for existence before being added or removed
|
150
|
+
- Task files are automatically regenerated after dependency changes
|
151
|
+
- Dependencies are visualized with status indicators in task listings and files
|
152
|
+
|
153
|
+
## Iterative Subtask Implementation
|
154
|
+
|
155
|
+
Once a task has been broken down into subtasks using `expand_task` or similar methods, follow this iterative process for implementation:
|
156
|
+
|
157
|
+
1. **Understand the Goal (Preparation):**
|
158
|
+
* Use `get_task` / `task-master show <subtaskId>` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)) to thoroughly understand the specific goals and requirements of the subtask.
|
159
|
+
|
160
|
+
2. **Initial Exploration & Planning (Iteration 1):**
|
161
|
+
* This is the first attempt at creating a concrete implementation plan.
|
162
|
+
* Explore the codebase to identify the precise files, functions, and even specific lines of code that will need modification.
|
163
|
+
* Determine the intended code changes (diffs) and their locations.
|
164
|
+
* Gather *all* relevant details from this exploration phase.
|
165
|
+
|
166
|
+
3. **Log the Plan:**
|
167
|
+
* Run `update_subtask` / `task-master update-subtask --id=<subtaskId> --prompt='<detailed plan>'` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
168
|
+
* Provide the *complete and detailed* findings from the exploration phase in the prompt. Include file paths, line numbers, proposed diffs, reasoning, and any potential challenges identified. Do not omit details. The goal is to create a rich, timestamped log within the subtask's `details`.
|
169
|
+
|
170
|
+
4. **Verify the Plan:**
|
171
|
+
* Run `get_task` / `task-master show <subtaskId>` again to confirm that the detailed implementation plan has been successfully appended to the subtask's details.
|
172
|
+
|
173
|
+
5. **Begin Implementation:**
|
174
|
+
* Set the subtask status using `set_task_status` / `task-master set-status --id=<subtaskId> --status=in-progress` (see [`taskmaster.mdc`](mdc:.cursor/rules/taskmaster.mdc)).
|
175
|
+
* Start coding based on the logged plan.
|
176
|
+
|
177
|
+
6. **Refine and Log Progress (Iteration 2+):**
|
178
|
+
* As implementation progresses, you will encounter challenges, discover nuances, or confirm successful approaches.
|
179
|
+
* **Before appending new information**: Briefly review the *existing* details logged in the subtask (using `get_task` or recalling from context) to ensure the update adds fresh insights and avoids redundancy.
|
180
|
+
* **Regularly** use `update_subtask` / `task-master update-subtask --id=<subtaskId> --prompt='<update details>\n- What worked...\n- What didn't work...'` to append new findings.
|
181
|
+
* **Crucially, log:**
|
182
|
+
* What worked ("fundamental truths" discovered).
|
183
|
+
* What didn't work and why (to avoid repeating mistakes).
|
184
|
+
* Specific code snippets or configurations that were successful.
|
185
|
+
* Decisions made, especially if confirmed with user input.
|
186
|
+
* Any deviations from the initial plan and the reasoning.
|
187
|
+
* The objective is to continuously enrich the subtask's details, creating a log of the implementation journey that helps the AI (and human developers) learn, adapt, and avoid repeating errors.
|
188
|
+
|
189
|
+
7. **Review & Update Rules (Post-Implementation):**
|
190
|
+
* Once the implementation for the subtask is functionally complete, review all code changes and the relevant chat history.
|
191
|
+
* Identify any new or modified code patterns, conventions, or best practices established during the implementation.
|
192
|
+
* Create new or update existing Cursor rules in the `.cursor/rules/` directory to capture these patterns, following the guidelines in [`cursor_rules.mdc`](mdc:.cursor/rules/cursor_rules.mdc) and [`self_improve.mdc`](mdc:.cursor/rules/self_improve.mdc).
|
193
|
+
|
194
|
+
8. **Mark Task Complete:**
|
195
|
+
* After verifying the implementation and updating any necessary rules, mark the subtask as completed: `set_task_status` / `task-master set-status --id=<subtaskId> --status=done`.
|
196
|
+
|
197
|
+
9. **Commit Changes (If using Git):**
|
198
|
+
* Stage the relevant code changes and any updated/new rule files (`git add .`).
|
199
|
+
* Craft a comprehensive Git commit message summarizing the work done for the subtask, including both code implementation and any rule adjustments.
|
200
|
+
* Execute the commit command directly in the terminal (e.g., `git commit -m 'feat(module): Implement feature X for subtask <subtaskId>\n\n- Details about changes...\n- Updated rule Y for pattern Z'`).
|
201
|
+
* Consider if a Changeset is needed according to [`changeset.mdc`](mdc:.cursor/rules/changeset.mdc). If so, run `npm run changeset`, stage the generated file, and amend the commit or create a new one.
|
202
|
+
|
203
|
+
10. **Proceed to Next Subtask:**
|
204
|
+
* Identify the next subtask in the dependency chain (e.g., using `next_task` / `task-master next`) and repeat this iterative process starting from step 1.
|
205
|
+
|
206
|
+
## Code Analysis & Refactoring Techniques
|
207
|
+
|
208
|
+
- **Top-Level Function Search**:
|
209
|
+
- Useful for understanding module structure or planning refactors.
|
210
|
+
- Use grep/ripgrep to find exported functions/constants:
|
211
|
+
`rg "export (async function|function|const) \w+"` or similar patterns.
|
212
|
+
- Can help compare functions between files during migrations or identify potential naming conflicts.
|
213
|
+
|
214
|
+
---
|
215
|
+
*This workflow provides a general guideline. Adapt it based on your specific project needs and team practices.*
|
@@ -0,0 +1,73 @@
|
|
1
|
+
---
|
2
|
+
description: Guidelines for continuously improving Cursor rules based on emerging code patterns and best practices.
|
3
|
+
globs: **/*
|
4
|
+
alwaysApply: true
|
5
|
+
---
|
6
|
+
|
7
|
+
- **Rule Improvement Triggers:**
|
8
|
+
- New code patterns not covered by existing rules
|
9
|
+
- Repeated similar implementations across files
|
10
|
+
- Common error patterns that could be prevented
|
11
|
+
- New libraries or tools being used consistently
|
12
|
+
- Emerging best practices in the codebase
|
13
|
+
|
14
|
+
- **Analysis Process:**
|
15
|
+
- Compare new code with existing rules
|
16
|
+
- Identify patterns that should be standardized
|
17
|
+
- Look for references to external documentation
|
18
|
+
- Check for consistent error handling patterns
|
19
|
+
- Monitor test patterns and coverage
|
20
|
+
|
21
|
+
- **Rule Updates:**
|
22
|
+
- **Add New Rules When:**
|
23
|
+
- A new technology/pattern is used in 3+ files
|
24
|
+
- Common bugs could be prevented by a rule
|
25
|
+
- Code reviews repeatedly mention the same feedback
|
26
|
+
- New security or performance patterns emerge
|
27
|
+
|
28
|
+
- **Modify Existing Rules When:**
|
29
|
+
- Better examples exist in the codebase
|
30
|
+
- Additional edge cases are discovered
|
31
|
+
- Related rules have been updated
|
32
|
+
- Implementation details have changed
|
33
|
+
|
34
|
+
- **Example Pattern Recognition:**
|
35
|
+
```typescript
|
36
|
+
// If you see repeated patterns like:
|
37
|
+
const data = await prisma.user.findMany({
|
38
|
+
select: { id: true, email: true },
|
39
|
+
where: { status: 'ACTIVE' }
|
40
|
+
});
|
41
|
+
|
42
|
+
// Consider adding to [prisma.mdc](mdc:.cursor/rules/prisma.mdc):
|
43
|
+
// - Standard select fields
|
44
|
+
// - Common where conditions
|
45
|
+
// - Performance optimization patterns
|
46
|
+
```
|
47
|
+
|
48
|
+
- **Rule Quality Checks:**
|
49
|
+
- Rules should be actionable and specific
|
50
|
+
- Examples should come from actual code
|
51
|
+
- References should be up to date
|
52
|
+
- Patterns should be consistently enforced
|
53
|
+
|
54
|
+
- **Continuous Improvement:**
|
55
|
+
- Monitor code review comments
|
56
|
+
- Track common development questions
|
57
|
+
- Update rules after major refactors
|
58
|
+
- Add links to relevant documentation
|
59
|
+
- Cross-reference related rules
|
60
|
+
|
61
|
+
- **Rule Deprecation:**
|
62
|
+
- Mark outdated patterns as deprecated
|
63
|
+
- Remove rules that no longer apply
|
64
|
+
- Update references to deprecated rules
|
65
|
+
- Document migration paths for old patterns
|
66
|
+
|
67
|
+
- **Documentation Updates:**
|
68
|
+
- Keep examples synchronized with code
|
69
|
+
- Update references to external docs
|
70
|
+
- Maintain links between related rules
|
71
|
+
- Document breaking changes
|
72
|
+
|
73
|
+
Follow [cursor_rules.mdc](mdc:.cursor/rules/cursor_rules.mdc) for proper rule formatting and structure.
|