prjct-cli 0.8.6 β 0.8.8
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/CHANGELOG.md +76 -0
- package/CLAUDE.md +34 -0
- package/core/agentic/context-builder.js +4 -3
- package/core/agentic/tool-registry.js +35 -0
- package/core/commands.js +84 -0
- package/core/infrastructure/legacy-installer-detector.js +546 -0
- package/core/infrastructure/session-manager.js +14 -2
- package/core/infrastructure/setup.js +29 -11
- package/core/utils/jsonl-helper.js +137 -0
- package/package.json +1 -1
- package/scripts/install.sh +45 -8
- package/scripts/postinstall.js +5 -5
- package/templates/agents/AGENTS.md +3 -3
- package/templates/commands/ask.md +25 -338
- package/templates/commands/build.md +7 -4
- package/templates/commands/feature.md +19 -160
- package/templates/commands/help.md +41 -299
- package/templates/commands/idea.md +7 -4
- package/templates/commands/init.md +15 -112
- package/templates/commands/migrate-all.md +25 -84
- package/templates/commands/now.md +4 -3
- package/templates/commands/ship.md +20 -86
- package/templates/commands/suggest.md +36 -495
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
const fs = require('fs').promises
|
|
2
|
+
const fsSync = require('fs')
|
|
3
|
+
const readline = require('readline')
|
|
4
|
+
const path = require('path')
|
|
2
5
|
|
|
3
6
|
/**
|
|
4
7
|
* JSONL Helper - Centralized JSONL parsing and writing
|
|
@@ -190,6 +193,134 @@ async function isJsonLinesEmpty(filePath) {
|
|
|
190
193
|
return count === 0
|
|
191
194
|
}
|
|
192
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Read JSONL file with streaming (memory-efficient for large files)
|
|
198
|
+
* Only reads last N lines instead of loading entire file
|
|
199
|
+
*
|
|
200
|
+
* @param {string} filePath - Path to JSONL file
|
|
201
|
+
* @param {number} maxLines - Maximum lines to read (default: 1000)
|
|
202
|
+
* @returns {Promise<Array<Object>>} - Array of parsed objects (last N lines)
|
|
203
|
+
*/
|
|
204
|
+
async function readJsonLinesStreaming(filePath, maxLines = 1000) {
|
|
205
|
+
try {
|
|
206
|
+
const fileStream = fsSync.createReadStream(filePath)
|
|
207
|
+
const rl = readline.createInterface({
|
|
208
|
+
input: fileStream,
|
|
209
|
+
crlfDelay: Infinity,
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
const lines = []
|
|
213
|
+
|
|
214
|
+
for await (const line of rl) {
|
|
215
|
+
if (line.trim()) {
|
|
216
|
+
try {
|
|
217
|
+
lines.push(JSON.parse(line))
|
|
218
|
+
} catch {
|
|
219
|
+
// Skip malformed lines
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Keep only last maxLines
|
|
223
|
+
if (lines.length > maxLines) {
|
|
224
|
+
lines.shift()
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return lines
|
|
230
|
+
} catch (error) {
|
|
231
|
+
if (error.code === 'ENOENT') {
|
|
232
|
+
return []
|
|
233
|
+
}
|
|
234
|
+
throw error
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Get file size in MB
|
|
240
|
+
*
|
|
241
|
+
* @param {string} filePath - Path to file
|
|
242
|
+
* @returns {Promise<number>} - File size in MB
|
|
243
|
+
*/
|
|
244
|
+
async function getFileSizeMB(filePath) {
|
|
245
|
+
try {
|
|
246
|
+
const stats = await fs.stat(filePath)
|
|
247
|
+
return stats.size / (1024 * 1024)
|
|
248
|
+
} catch (error) {
|
|
249
|
+
if (error.code === 'ENOENT') {
|
|
250
|
+
return 0
|
|
251
|
+
}
|
|
252
|
+
throw error
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Rotate JSONL file if it exceeds size limit
|
|
258
|
+
* Moves large file to archive with timestamp
|
|
259
|
+
*
|
|
260
|
+
* @param {string} filePath - Path to JSONL file
|
|
261
|
+
* @param {number} maxSizeMB - Maximum size in MB before rotation (default: 10)
|
|
262
|
+
* @returns {Promise<boolean>} - True if rotated, false if not needed
|
|
263
|
+
*/
|
|
264
|
+
async function rotateJsonLinesIfNeeded(filePath, maxSizeMB = 10) {
|
|
265
|
+
const sizeMB = await getFileSizeMB(filePath)
|
|
266
|
+
|
|
267
|
+
if (sizeMB < maxSizeMB) {
|
|
268
|
+
return false // No rotation needed
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
// Generate archive filename with timestamp
|
|
272
|
+
const timestamp = new Date().toISOString().split('T')[0] // YYYY-MM-DD
|
|
273
|
+
const dir = path.dirname(filePath)
|
|
274
|
+
const ext = path.extname(filePath)
|
|
275
|
+
const base = path.basename(filePath, ext)
|
|
276
|
+
const archivePath = path.join(dir, `${base}-${timestamp}${ext}`)
|
|
277
|
+
|
|
278
|
+
// Move file to archive
|
|
279
|
+
await fs.rename(filePath, archivePath)
|
|
280
|
+
|
|
281
|
+
console.log(`π¦ Rotated ${path.basename(filePath)} (${sizeMB.toFixed(1)}MB) β ${path.basename(archivePath)}`)
|
|
282
|
+
|
|
283
|
+
return true
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Append JSON line with automatic rotation
|
|
288
|
+
* Checks file size before append and rotates if needed
|
|
289
|
+
*
|
|
290
|
+
* @param {string} filePath - Path to JSONL file
|
|
291
|
+
* @param {Object} object - Object to append
|
|
292
|
+
* @param {number} maxSizeMB - Maximum size before rotation (default: 10)
|
|
293
|
+
* @returns {Promise<void>}
|
|
294
|
+
*/
|
|
295
|
+
async function appendJsonLineWithRotation(filePath, object, maxSizeMB = 10) {
|
|
296
|
+
// Rotate if needed (before appending)
|
|
297
|
+
await rotateJsonLinesIfNeeded(filePath, maxSizeMB)
|
|
298
|
+
|
|
299
|
+
// Append normally
|
|
300
|
+
await appendJsonLine(filePath, object)
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Warn if file is large before reading
|
|
305
|
+
* Returns size and whether it's considered large
|
|
306
|
+
*
|
|
307
|
+
* @param {string} filePath - Path to file
|
|
308
|
+
* @param {number} warnThresholdMB - Threshold in MB to warn (default: 50)
|
|
309
|
+
* @returns {Promise<{sizeMB: number, isLarge: boolean}>}
|
|
310
|
+
*/
|
|
311
|
+
async function checkFileSizeWarning(filePath, warnThresholdMB = 50) {
|
|
312
|
+
const sizeMB = await getFileSizeMB(filePath)
|
|
313
|
+
const isLarge = sizeMB > warnThresholdMB
|
|
314
|
+
|
|
315
|
+
if (isLarge) {
|
|
316
|
+
console.warn(
|
|
317
|
+
`β οΈ Large file detected: ${path.basename(filePath)} (${sizeMB.toFixed(1)}MB). Reading may use significant memory.`
|
|
318
|
+
)
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
return { sizeMB, isLarge }
|
|
322
|
+
}
|
|
323
|
+
|
|
193
324
|
module.exports = {
|
|
194
325
|
parseJsonLines,
|
|
195
326
|
stringifyJsonLines,
|
|
@@ -203,4 +334,10 @@ module.exports = {
|
|
|
203
334
|
getFirstJsonLines,
|
|
204
335
|
mergeJsonLines,
|
|
205
336
|
isJsonLinesEmpty,
|
|
337
|
+
// NEW: Memory-efficient functions
|
|
338
|
+
readJsonLinesStreaming,
|
|
339
|
+
getFileSizeMB,
|
|
340
|
+
rotateJsonLinesIfNeeded,
|
|
341
|
+
appendJsonLineWithRotation,
|
|
342
|
+
checkFileSizeWarning,
|
|
206
343
|
}
|
package/package.json
CHANGED
package/scripts/install.sh
CHANGED
|
@@ -9,22 +9,59 @@
|
|
|
9
9
|
YELLOW='\033[1;33m'
|
|
10
10
|
CYAN='\033[0;36m'
|
|
11
11
|
GREEN='\033[0;32m'
|
|
12
|
+
RED='\033[0;31m'
|
|
13
|
+
BOLD='\033[1m'
|
|
14
|
+
DIM='\033[2m'
|
|
12
15
|
NC='\033[0m'
|
|
13
16
|
|
|
17
|
+
# Check if legacy installation exists
|
|
18
|
+
LEGACY_DIR="$HOME/.prjct-cli"
|
|
19
|
+
HAS_LEGACY=false
|
|
20
|
+
LEGACY_VERSION="unknown"
|
|
21
|
+
|
|
22
|
+
if [ -d "$LEGACY_DIR" ]; then
|
|
23
|
+
# Check if it's a git clone (legacy curl install)
|
|
24
|
+
if [ -d "$LEGACY_DIR/.git" ]; then
|
|
25
|
+
HAS_LEGACY=true
|
|
26
|
+
if [ -f "$LEGACY_DIR/package.json" ]; then
|
|
27
|
+
LEGACY_VERSION=$(grep -o '"version":[[:space:]]*"[^"]*"' "$LEGACY_DIR/package.json" | head -1 | cut -d'"' -f4)
|
|
28
|
+
fi
|
|
29
|
+
fi
|
|
30
|
+
fi
|
|
31
|
+
|
|
14
32
|
echo ""
|
|
15
33
|
echo -e "${YELLOW}ββββββββββββββββββββββββββββββββββββββββ${NC}"
|
|
16
34
|
echo -e "${YELLOW}β οΈ This installation method is DEPRECATED${NC}"
|
|
17
35
|
echo -e "${YELLOW}ββββββββββββββββββββββββββββββββββββββββ${NC}"
|
|
18
36
|
echo ""
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
echo -e "
|
|
22
|
-
echo ""
|
|
23
|
-
echo -e "
|
|
24
|
-
echo -e "
|
|
25
|
-
echo
|
|
26
|
-
echo -e "
|
|
37
|
+
|
|
38
|
+
if [ "$HAS_LEGACY" = true ]; then
|
|
39
|
+
echo -e "${RED}β οΈ Legacy curl installation detected!${NC}"
|
|
40
|
+
echo ""
|
|
41
|
+
echo -e " ${DIM}Version: ${LEGACY_VERSION}${NC}"
|
|
42
|
+
echo -e " ${DIM}Location: ~/.prjct-cli/${NC}"
|
|
43
|
+
echo ""
|
|
44
|
+
echo -e "${CYAN}Migration Required:${NC}"
|
|
45
|
+
echo ""
|
|
46
|
+
echo -e " 1. ${BOLD}Install via npm:${NC}"
|
|
47
|
+
echo -e " ${GREEN}npm install -g prjct-cli${NC}"
|
|
48
|
+
echo ""
|
|
49
|
+
echo -e " 2. ${BOLD}Automatic cleanup:${NC}"
|
|
50
|
+
echo -e " ${DIM}Legacy installation will be cleaned automatically${NC}"
|
|
51
|
+
echo -e " ${DIM}Your project data will be preserved${NC}"
|
|
52
|
+
echo ""
|
|
53
|
+
else
|
|
54
|
+
echo -e "${CYAN}Please install using npm:${NC}"
|
|
55
|
+
echo ""
|
|
56
|
+
echo -e " ${GREEN}npm install -g prjct-cli${NC}"
|
|
57
|
+
echo ""
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
echo -e "${BOLD}Benefits of npm installation:${NC}"
|
|
61
|
+
echo -e " β’ ${CYAN}Automatic cleanup${NC} - Removes old curl installations"
|
|
62
|
+
echo -e " β’ ${CYAN}Data preservation${NC} - Your projects are migrated safely"
|
|
27
63
|
echo -e " β’ ${CYAN}Easy updates${NC} - Just npm update -g prjct-cli"
|
|
64
|
+
echo -e " β’ ${CYAN}Proper versioning${NC} - npm handles everything"
|
|
28
65
|
echo ""
|
|
29
66
|
echo -e "${YELLOW}ββββββββββββββββββββββββββββββββββββββββ${NC}"
|
|
30
67
|
echo ""
|
package/scripts/postinstall.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Post-install hook for prjct-cli (OPTIONAL)
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Attempts to run setup if npm scripts are enabled.
|
|
7
|
+
* If it fails or doesn't run, no problem - setup will run
|
|
8
|
+
* automatically on first CLI use (like Astro, Vite, etc.)
|
|
9
9
|
*
|
|
10
|
-
*
|
|
10
|
+
* This hook is an optimization but NOT critical.
|
|
11
11
|
*
|
|
12
|
-
* @version 0.8.
|
|
12
|
+
* @version 0.8.8
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
const path = require('path')
|
|
@@ -167,13 +167,13 @@ Semantic understanding, not pattern matching.
|
|
|
167
167
|
|
|
168
168
|
| Intent | Command | Examples |
|
|
169
169
|
| ---------- | ---------- | -------------------------------------------- |
|
|
170
|
-
| Start task | `/p:now` | "work on X", "starting API", "
|
|
171
|
-
| Finish | `/p:done` | "done", "finished", "
|
|
170
|
+
| Start task | `/p:now` | "work on X", "starting API", "begin auth" |
|
|
171
|
+
| Finish | `/p:done` | "done", "finished", "completed", "all set" |
|
|
172
172
|
| Ship | `/p:ship` | "ship this", "deploy X", "it's ready" |
|
|
173
173
|
| Idea | `/p:idea` | "I have an idea", "what if we..." |
|
|
174
174
|
| Progress | `/p:recap` | "show progress", "how am I doing" |
|
|
175
175
|
| Stuck | `/p:stuck` | "I'm stuck", "help with X" |
|
|
176
|
-
| Next | `/p:next` | "what's next", "
|
|
176
|
+
| Next | `/p:next` | "what's next", "show queue", "priority list" |
|
|
177
177
|
|
|
178
178
|
**Any language works** - if you understand intent, execute the command.
|
|
179
179
|
|
|
@@ -7,380 +7,67 @@ description: 'Conversational intent to action translator - helps users understan
|
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
9
9
|
|
|
10
|
-
Translate natural language intent into actionable prjct command flows. Helps users who know WHAT they want but don't know HOW
|
|
11
|
-
|
|
12
|
-
## Usage
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
/p:ask "<what you want to do>"
|
|
16
|
-
```
|
|
10
|
+
Translate natural language intent into actionable prjct command flows. Helps users who know WHAT they want but don't know HOW.
|
|
17
11
|
|
|
18
12
|
## Flow
|
|
19
13
|
|
|
20
14
|
1. **Understand intent**: Parse user's natural language description
|
|
21
|
-
2. **Analyze context**: Read project state (core/now.md
|
|
15
|
+
2. **Analyze context**: Read project state (`core/now.md`, `core/next.md`, `planning/roadmap.md`)
|
|
22
16
|
3. **Recommend flow**: Suggest specific command sequence with explanations
|
|
23
|
-
4. **
|
|
24
|
-
5. **Ask confirmation**: Interactive - don't execute automatically
|
|
17
|
+
4. **Ask confirmation**: Interactive - don't execute automatically
|
|
25
18
|
|
|
26
19
|
## Intent Categories
|
|
27
20
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
### 1. Feature Development
|
|
31
|
-
Keywords: "add", "implement", "create", "build", "agregar", "implementar", "crear"
|
|
21
|
+
**1. Feature Development**: "add", "implement", "create", "build"
|
|
22
|
+
β `/p:feature "{desc}"` β `/p:done` (iterate) β `/p:ship "{name}"`
|
|
32
23
|
|
|
33
|
-
**
|
|
34
|
-
|
|
35
|
-
1. /p:feature "{description}"
|
|
36
|
-
β Value analysis (impact/effort/timing)
|
|
37
|
-
β Task breakdown
|
|
38
|
-
β Auto-start first task
|
|
39
|
-
|
|
40
|
-
2. /p:done (after each task)
|
|
41
|
-
|
|
42
|
-
3. /p:ship "{feature name}" (when complete)
|
|
43
|
-
```
|
|
24
|
+
**2. Performance/Optimization**: "optimize", "improve", "faster", "memory leak"
|
|
25
|
+
β `/p:feature "optimize {area}"` β `/p:build 1` β `/p:done` β `/p:ship "optimization"`
|
|
44
26
|
|
|
45
|
-
|
|
46
|
-
|
|
27
|
+
**3. Bug Fixing**: "bug", "error", "fix", "broken", "not working"
|
|
28
|
+
β `/p:bug "{desc}"` β `/p:build "{bug task}"` β `/p:done` β `/p:ship "bug fixes"`
|
|
47
29
|
|
|
48
|
-
**
|
|
49
|
-
|
|
50
|
-
1. /p:feature "optimize {area}"
|
|
51
|
-
β Break down into measurable tasks:
|
|
52
|
-
β’ Profile and identify bottlenecks
|
|
53
|
-
β’ Implement specific optimizations
|
|
54
|
-
β’ Measure improvements
|
|
55
|
-
β’ Document findings
|
|
56
|
-
|
|
57
|
-
2. /p:build 1 (start with profiling)
|
|
58
|
-
|
|
59
|
-
3. /p:done (iterate through tasks)
|
|
60
|
-
|
|
61
|
-
4. /p:ship "performance optimization"
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### 3. Bug Fixing
|
|
65
|
-
Keywords: "bug", "error", "fix", "broken", "not working", "arreglar", "error"
|
|
66
|
-
|
|
67
|
-
**Recommended flow:**
|
|
68
|
-
```
|
|
69
|
-
1. /p:bug "{description}"
|
|
70
|
-
β Auto-prioritized based on severity
|
|
71
|
-
β Added to queue
|
|
30
|
+
**4. Design/Architecture**: "design", "architecture", "structure", "plan"
|
|
31
|
+
β `/p:design {target} --type {architecture|api|component|database|flow}` β `/p:feature "implement {design}"` β `/p:build 1`
|
|
72
32
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
3. /p:done (when fixed)
|
|
76
|
-
|
|
77
|
-
4. /p:ship "bug fixes" (if part of larger batch)
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### 4. Design/Architecture
|
|
81
|
-
Keywords: "design", "architecture", "structure", "plan", "diseΓ±ar", "arquitectura"
|
|
82
|
-
|
|
83
|
-
**Recommended flow:**
|
|
84
|
-
```
|
|
85
|
-
1. /p:design {target} --type {architecture|api|component|database|flow}
|
|
86
|
-
β Create design document
|
|
87
|
-
β Plan implementation
|
|
88
|
-
|
|
89
|
-
2. /p:feature "implement {design}"
|
|
90
|
-
β Convert design to tasks
|
|
91
|
-
|
|
92
|
-
3. /p:build 1 (start implementation)
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### 5. Lost/Confused
|
|
96
|
-
Keywords: "don't know", "help", "stuck", "what should", "no sΓ©", "ayuda"
|
|
97
|
-
|
|
98
|
-
**Recommended flow:**
|
|
99
|
-
```
|
|
100
|
-
1. /p:suggest
|
|
101
|
-
β Context-aware recommendations
|
|
102
|
-
β Shows current state
|
|
103
|
-
β Suggests next best action
|
|
104
|
-
|
|
105
|
-
OR
|
|
106
|
-
|
|
107
|
-
2. /p:help
|
|
108
|
-
β Interactive guide
|
|
109
|
-
β Shows available commands
|
|
110
|
-
β Examples
|
|
111
|
-
```
|
|
33
|
+
**5. Lost/Confused**: "don't know", "help", "stuck", "what should"
|
|
34
|
+
β `/p:suggest` (context-aware recommendations) OR `/p:help` (interactive guide)
|
|
112
35
|
|
|
113
36
|
## Response Format
|
|
114
37
|
|
|
115
38
|
```
|
|
116
39
|
βββββββββββββββββββββββββββ
|
|
117
|
-
π―
|
|
40
|
+
π― I understand: {interpreted_intent}
|
|
118
41
|
βββββββββββββββββββββββββββ
|
|
119
42
|
|
|
120
|
-
π
|
|
121
|
-
β’
|
|
122
|
-
β’
|
|
123
|
-
β’
|
|
43
|
+
π YOUR CONTEXT:
|
|
44
|
+
β’ Current state: {current_state}
|
|
45
|
+
β’ Active tasks: {active_tasks}
|
|
46
|
+
β’ Last ship: {time_ago}
|
|
124
47
|
|
|
125
48
|
βββββββββββββββββββββββββββ
|
|
126
49
|
|
|
127
|
-
π‘
|
|
50
|
+
π‘ RECOMMENDED FLOW:
|
|
128
51
|
|
|
129
52
|
{step_by_step_command_flow}
|
|
130
53
|
|
|
131
|
-
|
|
54
|
+
Each step explained:
|
|
132
55
|
β {command_1}: {why_this_command}
|
|
133
56
|
β {command_2}: {what_it_does}
|
|
134
57
|
β {command_3}: {expected_outcome}
|
|
135
58
|
|
|
136
59
|
βββββββββββββββββββββββββββ
|
|
137
60
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
"{similar_example_1}"
|
|
141
|
-
"{similar_example_2}"
|
|
142
|
-
|
|
143
|
-
βββββββββββββββββββββββββββ
|
|
144
|
-
|
|
145
|
-
ΒΏQuieres que ejecute el paso 1?
|
|
146
|
-
[SΓ] [No, solo dame las tareas] [Necesito mΓ‘s ayuda]
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
## Examples
|
|
150
|
-
|
|
151
|
-
### Example 1: Performance Optimization
|
|
152
|
-
|
|
153
|
-
**Input:**
|
|
154
|
-
```
|
|
155
|
-
/p:ask "quiero mejorar el performance y evitar memory leaks"
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
**Output:**
|
|
159
|
-
```
|
|
160
|
-
βββββββββββββββββββββββββββ
|
|
161
|
-
π― Entiendo: optimizaciΓ³n de performance + soluciΓ³n de memory leaks
|
|
162
|
-
βββββββββββββββββββββββββββ
|
|
163
|
-
|
|
164
|
-
π TU CONTEXTO:
|
|
165
|
-
β’ Estado actual: sin tarea activa
|
|
166
|
-
β’ Tareas en cola: 3
|
|
167
|
-
β’ Γltimo ship: hace 2 dΓas
|
|
168
|
-
|
|
169
|
-
βββββββββββββββββββββββββββ
|
|
170
|
-
|
|
171
|
-
π‘ RECOMENDACIΓN DE FLUJO:
|
|
172
|
-
|
|
173
|
-
1. /p:feature "optimizar performance y memory leaks"
|
|
174
|
-
|
|
175
|
-
Claude analizarΓ‘ y crearΓ‘ tareas como:
|
|
176
|
-
β’ Setup profiler (Chrome DevTools/React DevTools)
|
|
177
|
-
β’ Identificar memory leaks con heap snapshots
|
|
178
|
-
β’ Optimizar re-renders innecesarios
|
|
179
|
-
β’ Implementar memoization (useMemo, useCallback)
|
|
180
|
-
β’ Code splitting para reducir bundle size
|
|
181
|
-
β’ Medir mejoras y documentar
|
|
182
|
-
|
|
183
|
-
2. /p:build 1
|
|
184
|
-
β Empezar con el profiling (necesitas datos primero)
|
|
185
|
-
|
|
186
|
-
3. /p:done
|
|
187
|
-
β DespuΓ©s de cada tarea completada
|
|
188
|
-
|
|
189
|
-
4. /p:ship "performance optimization"
|
|
190
|
-
β Cuando hayas terminado todas las mejoras
|
|
191
|
-
|
|
192
|
-
βββββββββββββββββββββββββββ
|
|
193
|
-
|
|
194
|
-
β¨ POR QUΓ ESTE FLUJO:
|
|
195
|
-
|
|
196
|
-
β /p:feature: Analiza el valor (impacto alto, esfuerzo medio)
|
|
197
|
-
Recomienda timing (hacer ahora antes de mΓ‘s features)
|
|
198
|
-
Breakdown inteligente (primero medir, luego optimizar)
|
|
199
|
-
|
|
200
|
-
β /p:build: Asigna agente apropiado (probablemente FE)
|
|
201
|
-
Tracking de tiempo
|
|
202
|
-
Focus en una tarea a la vez
|
|
203
|
-
|
|
204
|
-
β /p:done: Registra progreso
|
|
205
|
-
Mantiene momentum
|
|
206
|
-
Mueve a siguiente tarea
|
|
207
|
-
|
|
208
|
-
β /p:ship: Commit + push + celebraciΓ³n
|
|
209
|
-
Actualiza docs
|
|
210
|
-
Registra el logro
|
|
211
|
-
|
|
212
|
-
βββββββββββββββββββββββββββ
|
|
213
|
-
|
|
214
|
-
ΒΏEmpezamos con /p:feature para analizar el valor y crear las tareas?
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
### Example 2: New Feature
|
|
218
|
-
|
|
219
|
-
**Input:**
|
|
220
|
-
```
|
|
221
|
-
/p:ask "I want to add user authentication"
|
|
61
|
+
Would you like me to execute step 1?
|
|
222
62
|
```
|
|
223
63
|
|
|
224
|
-
**Output:**
|
|
225
|
-
```
|
|
226
|
-
βββββββββββββββββββββββββββ
|
|
227
|
-
π― I understand: implement user authentication system
|
|
228
|
-
βββββββββββββββββββββββββββ
|
|
229
|
-
|
|
230
|
-
π YOUR CONTEXT:
|
|
231
|
-
β’ Current state: working on "navbar redesign"
|
|
232
|
-
β’ Queue: 2 tasks
|
|
233
|
-
β’ Last ship: 1 day ago
|
|
234
|
-
|
|
235
|
-
βββββββββββββββββββββββββββ
|
|
236
|
-
|
|
237
|
-
β οΈ IMPORTANTE: Tienes tarea activa
|
|
238
|
-
|
|
239
|
-
Opciones:
|
|
240
|
-
|
|
241
|
-
A) TERMINAR PRIMERO (Recomendado)
|
|
242
|
-
1. /p:done β Terminar "navbar redesign"
|
|
243
|
-
2. /p:feature "user authentication"
|
|
244
|
-
3. /p:build 1 β Empezar auth
|
|
245
|
-
|
|
246
|
-
B) GUARDAR PARA DESPUΓS
|
|
247
|
-
1. /p:feature "user authentication"
|
|
248
|
-
β Se agrega a la cola
|
|
249
|
-
2. ContinΓΊa con navbar
|
|
250
|
-
3. /p:done cuando termines navbar
|
|
251
|
-
4. /p:build "authentication" cuando estΓ©s listo
|
|
252
|
-
|
|
253
|
-
βββββββββββββββββββββββββββ
|
|
254
|
-
|
|
255
|
-
π‘ RECOMENDACIΓN:
|
|
256
|
-
|
|
257
|
-
Termina navbar primero (mantiene focus)
|
|
258
|
-
Luego /p:feature "authentication" harΓ‘:
|
|
259
|
-
|
|
260
|
-
β’ AnΓ‘lisis de valor (impacto: HIGH)
|
|
261
|
-
β’ Stack analysis (sugiere: Clerk, Auth0, o custom JWT)
|
|
262
|
-
β’ Task breakdown:
|
|
263
|
-
- Setup auth provider
|
|
264
|
-
- Implement login/signup UI
|
|
265
|
-
- Protected routes
|
|
266
|
-
- Session management
|
|
267
|
-
- Testing
|
|
268
|
-
|
|
269
|
-
β’ Auto-start primera tarea
|
|
270
|
-
|
|
271
|
-
βββββββββββββββββββββββββββ
|
|
272
|
-
|
|
273
|
-
ΒΏQuΓ© prefieres: A) Terminar navbar primero, o B) Agregar a cola?
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
### Example 3: Lost/Confused
|
|
277
|
-
|
|
278
|
-
**Input:**
|
|
279
|
-
```
|
|
280
|
-
/p:ask "no sΓ© quΓ© hacer ahora"
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
**Output:**
|
|
284
|
-
```
|
|
285
|
-
βββββββββββββββββββββββββββ
|
|
286
|
-
π― Entiendo: necesitas orientaciΓ³n sobre quΓ© hacer
|
|
287
|
-
βββββββββββββββββββββββββββ
|
|
288
|
-
|
|
289
|
-
π TU CONTEXTO:
|
|
290
|
-
β’ Estado actual: sin tarea activa β
|
|
291
|
-
β’ Tareas en cola: 5 tareas esperando
|
|
292
|
-
β’ Γltimo ship: hace 4 dΓas β οΈ
|
|
293
|
-
|
|
294
|
-
βββββββββββββββββββββββββββ
|
|
295
|
-
|
|
296
|
-
π‘ TE RECOMIENDO:
|
|
297
|
-
|
|
298
|
-
1. VER TU COLA DE TAREAS
|
|
299
|
-
/p:next
|
|
300
|
-
β Muestra las 5 tareas top priority
|
|
301
|
-
β Ya estΓ‘n priorizadas y listas para trabajar
|
|
302
|
-
|
|
303
|
-
2. EMPEZAR LA TAREA #1
|
|
304
|
-
/p:build 1
|
|
305
|
-
β Empieza automΓ‘ticamente la tarea top priority
|
|
306
|
-
β Asigna agente apropiado
|
|
307
|
-
β Tracking de tiempo
|
|
308
|
-
|
|
309
|
-
3. VER SUGERENCIAS INTELIGENTES
|
|
310
|
-
/p:suggest
|
|
311
|
-
β Analiza tu contexto completo
|
|
312
|
-
β Recomienda basado en:
|
|
313
|
-
- Tiempo sin ship (4 dΓas)
|
|
314
|
-
- Velocidad reciente
|
|
315
|
-
- Urgencias
|
|
316
|
-
|
|
317
|
-
βββββββββββββββββββββββββββ
|
|
318
|
-
|
|
319
|
-
π― MI SUGERENCIA ESPECΓFICA:
|
|
320
|
-
|
|
321
|
-
Han pasado 4 dΓas sin ship β Es momento de completar algo
|
|
322
|
-
|
|
323
|
-
OpciΓ³n A: Trabaja en tareas de cola
|
|
324
|
-
/p:next β /p:build 1 β /p:done β /p:ship
|
|
325
|
-
|
|
326
|
-
OpciΓ³n B: Crea algo nuevo rΓ‘pido
|
|
327
|
-
/p:feature "quick win" β /p:build 1 β ship today
|
|
328
|
-
|
|
329
|
-
βββββββββββββββββββββββββββ
|
|
330
|
-
|
|
331
|
-
ΒΏQuΓ© prefieres?
|
|
332
|
-
1. Ver quΓ© hay en cola (/p:next)
|
|
333
|
-
2. Sugerencias personalizadas (/p:suggest)
|
|
334
|
-
3. Contarme quΓ© tienes en mente
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
## Key Principles
|
|
338
|
-
|
|
339
|
-
1. **Conversational**: Natural language, not technical
|
|
340
|
-
2. **Educational**: Explain WHY each command
|
|
341
|
-
3. **Contextual**: Always check project state first
|
|
342
|
-
4. **Interactive**: Ask confirmation, offer choices
|
|
343
|
-
5. **No auto-execution**: Show the path, let user decide
|
|
344
|
-
6. **Bilingual**: Support English and Spanish naturally
|
|
345
|
-
7. **Examples**: Show similar use cases when relevant
|
|
346
|
-
|
|
347
64
|
## Validation
|
|
348
65
|
|
|
349
|
-
- **Optional**: Can run without project initialized
|
|
350
|
-
- **If not initialized**: Suggest `/p:init` first
|
|
66
|
+
- **Optional**: Can run without project initialized (suggests `/p:init` if needed)
|
|
351
67
|
- **Read-only**: Never modifies files, only recommends
|
|
352
68
|
|
|
353
69
|
## Edge Cases
|
|
354
70
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
First, initialize:
|
|
360
|
-
/p:init # For existing project
|
|
361
|
-
/p:init "your idea" # For new project
|
|
362
|
-
|
|
363
|
-
Then I can help you!
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
### Very vague request
|
|
367
|
-
```
|
|
368
|
-
π€ Puedes darme mΓ‘s detalles?
|
|
369
|
-
|
|
370
|
-
QuΓ© quieres hacer:
|
|
371
|
-
β’ Agregar nueva funcionalidad?
|
|
372
|
-
β’ Arreglar algo que no funciona?
|
|
373
|
-
β’ Mejorar el cΓ³digo existente?
|
|
374
|
-
β’ No estΓ‘s seguro?
|
|
375
|
-
|
|
376
|
-
CuΓ©ntame mΓ‘s y te ayudo a encontrar el comando correcto!
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
## Success Criteria
|
|
380
|
-
|
|
381
|
-
After using `/p:ask`, user should:
|
|
382
|
-
- β
Understand WHAT commands to use
|
|
383
|
-
- β
Understand WHY those commands
|
|
384
|
-
- β
Understand the SEQUENCE of actions
|
|
385
|
-
- β
Feel confident to proceed
|
|
386
|
-
- β
Learn the system while using it
|
|
71
|
+
**No prjct project**: Suggest `/p:init` or `/p:init "idea"` first
|
|
72
|
+
**Vague request**: Ask for more details - feature? bug? optimization? not sure?
|
|
73
|
+
**Active task exists**: Offer options - finish first (recommended) or add to queue
|