cursor-ai-toolkit 1.0.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.
- package/README.md +148 -0
- package/bin/cli.js +304 -0
- package/commands/context/ask-clarification.md +215 -0
- package/commands/context/context-prune.md +201 -0
- package/commands/context/orchestrate.md +279 -0
- package/commands/context/smart-detection.md +272 -0
- package/commands/learning/generate-memories.md +270 -0
- package/commands/learning/generate-rules.md +175 -0
- package/commands/learning/self-heal.md +233 -0
- package/commands/learning/self-improve.md +229 -0
- package/package.json +35 -0
package/README.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# 🧠 Cursor AI Toolkit
|
|
2
|
+
|
|
3
|
+
> AI Self-Improvement Commands for Cursor IDE - Learning, Rules & Context Management
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/cursor-ai-toolkit)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## 🚀 Quick Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npx cursor-ai-toolkit
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
One command installs 8 AI self-improvement commands for Cursor.
|
|
15
|
+
|
|
16
|
+
## What is AI Toolkit?
|
|
17
|
+
|
|
18
|
+
AI Toolkit enhances Cursor's AI capabilities with:
|
|
19
|
+
|
|
20
|
+
- **Pattern Learning** - Extract patterns from your codebase and create persistent memories
|
|
21
|
+
- **Rule Generation** - Auto-generate .mdc rules from established patterns
|
|
22
|
+
- **Self-Healing** - Fix bugs and proactively find similar issues
|
|
23
|
+
- **Context Management** - Prevent context drift in long conversations
|
|
24
|
+
|
|
25
|
+
## 📦 Command Bundles
|
|
26
|
+
|
|
27
|
+
| Bundle | Commands | Use Case |
|
|
28
|
+
|--------|----------|----------|
|
|
29
|
+
| **Minimal** | 4 | Core learning only |
|
|
30
|
+
| **Standard** | 8 | + Context management |
|
|
31
|
+
|
|
32
|
+
## 🔧 Commands Reference
|
|
33
|
+
|
|
34
|
+
### 🧠 Learning
|
|
35
|
+
|
|
36
|
+
| Command | Description |
|
|
37
|
+
|---------|-------------|
|
|
38
|
+
| `/generate-memories` | Create persistent memories from session patterns |
|
|
39
|
+
| `/generate-rules` | Auto-generate .mdc rules from codebase analysis |
|
|
40
|
+
| `/self-heal` | Fix a bug and find/fix similar antipatterns |
|
|
41
|
+
| `/self-improve` | Learn from user patterns, evolve behavior |
|
|
42
|
+
|
|
43
|
+
### 📊 Context Management
|
|
44
|
+
|
|
45
|
+
| Command | Description |
|
|
46
|
+
|---------|-------------|
|
|
47
|
+
| `/context-prune` | Summarize progress, prevent context drift |
|
|
48
|
+
| `/orchestrate` | Multi-agent coordination for complex tasks |
|
|
49
|
+
| `/ask-clarification` | Request missing information before proceeding |
|
|
50
|
+
| `/smart-detection` | Auto-detect changes and make smart decisions |
|
|
51
|
+
|
|
52
|
+
## 💡 Example Usage
|
|
53
|
+
|
|
54
|
+
### Generate Memories from Session
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
/generate-memories
|
|
58
|
+
|
|
59
|
+
════════════════════════════════════════════════════════════════
|
|
60
|
+
MEMORY GENERATION
|
|
61
|
+
════════════════════════════════════════════════════════════════
|
|
62
|
+
|
|
63
|
+
📊 SESSION ANALYSIS
|
|
64
|
+
|
|
65
|
+
Patterns detected:
|
|
66
|
+
1. Used useWatch 5 times (consistent)
|
|
67
|
+
2. Applied AbortController pattern 3 times
|
|
68
|
+
3. Skipped optional docs
|
|
69
|
+
|
|
70
|
+
📝 PROPOSED MEMORIES
|
|
71
|
+
|
|
72
|
+
1. [Preference] React Hook Form
|
|
73
|
+
"Use useWatch hook instead of methods.watch()"
|
|
74
|
+
Create? (y/n)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Auto-Generate Rules
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
/generate-rules src/components
|
|
81
|
+
|
|
82
|
+
════════════════════════════════════════════════════════════════
|
|
83
|
+
PATTERN ANALYSIS RESULTS
|
|
84
|
+
════════════════════════════════════════════════════════════════
|
|
85
|
+
|
|
86
|
+
## Detected Patterns (423 files analyzed)
|
|
87
|
+
|
|
88
|
+
✅ Styled component namespace: 98% use `* as S`
|
|
89
|
+
✅ Feature folder structure: 87% follow standard
|
|
90
|
+
⚠️ Barrel files: 23% still use index.ts
|
|
91
|
+
|
|
92
|
+
📁 Created: .cursor/rules/component-patterns.mdc
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Self-Healing Bug Fix
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
/self-heal "TypeError: Cannot read property 'data' of null"
|
|
99
|
+
|
|
100
|
+
Root Cause: Race condition - component unmounted before async resolved
|
|
101
|
+
|
|
102
|
+
✅ Fixed: useBookingData.ts:45
|
|
103
|
+
✅ Found 5 similar patterns
|
|
104
|
+
✅ Applied fix to all occurrences
|
|
105
|
+
✅ Added to .cursor/rules/web-standards.mdc
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## 🛠️ CLI Commands
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npx cursor-ai-toolkit # Interactive install
|
|
112
|
+
npx cursor-ai-toolkit --bundle standard -y # Non-interactive
|
|
113
|
+
npx cursor-ai-toolkit status # Check installation
|
|
114
|
+
npx cursor-ai-toolkit list # List all commands
|
|
115
|
+
npx cursor-ai-toolkit help # Show help
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## 📂 Installation Structure
|
|
119
|
+
|
|
120
|
+
After installation:
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
.cursor/
|
|
124
|
+
└── commands/
|
|
125
|
+
├── generate-memories.md
|
|
126
|
+
├── generate-rules.md
|
|
127
|
+
├── self-heal.md
|
|
128
|
+
├── self-improve.md
|
|
129
|
+
├── context-prune.md
|
|
130
|
+
├── orchestrate.md
|
|
131
|
+
├── ask-clarification.md
|
|
132
|
+
└── smart-detection.md
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## 🤝 Works With
|
|
136
|
+
|
|
137
|
+
- [Buddy OS](https://github.com/sharath317/buddy-os) - Role-aware autonomous agent
|
|
138
|
+
- [Cursor Full-Flow](https://github.com/sharath317/cursor-full-flow) - Jira to PR automation
|
|
139
|
+
- [Cursor Quality Suite](https://github.com/sharath317/cursor-quality-suite) - Testing & quality
|
|
140
|
+
|
|
141
|
+
## 📄 License
|
|
142
|
+
|
|
143
|
+
MIT © Sharath Chandra
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
**Make your AI smarter with every interaction.**
|
|
148
|
+
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* cursor-ai-toolkit CLI
|
|
5
|
+
* AI Self-Improvement Commands for Cursor IDE
|
|
6
|
+
* Learning, Rules, and Context Management
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
|
+
const readline = require('readline');
|
|
12
|
+
|
|
13
|
+
const VERSION = '1.0.0';
|
|
14
|
+
const CURSOR_DIR = '.cursor';
|
|
15
|
+
const COMMANDS_DIR = 'commands';
|
|
16
|
+
|
|
17
|
+
const colors = {
|
|
18
|
+
reset: '\x1b[0m',
|
|
19
|
+
bold: '\x1b[1m',
|
|
20
|
+
dim: '\x1b[2m',
|
|
21
|
+
red: '\x1b[31m',
|
|
22
|
+
green: '\x1b[32m',
|
|
23
|
+
yellow: '\x1b[33m',
|
|
24
|
+
blue: '\x1b[34m',
|
|
25
|
+
magenta: '\x1b[35m',
|
|
26
|
+
cyan: '\x1b[36m',
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const log = {
|
|
30
|
+
info: (msg) => console.log(`${colors.cyan}ℹ${colors.reset} ${msg}`),
|
|
31
|
+
success: (msg) => console.log(`${colors.green}✓${colors.reset} ${msg}`),
|
|
32
|
+
warn: (msg) => console.log(`${colors.yellow}⚠${colors.reset} ${msg}`),
|
|
33
|
+
error: (msg) => console.log(`${colors.red}✗${colors.reset} ${msg}`),
|
|
34
|
+
step: (msg) => console.log(` ${colors.dim}→${colors.reset} ${msg}`),
|
|
35
|
+
header: (msg) => console.log(`\n${colors.bold}${colors.cyan}${msg}${colors.reset}\n`),
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const BUNDLES = {
|
|
39
|
+
minimal: {
|
|
40
|
+
name: 'Minimal (Core Learning)',
|
|
41
|
+
description: 'Essential self-improvement commands',
|
|
42
|
+
commands: ['learning'],
|
|
43
|
+
count: 4,
|
|
44
|
+
},
|
|
45
|
+
standard: {
|
|
46
|
+
name: 'Standard (Learning + Context)',
|
|
47
|
+
description: 'Learning with context management',
|
|
48
|
+
commands: ['learning', 'context'],
|
|
49
|
+
count: 8,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
function prompt(question, defaultValue = '') {
|
|
54
|
+
const rl = readline.createInterface({
|
|
55
|
+
input: process.stdin,
|
|
56
|
+
output: process.stdout,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const defaultText = defaultValue ? ` (${defaultValue})` : '';
|
|
60
|
+
|
|
61
|
+
return new Promise((resolve) => {
|
|
62
|
+
rl.question(`${question}${defaultText}: `, (answer) => {
|
|
63
|
+
rl.close();
|
|
64
|
+
resolve(answer || defaultValue);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function ensureDir(dir) {
|
|
70
|
+
if (!fs.existsSync(dir)) {
|
|
71
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function copyCommands(sourceDir, targetDir, categories) {
|
|
76
|
+
let copiedCount = 0;
|
|
77
|
+
|
|
78
|
+
categories.forEach((category) => {
|
|
79
|
+
const srcCategoryDir = path.join(sourceDir, category);
|
|
80
|
+
|
|
81
|
+
if (fs.existsSync(srcCategoryDir)) {
|
|
82
|
+
const files = fs.readdirSync(srcCategoryDir).filter((f) => f.endsWith('.md'));
|
|
83
|
+
|
|
84
|
+
files.forEach((file) => {
|
|
85
|
+
const srcFile = path.join(srcCategoryDir, file);
|
|
86
|
+
const tgtFile = path.join(targetDir, file);
|
|
87
|
+
|
|
88
|
+
if (!fs.existsSync(tgtFile)) {
|
|
89
|
+
fs.copyFileSync(srcFile, tgtFile);
|
|
90
|
+
log.step(`Installed: ${file}`);
|
|
91
|
+
copiedCount++;
|
|
92
|
+
} else {
|
|
93
|
+
log.step(`Exists: ${file} (skipped)`);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
return copiedCount;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
async function init(flags = {}) {
|
|
103
|
+
console.log(`
|
|
104
|
+
${colors.bold}${colors.cyan}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
105
|
+
🧠 CURSOR AI TOOLKIT v${VERSION}
|
|
106
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${colors.reset}
|
|
107
|
+
AI Self-Improvement: Learning, Rules & Context Management
|
|
108
|
+
|
|
109
|
+
`);
|
|
110
|
+
|
|
111
|
+
const projectDir = process.cwd();
|
|
112
|
+
const cursorDir = path.join(projectDir, CURSOR_DIR);
|
|
113
|
+
const commandsDir = path.join(cursorDir, COMMANDS_DIR);
|
|
114
|
+
|
|
115
|
+
log.header('📦 Select Command Bundle');
|
|
116
|
+
|
|
117
|
+
Object.entries(BUNDLES).forEach(([key, bundle], idx) => {
|
|
118
|
+
console.log(` ${idx + 1}. ${colors.bold}${bundle.name}${colors.reset}`);
|
|
119
|
+
console.log(` ${bundle.description} (${bundle.count} commands)\n`);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
let selectedBundle = 'standard';
|
|
123
|
+
if (!flags.bundle && !flags.yes) {
|
|
124
|
+
const bundleAnswer = await prompt('Select bundle (1-2)', '2');
|
|
125
|
+
selectedBundle = Object.keys(BUNDLES)[parseInt(bundleAnswer, 10) - 1] || 'standard';
|
|
126
|
+
} else if (flags.bundle) {
|
|
127
|
+
selectedBundle = flags.bundle;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const bundle = BUNDLES[selectedBundle];
|
|
131
|
+
log.success(`Selected: ${bundle.name}`);
|
|
132
|
+
|
|
133
|
+
log.header('📥 Installing Commands');
|
|
134
|
+
|
|
135
|
+
ensureDir(commandsDir);
|
|
136
|
+
|
|
137
|
+
const packageDir = path.dirname(__dirname);
|
|
138
|
+
const packageCommandsDir = path.join(packageDir, 'commands');
|
|
139
|
+
|
|
140
|
+
const copiedCount = copyCommands(packageCommandsDir, commandsDir, bundle.commands);
|
|
141
|
+
|
|
142
|
+
console.log(`
|
|
143
|
+
${colors.bold}${colors.green}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
144
|
+
✓ INSTALLATION COMPLETE
|
|
145
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${colors.reset}
|
|
146
|
+
|
|
147
|
+
${colors.cyan}Commands installed:${colors.reset} ${copiedCount}
|
|
148
|
+
${colors.cyan}Location:${colors.reset} ${commandsDir}
|
|
149
|
+
|
|
150
|
+
${colors.bold}Commands Reference:${colors.reset}
|
|
151
|
+
|
|
152
|
+
${colors.cyan}🧠 Learning${colors.reset}
|
|
153
|
+
/generate-memories Create persistent memories from patterns
|
|
154
|
+
/generate-rules Auto-generate .mdc rules from codebase
|
|
155
|
+
/self-heal Fix bugs and prevent similar issues
|
|
156
|
+
/self-improve Learn and evolve from user patterns
|
|
157
|
+
|
|
158
|
+
${colors.cyan}📊 Context${colors.reset}
|
|
159
|
+
/context-prune Manage context window, prevent drift
|
|
160
|
+
/orchestrate Multi-agent coordination
|
|
161
|
+
/ask-clarification Request missing information
|
|
162
|
+
/smart-detection Auto-detect changes and decisions
|
|
163
|
+
|
|
164
|
+
${colors.dim}Documentation: https://github.com/sharath317/cursor-ai-toolkit${colors.reset}
|
|
165
|
+
`);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
async function status() {
|
|
169
|
+
const projectDir = process.cwd();
|
|
170
|
+
const commandsDir = path.join(projectDir, CURSOR_DIR, COMMANDS_DIR);
|
|
171
|
+
|
|
172
|
+
if (!fs.existsSync(commandsDir)) {
|
|
173
|
+
log.warn('AI Toolkit not installed. Run: npx cursor-ai-toolkit');
|
|
174
|
+
process.exit(0);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const commands = fs.readdirSync(commandsDir).filter((f) => f.endsWith('.md'));
|
|
178
|
+
|
|
179
|
+
console.log(`
|
|
180
|
+
${colors.bold}${colors.cyan}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
181
|
+
📊 AI TOOLKIT STATUS
|
|
182
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${colors.reset}
|
|
183
|
+
|
|
184
|
+
${colors.cyan}Version:${colors.reset} ${VERSION}
|
|
185
|
+
${colors.cyan}Commands:${colors.reset} ${commands.length} installed
|
|
186
|
+
${colors.cyan}Location:${colors.reset} ${commandsDir}
|
|
187
|
+
|
|
188
|
+
${colors.bold}Installed Commands:${colors.reset}`);
|
|
189
|
+
|
|
190
|
+
commands.forEach((cmd) => {
|
|
191
|
+
console.log(` - /${cmd.replace('.md', '')}`);
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
console.log('');
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
async function listCommands() {
|
|
198
|
+
const packageDir = path.dirname(__dirname);
|
|
199
|
+
const packageCommandsDir = path.join(packageDir, 'commands');
|
|
200
|
+
|
|
201
|
+
console.log(`
|
|
202
|
+
${colors.bold}${colors.cyan}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
203
|
+
📋 AVAILABLE COMMANDS
|
|
204
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${colors.reset}
|
|
205
|
+
`);
|
|
206
|
+
|
|
207
|
+
const categories = ['learning', 'context'];
|
|
208
|
+
const icons = { learning: '🧠', context: '📊' };
|
|
209
|
+
|
|
210
|
+
categories.forEach((cat) => {
|
|
211
|
+
const catDir = path.join(packageCommandsDir, cat);
|
|
212
|
+
if (fs.existsSync(catDir)) {
|
|
213
|
+
console.log(`\n${icons[cat]} ${colors.bold}${cat.toUpperCase()}${colors.reset}`);
|
|
214
|
+
|
|
215
|
+
const files = fs.readdirSync(catDir).filter((f) => f.endsWith('.md'));
|
|
216
|
+
files.forEach((file) => {
|
|
217
|
+
const name = file.replace('.md', '');
|
|
218
|
+
console.log(` /${name}`);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
console.log('');
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function showHelp() {
|
|
227
|
+
console.log(`
|
|
228
|
+
${colors.bold}cursor-ai-toolkit v${VERSION}${colors.reset}
|
|
229
|
+
|
|
230
|
+
AI Self-Improvement Commands for Cursor IDE
|
|
231
|
+
|
|
232
|
+
${colors.bold}Usage:${colors.reset}
|
|
233
|
+
npx cursor-ai-toolkit [command] [options]
|
|
234
|
+
|
|
235
|
+
${colors.bold}Commands:${colors.reset}
|
|
236
|
+
init Install commands (default)
|
|
237
|
+
status Show current configuration
|
|
238
|
+
list List all available commands
|
|
239
|
+
help Show this help
|
|
240
|
+
|
|
241
|
+
${colors.bold}Options:${colors.reset}
|
|
242
|
+
--bundle Select bundle (minimal, standard)
|
|
243
|
+
-y, --yes Non-interactive mode
|
|
244
|
+
|
|
245
|
+
${colors.bold}Examples:${colors.reset}
|
|
246
|
+
npx cursor-ai-toolkit Interactive install
|
|
247
|
+
npx cursor-ai-toolkit --bundle standard Install all commands
|
|
248
|
+
npx cursor-ai-toolkit status Check installation
|
|
249
|
+
|
|
250
|
+
${colors.bold}After Installation:${colors.reset}
|
|
251
|
+
/generate-memories Create persistent memories
|
|
252
|
+
/generate-rules Auto-generate .mdc rules
|
|
253
|
+
/self-heal Fix bugs proactively
|
|
254
|
+
/context-prune Manage context window
|
|
255
|
+
|
|
256
|
+
${colors.dim}https://github.com/sharath317/cursor-ai-toolkit${colors.reset}
|
|
257
|
+
`);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
const args = process.argv.slice(2);
|
|
261
|
+
const flags = {};
|
|
262
|
+
let command = null;
|
|
263
|
+
const skipNextArg = new Set();
|
|
264
|
+
|
|
265
|
+
args.forEach((arg, idx) => {
|
|
266
|
+
if (arg === '--bundle' && args[idx + 1]) {
|
|
267
|
+
skipNextArg.add(idx + 1);
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
args.forEach((arg, idx) => {
|
|
272
|
+
if (skipNextArg.has(idx)) {
|
|
273
|
+
return;
|
|
274
|
+
} else if (arg === '-y' || arg === '--yes') {
|
|
275
|
+
flags.yes = true;
|
|
276
|
+
} else if (arg === '--bundle' && args[idx + 1]) {
|
|
277
|
+
flags.bundle = args[idx + 1];
|
|
278
|
+
} else if (!arg.startsWith('-') && command === null) {
|
|
279
|
+
command = arg;
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
switch (command) {
|
|
284
|
+
case 'init':
|
|
285
|
+
case null:
|
|
286
|
+
init(flags);
|
|
287
|
+
break;
|
|
288
|
+
case 'status':
|
|
289
|
+
status();
|
|
290
|
+
break;
|
|
291
|
+
case 'list':
|
|
292
|
+
listCommands();
|
|
293
|
+
break;
|
|
294
|
+
case 'help':
|
|
295
|
+
case '-h':
|
|
296
|
+
case '--help':
|
|
297
|
+
showHelp();
|
|
298
|
+
break;
|
|
299
|
+
default:
|
|
300
|
+
log.error(`Unknown command: ${command}`);
|
|
301
|
+
console.log('Run "npx cursor-ai-toolkit help" for usage');
|
|
302
|
+
process.exit(1);
|
|
303
|
+
}
|
|
304
|
+
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Guidelines for when to ask for clarification vs proceed with assumptions
|
|
3
|
+
category: Reference
|
|
4
|
+
aliases: [clarify, ask, question]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Ask Clarification - Request Missing Information
|
|
8
|
+
|
|
9
|
+
Guidelines for when and how to ask for more information during workflows.
|
|
10
|
+
|
|
11
|
+
## When to Ask for Clarification
|
|
12
|
+
|
|
13
|
+
### 🔴 Must Ask (Blocking)
|
|
14
|
+
|
|
15
|
+
| Situation | Example Question |
|
|
16
|
+
| ---------------------------- | ------------------------------------------------------------------ |
|
|
17
|
+
| Acceptance criteria is vague | "AC says 'improve tooltip' - what specific improvement is needed?" |
|
|
18
|
+
| Multiple valid approaches | "Should I use existing pattern A or pattern B for this?" |
|
|
19
|
+
| Breaking change potential | "This changes public API - is that acceptable?" |
|
|
20
|
+
| Missing design | "No Figma link found - can you share the design?" |
|
|
21
|
+
| Conflicting requirements | "AC #2 conflicts with AC #4 - which takes priority?" |
|
|
22
|
+
| Security/data handling | "This touches user data - any specific handling needed?" |
|
|
23
|
+
|
|
24
|
+
### 🟡 Should Ask (Important)
|
|
25
|
+
|
|
26
|
+
| Situation | Example Question |
|
|
27
|
+
| -------------------------- | ------------------------------------------------------------------------ |
|
|
28
|
+
| Edge cases not specified | "What should happen when display_name is empty string vs undefined?" |
|
|
29
|
+
| Performance considerations | "This could impact bundle size - is that acceptable?" |
|
|
30
|
+
| Scope creep risk | "Should I also update the related component, or create separate ticket?" |
|
|
31
|
+
| Test coverage unclear | "Should I add unit tests, integration tests, or both?" |
|
|
32
|
+
|
|
33
|
+
### 🟢 Can Proceed (Minor)
|
|
34
|
+
|
|
35
|
+
| Situation | What I Do |
|
|
36
|
+
| ----------------------------- | ------------------------------------ |
|
|
37
|
+
| Styling details not specified | Follow design system defaults |
|
|
38
|
+
| Naming conventions | Follow existing patterns in codebase |
|
|
39
|
+
| File organization | Follow project structure rules |
|
|
40
|
+
| Error message wording | Use existing patterns |
|
|
41
|
+
|
|
42
|
+
## Clarification Request Format
|
|
43
|
+
|
|
44
|
+
```markdown
|
|
45
|
+
## ❓ Clarification Needed
|
|
46
|
+
|
|
47
|
+
Before proceeding, I need some information:
|
|
48
|
+
|
|
49
|
+
### 1. [Category]: [Question]
|
|
50
|
+
|
|
51
|
+
**Context:** [Why I'm asking]
|
|
52
|
+
**Options:**
|
|
53
|
+
|
|
54
|
+
- A) [Option 1]
|
|
55
|
+
- B) [Option 2]
|
|
56
|
+
**My recommendation:** [If I have one]
|
|
57
|
+
|
|
58
|
+
### 2. [Category]: [Question]
|
|
59
|
+
|
|
60
|
+
...
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
Please provide answers, or say "proceed with recommendations" to use my suggested approach.
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Example Clarification Request
|
|
68
|
+
|
|
69
|
+
```markdown
|
|
70
|
+
## ❓ Clarification Needed
|
|
71
|
+
|
|
72
|
+
Before implementing TICKET-123, I need some information:
|
|
73
|
+
|
|
74
|
+
### 1. Edge Case Handling
|
|
75
|
+
|
|
76
|
+
**Context:** The AC says "use display_name when available"
|
|
77
|
+
**Question:** What should happen when display_name is an empty string ""?
|
|
78
|
+
**Options:**
|
|
79
|
+
|
|
80
|
+
- A) Treat empty string as "not available", use original name
|
|
81
|
+
- B) Show empty string (might look broken)
|
|
82
|
+
**My recommendation:** Option A (treat empty as missing)
|
|
83
|
+
|
|
84
|
+
### 2. Scope Confirmation
|
|
85
|
+
|
|
86
|
+
**Context:** I found similar code in PackagesV2.tsx that could benefit from this change
|
|
87
|
+
**Question:** Should I update PackagesV2.tsx in this ticket, or create a follow-up?
|
|
88
|
+
**Options:**
|
|
89
|
+
|
|
90
|
+
- A) Include in this ticket (more complete, slightly larger PR)
|
|
91
|
+
- B) Separate ticket (smaller PR, but temporary inconsistency)
|
|
92
|
+
**My recommendation:** Option A (avoid code duplication)
|
|
93
|
+
|
|
94
|
+
### 3. Test Coverage
|
|
95
|
+
|
|
96
|
+
**Context:** helpers.ts doesn't have existing tests
|
|
97
|
+
**Question:** Should I add unit tests for getModifiedLineItems?
|
|
98
|
+
**Options:**
|
|
99
|
+
|
|
100
|
+
- A) Yes, add comprehensive tests
|
|
101
|
+
- B) Skip tests (matches current state)
|
|
102
|
+
**My recommendation:** Option A if time permits
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
Please provide answers, or say "proceed with recommendations".
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Information Sufficiency Checklist
|
|
110
|
+
|
|
111
|
+
Before implementation, verify:
|
|
112
|
+
|
|
113
|
+
### Requirements
|
|
114
|
+
|
|
115
|
+
- [ ] Clear acceptance criteria (actionable, measurable)
|
|
116
|
+
- [ ] Edge cases defined (or I can make reasonable assumptions)
|
|
117
|
+
- [ ] Design available (Figma link or clear description)
|
|
118
|
+
- [ ] Backend contract clear (API response structure)
|
|
119
|
+
|
|
120
|
+
### Technical
|
|
121
|
+
|
|
122
|
+
- [ ] Know which files to modify
|
|
123
|
+
- [ ] Found existing patterns to follow
|
|
124
|
+
- [ ] Understand dependencies
|
|
125
|
+
- [ ] No blocking conflicts with open PRs
|
|
126
|
+
|
|
127
|
+
### Scope
|
|
128
|
+
|
|
129
|
+
- [ ] Clear boundaries (what's in/out of scope)
|
|
130
|
+
- [ ] Estimate is reasonable
|
|
131
|
+
- [ ] No hidden complexity discovered
|
|
132
|
+
|
|
133
|
+
## AI Execution
|
|
134
|
+
|
|
135
|
+
### At Start of /gather-context or /full-flow:
|
|
136
|
+
|
|
137
|
+
1. **Fetch all available information** (Jira, Figma, codebase)
|
|
138
|
+
|
|
139
|
+
2. **Run sufficiency check:**
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
For each checklist item:
|
|
143
|
+
- If info available → ✅
|
|
144
|
+
- If info missing but can assume → ⚠️ (note assumption)
|
|
145
|
+
- If info missing and blocking → ❓ (must ask)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
3. **If any ❓ items exist:**
|
|
149
|
+
|
|
150
|
+
- Generate clarification request
|
|
151
|
+
- Wait for user response
|
|
152
|
+
- Do NOT proceed until answered
|
|
153
|
+
|
|
154
|
+
4. **If only ⚠️ items:**
|
|
155
|
+
|
|
156
|
+
- List assumptions being made
|
|
157
|
+
- Ask: "Proceed with these assumptions? (y/n)"
|
|
158
|
+
|
|
159
|
+
5. **If all ✅:**
|
|
160
|
+
- Proceed with implementation
|
|
161
|
+
|
|
162
|
+
### Example Flow:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
📋 Gathering context for TICKET-123...
|
|
166
|
+
|
|
167
|
+
[... gather info ...]
|
|
168
|
+
|
|
169
|
+
════════════════════════════════════════════════════════════════
|
|
170
|
+
INFORMATION CHECK
|
|
171
|
+
════════════════════════════════════════════════════════════════
|
|
172
|
+
|
|
173
|
+
✅ Requirements
|
|
174
|
+
✅ Acceptance criteria: Clear (3 items)
|
|
175
|
+
⚠️ Edge cases: Assuming empty string = missing
|
|
176
|
+
✅ Design: Found Figma link
|
|
177
|
+
✅ Backend: BE-789 defines display_name field
|
|
178
|
+
|
|
179
|
+
✅ Technical
|
|
180
|
+
✅ Files to modify: 4 identified
|
|
181
|
+
✅ Patterns found: getModifiedLineItems, TooltipTitle
|
|
182
|
+
✅ Dependencies: None blocking
|
|
183
|
+
✅ Conflicts: No open PRs in same files
|
|
184
|
+
|
|
185
|
+
✅ Scope
|
|
186
|
+
⚠️ Boundaries: PackagesV2 also needs update (including)
|
|
187
|
+
✅ Estimate: Small (2-3 hours)
|
|
188
|
+
✅ Complexity: Low
|
|
189
|
+
|
|
190
|
+
════════════════════════════════════════════════════════════════
|
|
191
|
+
|
|
192
|
+
⚠️ Proceeding with assumptions:
|
|
193
|
+
1. Empty string display_name treated as missing (fallback to name)
|
|
194
|
+
2. PackagesV2.tsx included in scope (avoid duplication)
|
|
195
|
+
|
|
196
|
+
Proceed with these assumptions? (y/n)
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Handling Responses
|
|
200
|
+
|
|
201
|
+
### User says "y" or "proceed":
|
|
202
|
+
|
|
203
|
+
→ Continue with stated assumptions
|
|
204
|
+
|
|
205
|
+
### User says "n":
|
|
206
|
+
|
|
207
|
+
→ Ask which assumption is wrong
|
|
208
|
+
→ Get correct approach
|
|
209
|
+
→ Update plan and re-confirm
|
|
210
|
+
|
|
211
|
+
### User provides additional context:
|
|
212
|
+
|
|
213
|
+
→ Incorporate into understanding
|
|
214
|
+
→ Update plan
|
|
215
|
+
→ Re-run sufficiency check
|