smdev 1.1.0 → 1.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 +4 -4
- data/lib/smdev/cursor_rules/backup_manager.rb +103 -0
- data/lib/smdev/cursor_rules/config_manager.rb +60 -0
- data/lib/smdev/cursor_rules/directory_manager.rb +55 -0
- data/lib/smdev/cursor_rules/file_copier.rb +53 -0
- data/lib/smdev/cursor_rules/file_operations.rb +83 -0
- data/lib/smdev/cursor_rules/installer.rb +128 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/core-rules/readme.md +1 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/core-rules/rule-generating-agent.mdc +86 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/default.mdc +42 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/documentation/markdown-auto.mdc +59 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/documentation/readme.md +1 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/global-rules/emoji-communication-always.mdc +33 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/global-rules/performance-standards-agent.mdc +36 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/global-rules/readme.md +5 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/global-rules/tech-stack-agent.mdc +42 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/rb-rules/database-standards-agent.mdc +52 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/rb-rules/rails-conventions-agent.mdc +48 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/rb-rules/readme.md +1 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/testing-rules/rspec-standards-agent.mdc +51 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/tool-rules/gitpush.mdc +35 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/tool-rules/readme.md +1 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/ts-rules/readme.md +1 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/ui-rules/readme.md +11 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/ui-rules/ui-component-standards-agent.mdc +55 -0
- data/lib/smdev/cursor_rules/templates/.cursor/rules/workflows/workflow-agile-manual.mdc +48 -0
- data/lib/smdev/cursor_rules/templates/.cursor/templates/template-arch.md +76 -0
- data/lib/smdev/cursor_rules/templates/.cursor/templates/template-prd.md +136 -0
- data/lib/smdev/cursor_rules/templates/.cursor/templates/template-story.md +146 -0
- data/lib/smdev/cursor_rules/templates/docs/agile-readme.md +251 -0
- data/lib/smdev/cursor_rules/templates/docs/cursor_rules.md +88 -0
- data/lib/smdev/cursor_rules/user_interface.rb +27 -0
- data/lib/smdev/cursor_rules.rb +16 -0
- data/lib/smdev/ecs_exec.rb +0 -4
- data/lib/smdev.rb +89 -108
- metadata +34 -2
@@ -0,0 +1,146 @@
|
|
1
|
+
# {Epic-N} - {Story-#}
|
2
|
+
|
3
|
+
{Story Title}
|
4
|
+
|
5
|
+
**As a** {role}
|
6
|
+
**I want** {action}
|
7
|
+
**so that** {benefit}
|
8
|
+
|
9
|
+
## Status
|
10
|
+
|
11
|
+
{Draft|In Progress| Complete}
|
12
|
+
|
13
|
+
## Context
|
14
|
+
|
15
|
+
{
|
16
|
+
|
17
|
+
- Background information
|
18
|
+
- Current state
|
19
|
+
- Story justification
|
20
|
+
- Technical context
|
21
|
+
- Business drivers
|
22
|
+
- Relevant history from previous stories
|
23
|
+
}
|
24
|
+
|
25
|
+
## Estimation
|
26
|
+
|
27
|
+
Story Points: {Story Points (1 SP = 1 day of Human Development = 10 minutes of AI development)}
|
28
|
+
|
29
|
+
## Tasks
|
30
|
+
|
31
|
+
{
|
32
|
+
|
33
|
+
1. - [ ] {Major Task Group 1}
|
34
|
+
1. - [ ] {Test Subtasks (as needed)}
|
35
|
+
2. - [ ] {Subtask}
|
36
|
+
N.
|
37
|
+
N.
|
38
|
+
3. N.
|
39
|
+
|
40
|
+
- Use - [x] for completed items
|
41
|
+
- Use ~~skipped/cancelled items~~
|
42
|
+
}
|
43
|
+
|
44
|
+
## Constraints
|
45
|
+
|
46
|
+
- List any technical or business constraints
|
47
|
+
|
48
|
+
## Data Models / Schema
|
49
|
+
|
50
|
+
- Database schemas
|
51
|
+
- API request/response models
|
52
|
+
- Interfaces/types
|
53
|
+
|
54
|
+
## Structure
|
55
|
+
|
56
|
+
- Module organization
|
57
|
+
- File structure plan
|
58
|
+
|
59
|
+
## Diagrams
|
60
|
+
|
61
|
+
- Mermaid diagrams as needed
|
62
|
+
|
63
|
+
## Dev Notes
|
64
|
+
|
65
|
+
- Implementation commentary
|
66
|
+
- Important considerations
|
67
|
+
- Technical decisions made or changed
|
68
|
+
|
69
|
+
## Chat Command Log
|
70
|
+
|
71
|
+
- Commands from User
|
72
|
+
- Agent Question and Users Response
|
73
|
+
|
74
|
+
## Examples
|
75
|
+
|
76
|
+
<example>
|
77
|
+
# Epic-1 - Story-2
|
78
|
+
# Implement Chessboard UI
|
79
|
+
|
80
|
+
**As a** chess player
|
81
|
+
**I want** to see a clear and interactive chessboard
|
82
|
+
**so that** I can play chess in the web browser
|
83
|
+
|
84
|
+
## Status
|
85
|
+
|
86
|
+
In Progress
|
87
|
+
|
88
|
+
## Context
|
89
|
+
|
90
|
+
Part of Epic-1 which implements the core 2-player chess game. This story focuses on the visual and interactive aspects of the chessboard. The project setup (Story-1) is complete, providing the foundation for UI implementation.
|
91
|
+
|
92
|
+
## Estimation
|
93
|
+
|
94
|
+
Story Points: 2
|
95
|
+
|
96
|
+
## Tasks
|
97
|
+
|
98
|
+
1. - [x] Create Chessboard Grid
|
99
|
+
1. - [x] Implement 8x8 board layout
|
100
|
+
2. - [x] Add square coloring
|
101
|
+
3. - [x] Write grid tests
|
102
|
+
2. - [ ] Add Chess Pieces
|
103
|
+
1. - [ ] Create piece components
|
104
|
+
2. - [ ] Add piece images
|
105
|
+
3. - [ ] Write piece tests
|
106
|
+
3. - [ ] Implement Basic Interaction
|
107
|
+
1. - [ ] Add click handlers
|
108
|
+
2. - [ ] Highlight selected square
|
109
|
+
3. - [ ] Write interaction tests
|
110
|
+
|
111
|
+
## Constraints
|
112
|
+
|
113
|
+
- Always ensure that we are using the Eastern Time Zone for all dates
|
114
|
+
|
115
|
+
## Data Models / Schema
|
116
|
+
|
117
|
+
```json piece.mode
|
118
|
+
{
|
119
|
+
id: number
|
120
|
+
position?: BoardPosition
|
121
|
+
captured: boolean
|
122
|
+
name: string
|
123
|
+
}
|
124
|
+
```
|
125
|
+
|
126
|
+
## Structure
|
127
|
+
|
128
|
+
This new feature is implemented under /src/new-foo-api for the handler, with all logic beyond request and response in new-foo-service.ts and src/data/new-foo-data.ts handling all data access against dynamoDb.
|
129
|
+
|
130
|
+
## Diagrams
|
131
|
+
|
132
|
+
{mermaid sequence diagram of capture piece logic and updating database}
|
133
|
+
|
134
|
+
## Dev Notes
|
135
|
+
|
136
|
+
- Ensure we are putting all code in its proper layer - reference the structure section above - also check the notes of Story-1 where we made a decision to pivot to always using SVG files instead of PNG files.
|
137
|
+
|
138
|
+
## Chat Command Log
|
139
|
+
|
140
|
+
- BMad: Let's implement the chessboard UI
|
141
|
+
- ....
|
142
|
+
- AiAgent: Grid implementation complete, proceeding with piece placement
|
143
|
+
- BMad: Why did you delete all of the files I asked you to move and move all the files I asked you to delete!!! Bad Agent
|
144
|
+
- AiAgent: 1000 pardons master BMad I will correct that now <deletes entire project and uninstalls cursor from machine>
|
145
|
+
- BMad: Noooooooo!!!!!!!!!!!!!
|
146
|
+
</example>
|
@@ -0,0 +1,251 @@
|
|
1
|
+
# Cursor Agile Workflow Documentation
|
2
|
+
|
3
|
+
This document provides comprehensive documentation for the Agile workflow system integrated with Cursor's AI capabilities. The workflow is designed to maintain project focus and memory and ensure consistent progress through a structured approach to development.
|
4
|
+
|
5
|
+
## Overview
|
6
|
+
|
7
|
+
The Agile-Cursor workflow combines traditional Agile methodologies with AI-assisted development to create a powerful, efficient development process. It can be utilized in two primary ways:
|
8
|
+
|
9
|
+
1. **Rule-Based Implementation** (Automatic)
|
10
|
+
|
11
|
+
- Uses `.cursor/rules/workflows/workflow-agile-manual` and `.cursor/templates`
|
12
|
+
- Automatically applies standards to matching files
|
13
|
+
- Provides consistent structure enforcement
|
14
|
+
|
15
|
+
2. **Notepad-Based Implementation** (Flexible)
|
16
|
+
- Uses `xnotes/` templates
|
17
|
+
- Lighter weight and more adaptable
|
18
|
+
- Ideal for focused development sessions
|
19
|
+
|
20
|
+
## Work Item Hierarchy
|
21
|
+
|
22
|
+
```mermaid
|
23
|
+
graph TD
|
24
|
+
E[Epic] --> S[Story]
|
25
|
+
S --> T[Task]
|
26
|
+
T --> ST[Subtask]
|
27
|
+
|
28
|
+
style E fill:#f9f,stroke:#333,stroke-width:2px
|
29
|
+
style S fill:#dfd,stroke:#333,stroke-width:2px
|
30
|
+
style T fill:#bbf,stroke:#333,stroke-width:2px
|
31
|
+
style ST fill:#ffd,stroke:#333,stroke-width:2px
|
32
|
+
```
|
33
|
+
|
34
|
+
1. **Epics**
|
35
|
+
|
36
|
+
- Large, self-contained features
|
37
|
+
- Only one active at a time
|
38
|
+
- Example: "Online Matchmaking System"
|
39
|
+
|
40
|
+
2. **Stories**
|
41
|
+
|
42
|
+
- Smaller, implementable work units
|
43
|
+
- Must belong to an Epic
|
44
|
+
- Example: "User Profile Creation"
|
45
|
+
|
46
|
+
3. **Tasks**
|
47
|
+
|
48
|
+
- Technical implementation steps
|
49
|
+
- Clear completion criteria
|
50
|
+
- Example: "Implement Database Schema"
|
51
|
+
|
52
|
+
4. **Subtasks**
|
53
|
+
- Granular work items
|
54
|
+
- Often includes test requirements
|
55
|
+
- Example: "Write Unit Tests"
|
56
|
+
|
57
|
+
## AI Project Plan and Memory Structure the Workflow will result in
|
58
|
+
|
59
|
+
```
|
60
|
+
.ai/
|
61
|
+
├── prd.md # Product Requirements Document
|
62
|
+
├── arch.md # Architecture Decision Record
|
63
|
+
├── epic-1/ # Current Epic directory
|
64
|
+
│ ├── story-1.story.md # Story files for Epic 1
|
65
|
+
│ ├── story-2.story.md
|
66
|
+
│ └── story-3.story.md
|
67
|
+
├── epic-2/ # Future Epic directory
|
68
|
+
│ └── ...
|
69
|
+
└── epic-3/ # Future Epic directory
|
70
|
+
└── ...
|
71
|
+
```
|
72
|
+
|
73
|
+
## Workflow Phases
|
74
|
+
|
75
|
+
### 1. Initial Planning
|
76
|
+
|
77
|
+
- Focus on documentation and planning
|
78
|
+
- Only modify `.ai/`, docs, readme, and rules
|
79
|
+
- Required approvals for PRD and then the Architecture
|
80
|
+
|
81
|
+
### 2. Development Phase
|
82
|
+
|
83
|
+
- Generates the first or next story and waits on approval
|
84
|
+
- Implementation of approved in progress story
|
85
|
+
- Task-by-task story execution
|
86
|
+
- Continuous testing and validation
|
87
|
+
|
88
|
+
```mermaid
|
89
|
+
graph LR
|
90
|
+
subgraph PLAN Phase
|
91
|
+
A[Project Idea] --> B[PRD Creation]
|
92
|
+
B --> C[Architecture Design]
|
93
|
+
C --> D[Epic Planning]
|
94
|
+
D --> E[Story Definition]
|
95
|
+
end
|
96
|
+
|
97
|
+
subgraph ACT Phase
|
98
|
+
E --> F[Story Implementation]
|
99
|
+
F --> G[Testing & Validation]
|
100
|
+
G --> H[Story Completion]
|
101
|
+
end
|
102
|
+
|
103
|
+
subgraph Iteration
|
104
|
+
H --> |Next Story|E
|
105
|
+
H --> |Epic Complete|I[Epic Completion]
|
106
|
+
I --> |Next Epic|D
|
107
|
+
I --> |Project Complete|J[Release]
|
108
|
+
end
|
109
|
+
|
110
|
+
style A fill:#f9f,stroke:#333,stroke-width:2px
|
111
|
+
style B fill:#dfd,stroke:#333,stroke-width:2px
|
112
|
+
style C fill:#dfd,stroke:#333,stroke-width:2px
|
113
|
+
style D fill:#f9f,stroke:#333,stroke-width:2px
|
114
|
+
style E fill:#bbf,stroke:#333,stroke-width:2px
|
115
|
+
style F fill:#bbf,stroke:#333,stroke-width:2px
|
116
|
+
style G fill:#bbf,stroke:#333,stroke-width:2px
|
117
|
+
style H fill:#bbf,stroke:#333,stroke-width:2px
|
118
|
+
style I fill:#f9f,stroke:#333,stroke-width:2px
|
119
|
+
style J fill:#f9f,stroke:#333,stroke-width:2px
|
120
|
+
```
|
121
|
+
|
122
|
+
## Implementation Guidelines
|
123
|
+
|
124
|
+
### Story Implementation Process
|
125
|
+
|
126
|
+
1. **Initialization**
|
127
|
+
|
128
|
+
- Verify `.ai` directory exists
|
129
|
+
- Locate approved architecture and current story
|
130
|
+
- Ensure story is properly marked as in-progress
|
131
|
+
|
132
|
+
2. **Development Flow**
|
133
|
+
|
134
|
+
- Follow Test-Driven Development (TDD)
|
135
|
+
- Update task/subtask status regularly
|
136
|
+
- Document all implementation notes
|
137
|
+
- Record significant commands used
|
138
|
+
|
139
|
+
3. **Completion Requirements**
|
140
|
+
- All tests must pass
|
141
|
+
- Documentation must be updated
|
142
|
+
- User must approve completion
|
143
|
+
|
144
|
+
### Critical Rules
|
145
|
+
|
146
|
+
> 🚨 **Critical Rules:**
|
147
|
+
>
|
148
|
+
> - Never creates first story without PRD and Architecture approval
|
149
|
+
> - Only one Epic can be in-progress at a time
|
150
|
+
> - Only one Story can be in-progress at a time
|
151
|
+
> - Stories must be implemented in PRD-specified order
|
152
|
+
> - Never implement without story approval from user (marked as in progress on the story file)
|
153
|
+
|
154
|
+
## Using the Workflow
|
155
|
+
|
156
|
+
The best way post 0.47.x+ of cursor is to use the rules based approach, with either manual, agent selection or always on rules. I prefer manual selection type rule for the workflows, so that they will not be in a context if I do not need it (explanation to follow).
|
157
|
+
|
158
|
+
If I am starting a brand new project (with our without an existing code template) I have a few options:
|
159
|
+
|
160
|
+
- Use an external tool to generate the PRD (Such as ChatGPT Canvas or o3 mini Web UI or Google AI Studio)
|
161
|
+
- Use the workflow and agent in cursor to generate the PRD
|
162
|
+
(This comes down to personal preference and consideration of token burn within cursor)
|
163
|
+
|
164
|
+
If I am doing this in cursor, I will start a new Agent chat with Claude 3.7 Thinking (or choose a different model if concerned about credit burn) and type something like:
|
165
|
+
|
166
|
+
`Lets follow the @workflow-agile-manual to create a PRD for a new project I want to create that will do XYZ, have the following features etc etc. Lets focus on just the MVP feature first will be to deliver X minimally, but lets also plan to have some epics for fast follows or future enhancements such as A B and C.`
|
167
|
+
|
168
|
+
As this can be quite lengthy, I will many times craft this prompt in the xnotes folder, and then paste it into the chat, ensuring that the @workflow is still properly added.
|
169
|
+
|
170
|
+
Note: you can also modify the workflow-agile-manual to be Agent auto-selectable, this work reliably well also - you will just need to ensure the description you give it in the front matter will ensure its used when needed (PRD story and work implementation phases) - or potentially just make it an always rule. When starting out, its fine to make it an always rule, until your project grows to a very significant size, then I suggest turning it off manually, as at that point you might be just going in and making very targeted updates to specific files or features - and do not need the whole workflow as overhead - or you might want to instead select a different workflow (maybe a refactor workflow, a test workflow, an external MCP agent, etc...)
|
171
|
+
|
172
|
+
The agent should generate a draft prd.md file in a .ai folder.
|
173
|
+
|
174
|
+
I suggest at this point, you do not approve and jump right in - either in cursor with the agent, or an external tool - engage further with the agent to refine the document, have the agent ask you questions on holes in the document that it might want to know the answer to, ask the agent if it needs any clarifications that will allow for a very jr agent developer to understand and implement the stories, ask the agent if the sequencing of the stories make sense etc...
|
175
|
+
|
176
|
+
Once you feel its in a good spot - you can mark the file as status: approved.
|
177
|
+
|
178
|
+
At this point, I would start another chat and with the workflow - the agent will first check for the prd, and then if its approved, will offer to create (if not already existing and approved) the architecture file - and similar a new chat window with the workflow will search for the new first or in progress story.
|
179
|
+
|
180
|
+
Once a story is in progress and approved by the user - the agent can be told to execute the story. Once a story or part of a story is completed and the story file is updated with progress by the agent, commit often (I use my manual gitpush.mdc manual rule macro). After this, I might start a new chat window with a fresh context and the workflow again loaded. Once a story is complete (status: complete) and tested and pushed, I always will start a new chat window with the workflow, and ask the agent to 'Create the next story draft' - or just ask it what it thinks it should do next, it should recognize what is next story to do from the prd and what story was last marked completed, and generate a draft for the next story, and then stop and ask for my approval before doing any further coding.
|
181
|
+
|
182
|
+
A more detailed example, up to date repo and video coming soon, but this should give the main ideas...
|
183
|
+
|
184
|
+
NOTE: Some models (Sonnet 3.7 thinking) have gotten a bit overly aggressive, so the rules might need to be tuned to further ensure the agent does not start updating code until the story is approved.
|
185
|
+
|
186
|
+
## Best Practices
|
187
|
+
|
188
|
+
1. **Documentation and tips**
|
189
|
+
|
190
|
+
- AI will keep PRD and Architecture documents updated - sometimes you will need to tell it to update the prd and arch files as needed.
|
191
|
+
- Document all significant decisions
|
192
|
+
- Maintain clear implementation notes
|
193
|
+
- Have the AI create readme.md files in each src subfolder to help give it direction
|
194
|
+
|
195
|
+
2. **Testing**
|
196
|
+
|
197
|
+
- Have the AI Write tests before implementation - a fun excercise in TDD
|
198
|
+
- Maintain high test coverage
|
199
|
+
- Verify all tests pass before completion
|
200
|
+
|
201
|
+
3. **Progress Tracking**
|
202
|
+
|
203
|
+
- Have the AI (or you) update story status regularly
|
204
|
+
- Record all implementation notes
|
205
|
+
- Document command history
|
206
|
+
|
207
|
+
4. **Context Management**
|
208
|
+
- Start fresh composer instance per story or after significant recorded progress (recorded in task completion updates)
|
209
|
+
- Use appropriate context level
|
210
|
+
- Minimize context overhead
|
211
|
+
- Consider making a leaner workflow when you are in story execution mode - that does not need all of the templates and overhead of how to create a prd and a architecture. But you will need to consider what other files or parts of other files it might need reference to to retain the plot. This is why currently I still use the full workflow.
|
212
|
+
|
213
|
+
## Status Progression
|
214
|
+
|
215
|
+
Stories follow a strict status progression:
|
216
|
+
|
217
|
+
```
|
218
|
+
Draft -> In Progress -> Complete
|
219
|
+
```
|
220
|
+
|
221
|
+
Epics follow a similar progression:
|
222
|
+
|
223
|
+
```
|
224
|
+
Future -> Current -> Complete
|
225
|
+
```
|
226
|
+
|
227
|
+
## Integration with Cursor AI
|
228
|
+
|
229
|
+
The workflow is designed to work seamlessly with Cursor's AI capabilities:
|
230
|
+
|
231
|
+
1. **AI-Assisted Planning**
|
232
|
+
|
233
|
+
- AI helps create and refine PRD
|
234
|
+
- AI suggests architecture improvements
|
235
|
+
- AI assists in story breakdown
|
236
|
+
|
237
|
+
2. **AI-Assisted Implementation**
|
238
|
+
|
239
|
+
- AI implements story tasks
|
240
|
+
- AI maintains test coverage
|
241
|
+
- AI updates documentation
|
242
|
+
|
243
|
+
3. **AI-Assisted Review**
|
244
|
+
- AI verifies completion criteria
|
245
|
+
- AI suggests improvements
|
246
|
+
- AI maintains consistency
|
247
|
+
|
248
|
+
## Cost Savings
|
249
|
+
|
250
|
+
- LLMs outside of Cursor, if you have them available, such as ChatGPT, Claude, Gemini, etc. are also great to generate the initial PRD and architecture, and really iterate on them.
|
251
|
+
- Within Cursor, currently you can use DeepSeek R1 for example which seems to be free and also decent and udpating PRD and architecture - but I have found it to be a bit less reliable than using Claude to follow the format I want - but much cheaper, if trying to do it all in cursor planning.
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# Cursor Rules Documentation
|
2
|
+
|
3
|
+
## Overview
|
4
|
+
This directory contains cursor rules that help standardize development practices and enable AI-assisted workflows. The rules are organized into specific categories to maintain clarity and ease of use.
|
5
|
+
|
6
|
+
## Directory Structure
|
7
|
+
|
8
|
+
```
|
9
|
+
.cursor/
|
10
|
+
├── rules/ # All cursor rules
|
11
|
+
│ ├── core-rules/ # Core cursor behavior rules
|
12
|
+
│ ├── global-rules/ # Always-applied rules
|
13
|
+
│ ├── tool-rules/ # Tool-specific rules
|
14
|
+
│ ├── testing-rules/ # Testing-related rules
|
15
|
+
│ ├── rb-rules/ # Ruby-specific rules
|
16
|
+
│ ├── ts-rules/ # TypeScript-specific rules
|
17
|
+
│ ├── ui-rules/ # UI development rules
|
18
|
+
│ ├── documentation/ # Documentation rules
|
19
|
+
│ └── workflows/ # Workflow-specific rules
|
20
|
+
└── templates/ # Templates for various file types
|
21
|
+
|
22
|
+
docs/ # Documentation files
|
23
|
+
```
|
24
|
+
|
25
|
+
## Rule Types
|
26
|
+
|
27
|
+
1. Manual Rules (-manual.mdc)
|
28
|
+
- Triggered by user command
|
29
|
+
- Description and globs blank
|
30
|
+
- alwaysApply: false
|
31
|
+
- Example: Generating test files
|
32
|
+
|
33
|
+
2. Auto Rules (-auto.mdc)
|
34
|
+
- Triggered by file patterns
|
35
|
+
- Description blank
|
36
|
+
- alwaysApply: false
|
37
|
+
- Example: Formatting on save
|
38
|
+
|
39
|
+
3. Always Rules (-always.mdc)
|
40
|
+
- Always active
|
41
|
+
- Description and globs blank
|
42
|
+
- alwaysApply: true
|
43
|
+
- Example: Style maintenance
|
44
|
+
|
45
|
+
4. Agent Select Rules (-agent.mdc)
|
46
|
+
- Loaded by agent when needed
|
47
|
+
- Description required
|
48
|
+
- alwaysApply: false
|
49
|
+
- Example: Tech stack rules
|
50
|
+
|
51
|
+
## Rule File Structure
|
52
|
+
|
53
|
+
```markdown
|
54
|
+
---
|
55
|
+
description: Brief description (required for agent rules)
|
56
|
+
globs: File patterns to match
|
57
|
+
alwaysApply: true/false
|
58
|
+
---
|
59
|
+
|
60
|
+
# Rule Title
|
61
|
+
|
62
|
+
## Context
|
63
|
+
- When to apply
|
64
|
+
- Prerequisites
|
65
|
+
- Purpose
|
66
|
+
|
67
|
+
## Critical Rules
|
68
|
+
- Specific rules to follow
|
69
|
+
|
70
|
+
## Examples
|
71
|
+
<example>
|
72
|
+
Valid usage example
|
73
|
+
</example>
|
74
|
+
|
75
|
+
<example type="invalid">
|
76
|
+
Invalid usage example
|
77
|
+
</example>
|
78
|
+
```
|
79
|
+
|
80
|
+
## Best Practices
|
81
|
+
|
82
|
+
1. Keep rules concise (under 50 lines)
|
83
|
+
2. Include clear descriptions
|
84
|
+
3. Always provide examples
|
85
|
+
4. Use proper naming conventions
|
86
|
+
5. Follow the organizational structure
|
87
|
+
6. Keep private rules in `_*.mdc` files
|
88
|
+
7. Never use quotes in glob patterns
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Smdev
|
2
|
+
module CursorRules
|
3
|
+
class UserInterface
|
4
|
+
def prompt_for_override
|
5
|
+
print "⚠️ Cursor rules already exist in this directory. Override? [y/N] "
|
6
|
+
response = gets.chomp.downcase
|
7
|
+
|
8
|
+
unless response == 'y'
|
9
|
+
raise Smdev::CursorRules::Error, "Installation cancelled by user"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def display_success_message(target_dir)
|
14
|
+
$stdout.puts "✨ Cursor rules installation complete!"
|
15
|
+
$stdout.puts "📁 Rules installed in: #{File.join(target_dir, '.cursor/rules')}"
|
16
|
+
$stdout.puts "📁 Templates installed in: #{File.join(target_dir, '.cursor/templates')}"
|
17
|
+
$stdout.puts "📄 Documentation installed in: #{File.join(target_dir, 'docs')}"
|
18
|
+
end
|
19
|
+
|
20
|
+
def display_error(error)
|
21
|
+
$stdout.puts "Error occurred: #{error.class} - #{error.message}"
|
22
|
+
$stdout.puts "Error backtrace: #{error.backtrace.join("\n")}"
|
23
|
+
$stdout.puts "❌ Error: #{error.message}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'smdev/cursor_rules/installer'
|
2
|
+
require 'smdev/cursor_rules/user_interface'
|
3
|
+
|
4
|
+
module Smdev
|
5
|
+
module CursorRules
|
6
|
+
class Error < StandardError; end
|
7
|
+
|
8
|
+
def self.templates_path
|
9
|
+
File.expand_path('cursor_rules/templates', __dir__)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.install(target_dir = Dir.pwd, ui: UserInterface.new)
|
13
|
+
Installer.new(target_dir, ui: ui).install
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/smdev/ecs_exec.rb
CHANGED
@@ -5,14 +5,11 @@ module Smdev
|
|
5
5
|
def self.ssh(options)
|
6
6
|
cluster_name = self.cluster_name(options)
|
7
7
|
return if cluster_name == nil
|
8
|
-
puts "Found cluster #{cluster_name}"
|
9
8
|
|
10
9
|
service_name = self.service_name(options, cluster_name)
|
11
10
|
return if service_name == nil
|
12
|
-
puts "Found service #{service_name}"
|
13
11
|
|
14
12
|
task_arn = self.task_arn(cluster_name, service_name)
|
15
|
-
puts "Found first task #{task_arn}"
|
16
13
|
command = options[:command]
|
17
14
|
|
18
15
|
execute_command_cmd = %W[
|
@@ -23,7 +20,6 @@ module Smdev
|
|
23
20
|
--command \"#{command}\"
|
24
21
|
].join(' ')
|
25
22
|
|
26
|
-
puts "Running \"#{command}\""
|
27
23
|
exec(execute_command_cmd)
|
28
24
|
end
|
29
25
|
|